details:   https://code.openbravo.com/erp/devel/pi/rev/86538f0c0124
changeset: 33825:86538f0c0124
user:      Armaignac <collazoandy4 <at> gmail.com>
date:      Fri Apr 06 14:37:01 2018 -0400
summary:   Fixes issue 38273:Current Balance is not updated if an invoice is 
completed when
Business Partner record is pending to be saved

If while editing a business partner a sales or purchase update the current 
balance
this value is lost when the entity is saved because has already been changed by
another user or process.

Now when another user or process update the current balance field while editing
the business partner an error message is shown saving the entity

details:   https://code.openbravo.com/erp/devel/pi/rev/eb8f5d143b93
changeset: 33826:eb8f5d143b93
user:      Alvaro Ferraz <alvaro.ferraz <at> openbravo.com>
date:      Thu Apr 12 17:07:02 2018 +0200
summary:   Related to issue 38273: Update copyright

diffstat:

 
modules/org.openbravo.advpaymentmngt/src-db/database/model/functions/APRM_GEN_PAYMENTSCHEDULE_INV.xml
 |  9 ++++++---
 
modules/org.openbravo.advpaymentmngt/src-db/database/model/functions/APRM_TAX_PAYMENT.xml
             |  5 +++--
 src-db/database/model/functions/C_BP_SOCREDITUSED_REFRESH.xml                  
                       |  5 +++--
 3 files changed, 12 insertions(+), 7 deletions(-)

diffs (77 lines):

diff -r 1828446d8690 -r eb8f5d143b93 
modules/org.openbravo.advpaymentmngt/src-db/database/model/functions/APRM_GEN_PAYMENTSCHEDULE_INV.xml
--- 
a/modules/org.openbravo.advpaymentmngt/src-db/database/model/functions/APRM_GEN_PAYMENTSCHEDULE_INV.xml
     Thu Apr 12 17:04:43 2018 +0200
+++ 
b/modules/org.openbravo.advpaymentmngt/src-db/database/model/functions/APRM_GEN_PAYMENTSCHEDULE_INV.xml
     Thu Apr 12 17:07:02 2018 +0200
@@ -657,7 +657,8 @@
         v_ConvertedAmount := COALESCE(V_OutstandingAmount, 0) * 
v_creditmultiplier;
       end if;
       UPDATE C_BPARTNER
-      SET SO_CREDITUSED = COALESCE(SO_CREDITUSED,0) + v_ConvertedAmount
+      SET SO_CREDITUSED = COALESCE(SO_CREDITUSED,0) + v_ConvertedAmount,
+      UPDATED = now()
       WHERE C_BPARTNER_ID = v_BPartner_ID;
 
       -- Automatic creation of payment and financial transaction
@@ -999,7 +1000,8 @@
                   v_ConvertedAmount := 
(COALESCE(cur_paymentschedule.OUTSTANDINGAMT, 0) * v_creditmultiplier);
                 end if;
                 UPDATE C_BPARTNER
-                SET SO_CREDITUSED = COALESCE(SO_CREDITUSED,0) - 
v_ConvertedAmount
+                SET SO_CREDITUSED = COALESCE(SO_CREDITUSED,0) - 
v_ConvertedAmount,
+                UPDATED = now()
                 WHERE C_BPARTNER_ID = v_BPartner_ID;
               END IF;
               -- Automatic creation of financial transaction
@@ -1148,7 +1150,8 @@
         v_ConvertedAmount := ((v_PaymentPlanExpectedTotal - v_PaidAmount) * 
v_creditmultiplier);
       END IF;
       UPDATE C_BPARTNER
-         SET SO_CREDITUSED = COALESCE(SO_CREDITUSED,0) - v_convertedAmount
+         SET SO_CREDITUSED = COALESCE(SO_CREDITUSED,0) - v_convertedAmount,
+         UPDATED = now()
       WHERE C_BPARTNER_ID = v_BPartner_ID;
 
       -- Delete C_InvoiceTax_CashVAT records for this invoice
diff -r 1828446d8690 -r eb8f5d143b93 
modules/org.openbravo.advpaymentmngt/src-db/database/model/functions/APRM_TAX_PAYMENT.xml
--- 
a/modules/org.openbravo.advpaymentmngt/src-db/database/model/functions/APRM_TAX_PAYMENT.xml
 Thu Apr 12 17:04:43 2018 +0200
+++ 
b/modules/org.openbravo.advpaymentmngt/src-db/database/model/functions/APRM_TAX_PAYMENT.xml
 Thu Apr 12 17:07:02 2018 +0200
@@ -16,7 +16,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) 2010-2014 Openbravo SLU
+* All portions are Copyright (C) 2010-2018 Openbravo SLU
 * All Rights Reserved.
 * Contributor(s):  ______________________________________.
 ************************************************************************/
@@ -175,7 +175,8 @@
     WHERE C_TAXPAYMENT_ID = p_record_id;
     -- Updating SO_CREDITUSED when PAYMENT OCCUR
     UPDATE C_BPARTNER
-    SET SO_CREDITUSED = SO_CREDITUSED - COALESCE(p_amount, 0)
+    SET SO_CREDITUSED = SO_CREDITUSED - COALESCE(p_amount, 0),
+    UPDATED = now()
     WHERE C_BPARTNER_ID = v_BPartner_ID; 
 
     -- Automatic creation of financial transaction
diff -r 1828446d8690 -r eb8f5d143b93 
src-db/database/model/functions/C_BP_SOCREDITUSED_REFRESH.xml
--- a/src-db/database/model/functions/C_BP_SOCREDITUSED_REFRESH.xml     Thu Apr 
12 17:04:43 2018 +0200
+++ b/src-db/database/model/functions/C_BP_SOCREDITUSED_REFRESH.xml     Thu Apr 
12 17:07:02 2018 +0200
@@ -16,7 +16,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-2009 Openbravo SLU
+* All portions are Copyright (C) 2001-2018 Openbravo SLU
 * All Rights Reserved.
 * Contributor(s):  ______________________________________.
 ************************************************************************/
@@ -42,7 +42,8 @@
       FROM C_DEBT_PAYMENT_V
       WHERE C_BPartner_ID=p_BPartner_ID
         AND C_DEBT_PAYMENT_STATUS(C_SETTLEMENT_CANCEL_ID, Cancel_Processed, 
Generate_Processed, IsPaid, IsValid, C_CashLine_ID, C_BankStatementLine_ID)='P'
-      )
+      ),
+      UPDATED = now()
     WHERE C_BPartner_ID=p_BPartner_ID;
   END IF;
 END C_BP_SOCREDITUSED_REFRESH

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Openbravo-commits mailing list
Openbravo-commits@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openbravo-commits

Reply via email to