Merge branch 'develop' of git@github.com:Dolibarr/dolibarr.git into develop

This commit is contained in:
Laurent Destailleur 2021-04-14 12:03:49 +02:00
commit 3a0ca6f3e1
10 changed files with 69 additions and 11 deletions

View File

@ -84,6 +84,16 @@ class mod_lot_advanced extends ModeleNumRefBatch
$texte .= '<td class="left" rowspan="2">&nbsp; <input type="submit" class="button" value="'.$langs->trans("Modify").'" name="Button"></td>';
// Option to enable custom masks per product
$texte .= '<td class="right">';
if ($conf->global->PRODUCTBATCH_LOT_USE_PRODUCT_MASKS) {
$texte .= '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?action=setmaskslot&amp;value=0">'.img_picto($langs->trans("Enabled"), 'on').'</a>';
} else {
$texte .= '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?action=setmaskslot&amp;value=1">'.img_picto($langs->trans("Disabled"), 'off').'</a>';
}
$texte .= ' '.$langs->trans('CustomMasks')."\n";
$texte .= '</td>';
$texte .= '</tr>';
$texte .= '</table>';

View File

@ -84,6 +84,16 @@ class mod_sn_advanced extends ModeleNumRefBatch
$texte .= '<td class="left" rowspan="2">&nbsp; <input type="submit" class="button" value="'.$langs->trans("Modify").'" name="Button"></td>';
// Option to enable custom masks per product
$texte .= '<td class="right">';
if ($conf->global->PRODUCTBATCH_SN_USE_PRODUCT_MASKS) {
$texte .= '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?action=setmaskssn&amp;value=0">'.img_picto($langs->trans("Enabled"), 'on').'</a>';
} else {
$texte .= '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?action=setmaskssn&amp;value=1">'.img_picto($langs->trans("Disabled"), 'off').'</a>';
}
$texte .= ' '.$langs->trans('CustomMasks')."\n";
$texte .= '</td>';
$texte .= '</tr>';
$texte .= '</table>';

View File

@ -1556,9 +1556,10 @@ class CommandeFournisseur extends CommonOrder
*
* @param User $user User making the clone
* @param int $socid Id of thirdparty
* @param int $notrigger Disable all triggers
* @return int New id of clone
*/
public function createFromClone(User $user, $socid = 0)
public function createFromClone(User $user, $socid = 0, $notrigger = 0)
{
global $conf, $user, $hookmanager;
@ -1605,7 +1606,7 @@ class CommandeFournisseur extends CommonOrder
// Create clone
$this->context['createfromclone'] = 'createfromclone';
$result = $this->create($user);
$result = $this->create($user, $notrigger);
if ($result < 0) {
$error++;
}

View File

@ -112,7 +112,7 @@ create table llx_societe
logo varchar(255) DEFAULT NULL,
logo_squarred varchar(255) DEFAULT NULL,
canvas varchar(32) DEFAULT NULL, -- type of canvas if used (null by default)
fk_entrepot integer DEFAULT NULL, -- if we need a link between third party and warehouse
fk_warehouse integer DEFAULT NULL, -- if we need a link between third party and warehouse
webservices_url varchar(255), -- supplier webservice url
webservices_key varchar(128), -- supplier webservice key

View File

@ -28,4 +28,8 @@ SerialNumberAlreadyInUse=Serial number %s is already used for product %s
TooManyQtyForSerialNumber=You can only have one product %s for serial number %s
BatchLotNumberingModules=Options for automatic generation of batch products managed by lots
BatchSerialNumberingModules=Options for automatic generation of batch products managed by serial numbers
QtyToAddAfterBarcodeScan=Qty to add for each barcode/lot/serial scanned
CustomMasks=Adds an option to define mask in the product card
LotProductTooltip=Adds an option in the product card to define a dedicated batch number mask
SNProductTooltip=Adds an option in the product card to define a dedicated serial number mask
QtyToAddAfterBarcodeScan=Qty to add for each barcode/lot/serial scanned

View File

@ -27,4 +27,7 @@ StockDetailPerBatch=Stock détaillé par lot
SerialNumberAlreadyInUse=Le numéro de série %s est déjà utilisé pour le produit %s
TooManyQtyForSerialNumber=Vous ne pouvez avoir qu'un produit %s avec le numéro de série %s
BatchLotNumberingModules=Modèle de génération et contrôle des numéros de lot
BatchSerialNumberingModules=Modèle de génération et contrôle des numéros de série
BatchSerialNumberingModules=Modèle de génération et contrôle des numéros de série
CustomMasks=Ajoute une option pour définir le masque dans la fiche produit
LotProductTooltip=Crée un champ dans la fiche produit pour définir un modèle spécifique de numéro de lot
SNProductTooltip=Crée un champ dans la fiche produit pour définir un modèle spécifique de numéro de série

View File

@ -72,6 +72,16 @@ if ($action == 'updateMaskLot') {
dolibarr_set_const($db, "PRODUCTBATCH_LOT_ADDON", $value, 'chaine', 0, '', $conf->entity);
} elseif ($action == 'setmodsn') {
dolibarr_set_const($db, "PRODUCTBATCH_SN_ADDON", $value, 'chaine', 0, '', $conf->entity);
} elseif ($action == 'setmaskslot') {
dolibarr_set_const($db, "PRODUCTBATCH_LOT_USE_PRODUCT_MASKS", $value, 'bool', 0, '', $conf->entity);
if ($value == '1' && $conf->global->PRODUCTBATCH_LOT_ADDONS !== 'mod_lot_advanced') {
dolibarr_set_const($db, "PRODUCTBATCH_LOT_ADDON", 'mod_lot_advanced', 'chaine', 0, '', $conf->entity);
}
} elseif ($action == 'setmaskssn') {
dolibarr_set_const($db, "PRODUCTBATCH_SN_USE_PRODUCT_MASKS", $value, 'bool', 0, '', $conf->entity);
if ($value == '1' && $conf->global->PRODUCTBATCH_SN_ADDONS !== 'mod_sn_advanced') {
dolibarr_set_const($db, "PRODUCTBATCH_SN_ADDON", 'mod_sn_advanced', 'chaine', 0, '', $conf->entity);
}
}
/*

View File

@ -751,7 +751,7 @@ div#moreinfo, div#infowarehouse {
border: none;
color: white;
background-color: #8c907e;
padding: 14px 28px;
padding: 14px 0px;
font-size: 16px;
cursor: pointer;
text-align: center;

View File

@ -486,7 +486,8 @@ function FreeZone() {
function TakeposOrderNotes() {
console.log("Open box to order notes");
$.colorbox({href:"freezone.php?action=addnote&place="+place+"&idline="+selectedline, onClosed: function () { Refresh(); },width:"80%", height:"250px", transition:"none", iframe:"true", title:"<?php echo $langs->trans("OrderNotes"); ?>"});
ModalBox('ModalNote');
$("#textinput").focus();
}
function Refresh() {
@ -918,6 +919,20 @@ if (empty($conf->global->TAKEPOS_HIDE_HEAD_BAR)) {
<button type="button" class="block" onclick="document.getElementById('ModalCreditNote').style.display = 'none';"><?php print $langs->trans("No"); ?></button>
</div>
</div>
</div>
<!-- Modal Note -->
<div id="ModalNote" class="modal">
<div class="modal-content">
<div class="modal-header">
<span class="close" href="#" onclick="document.getElementById('ModalNote').style.display = 'none';">&times;</span>
<h3><?php print $langs->trans("Note"); ?></h3>
</div>
<div class="modal-body">
<input type="text" class="block" id="textinput">
<button type="button" class="block" onclick="SetNote(); document.getElementById('ModalNote').style.display = 'none';">OK</button>
</div>
</div>
</div>
<div class="row1<?php if (empty($conf->global->TAKEPOS_HIDE_HEAD_BAR)) {
@ -1031,7 +1046,7 @@ if ($conf->global->TAKEPOS_BAR_RESTAURANT) {
}
}
if ($conf->global->TAKEPOS_PRINT_METHOD == "takeposconnector" && $conf->global->TAKEPOS_ORDER_NOTES == 1) {
$menus[$r++] = array('title'=>'<span class="fa fa-receipt paddingrightonly"></span><div class="trunc">'.$langs->trans("OrderNotes").'</div>', 'action'=>'TakeposOrderNotes();');
$menus[$r++] = array('title'=>'<span class="fa fa-sticky-note paddingrightonly"></span><div class="trunc">'.$langs->trans("OrderNotes").'</div>', 'action'=>'TakeposOrderNotes();');
}
if ($conf->global->TAKEPOS_SUPPLEMENTS) {
$menus[$r++] = array('title'=>'<span class="fa fa-receipt paddingrightonly"></span><div class="trunc">'.$langs->trans("ProductSupplements").'</div>', 'action'=>'LoadProducts(\'supplements\');');

View File

@ -565,9 +565,9 @@ if ($action == "freezone") {
if ($action == "addnote") {
foreach ($invoice->lines as $line) {
if ($line->id == $number) {
$line->array_options['order_notes'] = $desc;
$result = $invoice->updateline($line->id, $line->desc, $line->subprice, $line->qty, $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 ($line->id == $idline) {
$desc = GETPOST('addnote', 'alpha');
$result = $invoice->updateline($line->id, $desc, $line->subprice, $line->qty, $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);
}
}
$invoice->fetch($placeid);
@ -1019,6 +1019,11 @@ function CreditNote() {
});
}
function SetNote() {
$("#poslines").load("invoice.php?action=addnote&invoiceid="+placeid+"&idline="+selectedline+"&addnote="+$("#textinput").val(), function() {
});
}
$( document ).ready(function() {
console.log("Set customer info and sales in header placeid=<?php echo $placeid; ?> status=<?php echo $invoice->statut; ?>");