diff --git a/ChangeLog b/ChangeLog index f6530b59c1f..c447ac36cbf 100644 --- a/ChangeLog +++ b/ChangeLog @@ -375,6 +375,37 @@ Following changes may create regressions for some external modules, but were nec * v14 seems to work correctly on PHP v8 but it generates a lot of verbose warnings. Currently, v14 i snot yet officialy supported with PHP 8. + +***** ChangeLog for 13.0.5 compared to 13.0.4 ***** + +FIX: 13.0: class CommandeFournisseurDispatch provides trigger for UPDATE but not for CREATE / DELETE +FIX: #18389 Accountancy - Bug on LDcompta10 export for supplier invoice +FIX: #18591 : Remove double quotes of SQL Queries for postgresql compatibility +FIX: Accountancy - Debug Export Sage50 / CIEL Compta / CIEL Compta Evo (Format XIMPORT) +FIX: Accountancy - Some problems of length with general & subledger account +FIX: add DISTINCT +FIX: an approved holiday can be canceled by an admin. +FIX: autocalculation of the supplier price in main currency. +FIX: better sql request +FIX: cannot add time spend when column ref is not displayed +FIX: compatibility postgre sql +FIX: holiday card: hooks uninitialized +FIX: Invoice - Missing button to reopen an abandoned situation invoice +FIX: invoice validation: when checking if any VAT rate has a negative amount, prevent false positives with -1.0E-14 amounts +FIX: list of categories in stats of supplier invoices +FIX: Manage credit note on situation invoice for calculate margin +FIX: method_exists needs object at first param +FIX: move fetch_optionnal into $ac_static->fetch() +FIX: multicompany transverse mode compatibility +FIX: on supplier order, JOIN with product fourn price table must be done with fk_soc too to avoid display several times a same line (because of same supplier product ref) +FIX: postgre filter select search extrafield +FIX: products/services card: hidden extrafields were overridden +FIX: shipping validation workflow: 'ORDER_NEW' trigger called from wrong object +FIX: task time: can't filter by user with pgsql + show error message +FIX: task time: keep on using natural_search +FIX: wrong users count in multicompany transverse mode + + ***** ChangeLog for 13.0.4 compared to 13.0.3 ***** FIX: Allow disabling of a module (not a dangerous action) even if there is problem with token (due to bugged modules). diff --git a/htdocs/accountancy/admin/categories_list.php b/htdocs/accountancy/admin/categories_list.php index 2e369e19de1..999f81ef683 100644 --- a/htdocs/accountancy/admin/categories_list.php +++ b/htdocs/accountancy/admin/categories_list.php @@ -1,6 +1,6 @@ - * Copyright (C) 2011-2017 Alexandre Spangaro + * Copyright (C) 2011-2021 Alexandre Spangaro * * 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 @@ -91,19 +91,19 @@ $tabsql[32] = "SELECT a.rowid as rowid, a.code as code, a.label, a.range_account $tabsqlsort = array(); $tabsqlsort[32] = "position ASC"; -// Nom des champs en resultat de select pour affichage du dictionnaire +// Name of the fields in the result of select to display the dictionary $tabfield = array(); $tabfield[32] = "code,label,range_account,category_type,formula,position,country"; -// Nom des champs d'edition pour modification d'un enregistrement +// Name of editing fields for record modification $tabfieldvalue = array(); $tabfieldvalue[32] = "code,label,range_account,category_type,formula,position,country_id"; -// Nom des champs dans la table pour insertion d'un enregistrement +// Name of the fields in the table for inserting a record $tabfieldinsert = array(); $tabfieldinsert[32] = "code,label,range_account,category_type,formula,position,fk_country"; -// Nom du rowid si le champ n'est pas de type autoincrement +// Name of the rowid if the field is not of type autoincrement // Example: "" if id field is "rowid" and has autoincrement on // "nameoffield" if id field is not "rowid" or has not autoincrement on $tabrowid = array(); @@ -151,7 +151,7 @@ if (GETPOST('actionadd', 'alpha') || GETPOST('actionmodify', 'alpha')) { if ($value == 'range_account' && empty($_POST['range_account'])) { continue; } - if ($value == 'country' || $value == 'country_id') { + if (($value == 'country' || $value == 'country_id') && (!empty($_POST['country_id']))) { continue; } if (!GETPOSTISSET($value) || GETPOST($value) == '') { @@ -176,6 +176,9 @@ if (GETPOST('actionadd', 'alpha') || GETPOST('actionmodify', 'alpha')) { if ($fieldnamekey == 'category_type') { $fieldnamekey = 'Calculated'; } + if ($fieldnamekey == 'country') { + $fieldnamekey = 'Country'; + } setEventMessages($langs->transnoentities("ErrorFieldRequired", $langs->transnoentities($fieldnamekey)), null, 'errors'); } @@ -263,7 +266,7 @@ if (GETPOST('actionadd', 'alpha') || GETPOST('actionmodify', 'alpha')) { } } - // Si verif ok et action modify, on modifie la ligne + // If check ok and action modify, we modify the line if ($ok && GETPOST('actionmodify', 'alpha')) { if ($tabrowid[$id]) { $rowidcol = $tabrowid[$id]; @@ -430,12 +433,12 @@ print load_fiche_titre($titre, $linkback, $titlepicto); print ''.$langs->trans("AccountingAccountGroupsDesc", $langs->transnoentitiesnoconv("ByPersonalizedAccountGroups")).'

'; -// Confirmation de la suppression de la ligne +// Confirmation of the deletion of the line if ($action == 'delete') { print $form->formconfirm($_SERVER["PHP_SELF"].'?'.($page ? 'page='.$page.'&' : '').'sortfield='.$sortfield.'&sortorder='.$sortorder.'&rowid='.$rowid.'&code='.$code.'&id='.$id.($search_country_id > 0 ? '&search_country_id='.$search_country_id : ''), $langs->trans('DeleteLine'), $langs->trans('ConfirmDeleteLine'), 'confirm_delete', '', 0, 1); } -// Complete requete recherche valeurs avec critere de tri +// Complete search query with sorting criteria $sql = $tabsql[$id]; if ($search_country_id > 0) { @@ -634,14 +637,14 @@ if ($resql) { // Title of lines print ''; foreach ($fieldlist as $field => $value) { - // Determine le nom du champ par rapport aux noms possibles - // dans les dictionnaires de donnees - $showfield = 1; // By defaut + // Determines the name of the field in relation to the possible names + // in data dictionaries + $showfield = 1; // By default $class = "left"; $sortable = 1; $valuetoshow = ''; - $valuetoshow = ucfirst($fieldlist[$field]); // By defaut + $valuetoshow = ucfirst($fieldlist[$field]); // By default $valuetoshow = $langs->trans($valuetoshow); // try to translate if ($fieldlist[$field] == 'source') { $valuetoshow = $langs->trans("Contact"); diff --git a/htdocs/accountancy/admin/index.php b/htdocs/accountancy/admin/index.php index 45b5acc7c8a..309dc094e82 100644 --- a/htdocs/accountancy/admin/index.php +++ b/htdocs/accountancy/admin/index.php @@ -1,7 +1,7 @@ * Copyright (C) 2013-2014 Florian Henry - * Copyright (C) 2013-2019 Alexandre Spangaro + * Copyright (C) 2013-2021 Alexandre Spangaro * Copyright (C) 2014-2015 Ari Elbaz (elarifr) * Copyright (C) 2014 Marcos García * Copyright (C) 2014 Juanjo Menent @@ -260,6 +260,22 @@ $linkback = ''; //$linkback = '' . $langs->trans("BackToModuleList") . ''; print load_fiche_titre($title, $linkback, 'accountancy'); +// Show message if accountancy hidden options are activated to help to resolve some problems +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->ACCOUNTANCY_USE_PRODUCT_ACCOUNT_ON_THIRDPARTY)) { + print '
' . $langs->trans("ConstantIsOn", "ACCOUNTANCY_USE_PRODUCT_ACCOUNT_ON_THIRDPARTY") . '
'; + } + if (!empty($conf->global->MAIN_COMPANY_PERENTITY_SHARED)) { + print '
' . $langs->trans("ConstantIsOn", "MAIN_COMPANY_PERENTITY_SHARED") . '
'; + } + if (!empty($conf->global->MAIN_PRODUCT_PERENTITY_SHARED)) { + print '
' . $langs->trans("ConstantIsOn", "MAIN_PRODUCT_PERENTITY_SHARED") . '
'; + } +} + print '
'; print ''; print ''; diff --git a/htdocs/accountancy/class/bookkeeping.class.php b/htdocs/accountancy/class/bookkeeping.class.php index c80e1088e14..9cda04f6155 100644 --- a/htdocs/accountancy/class/bookkeeping.class.php +++ b/htdocs/accountancy/class/bookkeeping.class.php @@ -937,7 +937,6 @@ class BookKeeping extends CommonObject $line->piece_num = $obj->piece_num; $line->date_creation = $this->db->jdate($obj->date_creation); $line->date_export = $this->db->jdate($obj->date_export); - $line->date_validation = $this->db->jdate($obj->date_validated); $line->date_validation = $this->db->jdate($obj->date_validation); $this->lines[] = $line; @@ -1090,7 +1089,6 @@ class BookKeeping extends CommonObject $line->date_lim_reglement = $this->db->jdate($obj->date_lim_reglement); $line->date_modification = $this->db->jdate($obj->date_modification); $line->date_export = $this->db->jdate($obj->date_export); - $line->date_validation = $this->db->jdate($obj->date_validated); $line->date_validation = $this->db->jdate($obj->date_validation); $this->lines[] = $line; @@ -1752,7 +1750,6 @@ class BookKeeping extends CommonObject $line->date_creation = $obj->date_creation; $line->date_modification = $obj->date_modification; $line->date_export = $obj->date_export; - $line->date_validation = $obj->date_validated; $line->date_validation = $obj->date_validation; $this->linesmvt[] = $line; @@ -1817,7 +1814,6 @@ class BookKeeping extends CommonObject $line->sens = $obj->sens; $line->code_journal = $obj->code_journal; $line->piece_num = $obj->piece_num; - $line->date_validation = $obj->date_validated; $line->date_validation = $obj->date_validation; $this->linesexport[] = $line; diff --git a/htdocs/adherents/admin/member.php b/htdocs/adherents/admin/member.php index 0ff0919652d..39587521c4d 100644 --- a/htdocs/adherents/admin/member.php +++ b/htdocs/adherents/admin/member.php @@ -228,7 +228,7 @@ print "\n"; // Allow members to change type on renewal forms /* To test during next beta print ''.$langs->trans("MemberAllowchangeOfType").''; -print $form->selectyesno('ADHERENT_LOGIN_NOT_REQUIRED', (!empty($conf->global->MEMBER_ALLOW_CHANGE_OF_TYPE) ? 0 : 1), 1); +print $form->selectyesno('MEMBER_ALLOW_CHANGE_OF_TYPE', (!empty($conf->global->MEMBER_ALLOW_CHANGE_OF_TYPE) ? 0 : 1), 1); print "\n"; */ diff --git a/htdocs/adherents/card.php b/htdocs/adherents/card.php index 01efbc180d3..c4ac6ef1472 100644 --- a/htdocs/adherents/card.php +++ b/htdocs/adherents/card.php @@ -928,7 +928,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { $object->state_id = GETPOST('state_id', 'int'); // We set country_id, country_code and country for the selected country - $object->country_id = GETPOST('country_id', 'int') ?GETPOST('country_id', 'int') : $mysoc->country_id; + $object->country_id = GETPOST('country_id', 'int') ? GETPOST('country_id', 'int') : $mysoc->country_id; if ($object->country_id) { $tmparray = getCountry($object->country_id, 'all'); $object->country_code = $tmparray['code']; @@ -936,12 +936,12 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { } if (!empty($socid)) { - $object = new Societe($db); + $soc = new Societe($db); if ($socid > 0) { - $object->fetch($socid); + $soc->fetch($socid); } - if (!($object->id > 0)) { + if (!($soc->id > 0)) { $langs->load("errors"); print($langs->trans('ErrorRecordNotFound')); exit; @@ -1024,7 +1024,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { print "\n"; // Company - print ''.$langs->trans("Company").''; + print ''.$langs->trans("Company").''; // Civility print ''.$langs->trans("UserTitle").''; @@ -1048,7 +1048,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { // EMail print ''.(!empty($conf->global->ADHERENT_MAIL_REQUIRED) ? '' : '').$langs->trans("EMail").(!empty($conf->global->ADHERENT_MAIL_REQUIRED) ? '' : '').''; - print ''.img_picto('', 'object_email').' '; + print ''.img_picto('', 'object_email').' '; // Website print ''.$form->editfieldkey('Web', 'member_url', '', $object, 0).''; @@ -1056,21 +1056,25 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { // Address print ''.$langs->trans("Address").''; - print ''; + print ''; print ''; // Zip / Town print ''.$langs->trans("Zip").' / '.$langs->trans("Town").''; - print $formcompany->select_ziptown((GETPOSTISSET('zipcode') ? GETPOST('zipcode', 'alphanohtml') : $object->zip), 'zipcode', array('town', 'selectcountry_id', 'state_id'), 6); + print $formcompany->select_ziptown((GETPOSTISSET('zipcode') ? GETPOST('zipcode', 'alphanohtml') : $soc->zip), 'zipcode', array('town', 'selectcountry_id', 'state_id'), 6); print ' '; - print $formcompany->select_ziptown((GETPOSTISSET('town') ? GETPOST('town', 'alphanohtml') : $object->town), 'town', array('zipcode', 'selectcountry_id', 'state_id')); + print $formcompany->select_ziptown((GETPOSTISSET('town') ? GETPOST('town', 'alphanohtml') : $soc->town), 'town', array('zipcode', 'selectcountry_id', 'state_id')); print ''; // Country - $object->country_id = $object->country_id ? $object->country_id : $mysoc->country_id; - print ''.$langs->trans('Country').''; + if (empty($soc->country_id)) { + $soc->country_id = $mysoc->country_id; + $soc->country_code = $mysoc->country_code; + $soc->state_id = $mysoc->state_id; + } + print ''.$langs->trans('Country').''; print img_picto('', 'country', 'class="pictofixedwidth"'); - print $form->select_country(GETPOSTISSET('country_id') ? GETPOST('country_id', 'alpha') : $object->country_id, 'country_id'); + print $form->select_country(GETPOSTISSET('country_id') ? GETPOST('country_id', 'alpha') : $soc->country_id, 'country_id'); if ($user->admin) { print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1); } @@ -1079,9 +1083,9 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { // State if (empty($conf->global->MEMBER_DISABLE_STATE)) { print ''.$langs->trans('State').''; - if ($object->country_id) { + if ($soc->country_id) { print img_picto('', 'state', 'class="pictofixedwidth"'); - print $formcompany->select_state(GETPOSTISSET('state_id') ? GETPOST('state_id', 'int') : $object->state_id, $object->country_code); + print $formcompany->select_state(GETPOSTISSET('state_id') ? GETPOST('state_id', 'int') : $soc->state_id, $soc->country_code); } else { print $countrynotdefined; } @@ -1090,7 +1094,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { // Pro phone print ''.$langs->trans("PhonePro").''; - print ''.img_picto('', 'object_phoning').' '; + print ''.img_picto('', 'object_phoning').' '; // Personal phone print ''.$langs->trans("PhonePerso").''; diff --git a/htdocs/adherents/list.php b/htdocs/adherents/list.php index d55845b40c1..fe21b8577ef 100644 --- a/htdocs/adherents/list.php +++ b/htdocs/adherents/list.php @@ -962,7 +962,7 @@ while ($i < min($num, $limit)) { // Firstname if (!empty($arrayfields['d.firstname']['checked'])) { print ''; - print $memberstatic->getNomUrl(0, 0, 'card', 'fistname'); + print $memberstatic->getNomUrl(0, 0, 'card', 'firstname'); //print $obj->firstname; print "\n"; if (!$i) { diff --git a/htdocs/admin/accountant.php b/htdocs/admin/accountant.php index 4df27127608..221c57ab027 100644 --- a/htdocs/admin/accountant.php +++ b/htdocs/admin/accountant.php @@ -115,7 +115,7 @@ print ''; print ''; print ''; -print ''."\n"; +print ''."\n"; // Name print '
'.$langs->trans("CompanyInfo").''.$langs->trans("Value").'
'.$langs->trans("CompanyInfo").''.$langs->trans("Value").'
'; diff --git a/htdocs/admin/company_socialnetworks.php b/htdocs/admin/company_socialnetworks.php index 1ea09182344..80e152bd045 100644 --- a/htdocs/admin/company_socialnetworks.php +++ b/htdocs/admin/company_socialnetworks.php @@ -104,13 +104,11 @@ print ''; print ''; print ''; -// Social networks -print '
'; print '
'; print ''; print ''; -print ''; +print ''; print "\n"; diff --git a/htdocs/admin/openinghours.php b/htdocs/admin/openinghours.php index 03f396c9198..fb7dddc092c 100644 --- a/htdocs/admin/openinghours.php +++ b/htdocs/admin/openinghours.php @@ -92,7 +92,7 @@ if (empty($action) || $action == 'edit' || $action == 'updateedit') { print ''; print '
'.$langs->trans("SocialNetworksInformation").''.$langs->trans("Url").''.$langs->trans("SocialNetworkId").''.$langs->trans("SocialNetworksInformation").''.$langs->trans("Url").''.$langs->trans("SocialNetworkId").'
'; - print ''."\n"; + print ''."\n"; print ''; //print ''; diff --git a/htdocs/exports/class/export.class.php b/htdocs/exports/class/export.class.php index 50acd166237..e0067709e85 100644 --- a/htdocs/exports/class/export.class.php +++ b/htdocs/exports/class/export.class.php @@ -379,13 +379,13 @@ class Export */ public function conditionDate($Field, $Value, $Sens) { - // TODO date_format is forbidden, not performant and not portable. Use instead BETWEEN + // TODO date_format is forbidden, not performant and not portable. Use instead $Value to forge the range date. if (strlen($Value) == 4) { - $Condition = " date_format(".$Field.",'%Y') ".$Sens." '".$Value."'"; + $Condition = " date_format(".$Field.",'%Y') ".$Sens." '".$this->db->escape($Value)."'"; } elseif (strlen($Value) == 6) { - $Condition = " date_format(".$Field.",'%Y%m') ".$Sens." '".$Value."'"; + $Condition = " date_format(".$Field.",'%Y%m') ".$Sens." '".$this->db->escape($Value)."'"; } else { - $Condition = " date_format(".$Field.",'%Y%m%d') ".$Sens." ".$Value; + $Condition = " date_format(".$Field.",'%Y%m%d') ".$Sens." '".$this->db->escape($Value)."'"; } return $Condition; } @@ -416,7 +416,7 @@ class Export case 'Duree': case 'Numeric': case 'Number': - // Must be a string text to allow to use comparison strings like "<= 999" + // Must be a string text to allow to use comparison strings like "<= 99.9" $szFilterField = ''; break; case 'Status': diff --git a/htdocs/fourn/commande/dispatch.php b/htdocs/fourn/commande/dispatch.php index 16d4b1f25f3..7192f976219 100644 --- a/htdocs/fourn/commande/dispatch.php +++ b/htdocs/fourn/commande/dispatch.php @@ -1219,7 +1219,7 @@ if ($id > 0 || !empty($ref)) { // Qty print ''; print ''; - print ' '; + print ' '; print '
'.$langs->trans("Day").''.$langs->trans("Value").'
'.$langs->trans("Day").''.$langs->trans("Value").'
'; print $form->textwithpicto($langs->trans("Monday"), $langs->trans("OpeningHoursFormatDesc")); diff --git a/htdocs/comm/propal/class/propal.class.php b/htdocs/comm/propal/class/propal.class.php index a7b5c465226..6ae93695f8c 100644 --- a/htdocs/comm/propal/class/propal.class.php +++ b/htdocs/comm/propal/class/propal.class.php @@ -2563,8 +2563,13 @@ class Propal extends CommonObject $outputlangs->setDefaultLang($newlang); } + // PDF + $hidedetails = (!empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DETAILS) ? 1 : 0); + $hidedesc = (!empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DESC) ? 1 : 0); + $hideref = (!empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_REF) ? 1 : 0); + //$ret=$object->fetch($id); // Reload to get new records - $this->generateDocument($modelpdf, $outputlangs); + $this->generateDocument($modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref); } if (!$error) { @@ -2651,8 +2656,13 @@ class Propal extends CommonObject $outputlangs->setDefaultLang($newlang); } + // PDF + $hidedetails = (!empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DETAILS) ? 1 : 0); + $hidedesc = (!empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DESC) ? 1 : 0); + $hideref = (!empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_REF) ? 1 : 0); + //$ret=$object->fetch($id); // Reload to get new records - $this->generateDocument($modelpdf, $outputlangs); + $this->generateDocument($modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref); } $this->oldcopy = clone $this; diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php index 1a4a775fa5e..c71f022d2dc 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -3857,6 +3857,15 @@ if ($action == 'create') { // $resteapayer=bcadd($resteapayer,$totalavoir,$conf->global->MAIN_MAX_DECIMALS_TOT); $resteapayer = price2num($object->total_ttc - $totalpaye - $totalcreditnotes - $totaldeposits, 'MT'); + // Multicurrency + if (!empty($conf->multicurrency->enabled)) { + $multicurrency_totalpaye = $object->getSommePaiement(1); + $multicurrency_totalcreditnotes = $object->getSumCreditNotesUsed(1); + $multicurrency_totaldeposits = $object->getSumDepositsUsed(1); + $multicurrency_resteapayer = price2num($object->multicurrency_total_ttc - $multicurrency_totalpaye - $multicurrency_totalcreditnotes - $multicurrency_totaldeposits, 'MT'); + $resteapayer = price2num($multicurrency_resteapayer / $object->multicurrency_tx, 'MT'); + } + if ($object->paye) { $resteapayer = 0; } diff --git a/htdocs/core/class/html.formactions.class.php b/htdocs/core/class/html.formactions.class.php index 0590566582d..d4f4779a606 100644 --- a/htdocs/core/class/html.formactions.class.php +++ b/htdocs/core/class/html.formactions.class.php @@ -314,7 +314,7 @@ class FormActions $tmpa = dol_getdate($actioncomm->datep); $tmpb = dol_getdate($actioncomm->datef); if ($tmpa['mday'] == $tmpb['mday'] && $tmpa['mon'] == $tmpb['mon'] && $tmpa['year'] == $tmpb['year']) { - if ($tmpa['hours'] != $tmpb['hours'] || $tmpa['minutes'] != $tmpb['minutes'] && $tmpa['seconds'] != $tmpb['seconds']) { + if ($tmpa['hours'] != $tmpb['hours'] || $tmpa['minutes'] != $tmpb['minutes']) { print '-'.dol_print_date($actioncomm->datef, 'hour', 'tzuserrel'); } } else { diff --git a/htdocs/core/lib/accounting.lib.php b/htdocs/core/lib/accounting.lib.php index 68af901a757..21afb5f3490 100644 --- a/htdocs/core/lib/accounting.lib.php +++ b/htdocs/core/lib/accounting.lib.php @@ -103,7 +103,7 @@ function length_accountg($account) return $account; } - $g = $conf->global->ACCOUNTING_LENGTH_GACCOUNT; + $g = getDolGlobalInt('ACCOUNTING_LENGTH_GACCOUNT'); if (!is_empty($g)) { // Clean parameters $i = strlen($account); @@ -142,7 +142,7 @@ function length_accounta($accounta) return $accounta; } - $a = $conf->global->ACCOUNTING_LENGTH_AACCOUNT; + $a = getDolGlobalInt('ACCOUNTING_LENGTH_AACCOUNT'); if (!is_empty($a)) { // Clean parameters $i = strlen($accounta); diff --git a/htdocs/datapolicy/class/actions_datapolicy.class.php b/htdocs/datapolicy/class/actions_datapolicy.class.php index e54086149fe..c58e1634fc2 100644 --- a/htdocs/datapolicy/class/actions_datapolicy.class.php +++ b/htdocs/datapolicy/class/actions_datapolicy.class.php @@ -133,7 +133,7 @@ class ActionsDatapolicy header('Content-Disposition: attachment; filename=datapolicy_portabilite.csv'); header('Pragma: no-cache'); $object->fetch(GETPOST('socid')); - echo 'Name;Fistname;Civility;Thirdparty;Function;Address;ZipCode;City;Department;Country;Email;Pro Phone;Perso Phone;Mobile Phone;Instant Mail;Birthday;'.PHP_EOL; + echo 'Name;Firstname;Civility;Thirdparty;Function;Address;ZipCode;City;Department;Country;Email;Pro Phone;Perso Phone;Mobile Phone;Instant Mail;Birthday;'.PHP_EOL; echo $object->name.';'; echo ';'; echo ';'; @@ -157,7 +157,7 @@ class ActionsDatapolicy header('Pragma: no-cache'); $soc = $object->fetch_thirdparty(); - echo 'Name;Fistname;Civility;Thirdparty;Function;Address;ZipCode;City;Department;Country;Email;Pro Phone;Perso Phone;Mobile Phone;Instant Mail;Birthday;'.PHP_EOL; + echo 'Name;Firstname;Civility;Thirdparty;Function;Address;ZipCode;City;Department;Country;Email;Pro Phone;Perso Phone;Mobile Phone;Instant Mail;Birthday;'.PHP_EOL; echo $object->lastname.';'; echo $object->firstname.';'; echo $object->getCivilityLabel().';'; @@ -181,7 +181,7 @@ class ActionsDatapolicy header('Content-Disposition: attachment; filename=datapolicy_portabilite.csv'); header('Pragma: no-cache'); $soc = $object->fetch_thirdparty(); - echo 'Name;Fistname;Civility;Thirdparty;Function;Address;ZipCode;City;Department;Country;Email;Pro Phone;Perso Phone;Mobile Phone;Instant Mail;Birthday;'.PHP_EOL; + echo 'Name;Firstname;Civility;Thirdparty;Function;Address;ZipCode;City;Department;Country;Email;Pro Phone;Perso Phone;Mobile Phone;Instant Mail;Birthday;'.PHP_EOL; echo $object->lastname.';'; echo $object->firstname.';'; echo $object->getCivilityLabel().';'; diff --git a/htdocs/expensereport/card.php b/htdocs/expensereport/card.php index b187e15845b..5a4f7c57b61 100644 --- a/htdocs/expensereport/card.php +++ b/htdocs/expensereport/card.php @@ -2,7 +2,7 @@ /* Copyright (C) 2003 Rodolphe Quiedeville * Copyright (C) 2004-2020 Laurent Destailleur * Copyright (C) 2005-2009 Regis Houssin - * Copyright (C) 2015-2017 Alexandre Spangaro + * Copyright (C) 2015-2021 Alexandre Spangaro * Copyright (C) 2017 Ferran Marcet * Copyright (C) 2018 Frédéric France * @@ -2326,7 +2326,7 @@ if ($action == 'create') { // Quantity print ''; - print ''; + print ''; // We must be able to enter decimal qty print ''.$langs->trans('AmountHT').''; if ($action == 'editline' && $lineid == $objp->dispatchlineid) { - print ''; + print ''; } else { print $objp->qty; } diff --git a/htdocs/fourn/facture/card.php b/htdocs/fourn/facture/card.php index d03b93e439b..d32f7eebb93 100644 --- a/htdocs/fourn/facture/card.php +++ b/htdocs/fourn/facture/card.php @@ -2417,6 +2417,15 @@ if ($action == 'create') { // $resteapayer=bcadd($resteapayer,$totalavoir,$conf->global->MAIN_MAX_DECIMALS_TOT); $resteapayer = price2num($object->total_ttc - $totalpaye - $totalcreditnotes - $totaldeposits, 'MT'); + // Multicurrency + if (!empty($conf->multicurrency->enabled)) { + $multicurrency_totalpaye = $object->getSommePaiement(1); + $multicurrency_totalcreditnotes = $object->getSumCreditNotesUsed(1); + $multicurrency_totaldeposits = $object->getSumDepositsUsed(1); + $multicurrency_resteapayer = price2num($object->multicurrency_total_ttc - $multicurrency_totalpaye - $multicurrency_totalcreditnotes - $multicurrency_totaldeposits, 'MT'); + $resteapayer = price2num($multicurrency_resteapayer / $object->multicurrency_tx, 'MT'); + } + if ($object->paye) { $resteapayer = 0; } diff --git a/htdocs/install/repair.php b/htdocs/install/repair.php index 3bc37960bf3..16ed758b1f8 100644 --- a/htdocs/install/repair.php +++ b/htdocs/install/repair.php @@ -565,7 +565,7 @@ if ($ok && GETPOST('restore_user_pictures', 'alpha')) { $filetotestsmall = $dolibarr_main_data_root.'/users/'.substr(sprintf('%08d', $obj->rowid), -1, 1).'/'.substr(sprintf('%08d', $obj->rowid), -2, 1).'/thumbs/'.$name.'_small'.$ext; $filetotestmini = $dolibarr_main_data_root.'/users/'.substr(sprintf('%08d', $obj->rowid), -1, 1).'/'.substr(sprintf('%08d', $obj->rowid), -2, 1).'/thumbs/'.$name.'_mini'.$ext; $exists = dol_is_file($filetotest); - print 'Check user '.$obj->rowid.' lastname='.$obj->lastname.' fistname='.$obj->firstname.' photo='.$obj->photo.' file '.$filetotest." exists=".$exists."
\n"; + print 'Check user '.$obj->rowid.' lastname='.$obj->lastname.' firstname='.$obj->firstname.' photo='.$obj->photo.' file '.$filetotest." exists=".$exists."
\n"; if ($exists) { $filetarget = $dolibarr_main_data_root.'/users/'.$obj->rowid.'/'.$name.$ext; $filetargetsmall = $dolibarr_main_data_root.'/users/'.$obj->rowid.'/thumbs/'.$name.'_small'.$ext; diff --git a/htdocs/install/upgrade2.php b/htdocs/install/upgrade2.php index 27d34e2aa51..960b5b88c74 100644 --- a/htdocs/install/upgrade2.php +++ b/htdocs/install/upgrade2.php @@ -530,7 +530,7 @@ if (!GETPOST('action', 'aZ09') || preg_match('/upgrade/i', GETPOST('action', 'aZ // Can call a dedicated external upgrade process if (!$error) { - $parameters = array('versionfrom'=>$versionfrom, 'versionto='.$versionto); + $parameters = array('versionfrom' => $versionfrom, 'versionto' => $versionto); $object = new stdClass(); $action = "upgrade"; $reshook = $hookmanager->executeHooks('doUpgrade2', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks diff --git a/htdocs/langs/en_US/banks.lang b/htdocs/langs/en_US/banks.lang index a0b7942d446..6c770163f29 100644 --- a/htdocs/langs/en_US/banks.lang +++ b/htdocs/langs/en_US/banks.lang @@ -182,3 +182,4 @@ BankColorizeMovementName2=Background color for credit movement IfYouDontReconcileDisableProperty=If you don't make the bank reconciliations on some bank accounts, disable the property "%s" on them to remove this warning. NoBankAccountDefined=No bank account defined NoRecordFoundIBankcAccount=No record found in bank account. Commonly, this occurs when a record has been deleted manually from the list of transaction in the bank account (for example during a reconciliation of the bank account). Another reason is that the payment was recorded when the module "%s" was disabled. +AlreadyOneBankAccount=Already one bank account defined diff --git a/htdocs/multicurrency/multicurrency_rate.php b/htdocs/multicurrency/multicurrency_rate.php index d0be7666a95..36a6af12750 100644 --- a/htdocs/multicurrency/multicurrency_rate.php +++ b/htdocs/multicurrency/multicurrency_rate.php @@ -479,7 +479,7 @@ if ($resql) { // var_dump($obj); print '
' . $form->selectMultiCurrency($obj->code, 'multicurrency_code', 1, " code != '".$conf->currency."'", true) . ''; print ''; diff --git a/htdocs/product/class/api_products.class.php b/htdocs/product/class/api_products.class.php index e7709b3af41..3e93fee5d04 100644 --- a/htdocs/product/class/api_products.class.php +++ b/htdocs/product/class/api_products.class.php @@ -1617,7 +1617,7 @@ class Products extends DolibarrApi $combinations[$key]->attributes = $prodc2vp->fetchByFkCombination((int) $combination->id); $combinations[$key] = $this->_cleanObjectDatas($combinations[$key]); - if ($includestock==1) { + if ($includestock==1 && DolibarrApiAccess::$user->rights->stock->lire) { $productModel = new Product($this->db); $productModel->fetch((int) $combination->fk_product_child); $productModel->load_stock(); @@ -1859,7 +1859,7 @@ class Products extends DolibarrApi public function getStock($id, $selected_warehouse_id = null) { - if (!DolibarrApiAccess::$user->rights->produit->lire) { + if (!DolibarrApiAccess::$user->rights->produit->lire || !DolibarrApiAccess::$user->rights->stock->lire) { throw new RestException(401); } @@ -1945,6 +1945,10 @@ class Products extends DolibarrApi unset($object->supplierprices); // Mut use another API to get them + if (!DolibarrApiAccess::$user->rights->stock->lire) { + unset($object->stock_reel); + unset($object->stock_theorique); + } return $object; } @@ -2008,7 +2012,7 @@ class Products extends DolibarrApi throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login); } - if ($includestockdata) { + if ($includestockdata && DolibarrApiAccess::$user->rights->stock->lire) { $this->product->load_stock(); if (is_array($this->product->stock_warehouse)) { diff --git a/htdocs/public/members/new.php b/htdocs/public/members/new.php index 5c7de4c321e..4795338a938 100644 --- a/htdocs/public/members/new.php +++ b/htdocs/public/members/new.php @@ -523,6 +523,7 @@ print ''. print ''; print ''; print ''; +print ''; print '
'; @@ -563,7 +564,7 @@ jQuery(document).ready(function () { print ''."\n"; - // Type +// Type if (empty($conf->global->MEMBER_NEWFORM_FORCETYPE)) { $listoftype = $adht->liste_array(); $tmp = array_keys($listoftype); @@ -596,7 +597,7 @@ if (empty($conf->global->MEMBER_NEWFORM_FORCEMORPHY)) { // Company print ''."\n"; +print ''."\n"; // Title print ''."\n"; @@ -625,7 +626,7 @@ print ''."\n"; // Zip / Town print ''; diff --git a/htdocs/recruitment/class/recruitmentjobposition.class.php b/htdocs/recruitment/class/recruitmentjobposition.class.php index ccb822a3b17..3b52e5b4fa6 100644 --- a/htdocs/recruitment/class/recruitmentjobposition.class.php +++ b/htdocs/recruitment/class/recruitmentjobposition.class.php @@ -698,8 +698,14 @@ class RecruitmentJobPosition extends CommonObject $newlang = (GETPOST('lang_id', 'aZ09') ? GETPOST('lang_id', 'aZ09') : $this->thirdparty->default_lang); $outputlangs->setDefaultLang($newlang); } + + // PDF + $hidedetails = (!empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DETAILS) ? 1 : 0); + $hidedesc = (!empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DESC) ? 1 : 0); + $hideref = (!empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_REF) ? 1 : 0); + //$ret=$object->fetch($id); // Reload to get new records - $this->generateDocument($modelpdf, $outputlangs); + $this->generateDocument($modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref); } if (!$error) { diff --git a/htdocs/societe/card.php b/htdocs/societe/card.php index 77318146e25..651d24a6d54 100644 --- a/htdocs/societe/card.php +++ b/htdocs/societe/card.php @@ -1170,6 +1170,10 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { $("#typent_id").change(); $("#effectif_id").val(id_ef15); $("#effectif_id").change(); + /* Force to recompute the width of a select2 field when it was hidden and then shown programatically */ + if ($("#civility_id").data("select2")) { + $("#civility_id").select2({width: "resolve"}); + } $("#TypeName").html(document.formsoc.LastName.value); document.formsoc.private.value=1; }); diff --git a/htdocs/theme/eldy/global.inc.php b/htdocs/theme/eldy/global.inc.php index 97a2c1f738a..366e9322dde 100644 --- a/htdocs/theme/eldy/global.inc.php +++ b/htdocs/theme/eldy/global.inc.php @@ -1566,7 +1566,7 @@ select.widthcentpercentminusxx, span.widthcentpercentminusxx:not(.select2-select height: 64px !important; } - .divmainbodylarge { margin-left: 20px !important; margin-right: 20px !important; } + .divmainbodylarge { margin-left: 10px !important; margin-right: 10px !important; } .tdoverflowonsmartphone { max-width: 0; diff --git a/htdocs/theme/md/style.css.php b/htdocs/theme/md/style.css.php index 1a49a61573d..51e625438fd 100644 --- a/htdocs/theme/md/style.css.php +++ b/htdocs/theme/md/style.css.php @@ -1589,7 +1589,7 @@ table[summary="list_of_modules"] .fa-cog { min-width: 150px !important; } - .divmainbodylarge { margin-left: 20px; margin-right: 20px; } + .divmainbodylarge { margin-left: 10px; margin-right: 10px; } .tdoverflowonsmartphone { max-width: 0; diff --git a/htdocs/ticket/class/ticket.class.php b/htdocs/ticket/class/ticket.class.php index 7bee6692c5f..2fad1afd8ab 100644 --- a/htdocs/ticket/class/ticket.class.php +++ b/htdocs/ticket/class/ticket.class.php @@ -1676,7 +1676,7 @@ class Ticket extends CommonObject $actioncomm->userassigned = array($user->id); $actioncomm->userownerid = $user->id; $actioncomm->datep = $now; - $actioncomm->percentage = 100; + $actioncomm->percentage = -1; // percentage is not relevant for punctual events $actioncomm->elementtype = 'ticket'; $actioncomm->fk_element = $this->id; diff --git a/htdocs/user/bank.php b/htdocs/user/bank.php index 1bb88ce3d8c..a1edfc48269 100644 --- a/htdocs/user/bank.php +++ b/htdocs/user/bank.php @@ -1,12 +1,12 @@ - * Copyright (C) 2003 Jean-Louis Bergamo - * Copyright (C) 2004-2015 Laurent Destailleur - * Copyright (C) 2005-2009 Regis Houssin - * Copyright (C) 2013 Peter Fontaine - * Copyright (C) 2015-2016 Marcos García - * Copyright (C) 2015 Alexandre Spangaro - * Copyright (C) 2021 Gauthier VERDOL +/* Copyright (C) 2002-2004 Rodolphe Quiedeville + * Copyright (C) 2003 Jean-Louis Bergamo + * Copyright (C) 2004-2015 Laurent Destailleur + * Copyright (C) 2005-2009 Regis Houssin + * Copyright (C) 2013 Peter Fontaine + * Copyright (C) 2015-2016 Marcos García + * Copyright (C) 2015 Alexandre Spangaro + * Copyright (C) 2021 Gauthier VERDOL * * 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 @@ -324,7 +324,8 @@ if ($action != 'edit' && $action != 'create') { // If not bank account yet, $ac $ret .= ''; print $ret; } else { - print dol_getIdFromCode($db, $object->default_c_exp_tax_cat, 'c_exp_tax_cat', 'rowid', 'label'); + $label_exp_tax_cat = dol_getIdFromCode($db, $object->default_c_exp_tax_cat, 'c_exp_tax_cat', 'rowid', 'label'); + print $langs->trans($label_exp_tax_cat); //print $form->editfieldval("DefaultCategoryCar", 'default_c_exp_tax_cat', $object->default_c_exp_tax_cat, $object, $user->rights->user->user->creer, 'string', ($object->default_c_exp_tax_cat != '' ? $object->default_c_exp_tax_cat : '')); } print ''; @@ -359,7 +360,7 @@ if ($action != 'edit' && $action != 'create') { // If not bank account yet, $ac print '
'; - // Nbre max d'elements des petites listes + // Max number of elements in small lists $MAXLIST = $conf->global->MAIN_SIZE_SHORTLIST_LIMIT; // Latest payments of salaries
'.$langs->trans("Company").''; print img_picto('', 'company', 'class="pictofixedwidth"'); -print '
'.$langs->trans('UserTitle').''; print $formcompany->select_civility(GETPOST('civility_id'), 'civility_id').'
'.$langs->trans("Address").''."\n"; print '
'.$langs->trans('Zip').' / '.$langs->trans('Town').''; -print $formcompany->select_ziptown(GETPOST('zipcode'), 'zipcode', array('town', 'selectcountry_id', 'state_id'), 6, 1); +print $formcompany->select_ziptown(GETPOST('zipcode'), 'zipcode', array('town', 'selectcountry_id', 'state_id'), 0, 1, '', 'width75'); print ' / '; print $formcompany->select_ziptown(GETPOST('town'), 'town', array('zipcode', 'selectcountry_id', 'state_id'), 0, 1); print '