Bug : with VAT partially deductible and negative amount , it was a balance error , to solve this , the debit is computed (by SQL query ) before inserting into JRN , it slows down the operation but the result is correct
This commit is contained in:
parent
799457785c
commit
db6340a84a
1 changed files with 3 additions and 1 deletions
|
|
@ -768,7 +768,9 @@ class Acc_Ledger_Purchase extends Acc_Ledger
|
|||
$acc_operation=new Acc_Operation($this->db);
|
||||
$acc_operation->date=$e_date;
|
||||
$acc_operation->echeance=$e_ech;
|
||||
$acc_operation->amount=abs(round($tot_debit,2));
|
||||
// Total DEB
|
||||
$acc_operation->amount=$this->db->get_value("select sum(j_montant) from jrnx where j_grpt = $1 and j_debit='t'",
|
||||
array($seq));
|
||||
$acc_operation->desc=$e_comm;
|
||||
$acc_operation->grpt=$seq;
|
||||
$acc_operation->jrn=$p_jrn;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue