From ad485b55b6015b4502bf25277fd7a385bf4c7f39 Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Sun, 10 Mar 2019 20:01:39 +0100 Subject: [PATCH 1/6] NEW: Add category to bank transaction in various payment --- .../bank/class/paymentvarious.class.php | 5 +- htdocs/compta/bank/various_payment/card.php | 89 ++++++++++++------- 2 files changed, 59 insertions(+), 35 deletions(-) diff --git a/htdocs/compta/bank/class/paymentvarious.class.php b/htdocs/compta/bank/class/paymentvarious.class.php index 5a7ac205fe5..fad76c45d1b 100644 --- a/htdocs/compta/bank/class/paymentvarious.class.php +++ b/htdocs/compta/bank/class/paymentvarious.class.php @@ -63,6 +63,7 @@ class PaymentVarious extends CommonObject public $amount; public $type_payment; public $num_payment; + public $category_transaction; /** * @var string various payments label @@ -414,13 +415,13 @@ class PaymentVarious extends CommonObject $sign=1; if ($this->sens == '0') $sign=-1; - $bank_line_id = $acc->addline( + $bank_line_id = $acc->addline( $this->datep, $this->type_payment, $this->label, $sign * abs($this->amount), $this->num_payment, - '', + ($category_transaction > 0 ? $category_transaction : 0), $user ); diff --git a/htdocs/compta/bank/various_payment/card.php b/htdocs/compta/bank/various_payment/card.php index a1c1d8ae349..176fea7e8db 100644 --- a/htdocs/compta/bank/various_payment/card.php +++ b/htdocs/compta/bank/various_payment/card.php @@ -45,14 +45,15 @@ $action = GETPOST('action', 'alpha'); $cancel = GETPOST('cancel', 'aZ09'); $backtopage = GETPOST('backtopage', 'alpha'); -$accountid=GETPOST("accountid") > 0 ? GETPOST("accountid", "int") : 0; -$label=GETPOST("label", "alpha"); -$sens=GETPOST("sens", "int"); -$amount=GETPOST("amount", "alpha"); -$paymenttype=GETPOST("paymenttype", "int"); -$accountancy_code=GETPOST("accountancy_code", "alpha"); -$subledger_account=GETPOST("subledger_account", "alpha"); -$projectid = (GETPOST('projectid', 'int') ? GETPOST('projectid', 'int') : GETPOST('fk_project', 'int')); +$accountid = GETPOST("accountid") > 0 ? GETPOST("accountid", "int") : 0; +$label = GETPOST("label", "alpha"); +$sens = GETPOST("sens", "int"); +$amount = GETPOST("amount", "alpha"); +$paymenttype = GETPOST("paymenttype", "int"); +$accountancy_code = GETPOST("accountancy_code", "alpha"); +$subledger_account = GETPOST("subledger_account", "alpha"); +$projectid = (GETPOST('projectid', 'int') ? GETPOST('projectid', 'int') : GETPOST('fk_project', 'int')); +$cat1 = GETPOST("cat1", 'alpha'); // Security check $socid = GETPOST("socid", "int"); @@ -64,8 +65,6 @@ $object = new PaymentVarious($db); // Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context $hookmanager->initHooks(array('variouscard','globalcard')); - - /** * Actions */ @@ -113,6 +112,7 @@ if (empty($reshook)) $object->type_payment=GETPOST("paymenttype", 'int') > 0 ? GETPOST("paymenttype", "int") : 0; $object->num_payment=GETPOST("num_payment", 'alpha'); $object->fk_user_author=$user->id; + $object->category_transaction=GETPOST("cat1", 'alpha'); $object->accountancy_code=GETPOST("accountancy_code") > 0 ? GETPOST("accountancy_code", "alpha") : ""; $object->subledger_account=GETPOST("subledger_account") > 0 ? GETPOST("subledger_account", "alpha") : ""; @@ -240,6 +240,16 @@ if ($id) } } +$options = array(); + +// Load bank groups +require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/bankcateg.class.php'; +$bankcateg = new BankCateg($db); + +foreach ($bankcateg->fetchAll() as $bankcategory) { + $options[$bankcategory->id] = $bankcategory->label; +} + /* ************************************************************************** */ /* */ /* Create mode */ @@ -259,7 +269,7 @@ if ($action == 'create') print ''; // Date payment - print ''; @@ -314,17 +324,50 @@ if ($action == 'create') print ''."\n"; } + // Category + if (is_array($options) && count($options)) + { + print ''; + } + + // Project + if (! empty($conf->projet->enabled)) + { + $formproject=new FormProjets($db); + + // Associated project + $langs->load("projects"); + + print ''; + } + + // Other attributes + $parameters=array(); + $reshook=$hookmanager->executeHooks('formObjectOptions', $parameters, $object, $action); // Note that $action and $object may have been modified by hook + print $hookmanager->resPrint; + + print ''; + print '
'; + print '
'; print $form->editfieldkey('DatePayment', 'datep', '', $object, 0, 'string', '', 1).''; print $form->selectDate((empty($datep)?-1:$datep), "datep", '', '', '', 'add', 1, 1); print '
'.$langs->trans("Rubrique").''; + print Form::selectarray('cat1', $options, GETPOST('cat1'), 1); + print '
'.$langs->trans("Project").''; + + $numproject=$formproject->select_projects(-1, $projectid, 'fk_project', 0, 0, 1, 1); + + print '
'; + print '
'; + + print ''; // Accountancy account if (! empty($conf->accounting->enabled)) { - print ''; + print ''; print ''; } else // For external software { - print ''; + print ''; print ''; } @@ -351,26 +394,6 @@ if ($action == 'create') print ''; } - // Project - if (! empty($conf->projet->enabled)) - { - $formproject=new FormProjets($db); - - // Associated project - $langs->load("projects"); - - print ''; - } - - // Other attributes - $parameters=array(); - $reshook=$hookmanager->executeHooks('formObjectOptions', $parameters, $object, $action); // Note that $action and $object may have been modified by hook - print $hookmanager->resPrint; - print '
'.$langs->trans("AccountAccounting").'
'.$langs->trans("AccountAccounting").''; print $formaccounting->select_account($accountancy_code, 'accountancy_code', 1, null, 1, 1, ''); print '
'.$langs->trans("AccountAccounting").'
'.$langs->trans("AccountAccounting").''; print '
'.$langs->trans("Project").''; - - $numproject=$formproject->select_projects(-1, $projectid, 'fk_project', 0, 0, 1, 1); - - print '
'; dol_fiche_end(); From 09faf3aa5b0e404bc0c85f8ae4b4bb8d7505c5ec Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Fri, 24 May 2019 21:48:36 +0200 Subject: [PATCH 2/6] Accountancy - Use Ansi on Agiris model export & indent --- .../class/accountancyexport.class.php | 295 +++++++++--------- 1 file changed, 147 insertions(+), 148 deletions(-) diff --git a/htdocs/accountancy/class/accountancyexport.class.php b/htdocs/accountancy/class/accountancyexport.class.php index 1ef500fcf6b..0bfbbea2581 100644 --- a/htdocs/accountancy/class/accountancyexport.class.php +++ b/htdocs/accountancy/class/accountancyexport.class.php @@ -585,19 +585,19 @@ class AccountancyExport $date = dol_print_date($line->doc_date, '%d%m%Y'); print $line->piece_num . $separator; - print $line->label_operation . $separator; + print self::toAnsi($line->label_operation) . $separator; print $date . $separator; - print $line->label_operation . $separator; + print self::toAnsi($line->label_operation) . $separator; if (empty($line->subledger_account)) { print length_accountg($line->numero_compte) . $separator; - print $line->label_compte . $separator; + print self::toAnsi($line->label_compte) . $separator; } else { print length_accounta($line->subledger_account) . $separator; - print $line->subledger_label . $separator; + print self::toAnsi($line->subledger_label) . $separator; } - print $line->doc_ref . $separator; + print self::toAnsi($line->doc_ref) . $separator; print price($line->debit) . $separator; print price($line->credit) . $separator; print price($line->montant) . $separator; @@ -767,156 +767,155 @@ class AccountancyExport } } - /** - * Export format : SAGE50SWISS - * - * - * https://onlinehelp.sageschweiz.ch/default.aspx?tabid=19984 - * http://media.topal.ch/Public/Schnittstellen/TAF/Specification/Sage50-TAF-format.pdf - * - * @param array $objectLines data - * - * @return void - */ - public function exportSAGE50SWISS($objectLines) + /** + * Export format : SAGE50SWISS + * + * https://onlinehelp.sageschweiz.ch/default.aspx?tabid=19984 + * http://media.topal.ch/Public/Schnittstellen/TAF/Specification/Sage50-TAF-format.pdf + * + * @param array $objectLines data + * + * @return void + */ + public function exportSAGE50SWISS($objectLines) { - // SAGE50SWISS - $this->separator = ','; - $this->end_line = "\r\n"; + // SAGE50SWISS + $this->separator = ','; + $this->end_line = "\r\n"; - // Print header line - print "Blg,Datum,Kto,S/H,Grp,GKto,SId,SIdx,KIdx,BTyp,MTyp,Code,Netto,Steuer,FW-Betrag,Tx1,Tx2,PkKey,OpId,Flag"; - print $this->end_line; - $thisPieceNum= ""; - $thisPieceAccountNr= ""; - $aSize= count($objectLines); - foreach ($objectLines as $aIndex=>$line) + // Print header line + print "Blg,Datum,Kto,S/H,Grp,GKto,SId,SIdx,KIdx,BTyp,MTyp,Code,Netto,Steuer,FW-Betrag,Tx1,Tx2,PkKey,OpId,Flag"; + print $this->end_line; + $thisPieceNum= ""; + $thisPieceAccountNr= ""; + $aSize= count($objectLines); + foreach ($objectLines as $aIndex=>$line) + { + $sammelBuchung= false; + if ($aIndex-2 >= 0 && $objectLines[$aIndex-2]->piece_num == $line->piece_num) + { + $sammelBuchung= true; + } + elseif ($aIndex+2 < $aSize && $objectLines[$aIndex+2]->piece_num == $line->piece_num) + { + $sammelBuchung= true; + } + elseif ($aIndex+1 < $aSize + && $objectLines[$aIndex+1]->piece_num == $line->piece_num + && $aIndex-1 < $aSize + && $objectLines[$aIndex-1]->piece_num == $line->piece_num + ) + { + $sammelBuchung= true; + } + + //Blg + print $line->piece_num . $this->separator; + + // Datum + $date = dol_print_date($line->doc_date, '%d.%m.%Y'); + print $date . $this->separator; + + // Kto + print length_accountg($line->numero_compte) . $this->separator; + // S/H + if ($line->sens == 'D') + { + print 'S' . $this->separator; + } + else + { + print 'H' . $this->separator; + } + //Grp + print self::trunc($line->code_journal, 1) . $this->separator; + // GKto + if (empty($line->code_tiers)) + { + if ($line->piece_num == $thisPieceNum) { - $sammelBuchung= false; - if ($aIndex-2 >= 0 && $objectLines[$aIndex-2]->piece_num == $line->piece_num) - { - $sammelBuchung= true; - } - elseif ($aIndex+2 < $aSize && $objectLines[$aIndex+2]->piece_num == $line->piece_num) - { - $sammelBuchung= true; - } - elseif ($aIndex+1 < $aSize - && $objectLines[$aIndex+1]->piece_num == $line->piece_num - && $aIndex-1 < $aSize - && $objectLines[$aIndex-1]->piece_num == $line->piece_num - ) - { - $sammelBuchung= true; - } + print length_accounta($thisPieceAccountNr) . $this->separator; + } + else + { + print "div" . $this->separator; + } + } + else + { + print length_accounta($line->code_tiers) . $this->separator; + } + //SId + print $this->separator; + //SIdx + print "0" . $this->separator; + //KIdx + print "0" . $this->separator; + //BTyp + print "0" . $this->separator; - //Blg - print $line->piece_num . $this->separator; + //MTyp 1=Fibu Einzelbuchung 2=Sammebuchung + if ($sammelBuchung) + { + print "2" . $this->separator; + } + else + { + print "1" . $this->separator; + } + // Code + print '""' . $this->separator; + // Netto + if ($line->montant >= 0) + { + print $line->montant . $this->separator; + } + else + { + print $line->montant*-1 . $this->separator; + } + // Steuer + print "0.00" . $this->separator; + // FW-Betrag + print "0.00" . $this->separator; + // Tx1 + $line1= self::toAnsi($line->label_compte, 29); + if ($line1 == "LIQ" || $line1 == "LIQ Beleg ok" || strlen($line1) <= 3) + { + $line1= ""; + } + $line2= self::toAnsi($line->doc_ref, 29); + if (strlen($line1) == 0) + { + $line1= $line2; + $line2= ""; + } + if (strlen($line1) > 0 && strlen($line2) > 0 && (strlen($line1) + strlen($line2)) < 27) + { + $line1= $line1 . ' / ' . $line2; + $line2= ""; + } - // Datum - $date = dol_print_date($line->doc_date, '%d.%m.%Y'); - print $date . $this->separator; + print '"' . self::toAnsi($line1). '"' . $this->separator; + // Tx2 + print '"' . self::toAnsi($line2). '"' . $this->separator; + //PkKey + print "0" . $this->separator; + //OpId + print $this->separator; - // Kto - print length_accountg($line->numero_compte) . $this->separator; - // S/H - if ($line->sens == 'D') - { - print 'S' . $this->separator; - } - else - { - print 'H' . $this->separator; - } - //Grp - print self::trunc($line->code_journal, 1) . $this->separator; - // GKto - if (empty($line->code_tiers)) - { - if ($line->piece_num == $thisPieceNum) - { - print length_accounta($thisPieceAccountNr) . $this->separator; - } - else - { - print "div" . $this->separator; - } - } - else - { - print length_accounta($line->code_tiers) . $this->separator; - } - //SId - print $this->separator; - //SIdx - print "0" . $this->separator; - //KIdx - print "0" . $this->separator; - //BTyp - print "0" . $this->separator; + // Flag + print "0"; - //MTyp 1=Fibu Einzelbuchung 2=Sammebuchung - if ($sammelBuchung) - { - print "2" . $this->separator; - } - else - { - print "1" . $this->separator; - } - // Code - print '""' . $this->separator; - // Netto - if ($line->montant >= 0) - { - print $line->montant . $this->separator; - } - else - { - print $line->montant*-1 . $this->separator; - } - // Steuer - print "0.00" . $this->separator; - // FW-Betrag - print "0.00" . $this->separator; - // Tx1 - $line1= self::toAnsi($line->label_compte, 29); - if ($line1 == "LIQ" || $line1 == "LIQ Beleg ok" || strlen($line1) <= 3) - { - $line1= ""; - } - $line2= self::toAnsi($line->doc_ref, 29); - if (strlen($line1) == 0) - { - $line1= $line2; - $line2= ""; - } - if (strlen($line1) > 0 && strlen($line2) > 0 && (strlen($line1) + strlen($line2)) < 27) - { - $line1= $line1 . ' / ' . $line2; - $line2= ""; - } + print $this->end_line; - print '"' . self::toAnsi($line1). '"' . $this->separator; - // Tx2 - print '"' . self::toAnsi($line2). '"' . $this->separator; - //PkKey - print "0" . $this->separator; - //OpId - print $this->separator; - - // Flag - print "0"; - - print $this->end_line; - - if ($line->piece_num !== $thisPieceNum) - { - $thisPieceNum= $line->piece_num; - $thisPieceAccountNr= $line->numero_compte; - } + if ($line->piece_num !== $thisPieceNum) + { + $thisPieceNum= $line->piece_num; + $thisPieceAccountNr= $line->numero_compte; + } } - } + } /** * @@ -932,8 +931,8 @@ class AccountancyExport /** * * @param unknown $str Original string to encode and optionaly truncate - * @param integer $size trucate string after $size characters - * @return string String encoded in Windows-1251 charset + * @param integer $size truncate string after $size characters + * @return string String encoded in Windows-1251 charset */ public static function toAnsi($str, $size = -1) { From f8792250320208aafe07e2d0db98ac8b844dad6e Mon Sep 17 00:00:00 2001 From: KlaasOl <43514101+KlaasOl@users.noreply.github.com> Date: Sun, 26 May 2019 15:29:50 +0200 Subject: [PATCH 3/6] Create llx_accounting_account_nl.sql First accounting account scheme for Dutch accounting --- .../mysql/data/llx_accounting_account_nl.sql | 117 ++++++++++++++++++ 1 file changed, 117 insertions(+) create mode 100644 htdocs/install/mysql/data/llx_accounting_account_nl.sql diff --git a/htdocs/install/mysql/data/llx_accounting_account_nl.sql b/htdocs/install/mysql/data/llx_accounting_account_nl.sql new file mode 100644 index 00000000000..8cd08eb474d --- /dev/null +++ b/htdocs/install/mysql/data/llx_accounting_account_nl.sql @@ -0,0 +1,117 @@ +-- Copyright (C) 2001-2004 Rodolphe Quiedeville +-- Copyright (C) 2003 Jean-Louis Bergamo +-- Copyright (C) 2004-2009 Laurent Destailleur +-- Copyright (C) 2004 Benoit Mortier +-- Copyright (C) 2004 Guillaume Delecourt +-- Copyright (C) 2005-2009 Regis Houssin +-- Copyright (C) 2007 Patrick Raguin +-- Copyright (C) 2011-2017 Alexandre Spangaro +-- +-- 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 +-- the Free Software Foundation; either version 3 of the License, or +-- (at your option) any later version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License +-- along with this program. If not, see . +-- + +-- +-- Ne pas placer de commentaire en fin de ligne, ce fichier est parsé lors +-- de l'install et tous les sigles '--' sont supprimés. +-- + +-- Description of the accounts in NL-VERKORT +-- ID 0100-9999 +-- ADD 7006000 to rowid # Do no remove this comment -- +-- + +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1000, 'NL_VERKORT', 'BALANS', 'XXXXXX', '0050', '', 'Bedrijfspand en woning', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1001, 'NL-VERKORT', 'BALANS', 'XXXXXX', '0055', '', 'Afschrijving bedrijfspand en woning', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1002, 'NL-VERKORT', 'BALANS', 'XXXXXX', '0100', '', 'Inventaris', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1003, 'NL-VERKORT', 'BALANS', 'XXXXXX', '0105', '', 'Afschrijving inventaris', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1004, 'NL-VERKORT', 'BALANS', 'XXXXXX', '0150', '', 'Kantoor-inventaris', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1005, 'NL-VERKORT', 'BALANS', 'XXXXXX', '0155', '', 'Afschrijving kantoor-inventaris', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1006, 'NL-VERKORT', 'BALANS', 'XXXXXX', '0200', '', 'Transportmiddelen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1007, 'NL-VERKORT', 'BALANS', 'XXXXXX', '0205', '', 'Afschrijving transportmiddelen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1008, 'NL-VERKORT', 'BALANS', 'XXXXXX', '1100', '', 'Kas', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1009, 'NL-VERKORT', 'BALANS', 'XXXXXX', '1200', '', 'Bank', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1010, 'NL-VERKORT', 'BALANS', 'XXXXXX', '1300', '', 'Debiteuren', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1011, 'NL-VERKORT', 'BALANS', 'XXXXXX', '1310', '', 'Oninbare debiteuren', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1012, 'NL-VERKORT', 'BALANS', 'XXXXXX', '1500', '', 'Privé', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1013, 'NL-VERKORT', 'BALANS', 'XXXXXX', '1520', '', 'Privé IB/ZORGVERZ', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1014, 'NL-VERKORT', 'BALANS', 'XXXXXX', '1600', '', 'Crediteuren', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1015, 'NL-VERKORT', 'BALANS', 'XXXXXX', '1700', '', 'Ingehouden loonbelasing', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1016, 'NL-VERKORT', 'BALANS', 'XXXXXX', '1710', '', 'Afdracht loonbelasting', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1017, 'NL-VERKORT', 'BALANS', 'XXXXXX', '1720', '', 'Ingehouden pensioenlasten', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1018, 'NL-VERKORT', 'BALANS', 'XXXXXX', '1730', '', 'Reservering vakantiegeld', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1019, 'NL-VERKORT', 'BALANS', 'XXXXXX', '1820', '', 'BTW te betalen hoog', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1020, 'NL-VERKORT', 'BALANS', 'XXXXXX', '1825', '', 'BTW te betalen laag', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1021, 'NL-VERKORT', 'BALANS', 'XXXXXX', '1828', '', 'BTW te betalen auto privé', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1022, 'NL-VERKORT', 'BALANS', 'XXXXXX', '1829', '', 'BTW te betalen telefoon privé', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1023, 'NL-VERKORT', 'BALANS', 'XXXXXX', '1830', '', 'BTW te vorderen hoog', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1024, 'NL-VERKORT', 'BALANS', 'XXXXXX', '1835', '', 'BTW te vorderen laag', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1025, 'NL-VERKORT', 'BALANS', 'XXXXXX', '1890', '', 'Betaalde BTW', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1026, 'NL-VERKORT', 'BALANS', 'XXXXXX', '2200', '', 'Te betalen netto lonen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1027, 'NL-VERKORT', 'BALANS', 'XXXXXX', '2500', '', 'Kruisposten', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1028, 'NL-VERKORT', 'BALANS', 'XXXXXX', '2900', '', 'Vraagposten', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1029, 'NL-VERKORT', 'BALANS', 'XXXXXX', '3000', '', 'Voorraad', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1030, 'NL-VERKORT', 'EXPENSE', 'XXXXXX', '4000', '', 'Kantoorbenodigdheden', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1031, 'NL-VERKORT', 'EXPENSE', 'XXXXXX', '4010', '', 'Porti', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1032, 'NL-VERKORT', 'EXPENSE', 'XXXXXX', '4020', '', 'Telefoon/Internet', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1033, 'NL-VERKORT', 'EXPENSE', 'XXXXXX', '4030', '', 'Onderhoud gebouwen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1034, 'NL-VERKORT', 'EXPENSE', 'XXXXXX', '4040', '', 'Overige huisvestingskosten', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1035, 'NL-VERKORT', 'EXPENSE', 'XXXXXX', '4050', '', 'Belastingen en heffingen onroerend goed', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1036, 'NL-VERKORT', 'EXPENSE', 'XXXXXX', '4060', '', 'Onderhoud inventaris e.d.', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1037, 'NL-VERKORT', 'EXPENSE', 'XXXXXX', '4070', '', 'Kleine aanschaffingen < 500', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1038, 'NL-VERKORT', 'EXPENSE', 'XXXXXX', '4080', '', 'Kosten automatisering', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1039, 'NL-VERKORT', 'EXPENSE', 'XXXXXX', '4090', '', 'Abonnementen en contributies', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1040, 'NL-VERKORT', 'EXPENSE', 'XXXXXX', '4100', '', 'Autokosten', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1041, 'NL-VERKORT', 'EXPENSE', 'XXXXXX', '4110', '', 'Boetes', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1042, 'NL-VERKORT', 'EXPENSE', 'XXXXXX', '4120', '', 'Auto brandstof', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1043, 'NL-VERKORT', 'EXPENSE', 'XXXXXX', '4130', '', 'Auto belasting en verzekering', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1044, 'NL-VERKORT', 'EXPENSE', 'XXXXXX', '4140', '', 'BTW privé gebruik', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1045, 'NL-VERKORT', 'EXPENSE', 'XXXXXX', '4150', '', 'Bijtelling auto', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1046, 'NL-VERKORT', 'EXPENSE', 'XXXXXX', '4200', '', 'Reiskosten', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1047, 'NL-VERKORT', 'EXPENSE', 'XXXXXX', '4210', '', 'Reiskosten/eten', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1048, 'NL-VERKORT', 'EXPENSE', 'XXXXXX', '4220', '', 'Representatiekosten', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1049, 'NL-VERKORT', 'EXPENSE', 'XXXXXX', '4230', '', 'Werkkleding', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1050, 'NL-VERKORT', 'EXPENSE', 'XXXXXX', '4300', '', 'Magazijnkosten', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1051, 'NL-VERKORT', 'EXPENSE', 'XXXXXX', '4310', '', 'Stroom, gas en water', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1052, 'NL-VERKORT', 'EXPENSE', 'XXXXXX', '4320', '', 'Huur', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1053, 'NL-VERKORT', 'EXPENSE', 'XXXXXX', '4330', '', 'Reclamekosten', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1054, 'NL-VERKORT', 'EXPENSE', 'XXXXXX', '4340', '', 'Sponsoring', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1055, 'NL-VERKORT', 'EXPENSE', 'XXXXXX', '4350', '', 'Vertegenwoordigers/provisie', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1056, 'NL-VERKORT', 'EXPENSE', 'XXXXXX', '4400', '', 'Bruto lonen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1057, 'NL-VERKORT', 'EXPENSE', 'XXXXXX', '4410', '', 'Sociale lasten', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1058, 'NL-VERKORT', 'EXPENSE', 'XXXXXX', '4500', '', 'Afschr. kosten gebouwen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1059, 'NL-VERKORT', 'EXPENSE', 'XXXXXX', '4510', '', 'Afschr. kosten bedrijfsinventaris', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1060, 'NL-VERKORT', 'EXPENSE', 'XXXXXX', '4520', '', 'Afschr. kosten kantoorinventaris', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1061, 'NL-VERKORT', 'EXPENSE', 'XXXXXX', '4530', '', 'Afschr. kosten transportmiddelen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1062, 'NL-VERKORT', 'EXPENSE', 'XXXXXX', '4600', '', 'Administratiekosten', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1063, 'NL-VERKORT', 'EXPENSE', 'XXXXXX', '4610', '', 'Kantinekosten', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1064, 'NL-VERKORT', 'EXPENSE', 'XXXXXX', '4620', '', 'Provisie ass. tussenpersoon', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1065, 'NL-VERKORT', 'EXPENSE', 'XXXXXX', '4630', '', 'Vraagposten (V&W)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1066, 'NL-VERKORT', 'EXPENSE', 'XXXXXX', '4640', '', 'Diverse verzekeringen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1067, 'NL-VERKORT', 'EXPENSE', 'XXXXXX', '4700', '', 'Overige kosten', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1068, 'NL-VERKORT', 'EXPENSE', 'XXXXXX', '4750', '', 'Nog te verdelen posten', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1069, 'NL-VERKORT', 'EXPENSE', 'XXXXXX', '4800', '', 'Rente hypotheek', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1070, 'NL-VERKORT', 'EXPENSE', 'XXXXXX', '4810', '', 'Rente overige leningen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1071, 'NL-VERKORT', 'EXPENSE', 'XXXXXX', '4820', '', 'Rente en kosten RC', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1072, 'NL-VERKORT', 'EXPENSE', 'XXXXXX', '7000', '', 'Inkoop hoog', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1073, 'NL-VERKORT', 'EXPENSE', 'XXXXXX', '7010', '', 'Inkoop laag', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1074, 'NL-VERKORT', 'EXPENSE', 'XXXXXX', '7020', '', 'Inkoop nul BTW', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1075, 'NL-VERKORT', 'EXPENSE', 'XXXXXX', '7030', '', 'Inkoop binnen EU', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1076, 'NL-VERKORT', 'EXPENSE', 'XXXXXX', '7040', '', 'Inkoop buiten EU', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1077, 'NL-VERKORT', 'INCOME', 'XXXXXX', '8000', '', 'Omzet hoog', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1078, 'NL-VERKORT', 'INCOME', 'XXXXXX', '8010', '', 'Omzet laag', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1079, 'NL-VERKORT', 'INCOME', 'XXXXXX', '8020', '', 'Omzet nul BTW', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1080, 'NL-VERKORT', 'INCOME', 'XXXXXX', '8090', '', 'Onderhanden omzet', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1081, 'NL-VERKORT', 'INCOME', 'XXXXXX', '9000', '', 'Bijzondere baten', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1082, 'NL-VERKORT', 'EXPENSE', 'XXXXXX', '9010', '', 'Bijzondere lasten', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1083, 'NL-VERKORT', 'BALANS', 'XXXXXX', '9900', '', 'Kapitaal', 1); From 4301cd5b7a1a92c4e4c6c24aa66a4134f57eefaf Mon Sep 17 00:00:00 2001 From: KlaasOl <43514101+KlaasOl@users.noreply.github.com> Date: Sun, 26 May 2019 15:40:44 +0200 Subject: [PATCH 4/6] Update llx_accounting_abc.sql Adding chart of account NL VERKORT --- htdocs/install/mysql/data/llx_accounting_abc.sql | 3 +++ 1 file changed, 3 insertions(+) diff --git a/htdocs/install/mysql/data/llx_accounting_abc.sql b/htdocs/install/mysql/data/llx_accounting_abc.sql index b1dcdb64c35..54ae1d6e466 100644 --- a/htdocs/install/mysql/data/llx_accounting_abc.sql +++ b/htdocs/install/mysql/data/llx_accounting_abc.sql @@ -129,3 +129,6 @@ INSERT INTO llx_accounting_system (fk_country, pcg_version, label, active) VALUE -- Description of chart of account DZ NSCF INSERT INTO llx_accounting_system (fk_country, pcg_version, label, active) VALUES ( 13, 'NSCF', 'Nouveau système comptable financier', 1); + +-- Description of chart of account NL NL-VERKORT +INSERT INTO llx_accounting_system (fk_country, pcg_version, label, active) VALUES ( 17, 'NL-VERKORT', 'Verkort rekeningschema', 1); From 19b275f2d16207db6d415ec0c52021c273f733b8 Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Sun, 26 May 2019 22:33:35 +0200 Subject: [PATCH 5/6] Fix bankline cat with various payment --- htdocs/compta/bank/class/paymentvarious.class.php | 2 +- htdocs/compta/bank/various_payment/card.php | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/compta/bank/class/paymentvarious.class.php b/htdocs/compta/bank/class/paymentvarious.class.php index fad76c45d1b..ebdf085e18c 100644 --- a/htdocs/compta/bank/class/paymentvarious.class.php +++ b/htdocs/compta/bank/class/paymentvarious.class.php @@ -421,7 +421,7 @@ class PaymentVarious extends CommonObject $this->label, $sign * abs($this->amount), $this->num_payment, - ($category_transaction > 0 ? $category_transaction : 0), + ($this->category_transaction > 0 ? $this->category_transaction : 0), $user ); diff --git a/htdocs/compta/bank/various_payment/card.php b/htdocs/compta/bank/various_payment/card.php index 176fea7e8db..5b4ae6c8b4a 100644 --- a/htdocs/compta/bank/various_payment/card.php +++ b/htdocs/compta/bank/various_payment/card.php @@ -53,7 +53,7 @@ $paymenttype = GETPOST("paymenttype", "int"); $accountancy_code = GETPOST("accountancy_code", "alpha"); $subledger_account = GETPOST("subledger_account", "alpha"); $projectid = (GETPOST('projectid', 'int') ? GETPOST('projectid', 'int') : GETPOST('fk_project', 'int')); -$cat1 = GETPOST("cat1", 'alpha'); +$category_transaction = GETPOST("category_transaction", 'alpha'); // Security check $socid = GETPOST("socid", "int"); @@ -112,7 +112,7 @@ if (empty($reshook)) $object->type_payment=GETPOST("paymenttype", 'int') > 0 ? GETPOST("paymenttype", "int") : 0; $object->num_payment=GETPOST("num_payment", 'alpha'); $object->fk_user_author=$user->id; - $object->category_transaction=GETPOST("cat1", 'alpha'); + $object->category_transaction=GETPOST("category_transaction", 'alpha'); $object->accountancy_code=GETPOST("accountancy_code") > 0 ? GETPOST("accountancy_code", "alpha") : ""; $object->subledger_account=GETPOST("subledger_account") > 0 ? GETPOST("subledger_account", "alpha") : ""; @@ -328,7 +328,7 @@ if ($action == 'create') if (is_array($options) && count($options)) { print ''.$langs->trans("Rubrique").''; - print Form::selectarray('cat1', $options, GETPOST('cat1'), 1); + print Form::selectarray('category_transaction', $options, GETPOST('category_transaction'), 1); print ''; } From 6a84dfe29ee2794692e33d7df6006062dd6c2a0b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 29 May 2019 12:34:54 +0200 Subject: [PATCH 6/6] Update card.php --- htdocs/compta/bank/various_payment/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/compta/bank/various_payment/card.php b/htdocs/compta/bank/various_payment/card.php index 5b4ae6c8b4a..476314f0851 100644 --- a/htdocs/compta/bank/various_payment/card.php +++ b/htdocs/compta/bank/various_payment/card.php @@ -327,7 +327,7 @@ if ($action == 'create') // Category if (is_array($options) && count($options)) { - print ''.$langs->trans("Rubrique").''; + print ''.$langs->trans("RubriquesTransactions").''; print Form::selectarray('category_transaction', $options, GETPOST('category_transaction'), 1); print ''; }