diff --git a/ChangeLog b/ChangeLog index b6cb7742cd6..4da3132248c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -220,25 +220,38 @@ Following changes may create regressions for some external modules, but were nec * Rename the substitution for "project label" instead of "project title" in substitution variables -***** ChangeLog for 16.0.4 compared to 16.0.2 ***** +***** ChangeLog for 16.0.4 compared to 16.0.3 ***** FIX: Amount of localtax1 and 2 not correctly save on purchase order (the rate was saved instead) FIX: #20415 FIX: #21280 FIX: #23008 FIX: #22271 +FIX: #22524 FIX: #22837 +FIX: #22964 +FIX: #23012 FIX: #23019 Impossible to add task times to an existing draft invoice FIX: #23072 FIX: #23087 FIX: #23115 FIX: #23116 FIX: #23281 +FIX: #23420 : wrong check on $search_categ value causing FATAL ERROR +FIX: Accountancy - Quadra export +FIX: add border left on image product when conf activated +FIX: Add missing token when deleting template inn order_supplier admin menu +FIX: Amount of localtax1 and 2 not correctly save on purchase order (the +FIX: API access for deactivated users FIX: bad selection of barcode numbering module FIX: Can't see all time spent by all user FIX: CI FIX: CommonObject - showOptionals - Display blank td when MAIN_VIEW_LINE_NUMBER is enabled and action is confirm_valid FIX: Documents API inconsistency +FIX: Empty FormSetup emailTemplate type IF empty fieldvalue +FIX: Errors Handling for CreateFrom Hooks +FIX: error with dol_banner_tab, ref is needed +FIX: ExpenseReport card was not reloaded after addline FIX: #23075 FIX: #23117 FIX: get multicurrency infos of propal when create order from propal with "WORKFLOW_PROPAL_AUTOCREATE_ORDER" conf @@ -246,12 +259,16 @@ FIX: Give predictable order to inventory lines FIX: include class multicurrency FIX: methods declaration (backport fix 67b9a7dc07d708231d12b5e58800334d4a01ef98) FIX: multicurrency_tx and not currency_tx -FIX: PGSQL Integer type does not have a free length +FIX: on public ticket list, only the page 1 was accessible. Other pages were 404 error. +FIX: PGSQL Integer type does not have a free lenght +FIX: PGSQL Int type does not have a free lenght FIX: Product list in setup.php in new Module FIX: propal and order stats broken on Tag+User(retricted customer list) FIX: saving of numbering module for jobs FIX: Stickler FIX: travis +FIX: wrong check on $search_categ value causing fatal error +FIX: wrong stock list with multicompany and without stock sharing ***** ChangeLog for 16.0.3 compared to 16.0.2 ***** diff --git a/htdocs/comm/action/peruser.php b/htdocs/comm/action/peruser.php index de4af0c26c7..1830ad239a3 100644 --- a/htdocs/comm/action/peruser.php +++ b/htdocs/comm/action/peruser.php @@ -922,6 +922,10 @@ while ($currentdaytoshow < $lastdaytoshow) { if ($usergroup > 0) { $sql .= " AND ug.fk_usergroup = ".((int) $usergroup); } + if ($user->socid > 0) { + // External users should see only contacts of their company + $sql .= " AND u.fk_soc = ".((int) $user->socid); + } //print $sql; $resql = $db->query($sql); diff --git a/htdocs/comm/index.php b/htdocs/comm/index.php index 67af97cfe12..5d71683a311 100644 --- a/htdocs/comm/index.php +++ b/htdocs/comm/index.php @@ -61,25 +61,17 @@ if (isset($user->socid) && $user->socid > 0) { $socid = $user->socid; } + $max = $conf->global->MAIN_SIZE_SHORTLIST_LIMIT; +$maxofloop = (empty($conf->global->MAIN_MAXLIST_OVERLOAD) ? 500 : $conf->global->MAIN_MAXLIST_OVERLOAD); $now = dol_now(); -// Security check -$socid = GETPOST("socid", 'int'); -if ($user->socid > 0) { - $action = ''; - $id = $user->socid; -} else { - $id = 0; -} - -//restrictedArea($user, 'societe', $id, '&societe', '', 'fk_soc', 'rowid', 0); +//restrictedArea($user, 'societe', $socid, '&societe', '', 'fk_soc', 'rowid', 0); if (!$user->hasRight('propal', 'read') && !$user->hasRight('supplier_proposal', 'read') && !$user->hasRight('commande', 'read') && !$user->hasRight('fournisseur', 'commande', 'read') && !$user->hasRight('supplier_order', 'read') && !$user->hasRight('fichinter', 'read')) { accessforbidden(); } -$maxofloop = (empty($conf->global->MAIN_MAXLIST_OVERLOAD) ? 500 : $conf->global->MAIN_MAXLIST_OVERLOAD); /* diff --git a/htdocs/commande/card.php b/htdocs/commande/card.php index 8521e5be6fc..3edfe0fafc5 100644 --- a/htdocs/commande/card.php +++ b/htdocs/commande/card.php @@ -14,6 +14,7 @@ * Copyright (C) 2015 Jean-François Ferry * Copyright (C) 2018-2021 Frédéric France * Copyright (C) 2022 Gauthier VERDOL + * Copyright (C) 2023 Benjamin Falière * * 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 @@ -1843,25 +1844,25 @@ if ($action == 'create' && $usercancreate) { // Delivery delay print ''.$langs->trans('AvailabilityPeriod').''; print img_picto('', 'clock', 'class="pictofixedwidth"'); - $form->selectAvailabilityDelay($availability_id, 'availability_id', '', 1, 'maxwidth200 widthcentpercentminusx'); + $form->selectAvailabilityDelay((GETPOSTISSET('availability_id')?GETPOST('availability_id'):$availability_id), 'availability_id', '', 1, 'maxwidth200 widthcentpercentminusx'); print ''; // Terms of payment print ''.$langs->trans('PaymentConditionsShort').''; print img_picto('', 'payment', 'class="pictofixedwidth"'); - print $form->getSelectConditionsPaiements($cond_reglement_id, 'cond_reglement_id', 1, 1, 0, 'maxwidth200 widthcentpercentminusx', $deposit_percent); + print $form->getSelectConditionsPaiements((GETPOSTISSET('cond_reglement_id')?GETPOST('cond_reglement_id'):$cond_reglement_id), 'cond_reglement_id', 1, 1, 0, 'maxwidth200 widthcentpercentminusx', $deposit_percent); print ''; // Payment mode print ''.$langs->trans('PaymentMode').''; print img_picto('', 'bank', 'class="pictofixedwidth"'); - print $form->select_types_paiements($mode_reglement_id, 'mode_reglement_id', 'CRDT', 0, 1, 0, 0, 1, 'maxwidth200 widthcentpercentminusx', 1); + print $form->select_types_paiements((GETPOSTISSET('mode_reglement_id')?GETPOST('mode_reglement_id'):$mode_reglement_id), 'mode_reglement_id', 'CRDT', 0, 1, 0, 0, 1, 'maxwidth200 widthcentpercentminusx', 1); print ''; // Bank Account if (!empty($conf->global->BANK_ASK_PAYMENT_BANK_DURING_ORDER) && isModEnabled("banque")) { print ''.$langs->trans('BankAccount').''; - print img_picto('', 'bank_account', 'class="pictofixedwidth"').$form->select_comptes($fk_account, 'fk_account', 0, '', 1, '', 0, 'maxwidth200 widthcentpercentminusx', 1); + print img_picto('', 'bank_account', 'class="pictofixedwidth"').$form->select_comptes((GETPOSTISSET('fk_account')?GETPOST('fk_account'):$fk_account), 'fk_account', 0, '', 1, '', 0, 'maxwidth200 widthcentpercentminusx', 1); print ''; } @@ -1869,7 +1870,7 @@ if ($action == 'create' && $usercancreate) { if (isModEnabled('expedition')) { print ''.$langs->trans('SendingMethod').''; print img_picto('', 'object_dolly', 'class="pictofixedwidth"'); - $form->selectShippingMethod($shipping_method_id, 'shipping_method_id', '', 1, '', 0, 'maxwidth200 widthcentpercentminusx'); + $form->selectShippingMethod((GETPOSTISSET('shipping_method_id')?GETPOST('shipping_method_id'):$shipping_method_id), 'shipping_method_id', '', 1, '', 0, 'maxwidth200 widthcentpercentminusx'); print ''; } @@ -1878,14 +1879,14 @@ if ($action == 'create' && $usercancreate) { require_once DOL_DOCUMENT_ROOT.'/product/class/html.formproduct.class.php'; $formproduct = new FormProduct($db); print ''.$langs->trans('Warehouse').''; - print img_picto('', 'stock', 'class="pictofixedwidth"').$formproduct->selectWarehouses($warehouse_id, 'warehouse_id', '', 1, 0, 0, '', 0, 0, array(), 'maxwidth500 widthcentpercentminusxx'); + print img_picto('', 'stock', 'class="pictofixedwidth"').$formproduct->selectWarehouses((GETPOSTISSET('warehouse_id')?GETPOST('warehouse_id'):$warehouse_id), 'warehouse_id', '', 1, 0, 0, '', 0, 0, array(), 'maxwidth500 widthcentpercentminusxx'); print ''; } // Source / Channel - What trigger creation print ''.$langs->trans('Channel').''; print img_picto('', 'question', 'class="pictofixedwidth"'); - $form->selectInputReason($demand_reason_id, 'demand_reason_id', '', 1, 'maxwidth200 widthcentpercentminusx'); + $form->selectInputReason((GETPOSTISSET('demand_reason_id')?GETPOST('demand_reason_id'):$demand_reason_id), 'demand_reason_id', '', 1, 'maxwidth200 widthcentpercentminusx'); print ''; // TODO How record was recorded OrderMode (llx_c_input_method) @@ -1895,7 +1896,7 @@ if ($action == 'create' && $usercancreate) { $langs->load("projects"); print ''; print ''.$langs->trans("Project").''; - print img_picto('', 'project', 'class="pictofixedwidth"').$formproject->select_projects(($soc->id > 0 ? $soc->id : -1), $projectid, 'projectid', 0, 0, 1, 0, 0, 0, 0, '', 1, 0, 'maxwidth500 widthcentpercentminusxx'); + print img_picto('', 'project', 'class="pictofixedwidth"').$formproject->select_projects(($soc->id > 0 ? $soc->id : -1), (GETPOSTISSET('projectid')?GETPOST('projectid'):$projectid), 'projectid', 0, 0, 1, 0, 0, 0, 0, '', 1, 0, 'maxwidth500 widthcentpercentminusxx'); print ' id).'">'; print ''; print ''; @@ -1954,7 +1955,7 @@ if ($action == 'create' && $usercancreate) { print ''; print ''.$form->editfieldkey("Currency", 'multicurrency_code', '', $object, 0).''; print ''; - print img_picto('', 'currency', 'class="pictofixedwidth"').$form->selectMultiCurrency($currency_code, 'multicurrency_code', 0, '', false, 'maxwidth200 widthcentpercentminusx'); + print img_picto('', 'currency', 'class="pictofixedwidth"').$form->selectMultiCurrency((GETPOSTISSET('multicurrency_code')?GETPOST('multicurrency_code'):$currency_code), 'multicurrency_code', 0, '', false, 'maxwidth200 widthcentpercentminusx'); print ''; } diff --git a/htdocs/compta/stats/supplier_turnover_by_thirdparty.php b/htdocs/compta/stats/supplier_turnover_by_thirdparty.php index 2b590e05fd9..515a004a3cd 100644 --- a/htdocs/compta/stats/supplier_turnover_by_thirdparty.php +++ b/htdocs/compta/stats/supplier_turnover_by_thirdparty.php @@ -249,9 +249,9 @@ if ($modecompta == 'CREANCES-DETTES') { $sql .= " sum(f.total_ht) as amount, sum(f.total_ttc) as amount_ttc"; $sql .= " FROM ".MAIN_DB_PREFIX."facture_fourn as f, ".MAIN_DB_PREFIX."societe as s"; if ($selected_cat === -2) { // Without any category - $sql .= " LEFT OUTER JOIN ".MAIN_DB_PREFIX."categorie_societe as cs ON s.rowid = cs.fk_soc"; + $sql .= " LEFT OUTER JOIN ".MAIN_DB_PREFIX."categorie_fournisseur as cs ON s.rowid = cs.fk_soc"; } elseif ($selected_cat) { // Into a specific category - $sql .= ", ".MAIN_DB_PREFIX."categorie as c, ".MAIN_DB_PREFIX."categorie_societe as cs"; + $sql .= ", ".MAIN_DB_PREFIX."categorie as c, ".MAIN_DB_PREFIX."categorie_fournisseur as cs"; } $sql .= " WHERE f.fk_statut in (1,2)"; $sql .= " AND f.type IN (0,2)"; @@ -276,9 +276,9 @@ if ($modecompta == 'CREANCES-DETTES') { $sql .= ", ".MAIN_DB_PREFIX."paiementfourn as p"; $sql .= ", ".MAIN_DB_PREFIX."societe as s"; if ($selected_cat === -2) { // Without any category - $sql .= " LEFT OUTER JOIN ".MAIN_DB_PREFIX."categorie_societe as cs ON s.rowid = cs.fk_soc"; + $sql .= " LEFT OUTER JOIN ".MAIN_DB_PREFIX."categorie_fournisseur as cs ON s.rowid = cs.fk_soc"; } elseif ($selected_cat) { // Into a specific category - $sql .= ", ".MAIN_DB_PREFIX."categorie as c, ".MAIN_DB_PREFIX."categorie_societe as cs"; + $sql .= ", ".MAIN_DB_PREFIX."categorie as c, ".MAIN_DB_PREFIX."categorie_fournisseur as cs"; } $sql .= " WHERE p.rowid = pf.fk_paiementfourn"; $sql .= " AND pf.fk_facturefourn = f.rowid"; diff --git a/htdocs/core/class/cgenericdic.class.php b/htdocs/core/class/cgenericdic.class.php index ab1023b81f5..250fb3ec569 100644 --- a/htdocs/core/class/cgenericdic.class.php +++ b/htdocs/core/class/cgenericdic.class.php @@ -82,6 +82,8 @@ class CGenericDic $fieldlabel = 'label'; if ($this->table_element == 'c_stcomm') { $fieldlabel = 'libelle'; + } elseif ($this->table_element == 'c_type_fees') { + $fieldrowid = 'id'; } $error = 0; @@ -162,6 +164,8 @@ class CGenericDic if ($this->table_element == 'c_stcomm') { $fieldrowid = 'id'; $fieldlabel = 'libelle'; + } elseif ($this->table_element == 'c_type_fees') { + $fieldrowid = 'id'; } $sql = "SELECT"; @@ -233,6 +237,8 @@ class CGenericDic if ($this->table_element == 'c_stcomm') { $fieldrowid = 'id'; $fieldlabel = 'libelle'; + } elseif ($this->table_element == 'c_type_fees') { + $fieldrowid = 'id'; } $sql = "SELECT"; @@ -303,6 +309,8 @@ class CGenericDic if ($this->table_element == 'c_stcomm') { $fieldrowid = 'id'; $fieldlabel = 'libelle'; + } elseif ($this->table_element == 'c_type_fees') { + $fieldrowid = 'id'; } // Clean parameters diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index f5d45b751b4..b5bcbe3ef8f 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -6084,6 +6084,8 @@ abstract class CommonObject if (!empty($extrafields->attributes[$this->table_element]) && !empty($extrafields->attributes[$this->table_element]['computed'][$key])) { //var_dump($conf->disable_compute); if (empty($conf->disable_compute)) { + global $objectoffield; // We set a global variable to $objectoffield so + $objectoffield = $this; // we can use it inside computed formula $this->array_options["options_".$key] = dol_eval($extrafields->attributes[$this->table_element]['computed'][$key], 1, 0, ''); } } diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 3150ea706cc..d47b71d39cf 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -8917,10 +8917,12 @@ function dol_eval($s, $returnvalue = 0, $hideerrors = 1, $onlysimplestring = '1' // Only global variables can be changed by eval function and returned to caller global $db, $langs, $user, $conf, $website, $websitepage; global $action, $mainmenu, $leftmenu; + global $mysoc; + global $objectoffield; + + // Old variables used global $rights; global $object; - global $mysoc; - global $obj; // To get $obj used into list when dol_eval is used for computed fields and $obj is not yet $object global $soc; // For backward compatibility diff --git a/htdocs/core/modules/facture/doc/doc_generic_invoice_odt.modules.php b/htdocs/core/modules/facture/doc/doc_generic_invoice_odt.modules.php index 0b8fa2d4621..548b5cf66f4 100644 --- a/htdocs/core/modules/facture/doc/doc_generic_invoice_odt.modules.php +++ b/htdocs/core/modules/facture/doc/doc_generic_invoice_odt.modules.php @@ -336,15 +336,19 @@ class doc_generic_invoice_odt extends ModelePDFFactures $object->fetchObjectLinked('', '', '', ''); //print_r($object->linkedObjects['propal']); exit; - $propal_object = $object->linkedObjects['propal'][0]; + if (isset($object->linkedObjects['propal'][0])) { + $propal_object = $object->linkedObjects['propal'][0]; + } else { + $propal_object = null; + } // Make substitution $substitutionarray = array( - '__FROM_NAME__' => $this->emetteur->name, - '__FROM_EMAIL__' => $this->emetteur->email, - '__TOTAL_TTC__' => $object->total_ttc, - '__TOTAL_HT__' => $object->total_ht, - '__TOTAL_VAT__' => $object->total_tva + '__FROM_NAME__' => $this->emetteur->name, + '__FROM_EMAIL__' => $this->emetteur->email, + '__TOTAL_TTC__' => $object->total_ttc, + '__TOTAL_HT__' => $object->total_ht, + '__TOTAL_VAT__' => $object->total_tva ); complete_substitutions_array($substitutionarray, $langs, $object); // Call the ODTSubstitution hook @@ -435,8 +439,8 @@ class doc_generic_invoice_odt extends ModelePDFFactures } else { $odfHandler->setVars($key, 'ErrorFileNotFound', true, 'UTF-8'); } - } else // Text - { + } else { + // Text $odfHandler->setVars($key, $value, true, 'UTF-8'); } } catch (OdfException $e) { diff --git a/htdocs/product/card.php b/htdocs/product/card.php index a7b3c1958b5..627b7fc5b64 100644 --- a/htdocs/product/card.php +++ b/htdocs/product/card.php @@ -1846,7 +1846,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { if ($object->isService()) { $type = $langs->trans('Service'); } - //print load_fiche_titre($langs->trans('Modify').' '.$type.' : '.(is_object($object->oldcopy)?$object->oldcopy->ref:$object->ref), ""); + // print load_fiche_titre($langs->trans('Modify').' '.$type.' : '.(is_object($object->oldcopy)?$object->oldcopy->ref:$object->ref), ""); // Main official, simple, and not duplicated code print '
'."\n"; @@ -1865,19 +1865,18 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { // Ref if (empty($conf->global->MAIN_PRODUCT_REF_NOT_EDITABLE)) { - print ''.$langs->trans("Ref").''; + print ''.$langs->trans("Ref").''; } else { print ''.$langs->trans("Ref").''; } - // Label - print ''.$langs->trans("Label").''; + print ''.$langs->trans("Label").''; // Status To sell print ''.$langs->trans("Status").' ('.$langs->trans("Sell").')'; print ''; - if ($object->status_buy) { + if ((GETPOSTISSET('statut_buy') && GETPOST('statut_buy')) || (!GETPOSTISSET('statut_buy') && $object->status_buy)) { print ''; print ''; } else { @@ -1905,7 +1904,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { if ($object->isProduct() || !empty($conf->global->STOCK_SUPPORTS_SERVICES)) { print ''.$langs->trans("ManageLotSerial").''; $statutarray = array('0' => $langs->trans("ProductStatusNotOnBatch"), '1' => $langs->trans("ProductStatusOnBatch"), '2' => $langs->trans("ProductStatusOnSerial")); - print $form->selectarray('status_batch', $statutarray, $object->status_batch); + print $form->selectarray('status_batch', $statutarray, (GETPOSTISSET('status_batch') ? GETPOST('status_batch') : $object->status_batch)); print ''; if (!empty($object->status_batch) || !empty($conf->use_javascript_ajax)) { $langs->load("admin"); @@ -2024,7 +2023,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { // Default warehouse print ''.$langs->trans("DefaultWarehouse").''; print img_picto($langs->trans("DefaultWarehouse"), 'stock', 'class="pictofixedwidth"'); - print $formproduct->selectWarehouses($object->fk_default_warehouse, 'fk_default_warehouse', 'warehouseopen', 1); + print $formproduct->selectWarehouses((GETPOSTISSET('fk_default_warehouse') ? GETPOST('fk_default_warehouse') : $object->fk_default_warehouse), 'fk_default_warehouse', 'warehouseopen', 1); print ' '; print ''; /* @@ -2072,7 +2071,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { if (empty($conf->global->PRODUCT_DISABLE_NATURE)) { // Nature print ''.$form->textwithpicto($langs->trans("NatureOfProductShort"), $langs->trans("NatureOfProductDesc")).''; - print $formproduct->selectProductNature('finished', $object->finished); + print $formproduct->selectProductNature('finished', (GETPOSTISSET('finished') ? GETPOST('finished') : $object->finished)); print ''; } } @@ -2080,7 +2079,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { if (!$object->isService() && isModEnabled('bom')) { print ''.$form->textwithpicto($langs->trans("DefaultBOM"), $langs->trans("DefaultBOMDesc", $langs->transnoentitiesnoconv("Finished"))).''; $bomkey = "Bom:bom/class/bom.class.php:0:t.status=1 AND t.fk_product=".((int) $object->id); - print $form->selectForForms($bomkey, 'fk_default_bom', $object->fk_default_bom, 1); + print $form->selectForForms($bomkey, 'fk_default_bom', (GETPOSTISSET('fk_default_bom') ? GETPOST('fk_default_bom') : $object->fk_default_bom), 1); print ''; } @@ -2135,7 +2134,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { // Custom code if (!$object->isService() && empty($conf->global->PRODUCT_DISABLE_CUSTOM_INFO)) { - print ''.$langs->trans("CustomCode").''; + print ''.$langs->trans("CustomCode").''; // Origin country print ''.$langs->trans("CountryOrigin").''; print ''; @@ -2188,6 +2187,11 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { $arrayselected[] = $cat->id; } } + if (GETPOSTISSET('categories', 'array')) { + foreach (GETPOST('categories', 'array') as $cat) { + $arrayselected[] = $cat; + } + } print img_picto('', 'category').$form->multiselectarray('categories', $cate_arbo, $arrayselected, '', 0, 'quatrevingtpercent widthcentpercentminusx', 0, 0); print ""; } @@ -2213,76 +2217,76 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { // Accountancy_code_sell print ''.$langs->trans("ProductAccountancySellCode").''; print ''; - print $formaccounting->select_account($object->accountancy_code_sell, 'accountancy_code_sell', 1, '', 1, 1, 'minwidth150 maxwidth300'); + print $formaccounting->select_account((GETPOSTISSET('accountancy_code_sell') ? GETPOST('accountancy_code_sell') : $object->accountancy_code_sell), 'accountancy_code_sell', 1, '', 1, 1, 'minwidth150 maxwidth300'); print ''; // Accountancy_code_sell_intra if ($mysoc->isInEEC()) { print ''.$langs->trans("ProductAccountancySellIntraCode").''; print ''; - print $formaccounting->select_account($object->accountancy_code_sell_intra, 'accountancy_code_sell_intra', 1, '', 1, 1, 'minwidth150 maxwidth300'); + print $formaccounting->select_account((GETPOSTISSET('accountancy_code_sell_intra') ? GETPOST('accountancy_code_sell_intra') : $object->accountancy_code_sell_intra), 'accountancy_code_sell_intra', 1, '', 1, 1, 'minwidth150 maxwidth300'); print ''; } // Accountancy_code_sell_export print ''.$langs->trans("ProductAccountancySellExportCode").''; print ''; - print $formaccounting->select_account($object->accountancy_code_sell_export, 'accountancy_code_sell_export', 1, '', 1, 1, 'minwidth150 maxwidth300'); + print $formaccounting->select_account((GETPOSTISSET('accountancy_code_sell_export') ? GETPOST('accountancy_code_sell_export') : $object->accountancy_code_sell_export), 'accountancy_code_sell_export', 1, '', 1, 1, 'minwidth150 maxwidth300'); print ''; // Accountancy_code_buy print ''.$langs->trans("ProductAccountancyBuyCode").''; print ''; - print $formaccounting->select_account($object->accountancy_code_buy, 'accountancy_code_buy', 1, '', 1, 1, 'minwidth150 maxwidth300'); + print $formaccounting->select_account((GETPOSTISSET('accountancy_code_buy') ? GETPOST('accountancy_code_buy') : $object->accountancy_code_buy), 'accountancy_code_buy', 1, '', 1, 1, 'minwidth150 maxwidth300'); print ''; // Accountancy_code_buy_intra if ($mysoc->isInEEC()) { print ''.$langs->trans("ProductAccountancyBuyIntraCode").''; print ''; - print $formaccounting->select_account($object->accountancy_code_buy_intra, 'accountancy_code_buy_intra', 1, '', 1, 1, 'minwidth150 maxwidth300'); + print $formaccounting->select_account((GETPOSTISSET('accountancy_code_buy_intra') ? GETPOST('accountancy_code_buy_intra') : $object->accountancy_code_buy_intra), 'accountancy_code_buy_intra', 1, '', 1, 1, 'minwidth150 maxwidth300'); print ''; } // Accountancy_code_buy_export print ''.$langs->trans("ProductAccountancyBuyExportCode").''; print ''; - print $formaccounting->select_account($object->accountancy_code_buy_export, 'accountancy_code_buy_export', 1, '', 1, 1, 'minwidth150 maxwidth300'); + print $formaccounting->select_account((GETPOSTISSET('accountancy_code_buy_export') ? GETPOST('accountancy_code_buy_export') : $object->accountancy_code_buy_export), 'accountancy_code_buy_export', 1, '', 1, 1, 'minwidth150 maxwidth300'); print ''; } else { // For external software // Accountancy_code_sell print ''.$langs->trans("ProductAccountancySellCode").''; - print ''; + print ''; print ''; // Accountancy_code_sell_intra if ($mysoc->isInEEC()) { print ''.$langs->trans("ProductAccountancySellIntraCode").''; - print ''; + print ''; print ''; } // Accountancy_code_sell_export print ''.$langs->trans("ProductAccountancySellExportCode").''; - print ''; + print ''; print ''; // Accountancy_code_buy print ''.$langs->trans("ProductAccountancyBuyCode").''; - print ''; + print ''; print ''; // Accountancy_code_buy_intra if ($mysoc->isInEEC()) { print ''.$langs->trans("ProductAccountancyBuyIntraCode").''; - print ''; + print ''; print ''; } // Accountancy_code_buy_export print ''.$langs->trans("ProductAccountancyBuyExportCode").''; - print ''; + print ''; print ''; } }