From 5fafa8b642d7ed55868c9e7633c9810fbc852677 Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Tue, 15 Mar 2022 06:29:26 +0100 Subject: [PATCH 1/4] NEW Accountancy - Add subledger account when we generate a transaction with a deposit invoice --- htdocs/accountancy/journal/sellsjournal.php | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/htdocs/accountancy/journal/sellsjournal.php b/htdocs/accountancy/journal/sellsjournal.php index 884c56ee6f2..6f2fce7c10c 100644 --- a/htdocs/accountancy/journal/sellsjournal.php +++ b/htdocs/accountancy/journal/sellsjournal.php @@ -412,8 +412,13 @@ if ($action == 'writebookkeeping') { $bookkeeping->fk_docdet = 0; // Useless, can be several lines that are source of this record to add $bookkeeping->thirdparty_code = $companystatic->code_client; - $bookkeeping->subledger_account = ''; - $bookkeeping->subledger_label = ''; + if($k == $conf->global->ACCOUNTING_ACCOUNT_CUSTOMER_DEPOSIT) { + $bookkeeping->subledger_account = $tabcompany[$key]['code_compta']; + $bookkeeping->subledger_label = $tabcompany[$key]['name']; + } else { + $bookkeeping->subledger_account = ''; + $bookkeeping->subledger_label = ''; + } $bookkeeping->numero_compte = $k; $bookkeeping->label_compte = $label_account; @@ -886,6 +891,13 @@ if (empty($action) || $action == 'view') { print ""; // Subledger account print ""; + if($k == $conf->global->ACCOUNTING_ACCOUNT_CUSTOMER_DEPOSIT) { + if (($accountoshow == "") || $accountoshow == 'NotDefined') { + print ''.$langs->trans("ThirdpartyAccountNotDefined").''; + } else { + print length_accounta($tabcompany[$key]['code_compta']); + } + } print ''; $companystatic->id = $tabcompany[$key]['id']; $companystatic->name = $tabcompany[$key]['name']; From 587b2076d85dc1b54e503460043b2a06c742a411 Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Tue, 15 Mar 2022 08:11:44 +0000 Subject: [PATCH 2/4] Fixing style errors. --- htdocs/accountancy/journal/sellsjournal.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/accountancy/journal/sellsjournal.php b/htdocs/accountancy/journal/sellsjournal.php index 6f2fce7c10c..110919ce73b 100644 --- a/htdocs/accountancy/journal/sellsjournal.php +++ b/htdocs/accountancy/journal/sellsjournal.php @@ -412,7 +412,7 @@ if ($action == 'writebookkeeping') { $bookkeeping->fk_docdet = 0; // Useless, can be several lines that are source of this record to add $bookkeeping->thirdparty_code = $companystatic->code_client; - if($k == $conf->global->ACCOUNTING_ACCOUNT_CUSTOMER_DEPOSIT) { + if ($k == $conf->global->ACCOUNTING_ACCOUNT_CUSTOMER_DEPOSIT) { $bookkeeping->subledger_account = $tabcompany[$key]['code_compta']; $bookkeeping->subledger_label = $tabcompany[$key]['name']; } else { @@ -891,7 +891,7 @@ if (empty($action) || $action == 'view') { print ""; // Subledger account print ""; - if($k == $conf->global->ACCOUNTING_ACCOUNT_CUSTOMER_DEPOSIT) { + if ($k == $conf->global->ACCOUNTING_ACCOUNT_CUSTOMER_DEPOSIT) { if (($accountoshow == "") || $accountoshow == 'NotDefined') { print ''.$langs->trans("ThirdpartyAccountNotDefined").''; } else { From 87029188061cf42387c7d627c754a0b76661e5cc Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Wed, 16 Mar 2022 16:09:09 +0100 Subject: [PATCH 3/4] Use getDolGlobalIntString() --- htdocs/accountancy/journal/sellsjournal.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/accountancy/journal/sellsjournal.php b/htdocs/accountancy/journal/sellsjournal.php index 110919ce73b..19675f120a3 100644 --- a/htdocs/accountancy/journal/sellsjournal.php +++ b/htdocs/accountancy/journal/sellsjournal.php @@ -412,7 +412,7 @@ if ($action == 'writebookkeeping') { $bookkeeping->fk_docdet = 0; // Useless, can be several lines that are source of this record to add $bookkeeping->thirdparty_code = $companystatic->code_client; - if ($k == $conf->global->ACCOUNTING_ACCOUNT_CUSTOMER_DEPOSIT) { + if ($k == getDolGlobalIntString('ACCOUNTING_ACCOUNT_CUSTOMER_DEPOSIT')) { $bookkeeping->subledger_account = $tabcompany[$key]['code_compta']; $bookkeeping->subledger_label = $tabcompany[$key]['name']; } else { @@ -891,7 +891,7 @@ if (empty($action) || $action == 'view') { print ""; // Subledger account print ""; - if ($k == $conf->global->ACCOUNTING_ACCOUNT_CUSTOMER_DEPOSIT) { + if ($k == getDolGlobalIntString('ACCOUNTING_ACCOUNT_CUSTOMER_DEPOSIT')) { if (($accountoshow == "") || $accountoshow == 'NotDefined') { print ''.$langs->trans("ThirdpartyAccountNotDefined").''; } else { From 0856a49ef0ca738b5dfcbf48f8abb840f32002f1 Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Thu, 17 Mar 2022 14:44:00 +0100 Subject: [PATCH 4/4] Fix --- htdocs/accountancy/journal/sellsjournal.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/accountancy/journal/sellsjournal.php b/htdocs/accountancy/journal/sellsjournal.php index 19675f120a3..7a5ccd79b21 100644 --- a/htdocs/accountancy/journal/sellsjournal.php +++ b/htdocs/accountancy/journal/sellsjournal.php @@ -412,7 +412,7 @@ if ($action == 'writebookkeeping') { $bookkeeping->fk_docdet = 0; // Useless, can be several lines that are source of this record to add $bookkeeping->thirdparty_code = $companystatic->code_client; - if ($k == getDolGlobalIntString('ACCOUNTING_ACCOUNT_CUSTOMER_DEPOSIT')) { + if ($k == getDolGlobalString('ACCOUNTING_ACCOUNT_CUSTOMER_DEPOSIT')) { $bookkeeping->subledger_account = $tabcompany[$key]['code_compta']; $bookkeeping->subledger_label = $tabcompany[$key]['name']; } else { @@ -891,7 +891,7 @@ if (empty($action) || $action == 'view') { print ""; // Subledger account print ""; - if ($k == getDolGlobalIntString('ACCOUNTING_ACCOUNT_CUSTOMER_DEPOSIT')) { + if ($k == getDolGlobalString('ACCOUNTING_ACCOUNT_CUSTOMER_DEPOSIT')) { if (($accountoshow == "") || $accountoshow == 'NotDefined') { print ''.$langs->trans("ThirdpartyAccountNotDefined").''; } else {