clsImportDraftDocument Class |
Import prerecorded goods receipt, prerecorded A/P Invoices
Header Object: clsImportDraftDocument
Positions: clsImportDraftDocumentPos
Use MARIInterface.bImportDraftDocument(clsImportDraftDocument, clsImportBaseeImportMode) to import a new document
Namespace: MARIInterface
The clsImportDraftDocument type exposes the following members.
| Name | Description | |
|---|---|---|
| clsImportDraftDocument | Initializes a new instance of the clsImportDraftDocument class |
| Name | Description | |
|---|---|---|
| CardCode | Supplier CardCode | |
| Company | Company ID (Link to SBO Database) | |
| Currency | Currency in ISO code | |
| DiscountPercent | Discount Percent on the footer | |
| DocumentDate | Original document date on the suppliers paper | |
| DocumentDraftID | internal invisible id. %lt;100000 for internal use. Will be set by import. | |
| DocumentType | Document Type. clsImportDraftDocumenteDraftDocumentType | |
| DraftDocNumber | draft document number. Created internally by the selected number series (by company) | |
| DraftStatus | Draft Status. See clsImportDraftDocumenteDraftStatus | |
| ListOfDraftPositions |
Collection to import positions to the draft document
| |
| MessageText | Message send to employee, when MessageToEmployee is used | |
| MessageToEmployee | Message on Creation to employee | |
| NetValueDocumentCurrency | value without tax on the document in document currency | |
| ProjectLink | Default project for the user interface to add new positions with this default. Stored in MPDocumentDraftHeadLink | |
| RefDate1 | RefDate1 | |
| RefDate2 | RefDate2 | |
| RefDate3 | RefDate3 | |
| Reference1 | external reference number (Used for payment to the supplier) [REF.] | |
| Reference2 | Additional Reference [REF.No.] | |
| Reference3 | Additional reference [Journal Memo] |
| 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).) |
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()); } }