Click or drag to resize

clsImportProjectContract Class

Data holder to import a sales contract linked to a project

import from the MS Access table MARIProjektImportProjectContracts

Use MPInterface.bImportContract(clsImportProjectContract, clsImportBaseeImportMode) to import.

>You can directly add clsImportProjectContractPosition to the property ListOfContractPositions addition contract positions.

Inheritance Hierarchy
SystemObject
  MARIInterfaceclsImportBase
    MARIInterfaceclsImportProjectContract
      MARIInterfaceclsImportProjectPurchaseProcesses

Namespace:  MARIInterface
Assembly:  MARIInterface (in MARIInterface.dll) Version: 8.0.0.100
Syntax
public class clsImportProjectContract : clsImportBase

The clsImportProjectContract type exposes the following members.

Constructors
  NameDescription
Public methodclsImportProjectContract
Initializes a new instance of the clsImportProjectContract class
Top
Properties
  NameDescription
Public propertyA0AdditionalInfo
Billing Address: Line 3
Public propertyA0AdressLineNum
Integer
Public propertyA0AdressName
VARCHAR(50)
Public propertyA0AdressName2
VARCHAR(50)
Public propertyA0AdressName3
VARCHAR(50)
Public propertyA0Building
Block VARCHAR(100)
Public propertyA0City
Billing Address: City Name
Public propertyA0ContactPersonID
INT: Link to the contact persons (OCPR.CntctCode)
Public propertyA0Country
Billing Address: ISO Country Code USA, DE
Public propertyA0Matchcode
Billing Address: Name of address
Public propertyA0Name1
Billing Address: Name 1
Public propertyA0Name2
Billing Address: Name 2
Public propertyA0Region
County VARCHAR(100)
Public propertyA0State
VARCHAR(3)
Public propertyA0Street
Billing Address
Public propertyA0StreetNumber
Billing Address
Public propertyA0Title
Billing Address: Salutation
Public propertyA0ZIPCode
Billing Address: ZIP Code
Public propertyA1AdditionalInfo
ShipTo Line 3
Public propertyA1AdressLineNum
Integer
Public propertyA1AdressName
VARCHAR(50)
Public propertyA1AdressName2
VARCHAR(50)
Public propertyA1AdressName3
VARCHAR(50)
Public propertyA1Building
Block VARCHAR(100)
Public propertyA1BusinessPartner
Ship to code (OCRD.CardCode)
Public propertyA1City
VARCHAR(100)
Public propertyA1ContactPersonID
INT: Link to the contact persons
Public propertyA1Country
ShipTo: Country Code ISO USA, DE
Public propertyA1Matchcode
ShipTo
Public propertyA1Name1
ShipTo
Public propertyA1Name2
ShipTo
Public propertyA1Region
ShipTo County
Public propertyA1State
VARCHAR(3)
Public propertyA1Street
ShipTo
Public propertyA1StreetNumber
ShipTo
Public propertyA1Title
ShipTo Salutation
Public propertyA1ZIPCode
VARCHAR(20)
Public propertyBaseContractID
INT: Link to a base contact (Indent=0, Main Contract)
Public propertyChangeDate
Changing date
Public propertyChangeUserID
VARCHAR(4) User initials, which has made the change
Public propertyCompanyID
Company ID [Mandantory]. Link to the logical link of the SBO Database(Schema)
Public propertyCompleted
Boolean: Is the contract already compleated
Public propertyContractDate
Date of the contract [Mandantory]
Public propertyContractHandlingPercentage
Stores the percentage value (0.5=50%) for special VolumeHandling = Percent, PercendAndBlock or PercentAndWarning.
Public propertyContractID
Internal Identifier [Mandantory/Automatic if 0]
Public propertyContractMemo
Memo
Public propertyContractNumber
NVARCHAR(20) [Mandantory] Contract Identifier "C12345.."

You can use sGetNewContractNumber(String) to generate a new contract number based on the project number.

Public propertyContractType
Public propertyCurrencyCode
VARCHAR(3) ISO Currency code: USD, GBP, EUR, CHF... Do not use the SBO code. MARIProject uses ISO codes for mapping Rate between Sys and Loc(EUR/USD)
MARI-SystemcurrencyERP local currencyContract CurrencyCurrencyCodeCurrencyHandlingCurrencyRateCurrencyRateLoc2FcCurrencyRateSys2Loc
SYS (EUR)Loc=SYS (EUR)Contract=SYS (EUR)emptynot aplicable0 or 100
SYS (EUR)Loc=SYS (EUR)Contract=Special (CHF)CHFFloatingRateBySBO or FixedRateForContractRate between EUR and CHF00
SYS (EUR)Loc!=SYS (USD)Contract=local(USD)USDnot aplicableRate between EUR and USD0 or 10 or CurrencyRate
SYS (EUR)Loc!=SYS (USD)Contract=SYS(EUR)EURFloatingRateBySBO or FixedRateForContractRate between EUR and USD0 or CurrencyRate0 or CurrencyRate
SYS (EUR)Loc!=SYS (USD)Contract=Special(CAD)CADFloatingRateBySBO or FixedRateForContractignoredRate between USD and CAD
Public propertyCurrencyHandling
Public propertyCurrencyRate
Exchange rate of the contract between the system currency and the contract currency, if CurrencyCode does not match the system currency of MARIProject
Public propertyCurrencyRateLoc2Fc
Exchange Rate between the local currency of the SBO database and the contract currency. This propertry will only be considered, if the local currency of the SBO Database is different to the system currency of MARIProject. See CurrencyCode.
Public propertyCurrencyRateSys2Loc
Exchange Rate between the system currency (MARIProject) and the local currency of the SBO company (database). This property will only be considered, if the local currency of the SBO database is different. See CurrencyCode.
Public propertyCustomerCode
[Mandantory] Customer linked to this contract. OCRD.CardCode
Public propertyDescription
[Mandantory] Description of the contract
Public propertyFooterText
Footer Text (Memo)
Public propertyGroup1
INT Group1. GroupType=10008 (sales) 10016 (purchase). See ContractGroup or POContractGroup1.
Public propertyGroup2
INT Group2. GroupType=10014 (sales) 10017 (purchase). See ContractGroup2 or POContractGroup2.
Public propertyGroup3
INT Group2. GroupType=10015 (sales) 10018 (purchase). See ContractGroup3 or POContractGroup3.
Public propertyHandledBySBOUser
VARCHAR(128) SELECT USER_CODE FROM OUSR. SBO User Handling the SBO Documents created out of the contract.
Public propertyHeaderText
HeaderText (Memo)
Public propertyInActive
Switch to make a contract invisible. Not used in the import.
Public propertyLanguage
(not used) Language identifier
Public propertyLeadOrCustomer
Boolean to indivate if the Business Partner is a lead or customer
Public propertyListOfContractPositions
Collection to import contract positions directly with the contract.
Public propertyOcrCode1
OcrCode1. Can be set on contract level, when company setting modified to use profit center from contract master
Public propertyOcrCode2
OcrCode2. Can be set on contract level, when company setting modified to use profit center from contract master
Public propertyOcrCode3
OcrCode3. Can be set on contract level, when company setting modified to use profit center from contract master
Public propertyOcrCode4
OcrCode4. Can be set on contract level, when company setting modified to use profit center from contract master
Public propertyOcrCode5
OcrCode5. Can be set on contract level, when company setting modified to use profit center from contract master
Public propertyPaymentCondition
VARCHAR(50)used as integer Payment condition. Use the internal SBO code: OCTG.GroupNum
Public propertyPlanningDueDate
Planning Date as base for the auto planning.
Public propertyPlanningGroupMembers
Size of a team (number of employees) to calculate the autoplanning based on the standard capacity
Public propertyPlanningHandling
Type for the auto planning. 0=No auto planning, 1=auto planning starting from due date, 2=auto planning calculated back from due date
Public propertyPrimalCreation
Creation date of the dataset
Public propertyPrimalUserID
VARCHAR(4) User initials creating the dataset
Public propertyProjectNumber
[Mandantory] Link to the project number
Public propertyPurchasePriceList
Link to a price list in SBO for the purchase prices. -1=Last purchase price, -2=Last calculated Price, -3=Item Cost
Public propertyRebate1
Rebate percentage 50=50%
Public propertyReferenceNumber
Free reference number (Purchase order code of the client)
Public propertyReferenceText
Additional reference to the clients purchase order
Public propertySalesAccountant

Sales Employee Code sales accountant (not referenced to other dimensions). SELECT SlpCode FROM OSLP.

clsImportProjectPurchaseProcesses: Purchase employee

Public propertySalesPriceList
Link to a price list in SBO for contract positions, where the SalesPriceType = SalesPriceBySBOPriceList. -1=Last purchase price, -2=Last calculated Price, -3=Item Cost
Public propertySalesVolumeEquipment
Part of the sales volumn for equipment rental (in contract currency)
Public propertySalesVolumeExternalService
Part of the sales volume for external services (in contract currency)
Public propertySalesVolumeItems
Part of the volume for items (in contract currency)
Public propertySalesVolumeService
Part of the volume for services (in contract currency)
Public propertySalesVolumeTE
Part of the volume for travel expenses (in contract currency)
Public propertyServiceRangeTemplate
Preset to default the ServiceStartDate, ServiceEndDate of an invoice to feed XInvoice ZUGFeRD range for invoice creation/>.
Public propertyStandardAccounting
6=Standard (Every time, when contract collector is running)
Public propertyStatus
[not used any more]
Public propertyValidPeriodFrom
YYYYMMM Starting period of a contract.
Public propertyValidPeriodUntil
YYYYMMM Ending period of a contract 9999999 for unlimited.
Public propertyVolumeHandling
Set warning or block method. See clsImportProjectContracteVolumeHandling for details: 5 or 0=No Handling, 6=Warning, 7=Block timebooking
Top
Methods
  NameDescription
Public methodbReadFromDB
Reads the contract data from the database and copies the values to the class Only for internal use! To load data use your own SQL.
(Overrides clsImportBasebReadFromDB(MPInterface, String).)
Public methodbSaveRSToMDB
Function to write data in to the Access MDB
(Overrides clsImportBasebSaveRSToMDB(MPInterface, DataRow, DataTable).)
Public methodbUpdateContractIDsInAccess
Public methodGetListUserDefinedFields
Returns the user defined field definition for the dimension "Sales Contract". The fields have to be defined directly in MARIProject.
(Overrides clsImportBaseGetListUserDefinedFields(MPInterface).)
Public methodSetUserDefinedFieldValue
Fill user defined field with value
(Overrides clsImportBaseSetUserDefinedFieldValue(String, Object).)
Top
Remarks

See also clsImportProjectPurchaseProcesses for the purchase process.

Sales Contracts: View: MARIContract: :Table: MPVKVertraege

Purchase Processes: View: MARIPurchaseProcess: :Table: MPEKVertraege

Used by MS Access table: MARIProjektImportProjectContracts
Examples
Create new contract to existing project
private int CreateContract(string sProject, string sDescription) {
    Log($"CreateContract(\"{sProject}\", \"{sDescription}\")");

    clsImportProjectContract oContract = new clsImportProjectContract();
    oContract.ProjectNumber = sProject; // existing project  P100005
    oContract.ContractNumber = oMPInterface.sGetNewContractNumber(sProject); // P100005>> 10000500 new visible number follownig the number sValue for contracts
    oContract.Description = sDescription;
    oContract.ContractDate = DateTime.Now;
    oContract.CompanyID = 1;
    oContract.CustomerCode = "10006"; // valid customer number OCRD.Cardcode
    oContract.ContractType = clsImportProjectContract.eContractTypes.IndividualContract;
    oContract.StandardAccounting = clsImportProjectContract.eAccountingType.AlwaysCreateInvoices;
    oContract.ValidPeriodFrom = 2016012; // Starting period for the contract YYYYMMM 

    /*  It is possible to direcly add contract positions to the object to create the contract including its positions.
        oContract.ListOfContractPositions = new List<clsImportProjectContractPosition>();
    */

    if (oMPInterface.bImportContract(oContract, clsImportBase.eImportMode.ValidateAndImport)) {
        Log($"CreateContract: ContractID={oContract.ContractID}, ContractNumber=\"{oContract.ContractNumber}\"");
        return oContract.ContractID;
    } else {
        LogFail(oMPInterface.oErrors.PrintErrors(true));
        return 0;
    }
}
See Also