noalyss-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Noalyss-commit] [noalyss] 35/162: Task #448 : correct bug when saving i


From: Dany De Bontridder
Subject: [Noalyss-commit] [noalyss] 35/162: Task #448 : correct bug when saving into quant_purchase
Date: Sat, 11 Jul 2020 13:23:28 -0400 (EDT)

sparkyx pushed a commit to annotated tag E-4
in repository noalyss.

commit 6029d9141418d547761ccb9838bc4a4474dc6c62
Author: Dany De Bontridder <danydb@noalyss.eu>
AuthorDate: Sat May 12 12:53:01 2018 +0200

    Task #448 : correct bug when saving into quant_purchase
---
 include/class/acc_ledger_purchase.class.php | 5 ++++-
 include/sql/patch/upgrade128.sql            | 6 +++---
 2 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/include/class/acc_ledger_purchase.class.php 
b/include/class/acc_ledger_purchase.class.php
index f1202ea..a3974d3 100644
--- a/include/class/acc_ledger_purchase.class.php
+++ b/include/class/acc_ledger_purchase.class.php
@@ -589,6 +589,7 @@ class  Acc_Ledger_Purchase extends Acc_Ledger
                 // Set the currency rate
                 $acc_amount->set_parameter("currency_rate", $p_currency_rate);
                 $acc_amount->convert_euro();
+                $amount_euro=$acc_amount->amount;
                 
                 // Compute VAT or take the given one
                 if ( $g_parameter->MY_TVA_USE=='Y')
@@ -624,6 +625,8 @@ class  Acc_Ledger_Purchase extends Acc_Ledger
 
               
                 $tot_amount=round(bcadd($tot_amount,$acc_amount->amount),2);
+                $tot_amount=round(bcadd($tot_amount,$acc_amount->amount_nd),2);
+                
$tot_amount=round(bcadd($tot_amount,$acc_amount->amount_perso),2);
 
                 /* get the account and explode if necessary */
                 $sposte=$fiche->strAttribut(ATTR_DEF_ACCOUNT);
@@ -708,7 +711,7 @@ class  Acc_Ledger_Purchase extends Acc_Ledger
                                 ,$j_id          /* 2 */
                                 ,${"e_march".$i} /* 3 */
                                 ,${"e_quant".$i}  /* 4 */
-                                ,round($acc_amount->amount,2)         /* 5 */
+                                ,round($amount_euro,2)        /* 5 */
                                 ,$acc_amount->amount_vat  /* 6 */
                                 ,$oTva->get_parameter('id') /* 7 */
                                 ,$acc_amount->amount_nd     /* 8 */
diff --git a/include/sql/patch/upgrade128.sql b/include/sql/patch/upgrade128.sql
index a491ed5..8a1bf87 100644
--- a/include/sql/patch/upgrade128.sql
+++ b/include/sql/patch/upgrade128.sql
@@ -78,9 +78,9 @@ COMMENT ON COLUMN public.currency.cr_name IS 'Name of the 
currency' ;
 
 CREATE TABLE public.operation_currency (
        id bigserial NOT NULL,
-       oc_amount numeric(6) NOT NULL, -- amount in currency
-       oc_vat_amount numeric(6) NULL DEFAULT 0, -- vat amount in currency
-       oc_price_unit numeric(6) NULL, -- unit price in currency
+       oc_amount numeric(20,6) NOT NULL, -- amount in currency
+       oc_vat_amount numeric(20,6) NULL DEFAULT 0, -- vat amount in currency
+       oc_price_unit numeric(20,6) NULL, -- unit price in currency
        j_id int8 NOT NULL, -- fk to jrnx
        CONSTRAINT operation_currency_pk PRIMARY KEY (id)
 );



reply via email to

[Prev in Thread] Current Thread [Next in Thread]