|
@@ -513,6 +513,7 @@ if (empty($reshook)) {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ // If we add a line by click on product (invoice exists here because it was created juste before if it didn't exists)
|
|
|
if ($action == "addline" && ($user->hasRight('takepos', 'run') || defined('INCLUDE_PHONEPAGE_FROM_PUBLIC_PAGE'))) {
|
|
|
$prod = new Product($db);
|
|
|
$prod->fetch($idproduct);
|
|
@@ -703,6 +704,7 @@ if (empty($reshook)) {
|
|
|
$invoice->fetch($placeid);
|
|
|
}
|
|
|
|
|
|
+ // If we add a line by submitting freezone form (invoice exists here because it was created juste before if it didn't exists)
|
|
|
if ($action == "freezone" && $user->hasRight('takepos', 'run')) {
|
|
|
$customer = new Societe($db);
|
|
|
$customer->fetch($invoice->socid);
|
|
@@ -720,7 +722,10 @@ if (empty($reshook)) {
|
|
|
$localtax1_tx = get_localtax($tva_tx, 1, $customer, $mysoc, $tva_npr);
|
|
|
$localtax2_tx = get_localtax($tva_tx, 2, $customer, $mysoc, $tva_npr);
|
|
|
|
|
|
- $invoice->addline($desc, $number, 1, $tva_tx, $localtax1_tx, $localtax2_tx, 0, 0, '', 0, 0, 0, '', getDolGlobalInt('TAKEPOS_DISCOUNT_TTC') ? ($number >= 0 ? 'HT' : 'TTC') : (getDolGlobalInt('TAKEPOS_CHANGE_PRICE_HT') ? 'HT' : 'TTC'), $number, 0, -1, 0, '', 0, 0, null, '', '', 0, 100, '', null, 0);
|
|
|
+ $res = $invoice->addline($desc, $number, 1, $tva_tx, $localtax1_tx, $localtax2_tx, 0, 0, '', 0, 0, 0, '', getDolGlobalInt('TAKEPOS_DISCOUNT_TTC') ? ($number >= 0 ? 'HT' : 'TTC') : (getDolGlobalInt('TAKEPOS_CHANGE_PRICE_HT') ? 'HT' : 'TTC'), $number, 0, -1, 0, '', 0, 0, null, '', '', 0, 100, '', null, 0);
|
|
|
+ if ($res < 0) {
|
|
|
+ dol_htmloutput_errors($invoice->error, $invoice->errors, 1);
|
|
|
+ }
|
|
|
$invoice->fetch($placeid);
|
|
|
}
|
|
|
|