clsImportERPDocument Class |
Please make sure, that SAP Business One DI-API in 32 or 64 bit is installed according to the usage of this interface. The logon user in MARIProject has to have a corresponding user linked to the selected company database.
Namespace: MARIInterface
The clsImportERPDocument type exposes the following members.
| Name | Description | |
|---|---|---|
| clsImportERPDocument | Initializes a new instance of the clsImportERPDocument class |
| Name | Description | |
|---|---|---|
| CompanyID | Company ID [Mandatory]. Logical linkt to the SBO Database(Schema)
| |
| oDownPayments |
List of DocEntries of the DownPayments
| |
| oPositions |
List of the Document Lines
|
| Name | Description | |
|---|---|---|
| bSetBaseLineByDocNumInvoice | ||
| bSetBaseLineByDocNumSalesOrder |
| Name | Description | |
|---|---|---|
| Currency |
Document Currency
| |
| Discount | Discount in percentage for the document | |
| DocDueDate | OINV.DocDueDate | |
| DocEntry | ReadOnly Internal ID SBO OINV.DocEntry | |
| DocNum | OINV.DocNum (optional) Can be used, when DocNumSeries is manual | |
| DocNumSeries | OINV.Series (optional) Can be used, when manual=-1 | |
| DocType | Document Type | |
| DocumentDate | OINV.TaxDate | |
| DownPaymentPercent |
Percent of the Invoice value (1 = 100%)
| |
| FinanceBlock | ||
| FinanceBPCode | Bill to or Pay to business partner code | |
| FinanceBuilding | ||
| FinanceCity | ||
| FinanceCountry | ||
| FinanceCounty | ||
| FinanceMatchcode | ||
| FinanceName1 | ||
| FinanceName2 | ||
| FinanceName3 | ||
| FinanceState | ||
| FinanceStreet | ||
| FinanceStreetNo | ||
| FinanceZip | ||
| Footer | ||
| Header | ||
| ImportFileNum |
Order Number
| |
| JournalMemo |
Journal Memo VarChar(50)
| |
| nDownPaymentType |
Down Payment Type
| |
| PaymentTerm | PaymentTerm ID | |
| PostingDate | OINV.DocDate | |
| ProfitCenter |
Profit center in the header. Not used in MARIProject. Use the profit center in the position.
| |
| ProjectCode |
ProjectCode center in the header. Not used in MARIProject. Use the project code in the position.
| |
| REFNumber | Reference Number VarChar(11) | |
| REFSign | Reference Sign VarChar(11) | |
| Remarks |
Remarks
| |
| SalesPersonCode | string | |
| ShipmentBlock | ||
| ShipmentBPCode | ||
| ShipmentBuilding | ||
| ShipmentCity | ||
| ShipmentCountry | ||
| ShipmentCounty | ||
| ShipmentMatchcode | ||
| ShipmentName1 | ||
| ShipmentName2 | ||
| ShipmentName3 | ||
| ShipmentState | ||
| ShipmentStreet | ||
| ShipmentStreetNo | ||
| ShipmentZip |
private clsImportERPDocument CreateERPDocumentGoodsReceipt(string sCardCode, string sItemCode, DateTime dtDocDate) { clsImportERPDocument NewDoc = new clsImportERPDocument(); NewDoc.CompanyID = 1; // first company linked to MARIProject NewDoc.DocType = clsImportERPDocument.eERPDocTypes.Goods_Receipt_PO; NewDoc.DocumentDate = dtDocDate; NewDoc.DocDueDate = dtDocDate; NewDoc.FinanceBPCode = sCardCode; NewDoc.ShipmentBPCode = sCardCode; NewDoc.Header = "New goods receipt PO via MARIInterface"; clsImportERPDocument.clsERPDocumentPosition NewPos; NewPos = new clsImportERPDocument.clsERPDocumentPosition(); NewPos.PositionType = clsImportERPDocument.clsERPDocumentPosition.eLineTypes.Item; NewPos.ItemCode = sItemCode; NewPos.UnitPrice = 12.34m; NewPos.Quantity = 5; NewPos.WareHouse = "01"; NewDoc.oPositions.Add(NewPos); if (oMPInterface.bImportERPDocument(NewDoc, clsImportBase.eImportMode.ValidateAndImport)) { return NewDoc; } else { LogFail(oMPInterface.oErrors.PrintErrors()); return null; } }
private clsImportERPDocument CreateERPDocumentSalesOrder(string sCardCode, string sItemCode, DateTime dtDocDate) { clsImportERPDocument NewDoc = new clsImportERPDocument(); NewDoc.CompanyID = 1; // first company linked to MARIProject NewDoc.DocType = clsImportERPDocument.eERPDocTypes.Sales_Order; NewDoc.DocumentDate = dtDocDate; NewDoc.DocDueDate = dtDocDate.AddDays(30); NewDoc.FinanceBPCode = sCardCode; NewDoc.ShipmentBPCode = sCardCode; NewDoc.Header = "New sales order created via MARIInterface"; clsImportERPDocument.clsERPDocumentPosition NewPos; NewPos = new clsImportERPDocument.clsERPDocumentPosition(); NewPos.PositionType = clsImportERPDocument.clsERPDocumentPosition.eLineTypes.Item; NewPos.ItemCode = sItemCode; NewPos.UnitPrice = 123.45m; NewPos.Quantity = 5; NewDoc.oPositions.Add(NewPos); if (oMPInterface.bImportERPDocument(NewDoc, clsImportBase.eImportMode.ValidateAndImport)) { return NewDoc; } else { LogFail(oMPInterface.oErrors.PrintErrors()); return null; } }
private int CreateERPDocumentAPInvoice(clsImportERPDocument BaseSalesorder, DateTime dtDocDate) { clsImportERPDocument NewDoc = new clsImportERPDocument(); NewDoc.CompanyID = BaseSalesorder.CompanyID; NewDoc.DocType = clsImportERPDocument.eERPDocTypes.AR_Invoice; NewDoc.DocumentDate = dtDocDate; NewDoc.FinanceBPCode = BaseSalesorder.FinanceBPCode; NewDoc.ShipmentBPCode = BaseSalesorder.ShipmentBPCode; NewDoc.Header = "New A/P Invoice created via MARIInterface"; clsImportERPDocument.clsERPDocumentPosition NewPos; foreach (clsImportERPDocument.clsERPDocumentPosition BasePos in BaseSalesorder.oPositions) { NewPos = new clsImportERPDocument.clsERPDocumentPosition(); NewPos.PositionType = BasePos.PositionType; NewPos.ItemCode = BasePos.ItemCode; NewPos.UnitPrice = BasePos.UnitPrice; NewPos.Quantity = BasePos.Quantity; NewPos.BaseEntry = BaseSalesorder.DocEntry; NewPos.BaseLine = BasePos.llLinenum; NewPos.BaseType = BaseSalesorder.DocType; NewDoc.oPositions.Add(NewPos); } if (oMPInterface.bImportERPDocument(NewDoc, clsImportBase.eImportMode.ValidateAndImport)) { return NewDoc.DocEntry; } else { throw new Exception(oMPInterface.oErrors.PrintErrors()); } }