clsImportProjectContract Class |
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.
Namespace: MARIInterface
The clsImportProjectContract type exposes the following members.
| Name | Description | |
|---|---|---|
| clsImportProjectContract | Initializes a new instance of the clsImportProjectContract class |
| Name | Description | |||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| A0AdditionalInfo | Billing Address: Line 3 | |||||||||||||||||||||||||||||||||||||||||||||||||
| A0AdressLineNum | Integer | |||||||||||||||||||||||||||||||||||||||||||||||||
| A0AdressName | VARCHAR(50) | |||||||||||||||||||||||||||||||||||||||||||||||||
| A0AdressName2 | VARCHAR(50) | |||||||||||||||||||||||||||||||||||||||||||||||||
| A0AdressName3 | VARCHAR(50) | |||||||||||||||||||||||||||||||||||||||||||||||||
| A0Building | Block VARCHAR(100) | |||||||||||||||||||||||||||||||||||||||||||||||||
| A0City | Billing Address: City Name | |||||||||||||||||||||||||||||||||||||||||||||||||
| A0ContactPersonID | INT: Link to the contact persons (OCPR.CntctCode) | |||||||||||||||||||||||||||||||||||||||||||||||||
| A0Country | Billing Address: ISO Country Code USA, DE | |||||||||||||||||||||||||||||||||||||||||||||||||
| A0Matchcode | Billing Address: Name of address | |||||||||||||||||||||||||||||||||||||||||||||||||
| A0Name1 | Billing Address: Name 1 | |||||||||||||||||||||||||||||||||||||||||||||||||
| A0Name2 | Billing Address: Name 2 | |||||||||||||||||||||||||||||||||||||||||||||||||
| A0Region | County VARCHAR(100) | |||||||||||||||||||||||||||||||||||||||||||||||||
| A0State | VARCHAR(3) | |||||||||||||||||||||||||||||||||||||||||||||||||
| A0Street | Billing Address | |||||||||||||||||||||||||||||||||||||||||||||||||
| A0StreetNumber | Billing Address | |||||||||||||||||||||||||||||||||||||||||||||||||
| A0Title | Billing Address: Salutation | |||||||||||||||||||||||||||||||||||||||||||||||||
| A0ZIPCode | Billing Address: ZIP Code | |||||||||||||||||||||||||||||||||||||||||||||||||
| A1AdditionalInfo | ShipTo Line 3 | |||||||||||||||||||||||||||||||||||||||||||||||||
| A1AdressLineNum | Integer | |||||||||||||||||||||||||||||||||||||||||||||||||
| A1AdressName | VARCHAR(50) | |||||||||||||||||||||||||||||||||||||||||||||||||
| A1AdressName2 | VARCHAR(50) | |||||||||||||||||||||||||||||||||||||||||||||||||
| A1AdressName3 | VARCHAR(50) | |||||||||||||||||||||||||||||||||||||||||||||||||
| A1Building | Block VARCHAR(100) | |||||||||||||||||||||||||||||||||||||||||||||||||
| A1BusinessPartner | Ship to code (OCRD.CardCode) | |||||||||||||||||||||||||||||||||||||||||||||||||
| A1City | VARCHAR(100) | |||||||||||||||||||||||||||||||||||||||||||||||||
| A1ContactPersonID | INT: Link to the contact persons | |||||||||||||||||||||||||||||||||||||||||||||||||
| A1Country | ShipTo: Country Code ISO USA, DE | |||||||||||||||||||||||||||||||||||||||||||||||||
| A1Matchcode | ShipTo | |||||||||||||||||||||||||||||||||||||||||||||||||
| A1Name1 | ShipTo | |||||||||||||||||||||||||||||||||||||||||||||||||
| A1Name2 | ShipTo | |||||||||||||||||||||||||||||||||||||||||||||||||
| A1Region | ShipTo County | |||||||||||||||||||||||||||||||||||||||||||||||||
| A1State | VARCHAR(3) | |||||||||||||||||||||||||||||||||||||||||||||||||
| A1Street | ShipTo | |||||||||||||||||||||||||||||||||||||||||||||||||
| A1StreetNumber | ShipTo | |||||||||||||||||||||||||||||||||||||||||||||||||
| A1Title | ShipTo Salutation | |||||||||||||||||||||||||||||||||||||||||||||||||
| A1ZIPCode | VARCHAR(20) | |||||||||||||||||||||||||||||||||||||||||||||||||
| BaseContractID | INT: Link to a base contact (Indent=0, Main Contract) | |||||||||||||||||||||||||||||||||||||||||||||||||
| ChangeDate | Changing date | |||||||||||||||||||||||||||||||||||||||||||||||||
| ChangeUserID | VARCHAR(4) User initials, which has made the change | |||||||||||||||||||||||||||||||||||||||||||||||||
| CompanyID | Company ID [Mandantory]. Link to the logical link of the SBO Database(Schema) | |||||||||||||||||||||||||||||||||||||||||||||||||
| Completed | Boolean: Is the contract already compleated | |||||||||||||||||||||||||||||||||||||||||||||||||
| ContractDate | Date of the contract [Mandantory] | |||||||||||||||||||||||||||||||||||||||||||||||||
| ContractHandlingPercentage |
Stores the percentage value (0.5=50%) for special VolumeHandling = Percent, PercendAndBlock or PercentAndWarning.
| |||||||||||||||||||||||||||||||||||||||||||||||||
| ContractID | Internal Identifier [Mandantory/Automatic if 0] | |||||||||||||||||||||||||||||||||||||||||||||||||
| ContractMemo | Memo | |||||||||||||||||||||||||||||||||||||||||||||||||
| ContractNumber | NVARCHAR(20) [Mandantory] Contract Identifier "C12345.."
You can use sGetNewContractNumber(String) to generate a new contract number based on the project number. | |||||||||||||||||||||||||||||||||||||||||||||||||
| ContractType | [Mandantory] 1=Individual Contract. See clsImportProjectContracteContractTypes. | |||||||||||||||||||||||||||||||||||||||||||||||||
| CurrencyCode | VARCHAR(3) ISO Currency code: USD, GBP, EUR, CHF... Do not use the SBO code. MARIProject uses ISO codes for mapping
| |||||||||||||||||||||||||||||||||||||||||||||||||
| CurrencyHandling |
Contract can have one fixed rate (CurrencyRate) or the rate is floating over time. See clsImportProjectContracteCurrencyHandling.
| |||||||||||||||||||||||||||||||||||||||||||||||||
| CurrencyRate | Exchange rate of the contract between the system currency and the contract currency, if CurrencyCode does not match the system currency of MARIProject | |||||||||||||||||||||||||||||||||||||||||||||||||
| CurrencyRateLoc2Fc | 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. | |||||||||||||||||||||||||||||||||||||||||||||||||
| CurrencyRateSys2Loc | 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. | |||||||||||||||||||||||||||||||||||||||||||||||||
| CustomerCode | [Mandantory] Customer linked to this contract. OCRD.CardCode | |||||||||||||||||||||||||||||||||||||||||||||||||
| Description | [Mandantory] Description of the contract | |||||||||||||||||||||||||||||||||||||||||||||||||
| FooterText | Footer Text (Memo) | |||||||||||||||||||||||||||||||||||||||||||||||||
| Group1 | INT Group1. GroupType=10008 (sales) 10016 (purchase). See ContractGroup or POContractGroup1. | |||||||||||||||||||||||||||||||||||||||||||||||||
| Group2 | INT Group2. GroupType=10014 (sales) 10017 (purchase). See ContractGroup2 or POContractGroup2. | |||||||||||||||||||||||||||||||||||||||||||||||||
| Group3 | INT Group2. GroupType=10015 (sales) 10018 (purchase). See ContractGroup3 or POContractGroup3. | |||||||||||||||||||||||||||||||||||||||||||||||||
| HandledBySBOUser | VARCHAR(128) SELECT USER_CODE FROM OUSR. SBO User Handling the SBO Documents created out of the contract. | |||||||||||||||||||||||||||||||||||||||||||||||||
| HeaderText | HeaderText (Memo) | |||||||||||||||||||||||||||||||||||||||||||||||||
| InActive | Switch to make a contract invisible. Not used in the import. | |||||||||||||||||||||||||||||||||||||||||||||||||
| Language | (not used) Language identifier | |||||||||||||||||||||||||||||||||||||||||||||||||
| LeadOrCustomer | Boolean to indivate if the Business Partner is a lead or customer | |||||||||||||||||||||||||||||||||||||||||||||||||
| ListOfContractPositions |
Collection to import contract positions directly with the contract.
| |||||||||||||||||||||||||||||||||||||||||||||||||
| OcrCode1 | OcrCode1. Can be set on contract level, when company setting modified to use profit center from contract master | |||||||||||||||||||||||||||||||||||||||||||||||||
| OcrCode2 | OcrCode2. Can be set on contract level, when company setting modified to use profit center from contract master | |||||||||||||||||||||||||||||||||||||||||||||||||
| OcrCode3 | OcrCode3. Can be set on contract level, when company setting modified to use profit center from contract master | |||||||||||||||||||||||||||||||||||||||||||||||||
| OcrCode4 | OcrCode4. Can be set on contract level, when company setting modified to use profit center from contract master | |||||||||||||||||||||||||||||||||||||||||||||||||
| OcrCode5 | OcrCode5. Can be set on contract level, when company setting modified to use profit center from contract master | |||||||||||||||||||||||||||||||||||||||||||||||||
| PaymentCondition | VARCHAR(50)used as integer Payment condition. Use the internal SBO code: OCTG.GroupNum | |||||||||||||||||||||||||||||||||||||||||||||||||
| PlanningDueDate | Planning Date as base for the auto planning. | |||||||||||||||||||||||||||||||||||||||||||||||||
| PlanningGroupMembers | Size of a team (number of employees) to calculate the autoplanning based on the standard capacity | |||||||||||||||||||||||||||||||||||||||||||||||||
| PlanningHandling | Type for the auto planning. 0=No auto planning, 1=auto planning starting from due date, 2=auto planning calculated back from due date | |||||||||||||||||||||||||||||||||||||||||||||||||
| PrimalCreation | Creation date of the dataset | |||||||||||||||||||||||||||||||||||||||||||||||||
| PrimalUserID | VARCHAR(4) User initials creating the dataset | |||||||||||||||||||||||||||||||||||||||||||||||||
| ProjectNumber | [Mandantory] Link to the project number | |||||||||||||||||||||||||||||||||||||||||||||||||
| PurchasePriceList | Link to a price list in SBO for the purchase prices. -1=Last purchase price, -2=Last calculated Price, -3=Item Cost | |||||||||||||||||||||||||||||||||||||||||||||||||
| Rebate1 | Rebate percentage 50=50% | |||||||||||||||||||||||||||||||||||||||||||||||||
| ReferenceNumber | Free reference number (Purchase order code of the client) | |||||||||||||||||||||||||||||||||||||||||||||||||
| ReferenceText | Additional reference to the clients purchase order | |||||||||||||||||||||||||||||||||||||||||||||||||
| SalesAccountant | Sales Employee Code sales accountant (not referenced to other dimensions). SELECT SlpCode FROM OSLP. clsImportProjectPurchaseProcesses: Purchase employee | |||||||||||||||||||||||||||||||||||||||||||||||||
| SalesPriceList | 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 | |||||||||||||||||||||||||||||||||||||||||||||||||
| SalesVolumeEquipment | Part of the sales volumn for equipment rental (in contract currency) | |||||||||||||||||||||||||||||||||||||||||||||||||
| SalesVolumeExternalService | Part of the sales volume for external services (in contract currency) | |||||||||||||||||||||||||||||||||||||||||||||||||
| SalesVolumeItems | Part of the volume for items (in contract currency) | |||||||||||||||||||||||||||||||||||||||||||||||||
| SalesVolumeService | Part of the volume for services (in contract currency) | |||||||||||||||||||||||||||||||||||||||||||||||||
| SalesVolumeTE | Part of the volume for travel expenses (in contract currency) | |||||||||||||||||||||||||||||||||||||||||||||||||
| ServiceRangeTemplate |
Preset to default the ServiceStartDate, ServiceEndDate of an invoice to feed XInvoice ZUGFeRD range for invoice creation/>.
| |||||||||||||||||||||||||||||||||||||||||||||||||
| StandardAccounting | 6=Standard (Every time, when contract collector is running) | |||||||||||||||||||||||||||||||||||||||||||||||||
| Status | [not used any more] | |||||||||||||||||||||||||||||||||||||||||||||||||
| ValidPeriodFrom | YYYYMMM Starting period of a contract. | |||||||||||||||||||||||||||||||||||||||||||||||||
| ValidPeriodUntil | YYYYMMM Ending period of a contract 9999999 for unlimited. | |||||||||||||||||||||||||||||||||||||||||||||||||
| VolumeHandling | Set warning or block method. See clsImportProjectContracteVolumeHandling for details: 5 or 0=No Handling, 6=Warning, 7=Block timebooking |
| Name | Description | |
|---|---|---|
| bReadFromDB |
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).) | |
| bSaveRSToMDB |
Function to write data in to the Access MDB
(Overrides clsImportBasebSaveRSToMDB(MPInterface, DataRow, DataTable).) | |
| bUpdateContractIDsInAccess | ||
| GetListUserDefinedFields |
Returns the user defined field definition for the dimension "Sales Contract". The fields have to be defined directly in MARIProject.
(Overrides clsImportBaseGetListUserDefinedFields(MPInterface).) | |
| SetUserDefinedFieldValue |
Fill user defined field with value
(Overrides clsImportBaseSetUserDefinedFieldValue(String, Object).) |
See also clsImportProjectPurchaseProcesses for the purchase process.
Sales Contracts: View: MARIContract: :Table: MPVKVertraege
Purchase Processes: View: MARIPurchaseProcess: :Table: MPEKVertraege
Used by MS Access table: MARIProjektImportProjectContractsprivate 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; } }