details: https://code.openbravo.com/erp/devel/pi/rev/01bdbd141667 changeset: 13473:01bdbd141667 user: Javier Etxarri <javier.echarri <at> openbravo.com> date: Thu Aug 04 08:32:24 2011 +0200 summary: Fixes issue 18167: Copy lines in purchase invoices doesn't works with G/L items
details: https://code.openbravo.com/erp/devel/pi/rev/ee5049ab206c changeset: 13474:ee5049ab206c user: Javier Etxarri <javier.echarri <at> openbravo.com> date: Tue Aug 09 09:46:55 2011 +0200 summary: Fixes issue 17908: Linked items are not updated correctly diffstat: modules/org.openbravo.client.application/web/org.openbravo.client.application/js/form/ob-view-form-linked-items.js | 14 ++++++-- src/org/openbravo/erpCommon/ad_actionButton/CopyFromInvoice.java | 2 +- src/org/openbravo/erpCommon/ad_actionButton/CopyFromInvoice_data.xsql | 7 ++- src/org/openbravo/erpCommon/businessUtility/Tax.java | 16 +++++++-- 4 files changed, 27 insertions(+), 12 deletions(-) diffs (119 lines): diff -r 5b963c2ac330 -r ee5049ab206c modules/org.openbravo.client.application/web/org.openbravo.client.application/js/form/ob-view-form-linked-items.js --- a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/form/ob-view-form-linked-items.js Tue Aug 09 02:24:25 2011 +0200 +++ b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/form/ob-view-form-linked-items.js Tue Aug 09 09:46:55 2011 +0200 @@ -175,6 +175,7 @@ var windowId = this.getForm().view.standardWindow.windowId; var entityName = this.getForm().view.entity; var actionURL = OB.Application.contextUrl + 'utility/UsedByLink.html'; + var selCatItems=this.linkedItemCategoryListGrid.getSelectedRecord(); var that = this; /* loads linked items to the child grid */ @@ -192,7 +193,12 @@ that.linkedItemDS.setCacheData(usedByLinkData, true); that.linkedItemListGrid.filterData(); }; - var reqObj = { + + if (!selCatItems){ + this.linkedItemCategoryListGrid.filterEditorSubmit(); + } + else{ + var reqObj = { params: { Command: 'JSONLinkedItem', windowId: windowId, @@ -206,9 +212,9 @@ httpMethod: 'POST', useSimpleHttp: true, actionURL: actionURL - }; + }; isc.RPCManager.sendRequest(reqObj); - + } }, /** @@ -351,7 +357,7 @@ if (expanded && !this.isInitialized) { this.loadCategories(); - + this.linkedItemCategoryListGrid.filterEditorSubmit(); // this part should stay also for linked items this.isInitialized = true; } diff -r 5b963c2ac330 -r ee5049ab206c src/org/openbravo/erpCommon/ad_actionButton/CopyFromInvoice.java --- a/src/org/openbravo/erpCommon/ad_actionButton/CopyFromInvoice.java Tue Aug 09 02:24:25 2011 +0200 +++ b/src/org/openbravo/erpCommon/ad_actionButton/CopyFromInvoice.java Tue Aug 09 09:46:55 2011 +0200 @@ -110,7 +110,7 @@ String strCTaxID = Tax.get(this, data[i].productId, dataInvoice[0].dateinvoiced, dataInvoice[0].adOrgId, strWharehouse, dataInvoice[0].cBpartnerLocationId, dataInvoice[0].cBpartnerLocationId, dataInvoice[0].cProjectId, - strIsSOTrx.equals("Y")); + strIsSOTrx.equals("Y"), data[i].accountId); if ("Y".equals(strPriceListCheck)) { diff -r 5b963c2ac330 -r ee5049ab206c src/org/openbravo/erpCommon/ad_actionButton/CopyFromInvoice_data.xsql --- a/src/org/openbravo/erpCommon/ad_actionButton/CopyFromInvoice_data.xsql Tue Aug 09 02:24:25 2011 +0200 +++ b/src/org/openbravo/erpCommon/ad_actionButton/CopyFromInvoice_data.xsql Tue Aug 09 09:46:55 2011 +0200 @@ -38,7 +38,8 @@ '' AS M_PRICELIST_ID, '' AS LINE, '' AS ISSOTRX, '' AS TAXDATE, '' AS PRICESTD, '' AS VALIDFROM, - '' AS StdPrecision, '' AS PricePrecision, '' AS EnforcePriceLimit + '' AS StdPrecision, '' AS PricePrecision, '' AS EnforcePriceLimit, + C_INVOICELINE.ACCOUNT_ID AS ACCOUNT_ID FROM C_INVOICELINE LEFT OUTER JOIN C_INVOICE_DISCOUNT ON C_INVOICELINE.C_INVOICE_DISCOUNT_ID = C_INVOICE_DISCOUNT.C_INVOICE_DISCOUNT_ID LEFT OUTER JOIN C_BPARTNER_DISCOUNT ON C_INVOICE_DISCOUNT.C_DISCOUNT_ID = C_BPARTNER_DISCOUNT.C_DISCOUNT_ID @@ -61,12 +62,12 @@ CREATED, CREATEDBY, UPDATED, UPDATEDBY, LINE, DESCRIPTION, M_PRODUCT_ID, QTYINVOICED, PRICELIST, PRICEACTUAL, PRICELIMIT, LINENETAMT, C_CHARGE_ID, CHARGEAMT, C_UOM_ID, C_TAX_ID, S_RESOURCEASSIGNMENT_ID, TAXAMT, M_ATTRIBUTESETINSTANCE_ID, ISDESCRIPTION, QUANTITYORDER, M_PRODUCT_UOM_ID, - PRICESTD) + PRICESTD, ACCOUNT_ID,FINANCIAL_INVOICE_LINE) SELECT ?, ?, ?, ?, 'Y', now(), ?, now(), ?, (SELECT COALESCE(MAX(LINE),0)+10 FROM C_InvoiceLine WHERE C_Invoice_ID = ?), DESCRIPTION, M_PRODUCT_ID, QTYINVOICED, TO_NUMBER(?), TO_NUMBER(?), TO_NUMBER(?), TO_NUMBER(?), C_CHARGE_ID, CHARGEAMT, C_UOM_ID, ?, S_RESOURCEASSIGNMENT_ID, TAXAMT, M_ATTRIBUTESETINSTANCE_ID, ISDESCRIPTION, QUANTITYORDER, M_PRODUCT_UOM_ID, - PRICESTD + PRICESTD, ACCOUNT_ID,FINANCIAL_INVOICE_LINE FROM C_INVOICELINE WHERE C_INVOICELINE_ID = ? ]]> diff -r 5b963c2ac330 -r ee5049ab206c src/org/openbravo/erpCommon/businessUtility/Tax.java --- a/src/org/openbravo/erpCommon/businessUtility/Tax.java Tue Aug 09 02:24:25 2011 +0200 +++ b/src/org/openbravo/erpCommon/businessUtility/Tax.java Tue Aug 09 09:46:55 2011 +0200 @@ -34,10 +34,8 @@ String shipC_BPartner_Location_ID, String C_Project_ID, boolean IsSOTrx) throws IOException, ServletException { log4jTax.debug("Tax.get"); - return TaxData - .taxGet(conn, M_Product_ID, shipDate, AD_Org_ID, M_Warehouse_ID, - billC_BPartner_Location_ID, shipC_BPartner_Location_ID, C_Project_ID, (IsSOTrx ? "Y" - : "N")); + return Tax.get(conn, M_Product_ID, shipDate, AD_Org_ID, M_Warehouse_ID, + billC_BPartner_Location_ID, shipC_BPartner_Location_ID, C_Project_ID, IsSOTrx, ""); // FIXME: If this code is not goint be used, it should be removed /* @@ -68,6 +66,16 @@ public static String get(ConnectionProvider conn, String M_Product_ID, String shipDate, String AD_Org_ID, String M_Warehouse_ID, String billC_BPartner_Location_ID, + String shipC_BPartner_Location_ID, String C_Project_ID, boolean IsSOTrx, String account_id) + throws IOException, ServletException { + log4jTax.debug("Tax.get"); + return TaxData.taxGet(conn, M_Product_ID, shipDate, AD_Org_ID, M_Warehouse_ID, + billC_BPartner_Location_ID, shipC_BPartner_Location_ID, C_Project_ID, + (IsSOTrx ? "Y" : "N"), account_id); + } + + public static String get(ConnectionProvider conn, String M_Product_ID, String shipDate, + String AD_Org_ID, String M_Warehouse_ID, String billC_BPartner_Location_ID, String shipC_BPartner_Location_ID, String C_Project_ID, String IsSOTrx, String glItemId) throws IOException, ServletException { log4jTax.debug("Tax.get"); ------------------------------------------------------------------------------ uberSVN's rich system and user administration capabilities and model configuration take the hassle out of deploying and managing Subversion and the tools developers use with it. Learn more about uberSVN and get a free download at: http://p.sf.net/sfu/wandisco-dev2dev _______________________________________________ Openbravo-commits mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/openbravo-commits
