Prepare code to uniformize method addline.
This commit is contained in:
parent
8d1b86db49
commit
1ee67bd5b9
@ -112,8 +112,12 @@ while ($i < GEN_NUMBER_FACTURE && $result >= 0)
|
||||
$prodid = rand(1, $num_prods);
|
||||
$product=new Product($db);
|
||||
$result=$product->fetch($prodids[$prodid]);
|
||||
$result=$facture->addline($facture->id,$product->description,$product->price, rand(1,5), 0, 0, 0, $prodids[$prodid], 0, '', '', 0, 0, '', $product->price_base_type, $product->price_ttc, $product->type);
|
||||
$xnbp++;
|
||||
$result=$facture->addline($facture->id, $product->description, $product->price, rand(1,5), 0, 0, 0, $prodids[$prodid], 0, '', '', 0, 0, '', $product->price_base_type, $product->price_ttc, $product->type);
|
||||
if ($result < 0)
|
||||
{
|
||||
dol_print_error($db,$propal->error);
|
||||
}
|
||||
$xnbp++;
|
||||
}
|
||||
|
||||
print " OK with ref ".$facture->ref."\n";;
|
||||
|
||||
@ -143,7 +143,9 @@ while ($i < GEN_NUMBER_PROPAL && $result >= 0)
|
||||
while ($xnbp < $nbp)
|
||||
{
|
||||
$prodid = rand(1, $num_prods);
|
||||
$result=$propal->addline($propal->id, 'Description '.$xnbp, '100', rand(1,5), '19.6', 0, 0, $prodids[$prodid], 0);
|
||||
$product=new Product($db);
|
||||
$result=$product->fetch($prodids[$prodid]);
|
||||
$result=$propal->addline($propal->id, $product->description, $product->price, rand(1,5), 0, 0, 0, $prodids[$prodid], 0);
|
||||
if ($result < 0)
|
||||
{
|
||||
dol_print_error($db,$propal->error);
|
||||
|
||||
@ -758,7 +758,7 @@ else if ($action == 'add' && $user->rights->facture->creer)
|
||||
$product->fetch($_POST['idprod'.$i]);
|
||||
$startday=dol_mktime(12, 0, 0, $_POST['date_start'.$i.'month'], $_POST['date_start'.$i.'day'], $_POST['date_start'.$i.'year']);
|
||||
$endday=dol_mktime(12, 0, 0, $_POST['date_end'.$i.'month'], $_POST['date_end'.$i.'day'], $_POST['date_end'.$i.'year']);
|
||||
$result=$object->addline($id,$product->description,$product->price, $_POST['qty'.$i], $product->tva_tx, $product->localtax1_tx, $product->localtax2_tx, $_POST['idprod'.$i], $_POST['remise_percent'.$i], $startday, $endday, 0, 0, '', $product->price_base_type, $product->price_ttc, $product->type);
|
||||
$result=$object->addline($object->id,$product->description,$product->price, $_POST['qty'.$i], $product->tva_tx, $product->localtax1_tx, $product->localtax2_tx, $_POST['idprod'.$i], $_POST['remise_percent'.$i], $startday, $endday, 0, 0, '', $product->price_base_type, $product->price_ttc, $product->type);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -913,7 +913,7 @@ else if ($action == 'add' && $user->rights->facture->creer)
|
||||
}
|
||||
|
||||
$result = $object->addline(
|
||||
$id,
|
||||
$object->id,
|
||||
$langs->trans('Deposit'),
|
||||
$amountdeposit, //subprice
|
||||
1, //quantity
|
||||
@ -1016,7 +1016,7 @@ else if ($action == 'add' && $user->rights->facture->creer)
|
||||
}
|
||||
|
||||
$result = $object->addline(
|
||||
$id,
|
||||
$object->id,
|
||||
$desc,
|
||||
$lines[$i]->subprice,
|
||||
$lines[$i]->qty,
|
||||
@ -1093,7 +1093,7 @@ else if ($action == 'add' && $user->rights->facture->creer)
|
||||
$product->fetch($_POST['idprod'.$i]);
|
||||
$startday=dol_mktime(12, 0, 0, $_POST['date_start'.$i.'month'], $_POST['date_start'.$i.'day'], $_POST['date_start'.$i.'year']);
|
||||
$endday=dol_mktime(12, 0, 0, $_POST['date_end'.$i.'month'], $_POST['date_end'.$i.'day'], $_POST['date_end'.$i.'year']);
|
||||
$result=$object->addline($id,$product->description,$product->price, $_POST['qty'.$i], $product->tva_tx, $product->localtax1_tx, $product->localtax2_tx, $_POST['idprod'.$i], $_POST['remise_percent'.$i], $startday, $endday, 0, 0, '', $product->price_base_type, $product->price_ttc, $product->type);
|
||||
$result=$object->addline($object->id,$product->description,$product->price, $_POST['qty'.$i], $product->tva_tx, $product->localtax1_tx, $product->localtax2_tx, $_POST['idprod'.$i], $_POST['remise_percent'.$i], $startday, $endday, 0, 0, '', $product->price_base_type, $product->price_ttc, $product->type);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1311,7 +1311,7 @@ else if (($action == 'addline' || $action == 'addline_predef') && $user->rights-
|
||||
{
|
||||
// Insert line
|
||||
$result = $object->addline(
|
||||
$id,
|
||||
$object->id,
|
||||
$desc,
|
||||
$pu_ht,
|
||||
GETPOST('qty'),
|
||||
|
||||
Loading…
Reference in New Issue
Block a user