diff --git a/.travis.yml b/.travis.yml index 613d2fa2420..688d706331d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -282,7 +282,7 @@ script: # Ensure we catch errors set -e #parallel-lint --exclude htdocs/includes --blame . - parallel-lint --exclude dev/namespacemig --exclude dev/initdata/dbf/includes --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 --exclude htdocs/includes/jakub-onderka --exclude htdocs/includes/mike42/escpos-php/example --exclude htdocs/includes/phpunit/ --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 dev/initdata/dbf/includes --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 --exclude htdocs/includes/jakub-onderka --exclude htdocs/includes/mike42/escpos-php/example --exclude htdocs/includes/phpunit/ --exclude htdocs/includes/composer/autoload_static.php --blame . set +e echo diff --git a/htdocs/accountancy/bookkeeping/list.php b/htdocs/accountancy/bookkeeping/list.php index e50112f7ff1..065a72a5257 100644 --- a/htdocs/accountancy/bookkeeping/list.php +++ b/htdocs/accountancy/bookkeeping/list.php @@ -622,7 +622,7 @@ if ($action == 'delbookkeepingyear') { 'default' => $deljournal ); - $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?'.$param, $langs->trans('DeleteMvt'), $langs->trans('ConfirmDeleteMvt'), 'delbookkeepingyearconfirm', $form_question, 0, 1, 300); + $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?'.$param, $langs->trans('DeleteMvt'), $langs->trans('ConfirmDeleteMvt'), 'delbookkeepingyearconfirm', $form_question, '', 1, 300); print $formconfirm; } diff --git a/htdocs/accountancy/customer/lines.php b/htdocs/accountancy/customer/lines.php index 55342a98c27..7e51160195b 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 63b142e1bdd..8cc398a00bf 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 ef44222568f..8d3f3937823 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/admin/multicurrency.php b/htdocs/admin/multicurrency.php index 0c6d3e219b8..a2db56549e3 100644 --- a/htdocs/admin/multicurrency.php +++ b/htdocs/admin/multicurrency.php @@ -148,7 +148,10 @@ elseif ($action == 'setapilayer') } else { - MultiCurrency::syncRates($conf->global->MULTICURRENCY_APP_ID); + $result = MultiCurrency::syncRates($conf->global->MULTICURRENCY_APP_ID); + if ($result > 0) { + setEventMessages($langs->trans("CurrencyRateSyncSucceed"), null, "mesgs"); + } } } diff --git a/htdocs/admin/tools/listsessions.php b/htdocs/admin/tools/listsessions.php index 28d4fc3d51f..de526b725da 100644 --- a/htdocs/admin/tools/listsessions.php +++ b/htdocs/admin/tools/listsessions.php @@ -167,7 +167,7 @@ if ($savehandler == 'files') if (count($listofsessions) == 0) { - print ''.$langs->trans("NoSessionFound", $savepath, $openbasedir).''; + print ''.$langs->trans("NoSessionFound", $savepath, $openbasedir).''; } print ""; } diff --git a/htdocs/api/index.php b/htdocs/api/index.php index 7a9ef9ad24d..6ccdab6c179 100644 --- a/htdocs/api/index.php +++ b/htdocs/api/index.php @@ -56,6 +56,9 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; $url = $_SERVER['PHP_SELF']; +if (preg_match('/api\/index\.php$/', $url)) { // sometimes $_SERVER['PHP_SELF'] is 'api\/index\.php' instead of 'api\/index\.php/explorer.php' or 'api\/index\.php/method' + $url = $_SERVER['PHP_SELF'].$_SERVER['PATH_INFO']; +} // Fix for some NGINX setups (this should not be required even with NGINX, however setup of NGINX are often mysterious and this may help is such cases) if (! empty($conf->global->MAIN_NGINX_FIX)) { diff --git a/htdocs/bookmarks/bookmarks.lib.php b/htdocs/bookmarks/bookmarks.lib.php index 9e69eda2cd3..699065520da 100644 --- a/htdocs/bookmarks/bookmarks.lib.php +++ b/htdocs/bookmarks/bookmarks.lib.php @@ -60,10 +60,9 @@ function printDropdownBookmarksList() } $searchForm = ''."\n"; - $searchForm .= '
'; + $searchForm .= 'global->MAIN_OPTIMIZEFORTEXTBROWSER)?'onsubmit="return false"':'').'>'; $searchForm .= ''; - $searchForm .= ''; - $searchForm .= '
'; + // Url to list bookmark $listbtn = ''; @@ -79,7 +78,6 @@ function printDropdownBookmarksList() $newbtn .= img_picto('', 'bookmark', '', false, 0, 0, '', 'paddingright').dol_escape_htmltag($langs->trans('AddThisPageToBookmarks')).''; } - $bookmarkList = ''; - $html = ' - - - '; + $searchForm .= ''; - $html .= ' - - - '; + // Generate the return string + if (! empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) { + $html = $searchForm; - $html .= ' - - - '; + $html.=' + '; + } else { + $html = ' + + + '; - if ($(this).text().search(new RegExp(filter, "i")) < 0) { - $(this).addClass("hidden-search-result"); - } else { - $(this).removeClass("hidden-search-result"); - count++; - } - }); - $("#top-bookmark-search-filter-count").text(count); - }); - '; + $html .= ' + + + '; + + $html .= ' + + + '; + + $html .= ' + '; + } return $html; } diff --git a/htdocs/categories/viewcat.php b/htdocs/categories/viewcat.php index 727ef8b0610..c7242077da4 100644 --- a/htdocs/categories/viewcat.php +++ b/htdocs/categories/viewcat.php @@ -4,6 +4,7 @@ * Copyright (C) 2007 Patrick Raguin * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2015 Raphaël Doursenaud + * Copyright (C) 2020 Tobias Sekan * * 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 @@ -290,8 +291,18 @@ if ($user->rights->categorie->supprimer) print ""; +if (! empty($user->rights->categorie->creer)) +{ + $link = DOL_URL_ROOT.'/categories/card.php'; + $link .= '?action=create'; + $link .= '&type='.$type; + $link .= '&catorigin='.$object->id; + $link .= '&backtopage='.urlencode($_SERVER["PHP_SELF"].'?type='.$type.'&id='.$id); - + print '
'; + print dolGetButtonTitle($langs->trans('NewCategory'), '', 'fa fa-plus-circle', $link); + print "
"; +} $cats = $object->get_filles(); if ($cats < 0) diff --git a/htdocs/comm/remx.php b/htdocs/comm/remx.php index 651fa556e8a..c312591aeec 100644 --- a/htdocs/comm/remx.php +++ b/htdocs/comm/remx.php @@ -56,7 +56,7 @@ if (GETPOST('cancel', 'alpha') && !empty($backtopage)) exit; } -if ($action == 'confirm_split' && GETPOST("confirm") == 'yes') +if ($action == 'confirm_split' && GETPOST("confirm", "alpha") == 'yes') { //if ($user->rights->societe->creer) //if ($user->rights->facture->creer) @@ -122,6 +122,8 @@ if ($action == 'confirm_split' && GETPOST("confirm") == 'yes') $newdiscount2->datec = $discount->datec; $newdiscount1->tva_tx = $discount->tva_tx; $newdiscount2->tva_tx = $discount->tva_tx; + $newdiscount1->vat_src_code = $discount->vat_src_code; + $newdiscount2->vat_src_code = $discount->vat_src_code; $newdiscount1->amount_ttc = $amount_ttc_1; $newdiscount2->amount_ttc = price2num($discount->amount_ttc - $newdiscount1->amount_ttc); $newdiscount1->amount_ht = price2num($newdiscount1->amount_ttc / (1 + $newdiscount1->tva_tx / 100), 'MT'); @@ -129,6 +131,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 @@ -154,12 +163,12 @@ if ($action == 'setremise' && $user->rights->societe->creer) //if ($user->rights->societe->creer) //if ($user->rights->facture->creer) - $amount_ht = GETPOST('amount_ht'); + $amount_ht = price2num(GETPOST('amount_ht', 'alpha')); $desc = GETPOST('desc', 'alpha'); $tva_tx = GETPOST('tva_tx', 'alpha'); $discount_type = !empty($_POST['discount_type']) ?GETPOST('discount_type', 'alpha') : 0; - if (price2num($amount_ht) > 0) + if ($amount_ht > 0) { $error = 0; if (empty($desc)) @@ -196,7 +205,7 @@ if ($action == 'setremise' && $user->rights->societe->creer) } else { - setEventMessages($langs->trans("ErrorFieldFormat", $langs->transnoentitiesnoconv("NewGlobalDiscount")), null, 'errors'); + setEventMessages($langs->trans("ErrorFieldFormat", $langs->transnoentitiesnoconv("AmountHT")), null, 'errors'); } } @@ -375,10 +384,10 @@ if ($socid > 0) print ' '.$langs->trans("Currency".$conf->currency).''; print ''.$langs->trans("VAT").''; print ''; - print $form->load_tva('tva_tx', GETPOST('tva_tx'), $mysoc, $object); + print $form->load_tva('tva_tx', GETPOSTISSET('tva_tx') ? GETPOST('tva_tx', 'alpha') : 0, $mysoc, $object, 0, 0, '', 0, 1); print ''; print ''.$langs->trans("NoteReason").''; - print ''; + print ''; print ""; @@ -409,7 +418,7 @@ if ($socid > 0) /* - * List remises fixes client restant en cours (= liees a aucune facture ni ligne de facture) + * List not consumed available credits (= linked to no invoice and no invoice line) */ print load_fiche_titre($langs->trans("DiscountStillRemaining")); @@ -421,7 +430,8 @@ if ($socid > 0) print load_fiche_titre($langs->trans("CustomerDiscounts"), '', ''); } - $sql = "SELECT rc.rowid, rc.amount_ht, rc.amount_tva, rc.amount_ttc, rc.tva_tx, rc.multicurrency_amount_ht, rc.multicurrency_amount_tva, rc.multicurrency_amount_ttc,"; + $sql = "SELECT rc.rowid, rc.amount_ht, rc.amount_tva, rc.amount_ttc, rc.tva_tx, rc.vat_src_code,"; + $sql .= " rc.multicurrency_amount_ht, rc.multicurrency_amount_tva, rc.multicurrency_amount_ttc,"; $sql .= " rc.datec as dc, rc.description,"; $sql .= " rc.fk_facture_source,"; $sql .= " u.login, u.rowid as user_id,"; @@ -510,7 +520,7 @@ if ($socid > 0) { print ''.price($obj->multicurrency_amount_ht).''; } - print ''.vatrate($obj->tva_tx, true).''; + print ''.vatrate($obj->tva_tx.($obj->vat_src_code ? ' ('.$obj->vat_src_code.')' : ''), true).''; print ''.price($obj->amount_ttc).''; if (!empty($conf->multicurrency->enabled)) { @@ -577,7 +587,8 @@ if ($socid > 0) /* * Liste remises fixes fournisseur restant en cours (= liees a aucune facture ni ligne de facture) */ - $sql = "SELECT rc.rowid, rc.amount_ht, rc.amount_tva, rc.amount_ttc, rc.tva_tx, rc.multicurrency_amount_ht, rc.multicurrency_amount_tva, rc.multicurrency_amount_ttc,"; + $sql = "SELECT rc.rowid, rc.amount_ht, rc.amount_tva, rc.amount_ttc, rc.tva_tx, rc.vat_src_code,"; + $sql .= " rc.multicurrency_amount_ht, rc.multicurrency_amount_tva, rc.multicurrency_amount_ttc,"; $sql .= " rc.datec as dc, rc.description,"; $sql .= " rc.fk_invoice_supplier_source,"; $sql .= " u.login, u.rowid as user_id,"; @@ -666,7 +677,7 @@ if ($socid > 0) { print ''.price($obj->multicurrency_amount_ht).''; } - print ''.vatrate($obj->tva_tx, true).''; + print ''.vatrate($obj->tva_tx.($obj->vat_src_code ? ' ('.$obj->vat_src_code.')' : ''), true).''; print ''.price($obj->amount_ttc).''; if (!empty($conf->multicurrency->enabled)) { @@ -744,7 +755,8 @@ if ($socid > 0) } // Discount linked to invoice lines - $sql = "SELECT rc.rowid, rc.amount_ht, rc.amount_tva, rc.amount_ttc, rc.tva_tx, rc.multicurrency_amount_ht, rc.multicurrency_amount_tva, rc.multicurrency_amount_ttc,"; + $sql = "SELECT rc.rowid, rc.amount_ht, rc.amount_tva, rc.amount_ttc, rc.tva_tx, rc.vat_src_code,"; + $sql .= " rc.multicurrency_amount_ht, rc.multicurrency_amount_tva, rc.multicurrency_amount_ttc,"; $sql .= " rc.datec as dc, rc.description, rc.fk_facture_line, rc.fk_facture_source,"; $sql .= " u.login, u.rowid as user_id,"; $sql .= " f.rowid as invoiceid, f.ref,"; @@ -762,7 +774,7 @@ if ($socid > 0) $sql .= " ORDER BY dc DESC"; //$sql.= " UNION "; // Discount linked to invoices - $sql2 = "SELECT rc.rowid, rc.amount_ht, rc.amount_tva, rc.amount_ttc, rc.tva_tx,"; + $sql2 = "SELECT rc.rowid, rc.amount_ht, rc.amount_tva, rc.amount_ttc, rc.tva_tx, rc.vat_src_code,"; $sql2 .= " rc.datec as dc, rc.description, rc.fk_facture_line, rc.fk_facture,"; $sql2 .= " rc.fk_facture_source,"; $sql2 .= " u.login, u.rowid as user_id,"; @@ -881,7 +893,7 @@ if ($socid > 0) { print ''.price($obj->multicurrency_amount_ht).''; } - print ''.vatrate($obj->tva_tx, true).''; + print ''.vatrate($obj->tva_tx.($obj->vat_src_code ? ' ('.$obj->vat_src_code.')' : ''), true).''; print ''.price($obj->amount_ttc).''; if (!empty($conf->multicurrency->enabled)) { @@ -920,7 +932,8 @@ if ($socid > 0) } // Discount linked to invoice lines - $sql = "SELECT rc.rowid, rc.amount_ht, rc.amount_tva, rc.amount_ttc, rc.tva_tx, rc.multicurrency_amount_ht, rc.multicurrency_amount_tva, rc.multicurrency_amount_ttc,"; + $sql = "SELECT rc.rowid, rc.amount_ht, rc.amount_tva, rc.amount_ttc, rc.tva_tx, rc.vat_src_code,"; + $sql .= " rc.multicurrency_amount_ht, rc.multicurrency_amount_tva, rc.multicurrency_amount_ttc,"; $sql .= " rc.datec as dc, rc.description, rc.fk_invoice_supplier_line, rc.fk_invoice_supplier,"; $sql .= " rc.fk_invoice_supplier_source,"; $sql .= " u.login, u.rowid as user_id,"; @@ -939,7 +952,7 @@ if ($socid > 0) $sql .= " ORDER BY dc DESC"; //$sql.= " UNION "; // Discount linked to invoices - $sql2 = "SELECT rc.rowid, rc.amount_ht, rc.amount_tva, rc.amount_ttc, rc.tva_tx,"; + $sql2 = "SELECT rc.rowid, rc.amount_ht, rc.amount_tva, rc.amount_ttc, rc.tva_tx, rc.vat_src_code,"; $sql2 .= " rc.datec as dc, rc.description, rc.fk_invoice_supplier_line, rc.fk_invoice_supplier,"; $sql2 .= " rc.fk_invoice_supplier_source,"; $sql2 .= " u.login, u.rowid as user_id,"; @@ -1057,7 +1070,7 @@ if ($socid > 0) { print ''.price($obj->multicurrency_amount_ht).''; } - print ''.vatrate($obj->tva_tx, true).''; + print ''.vatrate($obj->tva_tx.($obj->vat_src_code ? ' ('.$obj->vat_src_code.')' : ''), true).''; print ''.price($obj->amount_ttc).''; if (!empty($conf->multicurrency->enabled)) { diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php index fbff955db47..fced3c4d84a 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -1,7 +1,7 @@ * Copyright (C) 2004 Eric Seigne - * Copyright (C) 2004-2016 Laurent Destailleur + * Copyright (C) 2004-2020 Laurent Destailleur * Copyright (C) 2005 Marc Barilley / Ocebo * Copyright (C) 2005-2015 Regis Houssin * Copyright (C) 2006 Andre Cianfarani @@ -302,10 +302,12 @@ if (empty($reshook)) $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; + //$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; @@ -485,10 +487,10 @@ if (empty($reshook)) // POST[remise_id] or POST[remise_id_for_payment] // We use the credit to reduce amount of invoice - if (!empty($_POST["remise_id"])) { + if (GETPOST("remise_id", 'int') > 0) { $ret = $object->fetch($id); if ($ret > 0) { - $result = $object->insert_discount($_POST["remise_id"]); + $result = $object->insert_discount(GETPOST("remise_id", 'int')); if ($result < 0) { setEventMessages($object->error, $object->errors, 'errors'); } @@ -497,11 +499,11 @@ if (empty($reshook)) } } // We use the credit to reduce remain to pay - if (!empty($_POST["remise_id_for_payment"])) + if (GETPOST("remise_id_for_payment", 'int') > 0) { require_once DOL_DOCUMENT_ROOT.'/core/class/discount.class.php'; $discount = new DiscountAbsolute($db); - $discount->fetch($_POST["remise_id_for_payment"]); + $discount->fetch(GETPOST("remise_id_for_payment", 'int')); //var_dump($object->getRemainToPay(0)); //var_dump($discount->amount_ttc);exit; @@ -809,14 +811,16 @@ if (empty($reshook)) $i = 0; foreach ($object->lines as $line) { - if ($line->product_type < 9 && $line->total_ht != 0) // Remove lines with product_type greater than or equal to 9 - { // no need to create discount if amount is null - $amount_ht[$line->tva_tx] += $line->total_ht; - $amount_tva[$line->tva_tx] += $line->total_tva; - $amount_ttc[$line->tva_tx] += $line->total_ttc; - $multicurrency_amount_ht[$line->tva_tx] += $line->multicurrency_total_ht; - $multicurrency_amount_tva[$line->tva_tx] += $line->multicurrency_total_tva; - $multicurrency_amount_ttc[$line->tva_tx] += $line->multicurrency_total_ttc; + if ($line->product_type < 9 && $line->total_ht != 0) // Remove lines with product_type greater than or equal to 9 and no need to create discount if amount is null + { + $keyforvatrate = $line->tva_tx.($line->vat_src_code ? ' ('.$line->vat_src_code.')' : ''); + + $amount_ht[$keyforvatrate] += $line->total_ht; + $amount_tva[$keyforvatrate] += $line->total_tva; + $amount_ttc[$keyforvatrate] += $line->total_ttc; + $multicurrency_amount_ht[$keyforvatrate] += $line->multicurrency_total_ht; + $multicurrency_amount_tva[$keyforvatrate] += $line->multicurrency_total_tva; + $multicurrency_amount_ttc[$keyforvatrate] += $line->multicurrency_total_ttc; $i++; } } @@ -830,9 +834,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'); } } } @@ -887,6 +891,7 @@ if (empty($reshook)) $discount->amount_ht = $discount->amount_ttc = $total_paiements + $total_creditnote_and_deposit - $object->total_ttc; $discount->amount_tva = 0; $discount->tva_tx = 0; + $discount->vat_src_code = ''; $result = $discount->create($user); if ($result < 0) @@ -904,7 +909,18 @@ if (empty($reshook)) $discount->multicurrency_amount_ht = abs($multicurrency_amount_ht[$tva_tx]); $discount->multicurrency_amount_tva = abs($multicurrency_amount_tva[$tva_tx]); $discount->multicurrency_amount_ttc = abs($multicurrency_amount_ttc[$tva_tx]); + + // Clean vat code + $reg = array(); + $vat_src_code = ''; + if (preg_match('/\((.*)\)/', $tva_tx, $reg)) + { + $vat_src_code = $reg[1]; + $tva_tx = preg_replace('/\s*\(.*\)/', '', $tva_tx); // Remove code into vatrate. + } + $discount->tva_tx = abs($tva_tx); + $discount->vat_src_code =$vat_src_code; $result = $discount->create($user); if ($result < 0) @@ -3397,7 +3413,7 @@ if ($action == 'create') { $langs->load('projects'); print ''.$langs->trans('Project').''; - $numprojet = $formproject->select_projects(($socid > 0 ? $socid : -1), $projectid, 'projectid', 0, 0, 1, 1); + $numprojet = $formproject->select_projects(($socid > 0 ? $socid : -1), $projectid, 'projectid', 0, 0, 1, 1, 0, 0, 0, '', 0, 0, 'maxwidth500'); print ' id.($fac_rec ? '&fac_rec='.$fac_rec : '')).'">'; print ''; } diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index ec7348723c5..7f499149034 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -3076,6 +3076,7 @@ class Facture extends CommonInvoice $localtaxes_type = getLocalTaxesFromRate($txtva, 0, $this->thirdparty, $mysoc); // Clean vat code + $reg = array(); $vat_src_code = ''; if (preg_match('/\((.*)\)/', $txtva, $reg)) { diff --git a/htdocs/core/class/commoninvoice.class.php b/htdocs/core/class/commoninvoice.class.php index c231a36402d..1c09d2ed48e 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/discount.class.php b/htdocs/core/class/discount.class.php index c3707b18972..bf85699a9fe 100644 --- a/htdocs/core/class/discount.class.php +++ b/htdocs/core/class/discount.class.php @@ -62,6 +62,7 @@ class DiscountAbsolute public $multicurrency_amount_ttc; // Vat rate public $tva_tx; + public $vat_src_code; /** * @var int User ID Id utilisateur qui accorde la remise @@ -133,7 +134,7 @@ class DiscountAbsolute $sql = "SELECT sr.rowid, sr.fk_soc, sr.discount_type,"; $sql.= " sr.fk_user,"; - $sql.= " sr.amount_ht, sr.amount_tva, sr.amount_ttc, sr.tva_tx,"; + $sql.= " sr.amount_ht, sr.amount_tva, sr.amount_ttc, sr.tva_tx, sr.vat_src_code,"; $sql.= " sr.multicurrency_amount_ht, sr.multicurrency_amount_tva, sr.multicurrency_amount_ttc,"; $sql.= " sr.fk_facture_line, sr.fk_facture, sr.fk_facture_source, sr.fk_invoice_supplier_line, sr.fk_invoice_supplier, sr.fk_invoice_supplier_source, sr.description,"; $sql.= " sr.datec,"; @@ -168,6 +169,8 @@ class DiscountAbsolute $this->multicurrency_amount_ttc = $obj->multicurrency_amount_ttc; $this->tva_tx = $obj->tva_tx; + $this->vat_src_code = $obj->vat_src_code; + $this->fk_user = $obj->fk_user; $this->fk_facture_line = $obj->fk_facture_line; $this->fk_facture = $obj->fk_facture; @@ -244,12 +247,12 @@ class DiscountAbsolute // Insert request $sql = "INSERT INTO ".MAIN_DB_PREFIX."societe_remise_except"; $sql .= " (entity, datec, fk_soc, discount_type, fk_user, description,"; - $sql .= " amount_ht, amount_tva, amount_ttc, tva_tx,"; + $sql .= " amount_ht, amount_tva, amount_ttc, tva_tx, vat_src_code,"; $sql .= " multicurrency_amount_ht, multicurrency_amount_tva, multicurrency_amount_ttc,"; $sql .= " fk_facture_source, fk_invoice_supplier_source"; $sql .= ")"; $sql .= " VALUES (".$conf->entity.", '".$this->db->idate($this->datec != '' ? $this->datec : dol_now())."', ".$this->fk_soc.", ".(empty($this->discount_type) ? 0 : intval($this->discount_type)).", ".$userid.", '".$this->db->escape($this->description)."',"; - $sql .= " ".$this->amount_ht.", ".$this->amount_tva.", ".$this->amount_ttc.", ".$this->tva_tx.","; + $sql .= " ".$this->amount_ht.", ".$this->amount_tva.", ".$this->amount_ttc.", ".$this->tva_tx.", '".$this->db->escape($this->vat_src_code)."',"; $sql .= " ".$this->multicurrency_amount_ht.", ".$this->multicurrency_amount_tva.", ".$this->multicurrency_amount_ttc.", "; $sql .= " ".($this->fk_facture_source ? "'".$this->db->escape($this->fk_facture_source)."'" : "null").","; $sql .= " ".($this->fk_invoice_supplier_source ? "'".$this->db->escape($this->fk_invoice_supplier_source)."'" : "null"); diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index f3615d4180f..1a42c9816b9 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -669,12 +669,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 { @@ -2141,7 +2143,7 @@ class Form } } - $selectFields = " p.rowid, p.ref, p.label, p.description, p.barcode, p.fk_product_type, p.price, p.price_ttc, p.price_base_type, p.tva_tx, p.duration, p.fk_price_expression"; + $selectFields = " p.rowid, p.ref, p.label, p.description, p.barcode, p.fk_country, p.fk_product_type, p.price, p.price_ttc, p.price_base_type, p.tva_tx, p.duration, p.fk_price_expression"; if (count($warehouseStatusArray)) { $selectFieldsGrouped = ", sum(".$db->ifsql("e.statut IS NULL", "0", "ps.reel").") as stock"; // e.statut is null if there is no record in stock @@ -2445,6 +2447,7 @@ class Form $outlabel = ''; $outdesc = ''; $outbarcode = ''; + $outorigin = ''; $outtype = ''; $outprice_ht = ''; $outprice_ttc = ''; @@ -2464,6 +2467,7 @@ class Form $outlabel = $objp->label; $outdesc = $objp->description; $outbarcode = $objp->barcode; + $outorigin = $objp->fk_country; $outpbq = empty($objp->price_by_qty_rowid) ? '' : $objp->price_by_qty_rowid; $outtype = $objp->fk_product_type; @@ -2525,12 +2529,15 @@ class Form $opt .= $objp->ref; if ($outbarcode) $opt .= ' ('.$outbarcode.')'; $opt .= ' - '.dol_trunc($label, $maxlengtharticle); + if ($outorigin && !empty($conf->global->PRODUCT_SHOW_ORIGIN_IN_COMBO)) $opt .= ' ('.getCountry($outorigin, 1).')'; $objRef = $objp->ref; if (!empty($filterkey) && $filterkey != '') $objRef = preg_replace('/('.preg_quote($filterkey).')/i', '$1', $objRef, 1); $outval .= $objRef; if ($outbarcode) $outval .= ' ('.$outbarcode.')'; $outval .= ' - '.dol_trunc($label, $maxlengtharticle); + if ($outorigin && !empty($conf->global->PRODUCT_SHOW_ORIGIN_IN_COMBO)) $outval .= ' ('.getCountry($outorigin, 1).')'; + // Units $opt .= $outvalUnits; $outval .= $outvalUnits; @@ -4770,7 +4777,7 @@ class Form print '
'; print ''; print ''; - print ' '; + print ' '; print ''."\n"; print "\n"; - // Show logo (search order: logo defined by PAYMENT_LOGO_suffix, then PAYMENT_LOGO, then small company logo, large company logo, theme logo, common logo) $width = 0; // Define logo and logosmall $logosmall = $mysoc->logo_small; $logo = $mysoc->logo; - $paramlogo = 'ONLINE_PAYMENT_LOGO_'.$suffix; - if (!empty($conf->global->$paramlogo)) $logosmall = $conf->global->$paramlogo; - elseif (!empty($conf->global->ONLINE_PAYMENT_LOGO)) $logosmall = $conf->global->ONLINE_PAYMENT_LOGO; //print ''."\n"; // Define urllogo $urllogo = ''; diff --git a/htdocs/product/fournisseurs.php b/htdocs/product/fournisseurs.php index 7ff90dc296a..22b4ac6e651 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 @@ -1070,6 +1071,7 @@ SCRIPT; // Modify-Remove print ''; + if ($usercancreate) { print ''.img_edit().""; diff --git a/htdocs/projet/class/task.class.php b/htdocs/projet/class/task.class.php index 7bb3f55242d..2e13a551e97 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 .= ", entity"; $sql .= ", fk_task_parent"; @@ -167,7 +169,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 .= ", ".$conf->entity; $sql .= ", ".$this->fk_task_parent; diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index e61c98e3267..e6e9e42aa75 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -1987,11 +1987,11 @@ class Societe extends CommonObject * @param float $remise Amount of discount * @param User $user User adding discount * @param string $desc Reason of discount - * @param float $tva_tx VAT rate + * @param string $vatrate VAT rate (may contain the vat code too). Exemple: '1.23', '1.23 (ABC)', ... * @param int $discount_type 0 => customer discount, 1 => supplier discount - * @return int <0 if KO, id of discount record if OK + * @return int <0 if KO, id of discount record if OK */ - public function set_remise_except($remise, User $user, $desc, $tva_tx = 0, $discount_type = 0) + public function set_remise_except($remise, User $user, $desc, $vatrate = '', $discount_type = 0) { // phpcs:enable global $langs; @@ -2012,8 +2012,17 @@ class Societe extends CommonObject return -2; } - if ($this->id) + if ($this->id > 0) { + // Clean vat code + $reg = array(); + $vat_src_code = ''; + if (preg_match('/\((.*)\)/', $vatrate, $reg)) + { + $vat_src_code = $reg[1]; + $vatrate = preg_replace('/\s*\(.*\)/', '', $vatrate); // Remove code into vatrate. + } + require_once DOL_DOCUMENT_ROOT.'/core/class/discount.class.php'; $discount = new DiscountAbsolute($this->db); @@ -2022,10 +2031,12 @@ class Societe extends CommonObject $discount->discount_type = $discount_type; $discount->amount_ht = $discount->multicurrency_amount_ht = price2num($remise, 'MT'); - $discount->amount_tva = $discount->multicurrency_amount_tva = price2num($remise * $tva_tx / 100, 'MT'); + $discount->amount_tva = $discount->multicurrency_amount_tva = price2num($remise * $vatrate / 100, 'MT'); $discount->amount_ttc = $discount->multicurrency_amount_ttc = price2num($discount->amount_ht + $discount->amount_tva, 'MT'); - $discount->tva_tx = price2num($tva_tx, 'MT'); + $discount->tva_tx = price2num($vatrate, 'MT'); + $discount->vat_src_code = $vat_src_code; + $discount->description = $desc; $result = $discount->create($user); diff --git a/htdocs/takepos/index.php b/htdocs/takepos/index.php index 2ce3f31211b..9f3a259e441 100644 --- a/htdocs/takepos/index.php +++ b/htdocs/takepos/index.php @@ -733,7 +733,6 @@ if (empty($conf->global->TAKEPOS_HIDE_HEAD_BAR)) { ?>
-
diff --git a/htdocs/takepos/invoice.php b/htdocs/takepos/invoice.php index 51536ba8133..6251b5b57b0 100644 --- a/htdocs/takepos/invoice.php +++ b/htdocs/takepos/invoice.php @@ -717,7 +717,7 @@ $( document ).ready(function() { trans("Customer"); - if ($invoice->socid != $conf->global->$constforcompanyid) { + if ($invoice->id > 0 && ($invoice->socid != $conf->global->$constforcompanyid)) { $s = $soc->name; } ?> @@ -733,17 +733,17 @@ $( document ).ready(function() { while ($obj = $db->fetch_object($resql)) { echo '$("#customerandsales").append(\''; if ($placeid==$obj->rowid) echo ""; - echo 'ref)); echo $num_sale; if (str_replace("-", "", $num_sale)>$max_sale) $max_sale=str_replace("-", "", $num_sale); - echo '\\\'">'.date('H:i', strtotime($obj->datec)); + echo '\\\';Refresh();">'.date('H:i', strtotime($obj->datec)); if ($placeid==$obj->rowid) echo ""; echo '\');'; } - echo '$("#customerandsales").append(\'\');'; + echo '\\\';Refresh();">\');'; } else { dol_print_error($db); } diff --git a/htdocs/theme/eldy/badges.inc.php b/htdocs/theme/eldy/badges.inc.php index ed609ddbc87..ae02a8e7f73 100644 --- a/htdocs/theme/eldy/badges.inc.php +++ b/htdocs/theme/eldy/badges.inc.php @@ -118,13 +118,13 @@ a.badge-warning:focus, a.badge-warning:hover { } /* WARNING colorblind */ -body[class^="colorblind-"] .badge-warning { +body[class*="colorblind-"] .badge-warning { background-color: ; } -body[class^="colorblind-"] a.badge-warning.focus,body[class^="colorblind-"] a.badge-warning:focus { +body[class*="colorblind-"] a.badge-warning.focus,body[class^="colorblind-"] a.badge-warning:focus { box-shadow: 0 0 0 0.2rem ; } -body[class^="colorblind-"] a.badge-warning:focus, a.badge-warning:hover { +body[class*="colorblind-"] a.badge-warning:focus, a.badge-warning:hover { background-color: ; } diff --git a/htdocs/theme/eldy/dropdown.inc.php b/htdocs/theme/eldy/dropdown.inc.php index bfe55597316..e930eef3f03 100644 --- a/htdocs/theme/eldy/dropdown.inc.php +++ b/htdocs/theme/eldy/dropdown.inc.php @@ -164,7 +164,9 @@ button.dropdown-item.global-search-item { } div#topmenu-global-search-dropdown, div#topmenu-bookmark-dropdown { - line-height: 46px; + global->THEME_TOPMENU_DISABLE_IMAGE)) { ?> + line-height: 46px; + } a.top-menu-dropdown-link { padding: 8px; diff --git a/htdocs/theme/eldy/progress.inc.php b/htdocs/theme/eldy/progress.inc.php index 750db266dfd..6df6d3480a8 100644 --- a/htdocs/theme/eldy/progress.inc.php +++ b/htdocs/theme/eldy/progress.inc.php @@ -145,16 +145,21 @@ if (! defined('ISLOADEDBYSTEELSHEET')) die('Must be call by steelsheet'); ?> background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); } -.progress-bar-green, -.progress-bar-success { +.progress-bar-green, .progress-bar-success { background-color: ; } -.progress-striped .progress-bar-green, -.progress-striped .progress-bar-success { +.progress-striped .progress-bar-green, .progress-striped .progress-bar-success { background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); } +body[class*="colorblind-"] .progress-bar-green, body[class*="colorblind-"] .progress-bar-success { + background-color: ; +} +body[class*="colorblind-"] .progress-bar-red, body[class*="colorblind-"] .progress-bar-danger { + background-color: ; +} + .progress-bar-aqua, .progress-bar-info { background-color: #00c0ef; diff --git a/htdocs/theme/eldy/theme_vars.inc.php b/htdocs/theme/eldy/theme_vars.inc.php index 65c51e10dfe..b0ab509dc5c 100644 --- a/htdocs/theme/eldy/theme_vars.inc.php +++ b/htdocs/theme/eldy/theme_vars.inc.php @@ -99,6 +99,7 @@ $badgeLight = '#f8f9fa'; $colorblind_deuteranopes_badgeSuccess = '#37de5d'; //! text color black $colorblind_deuteranopes_badgeSuccess_textColor7 = '#000'; $colorblind_deuteranopes_badgeWarning = '#e4e411'; +$colorblind_deuteranopes_badgeDanger = $badgeDanger; // currently not tested with a color blind people so use default color /* default color for status : After a quick check, somme status can have oposite function according to objects * So this badges status uses default value according to theme eldy status img