clsImportProjectContractPositionAccountingPos Class |
Can be used to define accounting conditions for one contract position. Add objects to clsImportProjectContractPosition.CollectionAccountingPos of the new position.
Reads from MS Access table: MARIProjektImportProjectContractPositionsAccCond
In addition a single accounting line can be added via MPInterface.bImportContractPositionAccountingPos(clsImportProjectContractPositionAccountingPos, clsImportBaseeImportMode).
Namespace: MARIInterface
The clsImportProjectContractPositionAccountingPos type exposes the following members.
| Name | Description | |
|---|---|---|
| clsImportProjectContractPositionAccountingPos | Initializes a new instance of the clsImportProjectContractPositionAccountingPos class |
| Name | Description | |
|---|---|---|
| AccountingCondition | Internal Id for each line of the accointing position. Will be set during import. | |
| AccountingCycle | Number of Monthes (1=every month, 6 biannually) will be used, when AccountingType = eAccountingType.ReccurentAccounting. See clsImportProjectContractPositioneMaintenancePeriodic for allowed values | |
| AccountingOrder | ConditionOrder. Order of the accounting positions (starts with 1) | |
| AccountingType | AccountingType | |
| AccountingValue | Value of the line. Use either Percentage or AccountingValue wich is quantity or unit price. | |
| ContractID |
Field to be used, when a single instance of this class will be imported. The ContractID is used to load the contract. Not requierd, when class is imported via the property CollectionAccountingPos.
| |
| ContractPositionID | Mandatory link to the contract Id. Will be filled, when class is added via CollectionAccountingPos. | |
| Description | Description | |
| DocumentPosID | Link to the position in the dococument which has closed this position. Not used in the import. | |
| DueDate | DueDate. Used only for AccountingCondition=eAccountingType.DueDate. | |
| EndPeriod | EndPeriod | |
| Percentage | PercentageValue 100.0 = 100% Use either AccountingValue or Percentage. | |
| PhaseID | PhaseID only for AccountingCondition=eAccountingType.PhaseLink | |
| RecalculateExistingLinesTo100 |
When a new accounting lines is added, this setting gives the instruction, that the following position in in the order of duedates will be used. The total amount of the contract position (ContractQuantity*ContractPrice)
| |
| StartPeriod | StartPeriod | |
| Status | Status of the position. If not set, positions will be open. See clsImportProjectContractPositionAccountingPosePosAccountingStatus |
| Name | Description | |
|---|---|---|
| bReadFromDB | (Overrides clsImportBasebReadFromDB(MPInterface, String).) | |
| bSaveRSToMDB | (Overrides clsImportBasebSaveRSToMDB(MPInterface, DataRow, DataTable).) |
public clsImportProjectContractPosition CreateContractPositionFixedPrice(int lContractID, string sItemCode) { Log($"CreateContractPositionFixedPrice(lContractID={lContractID}, sItemCode=\"{sItemCode}\")"); // create contract position clsImportProjectContractPosition oPos = new clsImportProjectContractPosition(); oPos.PositionTyp = clsImportProjectContractPosition.eContractPositionType.FixedPrice; oPos.ContractID = lContractID; oPos.Matchcode = "Fix Price Position"; oPos.Description1 = "FP: Created from the interface"; oPos.ContractQuantity = 1; oPos.ContractPrice = 10000; oPos.ItemCode = sItemCode; oPos.SalesPriceType = clsImportProjectContractPosition.eSalesPriceType.SalesPriceByContract; //IN20220719 oPos.SalesPositionRebatePercentage = 0;//IN20220719 //two accounting details 30%, 70% oPos.CollectionAccountingPos = new List<clsImportProjectContractPositionAccountingPos>(); clsImportProjectContractPositionAccountingPos oAcc1 = new clsImportProjectContractPositionAccountingPos(); oAcc1.AccountingType = clsImportProjectContractPositionAccountingPos.ePosAccountingType.DueDate; oAcc1.DueDate = new DateTime(2015, 1, 15); oAcc1.AccountingValue = 3000; oAcc1.Percentage = 30; oAcc1.Description = "First 30%"; oPos.CollectionAccountingPos.Add(oAcc1); clsImportProjectContractPositionAccountingPos oAcc2 = new clsImportProjectContractPositionAccountingPos(); oAcc2.AccountingType = clsImportProjectContractPositionAccountingPos.ePosAccountingType.DueDate; oAcc2.DueDate = new DateTime(2015, 5, 15); oAcc2.AccountingValue = 7000; oAcc2.Percentage = 70; oAcc2.Description = "Last 70%"; oPos.CollectionAccountingPos.Add(oAcc2); return oPos; } public int ImportContractPositionFixedPrice(clsImportProjectContractPosition oPos) { Log($"ImportContractPositionFixedPrice(lContractID={oPos.ContractID}, sItemCode=\"{oPos.ItemCode}\")"); // import contract position if (oMPInterface.bImportContractPosition(oPos, clsImportBase.eImportMode.ValidateAndImport)) { Log($"ImportContractPositionFixedPrice ContractPositionID={oPos.ContractPositionID}"); return oPos.ContractPositionID; } else { // read import error LogFail(oMPInterface.oErrors.PrintErrors(true)); return 0; } }