Merge pull request #13334 from OPEN-DSI/new-takepos-group-same-product
NEW add a parameter to group same product
This commit is contained in:
commit
5f0f376817
@ -96,3 +96,4 @@ ByTerminal=By terminal
|
||||
TakeposNumpadUsePaymentIcon=Use payment icon on numpad
|
||||
CashDeskRefNumberingModules=Numbering module for cash desk
|
||||
CashDeskGenericMaskCodes6 = <br><b>{TN}</b> tag is used to add the terminal number
|
||||
TakeposGroupSameProduct=Group same products lines
|
||||
|
||||
@ -90,6 +90,7 @@ BrowserMethodDescription=Simple and easy receipt printing. Only a few parameters
|
||||
TakeposNumpadUsePaymentIcon=Utilisation d'icônes sur les touches des modes de règlement du pavé numérique
|
||||
CashDeskRefNumberingModules=Modèles de numérotation des caisses
|
||||
CashDeskGenericMaskCodes6 = <br>La balise <b>{TN}</b> permet de rajouter le numéro du terminal
|
||||
TakeposGroupSameProduct=Regrouper les mêmes lignes de produits
|
||||
PrintMethod=Print method
|
||||
ReceiptPrinterMethodDescription=Powerful method with a lot of parameters. Full customizable with templates. Cannot print from the cloud.
|
||||
ByTerminal=By terminal
|
||||
|
||||
@ -304,6 +304,12 @@ $array = array('rowid' => 'ID', 'ref' => 'Ref', 'label' => 'Label', 'datec' => '
|
||||
print $form->selectarray('TAKEPOS_SORTPRODUCTFIELD', $array, (empty($conf->global->TAKEPOS_SORTPRODUCTFIELD) ? 'rowid' : $conf->global->TAKEPOS_SORTPRODUCTFIELD), 0, 0, 0, '', 1);
|
||||
print "</td></tr>\n";
|
||||
|
||||
print '<tr class="oddeven"><td>';
|
||||
print $langs->trans('TakeposGroupSameProduct');
|
||||
print '<td colspan="2">';
|
||||
print ajax_constantonoff("TAKEPOS_GROUP_SAME_PRODUCT", array(), $conf->entity, 0, 0, 1, 0);
|
||||
print "</td></tr>\n";
|
||||
|
||||
$substitutionarray = pdf_getSubstitutionArray($langs, null, null, 2);
|
||||
$substitutionarray['__(AnyTranslationKey)__'] = $langs->trans("Translation");
|
||||
$htmltext = '<i>'.$langs->trans("AvailableVariables").':<br>';
|
||||
|
||||
@ -326,7 +326,23 @@ if ($action == "addline")
|
||||
}
|
||||
}
|
||||
|
||||
$idoflineadded = $invoice->addline($prod->description, $price, 1, $tva_tx, $localtax1_tx, $localtax2_tx, $idproduct, $customer->remise_percent, '', 0, 0, 0, '', $price_base_type, $price_ttc, $prod->type, -1, 0, '', 0, $parent_line, null, 0, '', 0, 100, '', null, 0);
|
||||
$idoflineadded = 0;
|
||||
if (!empty($conf->global->TAKEPOS_GROUP_SAME_PRODUCT)) {
|
||||
foreach ($invoice->lines as $line) {
|
||||
if ($line->product_ref == $prod->ref) {
|
||||
$result = $invoice->updateline($line->id, $line->desc, $line->subprice, $line->qty+1, $line->remise_percent, $line->date_start, $line->date_end, $line->tva_tx, $line->localtax1_tx, $line->localtax2_tx, 'HT', $line->info_bits, $line->product_type, $line->fk_parent_line, 0, $line->fk_fournprice, $line->pa_ht, $line->label, $line->special_code, $line->array_options, $line->situation_percent, $line->fk_unit);
|
||||
if ($result < 0) {
|
||||
dol_htmloutput_errors($invoice->error, $invoice->errors, 1);
|
||||
} else {
|
||||
$idoflineadded = $line->id;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if ($idoflineadded <= 0) {
|
||||
$idoflineadded = $invoice->addline($prod->description, $price, 1, $tva_tx, $localtax1_tx, $localtax2_tx, $idproduct, $customer->remise_percent, '', 0, 0, 0, '', $price_base_type, $price_ttc, $prod->type, -1, 0, '', 0, $parent_line, null, 0, '', 0, 100, '', null, 0);
|
||||
}
|
||||
|
||||
$invoice->fetch($placeid);
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user