Merge branch '7.0' of git@github.com:Dolibarr/dolibarr.git into 8.0
This commit is contained in:
commit
8664594fc8
@ -651,8 +651,8 @@ if ($action == 'create')
|
||||
print "</tr>\n";
|
||||
}
|
||||
|
||||
$total_debit = price2num($total_debit);
|
||||
$total_credit = price2num($total_credit);
|
||||
$total_debit = price2num($total_debit, 'MT');
|
||||
$total_credit = price2num($total_credit, 'MT');
|
||||
|
||||
if ($total_debit != $total_credit)
|
||||
{
|
||||
|
||||
@ -1290,15 +1290,15 @@ if (empty($reshook))
|
||||
$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; // Fixme : is it not for the customer ? Shouldn't we take total_ttc ?
|
||||
if ($qualified){
|
||||
$totalamount += $lines[$i]->total_ht; // Fixme : is it not for the customer ? Shouldn't we take total_ttc ?
|
||||
$tva_tx = $lines[$i]->tva_tx;
|
||||
$amountdeposit[$tva_tx] += ($lines[$i]->total_ht * $valuedeposit) / 100;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if ($totalamount != 0) {
|
||||
if ($numlines > 0) $numlines = $numlines-1;
|
||||
$tva_tx = $lines[$numlines]->tva_tx;
|
||||
if (! empty($lines[$numlines]->vat_src_code) && ! preg_match('/\(/', $tva_tx)) $tva_tx .= ' ('.$lines[$numlines]->vat_src_code.')';
|
||||
$amountdeposit[$tva_tx] = ($totalamount * $valuedeposit) / 100;
|
||||
} else {
|
||||
if($totalamount == 0) {
|
||||
$amountdeposit[0] = 0;
|
||||
}
|
||||
} else {
|
||||
@ -1309,7 +1309,6 @@ if (empty($reshook))
|
||||
|
||||
$amount_ttc_diff = $amountdeposit[0];
|
||||
}
|
||||
|
||||
foreach ($amountdeposit as $tva => $amount)
|
||||
{
|
||||
if (empty($amount)) continue;
|
||||
@ -1322,6 +1321,7 @@ if (empty($reshook))
|
||||
} elseif ($typeamount=='variable') {
|
||||
$descline.= ' ('. $valuedeposit.'%)';
|
||||
}
|
||||
|
||||
$descline.= ' - '.$srcobject->ref;
|
||||
$result = $object->addline(
|
||||
$descline,
|
||||
|
||||
Loading…
Reference in New Issue
Block a user