diff --git a/htdocs/comm/action/class/api_agendaevents.class.php b/htdocs/comm/action/class/api_agendaevents.class.php index dedc515f61c..677e477cd89 100644 --- a/htdocs/comm/action/class/api_agendaevents.class.php +++ b/htdocs/comm/action/class/api_agendaevents.class.php @@ -219,7 +219,7 @@ class AgendaEvents extends DolibarrApi /** - * Update Agenda Event general fields (won't touch lines of expensereport) + * Update Agenda Event general fields * * @param int $id Id of Agenda Event to update * @param array $request_data Datas @@ -236,20 +236,20 @@ class AgendaEvents extends DolibarrApi throw new RestException(401, "Insuffisant rights to create an Agenda Event for owner id ".$request_data['userownerid'].' Your id is '.DolibarrApiAccess::$user->id); } - $result = $this->expensereport->fetch($id); + $result = $this->actioncomm->fetch($id); if ( ! $result ) { - throw new RestException(404, 'expensereport not found'); + throw new RestException(404, 'actioncomm not found'); } - if ( ! DolibarrApi::_checkAccessToResource('expensereport',$this->expensereport->id)) { + if ( ! DolibarrApi::_checkAccessToResource('actioncomm',$this->actioncomm->id)) { throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login); } foreach($request_data as $field => $value) { if ($field == 'id') continue; - $this->expensereport->$field = $value; + $this->actioncomm->$field = $value; } - if ($this->expensereport->update($id, DolibarrApiAccess::$user,1,'','','update')) + if ($this->actioncomm->update($id, DolibarrApiAccess::$user,1,'','','update')) return $this->get($id); return false; diff --git a/htdocs/comm/propal/class/propal.class.php b/htdocs/comm/propal/class/propal.class.php index 30ad7cd76b2..45e139c0b4f 100644 --- a/htdocs/comm/propal/class/propal.class.php +++ b/htdocs/comm/propal/class/propal.class.php @@ -4258,7 +4258,7 @@ class PropaleLigne extends CommonObjectLine * Update DB line fields total_xxx * Used by migration * - * @return int <0 if ko, >0 if ok + * @return int <0 if KO, >0 if OK */ function update_total() { diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php index 3611d8b3d98..c1ed110516d 100644 --- a/htdocs/commande/class/commande.class.php +++ b/htdocs/commande/class/commande.class.php @@ -4333,9 +4333,10 @@ class OrderLine extends CommonOrderLine // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** - * Update totals of order into database + * Update DB line fields total_xxx + * Used by migration * - * @return int <0 if ko, >0 if ok + * @return int <0 if KO, >0 if OK */ function update_total() { diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php index e191ffd3983..27b3fae010e 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -513,7 +513,7 @@ if (empty($reshook)) if ($object->type != Facture::TYPE_DEPOSIT && ! empty($conf->global->STOCK_CALCULATE_ON_BILL) && $qualified_for_stock_change) { if (! $idwarehouse || $idwarehouse == - 1) { - $error ++; + $error++; setEventMessages($langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv("Warehouse")), null, 'errors'); $action = ''; } @@ -573,7 +573,7 @@ if (empty($reshook)) if ($object->type != Facture::TYPE_DEPOSIT && ! empty($conf->global->STOCK_CALCULATE_ON_BILL) && $qualified_for_stock_change) { if (! $idwarehouse || $idwarehouse == - 1) { - $error ++; + $error++; setEventMessages($langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv("Warehouse")), null, 'errors'); $action = ''; } @@ -832,7 +832,7 @@ if (empty($reshook)) } if (! ($_POST['fac_replacement'] > 0)) { - $error ++; + $error++; setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("ReplaceInvoice")), null, 'errors'); } @@ -878,14 +878,14 @@ if (empty($reshook)) $sourceinvoice = GETPOST('fac_avoir'); if (! ($sourceinvoice > 0) && empty($conf->global->INVOICE_CREDIT_NOTE_STANDALONE)) { - $error ++; + $error++; setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("CorrectInvoice")), null, 'errors'); } $dateinvoice = dol_mktime(12, 0, 0, $_POST['remonth'], $_POST['reday'], $_POST['reyear']); if (empty($dateinvoice)) { - $error ++; + $error++; setEventMessages($langs->trans("ErrorFieldRequired", $langs->trans("Date")), null, 'errors'); } @@ -1109,7 +1109,7 @@ if (empty($reshook)) { if (GETPOST('socid', 'int') < 1) { - $error ++; + $error++; setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Customer")), null, 'errors'); } @@ -1279,7 +1279,7 @@ if (empty($reshook)) } } else { setEventMessages($srcobject->error, $srcobject->errors, 'errors'); - $error ++; + $error++; } } @@ -1373,7 +1373,7 @@ if (empty($reshook)) $result = $object->insert_discount($discountid); // This include link_to_invoice } else { setEventMessages($discount->error, $discount->errors, 'errors'); - $error ++; + $error++; break; } } else { @@ -1429,7 +1429,7 @@ if (empty($reshook)) $lineid = $result; } else { $lineid = 0; - $error ++; + $error++; break; } @@ -1441,7 +1441,7 @@ if (empty($reshook)) } } else { setEventMessages($srcobject->error, $srcobject->errors, 'errors'); - $error ++; + $error++; } } @@ -1665,37 +1665,46 @@ if (empty($reshook)) if (empty($idprod) && ($price_ht < 0) && ($qty < 0)) { setEventMessages($langs->trans('ErrorBothFieldCantBeNegative', $langs->transnoentitiesnoconv('UnitPriceHT'), $langs->transnoentitiesnoconv('Qty')), null, 'errors'); - $error ++; + $error++; } if (!$prod_entry_mode) { if (GETPOST('type') < 0 && ! GETPOST('search_idprod')) { setEventMessages($langs->trans('ErrorChooseBetweenFreeEntryOrPredefinedProduct'), null, 'errors'); - $error ++; + $error++; } } if ($prod_entry_mode == 'free' && empty($idprod) && GETPOST('type') < 0) { setEventMessages($langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv('Type')), null, 'errors'); - $error ++; + $error++; } if ($prod_entry_mode == 'free' && empty($idprod) && (($price_ht < 0 && empty($conf->global->FACTURE_ENABLE_NEGATIVE_LINES)) || $price_ht == '') && $price_ht_devise == '') // Unit price can be 0 but not '' { - setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("UnitPriceHT")), null, 'errors'); - $error ++; + if ($price_ht < 0 && empty($conf->global->FACTURE_ENABLE_NEGATIVE_LINES)) + { + $langs->load("errors"); + setEventMessages($langs->trans("ErrorFieldCantBeNegativeOnInvoice", $langs->transnoentitiesnoconv("UnitPriceHT")), null, 'errors'); + $error++; + } + else + { + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("UnitPriceHT")), null, 'errors'); + $error++; + } } if ($qty == '') { setEventMessages($langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv('Qty')), null, 'errors'); - $error ++; + $error++; } if ($prod_entry_mode == 'free' && empty($idprod) && empty($product_desc)) { setEventMessages($langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv('Description')), null, 'errors'); - $error ++; + $error++; } if ($qty < 0) { $langs->load("errors"); setEventMessages($langs->trans('ErrorQtyForCustomerInvoiceCantBeNegative'), null, 'errors'); - $error ++; + $error++; } if (!$error && !empty($conf->variants->enabled) && $prod_entry_mode != 'free') { @@ -1709,7 +1718,7 @@ if (empty($reshook)) else { setEventMessages($langs->trans('ErrorProductCombinationNotFound'), null, 'errors'); - $error ++; + $error++; } } } @@ -2115,7 +2124,7 @@ if (empty($reshook)) // Check price is not lower than minimum (check is done only for standard or replacement invoices) if (($object->type == Facture::TYPE_STANDARD || $object->type == Facture::TYPE_REPLACEMENT) && $price_min && (price2num($pu_ht) * (1 - price2num(GETPOST('remise_percent')) / 100) < price2num($price_min))) { setEventMessages($langs->trans("CantBeLessThanMinPrice", price(price2num($price_min, 'MU'), 0, $langs, 0, 0, - 1, $conf->currency)), null, 'errors'); - $error ++; + $error++; } } else { $type = GETPOST('type'); @@ -2124,14 +2133,29 @@ if (empty($reshook)) // Check parameters if (GETPOST('type') < 0) { setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Type")), null, 'errors'); - $error ++; + $error++; } } if ($qty < 0) { $langs->load("errors"); setEventMessages($langs->trans('ErrorQtyForCustomerInvoiceCantBeNegative'), null, 'errors'); - $error ++; + $error++; } + if (empty($productid) && (($pu_ht < 0 && empty($conf->global->FACTURE_ENABLE_NEGATIVE_LINES)) || $pu_ht == '') && $pu_ht_devise == '') // Unit price can be 0 but not '' + { + if ($pu_ht < 0 && empty($conf->global->FACTURE_ENABLE_NEGATIVE_LINES)) + { + $langs->load("errors"); + setEventMessages($langs->trans("ErrorFieldCantBeNegativeOnInvoice", $langs->transnoentitiesnoconv("UnitPriceHT")), null, 'errors'); + $error++; + } + else + { + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("UnitPriceHT")), null, 'errors'); + $error++; + } + } + // Update line if (! $error) { diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index e0926337200..e9481074494 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -1209,9 +1209,9 @@ class Facture extends CommonInvoice $label.= '
' . $langs->trans('AmountHT') . ': ' . price($this->total_ht, 0, $langs, 0, -1, -1, $conf->currency); if (! empty($this->total_tva)) $label.= '
' . $langs->trans('VAT') . ': ' . price($this->total_tva, 0, $langs, 0, -1, -1, $conf->currency); - if (! empty($this->total_localtax1)) - $label.= '
' . $langs->trans('LT1') . ': ' . price($this->total_localtax1, 0, $langs, 0, -1, -1, $conf->currency); - if (! empty($this->total_localtax2)) + if (! empty($this->total_localtax1) && $this->total_localtax1 != 0) // We keep test != 0 because $this->total_localtax1 can be '0.00000000' + $label.= '
eee' . $langs->trans('LT1') . ': ' . price($this->total_localtax1, 0, $langs, 0, -1, -1, $conf->currency); + if (! empty($this->total_localtax2) && $this->total_localtax2 != 0) $label.= '
' . $langs->trans('LT2') . ': ' . price($this->total_localtax2, 0, $langs, 0, -1, -1, $conf->currency); if (! empty($this->total_ttc)) $label.= '
' . $langs->trans('AmountTTC') . ': ' . price($this->total_ttc, 0, $langs, 0, -1, -1, $conf->currency); @@ -4862,8 +4862,8 @@ class FactureLigne extends CommonInvoiceLine // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** - * Mise a jour en base des champs total_xxx de ligne de facture - * TODO What is goal of this method ? + * Update DB line fields total_xxx + * Used by migration * * @return int <0 if KO, >0 if OK */ diff --git a/htdocs/compta/facture/list.php b/htdocs/compta/facture/list.php index f9d8bd1b250..570f3504017 100644 --- a/htdocs/compta/facture/list.php +++ b/htdocs/compta/facture/list.php @@ -511,8 +511,9 @@ if (! $sall) $sql.= ' typent.code,'; $sql.= ' state.code_departement, state.nom,'; $sql.= ' country.code,'; - $sql.= " p.rowid, p.ref"; - + $sql.= " p.rowid, p.ref, p.title"; + if ($search_categ_cus) $sql .= ", cc.fk_categorie, cc.fk_soc"; + // Add fields from extrafields foreach ($extrafields->attribute_label as $key => $val) //prevent error with sql_mode=only_full_group_by { $sql.=($extrafields->attribute_type[$key] != 'separate' ? ",ef.".$key : ''); diff --git a/htdocs/contact/list.php b/htdocs/contact/list.php index 30b7c5158ba..848535ce424 100644 --- a/htdocs/contact/list.php +++ b/htdocs/contact/list.php @@ -154,7 +154,7 @@ $arrayfields=array( 'p.phone'=>array('label'=>"Phone", 'checked'=>1), 'p.phone_perso'=>array('label'=>"PhonePerso", 'checked'=>0), 'p.phone_mobile'=>array('label'=>"PhoneMobile", 'checked'=>1), - 'p.fax'=>array('label'=>"Fax", 'checked'=>1), + 'p.fax'=>array('label'=>"Fax", 'checked'=>0), 'p.email'=>array('label'=>"EMail", 'checked'=>1), 'p.skype'=>array('label'=>"Skype", 'checked'=>1, 'enabled'=>(! empty($conf->skype->enabled))), 'p.thirdparty'=>array('label'=>"ThirdParty", 'checked'=>1, 'enabled'=>empty($conf->global->SOCIETE_DISABLE_CONTACTS)), diff --git a/htdocs/core/class/conf.class.php b/htdocs/core/class/conf.class.php index 34b2fd97c55..db22d443c54 100644 --- a/htdocs/core/class/conf.class.php +++ b/htdocs/core/class/conf.class.php @@ -523,6 +523,9 @@ class Conf // By default, we open card if one found if (! isset($this->global->MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE)) $this->global->MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE=1; + // By default, we show state code in combo list + if (! isset($this->global->MAIN_SHOW_STATE_CODE)) $this->global->MAIN_SHOW_STATE_CODE=1; + // Define list of limited modules (value must be key found for "name" property of module, so for example 'supplierproposal' for Module "Supplier Proposal" if (! isset($this->global->MAIN_MODULES_FOR_EXTERNAL)) $this->global->MAIN_MODULES_FOR_EXTERNAL='user,societe,propal,commande,facture,categorie,supplierproposal,fournisseur,contact,projet,contrat,ficheinter,expedition,agenda,resource,adherent,blockedlog'; // '' means 'all'. Note that contact is added here as it should be a module later. if (! empty($this->modules_parts['moduleforexternal'])) // Module part to include an external module into the MAIN_MODULES_FOR_EXTERNAL list diff --git a/htdocs/core/class/dolgraph.class.php b/htdocs/core/class/dolgraph.class.php index 28ab38bf56d..618716ce0e4 100644 --- a/htdocs/core/class/dolgraph.class.php +++ b/htdocs/core/class/dolgraph.class.php @@ -992,7 +992,7 @@ class DolGraph var percent=Math.round(series.percent); var number=series.data[0][1]; return \''; - $this->stringtoshow.='
'; + $this->stringtoshow.=''; if ($urltemp) $this->stringtoshow.=''; $this->stringtoshow.='\'+'; $this->stringtoshow.=($showlegend?'':'label+\' \'+'); // Hide label if already shown in legend @@ -1000,7 +1000,7 @@ class DolGraph $this->stringtoshow.=($showpercent?'\'
\'+percent+\'%\'+':''); $this->stringtoshow.='\''; if ($urltemp) $this->stringtoshow.='
'; - $this->stringtoshow.='
\'; + $this->stringtoshow.='\'; }, background: { opacity: 0.0, diff --git a/htdocs/core/class/html.formcompany.class.php b/htdocs/core/class/html.formcompany.class.php index 8d64a01eb65..78b06048ee4 100644 --- a/htdocs/core/class/html.formcompany.class.php +++ b/htdocs/core/class/html.formcompany.class.php @@ -276,7 +276,7 @@ class FormCompany } // Si traduction existe, on l'utilise, sinon on prend le libelle par defaut - if(!empty($conf->global->MAIN_SHOW_STATE_CODE) && + if (!empty($conf->global->MAIN_SHOW_STATE_CODE) && ($conf->global->MAIN_SHOW_STATE_CODE == 1 || $conf->global->MAIN_SHOW_STATE_CODE == 2 || $conf->global->MAIN_SHOW_STATE_CODE === 'all')) { if(!empty($conf->global->MAIN_SHOW_REGION_IN_STATE_SELECT) && $conf->global->MAIN_SHOW_REGION_IN_STATE_SELECT == 1) { $out.= $obj->region_name . ' - ' . $obj->code . ' - ' . ($langs->trans($obj->code)!=$obj->code?$langs->trans($obj->code):($obj->name!='-'?$obj->name:'')); diff --git a/htdocs/cron/list.php b/htdocs/cron/list.php index cc3b8e879ed..eb326673d25 100644 --- a/htdocs/cron/list.php +++ b/htdocs/cron/list.php @@ -355,7 +355,7 @@ else print_barre_liste($pagetitle, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'title_setup', 0, $newcardbutton, '', $limit); -print $langs->trans('CronInfo').'
'; +print ''.$langs->trans('CronInfo').'
'; $text =$langs->trans("HoursOnThisPageAreOnServerTZ").' '.$stringcurrentdate.'
'; if (! empty($conf->global->CRON_WARNING_DELAY_HOURS)) $text.=$langs->trans("WarningCronDelayed", $conf->global->CRON_WARNING_DELAY_HOURS); diff --git a/htdocs/expensereport/class/expensereport.class.php b/htdocs/expensereport/class/expensereport.class.php index 9f5fdc485e3..53ac035c0be 100644 --- a/htdocs/expensereport/class/expensereport.class.php +++ b/htdocs/expensereport/class/expensereport.class.php @@ -147,7 +147,7 @@ class ExpenseReport extends CommonObject // List of language codes for status $this->statuts_short = array(0 => 'Draft', 2 => 'Validated', 4 => 'Canceled', 5 => 'Approved', 6 => 'Paid', 99 => 'Refused'); $this->statuts = array(0 => 'Draft', 2 => 'ValidatedWaitingApproval', 4 => 'Canceled', 5 => 'Approved', 6 => 'Paid', 99 => 'Refused'); - $this->statuts_logo = array(0 => 'statut0', 2 => 'statut1', 4 => 'statut5', 5 => 'statut3', 6 => 'statut6', 99 => 'statut8'); + $this->statuts_logo = array(0 => 'statut0', 2 => 'statut1', 4 => 'statut5', 5 => 'statut3', 6 => 'statut6', 99 => 'statut5'); return 1; } diff --git a/htdocs/holiday/month_report.php b/htdocs/holiday/month_report.php index 5bb3bcaeca8..e9b98deb1f9 100644 --- a/htdocs/holiday/month_report.php +++ b/htdocs/holiday/month_report.php @@ -81,7 +81,7 @@ print ''; $sql = "SELECT cp.rowid, cp.fk_user, cp.date_debut, cp.date_fin, ct.label, cp.description, cp.halfday"; $sql .= " FROM ".MAIN_DB_PREFIX."holiday cp"; -$sql .= " LEFT JOIN llx_user u ON cp.fk_user = u.rowid"; +$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."user u ON cp.fk_user = u.rowid"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_holiday_types ct ON cp.fk_type = ct.rowid"; $sql .= " WHERE cp.rowid > 0"; $sql .= " AND cp.statut = 3"; // Approved diff --git a/htdocs/hrm/index.php b/htdocs/hrm/index.php index 26ed9f82682..6d1e16433cf 100644 --- a/htdocs/hrm/index.php +++ b/htdocs/hrm/index.php @@ -221,7 +221,7 @@ if (! empty($conf->holiday->enabled) && $user->rights->holiday->read) $userstatic->statut=$obj->statut; print ''; - print ''.$holidaystatic->getNomUrl(1).''; + print ''.$holidaystatic->getNomUrl(1).''; print ''.$userstatic->getNomUrl(-1, 'leave').''; print ''.$typeleaves[$obj->fk_type]['label'].''; @@ -300,7 +300,7 @@ if (! empty($conf->deplacement->enabled) && $user->rights->deplacement->lire) $userstatic->photo=$obj->photo; print ''; - print ''.$deplacementstatic->getNomUrl(1).''; + print ''.$deplacementstatic->getNomUrl(1).''; print ''.$userstatic->getNomUrl(-1).''; print ''.$obj->km.''; print ''.dol_print_date($db->jdate($obj->dm),'day').''; @@ -373,7 +373,7 @@ if (! empty($conf->expensereport->enabled) && $user->rights->expensereport->lire $userstatic->photo=$obj->photo; print ''; - print ''.$expensereportstatic->getNomUrl(1).''; + print ''.$expensereportstatic->getNomUrl(1).''; print ''.$userstatic->getNomUrl(-1).''; print ''.price($obj->total_ttc).''; print ''.dol_print_date($db->jdate($obj->dm),'day').''; diff --git a/htdocs/imports/import.php b/htdocs/imports/import.php index 6660156e59e..a9c1fc2317a 100644 --- a/htdocs/imports/import.php +++ b/htdocs/imports/import.php @@ -548,8 +548,8 @@ if ($step == 3 && $datatoimport) print ''; print ''; print ''; - print ''; - print ''; + print ''; + print ''; print ''; print ''.$langs->trans("ChooseFileToImport",img_picto('','filenew')).'

'; @@ -648,7 +648,8 @@ if ($step == 4 && $datatoimport) $classname = "Import".ucfirst($model); require_once $dir.$file; $obj = new $classname($db,$datatoimport); - if ($model == 'csv') { + if ($model == 'csv') + { $obj->separator = $separator; $obj->enclosure = $enclosure; } @@ -796,9 +797,9 @@ if ($step == 4 && $datatoimport) print ''; print ''; print $langs->trans("Separator").' : '; - print ''; + print ''; print '    '.$langs->trans("Enclosure").' : '; - print ''; + print ''; print ''; print ''; print ''; @@ -833,8 +834,8 @@ if ($step == 4 && $datatoimport) print ''; print ''; print ''; - print ''; - print ''; + print ''; + print ''; print '
'; print $langs->trans("SelectImportFields",img_picto('','grip_title','')).' '; $htmlother->select_import_model($importmodelid,'importmodelid',$datatoimport,1); @@ -1116,8 +1117,8 @@ if ($step == 4 && $datatoimport) print ''; print ''; print ''; - print ''; - print ''; + print ''; + print ''; print ''; print ''; @@ -1262,10 +1263,8 @@ if ($step == 5 && $datatoimport) if ($model == 'csv') { print ''; print ''; } diff --git a/htdocs/install/mysql/migration/7.0.0-8.0.0.sql b/htdocs/install/mysql/migration/7.0.0-8.0.0.sql index f5520b6f232..18b6440f45b 100644 --- a/htdocs/install/mysql/migration/7.0.0-8.0.0.sql +++ b/htdocs/install/mysql/migration/7.0.0-8.0.0.sql @@ -60,7 +60,7 @@ DROP TABLE llx_c_accountancy_category; DROP TABLE llx_c_accountingaccount; -- drop old postgresql unique key --- VPGSQL8.2 DROP INDEX llx_usergroup_rights_fk_usergroup_fk_id_key +-- VPGSQL8.2 DROP INDEX llx_usergroup_rights_fk_usergroup_fk_id_key; update llx_propal set fk_statut = 1 where fk_statut = -1; diff --git a/htdocs/install/mysql/tables/llx_commande.key.sql b/htdocs/install/mysql/tables/llx_commande.key.sql index 9652079846e..9134092195b 100644 --- a/htdocs/install/mysql/tables/llx_commande.key.sql +++ b/htdocs/install/mysql/tables/llx_commande.key.sql @@ -18,7 +18,7 @@ -- ============================================================================ --- Supprimme orphelins pour permettre montee de la cle +-- Delete orphans -- V4 DELETE llx_commande FROM llx_commande LEFT JOIN llx_societe ON llx_commande.fk_soc = llx_societe.rowid WHERE llx_societe.rowid IS NULL; ALTER TABLE llx_commande ADD UNIQUE INDEX uk_commande_ref (ref, entity); diff --git a/htdocs/langs/en_US/errors.lang b/htdocs/langs/en_US/errors.lang index cf88cf65cc9..96fbf755f9a 100644 --- a/htdocs/langs/en_US/errors.lang +++ b/htdocs/langs/en_US/errors.lang @@ -116,6 +116,7 @@ ErrorLoginDoesNotExists=User with login %s could not be found. ErrorLoginHasNoEmail=This user has no email address. Process aborted. ErrorBadValueForCode=Bad value for security code. Try again with new value... ErrorBothFieldCantBeNegative=Fields %s and %s can't be both negative +ErrorFieldCantBeNegativeOnInvoice=Field %s can't be negative on such type of invoice. If you want to add a discount line, just create the discount first with link %s on screen and apply it to invoice. You can also ask your admin to set option FACTURE_ENABLE_NEGATIVE_LINES to 1 to restore old behaviour. ErrorQtyForCustomerInvoiceCantBeNegative=Quantity for line into customer invoices can't be negative ErrorWebServerUserHasNotPermission=User account %s used to execute web server has no permission for that ErrorNoActivatedBarcode=No barcode type activated diff --git a/htdocs/projet/element.php b/htdocs/projet/element.php index 23ecadd9939..7210044ae35 100644 --- a/htdocs/projet/element.php +++ b/htdocs/projet/element.php @@ -292,7 +292,7 @@ $listofreferent=array( 'class'=>'SupplierProposal', 'table'=>'supplier_proposal', 'datefieldname'=>'date', - 'urlnew'=>DOL_URL_ROOT.'/supplier_proposal/card.php?action=create&projectid='.$id.'&socid='.$socid, + 'urlnew'=>DOL_URL_ROOT.'/supplier_proposal/card.php?action=create&projectid='.$id, // No socid parameter here, the socid is often the customer and we create a supplier object 'lang'=>'supplier_proposal', 'buttonnew'=>'AddSupplierProposal', 'testnew'=>$user->rights->supplier_proposal->creer, @@ -565,8 +565,6 @@ print ''; print ''; print ''; -$var = false; - foreach ($listofreferent as $key => $value) { $name=$langs->trans($value['name']); @@ -760,9 +758,9 @@ foreach ($listofreferent as $key => $value) if (empty($conf->global->PROJECT_CREATE_ON_OVERVIEW_DISABLED) && $urlnew) { $addform.='
'; - if ($testnew) $addform.=''.($buttonnew?$langs->trans($buttonnew):$langs->trans("Create")).''; + if ($testnew) $addform.=''.($buttonnew?$langs->trans($buttonnew):$langs->trans("Create")).' '; elseif (empty($conf->global->MAIN_BUTTON_HIDE_UNAUTHORIZED)) { - $addform.=''.($buttonnew?$langs->trans($buttonnew):$langs->trans("Create")).''; + $addform.=''.($buttonnew?$langs->trans($buttonnew):$langs->trans("Create")).' '; } $addform.='
'; } diff --git a/htdocs/public/payment/paymentok.php b/htdocs/public/payment/paymentok.php index 47e22e12c8b..a5b6b38ea35 100644 --- a/htdocs/public/payment/paymentok.php +++ b/htdocs/public/payment/paymentok.php @@ -534,7 +534,7 @@ if ($ispaymentok) $listofmimes=array(dol_mimetype($file)); } - $result=$object->send_an_email($texttosend, $subjecttosend, $listofpaths, $listofnames, $listofmimes, "", "", 0, -1); + $result=$object->send_an_email($texttosend, $subjecttosend, $listofpaths, $listofmimes, $listofnames, "", "", 0, -1); if ($result < 0) { @@ -546,6 +546,8 @@ if ($ispaymentok) { if ($file) $postactionmessages[] = 'Email sent to member (with invoice document attached)'; else $postactionmessages[] = 'Email sent to member (without any attached document)'; + + // TODO Add actioncomm event } } } diff --git a/htdocs/societe/list.php b/htdocs/societe/list.php index 7b2272c407b..5441625c9fb 100644 --- a/htdocs/societe/list.php +++ b/htdocs/societe/list.php @@ -711,48 +711,48 @@ if (! empty($arrayfields['s.nom']['checked'])) { print '
'; } if (! empty($arrayfields['s.name_alias']['checked'])) { print ''; } // Barcode if (! empty($arrayfields['s.barcode']['checked'])) { print ''; } // Customer code if (! empty($arrayfields['s.code_client']['checked'])) { print ''; } // Supplier code if (! empty($arrayfields['s.code_fournisseur']['checked'])) { print ''; } // Account Customer code if (! empty($arrayfields['s.code_compta']['checked'])) { print ''; } // Account Supplier code if (! empty($arrayfields['s.code_compta_fournisseur']['checked'])) { print ''; } // Town @@ -766,21 +766,21 @@ if (! empty($arrayfields['s.town']['checked'])) if (! empty($arrayfields['s.zip']['checked'])) { print ''; } // State if (! empty($arrayfields['state.nom']['checked'])) { print ''; } // Region if (! empty($arrayfields['region.nom']['checked'])) { print ''; } // Country @@ -801,14 +801,14 @@ if (! empty($arrayfields['s.email']['checked'])) { // Email print ''; } if (! empty($arrayfields['s.phone']['checked'])) { // Phone print ''; } if (! empty($arrayfields['s.fax']['checked'])) @@ -822,14 +822,14 @@ if (! empty($arrayfields['s.url']['checked'])) { // Url print ''; } if (! empty($arrayfields['s.siren']['checked'])) { // IdProf1 print ''; } if (! empty($arrayfields['s.siret']['checked'])) @@ -850,28 +850,28 @@ if (! empty($arrayfields['s.idprof4']['checked'])) { // IdProf4 print ''; } if (! empty($arrayfields['s.idprof5']['checked'])) { // IdProf5 print ''; } if (! empty($arrayfields['s.idprof6']['checked'])) { // IdProf6 print ''; } if (! empty($arrayfields['s.tva_intra']['checked'])) { // Vat number print ''; } @@ -958,7 +958,7 @@ if (! empty($arrayfields['s.status']['checked'])) if (! empty($arrayfields['s.import_key']['checked'])) { print ''; } // Action column
'.$langs->trans("CsvOptions").''; - print $langs->trans("Separator").' : '; - print htmlentities($separator); - print '    '.$langs->trans("Enclosure").' : '; - print htmlentities($enclosure); + print $langs->trans("Separator").' : '.dol_escape_htmltag($separator); + print '    '.$langs->trans("Enclosure").' : '.dol_escape_htmltag($enclosure); print '
'.$langs->trans("AmountHT").''.$langs->trans("AmountTTC").'
'; if (! empty($search_nom_only) && empty($search_nom)) $search_nom=$search_nom_only; - print ''; + print ''; print ''; - print ''; + print ''; print ''; - print ''; + print ''; print ''; - print ''; + print ''; print ''; - print ''; + print ''; print ''; - print ''; + print ''; print ''; - print ''; + print ''; print ''; - print ''; + print ''; print ''; - print ''; + print ''; print ''; - print ''; + print ''; print ''; - print ''; + print ''; print ''; - print ''; + print ''; print ''; - print ''; + print ''; print ''; - print ''; + print ''; print ''; - print ''; + print ''; print ''; - print ''; + print ''; print ''; - print ''; + print ''; print ''; - print ''; + print ''; print ''; - print ''; + print ''; print '