Click or drag to resize

clsImportProjectContractPositionAccountingPos Class

Import for table MPVKVertraegePositionenAkd: Contract Management: Contract positions accounting lines (due date, phase ...).

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).

Inheritance Hierarchy
SystemObject
  MARIInterfaceclsImportBase
    MARIInterfaceclsImportProjectContractPositionAccountingPos

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

The clsImportProjectContractPositionAccountingPos type exposes the following members.

Constructors
  NameDescription
Public methodclsImportProjectContractPositionAccountingPos
Initializes a new instance of the clsImportProjectContractPositionAccountingPos class
Top
Properties
  NameDescription
Public propertyAccountingCondition
Internal Id for each line of the accointing position. Will be set during import.
Public propertyAccountingCycle
Number of Monthes (1=every month, 6 biannually) will be used, when AccountingType = eAccountingType.ReccurentAccounting. See clsImportProjectContractPositioneMaintenancePeriodic for allowed values
Public propertyAccountingOrder
ConditionOrder. Order of the accounting positions (starts with 1)
Public propertyAccountingType
AccountingType
Public propertyAccountingValue
Value of the line. Use either Percentage or AccountingValue wich is quantity or unit price.
Public propertyContractID
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.
Public propertyContractPositionID
Mandatory link to the contract Id. Will be filled, when class is added via CollectionAccountingPos.
Public propertyDescription
Description
Public propertyDocumentPosID
Link to the position in the dococument which has closed this position. Not used in the import.
Public propertyDueDate
DueDate. Used only for AccountingCondition=eAccountingType.DueDate.
Public propertyEndPeriod
EndPeriod
Public propertyPercentage
PercentageValue 100.0 = 100% Use either AccountingValue or Percentage.
Public propertyPhaseID
PhaseID only for AccountingCondition=eAccountingType.PhaseLink
Public propertyRecalculateExistingLinesTo100
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)
Public propertyStartPeriod
StartPeriod
Public propertyStatus
Top
Methods
Remarks
Examples
Add Contract Position (fixed price) to existing contract
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;
    }
}
See Also