Fix: [ bug #1238 ] When creating accompte with a %, free product are
used for calculation.
This commit is contained in:
parent
7db903e671
commit
c6fb7996ba
@ -38,6 +38,7 @@ Fix: Corrected project contact types translation.
|
|||||||
Fix: [ bug #1206 ] PMP price is bad calculated.
|
Fix: [ bug #1206 ] PMP price is bad calculated.
|
||||||
Fix: [ bug #520 ] Product statistics and detailed lists are wrong.
|
Fix: [ bug #520 ] Product statistics and detailed lists are wrong.
|
||||||
Fix: [ bug #1240 ] traduction.
|
Fix: [ bug #1240 ] traduction.
|
||||||
|
Fix: [ bug #1238 ] When creating accompte with a %, free product are used for calculation.
|
||||||
|
|
||||||
***** ChangeLog for 3.5 compared to 3.4.* *****
|
***** ChangeLog for 3.5 compared to 3.4.* *****
|
||||||
For users:
|
For users:
|
||||||
|
|||||||
@ -900,10 +900,14 @@ else if ($action == 'add' && $user->rights->facture->creer)
|
|||||||
{
|
{
|
||||||
$totalamount=0;
|
$totalamount=0;
|
||||||
$lines = $srcobject->lines;
|
$lines = $srcobject->lines;
|
||||||
|
|
||||||
$numlines=count($lines);
|
$numlines=count($lines);
|
||||||
for ($i=0; $i<$numlines; $i++)
|
for ($i=0; $i<$numlines; $i++)
|
||||||
{
|
{
|
||||||
$totalamount += $lines[$i]->total_ht;
|
$qualified=1;
|
||||||
|
if (empty($lines[$i]->qty)) $qualified=0; // We discard qty=0, it is an option
|
||||||
|
if (! empty($lines[$i]->special_code)) $qualified=0; // We discard special_code (frais port, ecotaxe, option, ...)
|
||||||
|
if ($qualified) $totalamount += $lines[$i]->total_ht;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($totalamount!=0)
|
if ($totalamount!=0)
|
||||||
@ -963,7 +967,6 @@ else if ($action == 'add' && $user->rights->facture->creer)
|
|||||||
|
|
||||||
$fk_parent_line=0;
|
$fk_parent_line=0;
|
||||||
$num=count($lines);
|
$num=count($lines);
|
||||||
|
|
||||||
for ($i=0;$i<$num;$i++)
|
for ($i=0;$i<$num;$i++)
|
||||||
{
|
{
|
||||||
$label=(! empty($lines[$i]->label)?$lines[$i]->label:'');
|
$label=(! empty($lines[$i]->label)?$lines[$i]->label:'');
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user