if ($price_base_type != 'HT') { $pu_ht = price2num($pu_ttc / (1 + ($tva_tx/100)), 'MU'); } else { $pu_ttc = price2num($pu_ht * (1 + ($tva_tx/100)), 'MU'); } } $result = $propal->addline($propal->id, $desc, $pu_ht, $_POST["qty"], $tva_tx, $localtax1_tx, // localtax1 $localtax2_tx, // localtax2 $prod->id, $_POST["remise_percent"], $price_base_type, $pu_ttc ); if ($result > 0) { Header("Location: ".DOL_URL_ROOT."/comm/propal.php?id=".$propal->id); return; } $mesg = $langs->trans("ErrorUnknown").": $result"; } /*
$price_base_type = $prodcustprice->lines[0]->price_base_type; $prod->tva_tx = $prodcustprice->lines[0]->tva_tx; } } } // On reevalue prix selon taux tva car taux tva transaction peut etre different // de ceux du produit par defaut (par exemple si pays different entre vendeur et acheteur). if ($tva_tx != $object->tva_tx) { if ($price_base_type != 'HT') { $pu_ht = price2num($pu_ttc / (1 + $tva_tx / 100), 'MU'); } else { $pu_ttc = price2num($pu_ht * (1 + $tva_tx / 100), 'MU'); } } if (GETPOST('propalid') > 0) { $result = $propal->addline($desc, $pu_ht, GETPOST('qty'), $tva_tx, $localtax1_tx, $localtax2_tx, $object->id, GETPOST('remise_percent'), $price_base_type, $pu_ttc, 0, 0, -1, 0, 0, 0, 0, '', '', '', 0, $object->fk_unit); if ($result > 0) { header("Location: " . DOL_URL_ROOT . "/comm/propal.php?id=" . $propal->id); return; } setEventMessages($langs->trans("ErrorUnknown") . ": {$result}", null, 'errors'); } elseif (GETPOST('commandeid') > 0) { $result = $commande->addline($desc, $pu_ht, GETPOST('qty'), $tva_tx, $localtax1_tx, $localtax2_tx, $object->id, GETPOST('remise_percent'), '', '', $price_base_type, $pu_ttc, '', '', 0, -1, 0, 0, null, 0, '', 0, $object->fk_unit); if ($result > 0) { header("Location: " . DOL_URL_ROOT . "/commande/card.php?id=" . $commande->id); exit; } } elseif (GETPOST('factureid') > 0) { $result = $facture->addline($desc, $pu_ht, GETPOST('qty'), $tva_tx, $localtax1_tx, $localtax2_tx, $object->id, GETPOST('remise_percent'), '', '', '', '', '', $price_base_type, $pu_ttc, Facture::TYPE_STANDARD, -1, 0, '', 0, 0, null, 0, '', 0, 100, '', $object->fk_unit); if ($result > 0) { header("Location: " . DOL_URL_ROOT . "/compta/facture.php?facid=" . $facture->id);
{ $pu_ht = price2num($pu_ttc / (1 + ($tva_tx/100)), 'MU'); } else { $pu_ttc = price2num($pu_ht * (1 + ($tva_tx/100)), 'MU'); } } $result = $propal->addline( $propal->id, $desc, $pu_ht, GETPOST('qty'), $tva_tx, $localtax1_tx, // localtax1 $localtax2_tx, // localtax2 $prod->id, GETPOST('remise_percent'), $price_base_type, $pu_ttc ); if ($result > 0) { Header("Location: ".DOL_URL_ROOT."/comm/propal.php?id=".$propal->id); return; } $mesg = $langs->trans("ErrorUnknown").": $result"; }