FIX Sign of amount in origin currency on credit note created from lines
This commit is contained in:
parent
70b11f18b5
commit
9838199de1
@ -841,13 +841,18 @@ if (empty($reshook))
|
|||||||
$line->fk_facture = $object->id;
|
$line->fk_facture = $object->id;
|
||||||
$line->fk_parent_line = $fk_parent_line;
|
$line->fk_parent_line = $fk_parent_line;
|
||||||
|
|
||||||
$line->subprice =-$line->subprice; // invert price for object
|
$line->subprice = -$line->subprice; // invert price for object
|
||||||
$line->pa_ht = $line->pa_ht; // we choosed to have buy/cost price always positive, so no revert of sign here
|
$line->pa_ht = $line->pa_ht; // we choosed to have buy/cost price always positive, so no revert of sign here
|
||||||
$line->total_ht=-$line->total_ht;
|
$line->total_ht = -$line->total_ht;
|
||||||
$line->total_tva=-$line->total_tva;
|
$line->total_tva = -$line->total_tva;
|
||||||
$line->total_ttc=-$line->total_ttc;
|
$line->total_ttc = -$line->total_ttc;
|
||||||
$line->total_localtax1=-$line->total_localtax1;
|
$line->total_localtax1 = -$line->total_localtax1;
|
||||||
$line->total_localtax2=-$line->total_localtax2;
|
$line->total_localtax2 = -$line->total_localtax2;
|
||||||
|
|
||||||
|
$line->multicurrency_subprice = -$line->multicurrency_subprice;
|
||||||
|
$line->multicurrency_total_ht = -$line->multicurrency_total_ht;
|
||||||
|
$line->multicurrency_total_tva = -$line->multicurrency_total_tva;
|
||||||
|
$line->multicurrency_total_ttc = -$line->multicurrency_total_ttc;
|
||||||
|
|
||||||
$result = $line->insert(0, 1); // When creating credit note with same lines than source, we must ignore error if discount alreayd linked
|
$result = $line->insert(0, 1); // When creating credit note with same lines than source, we must ignore error if discount alreayd linked
|
||||||
|
|
||||||
|
|||||||
@ -1568,7 +1568,7 @@ class Facture extends CommonInvoice
|
|||||||
$facligne->desc=$remise->description; // Description ligne
|
$facligne->desc=$remise->description; // Description ligne
|
||||||
$facligne->vat_src_code=$remise->vat_src_code;
|
$facligne->vat_src_code=$remise->vat_src_code;
|
||||||
$facligne->tva_tx=$remise->tva_tx;
|
$facligne->tva_tx=$remise->tva_tx;
|
||||||
$facligne->subprice=-$remise->amount_ht;
|
$facligne->subprice = -$remise->amount_ht;
|
||||||
$facligne->fk_product=0; // Id produit predefini
|
$facligne->fk_product=0; // Id produit predefini
|
||||||
$facligne->qty=1;
|
$facligne->qty=1;
|
||||||
$facligne->remise_percent=0;
|
$facligne->remise_percent=0;
|
||||||
@ -1591,6 +1591,11 @@ class Facture extends CommonInvoice
|
|||||||
$facligne->total_tva = -$remise->amount_tva;
|
$facligne->total_tva = -$remise->amount_tva;
|
||||||
$facligne->total_ttc = -$remise->amount_ttc;
|
$facligne->total_ttc = -$remise->amount_ttc;
|
||||||
|
|
||||||
|
$facligne->multicurrency_subprice = -$remise->multicurrency_subprice;
|
||||||
|
$facligne->multicurrency_total_ht = -$remise->multicurrency_total_ht;
|
||||||
|
$facligne->multicurrency_total_tva = -$remise->multicurrency_total_tva;
|
||||||
|
$facligne->multicurrency_total_ttc = -$remise->multicurrency_total_ttc;
|
||||||
|
|
||||||
$lineid=$facligne->insert();
|
$lineid=$facligne->insert();
|
||||||
if ($lineid > 0)
|
if ($lineid > 0)
|
||||||
{
|
{
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user