Skip to content

Commit

Permalink
FIX : If we share invoice, we need to see discount created from a dep…
Browse files Browse the repository at this point in the history
…osit on each entity
  • Loading branch information
atm-gauthier committed Sep 17, 2019
1 parent 56e070c commit 2ac8bd4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion htdocs/core/class/discount.class.php
Expand Up @@ -91,7 +91,7 @@ function fetch($rowid, $fk_facture_source=0, $fk_invoice_supplier_source=0)
$sql.= " FROM ".MAIN_DB_PREFIX."societe_remise_except as sr";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."facture as f ON sr.fk_facture_source = f.rowid";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."facture as fsup ON sr.fk_invoice_supplier_source = fsup.rowid";
$sql.= " WHERE sr.entity = " . $conf->entity;
$sql.= " WHERE sr.entity IN (".getEntity('invoice').")";
if ($rowid) $sql.= " AND sr.rowid=".$rowid;
if ($fk_facture_source) $sql.= " AND sr.fk_facture_source=".$fk_facture_source;
if ($fk_invoice_supplier_source) $sql.= " AND sr.fk_invoice_supplier_source=".$fk_invoice_supplier_source;
Expand Down

0 comments on commit 2ac8bd4

Please sign in to comment.