From 8f37f6647022b4c288c542845caddbe54a512a53 Mon Sep 17 00:00:00 2001 From: "Sekan, Tobias" Date: Thu, 3 Sep 2020 11:36:11 +0200 Subject: [PATCH 1/3] Show number and allow click on payment area --- htdocs/compta/index.php | 66 +++++++++++++++++++++++++++++++++-------- 1 file changed, 54 insertions(+), 12 deletions(-) diff --git a/htdocs/compta/index.php b/htdocs/compta/index.php index 3121aeffb17..fda16cea665 100644 --- a/htdocs/compta/index.php +++ b/htdocs/compta/index.php @@ -7,6 +7,7 @@ * Copyright (C) 2015 Raphaël Doursenaud * Copyright (C) 2016 Marcos García * Copyright (C) 2019 Nicolas ZABOURI + * 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 @@ -148,7 +149,7 @@ if (!empty($conf->facture->enabled) && $user->rights->facture->lire) if (!$user->rights->societe->client->voir && !$socid) $sql .= ", sc.fk_soc, sc.fk_user "; $sql .= " FROM ".MAIN_DB_PREFIX."facture as f, ".MAIN_DB_PREFIX."societe as s"; if (!$user->rights->societe->client->voir && !$socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; - $sql .= " WHERE s.rowid = f.fk_soc AND f.fk_statut = 0"; + $sql .= " WHERE s.rowid = f.fk_soc AND f.fk_statut = ".Facture::STATUS_DRAFT; $sql .= " AND f.entity IN (".getEntity('invoice').")"; if (!$user->rights->societe->client->voir && !$socid) $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".$user->id; @@ -175,10 +176,18 @@ if (!empty($conf->facture->enabled) && $user->rights->facture->lire) { $num = $db->num_rows($resql); - print '
'; + print '
'; print ''; + print ''; - print ''; + print ''; + print ''; + if ($num) { $companystatic = new Societe($db); @@ -244,7 +253,7 @@ if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SU $sql .= ", cc.rowid as country_id, cc.code as country_code"; $sql .= " FROM ".MAIN_DB_PREFIX."facture_fourn as f, ".MAIN_DB_PREFIX."societe as s LEFT JOIN ".MAIN_DB_PREFIX."c_country as cc ON cc.rowid = s.fk_pays"; if (!$user->rights->societe->client->voir && !$socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; - $sql .= " WHERE s.rowid = f.fk_soc AND f.fk_statut = 0"; + $sql .= " WHERE s.rowid = f.fk_soc AND f.fk_statut = ".FactureFournisseur::STATUS_DRAFT; $sql .= " AND f.entity IN (".getEntity('invoice').')'; if (!$user->rights->societe->client->voir && !$socid) $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".$user->id; if ($socid) $sql .= " AND f.fk_soc = ".$socid; @@ -258,10 +267,18 @@ if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SU { $num = $db->num_rows($resql); - print '
'; + print '
'; print '
'.$langs->trans("CustomersDraftInvoices").($num ? ''.$num.'' : '').'
'; + print $langs->trans("CustomersDraftInvoices").' '; + print ''; + print ''.$num.''; + print ''; + print '
'; + print ''; - print ''; + print ''; + print ''; + if ($num) { $companystatic = new Societe($db); @@ -709,7 +726,7 @@ if (!empty($conf->facture->enabled) && !empty($conf->commande->enabled) && $user $sql .= " AND c.entity = ".$conf->entity; if (!$user->rights->societe->client->voir && !$socid) $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".$user->id; if ($socid) $sql .= " AND c.fk_soc = ".$socid; - $sql .= " AND c.fk_statut = 3"; + $sql .= " AND c.fk_statut = ".Commande::STATUS_CLOSED; $sql .= " AND c.facture = 0"; // Add where from hooks $parameters = array(); @@ -729,8 +746,15 @@ if (!empty($conf->facture->enabled) && !empty($conf->commande->enabled) && $user print '
'; print '
'.$langs->trans("SuppliersDraftInvoices").($num ? ''.$num.'' : '').'
'; + print $langs->trans("SuppliersDraftInvoices").' '; + print ''; + print ''.$num.''; + print ''; + print '
'; + print ""; - print ''; + print ''; + if (!empty($conf->global->MAIN_SHOW_HT_ON_SUMMARY)) print ''; print ''; print ''; @@ -822,7 +846,7 @@ if (!empty($conf->facture->enabled) && $user->rights->facture->lire) $sql .= " FROM ".MAIN_DB_PREFIX."societe as s LEFT JOIN ".MAIN_DB_PREFIX."c_country as cc ON cc.rowid = s.fk_pays,".MAIN_DB_PREFIX."facture as f"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."paiement_facture as pf on f.rowid=pf.fk_facture"; if (!$user->rights->societe->client->voir && !$socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; - $sql .= " WHERE s.rowid = f.fk_soc AND f.paye = 0 AND f.fk_statut = 1"; + $sql .= " WHERE s.rowid = f.fk_soc AND f.paye = 0 AND f.fk_statut = ".Facture::STATUS_VALIDATED; $sql .= " AND f.entity IN (".getEntity('invoice').')'; if (!$user->rights->societe->client->voir && !$socid) $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".$user->id; if ($socid) $sql .= " AND f.fk_soc = ".$socid; @@ -843,7 +867,15 @@ if (!empty($conf->facture->enabled) && $user->rights->facture->lire) print '
'; print '
'.$langs->trans("OrdersDeliveredToBill").' '.$num.''; + print $langs->trans("OrdersDeliveredToBill").' '; + print ''; + print ''.$num.''; + print ''; + print ''.$langs->trans("AmountHT").''.$langs->trans("AmountTTC").''.$langs->trans("ToBill").'
'; - print ''; + + print ''; + print ''; + print ''; if (!empty($conf->global->MAIN_SHOW_HT_ON_SUMMARY)) print ''; print ''; @@ -954,7 +986,7 @@ if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SU $sql .= " WHERE s.rowid = ff.fk_soc"; $sql .= " AND ff.entity = ".$conf->entity; $sql .= " AND ff.paye = 0"; - $sql .= " AND ff.fk_statut = 1"; + $sql .= " AND ff.fk_statut = ".FactureFournisseur::STATUS_VALIDATED; if (!$user->rights->societe->client->voir && !$socid) $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".$user->id; if ($socid) $sql .= " AND ff.fk_soc = ".$socid; // Add where from hooks @@ -973,7 +1005,17 @@ if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SU print '
'; print '
'.$langs->trans("BillsCustomersUnpaid", $num).' '.$num.'
'; + print $langs->trans("BillsCustomersUnpaid", $num).' '; + print ''; + print ''.$num.''; + print ''; + print ''.$langs->trans("DateDue").''.$langs->trans("AmountHT").''.$langs->trans("AmountTTC").'
'; - print ''; + + print ''; + print ''; + print ''; if (!empty($conf->global->MAIN_SHOW_HT_ON_SUMMARY)) print ''; print ''; From 06e8e62d3875d34090aadb9bd2089e88f7f16a09 Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Thu, 3 Sep 2020 09:49:35 +0000 Subject: [PATCH 2/3] Fixing style errors. --- htdocs/compta/index.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/compta/index.php b/htdocs/compta/index.php index fda16cea665..e487cf5746e 100644 --- a/htdocs/compta/index.php +++ b/htdocs/compta/index.php @@ -1010,7 +1010,7 @@ if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SU print '
'.$langs->trans("BillsSuppliersUnpaid", $num).' '.$num.'
'; + print $langs->trans("BillsSuppliersUnpaid", $num).' '; + print ''; + // TODO: "impayees.php" looks very outdatetd and should be set to deprecated or directly remove in the next version + // + print ''.$num.''; + print ''; + print ''.$langs->trans("DateDue").''.$langs->trans("AmountHT").''.$langs->trans("AmountTTC").''; print $langs->trans("BillsSuppliersUnpaid", $num).' '; print ''; - // TODO: "impayees.php" looks very outdatetd and should be set to deprecated or directly remove in the next version + // TODO: "impayees.php" looks very outdatetd and should be set to deprecated or directly remove in the next version // print ''.$num.''; print ''; From 1a33cd91c98ce4fb6617fec6f19db930a4463088 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 3 Sep 2020 12:20:20 +0200 Subject: [PATCH 3/3] Update index.php --- htdocs/compta/index.php | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/htdocs/compta/index.php b/htdocs/compta/index.php index e487cf5746e..a313f47cc13 100644 --- a/htdocs/compta/index.php +++ b/htdocs/compta/index.php @@ -33,12 +33,9 @@ require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php'; -if (!empty($conf->commande->enabled)) - require_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php'; -if (!empty($conf->commande->enabled)) - require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.commande.class.php'; -if (!empty($conf->tax->enabled)) - require_once DOL_DOCUMENT_ROOT.'/compta/sociales/class/chargesociales.class.php'; +require_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php'; +require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.commande.class.php'; +require_once DOL_DOCUMENT_ROOT.'/compta/sociales/class/chargesociales.class.php'; // L'espace compta/treso doit toujours etre actif car c'est un espace partage // par de nombreux modules (banque, facture, commande a facturer, etc...) independamment