clsImportDraftDocumentPos Class |
Use MARIInterface.bImportDraftDocument(clsImportDraftDocument, clsImportBaseeImportMode) to import a new document
Namespace: MARIInterface
The clsImportDraftDocumentPos type exposes the following members.
| Name | Description | |
|---|---|---|
| clsImportDraftDocumentPos | Initializes a new instance of the clsImportDraftDocumentPos class |
| Name | Description | |
|---|---|---|
| Description1 | Description 1 | |
| Description2 | Description 2 | |
| DocumentDraftID | Link to clsImportDraftDocument Header. | |
| DocumentDraftPosID | internal unique id of the line. must by < 100000 for import. Will be replaced by internal id of the line | |
| EquipmentCategory | Equipment Category to be used for selected PosType. See clsImportDraftDocumentPoseDraftPositionType | |
| EquipmentSubject | Equipment Subject (=cost type) to be used for selected PosType. See clsImportDraftDocumentPoseDraftPositionType | |
| ItemCode | Item Number to be used for selected PosType. See clsImportDraftDocumentPoseDraftPositionType | |
| NetUnitPriceDocumentCurrency | Net Unit Price in document currency | |
| PosType | Position type. See clsImportDraftDocumentPoseDraftPositionType | |
| Quantity | Quantity of the document line. The quantity must match the lins in ProjectAllocationLines | |
| RebateValueDocumentCurrency | Rebate Value in document currency | |
| ServiceNumber | Service number for service positions. PosType=clsImportDraftDocumentPoseDraftPositionType.PurchaseServiceAtCost |
| Name | Description | |
|---|---|---|
| GetListUserDefinedFields |
Returns the user defined field definition for the dimension "Sales Contract Document Positions". The fields have to be defined directly in MARIProject.
(Overrides clsImportBaseGetListUserDefinedFields(MPInterface).) |
| Name | Description | |
|---|---|---|
| ProjectAllocationLines |
A link in a prerecored document can be linked to a project, phase, contract...
One position can technically be linked to several projects. When more than one line is linked, the quantity in the lines must match the quantity in the position.
|
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()); } }