diff --git a/.travis.yml b/.travis.yml index f7b3df2cb76..1cd0a40bf82 100644 --- a/.travis.yml +++ b/.travis.yml @@ -291,7 +291,7 @@ script: # Ensure we catch errors set -e #parallel-lint --exclude htdocs/includes --blame . - parallel-lint --exclude dev/namespacemig --exclude htdocs/includes/sabre --exclude htdocs/includes/phpoffice/phpexcel/Classes/PHPExcel/Shared --exclude htdocs/includes/phpoffice/PhpSpreadsheet --exclude htdocs/includes/sebastian --exclude htdocs/includes/squizlabs/php_codesniffer/tests --exclude htdocs/includes/jakub-onderka/php-parallel-lint/tests --exclude htdocs/includes/mike42/escpos-php/example --exclude htdocs/includes/phpunit/php-token-stream/tests --exclude htdocs/includes/composer/autoload_static.php --blame . + parallel-lint --exclude dev/namespacemig --exclude htdocs/includes/myclabs --exclude htdocs/includes/webmozart --exclude htdocs/includes/phpspec --exclude htdocs/includes/sabre --exclude htdocs/includes/phpoffice/phpexcel/Classes/PHPExcel/Shared --exclude htdocs/includes/phpoffice/PhpSpreadsheet --exclude htdocs/includes/sebastian --exclude htdocs/includes/squizlabs/php_codesniffer/tests --exclude htdocs/includes/jakub-onderka/php-parallel-lint/tests --exclude htdocs/includes/mike42/escpos-php/example --exclude htdocs/includes/phpunit/php-token-stream/tests --exclude htdocs/includes/composer/autoload_static.php --blame . set +e echo diff --git a/htdocs/accountancy/bookkeeping/thirdparty_lettering_customer.php b/htdocs/accountancy/bookkeeping/thirdparty_lettering_customer.php index 9cb863aec7d..33563b7b57a 100644 --- a/htdocs/accountancy/bookkeeping/thirdparty_lettering_customer.php +++ b/htdocs/accountancy/bookkeeping/thirdparty_lettering_customer.php @@ -197,7 +197,7 @@ if ($resql) { $param="&socid=".$socid; print '
'; - print ''; + print ''; print ''; $letteringbutton = ''; diff --git a/htdocs/accountancy/bookkeeping/thirdparty_lettering_supplier.php b/htdocs/accountancy/bookkeeping/thirdparty_lettering_supplier.php index 61e5e34da99..54aec9490b4 100644 --- a/htdocs/accountancy/bookkeeping/thirdparty_lettering_supplier.php +++ b/htdocs/accountancy/bookkeeping/thirdparty_lettering_supplier.php @@ -195,7 +195,7 @@ if ($resql) { $param="&socid=".$socid; print ''; - print ''; + print ''; print ''; $letteringbutton = ''; diff --git a/htdocs/accountancy/customer/lines.php b/htdocs/accountancy/customer/lines.php index d52c4c51f07..c35468ea85a 100644 --- a/htdocs/accountancy/customer/lines.php +++ b/htdocs/accountancy/customer/lines.php @@ -332,7 +332,7 @@ if ($result) { print_liste_field_titre("VATRate", $_SERVER["PHP_SELF"], "fd.tva_tx", "", $param, '', $sortfield, $sortorder, 'right '); print_liste_field_titre("Country", $_SERVER["PHP_SELF"], "co.label", "", $param, '', $sortfield, $sortorder); print_liste_field_titre("VATIntra", $_SERVER["PHP_SELF"], "s.tva_intra", "", $param, '', $sortfield, $sortorder); - print_liste_field_titre("Account", $_SERVER["PHP_SELF"], "aa.account_number", "", $param, '', $sortfield, $sortorder, 'center '); + print_liste_field_titre("Account", $_SERVER["PHP_SELF"], "aa.account_number", "", $param, '', $sortfield, $sortorder); $clickpicto = $form->showCheckAddButtons(); print_liste_field_titre($clickpicto, '', '', '', '', '', '', '', 'center '); print "\n"; @@ -341,7 +341,7 @@ if ($result) { $product_static = new Product($db); while ($objp = $db->fetch_object($result)) { - $codecompta = length_accountg($objp->account_number).' - '.$objp->label_compte; + $codecompta = length_accountg($objp->account_number).' - '.$objp->label_compte.''; $facture_static->ref = $objp->ref; $facture_static->id = $objp->facid; @@ -390,7 +390,7 @@ if ($result) { print ''.$objp->tva_intra.''; - print ''; + print ''; print $codecompta.' '; print img_edit(); print ''; diff --git a/htdocs/accountancy/expensereport/lines.php b/htdocs/accountancy/expensereport/lines.php index cc606555b37..4d96027f79a 100644 --- a/htdocs/accountancy/expensereport/lines.php +++ b/htdocs/accountancy/expensereport/lines.php @@ -287,7 +287,7 @@ if ($result) { while ($i < min($num_lines, $limit)) { $objp = $db->fetch_object($result); - $codeCompta = length_accountg($objp->account_number).' - '.$objp->label; + $codeCompta = length_accountg($objp->account_number).' - '.$objp->label.''; $expensereport_static->ref = $objp->ref; $expensereport_static->id = $objp->erid; @@ -315,7 +315,7 @@ if ($result) { print ''.$codeCompta.''; - print ''; + print ''; print img_edit(); print ''; diff --git a/htdocs/accountancy/supplier/lines.php b/htdocs/accountancy/supplier/lines.php index a035aed2b1f..5b74311c310 100644 --- a/htdocs/accountancy/supplier/lines.php +++ b/htdocs/accountancy/supplier/lines.php @@ -336,7 +336,7 @@ if ($result) { print_liste_field_titre("VATRate", $_SERVER["PHP_SELF"], "l.tva_tx", "", $param, '', $sortfield, $sortorder, 'right '); print_liste_field_titre("Country", $_SERVER["PHP_SELF"], "co.label", "", $param, '', $sortfield, $sortorder); print_liste_field_titre("VATIntra", $_SERVER["PHP_SELF"], "s.tva_intra", "", $param, '', $sortfield, $sortorder); - print_liste_field_titre("Account", $_SERVER["PHP_SELF"], "aa.account_number", "", $param, '', $sortfield, $sortorder, 'center '); + print_liste_field_titre("Account", $_SERVER["PHP_SELF"], "aa.account_number", "", $param, '', $sortfield, $sortorder); $checkpicto = $form->showCheckAddButtons(); print_liste_field_titre($checkpicto, '', '', '', '', '', '', '', 'center '); print "\n"; @@ -347,7 +347,7 @@ if ($result) { while ($i < min($num_lines, $limit)) { $objp = $db->fetch_object($result); - $codecompta = length_accountg($objp->account_number).' - '.$objp->label; + $codecompta = length_accountg($objp->account_number).' - '.$objp->label.''; $facturefournisseur_static->ref = $objp->ref; $facturefournisseur_static->id = $objp->facid; @@ -399,7 +399,7 @@ if ($result) { print ''.$objp->tva_intra.''; - print ''; + print ''; print $codecompta.' '; print img_edit(); print ''; diff --git a/htdocs/adherents/cartes/carte.php b/htdocs/adherents/cartes/carte.php index e7686a0a055..6736a22cd5d 100644 --- a/htdocs/adherents/cartes/carte.php +++ b/htdocs/adherents/cartes/carte.php @@ -259,7 +259,7 @@ print '
'; print img_picto('', 'puce').' '.$langs->trans("DocForAllMembersCards", ($conf->global->ADHERENT_CARD_TYPE?$conf->global->ADHERENT_CARD_TYPE:$langs->transnoentitiesnoconv("None"))).' '; print ''; -print ''; +print ''; print ''; print ''; print ''; @@ -279,7 +279,7 @@ print '

'; print img_picto('', 'puce').' '.$langs->trans("DocForOneMemberCards", ($conf->global->ADHERENT_CARD_TYPE?$conf->global->ADHERENT_CARD_TYPE:$langs->transnoentitiesnoconv("None"))).' '; print ''; -print ''; +print ''; print ''; print ''; print $langs->trans("DescADHERENT_CARD_TYPE").' '; @@ -299,7 +299,7 @@ print '

'; print img_picto('', 'puce').' '.$langs->trans("DocForLabels", $conf->global->ADHERENT_ETIQUETTE_TYPE).' '; print ''; -print ''; +print ''; print ''; print ''; print $langs->trans("DescADHERENT_ETIQUETTE_TYPE").' '; diff --git a/htdocs/adherents/type.php b/htdocs/adherents/type.php index 11360ad4652..4590254ebf6 100644 --- a/htdocs/adherents/type.php +++ b/htdocs/adherents/type.php @@ -605,7 +605,7 @@ if ($rowid > 0) } print ''; - print ''; + print ''; print ''; print '
'; diff --git a/htdocs/admin/agenda_other.php b/htdocs/admin/agenda_other.php index 0ea6a932fe7..0a86aa9b5e6 100644 --- a/htdocs/admin/agenda_other.php +++ b/htdocs/admin/agenda_other.php @@ -324,7 +324,7 @@ if ($conf->global->MAIN_FEATURES_LEVEL >= 2) } print ''; -print ''; +print ''; print ''; print ''."\n"; diff --git a/htdocs/admin/agenda_reminder.php b/htdocs/admin/agenda_reminder.php index 614d4ef4407..b641dd74fe2 100644 --- a/htdocs/admin/agenda_reminder.php +++ b/htdocs/admin/agenda_reminder.php @@ -180,7 +180,7 @@ $head=agenda_prepare_head(); dol_fiche_head($head, 'reminders', $langs->trans("Agenda"), -1, 'action'); print ''; -print ''; +print ''; print ''; print '
'."\n"; diff --git a/htdocs/admin/clicktodial.php b/htdocs/admin/clicktodial.php index 03c4eeb66cf..3fb3340a702 100644 --- a/htdocs/admin/clicktodial.php +++ b/htdocs/admin/clicktodial.php @@ -119,7 +119,7 @@ if (! empty($conf->global->CLICKTODIAL_URL)) if (GETPOST('phonefortest')) $phonefortest=GETPOST('phonefortest'); print ''; - print ''; + print ''; print $langs->trans("LinkToTestClickToDial", $user->login).' : '; print ''; print ''; diff --git a/htdocs/admin/fckeditor.php b/htdocs/admin/fckeditor.php index efe8ca1117d..3bbd23fa7d6 100644 --- a/htdocs/admin/fckeditor.php +++ b/htdocs/admin/fckeditor.php @@ -185,7 +185,7 @@ else print '
'."\n"; print ''."\n"; - print ''; + print ''; // Skins show_skin(null, 1); diff --git a/htdocs/bom/bom_card.php b/htdocs/bom/bom_card.php index 3f1be6c7e4c..3320c160fc2 100644 --- a/htdocs/bom/bom_card.php +++ b/htdocs/bom/bom_card.php @@ -546,7 +546,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea $result = $object->getLinesArray(); print ' - + diff --git a/htdocs/bom/bom_list.php b/htdocs/bom/bom_list.php index 12602f9744a..446d629f090 100644 --- a/htdocs/bom/bom_list.php +++ b/htdocs/bom/bom_list.php @@ -482,7 +482,7 @@ $selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfi $selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : ''); print '
'; // You can use div-table-responsive-no-min if you dont need reserved height for your table -print '
'."\n"; +print '
'."\n"; // Fields title search @@ -502,7 +502,7 @@ foreach ($object->fields as $key => $val) elseif (strpos($val['type'], 'integer:') === 0) { print $object->showInputField($val, $key, $search[$key], '', '', 'search_', 'maxwidth150', 1); } - elseif (! preg_match('/^(date|timestamp)/', $val['type'])) print ''; + elseif (!preg_match('/^(date|timestamp)/', $val['type'])) print ''; print ''; } } @@ -582,6 +582,7 @@ while ($i < ($limit ? min($num, $limit) : $num)) elseif ($key == 'ref') $cssforfield .= ($cssforfield ? ' ' : '').'nowrap'; if (in_array($val['type'], array('double(24,8)', 'double(6,3)', 'integer', 'real', 'price')) && $key != 'status') $cssforfield .= ($cssforfield ? ' ' : '').'right'; + if (in_array($key, array('fk_soc', 'fk_user', 'fk_warehouse'))) $cssforfield = 'tdoverflowmax100'; if (!empty($arrayfields['t.'.$key]['checked'])) { diff --git a/htdocs/comm/action/pertype.php b/htdocs/comm/action/pertype.php index 04f334a9551..5591741997e 100644 --- a/htdocs/comm/action/pertype.php +++ b/htdocs/comm/action/pertype.php @@ -248,7 +248,7 @@ $nav .= "   ('; -$nav .= ''; +$nav .= ''; $nav .= ''; $nav .= ''; $nav .= ''; diff --git a/htdocs/comm/action/peruser.php b/htdocs/comm/action/peruser.php index f906c4cab45..711e18ef8b6 100644 --- a/htdocs/comm/action/peruser.php +++ b/htdocs/comm/action/peruser.php @@ -289,7 +289,7 @@ $nav .= "   ".$langs->trans("Today").")"; /*$nav.='   '; -$nav.=''; +$nav.=''; $nav.=''; $nav.=''; $nav.=''; diff --git a/htdocs/comm/propal/card.php b/htdocs/comm/propal/card.php index f55861b00cc..1f5927f260a 100644 --- a/htdocs/comm/propal/card.php +++ b/htdocs/comm/propal/card.php @@ -1541,7 +1541,7 @@ if ($action == 'create') $object = new Propal($db); print ''; - print ''; + print ''; print ''; if ($origin != 'project' && $originid) { print ''; @@ -1675,7 +1675,7 @@ if ($action == 'create') $langs->load("projects"); print ''; print ''; print ''; @@ -2052,7 +2052,7 @@ if ($action == 'create') print ''; print ''; print ''; @@ -2100,7 +2100,7 @@ if ($action == 'create' && $usercancreate) $morehtmlref .= ''; $morehtmlref .= ''; $morehtmlref .= ''; - $morehtmlref .= $formproject->select_projects($object->socid, $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1); + $morehtmlref .= $formproject->select_projects($object->socid, $object->fk_project, 'projectid', 0, 0, 1, 0, 1, 0, 0, '', 1, 0, 'maxwidth500'); $morehtmlref .= ''; $morehtmlref .= ''; } else { @@ -2177,7 +2177,7 @@ if ($action == 'create' && $usercancreate) print ''; diff --git a/htdocs/core/class/extrafields.class.php b/htdocs/core/class/extrafields.class.php index 57debc1311b..cf439f210be 100644 --- a/htdocs/core/class/extrafields.class.php +++ b/htdocs/core/class/extrafields.class.php @@ -1577,9 +1577,9 @@ class ExtraFields if ($type == 'date') $out.=' (YYYY-MM-DD)'; elseif ($type == 'datetime') $out.=' (YYYY-MM-DD HH:MM:SS)'; */ - if (! empty($help) && $keyprefix != 'search_options_') { + /*if (! empty($help) && $keyprefix != 'search_options_') { $out .= $form->textwithpicto('', $help, 1, 'help', '', 0, 3); - } + }*/ return $out; } diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 796011085dd..4be8c74ffac 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -646,12 +646,14 @@ class Form /* console.log( index + ": " + $( this ).text() ); */ if ($(this).is(\':checked\')) atleastoneselected++; }); + console.log("initCheckForSelect mode="+mode+" atleastoneselected="+atleastoneselected); + if (atleastoneselected || '.$alwaysvisible.') { jQuery(".massaction").show(); - '.($selected ? 'if (atleastoneselected) { jQuery(".massactionselect").val("'.$selected.'"); jQuery(".massactionconfirmed").prop(\'disabled\', false); }' : '').' - '.($selected ? 'if (! atleastoneselected) { jQuery(".massactionselect").val("0"); jQuery(".massactionconfirmed").prop(\'disabled\', true); } ' : '').' + '.($selected ? 'if (atleastoneselected) { jQuery(".massactionselect").val("'.$selected.'").trigger(\'change\'); jQuery(".massactionconfirmed").prop(\'disabled\', false); }' : '').' + '.($selected ? 'if (! atleastoneselected) { jQuery(".massactionselect").val("0").trigger(\'change\'); jQuery(".massactionconfirmed").prop(\'disabled\', true); } ' : '').' } else { @@ -3509,11 +3511,11 @@ class Form /** * Return list of payment methods * - * @param string $selected Id du mode de paiement pre-selectionne - * @param string $htmlname Nom de la zone select + * @param string $selected Id or code or preselected payment mode + * @param string $htmlname Name of select field * @param string $filtertype To filter on field type in llx_c_paiement ('CRDT' or 'DBIT' or array('code'=>xx,'label'=>zz)) - * @param int $format 0=id+libelle, 1=code+code, 2=code+libelle, 3=id+code - * @param int $empty 1=peut etre vide, 0 sinon + * @param int $format 0=id+label, 1=code+code, 2=code+label, 3=id+code + * @param int $empty 1=can be empty, 0 otherwise * @param int $noadmininfo 0=Add admin info, 1=Disable admin info * @param int $maxlength Max length of label * @param int $active Active or not, -1 = all @@ -3551,9 +3553,12 @@ class Form elseif ($format == 1) print '
'.$langs->trans("Project").''; - $numprojet = $formproject->select_projects(($soc->id > 0 ? $soc->id : -1), $projectid, 'projectid', 0, 0, 1, 1); + $numprojet = $formproject->select_projects(($soc->id > 0 ? $soc->id : -1), $projectid, 'projectid', 0, 0, 1, 1, 0, 0, 0, '', 0, 0, 'maxwidth500'); print ' id).'">'; print '
'; if ($object->statut == Propal::STATUS_DRAFT && $action == 'editdate' && $usercancreate) { print ''; - print ''; + print ''; print ''; print $form->selectDate($object->date, 're', '', '', 0, "editdate"); print ''; @@ -2078,7 +2078,7 @@ if ($action == 'create') print ''; if ($object->statut == Propal::STATUS_DRAFT && $action == 'editecheance' && $usercancreate) { print ''; - print ''; + print ''; print ''; print $form->selectDate($object->fin_validite, 'ech', '', '', '', "editecheance"); print ''; @@ -2412,7 +2412,7 @@ if ($action == 'create') $result = $object->getLinesArray(); print ' - + diff --git a/htdocs/comm/remx.php b/htdocs/comm/remx.php index 651fa556e8a..c7016f2dbab 100644 --- a/htdocs/comm/remx.php +++ b/htdocs/comm/remx.php @@ -129,6 +129,13 @@ if ($action == 'confirm_split' && GETPOST("confirm") == 'yes') $newdiscount1->amount_tva = price2num($newdiscount1->amount_ttc - $newdiscount1->amount_ht); $newdiscount2->amount_tva = price2num($newdiscount2->amount_ttc - $newdiscount2->amount_ht); + $newdiscount1->multicurrency_amount_ttc = $amount_ttc_1 * ($discount->multicurrency_amount_ttc / $discount->amount_ttc); + $newdiscount2->multicurrency_amount_ttc = price2num($discount->multicurrency_amount_ttc - $newdiscount1->multicurrency_amount_ttc); + $newdiscount1->multicurrency_amount_ht = price2num($newdiscount1->multicurrency_amount_ttc / (1 + $newdiscount1->tva_tx / 100), 'MT'); + $newdiscount2->multicurrency_amount_ht = price2num($newdiscount2->multicurrency_amount_ttc / (1 + $newdiscount2->tva_tx / 100), 'MT'); + $newdiscount1->multicurrency_amount_tva = price2num($newdiscount1->multicurrency_amount_ttc - $newdiscount1->multicurrency_amount_ht); + $newdiscount2->multicurrency_amount_tva = price2num($newdiscount2->multicurrency_amount_ttc - $newdiscount2->multicurrency_amount_ht); + $db->begin(); $discount->fk_facture_source = 0; // This is to delete only the require record (that we will recreate with two records) and not all family with same fk_facture_source // This is to delete only the require record (that we will recreate with two records) and not all family with same fk_invoice_supplier_source diff --git a/htdocs/commande/card.php b/htdocs/commande/card.php index 3c1bf672c0f..9b389bccb5b 100644 --- a/htdocs/commande/card.php +++ b/htdocs/commande/card.php @@ -1594,8 +1594,8 @@ if ($action == 'create' && $usercancreate) $note_public = $object->getDefaultCreateValueFor('note_public'); } - print ''; - print ''; + print ''; + print ''; print ''; print '' . "\n"; print ''; @@ -1734,7 +1734,7 @@ if ($action == 'create' && $usercancreate) $langs->load("projects"); print '
'.$langs->trans("Project").''; - $numprojet = $formproject->select_projects(($soc->id > 0 ? $soc->id : -1), $projectid, 'projectid', 0, 0, 1, 0, 0, 0, 0, '', 0, 0); + $numprojet = $formproject->select_projects(($soc->id > 0 ? $soc->id : -1), $projectid, 'projectid', 0, 0, 1, 0, 0, 0, 0, '', 0, 0, 'maxwidth500'); print ' id).'">'; print '
'; if ($action == 'editdate') { print '
'; - print ''; + print ''; print ''; print $form->selectDate($object->date, 'order_', '', '', '', "setdate"); print ''; @@ -2198,7 +2198,7 @@ if ($action == 'create' && $usercancreate) print '
'; if ($action == 'editdate_livraison') { print ''; - print ''; + print ''; print ''; print $form->selectDate($object->date_livraison ? $object->date_livraison : - 1, 'liv_', '', '', '', "setdate_livraison"); print ''; @@ -2492,7 +2492,7 @@ if ($action == 'create' && $usercancreate) $result = $object->getLinesArray(); print ' - + '; diff --git a/htdocs/compta/cashcontrol/cashcontrol_card.php b/htdocs/compta/cashcontrol/cashcontrol_card.php index 8e83e6a33a4..41ba0dbd0fe 100644 --- a/htdocs/compta/cashcontrol/cashcontrol_card.php +++ b/htdocs/compta/cashcontrol/cashcontrol_card.php @@ -318,7 +318,7 @@ if ($action == "create" || $action == "start") print load_fiche_titre($langs->trans("CashControl")." - ".$langs->trans("New"), '', 'cash-register'); print ''; - print ''; + print ''; if ($action == 'start' && GETPOST('posnumber', 'int') != '' && GETPOST('posnumber', 'int') != '' && GETPOST('posnumber', 'int') != '-1') { print ''; diff --git a/htdocs/compta/facture/card-rec.php b/htdocs/compta/facture/card-rec.php index 7d1f529bf82..06717574b07 100644 --- a/htdocs/compta/facture/card-rec.php +++ b/htdocs/compta/facture/card-rec.php @@ -1680,7 +1680,7 @@ else // Lines print ' - + diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php index 185f2a1a818..bf03ad2c3d6 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -302,11 +302,13 @@ if (empty($reshook)) // Note: Other solution if you want to add a negative line on invoice, is to create a discount for customer and consumme it (but this is possible on standard invoice only). $array_of_total_ht_per_vat_rate = array(); $array_of_total_ht_devise_per_vat_rate = array(); - foreach($object->lines as $line) { - if (empty($array_of_total_ht_per_vat_rate[$line->tva_tx.'_'.$line->vat_src_code])) $array_of_total_ht_per_vat_rate[$line->tva_tx.'_'.$line->vat_src_code] = 0; - if (empty($array_of_total_ht_devise_per_vat_rate[$line->tva_tx.'_'.$line->vat_src_code])) $array_of_total_ht_devise_per_vat_rate[$line->tva_tx.'_'.$line->vat_src_code] = 0; - $array_of_total_ht_per_vat_rate[$line->tva_tx.'_'.$line->vat_src_code] += $line->total_ht; - $array_of_total_ht_devise_per_vat_rate[$line->tva_tx.'_'.$line->vat_src_code] += $line->multicurrency_total_ht; + foreach ($object->lines as $line) { + //$vat_src_code_for_line = $line->vat_src_code; // TODO We chek sign of total per vat without taking into account the vat code because for the moment the vat code is lost/unknown when we add a down payment. + $vat_src_code_for_line = ''; + if (empty($array_of_total_ht_per_vat_rate[$line->tva_tx.'_'.$vat_src_code_for_line])) $array_of_total_ht_per_vat_rate[$line->tva_tx.'_'.$vat_src_code_for_line] = 0; + if (empty($array_of_total_ht_devise_per_vat_rate[$line->tva_tx.'_'.$vat_src_code_for_line])) $array_of_total_ht_devise_per_vat_rate[$line->tva_tx.'_'.$vat_src_code_for_line] = 0; + $array_of_total_ht_per_vat_rate[$line->tva_tx.'_'.$vat_src_code_for_line] += $line->total_ht; + $array_of_total_ht_devise_per_vat_rate[$line->tva_tx.'_'.$vat_src_code_for_line] += $line->multicurrency_total_ht; } //var_dump($array_of_total_ht_per_vat_rate);exit; @@ -831,9 +833,9 @@ if (empty($reshook)) $amount_ht[$vatrate] = price2num($amount_ht[$vatrate] * $ratio, 'MU'); $amount_tva[$vatrate] = price2num($amount_tva[$vatrate] * $ratio, 'MU'); $amount_ttc[$vatrate] = price2num($amount_ttc[$vatrate] * $ratio, 'MU'); - $multicurrency_amount_ht[$line->tva_tx] = price2num($multicurrency_amount_ht[$vatrate] * $ratio, 'MU'); - $multicurrency_amount_tva[$line->tva_tx] = price2num($multicurrency_amount_tva[$vatrate] * $ratio, 'MU'); - $multicurrency_amount_ttc[$line->tva_tx] = price2num($multicurrency_amount_ttc[$vatrate] * $ratio, 'MU'); + $multicurrency_amount_ht[$vatrate] = price2num($multicurrency_amount_ht[$vatrate] * $ratio, 'MU'); + $multicurrency_amount_tva[$vatrate] = price2num($multicurrency_amount_tva[$vatrate] * $ratio, 'MU'); + $multicurrency_amount_ttc[$vatrate] = price2num($multicurrency_amount_ttc[$vatrate] * $ratio, 'MU'); } } } @@ -2840,7 +2842,7 @@ if ($action == 'create') } print ''; - print ''; + print ''; print ''; if ($soc->id > 0) print ''."\n"; print ''; @@ -4441,7 +4443,7 @@ elseif ($id > 0 || !empty($ref)) print ''; if ($action == 'editrevenuestamp') { print ''; - print ''; + print ''; print ''; print ''; print $formother->select_revenue_stamp('', 'revenuestamp_type', $mysoc->country_code); @@ -4945,7 +4947,7 @@ elseif ($id > 0 || !empty($ref)) } print ' - + diff --git a/htdocs/core/class/commoninvoice.class.php b/htdocs/core/class/commoninvoice.class.php index 80afcfacecc..ab580aa4d9b 100644 --- a/htdocs/core/class/commoninvoice.class.php +++ b/htdocs/core/class/commoninvoice.class.php @@ -95,7 +95,7 @@ abstract class CommonInvoice extends CommonObject * This does not include open direct debit requests. * * @param int $multicurrency Return multicurrency_amount instead of amount - * @return double Remain of amount to pay + * @return double Remain of amount to pay */ public function getRemainToPay($multicurrency = 0) { @@ -104,7 +104,7 @@ abstract class CommonInvoice extends CommonObject $alreadypaid+=$this->getSumDepositsUsed($multicurrency); $alreadypaid+=$this->getSumCreditNotesUsed($multicurrency); - $remaintopay = ($this->total_ttc - $alreadypaid); + $remaintopay = price2num($this->total_ttc - $alreadypaid, 'MT'); if ($this->statut == self::STATUS_CLOSED && $this->close_code == 'discount_vat') { // If invoice closed with discount for anticipated payment $remaintopay = 0; } diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index c193ae977dc..0d3ab9162dd 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -6638,9 +6638,10 @@ abstract class CommonObject if (($mode == 'create' || $mode == 'edit') && abs($visibility) != 1 && abs($visibility) != 3) continue; // <> -1 and <> 1 and <> 3 = not visible on forms, only on list elseif ($mode == 'view' && empty($visibility)) continue; if (empty($perms)) continue; - // Load language if required - if (!empty($extrafields->attributes[$this->table_element]['langfile'][$key])) $langs->load($extrafields->attributes[$this->table_element]['langfile'][$key]); + if (!empty($extrafields->attributes[$this->table_element]['langfile'][$key])) { + $langs->load($extrafields->attributes[$this->table_element]['langfile'][$key]); + } $colspan = ''; if (is_array($params) && count($params) > 0) { @@ -6739,8 +6740,8 @@ abstract class CommonObject { $value = GETPOSTISSET($keyprefix.'options_'.$key.$keysuffix) ?price2num(GETPOST($keyprefix.'options_'.$key.$keysuffix, 'alpha', 3)) : $this->array_options['options_'.$key]; } - $labeltoshow = $langs->trans($label); + $helptoshow = $langs->trans($extrafields->attributes[$this->table_element]['help'][$key]); $out .= 'attributes[$this->table_element]['help'][$key])) $out .= $form->textwithpicto($labeltoshow, $extrafields->attributes[$this->table_element]['help'][$key]); + if (!empty($extrafields->attributes[$this->table_element]['help'][$key])) $out .= $form->textwithpicto($labeltoshow, $helptoshow); else $out .= $labeltoshow; if ($mode != 'view' && !empty($extrafields->attributes[$this->table_element]['required'][$key])) $out .= ' *'; } else { if ($mode != 'view' && !empty($extrafields->attributes[$this->table_element]['required'][$key])) $out .= ' fieldrequired'; - $out .= '"'; - $out .= '>'; - if (!empty($extrafields->attributes[$this->table_element]['help'][$key])) $out .= $form->textwithpicto($labeltoshow, $extrafields->attributes[$this->table_element]['help'][$key]); + $out .= '">'; + if (!empty($extrafields->attributes[$this->table_element]['help'][$key])) $out .= $form->textwithpicto($labeltoshow, $helptoshow); else $out .= $labeltoshow; } $out .= '
\n"; $out .= "\n"; - } - $out .= ''; + $out .= ''; + } if ($noprint) return $out; else print $out; diff --git a/htdocs/core/lib/xcal.lib.php b/htdocs/core/lib/xcal.lib.php index 7e7cbd9672e..e3f53b7588d 100644 --- a/htdocs/core/lib/xcal.lib.php +++ b/htdocs/core/lib/xcal.lib.php @@ -330,7 +330,7 @@ function build_calfile($format, $title, $desc, $events_array, $outputfile) * @param string $format "rss" * @param string $title Title of export * @param string $desc Description of export - * @param array $events_array Array of events ("uid","startdate","summary","url","desc","author","category") + * @param array $events_array Array of events ("uid","startdate","summary","url","desc","author","category") or Array of WebsitePage * @param string $outputfile Output file * @param string $filter (optional) Filter * @return int < 0 if ko, Nb of events in file if ok @@ -355,7 +355,7 @@ function build_rssfile($format, $title, $desc, $events_array, $outputfile, $filt $date = date("r"); // Print header - fwrite($fichier, 'charset_output.""?>'); + fwrite($fichier, 'charset_output.'"?>'); fwrite($fichier, "\n"); fwrite($fichier, ''); @@ -363,11 +363,13 @@ function build_rssfile($format, $title, $desc, $events_array, $outputfile, $filt fwrite($fichier, "\n".$title."\n"); - $form = ""."\n". + /* + fwrite($fichier, ""."\n". // "fr"."\n". "Dolibarr"."\n". "".$date.""."\n". - "Dolibarr"."\n"; + "Dolibarr"."\n"); + */ // Define $urlwithroot $urlwithouturlroot = preg_replace("/".preg_quote(DOL_URL_ROOT, "/")."$/i", "", trim($dolibarr_main_url_root)); @@ -392,6 +394,19 @@ function build_rssfile($format, $title, $desc, $events_array, $outputfile, $filt if ($eventqualified) { + if (is_object($event) && get_class($event) == 'WebsitePage') { + // Convert object into an array + $tmpevent = array(); + $tmpevent['uid'] = $event->id; + $tmpevent['startdate'] = $event->date_creation; + $tmpevent['summary'] = $event->title; + $tmpevent['url'] = $event->urlpage.'.php'; + $tmpevent['author'] = $event->author_alias ? $event->author_alias : 'unknown'; + //$tmpevent['category'] = ''; + + $event = $tmpevent; + } + $uid = $event["uid"]; $startdate = $event["startdate"]; $summary = $event["summary"]; diff --git a/htdocs/don/card.php b/htdocs/don/card.php index bba65463bb6..faa6693bce8 100644 --- a/htdocs/don/card.php +++ b/htdocs/don/card.php @@ -445,7 +445,7 @@ if ($action == 'create') if (!empty($conf->projet->enabled)) { print "".$langs->trans("Project").""; - $formproject->select_projects(-1, $projectid, 'fk_project', 0, 0, 1, 1); + $formproject->select_projects(-1, $projectid, 'fk_project', 0, 0, 1, 1, 0, 0, 0, '', 0, 0, 'maxwidth500'); print "\n"; } @@ -579,7 +579,7 @@ if (!empty($id) && $action == 'edit') $langs->load('projects'); print ''.$langs->trans('Project').''; - $formproject->select_projects(-1, $object->fk_project, 'fk_project', 0, 0, 1, 1); + $formproject->select_projects(-1, $object->fk_project, 'fk_project', 0, 0, 1, 1, 0, 0, 0, '', 0, 0, 'maxwidth500'); print ''; } @@ -652,7 +652,7 @@ if (!empty($id) && $action != 'edit') $morehtmlref.='
'; $morehtmlref.=''; $morehtmlref.=''; - $morehtmlref.=$formproject->select_projects($object->socid, $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1); + $morehtmlref.=$formproject->select_projects($object->socid, $object->fk_project, 'projectid', 0, 0, 1, 0, 1, 0, 0, '', 1, 0, 'maxwidth500'); $morehtmlref.=''; $morehtmlref.='
'; } else { diff --git a/htdocs/expedition/card.php b/htdocs/expedition/card.php index b137e6cdfa5..cc9111fc813 100644 --- a/htdocs/expedition/card.php +++ b/htdocs/expedition/card.php @@ -2012,7 +2012,7 @@ elseif ($id || $ref) if ($action == 'editline') { print '
- + diff --git a/htdocs/fourn/class/fournisseur.product.class.php b/htdocs/fourn/class/fournisseur.product.class.php index 717a617b0ca..75e5a281218 100644 --- a/htdocs/fourn/class/fournisseur.product.class.php +++ b/htdocs/fourn/class/fournisseur.product.class.php @@ -1,12 +1,13 @@ - * Copyright (C) 2006-2011 Laurent Destailleur - * Copyright (C) 2009-2014 Regis Houssin - * Copyright (C) 2011 Juanjo Menent - * Copyright (C) 2012 Christophe Battarel - * Copyright (C) 2015 Marcos García - * Copyright (C) 2016 Charlie Benke - * Copyright (C) 2019 Frédéric France +/* Copyright (C) 2005 Rodolphe Quiedeville + * Copyright (C) 2006-2011 Laurent Destailleur + * Copyright (C) 2009-2014 Regis Houssin + * Copyright (C) 2011 Juanjo Menent + * Copyright (C) 2012 Christophe Battarel + * Copyright (C) 2015 Marcos García + * Copyright (C) 2016 Charlie Benke + * Copyright (C) 2019 Frédéric France + * Copyright (C) 2020 Pierre Ardoin * * 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 @@ -594,7 +595,7 @@ class ProductFournisseur extends Product global $conf; $sql = "SELECT s.nom as supplier_name, s.rowid as fourn_id,"; - $sql .= " pfp.rowid as product_fourn_pri_id, pfp.ref_fourn, pfp.desc_fourn, pfp.fk_product as product_fourn_id, pfp.fk_supplier_price_expression,"; + $sql .= " pfp.rowid as product_fourn_pri_id, pfp.entity, pfp.ref_fourn, pfp.desc_fourn, pfp.fk_product as product_fourn_id, pfp.fk_supplier_price_expression,"; $sql .= " pfp.price, pfp.quantity, pfp.unitprice, pfp.remise_percent, pfp.remise, pfp.tva_tx, pfp.fk_availability, pfp.charges, pfp.info_bits, pfp.delivery_time_days, pfp.supplier_reputation,"; $sql .= " pfp.multicurrency_price, pfp.multicurrency_unitprice, pfp.multicurrency_tx, pfp.fk_multicurrency, pfp.multicurrency_code, pfp.datec, pfp.tms,"; $sql .= " pfp.barcode, pfp.fk_barcode_type"; @@ -620,6 +621,7 @@ class ProductFournisseur extends Product $prodfourn->product_fourn_price_id = $record["product_fourn_pri_id"]; $prodfourn->product_fourn_id = $record["product_fourn_id"]; + $prodfourn->product_fourn_entity = $record["entity"]; $prodfourn->fourn_ref = $record["ref_fourn"]; $prodfourn->ref_supplier = $record["ref_fourn"]; $prodfourn->desc_supplier = $record["desc_fourn"]; diff --git a/htdocs/fourn/commande/index.php b/htdocs/fourn/commande/index.php index b6720a93e57..1830fbe778a 100644 --- a/htdocs/fourn/commande/index.php +++ b/htdocs/fourn/commande/index.php @@ -81,7 +81,7 @@ $sql .= " FROM ".MAIN_DB_PREFIX."societe as s"; $sql .= ", ".MAIN_DB_PREFIX."commande_fournisseur as cf"; if (!$user->rights->societe->client->voir && !$socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; $sql .= " WHERE cf.fk_soc = s.rowid"; -$sql .= " AND cf.entity = ".$conf->entity; +$sql .= " AND cf.entity IN (".getEntity('supplier_order').")"; if ($user->socid) $sql .= ' AND cf.fk_soc = '.$user->socid; if (!$user->rights->societe->client->voir && !$socid) $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".$user->id; $sql .= " GROUP BY cf.fk_statut"; @@ -267,7 +267,7 @@ if (! empty($conf->multicompany->enabled) && ! empty($conf->global->MULTICOMPANY } else { - $sql.= " WHERE (u.entity IN (".getEntity('user').")"; + $sql.= " WHERE (u.entity IN (".getEntity('user')."))"; } $sql.= " AND u.fk_soc IS NULL"; // An external user can not approved diff --git a/htdocs/fourn/facture/card.php b/htdocs/fourn/facture/card.php index 329ee266362..703a97fe11a 100644 --- a/htdocs/fourn/facture/card.php +++ b/htdocs/fourn/facture/card.php @@ -2077,7 +2077,7 @@ if ($action == 'create') $langs->load('projects'); print ''.$langs->trans('Project').''; - $formproject->select_projects((empty($conf->global->PROJECT_CAN_ALWAYS_LINK_TO_ALL_SUPPLIERS) ? $societe->id : -1), $projectid, 'projectid', 0, 0, 1, 1); + $formproject->select_projects((empty($conf->global->PROJECT_CAN_ALWAYS_LINK_TO_ALL_SUPPLIERS) ? $societe->id : -1), $projectid, 'projectid', 0, 0, 1, 1, 0, 0, 0, '', 0, 0, 'maxwidth500'); print ''; } diff --git a/htdocs/fourn/facture/paiement.php b/htdocs/fourn/facture/paiement.php index 19fed7a3387..ed5a7d244f5 100644 --- a/htdocs/fourn/facture/paiement.php +++ b/htdocs/fourn/facture/paiement.php @@ -916,7 +916,7 @@ if (empty($action) || $action == 'list') $selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields print '
'; - print ''."\n"; + print '
'."\n"; // Lines for filters fields print ''; @@ -1018,7 +1018,7 @@ if (empty($action) || $action == 'list') // Amount print ''; if (!$i) $totalarray['nbfield']++; - $totalarray['pos'][7] = 'amount'; + if (!$i) $totalarray['pos'][$totalarray['nbfield']] = 'amount'; $totalarray['val']['amount'] += $objp->pamount; // Ref invoice diff --git a/htdocs/install/upgrade2.php b/htdocs/install/upgrade2.php index 05eeaba2d5f..afd5830d4c1 100644 --- a/htdocs/install/upgrade2.php +++ b/htdocs/install/upgrade2.php @@ -5115,7 +5115,7 @@ function migrate_members_socialnetworks() $obj->socialnetworks = '[]'; } $socialnetworks = array_merge($arraysocialnetworks, json_decode($obj->socialnetworks, true)); - $sqlupd = 'UPDATE '.MAIN_DB_PREFIX.'adherent SET socialnetworks="'.$db->escape(json_encode($socialnetworks, true)).'"'; + $sqlupd = 'UPDATE '.MAIN_DB_PREFIX."adherent SET socialnetworks='".$db->escape(json_encode($socialnetworks, true))."'"; $sqlupd.= ', skype=null'; $sqlupd.= ', twitter=null'; $sqlupd.= ', facebook=null'; @@ -5209,7 +5209,7 @@ function migrate_contacts_socialnetworks() $obj->socialnetworks = '[]'; } $socialnetworks = array_merge($arraysocialnetworks, json_decode($obj->socialnetworks, true)); - $sqlupd = 'UPDATE '.MAIN_DB_PREFIX.'socpeople SET socialnetworks="'.$db->escape(json_encode($socialnetworks, true)).'"'; + $sqlupd = 'UPDATE '.MAIN_DB_PREFIX."socpeople SET socialnetworks='".$db->escape(json_encode($socialnetworks, true))."'"; $sqlupd.= ', jabberid=null'; $sqlupd.= ', skype=null'; $sqlupd.= ', twitter=null'; @@ -5300,7 +5300,7 @@ function migrate_thirdparties_socialnetworks() $obj->socialnetworks = '[]'; } $socialnetworks = array_merge($arraysocialnetworks, json_decode($obj->socialnetworks, true)); - $sqlupd = 'UPDATE '.MAIN_DB_PREFIX.'societe SET socialnetworks="'.$db->escape(json_encode($socialnetworks, true)).'"'; + $sqlupd = 'UPDATE '.MAIN_DB_PREFIX."societe SET socialnetworks='".$db->escape(json_encode($socialnetworks, true))."'"; $sqlupd.= ', skype=null'; $sqlupd.= ', twitter=null'; $sqlupd.= ', facebook=null'; diff --git a/htdocs/modulebuilder/template/myobject_card.php b/htdocs/modulebuilder/template/myobject_card.php index cc87e83d5c0..93eb7560aaa 100644 --- a/htdocs/modulebuilder/template/myobject_card.php +++ b/htdocs/modulebuilder/template/myobject_card.php @@ -401,7 +401,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea $result = $object->getLinesArray(); print ' - + diff --git a/htdocs/modulebuilder/template/myobject_list.php b/htdocs/modulebuilder/template/myobject_list.php index 46f347618f4..827eb430b84 100644 --- a/htdocs/modulebuilder/template/myobject_list.php +++ b/htdocs/modulebuilder/template/myobject_list.php @@ -409,7 +409,7 @@ $selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfi $selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : ''); print '
'; // You can use div-table-responsive-no-min if you dont need reserved height for your table -print '
'.price($objp->pamount).'
'."\n"; +print '
'."\n"; // Fields title search @@ -509,6 +509,7 @@ while ($i < ($limit ? min($num, $limit) : $num)) elseif ($key == 'ref') $cssforfield .= ($cssforfield ? ' ' : '').'nowrap'; if (in_array($val['type'], array('double(24,8)', 'double(6,3)', 'integer', 'real', 'price')) && $key != 'status') $cssforfield .= ($cssforfield ? ' ' : '').'right'; + //if (in_array($key, array('fk_soc', 'fk_user', 'fk_warehouse'))) $cssforfield = 'tdoverflowmax100'; if (!empty($arrayfields['t.'.$key]['checked'])) { diff --git a/htdocs/mrp/mo_card.php b/htdocs/mrp/mo_card.php index db05bfd408d..e16a19ea482 100644 --- a/htdocs/mrp/mo_card.php +++ b/htdocs/mrp/mo_card.php @@ -497,7 +497,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea $object->fetchLines(); print ' - + diff --git a/htdocs/mrp/mo_list.php b/htdocs/mrp/mo_list.php index 1b7849992a0..d2c2bdcf0ef 100644 --- a/htdocs/mrp/mo_list.php +++ b/htdocs/mrp/mo_list.php @@ -398,7 +398,7 @@ $selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfi $selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : ''); print '
'; // You can use div-table-responsive-no-min if you dont need reserved height for your table -print '
'."\n"; +print '
'."\n"; // Fields title search @@ -418,7 +418,7 @@ foreach ($object->fields as $key => $val) elseif (strpos($val['type'], 'integer:') === 0) { print $object->showInputField($val, $key, $search[$key], '', '', 'search_', 'maxwidth150', 1); } - elseif (! preg_match('/^(date|timestamp)/', $val['type'])) print ''; + elseif (!preg_match('/^(date|timestamp)/', $val['type'])) print ''; print ''; } } @@ -498,6 +498,7 @@ while ($i < ($limit ? min($num, $limit) : $num)) elseif ($key == 'ref') $cssforfield .= ($cssforfield ? ' ' : '').'nowrap'; if (in_array($val['type'], array('double(24,8)', 'double(6,3)', 'integer', 'real', 'price')) && $key != 'status') $cssforfield .= ($cssforfield ? ' ' : '').'right'; + if (in_array($key, array('fk_soc', 'fk_user', 'fk_warehouse'))) $cssforfield = 'tdoverflowmax100'; if (!empty($arrayfields['t.'.$key]['checked'])) { diff --git a/htdocs/product/card.php b/htdocs/product/card.php index 01da1eb741f..f4e959a9459 100644 --- a/htdocs/product/card.php +++ b/htdocs/product/card.php @@ -1440,7 +1440,7 @@ else // Default warehouse print ''; /* print "".'
'.$langs->trans("DefaultWarehouse").''; print $formproduct->selectWarehouses($object->fk_default_warehouse, 'fk_default_warehouse', 'warehouseopen', 1); - print ' '.$langs->trans("AddWarehouse").''; + print ' '; print '
'.$langs->trans("StockLimit").''; diff --git a/htdocs/product/fournisseurs.php b/htdocs/product/fournisseurs.php index 0abb57d8951..f6daf4cb77d 100644 --- a/htdocs/product/fournisseurs.php +++ b/htdocs/product/fournisseurs.php @@ -10,6 +10,7 @@ * Copyright (C) 2016 Ferran Marcet * Copyright (C) 2019 Frédéric France * Copyright (C) 2019 Tim Otte + * Copyright (C) 2020 Pierre Ardoin * * 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 @@ -1054,6 +1055,7 @@ SCRIPT; // Modify-Remove print ''; + if ($usercancreate) { print ''.img_edit().""; diff --git a/htdocs/product/price.php b/htdocs/product/price.php index a6697701a68..3f6a89cbddb 100644 --- a/htdocs/product/price.php +++ b/htdocs/product/price.php @@ -1151,7 +1151,7 @@ if ($action == 'edit_vat' && ($user->rights->produit->creer || $user->rights->se print load_fiche_titre($langs->trans("UpdateVAT"), ''); print ''; - print ''; + print ''; print ''; print ''; @@ -1185,7 +1185,7 @@ if ($action == 'edit_price' && $object->getRights()->creer) { print ''."\n"; print ''; - print ''; + print ''; print ''; print ''; @@ -1660,7 +1660,7 @@ if (!empty($conf->global->PRODUIT_CUSTOMER_PRICES)) print load_fiche_titre($langs->trans('PriceByCustomer')); print ''; - print ''; + print ''; print ''; print ''; @@ -1747,7 +1747,7 @@ if (!empty($conf->global->PRODUIT_CUSTOMER_PRICES)) } print ''; - print ''; + print ''; print ''; print ''; diff --git a/htdocs/product/stock/index.php b/htdocs/product/stock/index.php index 35e16e5c840..93c6e65ad49 100644 --- a/htdocs/product/stock/index.php +++ b/htdocs/product/stock/index.php @@ -45,6 +45,7 @@ $result=restrictedArea($user, 'stock'); */ $producttmp=new Product($db); +$warehouse=new Entrepot($db); $help_url='EN:Module_Stocks_En|FR:Module_Stock|ES:Módulo_Stocks'; llxHeader("", $langs->trans("Stocks"), $help_url); @@ -70,13 +71,14 @@ if (! empty($conf->global->MAIN_SEARCH_FORM_ON_HOME_AREAS)) // This is usele print "

"; } +$max = 15; -$sql = "SELECT e.ref as label, e.rowid, e.statut"; +$sql = "SELECT e.rowid, e.ref as label, e.lieu, e.statut as status"; $sql.= " FROM ".MAIN_DB_PREFIX."entrepot as e"; $sql.= " WHERE e.statut in (0,1)"; $sql.= " AND e.entity IN (".getEntity('stock').")"; $sql.= $db->order('e.statut', 'DESC'); -$sql.= $db->plimit(15, 0); +$sql.= $db->plimit($max + 1, 0); $result = $db->query($sql); @@ -92,20 +94,31 @@ if ($result) if ($num) { - $entrepot=new Entrepot($db); - - while ($i < $num) + while ($i < min($max, $num)) { $objp = $db->fetch_object($result); + $warehouse->id = $objp->rowid; + $warehouse->statut = $objp->status; + $warehouse->label = $objp->label; + $warehouse->lieu = $objp->lieu; + print ''; - print "rowid\">".img_object($langs->trans("ShowStock"), "stock")." ".$objp->label."\n"; - print ''.$entrepot->LibStatut($objp->statut, 5).''; + print ''; + print $warehouse->getNomUrl(1); + print ''."\n"; + print ''; + print $warehouse->getLibStatut(5); + print ''; print "\n"; $i++; } $db->free($result); } + if ($num > $max) { + print ''.$langs->trans("More").'...'; + } + print ""; print ''; } @@ -122,7 +135,7 @@ print '
'; // Last movements $max=10; $sql = "SELECT p.rowid, p.label as produit, p.tobatch, p.tosell, p.tobuy,"; -$sql.= " e.ref as stock, e.rowid as entrepot_id,"; +$sql.= " e.ref as warehouse_ref, e.rowid as warehouse_id, e.ref as warehouse_label, e.lieu, e.statut as warehouse_status,"; $sql.= " m.value as qty, m.datem, m.batch, m.eatby, m.sellby"; $sql.= " FROM ".MAIN_DB_PREFIX."entrepot as e"; $sql.= ", ".MAIN_DB_PREFIX."stock_mouvement as m"; @@ -166,6 +179,12 @@ if ($resql) $producttmp->status_sell = $objp->tosell; $producttmp->status_buy = $objp->tobuy; + $warehouse->id = $objp->warehouse_id; + $warehouse->ref = $objp->warehouse_ref; + $warehouse->statut = $objp->warehouse_status; + $warehouse->label = $objp->warehouse_label; + $warehouse->lieu = $objp->lieu; + print ''; print ''.dol_print_date($db->jdate($objp->datem), 'dayhour').''; print ''; @@ -177,9 +196,9 @@ if ($resql) print ''.dol_print_date($db->jdate($objp->sellby), 'day').''; print ''.dol_print_date($db->jdate($objp->eatby), 'day').''; } - print ''; - print img_object($langs->trans("ShowWarehouse"), "stock").' '.$objp->stock; - print "\n"; + print ''; + print $warehouse->getNomUrl(1); + print "\n"; print ''; if ($objp->qty > 0) print '+'; print $objp->qty.''; @@ -190,6 +209,8 @@ if ($resql) print ""; print '
'; +} else { + dol_print_error($db); } //print ''; diff --git a/htdocs/projet/class/task.class.php b/htdocs/projet/class/task.class.php index 60657b08061..bba05a55c8e 100644 --- a/htdocs/projet/class/task.class.php +++ b/htdocs/projet/class/task.class.php @@ -3,6 +3,7 @@ * Copyright (C) 2010-2012 Regis Houssin * Copyright (C) 2014 Marcos García * Copyright (C) 2018 Frédéric France + * Copyright (C) 2020 Juanjo Menent * * 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 @@ -154,7 +155,8 @@ class Task extends CommonObject // Insert request $sql = "INSERT INTO ".MAIN_DB_PREFIX."projet_task ("; - $sql .= "fk_projet"; + $sql .= "entity"; + $sql .= ", fk_projet"; $sql .= ", ref"; $sql .= ", fk_task_parent"; $sql .= ", label"; @@ -166,7 +168,8 @@ class Task extends CommonObject $sql .= ", planned_workload"; $sql .= ", progress"; $sql .= ") VALUES ("; - $sql .= $this->fk_project; + $sql .= $conf->entity; + $sql .= ", ".$this->fk_project; $sql .= ", ".(!empty($this->ref) ? "'".$this->db->escape($this->ref)."'" : 'null'); $sql .= ", ".$this->fk_task_parent; $sql .= ", '".$this->db->escape($this->label)."'"; diff --git a/htdocs/reception/card.php b/htdocs/reception/card.php index b2723a0ce6a..83a28d55f48 100644 --- a/htdocs/reception/card.php +++ b/htdocs/reception/card.php @@ -1610,7 +1610,7 @@ elseif ($id || $ref) if ($action == 'editline') { print '
- + '; diff --git a/htdocs/societe/price.php b/htdocs/societe/price.php index 5b383f30e28..7386987945e 100644 --- a/htdocs/societe/price.php +++ b/htdocs/societe/price.php @@ -256,7 +256,7 @@ if (!empty($conf->global->PRODUIT_CUSTOMER_PRICES)) { print load_fiche_titre($langs->trans('PriceByCustomer')); print ''; - print ''; + print ''; print ''; print ''; print ''; @@ -334,7 +334,7 @@ if (!empty($conf->global->PRODUIT_CUSTOMER_PRICES)) { } print ''; - print ''; + print ''; print ''; print ''; print '
'; diff --git a/htdocs/supplier_proposal/card.php b/htdocs/supplier_proposal/card.php index 5067a4935bc..e998f909d06 100644 --- a/htdocs/supplier_proposal/card.php +++ b/htdocs/supplier_proposal/card.php @@ -1041,7 +1041,7 @@ if (empty($reshook)) if (!$error) { - $result = $object->insertExtraFields('SUPPLIER_PROPOSAL_MODIFY'); + $result = $object->insertExtraFields('PROPOSAL_SUPPLIER_MODIFY'); if ($result < 0) { setEventMessages($object->error, $object->errors, 'errors'); @@ -1125,7 +1125,7 @@ if ($action == 'create') $object = new SupplierProposal($db); print ''; - print ''; + print ''; print ''; if ($origin != 'project' && $originid) { print ''; @@ -1433,7 +1433,7 @@ if ($action == 'create') require_once DOL_DOCUMENT_ROOT.'/core/class/notify.class.php'; $notify = new Notify($db); $text .= '
'; - $text .= $notify->confirmMessage('SUPPLIER_PROPOSAL_VALIDATE', $object->socid, $object); + $text .= $notify->confirmMessage('PROPOSAL_SUPPLIER_VALIDATE', $object->socid, $object); } if (!$error) @@ -1557,8 +1557,8 @@ if ($action == 'create') print '
'; print ''; if ($action == 'editdate_livraison') { - print ''; - print ''; + print ''; + print ''; print ''; print $form->selectDate($object->date_livraison, 'liv_', '', '', '', "editdate_livraison"); print ''; @@ -1762,7 +1762,7 @@ if ($action == 'create') $result = $object->getLinesArray(); print ' - + @@ -1806,7 +1806,10 @@ if ($action == 'create') if ($action == 'statut') { // Form to set proposal accepted/refused - $form_close = ''; + $form_close = ''; + $form_close .= ''; + $form_close .= ''; + if (! empty($conf->global->SUPPLIER_PROPOSAL_UPDATE_PRICE_ON_SUPPlIER_PROPOSAL)) $form_close .= '

'.$langs->trans('SupplierProposalRefFournNotice').'

'; // TODO Suggest a permanent checkbox instead of option $form_close .= ''; $form_close .= ''; diff --git a/htdocs/supplier_proposal/class/supplier_proposal.class.php b/htdocs/supplier_proposal/class/supplier_proposal.class.php index 97e3b12b92f..6f41426ee80 100644 --- a/htdocs/supplier_proposal/class/supplier_proposal.class.php +++ b/htdocs/supplier_proposal/class/supplier_proposal.class.php @@ -1481,7 +1481,7 @@ class SupplierProposal extends CommonObject if (! $error && ! $notrigger) { // Call trigger - $result=$this->call_trigger('SUPPLIER_PROPOSAL_VALIDATE', $user); + $result = $this->call_trigger('PROPOSAL_SUPPLIER_VALIDATE', $user); if ($result < 0) { $error++; } // End call triggers } @@ -1683,7 +1683,7 @@ class SupplierProposal extends CommonObject if (! $notrigger) { // Call trigger - $result=$this->call_trigger('SUPPLIER_PROPOSAL_REOPEN', $user); + $result = $this->call_trigger('PROPOSAL_SUPPLIER_REOPEN', $user); if ($result < 0) { $error++; } // End call triggers } @@ -1736,13 +1736,13 @@ class SupplierProposal extends CommonObject $resql=$this->db->query($sql); if ($resql) { - $modelpdf=$conf->global->SUPPLIER_PROPOSAL_ADDON_PDF_ODT_CLOSED?$conf->global->SUPPLIER_PROPOSAL_ADDON_PDF_ODT_CLOSED:$this->modelpdf; - $triggerName = 'SUPPLIER_PROPOSAL_CLOSE_REFUSED'; + $modelpdf = $conf->global->SUPPLIER_PROPOSAL_ADDON_PDF_ODT_CLOSED ? $conf->global->SUPPLIER_PROPOSAL_ADDON_PDF_ODT_CLOSED : $this->modelpdf; + $triggerName = 'PROPOSAL_SUPPLIER_CLOSE_REFUSED'; if ($status == 2) { - $triggerName='SUPPLIER_PROPOSAL_CLOSE_SIGNED'; - $modelpdf=$conf->global->SUPPLIER_PROPOSAL_ADDON_PDF_ODT_TOBILL?$conf->global->SUPPLIER_PROPOSAL_ADDON_PDF_ODT_TOBILL:$this->modelpdf; + $triggerName = 'PROPOSAL_SUPPLIER_CLOSE_SIGNED'; + $modelpdf = $conf->global->SUPPLIER_PROPOSAL_ADDON_PDF_ODT_TOBILL ? $conf->global->SUPPLIER_PROPOSAL_ADDON_PDF_ODT_TOBILL : $this->modelpdf; if (! empty($conf->global->SUPPLIER_PROPOSAL_UPDATE_PRICE_ON_SUPPlIER_PROPOSAL)) // TODO This option was not tested correctly. Error if product ref does not exists { @@ -1751,7 +1751,7 @@ class SupplierProposal extends CommonObject } if ($status == 4) { - $triggerName='SUPPLIER_PROPOSAL_CLASSIFY_BILLED'; + $triggerName = 'PROPOSAL_SUPPLIER_CLASSIFY_BILLED'; } if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) @@ -1916,7 +1916,7 @@ class SupplierProposal extends CommonObject if (!$error) { // Call trigger - $result=$this->call_trigger('SUPPLIER_PROPOSAL_UNVALIDATE', $user); + $result = $this->call_trigger('PROPOSAL_SUPPLIER_UNVALIDATE', $user); if ($result < 0) $error++; } @@ -2034,7 +2034,7 @@ class SupplierProposal extends CommonObject if (! $notrigger) { // Call trigger - $result=$this->call_trigger('SUPPLIER_PROPOSAL_DELETE', $user); + $result = $this->call_trigger('PROPOSAL_SUPPLIER_DELETE', $user); if ($result < 0) { $error++; } // End call triggers } diff --git a/htdocs/takepos/takepos.php b/htdocs/takepos/takepos.php index a7fb413e5f4..77c20d13046 100644 --- a/htdocs/takepos/takepos.php +++ b/htdocs/takepos/takepos.php @@ -613,7 +613,7 @@ function TerminalsDialog() function DirectPayment(){ console.log("DirectPayment"); - $("#poslines").load("invoice.php?place"+place+"&action=valid&pay=trans("cash"); ?>", function() { + $("#poslines").load("invoice.php?place="+place+"&action=valid&pay=trans("cash"); ?>", function() { }); } diff --git a/htdocs/theme/md/style.css.php b/htdocs/theme/md/style.css.php index 0293513109d..e800689b15d 100644 --- a/htdocs/theme/md/style.css.php +++ b/htdocs/theme/md/style.css.php @@ -2886,7 +2886,6 @@ table.paddingtopbottomonly tr td { background: rgb() !important; } tr.liste_titre_filter td.liste_titre { - border-bottom: 1px solid #FDFFFF; padding-top: 4px; padding-bottom: 3px; } diff --git a/htdocs/ticket/index.php b/htdocs/ticket/index.php index 92a931bf15d..180f1a6f4dc 100644 --- a/htdocs/ticket/index.php +++ b/htdocs/ticket/index.php @@ -203,7 +203,8 @@ $stringtoshow = ''; $stringtoshow .= '
'; // hideobject is to start hidden $stringtoshow .= ''; -$stringtoshow .= ''; +$stringtoshow .= ''; +$stringtoshow .= ''; $stringtoshow .= ''; $stringtoshow .= $langs->trans("Year").' '; $stringtoshow .= ''; @@ -212,7 +213,7 @@ $stringtoshow .= '
'; print '
'; print '
'; -print ''; +print ''; print '
'.$langs->trans("Statistics").' '.img_picto('', 'filter.png', 'id="idsubimgDOLUSERCOOKIE_ticket_by_status" class="linkobject"').'
'.$langs->trans("Statistics").' '.$endyear.' '.img_picto('', 'filter.png', 'id="idsubimgDOLUSERCOOKIE_ticket_by_status" class="linkobject"').'
'; print $stringtoshow; diff --git a/scripts/emailings/mailing-send.php b/scripts/emailings/mailing-send.php index 4e5069b4fdc..eb5b794d3d1 100755 --- a/scripts/emailings/mailing-send.php +++ b/scripts/emailings/mailing-send.php @@ -328,7 +328,7 @@ if ($resql) { dol_syslog("error for emailing id " . $id . " #" . $i . ($mail->error ? ' - ' . $mail->error : ''), LOG_DEBUG); $sqlerror = "UPDATE " . MAIN_DB_PREFIX . "mailing_cibles"; - $sqlerror .= " SET statut=-1, date_envoi=" . $db->idate($now) . " WHERE rowid=" . $obj->rowid; + $sqlerror .= " SET statut=-1, date_envoi='" . $db->idate($now) . "' WHERE rowid=" . $obj->rowid; $resqlerror = $db->query($sqlerror); if (! $resqlerror) { dol_print_error($db);