biuan SAP® BUSINESS ONE SDK
API Down Payments To Draw / Down Payments To Draw Details

Description

Represents detail lines for the DownPaymentsToDraw object.

Source tables: INV11, PCh21, RIN11, RPC11, DRF11

Example

Creating a down payment (C#)
// Update PeriodCategory with SalesDownPaymentInterimAccount and PurchaseDownPaymentInterimAccount PeriodCategoryParamsCollection oPeriodCategoryColl; PeriodCategory oPerCategory; // Get Period Category Collection oPeriodCategoryColl = MainModule.oCmpSrv.GetPeriods(); // Get the current period category, e.g. the first category oPerCategory = MainModule.oCmpSrv.GetPeriod(oPeriodCategoryColl.Item(0)); // SalesDownPaymentInterimAccount is a new property, mandatory for DownPayment process oPerCategory.SalesDownPaymentInterimAccount = "2000"; // PurchaseDownPaymentInterimAccount is a new property, mandatory for DownPayment process oPerCategory.PurchaseDownPaymentInterimAccount = "2000"; MainModule.oCmpSrv.UpdatePeriod(oPerCategory); // Add a BP SAPbobsCOM.BusinessPartners oBP; oBP = (SAPbobsCOM.BusinessPartners)MainModule.oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oBusinessPartners); oBP.CardCode = "efrat"; // DownPaymentClearAct is an existing property, mandatory for DownPayment process oBP.DownPaymentClearAct = "1000"; //DownPaymentInterimAccount is a new property, mandatory for DownPayment process oBP.DownPaymentInterimAccount = "1000"; oBP.Add(); // Add two items SAPbobsCOM.Items oItem1, oItem2; oItem1 = (SAPbobsCOM.Items)MainModule.oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oItems); oItem1.ItemCode = "item1"; oItem1.InventoryItem = BoYesNoEnum.tNO; oItem1.Add(); oItem2 = (SAPbobsCOM.Items)MainModule.oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oItems); oItem2.ItemCode = "item2"; oItem2.InventoryItem = BoYesNoEnum.tNO; oItem2.Add(); // Add a DownPayment invoice SAPbobsCOM.Documents oDP; oDP = (SAPbobsCOM.Documents)MainModule.oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oDownPayments); // Set Down Payment Header Values oDP.CardCode = "efrat"; oDP.DownPaymentType = DownPaymentTypeEnum.dptInvoice; // Set Down Payment Line Values // For VatGroup A1, the DownPayment has a line with 1 item1 of unit price $10. oDP.Lines.ItemCode = "item1"; oDP.Lines.Quantity = 1; oDP.Lines.UnitPrice = 10; oDP.Lines.VatGroup = "A1"; oDP.Lines.Add(); //For VatGroup A2, the DownPayment has a line with 1 item2 of unit price $10. oDP.Lines.ItemCode = "item2"; oDP.Lines.Quantity = 1; oDP.Lines.UnitPrice = 10; oDP.Lines.VatGroup = "A2"; oDP.Add(); string sNewObjCode = ""; // Retrieve the key of the last added record, here the DocNum of DownPayment invoice created in the step MainModule.oCompany.GetNewObjectCode(out sNewObjCode); int tmpKey = Convert.ToInt32(sNewObjCode); // Pay the DownPayment invoice SAPbobsCOM.Payments oPay; oPay = (SAPbobsCOM.Payments)MainModule.oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oIncomingPayments); oPay.CardCode = "efrat"; // Set the Downpayment we created to be paid oPay.Invoices.DocEntry = tmpKey; oPay.Invoices.InvoiceType = BoRcptInvTypes.it_DownPayment; oPay.CashAccount = "1000"; oPay.CashSum = 30; oPay.Add(); // Add invoice with down payment SAPbobsCOM.Documents oINV; oINV = (SAPbobsCOM.Documents)MainModule.oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oInvoices); oINV.CardCode = "efrat"; oINV.DocType = SAPbobsCOM.BoDocumentTypes.dDocument_Items; // For VatGroup A1, the invoice has 1 item1 with unit price $10. oINV.Lines.ItemCode = "item1"; oINV.Lines.Quantity = 1; oINV.Lines.UnitPrice = 10; oINV.Lines.VatGroup = "A1"; oINV.Lines.Add(); // For VatGroup A2, the invoice has 1 item2 with unit price $20. oINV.Lines.ItemCode = "item2"; oINV.Lines.Quantity = 1; oINV.Lines.UnitPrice = 20; oINV.Lines.VatGroup = "A2"; // Link to the invoice the DownPayment that was paid. SAPbobsCOM.DownPaymentsToDraw dpm = oINV.DownPaymentsToDraw; dpm.DocEntry = tmpKey; // Draw totally $5 from the DownPayment dpm.AmountToDraw = 5; // Distribute the total amount to draw according to different VatGroups // DownPaymentsToDrawDetails is a new sub-object of DownPaymentsToDraw SAPbobsCOM.DownPaymentsToDrawDetails dpDetails = dpm.DownPaymentsToDrawDetails; // Add a DownPaymentsToDrawDetails line // Draw $2 from VatGroup A1 of the DownPayment in step 4 dpDetails.VatGroupCode = "A1"; dpDetails.AmountToDraw = 2.0; dpDetails.Add(); // Add a DownPaymentsToDrawDetails line //Draw $3 from VatGroup A2 of the DownPayment in step 4 dpDetails.VatGroupCode = "A2"; dpDetails.AmountToDraw = 3.0; // Add the invoice oINV.Add();

See Also

SAP® B1 DI-API C# definition

public class DownPaymentsToDrawDetailsClass : IDownPaymentsToDrawDetails, DownPaymentsToDrawDetails { public virtual double AmountToDraw { get; set; } public virtual double AmountToDrawFC { get; set; } public virtual double AmountToDrawSC { get; set; } public virtual int Count { get; } public virtual int DocEntry { get; } public virtual int DocInternalID { get; } public virtual double GrossAmountToDraw { get; set; } public virtual double GrossAmountToDrawFC { get; set; } public virtual double GrossAmountToDrawSC { get; set; } public virtual BoYesNoEnum IsGrossLine { get; } public virtual LineTypeEnum LineType { get; set; } public virtual int RowNum { get; set; } public virtual int SeqNum { get; } public virtual double Tax { get; set; } public virtual BoYesNoEnum TaxAdjust { get; } public virtual double TaxFC { get; set; } public virtual double TaxSC { get; set; } public virtual string VatGroupCode { get; set; } public virtual double VatPercent { get; } public extern DownPaymentsToDrawDetailsClass(); public virtual extern void Add(); public virtual extern void SetCurrentLine(int LineNum); }

API Down Payments To Draw / Down Payments To Draw Details

Description

The details for this drawn downpayment. A drawn downpayment can be applied to various tax groups and in different ways.

Property type

Read-only property

Syntax

Visual Basic
Public Property DownPaymentsToDrawDetails() As DownPaymentsToDrawDetails

See Also

Related information


Line Type Enum LineTypeEnum Enumeration
Types of detail lines for down payments to draw.
   Parent: Down Payments To Draw Details DownPaymentsToDrawDetails Object

Down Payment Type Enum DownPaymentTypeEnum Enumeration
Down payment document types.
   Parent: Down Payments To Draw DownPaymentsToDraw Object

Down Payments To Draw DownPaymentsToDraw Object
Represents down payments drawn into A/R or A/P invoices. The Documents.DownPaymentAmount property is updated with the total amount to draw. Source tables: INV9,  PCH9, RIN9, RPC9, DRF9
   Parent: Documents Documents Object· Table: OIGE OIGN


SAP® Business One is the trademark(s) or registered trademark(s) of SAP AG in Germany and in several other countries. Contact
This website is not affiliated with, maintained, authorized, endorsed or sponsored by SAP AG or any of its affiliates