From bbb62f27c72271f71e7eb89bae2a52101b3ebf4f Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 14 Sep 2019 19:25:09 +0200 Subject: [PATCH 1/4] Update doc --- htdocs/fourn/card.php | 4 ++-- htdocs/fourn/commande/orderstoinvoice.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/fourn/card.php b/htdocs/fourn/card.php index 90240e4cd2b..5ebe8ffed56 100644 --- a/htdocs/fourn/card.php +++ b/htdocs/fourn/card.php @@ -605,9 +605,9 @@ if ($object->id > 0) $sql2.= ' WHERE c.fk_soc = s.rowid'; $sql2.= " AND c.entity IN (".getEntity('commande_fournisseur').")"; $sql2.= ' AND s.rowid = '.$object->id; - // Show orders with status validated, shipping started and delivered (even if any order we can bill) + // Show orders with status validated, shipping started and delivered (even if any order we can bill). //$sql2.= " AND c.fk_statut IN (".CommandeFournisseur::STATUS_ORDERSENT.", ".CommandeFournisseur::STATUS_RECEIVED_PARTIALLY.", ".CommandeFournisseur::STATUS_RECEIVED_COMPLETELY.")"; - $sql2.= " AND c.fk_statut IN (".CommandeFournisseur::STATUS_RECEIVED_COMPLETELY.")"; + $sql2.= " AND c.fk_statut IN (".CommandeFournisseur::STATUS_RECEIVED_COMPLETELY.")"; // Must match filter in htdocs/fourn/orderstoinvoice.php $sql2.= " AND c.billed = 0"; // Find order that are not already invoiced // just need to check received status because we have the billed status now diff --git a/htdocs/fourn/commande/orderstoinvoice.php b/htdocs/fourn/commande/orderstoinvoice.php index 75a78087366..39f33bebb73 100644 --- a/htdocs/fourn/commande/orderstoinvoice.php +++ b/htdocs/fourn/commande/orderstoinvoice.php @@ -450,7 +450,7 @@ if (($action != 'create' && $action != 'add') && !$error) { $sql .= ' AND c.fk_soc = s.rowid'; // Show orders with status validated, shipping started and delivered (well any order we can bill) - $sql .= " AND c.fk_statut IN (5)"; + $sql .= " AND c.fk_statut IN (".CommandeFournisseur::STATUS_RECEIVED_COMPLETELY.")"; // Must match filter in htdocs/fourn/card.php $sql .= " AND c.billed = 0"; // Find order that are not already invoiced From 21e27389d411b3fc9ba3556282ca25f095038c9b Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Sat, 14 Sep 2019 20:58:12 +0200 Subject: [PATCH 2/4] NEW Bank Add an option for colorize background color of debit or credit movement --- htdocs/admin/agenda_extsites.php | 2 +- htdocs/admin/bank.php | 120 +++++++++++++++++++++++- htdocs/compta/bank/bankentries_list.php | 24 ++++- htdocs/langs/en_US/banks.lang | 4 + 4 files changed, 143 insertions(+), 7 deletions(-) diff --git a/htdocs/admin/agenda_extsites.php b/htdocs/admin/agenda_extsites.php index 6979c49aabc..b59c311eb2f 100644 --- a/htdocs/admin/agenda_extsites.php +++ b/htdocs/admin/agenda_extsites.php @@ -44,7 +44,7 @@ $actionsave=GETPOST('save', 'alpha'); if (empty($conf->global->AGENDA_EXT_NB)) $conf->global->AGENDA_EXT_NB=5; $MAXAGENDA=$conf->global->AGENDA_EXT_NB; -// List of aviable colors +// List of available colors $colorlist=array('BECEDD','DDBECE','BFDDBE','F598B4','F68654','CBF654','A4A4A5'); diff --git a/htdocs/admin/bank.php b/htdocs/admin/bank.php index 2a0a66fe269..44cdd5e611b 100644 --- a/htdocs/admin/bank.php +++ b/htdocs/admin/bank.php @@ -1,5 +1,4 @@ * Copyright (C) 2010-2016 Juanjo Menent * Copyright (C) 2013-2018 Philippe Grand @@ -28,6 +27,7 @@ require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT . '/core/lib/admin.lib.php'; require_once DOL_DOCUMENT_ROOT . '/core/lib/bank.lib.php'; +require_once DOL_DOCUMENT_ROOT . '/core/class/html.formother.class.php'; require_once DOL_DOCUMENT_ROOT . '/compta/bank/class/account.class.php'; require_once DOL_DOCUMENT_ROOT . '/societe/class/companybankaccount.class.php'; @@ -38,6 +38,7 @@ if (!$user->admin) accessforbidden(); $action = GETPOST('action', 'alpha'); +$actionsave=GETPOST('save', 'alpha'); $value = GETPOST('value', 'alpha'); $label = GETPOST('label', 'alpha'); $scandir = GETPOST('scan_dir', 'alpha'); @@ -60,7 +61,7 @@ if ($action == 'setbankorder') { } } -//Auto report last num releve on conciliate +// Auto report last num releve on conciliate if ($action == 'setreportlastnumreleve') { if (dolibarr_set_const($db, "BANK_REPORT_LAST_NUM_RELEVE", 1, 'chaine', 0, '', $conf->entity) > 0) { @@ -82,6 +83,58 @@ elseif ($action == 'unsetreportlastnumreleve') { } } +// Colorize movements +if ($action == 'setbankcolorizemovement') { + if (dolibarr_set_const($db, "BANK_COLORIZE_MOVEMENT", 1, 'chaine', 0, '', $conf->entity) > 0) + { + header("Location: " . $_SERVER["PHP_SELF"]); + exit; + } + else { + dol_print_error($db); + } +} +elseif ($action == 'unsetbankcolorizemovement') { + if (dolibarr_set_const($db, "BANK_COLORIZE_MOVEMENT", 0, 'chaine', 0, '', $conf->entity) > 0) + { + header("Location: " . $_SERVER["PHP_SELF"]); + exit; + } + else { + dol_print_error($db); + } +} + +if ($actionsave) +{ + $db->begin(); + + $i=1; $errorsaved=0; + $error=0; + + // Save colors + while ($i <= 2) + { + $color=trim(GETPOST('BANK_COLORIZE_MOVEMENT_COLOR'.$i, 'alpha')); + if ($color=='-1') $color=''; + + $res=dolibarr_set_const($db, 'BANK_COLORIZE_MOVEMENT_COLOR'.$i, $color, 'chaine', 0, '', $conf->entity); + if (! $res > 0) $error++; + $i++; + } + + if (! $error) + { + $db->commit(); + setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); + } + else + { + $db->rollback(); + if (empty($errorsaved)) setEventMessages($langs->trans("Error"), null, 'errors'); + } +} + if ($action == 'specimen') { $modele = GETPOST('module', 'alpha'); @@ -157,10 +210,11 @@ elseif ($action == 'setdoc') { /* - * view + * View */ $form = new Form($db); +$formother=new FormOther($db); $dirmodels = array_merge(array('/'), (array) $conf->modules_parts['models']); @@ -169,6 +223,10 @@ llxHeader("", $langs->trans("BankSetupModule")); $linkback = '' . $langs->trans("BackToModuleList") . ''; print load_fiche_titre($langs->trans("BankSetupModule"), $linkback, 'title_setup'); +print '
'; +print ''; +print ''; + $head = bank_admin_prepare_head(null); dol_fiche_head($head, 'general', $langs->trans("BankSetupModule"), -1, 'account'); @@ -372,7 +430,56 @@ foreach ($dirmodels as $reldir) { print ''; //} +print '

'; +print load_fiche_titre($langs->trans("BankColorizeMovement"), '', ''); +print ''; +print "\n"; +print ''; +print ''."\n"; +print "\n"; + +print '"; +// Active +if ($conf->global->BANK_COLORIZE_MOVEMENT) { + print ''; +} +else +{ + print '"; +} + +print "\n"; + +if(! empty($conf->global->BANK_COLORIZE_MOVEMENT)) +{ + $i=1; + while ($i <= 2) + { + $key=$i; + $color='BANK_COLORIZE_MOVEMENT_COLOR'.$key; + + print ''; + + // Label + print '"; + // Color + print ''; + print ""; + $i++; + } +} +print '
' . $langs->trans("Name") . ''.$langs->trans("Value").'
'; +print $langs->trans('BankColorizeMovementDesc'); +print "' . "\n"; + print ''; + print img_picto($langs->trans("Enabled"), 'switch_on'); + print ''; + print '' . "\n"; + print '' . img_picto($langs->trans("Disabled"), 'switch_off') . ''; + print "
'.$langs->trans("BankColorizeMovementName".$key)."'; + print $formother->selectColor((GETPOST("BANK_COLORIZE_MOVEMENT_COLOR".$key)?GETPOST("BANK_COLORIZE_MOVEMENT_COLOR".$key):$conf->global->$color), "BANK_COLORIZE_MOVEMENT_COLOR".$key, 'bankmovementcolorconfig', 1, '', 'right hideifnotset'); + print '
'; print '

'; @@ -384,7 +491,6 @@ print '

'; //{ print load_fiche_titre($langs->trans("Other"), '', ''); - print "\n"; print "\n"; print ''; @@ -416,6 +522,12 @@ print "\n"; print '
' . $langs->trans("Name") . '
'; dol_fiche_end(); +print '
'; +print ''; +print '
'; + +print "
\n"; + // End of page llxFooter(); $db->close(); diff --git a/htdocs/compta/bank/bankentries_list.php b/htdocs/compta/bank/bankentries_list.php index a8002c179be..3522d8b6c9d 100644 --- a/htdocs/compta/bank/bankentries_list.php +++ b/htdocs/compta/bank/bankentries_list.php @@ -6,7 +6,7 @@ * Copyright (C) 2014 Florian Henry * Copyright (C) 2015 Jean-François Ferry * Copyright (C) 2016 Juanjo Menent - * Copyright (C) 2017 Alexandre Spangaro + * Copyright (C) 2017-2019 Alexandre Spangaro * Copyright (C) 2018 Ferran Marcet * Copyright (C) 2018 Frédéric France * @@ -1110,7 +1110,27 @@ if ($resql) $bankaccount = $cachebankaccount[$objp->bankid]; } - print ''; + if (empty($conf->global->BANK_COLORIZE_MOVEMENT)) { + $backgroundcolor = "class='oddeven'"; + } else { + if ($objp->amount < 0) + { + if (empty($conf->global->BANK_COLORIZE_MOVEMENT_COLOR1)) { + $color = '#fca955'; + } else { + $color = '#' . $conf->global->BANK_COLORIZE_MOVEMENT_COLOR1; + } + $backgroundcolor = 'style="background-color: ' . $color . ';"'; + } else { + if (empty($conf->global->BANK_COLORIZE_MOVEMENT_COLOR2)) { + $color = '#7fdb86'; + } else { + $color = '#' . $conf->global->BANK_COLORIZE_MOVEMENT_COLOR2; + } + $backgroundcolor = 'style="background-color: ' . $color . ';"'; + } + } + print ''; // Ref if (! empty($arrayfields['b.rowid']['checked'])) diff --git a/htdocs/langs/en_US/banks.lang b/htdocs/langs/en_US/banks.lang index 47295ec7e31..44f80c7c3b7 100644 --- a/htdocs/langs/en_US/banks.lang +++ b/htdocs/langs/en_US/banks.lang @@ -169,3 +169,7 @@ FindYourSEPAMandate=This is your SEPA mandate to authorize our company to make d AutoReportLastAccountStatement=Automatically fill the field 'number of bank statement' with last statement number when making reconciliation CashControl=POS cash fence NewCashFence=New cash fence +BankColorizeMovement=Colorize movements +BankColorizeMovementDesc=If this function is enable, you can choose specific background color for debit or credit movements +BankColorizeMovementName1=Background color for debit movement +BankColorizeMovementName2=Background color for credit movement From 5ba6a90acc48905c95ed371d915edb025f257573 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 15 Sep 2019 10:49:40 +0200 Subject: [PATCH 3/4] Fix responsive --- htdocs/societe/index.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/societe/index.php b/htdocs/societe/index.php index 4657a3e3f64..2010edeb217 100644 --- a/htdocs/societe/index.php +++ b/htdocs/societe/index.php @@ -288,7 +288,7 @@ if ($result) print ''; // Name - print ''; + print ''; print $thirdparty_static->getNomUrl(1); print "\n"; // Type From 6c078bdcb07112798a1620e4b1437cb6751df459 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 15 Sep 2019 10:53:41 +0200 Subject: [PATCH 4/4] Fix translation --- htdocs/langs/en_US/admin.lang | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index 3eb9f24112d..9202e31308b 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -1059,7 +1059,7 @@ BackgroundImageLogin=Background image PermanentLeftSearchForm=Permanent search form on left menu DefaultLanguage=Default language EnableMultilangInterface=Enable multilanguage support -EnableShowLogo=Show logo on left menu +EnableShowLogo=Show the company logo in the menu CompanyInfo=Company/Organization CompanyIds=Company/Organization identities CompanyName=Name