Merge branch 'NEW/addline_with_position_choice' of github.com:atm-gauthier/dolibarr into NEW/addline_with_position_choice_develop

This commit is contained in:
Gauthier PC portable 024 2021-11-22 16:17:55 +01:00
commit 9840c1e0fa
8 changed files with 9 additions and 17 deletions

View File

@ -1145,7 +1145,7 @@ if (empty($reshook)) {
setEventMessages($mesg, null, 'errors');
} else {
// Insert line
$result = $object->addline($desc, $pu_ht, $qty, $tva_tx, $localtax1_tx, $localtax2_tx, $idprod, $remise_percent, $price_base_type, $pu_ttc, $info_bits, $type, $rank, 0, GETPOST('fk_parent_line'), $fournprice, $buyingprice, $label, $date_start, $date_end, $array_options, $fk_unit, '', 0, $pu_ht_devise);
$result = $object->addline($desc, $pu_ht, $qty, $tva_tx, $localtax1_tx, $localtax2_tx, $idprod, $remise_percent, $price_base_type, $pu_ttc, $info_bits, $type, min($rank, count($object->lines) + 1), 0, GETPOST('fk_parent_line'), $fournprice, $buyingprice, $label, $date_start, $date_end, $array_options, $fk_unit, '', 0, $pu_ht_devise);
if ($result > 0) {
$db->commit();

View File

@ -937,7 +937,7 @@ if (empty($reshook)) {
setEventMessages($mesg, null, 'errors');
} else {
// Insert line
$result = $object->addline($desc, $pu_ht, $qty, $tva_tx, $localtax1_tx, $localtax2_tx, $idprod, $remise_percent, $info_bits, 0, $price_base_type, $pu_ttc, $date_start, $date_end, $type, $rank, 0, GETPOST('fk_parent_line'), $fournprice, $buyingprice, $label, $array_options, $fk_unit, '', 0, $pu_ht_devise);
$result = $object->addline($desc, $pu_ht, $qty, $tva_tx, $localtax1_tx, $localtax2_tx, $idprod, $remise_percent, $info_bits, 0, $price_base_type, $pu_ttc, $date_start, $date_end, $type, min($rank, count($object->lines) + 1), 0, GETPOST('fk_parent_line'), $fournprice, $buyingprice, $label, $array_options, $fk_unit, '', 0, $pu_ht_devise);
if ($result > 0) {
$ret = $object->fetch($object->id); // Reload to get new records

View File

@ -2262,7 +2262,7 @@ if (empty($reshook)) {
}
// Insert line
$result = $object->addline($desc, $pu_ht, $qty, $tva_tx, $localtax1_tx, $localtax2_tx, $idprod, $remise_percent, $date_start, $date_end, 0, $info_bits, '', $price_base_type, $pu_ttc, $type, $rank, $special_code, '', 0, GETPOST('fk_parent_line'), $fournprice, $buyingprice, $label, $array_options, $_POST['progress'], '', $fk_unit, $pu_ht_devise);
$result = $object->addline($desc, $pu_ht, $qty, $tva_tx, $localtax1_tx, $localtax2_tx, $idprod, $remise_percent, $date_start, $date_end, 0, $info_bits, '', $price_base_type, $pu_ttc, $type, min($rank, count($object->lines) + 1), $special_code, '', 0, GETPOST('fk_parent_line'), $fournprice, $buyingprice, $label, $array_options, $_POST['progress'], '', $fk_unit, $pu_ht_devise);
if ($result > 0) {
// Define output language and generate document

View File

@ -311,15 +311,8 @@ if ($nolinesbefore) {
echo '</span>';
}
if (!empty($conf->global->MAIN_VIEW_LINE_NUMBER)) {
$tab = array(-1 => $langs->trans('AtTheEnd'));
if (!empty($object->lines)) {
$langs->load('admin');
foreach ($object->lines as $k => $v) {
$tab[$v->rang] = $langs->trans('OnLine') . '&nbsp;' . ($k + 1);
}
}
echo '<br>'.$langs->trans('Position').' : '.$form->selectarray('rank', $tab);
if(!empty($conf->global->MAIN_VIEW_LINE_NUMBER)) {
echo '<br>'.$langs->trans('AddLineOnPosition').' : <input type="number" name="rank" step="1" min="0" style="width: 5em;">';
}
if (is_object($hookmanager) && empty($senderissupplier)) {

View File

@ -586,7 +586,7 @@ if (empty($reshook)) {
$pu_ht_devise,
'',
0,
$rank
min($rank, count($object->lines) + 1)
);
}
if ($idprod == -99 || $idprod == 0) {

View File

@ -1510,7 +1510,7 @@ if (empty($reshook)) {
$tva_npr,
$price_base_type,
$type,
$rank,
min($rank, count($object->lines) + 1),
0,
$array_options,
$productsupplier->fk_unit,

View File

@ -1159,5 +1159,4 @@ hasBeenValidated=%s has been validated
ClientTZ=Client Time Zone (user)
NotClosedYet=Not yet closed
ClearSignature=Signature reset
AtTheEnd=At the end
OnLine=On line
AddLineOnPosition=Add line on position (at the end if empty)

View File

@ -674,7 +674,7 @@ if (empty($reshook)) {
$pu_ttc,
$tva_npr,
$type,
$rank,
min($rank, count($object->lines) + 1),
0,
GETPOST('fk_parent_line'),
$fournprice,