The $check is supposed to be a check retuning a boolean. By being an
`if (value)` check instead of being an `if (value IS NOT NULL)` check,
postgresql complains the types are not correct:
Error ERROR: 42804: argument of CASE/WHEN must be type boolean,
not type integer LINE 1: ...k, tl2.fk_doc FROM ( SELECT DISTINCT
(CASE WHEN tll.fk_fac... ^ LOCATION: coerce_to_boolean,
parse_coerce.c:1176
Regression from commit cfc162a31d.
It shows as the following in the logs:
GROUP BY fk_facture
\x09AND fk_facture IN (8)
AND fd.total_ttc <> 0
AND fd.fk_code_ventilation <= 0
fd.product_type <= 2
WHERE
\x09llx_facturedet as fd
FROM
FIX I did further testing and investigation and I fixed the following issues that stop doing a full closure without duplicate lines generated by an unclean database :
- different label_compte with same account number
- removing label_compte is raising an issue and the code in the line around 2770 $bookkeeping->label_compte = $obj->label_compte;
- different subledger_label with same subledger_account
- empty versus null values for subledger_label and subledger_account
- opening_balance is 0 as it creates a bookkeeping entry for now.
FIX - Update Accounting closure with missing too many A-Nouveau #30039)
* Fix expense report journal entries bind to user
WAS: expense report payments did not fill out $tabtb (credit) to associate with their $tabpay (debit). The case would always fall through to 'NotDefined' and require manual adjustment.
NEW: if a user is associated with the expense report, then that user will get an associated credit line ($tabtp) generated.
* allow grouping tax with actual cost for accounting
Provides the ability for taxes paid in expense reports (ER_JOURNAL_GROUP_TAX_WITH_LINES) or purchases (AC_JOURNAL_GROUP_TAX_WITH_LINES) to get grouped with the main expense/purchase line and associated with the accounting account for the item itself. This is in contrast to the default behavior designed around VAT which splits off any taxes paid into a separate accounting account for each type of tax.
* fixed out of date reference
fixed merge error
* fixed linting issues
whitespace around braces and if/else keywords
* Update bankjournal.php
---------
Co-authored-by: Laurent Destailleur <eldy@destailleur.fr>
* Qual: Fix FunctionArray phan notices
* Fix class name in typing of htdocs/modulebuilder/index.php
* Fix customreports phpdoc
* Adjust file type after completeFileArrayWithDatabaseInfo
* Further phpdoc typing improvements
* More phpdoc
* Improve typing with cast on position field
* Force phpstan version
* Add phpstan exception
* Fix array index type + adjust phan config comment
* NEW Accountancy - Add general account on thirdparty - SQL Part
* NEW Accountancy - Add general account on thirdparty - Code customer part
* NEW Accountancy - Add general account on thirdparty - Code customer part
* NEW Accountancy - Add general account on thirdparty - Code customer part
* Fix Phan
* Use isModEnabled
* NEW Accountancy - Add general account on thirdparty - Code supplier part
* Fix phan
* Fix phan
* Fix phan
* Use list of account instead of simple input
* Use list of account instead of simple input
* Tabs
* NEW Accountancy - Add general account on thirdparty - Code user part
* NEW Accountancy - Add general account on thirdparty - Code user part
* Fix indent
* Fix indent
* Remove duplicate language key
* Fix phan
* Fix phan
* Update card.php
* Fix accountancy export CSV
---------
Co-authored-by: Laurent Destailleur <eldy@destailleur.fr>