diff --git a/ChangeLog b/ChangeLog index 031e740e008..41f9d05f752 100644 --- a/ChangeLog +++ b/ChangeLog @@ -28,6 +28,84 @@ Following changes may create regressions for some external modules, but were nec * All functions fetch_all() are deprecated for naming consitency, use fetchAll() instead +***** ChangeLog for 16.0.1 compared to 16.0.0 ***** + +FIX: #16476 on massaction the pdf generation is not using the t… +FIX: #21416 Filter tag no-categorie in members +FIX: #21543 +FIX: #21799 inactive companies shall not be selectable for new proposals, orders and invoices +FIX: #21859 Don't show html balise on list for private/public note +FIX: #22164 +FIX: #22241 +FIX: #22263 Accountancy - Account number expected in place of a rowid on parent account on export +FIX: #22264 Accountancy - Translation on chart of accounts export +FIX: #22265 Accountancy - Account number expected in place of a rowid on export +FIX: #22334 +FIX: #22360 +FIX: #22379 creating events on supplier order +FIX: #22382 Error on length of supplier reference +FIX: #22386 IBAN not mandatory for International Export Countries +FIX: #22440 Lang Key "UserAccountNotDefined" is missing +FIX: #22482 +FIX: #22507 +FIX: Accountancy - Some manuals operations are displayed in subledger +FIX: API reception return error 500 +FIX: avoid override initial message ($this instead $object) +FIX: avoid some warnings (php8+) +FIX: Bad backtopage and CSRF on link for ticket message +FIX: bad closing select +FIX: broken feature, wrong fk_parent_line after cloning object +FIX: Column label +FIX: compatibility if javascript not actived +FIX: compatibility with Mysql <= 5.7 +FIX: contact deletion: execute trigger before really deleting +FIX: CronJob sendBackup +FIX: CSRF + lost value of constant after use save button +FIX: CSS +FIX: data integrity for llx_delivery table +FIX: default value for partnership status +FIX: deletion of the MO_CHILD link +FIX: Dictionary - Display error on cache_vatrates +FIX: Dolibarr#16476 version 2a +FIX: Duplicate creation of invoice when closing shipment linked to order +FIX: Duplicate in list when filtering on categories +FIX: extrafields with value '0' was '' +FIX: filters lost when sorting on productMargin and customerMargins +FIX: fk_expedition in $line can be usefull for triggers +FIX: Import in upgrade when using a socialnetwork field. +FIX: input hidden with fk_product of line on mo production can be usefull +FIX: inventory code must be different at each transation +FIX: inventory total columns +FIX: Issue #16476 on massaction the pdf generation is not using the thirdparty language settings +FIX: Linked object agenda card +FIX: missing check if category module is enabled +FIX: missing check if incoice as a payment (wrong status) +FIX: missing class "societe" when create another object with workflow +FIX: missing error message if image size too large +FIX: Missing reposition +FIX: missing the management of a constant in the Ticket config +FIX: Missing token in different URLs links +FIX: @ must be allowed into dol_eval to allow rules including external module string 'abc@def' +FIX: - php V8 get number doc saphir +FIX: - php V8 propal index last draft +FIX: Preview button position on documents list (case when the file is too long) +FIX: Project - on global view, missing display of ref customer +FIX: Protection against bad value into accurancy setup +FIX: reading of trackid in emailcollector (when on recipient suffix) +FIX: recruitment linked files +FIX: Remove use of code we should not have +FIX: Restore the option MAIN_OPTIMIZEFORTEXTBROWSER +FIX: Rich text is not diplayed +FIX: same thing in deleteline +FIX: Supplier Reference is lost when page breaks +FIX: support of array parameters in "add to bookmark" feature. +FIX: Test that web dir is correct in install +FIX: the shipment PDF was using the full size logo instead of small +FIX: Token Error : delete stock transfer +FIX: ToOfferALinkForOnlinePayment not translated +FIX: tooltip of technical tables added of a module +FIX: wrong result check when update expensereport line + ***** ChangeLog for 16.0.0 compared to 15.0.0 ***** @@ -236,6 +314,7 @@ Following changes may create regressions for some external modules, but were nec * Method fetch_all of DolResource has been renamed into fetchAll() to match naming conventions. * The hook 'upgrade' and 'doUpgrade2" has been renamed 'doUpgradeBefore' and 'doUpgradeAfterDB'. A new trigger 'doUpgradeAfterFiles' has been introduced. * The context hook 'suppliercard' when on the supplier tab of a thirdparty has been renamed into 'thirdpartysupplier' +* Because the module Resources highly linked to the Agenda module, the menu for Resources module has been moved into top menu Agenda. ***** ChangeLog for 15.0.3 compared to 15.0.2 ***** diff --git a/htdocs/accountancy/admin/index.php b/htdocs/accountancy/admin/index.php index 22d39dea7d0..8236b83eb3d 100644 --- a/htdocs/accountancy/admin/index.php +++ b/htdocs/accountancy/admin/index.php @@ -266,6 +266,9 @@ if (!$user->admin) { if (!empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) { print '
' . $langs->trans("ConstantIsOn", "FACTURE_DEPOSITS_ARE_JUST_PAYMENTS") . '
'; } + if (!empty($conf->global->FACTURE_SUPPLIER_DEPOSITS_ARE_JUST_PAYMENTS)) { + print '
' . $langs->trans("ConstantIsOn", "FACTURE_SUPPLIER_DEPOSITS_ARE_JUST_PAYMENTS") . '
'; + } if (!empty($conf->global->ACCOUNTANCY_USE_PRODUCT_ACCOUNT_ON_THIRDPARTY)) { print '
' . $langs->trans("ConstantIsOn", "ACCOUNTANCY_USE_PRODUCT_ACCOUNT_ON_THIRDPARTY") . '
'; } diff --git a/htdocs/accountancy/journal/purchasesjournal.php b/htdocs/accountancy/journal/purchasesjournal.php index c278429ba97..0f721a67db7 100644 --- a/htdocs/accountancy/journal/purchasesjournal.php +++ b/htdocs/accountancy/journal/purchasesjournal.php @@ -133,7 +133,7 @@ if (!empty($conf->global->MAIN_COMPANY_PERENTITY_SHARED)) { $sql .= " WHERE f.fk_statut > 0"; $sql .= " AND fd.fk_code_ventilation > 0"; $sql .= " AND f.entity IN (".getEntity('facture_fourn', 0).")"; // We don't share object for accountancy -if (!empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) { +if (!empty($conf->global->FACTURE_SUPPLIER_DEPOSITS_ARE_JUST_PAYMENTS)) { $sql .= " AND f.type IN (".FactureFournisseur::TYPE_STANDARD.",".FactureFournisseur::TYPE_REPLACEMENT.",".FactureFournisseur::TYPE_CREDIT_NOTE.",".FactureFournisseur::TYPE_SITUATION.")"; } else { $sql .= " AND f.type IN (".FactureFournisseur::TYPE_STANDARD.",".FactureFournisseur::TYPE_REPLACEMENT.",".FactureFournisseur::TYPE_CREDIT_NOTE.",".FactureFournisseur::TYPE_DEPOSIT.",".FactureFournisseur::TYPE_SITUATION.")"; @@ -764,7 +764,7 @@ if (empty($action) || $action == 'view') { $exportlink = ''; $builddate = dol_now(); $description = $langs->trans("DescJournalOnlyBindedVisible").'
'; - if (!empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) { + if (!empty($conf->global->FACTURE_SUPPLIER_DEPOSITS_ARE_JUST_PAYMENTS)) { $description .= $langs->trans("DepositsAreNotIncluded"); } else { $description .= $langs->trans("DepositsAreIncluded"); diff --git a/htdocs/accountancy/journal/variousjournal.php b/htdocs/accountancy/journal/variousjournal.php index 8f6297e480a..13ccba0d762 100644 --- a/htdocs/accountancy/journal/variousjournal.php +++ b/htdocs/accountancy/journal/variousjournal.php @@ -202,6 +202,9 @@ if ($object->nature == 2 || $object->nature == 3) { } else { $description .= $langs->trans("DepositsAreIncluded"); } + if (!empty($conf->global->FACTURE_SUPPLIER_DEPOSITS_ARE_JUST_PAYMENTS)) { + $description .= $langs->trans("SupplierDepositsAreNotIncluded"); + } } $listofchoices = array('notyet' => $langs->trans("NotYetInGeneralLedger"), 'already' => $langs->trans("AlreadyInGeneralLedger")); diff --git a/htdocs/accountancy/supplier/list.php b/htdocs/accountancy/supplier/list.php index d14beb84cc2..4593541e87a 100644 --- a/htdocs/accountancy/supplier/list.php +++ b/htdocs/accountancy/supplier/list.php @@ -342,7 +342,7 @@ if (strlen(trim($search_country))) { if (strlen(trim($search_tvaintra))) { $sql .= natural_search("s.tva_intra", $search_tvaintra); } -if (!empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) { +if (!empty($conf->global->FACTURE_SUPPLIER_DEPOSITS_ARE_JUST_PAYMENTS)) { $sql .= " AND f.type IN (".FactureFournisseur::TYPE_STANDARD.",".FactureFournisseur::TYPE_REPLACEMENT.",".FactureFournisseur::TYPE_CREDIT_NOTE.",".FactureFournisseur::TYPE_SITUATION.")"; } else { $sql .= " AND f.type IN (".FactureFournisseur::TYPE_STANDARD.",".FactureFournisseur::TYPE_REPLACEMENT.",".FactureFournisseur::TYPE_CREDIT_NOTE.",".FactureFournisseur::TYPE_DEPOSIT.",".FactureFournisseur::TYPE_SITUATION.")"; diff --git a/htdocs/compta/bank/various_payment/card.php b/htdocs/compta/bank/various_payment/card.php index 0b044f8f806..79f338cef85 100644 --- a/htdocs/compta/bank/various_payment/card.php +++ b/htdocs/compta/bank/various_payment/card.php @@ -410,7 +410,7 @@ if ($action == 'create') { // Amount print ''; print $form->editfieldkey('Amount', 'amount', '', $object, 0, 'string', '', 1).''; - print ''; + print ''; print ''; // Bank diff --git a/htdocs/compta/facture/class/facturestats.class.php b/htdocs/compta/facture/class/facturestats.class.php index 522fe9aa2e2..55ae05ff0a5 100644 --- a/htdocs/compta/facture/class/facturestats.class.php +++ b/htdocs/compta/facture/class/facturestats.class.php @@ -97,10 +97,19 @@ class FactureStats extends Stats if ($this->userid > 0) { $this->where .= ' AND f.fk_user_author = '.((int) $this->userid); } - if (!empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) { - $this->where .= " AND f.type IN (0,1,2,5)"; - } else { - $this->where .= " AND f.type IN (0,1,2,3,5)"; + if ($mode == 'customer') { + if (!empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) { + $this->where .= " AND f.type IN (0,1,2,5)"; + } else { + $this->where .= " AND f.type IN (0,1,2,3,5)"; + } + } + if ($mode == 'supplier') { + if (!empty($conf->global->FACTURE_SUPPLIER_DEPOSITS_ARE_JUST_PAYMENTS)) { + $this->where .= " AND f.type IN (0,1,2,5)"; + } else { + $this->where .= " AND f.type IN (0,1,2,3,5)"; + } } if ($typentid) { diff --git a/htdocs/compta/facture/prelevement.php b/htdocs/compta/facture/prelevement.php index c36b205b8fb..20626bb6cdf 100644 --- a/htdocs/compta/facture/prelevement.php +++ b/htdocs/compta/facture/prelevement.php @@ -260,7 +260,7 @@ if ($object->id > 0) { $resteapayeraffiche = $resteapayer; if ($type == 'bank-transfer') { - if (!empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) { // Never use this + if (!empty($conf->global->FACTURE_SUPPLIER_DEPOSITS_ARE_JUST_PAYMENTS)) { // Not recommended $filterabsolutediscount = "fk_invoice_supplier_source IS NULL"; // If we want deposit to be substracted to payments only and not to total of final invoice $filtercreditnote = "fk_invoice_supplier_source IS NOT NULL"; // If we want deposit to be substracted to payments only and not to total of final invoice } else { @@ -273,7 +273,7 @@ if ($object->id > 0) { $absolute_discount = price2num($absolute_discount, 'MT'); $absolute_creditnote = price2num($absolute_creditnote, 'MT'); } else { - if (!empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) { + if (!empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) { // Not recommended $filterabsolutediscount = "fk_facture_source IS NULL"; // If we want deposit to be substracted to payments only and not to total of final invoice $filtercreditnote = "fk_facture_source IS NOT NULL"; // If we want deposit to be substracted to payments only and not to total of final invoice } else { diff --git a/htdocs/compta/journal/purchasesjournal.php b/htdocs/compta/journal/purchasesjournal.php index 2c7c5d42156..28eee624db2 100644 --- a/htdocs/compta/journal/purchasesjournal.php +++ b/htdocs/compta/journal/purchasesjournal.php @@ -95,7 +95,7 @@ $periodlink = ''; $exportlink = ''; $builddate = dol_now(); $description = $langs->trans("DescPurchasesJournal").'
'; -if (!empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) { +if (!empty($conf->global->FACTURE_SUPPLIER_DEPOSITS_ARE_JUST_PAYMENTS)) { $description .= $langs->trans("DepositsAreNotIncluded"); } else { $description .= $langs->trans("DepositsAreIncluded"); @@ -119,7 +119,7 @@ $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."product as p ON p.rowid = fd.fk_product"; $sql .= " JOIN ".MAIN_DB_PREFIX."facture_fourn as f ON f.rowid = fd.fk_facture_fourn"; $sql .= " JOIN ".MAIN_DB_PREFIX."societe as s ON s.rowid = f.fk_soc"; $sql .= " WHERE f.fk_statut > 0 AND f.entity IN (".getEntity('invoice').")"; -if (!empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) { +if (!empty($conf->global->FACTURE_SUPPLIER_DEPOSITS_ARE_JUST_PAYMENTS)) { $sql .= " AND f.type IN (0,1,2)"; } else { $sql .= " AND f.type IN (0,1,2,3)"; diff --git a/htdocs/compta/localtax/quadri_detail.php b/htdocs/compta/localtax/quadri_detail.php index 0dfb0ab3c6d..9e03f156848 100644 --- a/htdocs/compta/localtax/quadri_detail.php +++ b/htdocs/compta/localtax/quadri_detail.php @@ -194,6 +194,9 @@ if ($conf->global->TAX_MODE_SELL_SERVICE == 'payment') $description.='
'.$lan if (!empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) { $description.='
'.$langs->trans("DepositsAreNotIncluded"); } +if (! empty($conf->global->FACTURE_SUPPLIER_DEPOSITS_ARE_JUST_PAYMENTS)) { + $description.='
'.$langs->trans("SupplierDepositsAreNotIncluded"); +} */ if (!empty($conf->global->MAIN_MODULE_ACCOUNTING)) { $description .= $langs->trans("ThisIsAnEstimatedValue"); diff --git a/htdocs/compta/resultat/clientfourn.php b/htdocs/compta/resultat/clientfourn.php index cd2106e50a4..908d0ae4ac2 100644 --- a/htdocs/compta/resultat/clientfourn.php +++ b/htdocs/compta/resultat/clientfourn.php @@ -189,6 +189,9 @@ if ($modecompta == "CREANCES-DETTES") { } else { $description .= $langs->trans("DepositsAreIncluded"); } + if (!empty($conf->global->FACTURE_SUPPLIER_DEPOSITS_ARE_JUST_PAYMENTS)) { + $description .= $langs->trans("SupplierDepositsAreNotIncluded"); + } $builddate = dol_now(); //$exportlink=$langs->trans("NotYetAvailable"); } elseif ($modecompta == "RECETTES-DEPENSES") { @@ -637,7 +640,7 @@ if ($modecompta == 'BOOKKEEPING') { $sql .= ", ".MAIN_DB_PREFIX."facture_fourn as f"; $sql .= " WHERE f.fk_soc = s.rowid"; $sql .= " AND f.fk_statut IN (1,2)"; - if (!empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) { + if (!empty($conf->global->FACTURE_SUPPLIER_DEPOSITS_ARE_JUST_PAYMENTS)) { $sql .= " AND f.type IN (0,1,2)"; } else { $sql .= " AND f.type IN (0,1,2,3)"; @@ -1341,7 +1344,7 @@ if ($modecompta == 'BOOKKEEPING') { $sql = "SELECT date_format(f.datef,'%Y-%m') as dm, sum(f.total_tva) as amount"; $sql .= " FROM ".MAIN_DB_PREFIX."facture_fourn as f"; $sql .= " WHERE f.fk_statut IN (1,2)"; - if (!empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) { + if (!empty($conf->global->FACTURE_SUPPLIER_DEPOSITS_ARE_JUST_PAYMENTS)) { $sql .= " AND f.type IN (0,1,2)"; } else { $sql .= " AND f.type IN (0,1,2,3)"; diff --git a/htdocs/compta/resultat/index.php b/htdocs/compta/resultat/index.php index 5b2ca11be54..4012994be58 100644 --- a/htdocs/compta/resultat/index.php +++ b/htdocs/compta/resultat/index.php @@ -165,6 +165,9 @@ if ($modecompta == 'CREANCES-DETTES') { } else { $description .= "
".$langs->trans("DepositsAreIncluded"); } + if (!empty($conf->global->FACTURE_SUPPLIER_DEPOSITS_ARE_JUST_PAYMENTS)) { + $description .= $langs->trans("SupplierDepositsAreNotIncluded"); + } $builddate = dol_now(); //$exportlink=$langs->trans("NotYetAvailable"); } elseif ($modecompta == "RECETTES-DEPENSES") { @@ -330,7 +333,7 @@ if (isModEnabled('facture') && ($modecompta == 'CREANCES-DETTES' || $modecompta $sql = "SELECT sum(f.total_ht) as amount_ht, sum(f.total_ttc) as amount_ttc, date_format(f.datef,'%Y-%m') as dm"; $sql .= " FROM ".MAIN_DB_PREFIX."facture_fourn as f"; $sql .= " WHERE f.fk_statut IN (1,2)"; - if (!empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) { + if (!empty($conf->global->FACTURE_SUPPLIER_DEPOSITS_ARE_JUST_PAYMENTS)) { $sql .= " AND f.type IN (0,1,2)"; } else { $sql .= " AND f.type IN (0,1,2,3)"; @@ -438,7 +441,7 @@ if (isModEnabled('tax') && ($modecompta == 'CREANCES-DETTES' || $modecompta == " $sql = "SELECT sum(f.total_tva) as amount, date_format(f.datef,'%Y-%m') as dm"; $sql .= " FROM ".MAIN_DB_PREFIX."facture_fourn as f"; $sql .= " WHERE f.fk_statut IN (1,2)"; - if (!empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) { + if (!empty($conf->global->FACTURE_SUPPLIER_DEPOSITS_ARE_JUST_PAYMENTS)) { $sql .= " AND f.type IN (0,1,2)"; } else { $sql .= " AND f.type IN (0,1,2,3)"; diff --git a/htdocs/compta/resultat/result.php b/htdocs/compta/resultat/result.php index 9a5a8325448..15c369b7a52 100644 --- a/htdocs/compta/resultat/result.php +++ b/htdocs/compta/resultat/result.php @@ -205,6 +205,9 @@ if ($modecompta == "CREANCES-DETTES") { } else { $description .= $langs->trans("DepositsAreIncluded"); } + if (!empty($conf->global->FACTURE_SUPPLIER_DEPOSITS_ARE_JUST_PAYMENTS)) { + $description .= $langs->trans("SupplierDepositsAreNotIncluded"); + } $builddate = dol_now(); //$exportlink=$langs->trans("NotYetAvailable"); } elseif ($modecompta == "RECETTES-DEPENSES") { @@ -231,8 +234,6 @@ if ($modecompta == "CREANCES-DETTES") { $exportlink = ''; $description = $langs->trans("RulesResultBookkeepingPersonalized"); $description .= ' ('.$langs->trans("SeePageForSetup", DOL_URL_ROOT.'/accountancy/admin/categories_list.php?search_country_id='.$mysoc->country_id.'&mainmenu=accountancy&leftmenu=accountancy_admin', $langs->transnoentitiesnoconv("Accountancy").' / '.$langs->transnoentitiesnoconv("Setup").' / '.$langs->transnoentitiesnoconv("AccountingCategory")).')'; - //if (!empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) $description.= $langs->trans("DepositsAreNotIncluded"); - //else $description.= $langs->trans("DepositsAreIncluded"); $builddate = dol_now(); } diff --git a/htdocs/compta/stats/byratecountry.php b/htdocs/compta/stats/byratecountry.php index f19c37fb84a..fb8ad4de1a5 100644 --- a/htdocs/compta/stats/byratecountry.php +++ b/htdocs/compta/stats/byratecountry.php @@ -225,7 +225,9 @@ if ($conf->global->TAX_MODE_SELL_SERVICE == 'payment') { if (!empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) { $description .= '
'.$langs->trans("DepositsAreNotIncluded"); } - +if (!empty($conf->global->FACTURE_SUPPLIER_DEPOSITS_ARE_JUST_PAYMENTS)) { + $description .= $langs->trans("SupplierDepositsAreNotIncluded"); +} // Customers invoices $elementcust = $langs->trans("CustomersInvoices"); $productcust = $langs->trans("ProductOrService"); @@ -256,6 +258,9 @@ if ($modecompta == "CREANCES-DETTES") { } else { $description .= $langs->trans("DepositsAreIncluded"); } + if (!empty($conf->global->FACTURE_SUPPLIER_DEPOSITS_ARE_JUST_PAYMENTS)) { + $description .= $langs->trans("SupplierDepositsAreNotIncluded"); + } $builddate = dol_now(); } elseif ($modecompta == "RECETTES-DEPENSES") { @@ -406,7 +411,7 @@ if ($modecompta == 'CREANCES-DETTES') { $sql2 .= " WHERE ff.datef >= '".$db->idate($date_start)."'"; $sql2 .= " AND ff.datef <= '".$db->idate($date_end)."'"; $sql .= " AND ff.fk_statut in (1,2)"; - if (!empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) { + if (!empty($conf->global->FACTURE_SUPPLIER_DEPOSITS_ARE_JUST_PAYMENTS)) { $sql .= " AND ff.type IN (0,1,2,5)"; } else { $sql .= " AND ff.type IN (0,1,2,3,5)"; diff --git a/htdocs/compta/stats/cabyprodserv.php b/htdocs/compta/stats/cabyprodserv.php index 80a0a47538d..dc0fa94030c 100644 --- a/htdocs/compta/stats/cabyprodserv.php +++ b/htdocs/compta/stats/cabyprodserv.php @@ -247,7 +247,6 @@ if ($modecompta == "CREANCES-DETTES") { } else { $description .= $langs->trans("DepositsAreIncluded"); } - $builddate = dol_now(); } elseif ($modecompta == "RECETTES-DEPENSES") { $name = $langs->trans("TurnoverCollected").', '.$langs->trans("ByProductsAndServices"); diff --git a/htdocs/compta/tva/clients.php b/htdocs/compta/tva/clients.php index aa639804ba0..d0ed3032684 100644 --- a/htdocs/compta/tva/clients.php +++ b/htdocs/compta/tva/clients.php @@ -154,6 +154,9 @@ if ($conf->global->TAX_MODE_SELL_SERVICE == 'payment') { if (!empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) { $description .= '
'.$langs->trans("DepositsAreNotIncluded"); } +if (!empty($conf->global->FACTURE_SUPPLIER_DEPOSITS_ARE_JUST_PAYMENTS)) { + $description .= $langs->trans("SupplierDepositsAreNotIncluded"); +} if (!empty($conf->global->MAIN_MODULE_ACCOUNTING)) { $description .= '
'.$langs->trans("ThisIsAnEstimatedValue"); } diff --git a/htdocs/compta/tva/index.php b/htdocs/compta/tva/index.php index 16b24361160..f0efe305d8c 100644 --- a/htdocs/compta/tva/index.php +++ b/htdocs/compta/tva/index.php @@ -211,6 +211,9 @@ if ($conf->global->TAX_MODE_SELL_SERVICE == 'payment') { if (!empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) { $description .= '
'.$langs->trans("DepositsAreNotIncluded"); } +if (!empty($conf->global->FACTURE_SUPPLIER_DEPOSITS_ARE_JUST_PAYMENTS)) { + $description .= $langs->trans("SupplierDepositsAreNotIncluded"); +} if (!empty($conf->global->MAIN_MODULE_ACCOUNTING)) { $description .= '
'.$langs->trans("ThisIsAnEstimatedValue"); } diff --git a/htdocs/compta/tva/quadri_detail.php b/htdocs/compta/tva/quadri_detail.php index 18b3c9c6b86..997c90e083c 100644 --- a/htdocs/compta/tva/quadri_detail.php +++ b/htdocs/compta/tva/quadri_detail.php @@ -164,6 +164,9 @@ if ($conf->global->TAX_MODE_SELL_SERVICE == 'payment') { if (!empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) { $description .= '
'.$langs->trans("DepositsAreNotIncluded"); } +if (!empty($conf->global->FACTURE_SUPPLIER_DEPOSITS_ARE_JUST_PAYMENTS)) { + $description .= $langs->trans("SupplierDepositsAreNotIncluded"); +} if (!empty($conf->global->MAIN_MODULE_ACCOUNTING)) { $description .= '
'.$langs->trans("ThisIsAnEstimatedValue"); } diff --git a/htdocs/contrat/class/contrat.class.php b/htdocs/contrat/class/contrat.class.php index 2a8d1b815a7..8ebfc82676a 100644 --- a/htdocs/contrat/class/contrat.class.php +++ b/htdocs/contrat/class/contrat.class.php @@ -1707,8 +1707,8 @@ class Contrat extends CommonObject $total_localtax1 = $tabprice[9]; $total_localtax2 = $tabprice[10]; - $localtax1_type = $localtaxes_type[0]; - $localtax2_type = $localtaxes_type[2]; + $localtax1_type = (empty($localtaxes_type[0]) ? '' : $localtaxes_type[0]); + $localtax2_type = (empty($localtaxes_type[2]) ? '' : $localtaxes_type[2]); // TODO A virer // Anciens indicateurs: $price, $remise (a ne plus utiliser) @@ -1741,8 +1741,8 @@ class Contrat extends CommonObject $sql .= ",tva_tx = ".((float) price2num($tvatx)); $sql .= ",localtax1_tx = ".((float) price2num($localtax1tx)); $sql .= ",localtax2_tx = ".((float) price2num($localtax2tx)); - $sql .= ",localtax1_type='".$this->db->escape($localtax1_type); - $sql .= ",localtax2_type='".$this->db->escape($localtax2_type); + $sql .= ",localtax1_type='".$this->db->escape($localtax1_type)."'"; + $sql .= ",localtax2_type='".$this->db->escape($localtax2_type)."'"; $sql .= ", total_ht = ".((float) price2num($total_ht)); $sql .= ", total_tva = ".((float) price2num($total_tva)); $sql .= ", total_localtax1 = ".((float) price2num($total_localtax1)); diff --git a/htdocs/core/class/commoninvoice.class.php b/htdocs/core/class/commoninvoice.class.php index 41dec1e8fb7..7c45e6523f5 100644 --- a/htdocs/core/class/commoninvoice.class.php +++ b/htdocs/core/class/commoninvoice.class.php @@ -175,7 +175,7 @@ abstract class CommonInvoice extends CommonObject /** * Return amount (with tax) of all deposits invoices used by invoice. * Should always be empty, except if option FACTURE_DEPOSITS_ARE_JUST_PAYMENTS is on for sale invoices (not recommended), - * of FACTURE_SUPPLIER_DEPOSITS_ARE_JUST_PAYMENTS is on for purchase invoices (not recommended). + * of FACTURE_SUPPLIER_DEPOSITS_ARE_JUST_PAYMENTS is on for purchase invoices (not recommended). * * @param int $multicurrency Return multicurrency_amount instead of amount * @return float <0 and set ->error if KO, Sum of deposits amount otherwise @@ -183,7 +183,7 @@ abstract class CommonInvoice extends CommonObject public function getSumDepositsUsed($multicurrency = 0) { /*if ($this->element == 'facture_fourn' || $this->element == 'invoice_supplier') { - // FACTURE_DEPOSITS_ARE_JUST_PAYMENTS was never supported for purchase invoice, so we can return 0 with no need of SQL for this case. + // FACTURE_SUPPLIER_DEPOSITS_ARE_JUST_PAYMENTS was never supported for purchase invoice, so we can return 0 with no need of SQL for this case. return 0.0; }*/ @@ -379,7 +379,7 @@ abstract class CommonInvoice extends CommonObject $sql = "SELECT rc.amount_ttc as amount, rc.multicurrency_amount_ttc as multicurrency_amount, rc.datec as date, f.ref as ref, rc.description as type"; $sql .= ' FROM '.$this->db->prefix().'societe_remise_except as rc, '.$this->db->prefix().'facture_fourn as f'; $sql .= ' WHERE rc.fk_invoice_supplier_source=f.rowid AND rc.fk_invoice_supplier = '.((int) $this->id); - $sql .= ' AND (f.type = 2 OR f.type = 0 OR f.type = 3)'; // Find discount coming from credit note or excess received or deposits (payments from deposits are always null except if FACTURE_DEPOSITS_ARE_JUST_PAYMENTS is set) + $sql .= ' AND (f.type = 2 OR f.type = 0 OR f.type = 3)'; // Find discount coming from credit note or excess received or deposits (payments from deposits are always null except if FACTURE_SUPPLIER_DEPOSITS_ARE_JUST_PAYMENTS is set) } if ($sql) { diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 7224949a70b..508129ba141 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -4410,7 +4410,7 @@ abstract class CommonObject $nb_rows_affected = $this->db->affected_rows($resql); // should be 1 or 0 if status was already correct - if ($nb_rows_affected >= 0) { + if ($nb_rows_affected > 0) { if (empty($trigkey)) { // Try to guess trigkey (for backward compatibility, now we should have trigkey defined into the call of setStatus) if ($this->element == 'supplier_proposal' && $status == 2) { diff --git a/htdocs/core/class/discount.class.php b/htdocs/core/class/discount.class.php index dff1383a629..052d5ae7e1c 100644 --- a/htdocs/core/class/discount.class.php +++ b/htdocs/core/class/discount.class.php @@ -559,7 +559,7 @@ class DiscountAbsolute /** * Return amount (with tax) of all deposits invoices used by invoice as a payment. - * Should always be empty, except if option FACTURE_DEPOSITS_ARE_JUST_PAYMENTS is on (not recommended). + * Should always be empty, except if option FACTURE_DEPOSITS_ARE_JUST_PAYMENTS or FACTURE_SUPPLIER_DEPOSITS_ARE_JUST_PAYMENTS is on (not recommended). * * @param CommonInvoice $invoice Object invoice (customer of supplier) * @param int $multicurrency 1=Return multicurrency_amount instead of amount. TODO Add a mode multicurrency = -1 to return array with amount + multicurrency amount diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 6ae2e0d1a29..1479717b411 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -5759,7 +5759,7 @@ class Form print ''; print '
'; if (!empty($discount_type)) { - if (!empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) { + if (!empty($conf->global->FACTURE_SUPPLIER_DEPOSITS_ARE_JUST_PAYMENTS)) { if (!$filter || $filter == "fk_invoice_supplier_source IS NULL") { $translationKey = 'HasAbsoluteDiscountFromSupplier'; // If we want deposit to be substracted to payments only and not to total of final invoice } else { diff --git a/htdocs/core/lib/tax.lib.php b/htdocs/core/lib/tax.lib.php index a0602dfd74e..29ced3591a1 100644 --- a/htdocs/core/lib/tax.lib.php +++ b/htdocs/core/lib/tax.lib.php @@ -174,10 +174,18 @@ function tax_by_thirdparty($type, $db, $y, $date_start, $date_end, $modetax, $di $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."product as p on d.fk_product = p.rowid"; $sql .= " WHERE f.entity IN (".getEntity($invoicetable).")"; $sql .= " AND f.fk_statut in (1,2)"; // Validated or paid (partially or completely) - if (!empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) { - $sql .= " AND f.type IN (0,1,2,5)"; + if ($direction == 'buy') { + if (!empty($conf->global->FACTURE_SUPPLIER_DEPOSITS_ARE_JUST_PAYMENTS)) { + $sql .= " AND f.type IN (0,1,2,5)"; + } else { + $sql .= " AND f.type IN (0,1,2,3,5)"; + } } else { - $sql .= " AND f.type IN (0,1,2,3,5)"; + if (!empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) { + $sql .= " AND f.type IN (0,1,2,5)"; + } else { + $sql .= " AND f.type IN (0,1,2,3,5)"; + } } $sql .= " AND f.rowid = d.".$fk_facture; $sql .= " AND s.rowid = f.fk_soc"; @@ -222,10 +230,18 @@ function tax_by_thirdparty($type, $db, $y, $date_start, $date_end, $modetax, $di $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."product as p on d.fk_product = p.rowid"; $sql .= " WHERE f.entity IN (".getEntity($invoicetable).")"; $sql .= " AND f.fk_statut in (1,2)"; // Paid (partially or completely) - if (!empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) { - $sql .= " AND f.type IN (0,1,2,5)"; + if ($direction == 'buy') { + if (!empty($conf->global->FACTURE_SUPPLIER_DEPOSITS_ARE_JUST_PAYMENTS)) { + $sql .= " AND f.type IN (0,1,2,5)"; + } else { + $sql .= " AND f.type IN (0,1,2,3,5)"; + } } else { - $sql .= " AND f.type IN (0,1,2,3,5)"; + if (!empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) { + $sql .= " AND f.type IN (0,1,2,5)"; + } else { + $sql .= " AND f.type IN (0,1,2,3,5)"; + } } $sql .= " AND f.rowid = d.".$fk_facture; $sql .= " AND s.rowid = f.fk_soc"; @@ -359,10 +375,18 @@ function tax_by_thirdparty($type, $db, $y, $date_start, $date_end, $modetax, $di $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."product as p on d.fk_product = p.rowid"; $sql .= " WHERE f.entity IN (".getEntity($invoicetable).")"; $sql .= " AND f.fk_statut in (1,2)"; // Validated or paid (partially or completely) - if (!empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) { - $sql .= " AND f.type IN (0,1,2,5)"; + if ($direction == 'buy') { + if (!empty($conf->global->FACTURE_SUPPLIER_DEPOSITS_ARE_JUST_PAYMENTS)) { + $sql .= " AND f.type IN (0,1,2,5)"; + } else { + $sql .= " AND f.type IN (0,1,2,3,5)"; + } } else { - $sql .= " AND f.type IN (0,1,2,3,5)"; + if (!empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) { + $sql .= " AND f.type IN (0,1,2,5)"; + } else { + $sql .= " AND f.type IN (0,1,2,3,5)"; + } } $sql .= " AND f.rowid = d.".$fk_facture; $sql .= " AND s.rowid = f.fk_soc"; @@ -407,10 +431,18 @@ function tax_by_thirdparty($type, $db, $y, $date_start, $date_end, $modetax, $di $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."product as p on d.fk_product = p.rowid"; $sql .= " WHERE f.entity IN (".getEntity($invoicetable).")"; $sql .= " AND f.fk_statut in (1,2)"; // Paid (partially or completely) - if (!empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) { - $sql .= " AND f.type IN (0,1,2,5)"; + if ($direction == 'buy') { + if (!empty($conf->global->FACTURE_SUPPLIER_DEPOSITS_ARE_JUST_PAYMENTS)) { + $sql .= " AND f.type IN (0,1,2,5)"; + } else { + $sql .= " AND f.type IN (0,1,2,3,5)"; + } } else { - $sql .= " AND f.type IN (0,1,2,3,5)"; + if (!empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) { + $sql .= " AND f.type IN (0,1,2,5)"; + } else { + $sql .= " AND f.type IN (0,1,2,3,5)"; + } } $sql .= " AND f.rowid = d.".$fk_facture; $sql .= " AND s.rowid = f.fk_soc"; @@ -730,10 +762,18 @@ function tax_by_rate($type, $db, $y, $q, $date_start, $date_end, $modetax, $dire $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."product as p on d.fk_product = p.rowid"; $sql .= " WHERE f.entity IN (".getEntity($invoicetable).")"; $sql .= " AND f.fk_statut in (1,2)"; // Validated or paid (partially or completely) - if (!empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) { - $sql .= " AND f.type IN (0,1,2,5)"; + if ($direction == 'buy') { + if (!empty($conf->global->FACTURE_SUPPLIER_DEPOSITS_ARE_JUST_PAYMENTS)) { + $sql .= " AND f.type IN (0,1,2,5)"; + } else { + $sql .= " AND f.type IN (0,1,2,3,5)"; + } } else { - $sql .= " AND f.type IN (0,1,2,3,5)"; + if (!empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) { + $sql .= " AND f.type IN (0,1,2,5)"; + } else { + $sql .= " AND f.type IN (0,1,2,3,5)"; + } } if ($y && $m) { $sql .= " AND f.datef >= '".$db->idate(dol_get_first_day($y, $m, false))."'"; @@ -776,10 +816,18 @@ function tax_by_rate($type, $db, $y, $q, $date_start, $date_end, $modetax, $dire $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."product as p on d.fk_product = p.rowid"; $sql .= " WHERE f.entity IN (".getEntity($invoicetable).")"; $sql .= " AND f.fk_statut in (1,2)"; // Paid (partially or completely) - if (!empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) { - $sql .= " AND f.type IN (0,1,2,5)"; + if ($direction == 'buy') { + if (!empty($conf->global->FACTURE_SUPPLIER_DEPOSITS_ARE_JUST_PAYMENTS)) { + $sql .= " AND f.type IN (0,1,2,5)"; + } else { + $sql .= " AND f.type IN (0,1,2,3,5)"; + } } else { - $sql .= " AND f.type IN (0,1,2,3,5)"; + if (!empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) { + $sql .= " AND f.type IN (0,1,2,5)"; + } else { + $sql .= " AND f.type IN (0,1,2,3,5)"; + } } if ($y && $m) { $sql .= " AND pa.datep >= '".$db->idate(dol_get_first_day($y, $m, false))."'"; @@ -915,10 +963,18 @@ function tax_by_rate($type, $db, $y, $q, $date_start, $date_end, $modetax, $dire $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."product as p on d.fk_product = p.rowid"; $sql .= " WHERE f.entity IN (".getEntity($invoicetable).")"; $sql .= " AND f.fk_statut in (1,2)"; // Validated or paid (partially or completely) - if (!empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) { - $sql .= " AND f.type IN (0,1,2,5)"; + if ($direction == 'buy') { + if (!empty($conf->global->FACTURE_SUPPLIER_DEPOSITS_ARE_JUST_PAYMENTS)) { + $sql .= " AND f.type IN (0,1,2,5)"; + } else { + $sql .= " AND f.type IN (0,1,2,3,5)"; + } } else { - $sql .= " AND f.type IN (0,1,2,3,5)"; + if (!empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) { + $sql .= " AND f.type IN (0,1,2,5)"; + } else { + $sql .= " AND f.type IN (0,1,2,3,5)"; + } } if ($y && $m) { $sql .= " AND f.datef >= '".$db->idate(dol_get_first_day($y, $m, false))."'"; @@ -961,10 +1017,18 @@ function tax_by_rate($type, $db, $y, $q, $date_start, $date_end, $modetax, $dire $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."product as p on d.fk_product = p.rowid"; $sql .= " WHERE f.entity IN (".getEntity($invoicetable).")"; $sql .= " AND f.fk_statut in (1,2)"; // Paid (partially or completely) - if (!empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) { - $sql .= " AND f.type IN (0,1,2,5)"; + if ($direction == 'buy') { + if (!empty($conf->global->FACTURE_SUPPLIER_DEPOSITS_ARE_JUST_PAYMENTS)) { + $sql .= " AND f.type IN (0,1,2,5)"; + } else { + $sql .= " AND f.type IN (0,1,2,3,5)"; + } } else { - $sql .= " AND f.type IN (0,1,2,3,5)"; + if (!empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) { + $sql .= " AND f.type IN (0,1,2,5)"; + } else { + $sql .= " AND f.type IN (0,1,2,3,5)"; + } } if ($y && $m) { $sql .= " AND pa.datep >= '".$db->idate(dol_get_first_day($y, $m, false))."'"; diff --git a/htdocs/core/modules/modFacture.class.php b/htdocs/core/modules/modFacture.class.php index 339e02cf393..85072c90cee 100644 --- a/htdocs/core/modules/modFacture.class.php +++ b/htdocs/core/modules/modFacture.class.php @@ -5,6 +5,7 @@ * Copyright (C) 2004 Benoit Mortier * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2021 Alexandre Spangaro + * Copyright (C) 2022 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -238,7 +239,7 @@ class modFacture extends DolibarrModules $this->import_fields_array[$r] = array( 'f.ref' => 'InvoiceRef*', 'f.ref_ext' => 'ExternalRef', - 'f.ref_client' => 'CutomerRef', + 'f.ref_client' => 'CustomerRef', 'f.type' => 'Type*', 'f.fk_soc' => 'Customer*', 'f.datec' => 'InvoiceDateCreation', @@ -350,7 +351,7 @@ class modFacture extends DolibarrModules ) ); - //Import Supplier Invoice Lines + // Import Invoice Lines $r++; $this->import_code[$r] = $this->rights_class.'_'.$r; $this->import_label[$r] = "InvoiceLine"; // Translation key diff --git a/htdocs/fourn/class/fournisseur.product.class.php b/htdocs/fourn/class/fournisseur.product.class.php index 16bc43474d8..ec923f91118 100644 --- a/htdocs/fourn/class/fournisseur.product.class.php +++ b/htdocs/fourn/class/fournisseur.product.class.php @@ -419,7 +419,11 @@ class ProductFournisseur extends Product $productfournisseurprice->array_options[$key] = $value; } $res = $productfournisseurprice->update($user); - if ($res < 0) $error++; + if ($res < 0) { + $this->error = $productfournisseurprice->error; + $this->errors = $productfournisseurprice->errors; + $error++; + } } } } @@ -506,6 +510,7 @@ class ProductFournisseur extends Product if ($resql) { $this->product_fourn_price_id = $this->db->last_insert_id(MAIN_DB_PREFIX."product_fournisseur_price"); } else { + $this->error = $this->db->lasterror(); $error++; } @@ -518,7 +523,11 @@ class ProductFournisseur extends Product $productfournisseurprice->array_options[$key] = $value; } $res = $productfournisseurprice->update($user); - if ($res < 0) $error++; + if ($res < 0) { + $this->error = $productfournisseurprice->error; + $this->errors = $productfournisseurprice->errors; + $error++; + } } } } diff --git a/htdocs/fourn/commande/card.php b/htdocs/fourn/commande/card.php index 834ef4031c0..67cfffdeb7c 100644 --- a/htdocs/fourn/commande/card.php +++ b/htdocs/fourn/commande/card.php @@ -2121,7 +2121,7 @@ if ($action == 'create') { print ''; // Relative and absolute discounts - if (!empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) { + if (!empty($conf->global->FACTURE_SUPPLIER_DEPOSITS_ARE_JUST_PAYMENTS)) { $filterabsolutediscount = "fk_invoice_supplier_source IS NULL"; // If we want deposit to be substracted to payments only and not to total of final invoice $filtercreditnote = "fk_invoice_supplier_source IS NOT NULL"; // If we want deposit to be substracted to payments only and not to total of final invoice } else { diff --git a/htdocs/fourn/facture/card.php b/htdocs/fourn/facture/card.php index 31cec906b0f..54ee8157e13 100644 --- a/htdocs/fourn/facture/card.php +++ b/htdocs/fourn/facture/card.php @@ -2641,7 +2641,7 @@ if ($action == 'create') { } $resteapayeraffiche = $resteapayer; - if (!empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) { // Never use this + if (!empty($conf->global->FACTURE_SUPPLIER_DEPOSITS_ARE_JUST_PAYMENTS)) { // Never use this $filterabsolutediscount = "fk_invoice_supplier_source IS NULL"; // If we want deposit to be substracted to payments only and not to total of final invoice $filtercreditnote = "fk_invoice_supplier_source IS NOT NULL"; // If we want deposit to be substracted to payments only and not to total of final invoice } else { diff --git a/htdocs/install/mysql/migration/15.0.0-16.0.0.sql b/htdocs/install/mysql/migration/15.0.0-16.0.0.sql index f7e7a7a1ba5..acbcbf7b0d3 100644 --- a/htdocs/install/mysql/migration/15.0.0-16.0.0.sql +++ b/htdocs/install/mysql/migration/15.0.0-16.0.0.sql @@ -365,7 +365,52 @@ ALTER TABLE llx_bank_account ADD COLUMN pti_in_ctti smallint DEFAULT 0 AFTER dom -- Set default ticket type to OTHER if no default exists UPDATE llx_c_ticket_type SET use_default=1 WHERE code='OTHER' AND NOT EXISTS(SELECT * FROM (SELECT * FROM llx_c_ticket_type) AS t WHERE use_default=1); + -- Assets - New module + +CREATE TABLE llx_asset( + rowid integer AUTO_INCREMENT PRIMARY KEY NOT NULL, + ref varchar(128) NOT NULL, + entity integer DEFAULT 1 NOT NULL, + label varchar(255), + + fk_asset_model integer, + + reversal_amount_ht double(24,8), + acquisition_value_ht double(24,8) DEFAULT NULL, + recovered_vat double(24,8), + + reversal_date date, + + date_acquisition date NOT NULL, + date_start date NOT NULL, + + qty real DEFAULT 1 NOT NULL, + + acquisition_type smallint DEFAULT 0 NOT NULL, + asset_type smallint DEFAULT 0 NOT NULL, + + not_depreciated integer DEFAULT 0, + + disposal_date date, + disposal_amount_ht double(24,8), + fk_disposal_type integer, + disposal_depreciated integer DEFAULT 0, + disposal_subject_to_vat integer DEFAULT 0, + + note_public text, + note_private text, + + date_creation datetime NOT NULL, + tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + fk_user_creat integer NOT NULL, + fk_user_modif integer, + last_main_doc varchar(255), + import_key varchar(14), + model_pdf varchar(255), + status integer NOT NULL +) ENGINE=innodb; + ALTER TABLE llx_asset DROP FOREIGN KEY fk_asset_asset_type; ALTER TABLE llx_asset DROP INDEX idx_asset_fk_asset_type; diff --git a/htdocs/install/mysql/tables/llx_establishment.sql b/htdocs/install/mysql/tables/llx_establishment.sql index a3542f6d9d6..1b1f38074ad 100644 --- a/htdocs/install/mysql/tables/llx_establishment.sql +++ b/htdocs/install/mysql/tables/llx_establishment.sql @@ -22,6 +22,7 @@ CREATE TABLE llx_establishment ( rowid integer NOT NULL auto_increment PRIMARY KEY, entity integer NOT NULL DEFAULT 1, + label varchar(255), ref varchar(30), label varchar(255) NOT NULL, name varchar(128), diff --git a/htdocs/langs/en_US/errors.lang b/htdocs/langs/en_US/errors.lang index f732641fc79..6ff5a63196a 100644 --- a/htdocs/langs/en_US/errors.lang +++ b/htdocs/langs/en_US/errors.lang @@ -14,6 +14,7 @@ ErrorLoginAlreadyExists=Login %s already exists. ErrorGroupAlreadyExists=Group %s already exists. ErrorEmailAlreadyExists=Email %s already exists. ErrorRecordNotFound=Record not found. +ErrorRecordNotFoundShort=Not found ErrorFailToCopyFile=Failed to copy file '%s' into '%s'. ErrorFailToCopyDir=Failed to copy directory '%s' into '%s'. ErrorFailToRenameFile=Failed to rename file '%s' into '%s'. diff --git a/htdocs/supplier_proposal/card.php b/htdocs/supplier_proposal/card.php index 76c4784b013..37853d1488a 100644 --- a/htdocs/supplier_proposal/card.php +++ b/htdocs/supplier_proposal/card.php @@ -1613,7 +1613,7 @@ if ($action == 'create') { print ''; // Relative and absolute discounts - if (!empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) { + if (!empty($conf->global->FACTURE_SUPPLIER_DEPOSITS_ARE_JUST_PAYMENTS)) { $filterabsolutediscount = "fk_invoice_supplier_source IS NULL"; // If we want deposit to be substracted to payments only and not to total of final invoice $filtercreditnote = "fk_invoice_supplier_source IS NOT NULL"; // If we want deposit to be substracted to payments only and not to total of final invoice } else { diff --git a/htdocs/takepos/admin/terminal.php b/htdocs/takepos/admin/terminal.php index 9cd1a5fd5f0..c511d3e0529 100644 --- a/htdocs/takepos/admin/terminal.php +++ b/htdocs/takepos/admin/terminal.php @@ -414,7 +414,7 @@ $htmltext .= ''; print '
'; print load_fiche_titre($langs->trans('FreeLegalTextOnInvoices'), '', ''); -print '
'; +print '
'; print '
'; print ''; print ''; diff --git a/htdocs/takepos/index.php b/htdocs/takepos/index.php index c43d0ec092f..faa843aec9a 100644 --- a/htdocs/takepos/index.php +++ b/htdocs/takepos/index.php @@ -587,7 +587,9 @@ function New() { * return {void} */ function Search2(keyCodeForEnter, moreorless) { - console.log("Search2 Call ajax search to replace products keyCodeForEnter="+keyCodeForEnter); + var eventKeyCode = window.event.keyCode; + + console.log("Search2 Call ajax search to replace products keyCodeForEnter="+keyCodeForEnter+", eventKeyCode="+eventKeyCode); var search_term = $('#search').val(); var search_start = 0; @@ -610,20 +612,19 @@ function Search2(keyCodeForEnter, moreorless) { } var search = false; - var eventKeyCode = window.event.keyCode; - if (keyCodeForEnter == '' || eventKeyCode == keyCodeForEnter) { + if (keyCodeForEnter != '' || eventKeyCode == keyCodeForEnter) { search = true; } if (search === true) { - - // temporization time to give time to type + // if a timer has been already started (search2_timer is a global js variable), we cancel it now + // we click onto another key, we will restart another timer just after if (search2_timer) { clearTimeout(search2_timer); } + // temporization time to give time to type search2_timer = setTimeout(function(){ - pageproducts = 0; jQuery(".wrapper2 .catwatermark").hide(); var nbsearchresults = 0; @@ -695,8 +696,8 @@ function Search2(keyCodeForEnter, moreorless) { if (data.length == 0) { $('#search').val('load('errors'); - echo dol_escape_js($langs->trans("ErrorRecordNotFound")); - ?>'); + echo dol_escape_js($langs->transnoentitiesnoconv("ErrorRecordNotFoundShort")); + ?> ('+search_term+')'); $('#search').select(); } else ClearSearch();
'.$langs->trans("Parameters").''.$langs->trans('Value').'