From 70be232316b1df3b2cd6f0a441300408a739d427 Mon Sep 17 00:00:00 2001 From: Sylvain Legrand Date: Thu, 4 May 2023 09:30:00 +0200 Subject: [PATCH 1/2] Update subaccount.php --- htdocs/accountancy/admin/subaccount.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/accountancy/admin/subaccount.php b/htdocs/accountancy/admin/subaccount.php index 86df8d69416..9e0a6792f10 100644 --- a/htdocs/accountancy/admin/subaccount.php +++ b/htdocs/accountancy/admin/subaccount.php @@ -130,7 +130,7 @@ llxHeader('', $title, $help_url); // Customer -$sql = "SELECT sa.rowid, sa.nom as label, sa.code_compta as subaccount, '1' as type, sa.entity"; +$sql = "SELECT sa.rowid, sa.nom as label, sa.code_compta as subaccount, '1' as type, sa.entity, sa.client as nature"; $sql .= " FROM ".MAIN_DB_PREFIX."societe sa"; $sql .= " WHERE sa.entity IN (".getEntity('societe').")"; $sql .= " AND sa.code_compta <> ''"; @@ -178,7 +178,7 @@ if (!empty($search_type) && $search_type >= 0) { // Supplier $sql .= " UNION "; -$sql .= " SELECT sa.rowid, sa.nom as label, sa.code_compta_fournisseur as subaccount, '2' as type, sa.entity FROM ".MAIN_DB_PREFIX."societe sa"; +$sql .= " SELECT sa.rowid, sa.nom as label, sa.code_compta_fournisseur as subaccount, '2' as type, sa.entity, '0' as nature FROM ".MAIN_DB_PREFIX."societe sa"; $sql .= " WHERE sa.entity IN (".getEntity('societe').")"; $sql .= " AND sa.code_compta_fournisseur <> ''"; //print $sql; @@ -225,7 +225,7 @@ if (!empty($search_type) && $search_type >= 0) { // User - Employee $sql .= " UNION "; -$sql .= " SELECT u.rowid, u.lastname as label, u.accountancy_code as subaccount, '3' as type, u.entity FROM ".MAIN_DB_PREFIX."user u"; +$sql .= " SELECT u.rowid, u.lastname as label, u.accountancy_code as subaccount, '3' as type, u.entity, '0' as nature FROM ".MAIN_DB_PREFIX."user u"; $sql .= " WHERE u.entity IN (".getEntity('user').")"; $sql .= " AND u.accountancy_code <> ''"; //print $sql; @@ -393,7 +393,7 @@ if ($resql) { // Subaccount label if (!empty($arrayfields['label']['checked'])) { print ""; - print $obj->label; + print $obj->nature == 2 ? ''.$obj->label.' ('.$langs->trans(" Prospect").')' : $obj->label; print "\n"; if (!$i) { $totalarray['nbfield']++; From 9599fb8f228592cd563c6c4cfcc649573ce80043 Mon Sep 17 00:00:00 2001 From: Sylvain Legrand Date: Fri, 5 May 2023 08:15:55 +0200 Subject: [PATCH 2/2] Update subaccount.php --- htdocs/accountancy/admin/subaccount.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/accountancy/admin/subaccount.php b/htdocs/accountancy/admin/subaccount.php index 9e0a6792f10..07f3bf5ef07 100644 --- a/htdocs/accountancy/admin/subaccount.php +++ b/htdocs/accountancy/admin/subaccount.php @@ -393,7 +393,7 @@ if ($resql) { // Subaccount label if (!empty($arrayfields['label']['checked'])) { print ""; - print $obj->nature == 2 ? ''.$obj->label.' ('.$langs->trans(" Prospect").')' : $obj->label; + print $obj->nature == 2 ? ''.$obj->label.' ('.$langs->trans("Prospect").')' : $obj->label; print "\n"; if (!$i) { $totalarray['nbfield']++;