Skip to content

Commit

Permalink
Fix: Clean param
Browse files Browse the repository at this point in the history
  • Loading branch information
eldy committed Oct 7, 2013
1 parent b778700 commit 51a82a2
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions htdocs/fourn/class/fournisseur.facture.class.php
Expand Up @@ -636,7 +636,7 @@ function delete($rowid)
else {
$error++;
}

if (! $error)
{
// Delete linked object
Expand Down Expand Up @@ -1153,6 +1153,7 @@ function updateline($id, $label, $pu, $vatrate, $txlocaltax1=0, $txlocaltax2=0,
if ($type < 0) return -1;

// Clean parameters
if (empty($vatrate)) $vatrate=0;
if (empty($txlocaltax1)) $txlocaltax1=0;
if (empty($txlocaltax2)) $txlocaltax2=0;

Expand All @@ -1163,9 +1164,9 @@ function updateline($id, $label, $pu, $vatrate, $txlocaltax1=0, $txlocaltax2=0,
// qty, pu, remise_percent et txtva
// TRES IMPORTANT: C'est au moment de l'insertion ligne qu'on doit stocker
// la part ht, tva et ttc, et ce au niveau de la ligne qui a son propre taux tva.

$localtaxes_type=getLocalTaxesFromRate($vatrate,0,$this->thirdparty);

$tabprice = calcul_price_total($qty, $pu, $remise_percent, $vatrate, $txlocaltax1, $txlocaltax2, 0, $price_base_type, $info_bits, $type, $this->thirdparty,$localtaxes_type);
$total_ht = $tabprice[0];
$total_tva = $tabprice[1];
Expand Down

0 comments on commit 51a82a2

Please sign in to comment.