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

This commit is contained in:
Laurent Destailleur 2021-07-08 23:46:35 +02:00
commit d9475b8b2b
6 changed files with 39 additions and 18 deletions

View File

@ -158,6 +158,9 @@ if ($action == 'validatehistory') {
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."accounting_account as aa4 ON " . $alias_societe_perentity . ".accountancy_code_sell = aa4.account_number AND aa4.active = 1 AND aa4.fk_pcg_version = '".$db->escape($chartaccountcode)."' AND aa4.entity = ".$conf->entity;
$sql .= " WHERE f.fk_statut > 0 AND l.fk_code_ventilation <= 0";
$sql .= " AND l.product_type <= 2";
if (!empty($conf->global->ACCOUNTING_DATE_START_BINDING)) {
$sql .= " AND f.datef >= '".$db->idate($conf->global->ACCOUNTING_DATE_START_BINDING)."'";
}
dol_syslog('htdocs/accountancy/customer/index.php');
$result = $db->query($sql);

View File

@ -166,6 +166,9 @@ if ($action == 'validatehistory') {
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."accounting_account as aa4 ON " . $alias_product_perentity . ".accountancy_code_buy = aa4.account_number AND aa4.active = 1 AND aa4.fk_pcg_version = '".$db->escape($chartaccountcode)."' AND aa4.entity = ".$conf->entity;
$sql .= " WHERE f.fk_statut > 0 AND l.fk_code_ventilation <= 0";
$sql .= " AND l.product_type <= 2";
if (!empty($conf->global->ACCOUNTING_DATE_START_BINDING)) {
$sql .= " AND f.datef >= '".$db->idate($conf->global->ACCOUNTING_DATE_START_BINDING)."'";
}
dol_syslog('htdocs/accountancy/supplier/index.php');

View File

@ -1252,6 +1252,9 @@ class Form
if (is_null($ajaxoptions)) {
$ajaxoptions = array();
}
require_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
// No immediate load of all database
$placeholder = '';
if ($selected && empty($selected_input_value)) {

View File

@ -1636,42 +1636,48 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
$tooltip .= '<br>'.$langs->trans("GenericMaskCodes4a", $langs->transnoentities("Batch"), $langs->transnoentities("Batch"));
$tooltip .= '<br>'.$langs->trans("GenericMaskCodes5");
print '<tr><td id="mask_option">'.$langs->trans("ManageLotMask").'</td>';
if ($object->status_batch == '1' && $conf->global->PRODUCTBATCH_LOT_USE_PRODUCT_MASKS && $conf->global->PRODUCTBATCH_LOT_ADDON == 'mod_lot_advanced') {
$mask = !empty($object->batch_mask) ? $object->batch_mask : $conf->global->LOT_ADVANCED_MASK;
if ($object->status_batch == '1' && getDolGlobalString('PRODUCTBATCH_LOT_USE_PRODUCT_MASKS') && getDolGlobalString('PRODUCTBATCH_LOT_ADDON') == 'mod_lot_advanced') {
$mask = !empty($object->batch_mask) ? $object->batch_mask : getDolGlobalString('LOT_ADVANCED_MASK');
}
if ($object->status_batch == '2' && $conf->global->PRODUCTBATCH_SN_USE_PRODUCT_MASKS && $conf->global->PRODUCTBATCH_SN_ADDON == 'mod_sn_advanced') {
$mask = !empty($object->batch_mask) ? $object->batch_mask : $conf->global->SN_ADVANCED_MASK;
if ($object->status_batch == '2' && getDolGlobalString('PRODUCTBATCH_SN_USE_PRODUCT_MASKS') && getDolGlobalString('PRODUCTBATCH_SN_ADDON') == 'mod_sn_advanced') {
$mask = !empty($object->batch_mask) ? $object->batch_mask : getDolGlobalString('SN_ADVANCED_MASK');
}
$inherited_mask_lot = $conf->global->LOT_ADVANCED_MASK;
$inherited_mask_sn = $conf->global->SN_ADVANCED_MASK;
$inherited_mask_lot = getDolGlobalString('LOT_ADVANCED_MASK');
$inherited_mask_sn = getDolGlobalString('SN_ADVANCED_MASK');
print '<td id="field_mask">';
print $form->textwithpicto('<input type="text" class="flat minwidth175" name="batch_mask" id="batch_mask_input" value="'.$mask.'">', $tooltip, 1, 1);
print '<script type="text/javascript">
$(document).ready(function() {
$("#field_mask, #mask_option").addClass("hideobject");
var preselect = $("#status_batch option:selected");
if (preselect !== "0") {
$("#field_mask, #mask_option").toggleClass("hideobject");
}
$("#status_batch").on("change", function () {
console.log("We change batch status");
$("#field_mask").parent().addClass("hideobject");
var preselect = document.getElementById("status_batch");';
if (getDolGlobalString('PRODUCTBATCH_SN_USE_PRODUCT_MASKS')) {
print 'if (preselect.value == "2") {
$("#field_mask").parent().removeClass("hideobject");
}';
}
if (getDolGlobalString('PRODUCTBATCH_LOT_USE_PRODUCT_MASKS')) {
print 'if (preselect.value == "1") {
$("#field_mask").parent().removeClass("hideobject");
}';
}
print '$("#status_batch").on("change", function () {
var optionSelected = $("option:selected", this);
var valueSelected = this.value;
$("#field_mask, #mask_option").addClass("hideobject");
$("#field_mask").parent().addClass("hideobject");
';
if ($conf->global->PRODUCTBATCH_LOT_USE_PRODUCT_MASKS && $conf->global->PRODUCTBATCH_LOT_ADDON == 'mod_lot_advanced') {
if (getDolGlobalString('PRODUCTBATCH_LOT_USE_PRODUCT_MASKS') && getDolGlobalString('PRODUCTBATCH_LOT_ADDON') == 'mod_lot_advanced') {
print '
if (this.value == 1) {
$("#field_mask, #mask_option").toggleClass("hideobject");
$("#field_mask").parent().removeClass("hideobject");
$("#batch_mask_input").val("'.$inherited_mask_lot.'");
}
';
}
if ($conf->global->PRODUCTBATCH_SN_USE_PRODUCT_MASKS && $conf->global->PRODUCTBATCH_SN_ADDON == 'mod_sn_advanced') {
if (getDolGlobalString('PRODUCTBATCH_SN_USE_PRODUCT_MASKS') && getDolGlobalString('PRODUCTBATCH_SN_ADDON') == 'mod_sn_advanced') {
print '
if (this.value == 2) {
$("#field_mask, #mask_option").toggleClass("hideobject");
$("#field_mask").parent().removeClass("hideobject");
$("#batch_mask_input").val("'.$inherited_mask_sn.'");
}
';

View File

@ -4530,6 +4530,9 @@ div#card-errors {
.ui-dialog-content {
}
.ui-dialog.ui-corner-all.ui-widget.ui-widget-content.ui-front.ui-dialog-buttons.ui-draggable {
z-index: 1002 !important; /* Default 101 with jquery, top menu have a z-index of 1000 */
}
/* ============================================================================== */
/* For content of image preview */

View File

@ -4474,6 +4474,9 @@ div#card-errors {
font-size: <?php print $fontsize; ?>px !important;
}
.ui-dialog.ui-corner-all.ui-widget.ui-widget-content.ui-front.ui-dialog-buttons.ui-draggable {
z-index: 1002 !important; /* Default 101 with jquery, top menu have a z-index of 1000 */
}
/* ============================================================================== */
/* For content of image preview */