View source | View content page | Page history | Printable version   
Toolbox
Main Page
Upload file
What links here
Recent changes
Help

PDF Books
Show collection (0 pages)
Collections help

Search

Projects:IDL Extension Invoices/Technical Documentation

Contents

DataSet

Some reference data are necessary to implement the new Entity "Invoices" in IDL

DataSet.png

DataSetTable.png

Process

Entity Name

Parameters

Mandatory fields *

Num Name Type
1 IsSalesOrderTransaction * boolean
2 Organization string
3 DocumentNo ** string
4 OrderReference ** string
5 DescriptionHeader string
6 TransactionDocument * string
7 InvoiceDate * date
8 AccountingDate date
9 TaxDate date
10 BusinessPartner * string
11 UserContact string
12 PriceList string
13 SalesRepresentativeCompanyAgent string
14 PrintDiscount boolean
15 FormOfPayment string
16 PaymentsTerms string
17 Project string
18 FinancialInvoiceLine boolean
19 Account string
20 Product string
21 DescriptionLine string
22 InvoicedQuantity * numeric
23 PriceListVersion numeric
24 NetUnitPrice numeric
25 NetListPrice numeric
26 Tax string
27 Process * boolean
28 Withholding string
29 ExcludeForWithholding boolean

Validations

The validate process will validate that each field has the correct type, the correct length and the not null restrictions

Load

Important

-


Invoice Header

c_invoice_id: Auto calculated

ad_client_id: Client logged

ad_org_id: Field Organization

isactive: Y

created: Now

createdby: User logged

updated: Now

updatedby: User logged

issotrx: Field IsSalesOrderTransaction

documentno: Field DocumentNo

String strDocumentNo = "";
SEInOutDocTypeData[] data = SEInOutDocTypeData.select(this, strDocTypeTarget);
if (data[0].isdocnocontrolled.equals("Y")) strDocumentNo = data[0].currentnext;
else strDocumentNo = Utility.getDocumentNo(this, vars.getClient(), "C_Invoice", false);

docstatus: DR (Draft)

docaction: CO (Complete)

processing: N

processed: N

posted: N

c_doctype_id: 0

c_doctypetarget_id: Field TransactionDocument

c_order_id: null

description: Field DescriptionHeader

isprinted: N

salesrep_id: Field SalesRepresentativeCompanyAgent

resultado.append("new Array(\"inpsalesrepId\", ");
      FieldProvider[] tld = null;
      try {
        ComboTableData comboTableData = new ComboTableData(vars, this, "TABLE", "",
            "AD_User SalesRep", "", Utility.getContext(this, vars, "#AccessibleOrgTree",
                "SEInvoiceBPartner"), Utility.getContext(this, vars, "#User_Client",
                "SEInvoiceBPartner"), 0);
        Utility.fillSQLParameters(this, vars, null, comboTableData, "SEInvoiceBPartner", "");
        tld = comboTableData.select(false);
        comboTableData = null;
      } catch (Exception ex) {
        throw new ServletException(ex);
      }

      if (tld != null && tld.length > 0) {
        resultado.append("new Array(");
        for (int i = 0; i < tld.length; i++) {
          resultado.append("new Array(\"" + tld[i].getField("id") + "\", \""
              + FormatUtilities.replaceJS(tld[i].getField("name")) + "\", \""
              + (tld[i].getField("id").equalsIgnoreCase(strUserRep) ? "true" : "false") + "\")");
          if (i < tld.length - 1)
            resultado.append(",\n");
        }
        resultado.append("\n)");
      } else
        resultado.append("null");

dateinvoiced: Field InvoiceDate

dateprinted: null

dateacct: Field AccountingDate

c_bpartner_id: Field BusinessPartner

c_bpartner_location_id: Filled with the newest location of the partner checked with isbillto = Y

poreference: Field OrderReference

isdiscountprinted: Field PrintDiscount (Default value: Y)

dateordered: null

c_currency_id: SL_Invoice_PriceList callout will be applied (Using Price List to calculate it)

SLOrderPriceListData[] data = SLOrderPriceListData.select(this, strMPriceListID);
    StringBuffer resultado = new StringBuffer();
    resultado.append("var calloutName='SL_Invoice_PriceList';\n\n");
    resultado.append("var respuesta = new Array(");
    if (data != null && data.length > 0) {
      resultado.append("new Array(\"inpistaxincluded\", \"" + data[0].istaxincluded + "\"),\n");
      resultado.append("new Array(\"inpcCurrencyId\", \"" + data[0].cCurrencyId + "\")\n");
    }

paymentrule: Field FormOfPayment

BpartnerMiscData[] data = BpartnerMiscData.select(this, strBPartner);
          String strPaymentRule = (strIsSOTrx.equals("Y") ? data[0].paymentrule : data[0].paymentrulepo);
      if (strPaymentRule.equals("") && DocBaseType.endsWith("C"))
        strPaymentRule = "P";
      else if (strPaymentRule.equals("S") || strPaymentRule.equals("U") && strIsSOTrx.equals("Y"))
        strPaymentRule = "P";
      resultado.append("new Array(\"inppaymentrule\", \"" + strPaymentRule + "\"),");

c_paymentterm_id: Field PaymentsTerms

BpartnerMiscData[] data = BpartnerMiscData.select(this, strBPartner);
      String PaymentTerm = (strIsSOTrx.equals("Y") ? data[0].cPaymenttermId
          : data[0].poPaymenttermId);
      resultado.append("new Array(\"inpcPaymenttermId\", \"" + PaymentTerm + "\"),");

c_charge_id: null

chargeamt: null

totallines: 0.00

grandtotal: 0.00

m_pricelist_id: Field PriceList

BpartnerMiscData[] data = BpartnerMiscData.select(this, strBPartner);
      String strPriceList = (strIsSOTrx.equals("Y") ? data[0].mPricelistId : data[0].poPricelistId);
      resultado.append("new Array(\"inpmPricelistId\", \""
          + (strPriceList.equals("") ? Utility.getContext(this, vars, "#M_PriceList_ID",
              strWindowId) : strPriceList) + "\"),");

istaxincluded: SL_Invoice_PriceList callout will be applied (Using Price List to calculate it)

SLOrderPriceListData[] data = SLOrderPriceListData.select(this, strMPriceListID);
    StringBuffer resultado = new StringBuffer();
    resultado.append("var calloutName='SL_Invoice_PriceList';\n\n");
    resultado.append("var respuesta = new Array(");
    if (data != null && data.length > 0) {
      resultado.append("new Array(\"inpistaxincluded\", \"" + data[0].istaxincluded + "\"),\n");
      resultado.append("new Array(\"inpcCurrencyId\", \"" + data[0].cCurrencyId + "\")\n");
    }

c_campaign_id: null

c_project_id: Field Project

c_activity_id: null

createfrom: N

generateto: N

ad_user_id: Field UserContact

try {
        ComboTableData comboTableData = new ComboTableData(vars, this, "TABLEDIR", "AD_User_ID",
            "", "AD_User C_BPartner User/Contacts", Utility.getContext(this, vars,
                "#AccessibleOrgTree", strWindowId), Utility.getContext(this, vars, "#User_Client",
                strWindowId), 0);
        Utility.fillSQLParameters(this, vars, null, comboTableData, strWindowId, "");
        tdv = comboTableData.select(false);
        comboTableData = null;
      } catch (Exception ex) {
        throw new ServletException(ex);
      }

      resultado.append("new Array(\"inpadUserId\", ");
      if (tdv != null && tdv.length > 0) {
        resultado.append("new Array(");
        for (int i = 0; i < tdv.length; i++) {
          resultado.append("new Array(\"" + tdv[i].getField("id") + "\", \""
              + FormatUtilities.replaceJS(tdv[i].getField("name")) + "\", \""
              + (tdv[i].getField("id").equalsIgnoreCase(strContact) ? "true" : "false") + "\")");
          if (i < tdv.length - 1)
            resultado.append(",\n");
        }
        resultado.append("\n)");
      } else
        resultado.append("null");

copyfrom: N

isselfservice: N

ad_orgtrx_id: null

user1_id: null

user2_id: null

withholdingamount: null

taxdate: Field TaxDate

c_withholding_id: Field Withholding

ispaid: N

totalpaid: 0.00

outstandingamt: 0.00

daystilldue: 0

dueamt: 0.00

lastcalculatedondate: null

updatepaymentmonitor: N

fin_paymentmethod_id: null

fin_payment_priority_id: null

-


Invoice Lines

c_invoiceline_id : Auto calculated

ad_client_id : Client logged

ad_org_id : Field Organization

isactive : Y

created : Now

createdby : User logged

updated : Now

updatedby : User logged

c_invoice_id : c_invoice_id from the Header

c_orderline_id : null

m_inoutline_id : null

line : Auto calculated

description : Field DescriptionLine

financial_invoice_line : Field FinancialInvoiceLine

account_id : Field Account

m_product_id : Field Product

qtyinvoiced : InvoicedQuantity

pricelist : Field NetListPrice

priceactual : Field NetUnitPrice

pricelimit

pricestd

linenetamt : SL_Invoice_Amt callout logic will be applied

LineNetAmt = qtyInvoice.multiply(priceActual);

'''c_charge_id''' : null

chargeamt : null

c_uom_id : Filled with Product data

c_tax_id : Field Tax

taxamt : SL_Invoice_Amt callout logic will be applied

SLInvoiceTaxAmtData[] dataTax = SLInvoiceTaxAmtData.select(this, strTaxId, strInvoiceId);
    BigDecimal taxRate = BigDecimal.ZERO;
    BigDecimal taxRate = BigDecimal.ZERO;
    Integer taxScale = new Integer(0);
    if (dataTax.length > 0) {
      taxRate = (dataTax[0].rate.equals("") ? new BigDecimal(1) : new BigDecimal(dataTax[0].rate));
      taxScale = new Integer(dataTax[0].priceprecision);
    }
BigDecimal taxAmt = ((LineNetAmt.multiply(taxRate)).divide(new BigDecimal("100"), 12,
BigDecimal.ROUND_HALF_EVEN)).setScale(taxScale, BigDecimal.ROUND_HALF_UP);

m_attributesetinstance_id : null

isdescription : N

quantityorder : null

m_product_uom_id : null

c_invoice_discount_id : null

c_projectline_id : null

m_offer_id : null

pricestd : Price from the price list version "Field PriceListVersion" will be used. If PriceListVersion is empty pricelist will be copied.

excludeforwithholding : Field ExcludeForWithholding

iseditlinenetamt : N

taxbaseamt numeric : SL_Invoice_Amt callout logic will be applied

LineNetAmt = qtyInvoice.multiply(priceActual);

Retrieved from "http://wiki.openbravo.com/wiki/Projects:IDL_Extension_Invoices/Technical_Documentation"

This page has been accessed 208 times. This page was last modified on 20 March 2018, at 09:40. Content is available under Creative Commons Attribution-ShareAlike 2.5 Spain License.