Click or drag to resize

clsImportDraftDocumentPosLink Class

Allocation of a project/phase/Contract.. to a prerecorded document import. Sub class to clsImportDraftDocumentPos.ProjectAllocationLines. Cannot be imported manually.

Use MARIInterface.bImportDraftDocument(clsImportDraftDocument, clsImportBaseeImportMode) to import a new document

Inheritance Hierarchy
SystemObject
  MARIInterfaceclsImportBase
    MARIInterfaceclsImportDraftDocumentPosLink

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

The clsImportDraftDocumentPosLink type exposes the following members.

Constructors
  NameDescription
Public methodclsImportDraftDocumentPosLink
Initializes a new instance of the clsImportDraftDocumentPosLink class
Top
Properties
  NameDescription
Public propertyDocumentDraftPosID
Link to the postion
Public propertyDocumentDraftPosLinkID
internal line id. 0 for import
Public propertyPhaseID
Link to a phase. Mandatory, if phases are used
Public propertyProject
Project number
Public propertyPurchaseProcess
(optional) Link to the corresponding PurchaseProcess
Public propertyPurchaseProcessPos
(optional) link to the position in the purchase process
Public propertyQuantity
Quantity of the line
Public propertySalesContract
Link to the customer contract
Public propertySalesContractPos
Link to the position in the customer contract
Top
Remarks
Examples
Import a draft document (AP Invoice)
private void CreateDraftDocument() {

    clsImportDraftDocument oDraft = new clsImportDraftDocument();
    oDraft.DocumentType = clsImportDraftDocument.eDraftDocumentType.DraftAPInvoice; //300
    oDraft.Company = 1; // first linked SBO Database to MARIProject
    oDraft.DocumentDate = new DateTime(2023, 01, 15);
    oDraft.RefDate1 = new DateTime(2023, 1, 8);//delivery date
    oDraft.CardCode = "70000"; // OCRD
    oDraft.Currency = "EUR"; // ISO Code
    oDraft.NetValueDocumentCurrency = 10000m;
    oDraft.Reference1 = "ExteralInvoice 12321089";
    oDraft.ProjectLink = "P100016";
    oDraft.MessageToEmployee = "0002"; //responsible employee
    oDraft.MessageText = "Please review this prerecorded invoice";

    if (!oMPInterface.bImportDraftDocument(oDraft, clsImportBase.eImportMode.ValidateAndImport)) {
        LogFail(oMPInterface.oErrors.PrintErrors());
    }


}
private void CreateDraftDocumentWithPos() {

    clsImportDraftDocument oDraft = new clsImportDraftDocument();
    oDraft.DocumentType = clsImportDraftDocument.eDraftDocumentType.DraftAPInvoice; //300
    oDraft.Company = 1; // first linked SBO Database to MARIProject
    oDraft.DocumentDate = new DateTime(2023, 01, 15);
    oDraft.RefDate1 = new DateTime(2023, 1, 8);//delivery date
    oDraft.CardCode = "70000"; // OCRD
    oDraft.Currency = "EUR"; // ISO Code
    oDraft.NetValueDocumentCurrency = 10000m;
    oDraft.Reference1 = "ExteralInvoice 12321089";
    oDraft.Reference2 = "Carlos Santana";
    oDraft.Reference3 = "Journalmemo";


    //sample Positions
    oDraft.ListOfDraftPositions = new List<clsImportDraftDocumentPos>();
    oDraft.ListOfDraftPositions.Add(new clsImportDraftDocumentPos() {
        PosType = clsImportDraftDocumentPos.eDraftPositionType.PurchasItemAtCost,
        ItemCode = "210000",
        Description1 = "Apple",
        Quantity = 12,
        NetUnitPriceDocumentCurrency = 900m,
        /*Sample projekt link (one line)*/
        ProjectAllocationLines = new List<clsImportDraftDocumentPosLink>() {
            new clsImportDraftDocumentPosLink () {
                Project = "P100016",
                PhaseID = 100007,
                Quantity = 12
            }
        }
    });

    if (!oMPInterface.bImportDraftDocument(oDraft, clsImportBase.eImportMode.ValidateAndImport)) {
        LogFail(oMPInterface.oErrors.PrintErrors());
    }


}
See Also