details: https://code.openbravo.com/erp/devel/pi/rev/1c1d272bdb98 changeset: 30345:1c1d272bdb98 user: Mark <markmm82 <at> gmail.com> date: Thu Jan 07 14:50:44 2016 -0500 summary: Fixes Issue 27685: The organization id is taken into account when doing Undo Year Close.
A new restriction was added to sql query to filtering by Organization. details: https://code.openbravo.com/erp/devel/pi/rev/f865e486c4a8 changeset: 30346:f865e486c4a8 user: Alvaro Ferraz <alvaro.ferraz <at> openbravo.com> date: Fri Sep 30 09:24:45 2016 +0200 summary: Related to issue 27685: Update copyright details: https://code.openbravo.com/erp/devel/pi/rev/a3c2fb154a29 changeset: 30347:a3c2fb154a29 user: Mark <markmm82 <at> gmail.com> date: Thu Sep 29 19:46:04 2016 -0400 summary: Fixes issue 33954: Recalculated next reconciliation's balance after deletion Once a non-last reconciliation is reactivated and deleted, balance for next reconciliations have been recalculated. details: https://code.openbravo.com/erp/devel/pi/rev/ed8fb0de3b97 changeset: 30348:ed8fb0de3b97 user: Alvaro Ferraz <alvaro.ferraz <at> openbravo.com> date: Fri Sep 30 09:57:00 2016 +0200 summary: Related to issue 33954: Code review improvements Avoid loop and do the update with just one query. details: https://code.openbravo.com/erp/devel/pi/rev/79f4c2e75d1f changeset: 30349:79f4c2e75d1f user: Mark <markmm82 <at> gmail.com> date: Thu Sep 29 14:59:52 2016 -0400 summary: Fixes issue 34068: Stock valuation updated to 0 by cost processes if no stock Stock valuation is updated to 0 when the stock if 0 by the Reset Unit Cost process and the Costing Background Process diffstat: modules/org.openbravo.advpaymentmngt/src-db/database/model/triggers/APRM_FIN_RECON_CHECK_TRG.xml | 16 +++++++++- src-db/database/model/functions/M_UPDATE_STOCK_VALUATION.xml | 5 +- src/org/openbravo/erpCommon/businessUtility/EndYearCloseUtility.java | 2 +- src/org/openbravo/erpCommon/businessUtility/EndYearCloseUtility_data.xsql | 6 ++- 4 files changed, 22 insertions(+), 7 deletions(-) diffs (102 lines): diff -r 25781f999994 -r 79f4c2e75d1f modules/org.openbravo.advpaymentmngt/src-db/database/model/triggers/APRM_FIN_RECON_CHECK_TRG.xml --- a/modules/org.openbravo.advpaymentmngt/src-db/database/model/triggers/APRM_FIN_RECON_CHECK_TRG.xml Thu Sep 29 10:27:32 2016 +0200 +++ b/modules/org.openbravo.advpaymentmngt/src-db/database/model/triggers/APRM_FIN_RECON_CHECK_TRG.xml Thu Sep 29 14:59:52 2016 -0400 @@ -15,12 +15,13 @@ * under the License. * The Original Code is Openbravo ERP. * The Initial Developer of the Original Code is Openbravo SLU -* All portions are Copyright (C) 2010 Openbravo SLU +* All portions are Copyright (C) 2010-2016 Openbravo SLU * All Rights Reserved. * Contributor(s): ______________________________________. *************************************************************************/ v_DateNull DATE := TO_DATE('01-01-1900','DD-MM-YYYY'); +v_balance NUMBER; BEGIN @@ -47,6 +48,19 @@ IF(:OLD.PROCESSED='Y') THEN RAISE_APPLICATION_ERROR(-20000, '@20501@'); END IF; + + --Is necessary update starting and ending balances of subsequents reconciliations + SELECT endingbalance - startingbalance + INTO v_balance + FROM fin_reconciliation + WHERE fin_reconciliation_id = :old.fin_reconciliation_id; + + UPDATE fin_reconciliation + SET startingbalance = startingbalance - v_balance, + endingbalance = endingbalance - v_balance + WHERE fin_financial_account_id = :old.fin_financial_account_id + AND statementdate > :old.statementdate; + END IF; END APRM_FIN_RECON_CHECK_TRG ]]></body> diff -r 25781f999994 -r 79f4c2e75d1f src-db/database/model/functions/M_UPDATE_STOCK_VALUATION.xml --- a/src-db/database/model/functions/M_UPDATE_STOCK_VALUATION.xml Thu Sep 29 10:27:32 2016 +0200 +++ b/src-db/database/model/functions/M_UPDATE_STOCK_VALUATION.xml Thu Sep 29 14:59:52 2016 -0400 @@ -34,7 +34,7 @@ * under the License. * The Original Code is Openbravo ERP. * The Initial Developer of the Original Code is Openbravo SLU -* All portions are Copyright (C) 2014 Openbravo SLU +* All portions are Copyright (C) 2014-2016 Openbravo SLU * All Rights Reserved. * Contributor(s): ______________________________________. ************************************************************************/ @@ -88,11 +88,10 @@ ELSE v_unit_price := ROUND(v_valuation/v_stock, v_costprecission); END IF; - IF (v_count > 0) THEN UPDATE m_stock_valuation SET stock = stock + p_stock, - stock_valuation = stock_valuation + p_valuation, + stock_valuation = (CASE WHEN v_stock = 0 THEN 0 ELSE stock_valuation + p_valuation END), unit_price = v_unit_price WHERE ad_client_id = p_client AND ad_org_id = p_org diff -r 25781f999994 -r 79f4c2e75d1f src/org/openbravo/erpCommon/businessUtility/EndYearCloseUtility.java --- a/src/org/openbravo/erpCommon/businessUtility/EndYearCloseUtility.java Thu Sep 29 10:27:32 2016 +0200 +++ b/src/org/openbravo/erpCommon/businessUtility/EndYearCloseUtility.java Thu Sep 29 14:59:52 2016 -0400 @@ -384,7 +384,7 @@ String strRegFactAcctGroupId, String strCloseFactAcctGroupId, String strDivideUpFactAcctGroupId, String strOpenUpFactAcctGroupId, String strOrgClosingId) throws ServletException { - boolean isYearNotAllowed = EndYearCloseUtilityData.selectUndoAllowed(conn, strYearId); + boolean isYearNotAllowed = EndYearCloseUtilityData.selectUndoAllowed(conn, strYearId, stradOrgId); if (isYearNotAllowed) { return "UndoNotAllowedForYear"; } diff -r 25781f999994 -r 79f4c2e75d1f src/org/openbravo/erpCommon/businessUtility/EndYearCloseUtility_data.xsql --- a/src/org/openbravo/erpCommon/businessUtility/EndYearCloseUtility_data.xsql Thu Sep 29 10:27:32 2016 +0200 +++ b/src/org/openbravo/erpCommon/businessUtility/EndYearCloseUtility_data.xsql Thu Sep 29 14:59:52 2016 -0400 @@ -12,7 +12,7 @@ * under the License. * The Original Code is Openbravo ERP. * The Initial Developer of the Original Code is Openbravo SLU - * All portions are Copyright (C) 2001-2012 Openbravo SLU + * All portions are Copyright (C) 2001-2016 Openbravo SLU * All Rights Reserved. * Contributor(s): ______________________________________. ************************************************************************ @@ -579,11 +579,13 @@ where c_year_close_v.c_year_id = c_year.c_year_id and c_year_close_v.c_calendar_id = (select c_calendar_id from c_year where c_year_id = ?) and c_year.year > (select year from c_year where c_year_id = ?) - and c_year_close_v.status <> 'O') + and c_year_close_v.status <> 'O' + and c_year_close_v.ad_org_id = ?) ]]> </Sql> <Parameter name="cYearId"/> <Parameter name="cYearId"/> + <Parameter name="cOrgId"/> </SqlMethod> <SqlMethod name="updatePeriodsOpen" type="preparedStatement" connection="true" return="rowCount"> <SqlMethodComment></SqlMethodComment> ------------------------------------------------------------------------------ _______________________________________________ Openbravo-commits mailing list Openbravo-commits@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/openbravo-commits