FIX Autoset rank on recuring invoice line was not working.
This commit is contained in:
parent
51e9a7c251
commit
3515097e4f
@ -1605,19 +1605,19 @@ if ($action == 'create') {
|
|||||||
|
|
||||||
|
|
||||||
// Lines
|
// Lines
|
||||||
print ' <form name="addproduct" id="addproduct" action="'.$_SERVER["PHP_SELF"].'?id='.$object->id.(($action != 'editline') ? '#add' : '#line_'.GETPOST('lineid', 'int')).'" method="POST">
|
print '<form name="addproduct" id="addproduct" action="'.$_SERVER["PHP_SELF"].'?id='.$object->id.(($action != 'editline') ? '#add' : '#line_'.GETPOST('lineid', 'int')).'" method="POST">';
|
||||||
<input type="hidden" name="token" value="' . newToken().'">
|
print '<input type="hidden" name="token" value="' . newToken().'">';
|
||||||
<input type="hidden" name="action" value="' . (($action != 'editline') ? 'addline' : 'updateline').'">
|
print '<input type="hidden" name="action" value="' . (($action != 'editline') ? 'addline' : 'updateline').'">';
|
||||||
<input type="hidden" name="mode" value="">
|
print '<input type="hidden" name="mode" value="">';
|
||||||
<input type="hidden" name="id" value="' . $object->id.'">
|
print '<input type="hidden" name="id" value="' . $object->id.'">';
|
||||||
';
|
print '<input type="hidden" name="page_y" value="">';
|
||||||
|
|
||||||
if (!empty($conf->use_javascript_ajax) && $object->statut == 0) {
|
if (!empty($conf->use_javascript_ajax) && $object->statut == 0) {
|
||||||
include DOL_DOCUMENT_ROOT.'/core/tpl/ajaxrow.tpl.php';
|
include DOL_DOCUMENT_ROOT.'/core/tpl/ajaxrow.tpl.php';
|
||||||
}
|
}
|
||||||
|
|
||||||
print '<div class="div-table-responsive-no-min">';
|
print '<div class="div-table-responsive-no-min">';
|
||||||
print '<table id="tablelines" class="noborder noshadow" width="100%">';
|
print '<table id="tablelines" class="noborder noshadow centpercent">';
|
||||||
// Show object lines
|
// Show object lines
|
||||||
if (!empty($object->lines)) {
|
if (!empty($object->lines)) {
|
||||||
$canchangeproduct = 1;
|
$canchangeproduct = 1;
|
||||||
|
|||||||
@ -945,6 +945,13 @@ class FactureRec extends CommonInvoice
|
|||||||
$product_type = $product->type;
|
$product_type = $product->type;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Rank to use
|
||||||
|
$ranktouse = $rang;
|
||||||
|
if ($ranktouse == -1) {
|
||||||
|
$rangmax = $this->line_max(0);
|
||||||
|
$ranktouse = $rangmax + 1;
|
||||||
|
}
|
||||||
|
|
||||||
$sql = "INSERT INTO ".MAIN_DB_PREFIX."facturedet_rec (";
|
$sql = "INSERT INTO ".MAIN_DB_PREFIX."facturedet_rec (";
|
||||||
$sql .= "fk_facture";
|
$sql .= "fk_facture";
|
||||||
$sql .= ", label";
|
$sql .= ", label";
|
||||||
@ -1003,7 +1010,7 @@ class FactureRec extends CommonInvoice
|
|||||||
$sql .= ", ".($fk_fournprice > 0 ? $fk_fournprice : 'null');
|
$sql .= ", ".($fk_fournprice > 0 ? $fk_fournprice : 'null');
|
||||||
$sql .= ", ".($pa_ht ? price2num($pa_ht) : 0);
|
$sql .= ", ".($pa_ht ? price2num($pa_ht) : 0);
|
||||||
$sql .= ", ".((int) $info_bits);
|
$sql .= ", ".((int) $info_bits);
|
||||||
$sql .= ", ".((int) $rang);
|
$sql .= ", ".((int) $ranktouse);
|
||||||
$sql .= ", ".((int) $special_code);
|
$sql .= ", ".((int) $special_code);
|
||||||
$sql .= ", ".($fk_unit ? ((int) $fk_unit) : "null");
|
$sql .= ", ".($fk_unit ? ((int) $fk_unit) : "null");
|
||||||
$sql .= ", ".(int) $this->fk_multicurrency;
|
$sql .= ", ".(int) $this->fk_multicurrency;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user