diff --git a/htdocs/admin/modules.php b/htdocs/admin/modules.php index 484c2526734..6f96506cc31 100644 --- a/htdocs/admin/modules.php +++ b/htdocs/admin/modules.php @@ -1363,7 +1363,7 @@ if ($mode == 'deploy') { $(document).ready(function() { jQuery("#fileinstall").on("change", function() { if(this.files[0].size > '.($maxmin * 1024).') { - alert("'.dol_escape_js($langs->trans("ErrorFileSizeTooLarge")).'"); + alert("'.dol_escape_js($langs->transnoentitiesnoconv("ErrorFileSizeTooLarge")).'"); this.value = ""; } }); diff --git a/htdocs/comm/propal/card.php b/htdocs/comm/propal/card.php index ec3c9a38e42..634d4624ca9 100644 --- a/htdocs/comm/propal/card.php +++ b/htdocs/comm/propal/card.php @@ -151,7 +151,6 @@ $reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action if ($reshook < 0) { setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); } - if (empty($reshook)) { $backurlforlist = DOL_URL_ROOT.'/comm/propal/list.php'; @@ -1669,7 +1668,20 @@ if (empty($reshook)) { $result = $object->set_demand_reason($user, GETPOSTINT('demand_reason_id')); } elseif ($action == 'setconditions' && $usercancreate) { // Terms of payment - $result = $object->setPaymentTerms(GETPOSTINT('cond_reglement_id'), GETPOSTINT('cond_reglement_id_deposit_percent')); + $sql = "SELECT code "; + $sql .= "FROM " . $db->prefix() . "c_payment_term"; + $sql .= " WHERE rowid = " . ((int) GETPOST('cond_reglement_id', 'int')); + $result = $db->query($sql); + if ($result) { + $obj = $db->fetch_object($result); + if ($obj->code == 'DEP30PCTDEL') { + $result = $object->setPaymentTerms(GETPOSTINT('cond_reglement_id'), GETPOSTFLOAT('cond_reglement_id_deposit_percent')); + } else { + $object->deposit_percent = 0; + $object->update($user); + $result = $object->setPaymentTerms(GETPOSTINT('cond_reglement_id'), $object->deposit_percent); + } + } //} elseif ($action == 'setremisepercent' && $usercancreate) { // $result = $object->set_remise_percent($user, price2num(GETPOST('remise_percent'), '', 2)); //} elseif ($action == 'setremiseabsolue' && $usercancreate) { diff --git a/htdocs/commande/list.php b/htdocs/commande/list.php index c1fbd552087..7f2e193eaf6 100644 --- a/htdocs/commande/list.php +++ b/htdocs/commande/list.php @@ -2720,7 +2720,7 @@ while ($i < $imaxinloop) { $productstat_cachevirtual[$generic_commande->lines[$lig]->fk_product]['stock_reel'] = $generic_product->stock_theorique; } else { $generic_product->stock_reel = $productstat_cache[$generic_commande->lines[$lig]->fk_product]['stock_reel']; - $generic_product->stock_theorique = $productstat_cachevirtual[$generic_commande->lines[$lig]->fk_product]['stock_reel'] = $generic_product->stock_theorique; + $generic_product->stock_theorique = $productstat_cachevirtual[$generic_commande->lines[$lig]->fk_product]['stock_reel']; } if ($reliquat > $generic_product->stock_reel) { diff --git a/htdocs/commande/list_det.php b/htdocs/commande/list_det.php index 9d9845532df..aa059a02bbf 100644 --- a/htdocs/commande/list_det.php +++ b/htdocs/commande/list_det.php @@ -2110,7 +2110,7 @@ if ($resql) { $productstat_cachevirtual[$obj->fk_product]['stock_reel'] = $generic_product->stock_theorique; } else { $generic_product->stock_reel = $productstat_cache[$obj->fk_product]['stock_reel']; - $generic_product->stock_theorique = $productstat_cachevirtual[$obj->fk_product]['stock_reel'] = $generic_product->stock_theorique; + $generic_product->stock_theorique = $productstat_cachevirtual[$obj->fk_product]['stock_reel']; } if ($reliquat > $generic_product->stock_reel) { diff --git a/htdocs/fourn/commande/card.php b/htdocs/fourn/commande/card.php index b89ea893078..66761d12cdd 100644 --- a/htdocs/fourn/commande/card.php +++ b/htdocs/fourn/commande/card.php @@ -1661,7 +1661,7 @@ if ($action == 'create') { if ($origin == "commande") { $cond_reglement_id = 0; $mode_reglement_id = 0; - $delivery_date = ''; + $datelivraison = ''; $objectsrc->note_private = ''; $objectsrc->note_public = ''; if ($societe = $object->thirdparty) { @@ -1685,9 +1685,9 @@ if ($action == 'create') { $demand_reason_id = (!empty($objectsrc->demand_reason_id) ? $objectsrc->demand_reason_id : (!empty($soc->demand_reason_id) ? $soc->demand_reason_id : 0)); //$remise_percent = (!empty($objectsrc->remise_percent) ? $objectsrc->remise_percent : (!empty($soc->remise_supplier_percent) ? $soc->remise_supplier_percent : 0)); //$remise_absolue = (!empty($objectsrc->remise_absolue) ? $objectsrc->remise_absolue : (!empty($soc->remise_absolue) ? $soc->remise_absolue : 0)); - $dateinvoice = !getDolGlobalString('MAIN_AUTOFILL_DATE') ? -1 : ''; + $dateinvoice = getDolGlobalString('MAIN_AUTOFILL_DATE') ? '' : -1; - $datedelivery = (!empty($objectsrc->delivery_date) ? $objectsrc->delivery_date : ''); + $datelivraison = (!empty($objectsrc->delivery_date) ? $objectsrc->delivery_date : ''); if (isModEnabled("multicurrency")) { if (!empty($objectsrc->multicurrency_code)) { @@ -1820,7 +1820,9 @@ if ($action == 'create') { $usehourmin = 1; } print img_picto('', 'action', 'class="pictofixedwidth"'); + print $form->selectDate($datelivraison ? $datelivraison : -1, 'liv_', $usehourmin, $usehourmin, 0, "set"); + print ''; // Bank Account diff --git a/htdocs/install/mysql/migration/repair.sql b/htdocs/install/mysql/migration/repair.sql index 9b4d9c7e17a..c444d7fa667 100644 --- a/htdocs/install/mysql/migration/repair.sql +++ b/htdocs/install/mysql/migration/repair.sql @@ -313,7 +313,7 @@ drop table tmp_societe_double; -- Sequence to removed duplicated values of llx_accounting_account. Run several times if you still have duplicate. drop table tmp_accounting_account_double; --select account_number, fk_pcg_version, max(rowid) as max_rowid, count(rowid) as count_rowid from llx_accounting_account where label is not null group by account_number, fk_pcg_version having count(rowid) >= 2; -create table tmp_accounting_account_double as (select account_number, fk_pcg_version, max(rowid) as max_rowid, count(rowid) as count_rowid from llx_accounting_account where label is not null group by account_number, fk_pcg_version having count(rowid) >= 2); +create table tmp_accounting_account_double as (select account_number, fk_pcg_version, entity, max(rowid) as max_rowid, count(rowid) as count_rowid from llx_accounting_account where label is not null group by account_number, fk_pcg_version, entity having count(rowid) >= 2); --select * from tmp_accounting_account_double; delete from llx_accounting_account where (rowid) in (select max_rowid from tmp_accounting_account_double); --update to avoid duplicate, delete to delete drop table tmp_accounting_account_double; diff --git a/htdocs/product/list.php b/htdocs/product/list.php index 7ceeab47c0f..be70a262538 100644 --- a/htdocs/product/list.php +++ b/htdocs/product/list.php @@ -1983,7 +1983,7 @@ while ($i < $imaxinloop) { foreach ($arraypricelevel as $key => $value) { if (!empty($arrayfields['p.sellprice'.$key]['checked'])) { print '
| '; print $langs->trans('DeliveryDate'); print ' | '; - if ($action != 'editdate_livraison' && $object->statut == SupplierProposal::STATUS_VALIDATED) { + if ($action != 'editdate_livraison' && $object->statut != SupplierProposal::STATUS_NOTSIGNED) { print 'id.'">'.img_edit($langs->transnoentitiesnoconv('SetDeliveryDate'), 1).' | '; } print '