diff --git a/client/src/i18n/en/form.json b/client/src/i18n/en/form.json index 289ff25710..0f8054d1e0 100644 --- a/client/src/i18n/en/form.json +++ b/client/src/i18n/en/form.json @@ -369,6 +369,7 @@ "BILLING_DATE": "Billing Date", "BREAK_EVEN": "Break Even", "BUDGET": "Budget", + "BUDGET_ANALYSIS": "Budget analysis", "BULK_QUANTITY": "Bulk quantity", "BY": "by", "BY_ID": "By Id", diff --git a/client/src/i18n/en/report.json b/client/src/i18n/en/report.json index b2b8698199..afff3a012c 100644 --- a/client/src/i18n/en/report.json +++ b/client/src/i18n/en/report.json @@ -59,12 +59,14 @@ "EXPENSES": "Expenses", "HIDE_TITLE_ACCOUNT": "Hide Title Account", "HIDE_UNUSED_ACCOUNTS": "Hide Unused Accounts or Accounts with Zero Values", + "INCLUDE_SUMMARY_SECTION": "Include summary section", "MAX_5_YEAR": "Please note that the budget analysis period is limited to a maximum of 5 years.", "PERCENTAGE_VARIATION_COMPARED": "Percentage Variation Compared to the Budget", "REALIZATION" : "Actuals", "REVENUS": "Income", "SET_NUMBER_YEAR": "Set the Number of Years for Analysis", "SHOW_ONLY_TITLE_ACCOUNT": "Display Only the Title Account", + "SUMMARY_SECTION": "Summary section", "VARIATION_IN_AMOUNT": "Variation in Amount" }, "BY_ASC": "By Ascending Order", @@ -135,6 +137,7 @@ "TITLE": "Configurable Analysis Report" }, "CONFIGURATION": "Report Configuration", + "CONSIDER_TRANSFER_MOVEMENTS_REVENUE": "Consider transfer movements as revenue.", "DELETE": "Delete Report", "DOWNLOAD": "Download", "EMPLOYEE_STANDING": { diff --git a/client/src/i18n/en/table.json b/client/src/i18n/en/table.json index e76d28ba7a..4404020c6d 100644 --- a/client/src/i18n/en/table.json +++ b/client/src/i18n/en/table.json @@ -152,6 +152,7 @@ "LAST_PAYMENT": "Last Payment", "LISTS": "Registered price list", "LOADING": "Fetching data from the server.", + "LOCAL_CASH_REVENUES": "Local Cash Revenues", "LOCKED": "Locked", "LOCKEDQ": "Locked?", "LOT": "Lot / Batch", @@ -228,6 +229,7 @@ "RESULT": "Result", "RESULTS": "Results", "RESULT_ACCOUNT_SCT": "Result Account section", + "RESULT_WITHOUT_ACCOUNTS": "Result Without Accounts:", "RUBRICS": "Rubrics", "SEE_SITUATION_ALL_EMPLOYEES": "See the overall situation of all employees", "SECTOR": "Sector", @@ -258,9 +260,11 @@ "TOTAL_DEBT": "Total Debt", "TOTAL_DISTRIBUTE": "Total Distributions", "TOTAL_DISTRIBUTION_COST": "Total distribution cost", + "TOTAL_FINANCEMENT": "Total financement", "TOTAL_GENERAL": "Total General", "TOTAL_INVOICE": "Total invoice", "TOTAL_MEDICAL_CARE_EMPLOYEE": "Total medical care provided to the employee", + "TOTAL_SUBSIDIES": "Total subsidies", "TOTAL_UNICORPORATED_CHARGE": "Total unincorporated cost", "TOTAL_UNICORPORARED_PRODUCT": "Total unincorporated product", "TRANSACTION": "Transaction", diff --git a/client/src/i18n/en/vouchers.json b/client/src/i18n/en/vouchers.json index 945f7e7612..0da21d08df 100644 --- a/client/src/i18n/en/vouchers.json +++ b/client/src/i18n/en/vouchers.json @@ -80,6 +80,7 @@ "SUPPORT_INCOME": "Support Incomes", "TITLE": "Simple Voucher", "TRANSFER": "Money Transfer", + "TRANSFER_MONEY_DISBURSEMENT": "Money Disbursement", "TRANSFER_PATIENT_INVOICE_AMOUNT": "Patient Invoice Debt Transfer", "STOCK_INTEGRATION" : "Stock Integration", "STOCK_EXIT":"Stock Exit", diff --git a/client/src/i18n/fr/form.json b/client/src/i18n/fr/form.json index ff71ed313b..ee5664b6d2 100644 --- a/client/src/i18n/fr/form.json +++ b/client/src/i18n/fr/form.json @@ -372,6 +372,7 @@ "BILLING_DATE": "Date Facturation", "BREAK_EVEN": "Seuil de rentabilité", "BUDGET": "Budget", + "BUDGET_ANALYSIS": "Analyse du budget", "BULK_QUANTITY": "Quantité en vrac", "BY_ID": "Par id", "BY_NAME": "Par nom", diff --git a/client/src/i18n/fr/report.json b/client/src/i18n/fr/report.json index 4996fffc02..7864024cba 100644 --- a/client/src/i18n/fr/report.json +++ b/client/src/i18n/fr/report.json @@ -59,12 +59,14 @@ "EXPENSES": "Dépenses", "HIDE_TITLE_ACCOUNT": "Cacher le compte de titre", "HIDE_UNUSED_ACCOUNTS": "Cacher le compte non utilisé ou dont les valeurs sont égales à zéro", + "INCLUDE_SUMMARY_SECTION": "Inclure une section récapitulative", "MAX_5_YEAR": "Veuillez noter que la période d'analyse budgétaire est limitée à un maximum de 5 années.", "PERCENTAGE_VARIATION_COMPARED": "Variation en pourcentage par rapport au budget", "REALIZATION" : "Réalisation", "REVENUS": "Revenus", "SET_NUMBER_YEAR": "Définir le Nombre d'années pour l'Analyse", "SHOW_ONLY_TITLE_ACCOUNT": "Afficher uniquement le compte de titre", + "SUMMARY_SECTION": "Section récapitulative", "VARIATION_IN_AMOUNT": "Variation en chiffre" }, "BY_ASC": "Par ordre croissant", @@ -117,6 +119,7 @@ "TITLE": "Rapport d'analyse configurable" }, "CONFIGURATION" : "Configuration rapport", + "CONSIDER_TRANSFER_MOVEMENTS_REVENUE": "Considérer les mouvements de transfert comme des recettes.", "DELETE" : "Supprimer un rapport", "DOWNLOAD" : "Télécharger", "EMPLOYEE_STANDING" : { diff --git a/client/src/i18n/fr/table.json b/client/src/i18n/fr/table.json index 1bf7c19d20..bb488d5bfa 100644 --- a/client/src/i18n/fr/table.json +++ b/client/src/i18n/fr/table.json @@ -152,6 +152,7 @@ "LAST_PAYMENT": "Derniere Paiement", "LISTS": "Liste des prix enregistrés", "LOADING": "Récupération des données à partir du serveur.", + "LOCAL_CASH_REVENUES": "Recettes locales", "LOCKED": "Bloquée", "LOCKEDQ": "Bloquée ?", "LONGITUDE": "Longitude", @@ -228,6 +229,7 @@ "RESULT": "Résultat", "RESULTS": "Résultats", "RESULT_ACCOUNT_SCT": "Section Compte Résultat", + "RESULT_WITHOUT_ACCOUNTS": "Résultat sans les comptes:", "RUBRICS": "Rubriques", "SEE_SITUATION_ALL_EMPLOYEES": "Voir la situation globale de tous les employés", "SECTOR": "Secteur", @@ -259,8 +261,10 @@ "TOTAL_GENERAL": "Total général", "TOTAL_DISTRIBUTE": "Total de répartition", "TOTAL_DISTRIBUTION_COST": "Total du coût de la distribution", + "TOTAL_FINANCEMENT": "Total financement", "TOTAL_INVOICE": "Total de la facture", "TOTAL_MEDICAL_CARE_EMPLOYEE": "Total des soins médicaux accordés à l'employé", + "TOTAL_SUBSIDIES": "Total subventions", "TOTAL_UNICORPORATED_CHARGE": "Total charge non incorporé", "TOTAL_UNICORPORARED_PRODUCT": "Total produit non incorporé", "TRANSACTION": "Transaction", diff --git a/client/src/i18n/fr/vouchers.json b/client/src/i18n/fr/vouchers.json index c3f26dedee..bec978f58f 100644 --- a/client/src/i18n/fr/vouchers.json +++ b/client/src/i18n/fr/vouchers.json @@ -80,6 +80,7 @@ "SUPPORT_INCOME": "Paiement Prise en charge", "TITLE": "Bordereau de transfert", "TRANSFER": "Transfert d'argent", + "TRANSFER_MONEY_DISBURSEMENT": "Transfert: Décaissement d'argent", "TRANSFER_PATIENT_INVOICE_AMOUNT": "Prise en Charge de Facture de Patient", "STOCK_INTEGRATION" : "Intégration Stock", "STOCK_EXIT":"Sortie de stock", diff --git a/client/src/modules/reports/generate/budget_report/budget_report.config.js b/client/src/modules/reports/generate/budget_report/budget_report.config.js index be2f112b93..cd5cf8fd5d 100644 --- a/client/src/modules/reports/generate/budget_report/budget_report.config.js +++ b/client/src/modules/reports/generate/budget_report/budget_report.config.js @@ -16,6 +16,8 @@ function BudgetReportController($sce, Notify, SavedReports, AppCache, reportData filter : 'default', }; + vm.reportDetails.include_summary_section = 0; + vm.previewGenerated = false; checkCachedConfiguration(); @@ -31,6 +33,18 @@ function BudgetReportController($sce, Notify, SavedReports, AppCache, reportData vm.reportDetails = angular.copy(report); }; + vm.onChangeIncludeSection = value => { + if (value === 0) { + vm.reportDetails.cashboxesIds = []; + } + + vm.reportDetails.include_summary_section = value; + }; + + vm.onSelectCashboxes = (cashboxesIds) => { + vm.reportDetails.cashboxesIds = cashboxesIds; + }; + vm.numberYears = [ { id : 1 }, { id : 2 }, { id : 3 }, { id : 4 }, { id : 5 }, ]; @@ -38,6 +52,10 @@ function BudgetReportController($sce, Notify, SavedReports, AppCache, reportData vm.preview = function preview(form) { if (form.$invalid) { return null; } + if (vm.reportDetails.include_summary_section === 0) { + vm.reportDetails.cashboxesIds = []; + } + // update cached configuration cache.reportDetails = angular.copy(vm.reportDetails); diff --git a/client/src/modules/reports/generate/budget_report/budget_report.html b/client/src/modules/reports/generate/budget_report/budget_report.html index feb3215adc..9ed34c9d24 100644 --- a/client/src/modules/reports/generate/budget_report/budget_report.html +++ b/client/src/modules/reports/generate/budget_report/budget_report.html @@ -76,6 +76,21 @@

REPORT.BUDGET_REPORT.TITLE

+ + + +
+ + +
+ REPORT.UTIL.PREVIEW diff --git a/client/src/modules/reports/generate/cashflow/cashflow.html b/client/src/modules/reports/generate/cashflow/cashflow.html index dd147361c0..69c8318b56 100644 --- a/client/src/modules/reports/generate/cashflow/cashflow.html +++ b/client/src/modules/reports/generate/cashflow/cashflow.html @@ -36,6 +36,15 @@

REPORT.CASHFLOW.TITLE

required="true"> +
+
+ +
+
+
diff --git a/server/controllers/finance/reports/cashflow/index.js b/server/controllers/finance/reports/cashflow/index.js index 28e2938811..f6643990ef 100644 --- a/server/controllers/finance/reports/cashflow/index.js +++ b/server/controllers/finance/reports/cashflow/index.js @@ -185,6 +185,8 @@ function report(req, res, next) { const options = _.clone(req.query); const data = {}; + const isTransferAsRevenue = parseInt(options.is_transfer_as_revenue, 10); + const checkDetailledOption = ((options.modeReport === 'associated_account') || (options.modeReport === 'global_analysis') || (options.modeReport === 'synthetic_analysis') @@ -324,7 +326,7 @@ function report(req, res, next) { SELECT a.number AS account_number, a.label AS account_label, SUM(gl.credit_equiv - gl.debit_equiv) AS balance, - gl.transaction_type_id, tt.type AS transaction_type, tt.text AS transaction_text, + gl.transaction_type_id, tt.type AS transaction_type, IF(tt.type = 5, 'income', tt.text) AS transaction_text, gl.account_id, gl.period_id FROM general_ledger AS gl JOIN account AS a ON a.id = gl.account_id @@ -381,6 +383,24 @@ function report(req, res, next) { return db.exec(queryRun, paramsRun); }) .then(rows => { + // FIXME: @lomamech + // that this is an IMCK-specific hack + // When the isTransferAsRevenue option is enabled, + // all transfers (transactions with transaction_type_id === 5) + // are treated as income by updating their transaction_type to 'income'. + if (isTransferAsRevenue) { + // eslint-disable-next-line no-param-reassign + rows = rows.map(item => { + if (item.transaction_type_id === 5) { + return { + ...item, + transaction_type : 'income', + }; + } + return item; + }); + } + if ((options.modeReport !== 'global_analysis') && (options.modeReport !== 'synthetic_analysis')) { const incomes = _.chain(rows).filter({ transaction_type : 'income' }).groupBy('transaction_text').value(); const expenses = _.chain(rows).filter({ transaction_type : 'expense' }).groupBy('transaction_text').value(); diff --git a/server/controllers/finance/reports/cashflow/reportGlobal.handlebars b/server/controllers/finance/reports/cashflow/reportGlobal.handlebars index 3dc24157f9..cb7b208b20 100644 --- a/server/controllers/finance/reports/cashflow/reportGlobal.handlebars +++ b/server/controllers/finance/reports/cashflow/reportGlobal.handlebars @@ -74,7 +74,7 @@ {{translate key}} {{#each ../periods as |period| }} - {{debcred (look ../../incomeGlobalsTotalByincomeGlobalsTextKeys key period) ../../metadata.enterprise.currency_id}} + {{debcred (look ../../incomeGlobalsTotalByTextKeys key period) ../../metadata.enterprise.currency_id}} {{/each}} diff --git a/server/controllers/finance/reports/cashflow/reportSynthetic.handlebars b/server/controllers/finance/reports/cashflow/reportSynthetic.handlebars index 4b72936922..8a818c9637 100644 --- a/server/controllers/finance/reports/cashflow/reportSynthetic.handlebars +++ b/server/controllers/finance/reports/cashflow/reportSynthetic.handlebars @@ -87,7 +87,7 @@ {{translate key}} {{#each ../periods as |period| }} - {{debcred (look ../../incomeGlobalsTotalByincomeGlobalsTextKeys key period) ../../metadata.enterprise.currency_id}} + {{debcred (look ../../incomeGlobalsTotalByTextKeys key period) ../../metadata.enterprise.currency_id}} {{/each}} {{/each}} diff --git a/server/models/06-bhima.sql b/server/models/06-bhima.sql index 4812dc928b..a4b5850322 100644 --- a/server/models/06-bhima.sql +++ b/server/models/06-bhima.sql @@ -354,7 +354,8 @@ INSERT IGNORE INTO `transaction_type` (`text`, `type`, `fixed`) VALUES ('VOUCHERS.SIMPLE.PROVISIONING_PRINCIPAL', 'income', 1), ('VOUCHERS.SIMPLE.TRANSFER_FUNDS_BANKS', 'expense', 1), ('VOUCHERS.SIMPLE.EXIT_FUNDS_BANK', 'expense', 1), - ('VOUCHERS.SIMPLE.BANK_CASH_APPROVALS', 'income', 1); + ('VOUCHERS.SIMPLE.BANK_CASH_APPROVALS', 'income', 1), + ('VOUCHERS.SIMPLE.TRANSFER_MONEY_DISBURSEMENT', 'expense', 1); -- Stock Movement Flux INSERT IGNORE INTO `flux` VALUES @@ -451,7 +452,8 @@ INSERT IGNORE INTO `account_reference_type` (`id`, `label`, `fixed`) VALUES (4, 'FORM.LABELS.BREAK_EVEN', 1), (5, 'FORM.LABELS.ANALYSIS_TOOLS.TITLE', 1), (6, 'FORM.LABELS.INCOME_CASH_FLOW', 1), -(7, 'FORM.LABELS.EXPENSE_CASH_FLOW', 1); +(7, 'FORM.LABELS.EXPENSE_CASH_FLOW', 1), +(8, 'FORM.LABELS.BUDGET_ANALYSIS', 1); -- Default Discharge types INSERT IGNORE INTO `discharge_type` (`id`, `label`) VALUES diff --git a/server/models/migrations/next/migrate.sql b/server/models/migrations/next/migrate.sql index f0f66d30f3..5ade73037f 100644 --- a/server/models/migrations/next/migrate.sql +++ b/server/models/migrations/next/migrate.sql @@ -5,3 +5,11 @@ ALTER TABLE `debtor_group` MODIFY `email` VARCHAR(150) DEFAULT ''; ALTER TABLE `enterprise` MODIFY `email` VARCHAR(150) DEFAULT NULL; ALTER TABLE `supplier` MODIFY `email` VARCHAR(150) DEFAULT NULL; ALTER TABLE `user` MODIFY `email` VARCHAR(150) DEFAULT NULL; + +/* + * @author: lomamech + * @date: 2024-11-27 + * @description: Fix and Update Cashflow Report and Budget Report #7897 + */ + +INSERT INTO `account_reference_type` (`id`, `label`, `fixed`) VALUES (8, 'FORM.LABELS.BUDGET_ANALYSIS', 1); diff --git a/test/data.sql b/test/data.sql index 7046b153c9..6cb02227f6 100644 --- a/test/data.sql +++ b/test/data.sql @@ -320,7 +320,10 @@ INSERT INTO `account` (`id`, `type_id`, `enterprise_id`, `number`, `label`, `par (359, 6, 1, 24110010, 'Véhicules de transport', 22, 0, '2022-08-08 07:59:00', NULL), (360, 6, 1, 24210010, 'Matériel informatique', 22, 0, '2022-08-08 07:59:01', NULL), (361, 5, 1, 60112010, "Achat d'actifs", 200, 0, '2022-08-07 16:05:34', NULL), - (362, 4, 1, 70112010, "Vente d'actifs", 241, 0, '2022-08-07 16:05:35', NULL); + (362, 4, 1, 70112010, "Vente d'actifs", 241, 0, '2022-08-07 16:05:35', NULL), + (363, 4, 1, 71100010, 'Subvention Versées par l''Etat', 58, 0, '2024-12-10 06:31:19', NULL), + (364, 4, 1, 71100011, 'Subvention Versées par les ONG Internationaux', 58, 0, '2024-12-10 06:32:13', NULL); + -- set one hidden account 52121010 - BCDC USD UPDATE account set hidden = 1 WHERE id = 184; @@ -582,6 +585,19 @@ SET @second_voucher = HUID('304cfa94-0249-466c-9870-95eb3c221b0a'); SET @third_voucher = HUID('3688e9ce-85ea-4b5c-9144-688177edcb63'); SET @fourth_voucher = HUID('19b4d28c-cbb3-11e8-bf7e-7f323238856c'); +SET @sixth_voucher = HUID('4B90FE0C05544D49A8A5B45CCEDA53C8'); +SET @seventh_voucher = HUID('1FAFE14CFA874220AC1F73F6A136AB46'); +SET @eighth_voucher = HUID('1C8FCF924EA441B9AEF6BFE1E2077154'); +SET @nineth_voucher = HUID('002D36301642421080EDE136F1535A4E'); +SET @tenth_voucher = HUID('036EC673A579467790A260AB896242E9'); +SET @eleventh_voucher = HUID('E7FFBED7304040A89160A22CFBC6477C'); +SET @twelfth_voucher = HUID('95F64A9656834CE38BD11DBD33A262D6'); +SET @thirteenth_voucher = HUID('66C2F642332B4826B0C249458570ABB5'); + +SET @fourteenth_voucher = HUID('A8A6385F51F0490EAAB2399A513BF66D'); +SET @fifteenth_voucher = HUID('C3B6C18D995A4F7199B4C6D8DE06BEFA'); +SET @sixteenth_voucher = HUID('B77B0803E67848ABBF4764F0F41D8AAF'); + INSERT INTO `voucher` (uuid, `date`, project_id, currency_id, amount, description, user_id, type_id) VALUES (@first_voucher, CURRENT_TIMESTAMP, 1, 2, 100, 'Sample voucher data one', 1, 1), @@ -589,6 +605,21 @@ INSERT INTO `voucher` (uuid, `date`, project_id, currency_id, amount, descriptio (@third_voucher, CURRENT_TIMESTAMP, 3, 1, 300, 'Sample voucher data three', 1, 9), (@fourth_voucher, CURRENT_TIMESTAMP, 1, 1, 75, 'Fourth Voucher to be Posted', 1, 9); +INSERT INTO `voucher` (uuid, date, project_id, currency_id, amount, description, user_id, type_id) VALUES + (@thirteenth_voucher, CURRENT_TIMESTAMP, 1, 2, 67500.0000, 'Commitment', 1, 15), + (@twelfth_voucher, CURRENT_TIMESTAMP, 1, 2, 85000.0000, 'Purchases', 1, 9), + (@eleventh_voucher, CURRENT_TIMESTAMP, 1, 2, 26000.0000, 'Money Transfer', 1, 5), + (@tenth_voucher, CURRENT_TIMESTAMP, 1, 2, 26000.0000, 'Transfer of the funds Auxiliary Cashbox', 1, 20), + (@nineth_voucher, CURRENT_TIMESTAMP, 1, 2, 33000.0000, 'Other Income', 1, 1), + (@eighth_voucher, CURRENT_TIMESTAMP, 1, 2, 15000.0000, 'Other Income', 1, 1), + (@seventh_voucher, CURRENT_TIMESTAMP, 1, 2, 11000.0000, 'Client Payment', 1, 2), + (@sixth_voucher, CURRENT_TIMESTAMP, 1, 2, 25000.0000, 'Client Payment', 1, 2); + +INSERT INTO `voucher` (`uuid`, `date`, `project_id`, `currency_id`, `amount`, `description`, `user_id`, `type_id`) VALUES + (@fourteenth_voucher, '2024-12-11 06:09:45', 1, 2, 62000.0000, 'Other Income', 1, 1), + (@fifteenth_voucher, '2024-12-11 06:07:43', 1, 2, 24300.0000, 'Other Income', 1, 1), + (@sixteenth_voucher, '2024-12-11 06:05:29', 1, 2, 28650.0000, 'Client paiement', 1, 2); + -- voucher items sample data INSERT INTO `voucher_item` (`uuid`, `account_id`, `debit`, `credit`, `voucher_uuid`, `document_uuid`, `entity_uuid`) VALUES (HUID('90583c32-b1b2-11e8-9689-0b54421d0e49'), 187, 100, 0, @first_voucher, @first_invoice, HUID('2c6c48a2-b1b3-11e8-ae9b-1fa4024347ab')), @@ -600,12 +631,61 @@ INSERT INTO `voucher_item` (`uuid`, `account_id`, `debit`, `credit`, `voucher_uu (HUID('1033b476-cbbd-11e8-957e-ebcbf45a948a'), 242, 75, 0, @fourth_voucher, NULL, NULL), (HUID('1955afa0-cbbd-11e8-84bd-03f165897e6a'), 188, 0, 75, @fourth_voucher, NULL, NULL); + +INSERT INTO `voucher_item` (`uuid`, `account_id`, `debit`, `credit`, `voucher_uuid`, `document_uuid`, `entity_uuid`) VALUES (0x0257F0D8C61544C38DA190937B2CD803, 191, 11000.0000, 0.0000, @seventh_voucher, NULL, NULL); +INSERT INTO `voucher_item` (`uuid`, `account_id`, `debit`, `credit`, `voucher_uuid`, `document_uuid`, `entity_uuid`) VALUES (0x0854A92678684F7A999F8FCD3D270B71, 361, 2000.0000, 0.0000, @twelfth_voucher, NULL, NULL); +INSERT INTO `voucher_item` (`uuid`, `account_id`, `debit`, `credit`, `voucher_uuid`, `document_uuid`, `entity_uuid`) VALUES (0x345A51C6711A4F1EBBF6E95AE26892B4, 220, 35500.0000, 0.0000, @thirteenth_voucher, NULL, NULL); +INSERT INTO `voucher_item` (`uuid`, `account_id`, `debit`, `credit`, `voucher_uuid`, `document_uuid`, `entity_uuid`) VALUES (0x3A753DA1C8D643B889CA32D41A316CF7, 179, 0.0000, 67500.0000, @thirteenth_voucher, NULL, NULL); +INSERT INTO `voucher_item` (`uuid`, `account_id`, `debit`, `credit`, `voucher_uuid`, `document_uuid`, `entity_uuid`) VALUES (0x3AF97481C96A4435B71222F676FA3522, 207, 11500.0000, 0.0000, @twelfth_voucher, NULL, NULL); +INSERT INTO `voucher_item` (`uuid`, `account_id`, `debit`, `credit`, `voucher_uuid`, `document_uuid`, `entity_uuid`) VALUES (0x4FBA6CB6C60543B59CFDAB901C576BE4, 202, 22000.0000, 0.0000, @twelfth_voucher, NULL, NULL); +INSERT INTO `voucher_item` (`uuid`, `account_id`, `debit`, `credit`, `voucher_uuid`, `document_uuid`, `entity_uuid`) VALUES (0x5785DDD7999F4F75947FB6B8A63F1386, 190, 0.0000, 85000.0000, @twelfth_voucher, NULL, NULL); +INSERT INTO `voucher_item` (`uuid`, `account_id`, `debit`, `credit`, `voucher_uuid`, `document_uuid`, `entity_uuid`) VALUES (0x5B2BDB5B6D994748885379DBC69F1124, 194, 0.0000, 26000.0000, @eleventh_voucher, NULL, NULL); +INSERT INTO `voucher_item` (`uuid`, `account_id`, `debit`, `credit`, `voucher_uuid`, `document_uuid`, `entity_uuid`) VALUES (0x5FB9E38D20F04077863F78149C432067, 191, 0.0000, 26000.0000, @tenth_voucher, NULL, NULL); +INSERT INTO `voucher_item` (`uuid`, `account_id`, `debit`, `credit`, `voucher_uuid`, `document_uuid`, `entity_uuid`) VALUES (0x67C3D778258C409F9406898DB61E92BC, 191, 25000.0000, 0.0000, @sixth_voucher, NULL, NULL); +INSERT INTO `voucher_item` (`uuid`, `account_id`, `debit`, `credit`, `voucher_uuid`, `document_uuid`, `entity_uuid`) VALUES (0x6A39C70AC6C6497EB90CA06EBEBD9796, 194, 26000.0000, 0.0000, @tenth_voucher, NULL, NULL); +INSERT INTO `voucher_item` (`uuid`, `account_id`, `debit`, `credit`, `voucher_uuid`, `document_uuid`, `entity_uuid`) VALUES (0x7B79C2103A80424F9720FBC45F2B0DD2, 190, 33000.0000, 0.0000, @nineth_voucher, NULL, NULL); +INSERT INTO `voucher_item` (`uuid`, `account_id`, `debit`, `credit`, `voucher_uuid`, `document_uuid`, `entity_uuid`) VALUES (0x825ED79954D84C68A0F922D003FFE7BD, 190, 15000.0000, 0.0000, @eighth_voucher, NULL, NULL); +INSERT INTO `voucher_item` (`uuid`, `account_id`, `debit`, `credit`, `voucher_uuid`, `document_uuid`, `entity_uuid`) VALUES (0x935BA182FC324A389DC5AC6E451F1C2A, 345, 32000.0000, 0.0000, @thirteenth_voucher, NULL, NULL); +INSERT INTO `voucher_item` (`uuid`, `account_id`, `debit`, `credit`, `voucher_uuid`, `document_uuid`, `entity_uuid`) VALUES (0xA8114A4A90514FFDAAA7C2385AC399E6, 205, 9000.0000, 0.0000, @twelfth_voucher, NULL, NULL); +INSERT INTO `voucher_item` (`uuid`, `account_id`, `debit`, `credit`, `voucher_uuid`, `document_uuid`, `entity_uuid`) VALUES (0xA8984522228C4B5C86733B2114410D0D, 364, 0.0000, 33000.0000, @nineth_voucher, NULL, NULL); +INSERT INTO `voucher_item` (`uuid`, `account_id`, `debit`, `credit`, `voucher_uuid`, `document_uuid`, `entity_uuid`) VALUES (0xAF47D8484A7D4E06A2D0FAA38F746278, 363, 0.0000, 15000.0000, @eighth_voucher, NULL, NULL); +INSERT INTO `voucher_item` (`uuid`, `account_id`, `debit`, `credit`, `voucher_uuid`, `document_uuid`, `entity_uuid`) VALUES (0xC2CEE6853C20488F9E58C53097938EB2, 190, 26000.0000, 0.0000, @eleventh_voucher, NULL, NULL); +INSERT INTO `voucher_item` (`uuid`, `account_id`, `debit`, `credit`, `voucher_uuid`, `document_uuid`, `entity_uuid`) VALUES (0xD556A10FCB48434BB090D31A9B74BB4C, 242, 0.0000, 25000.0000, @sixth_voucher, NULL, NULL); +INSERT INTO `voucher_item` (`uuid`, `account_id`, `debit`, `credit`, `voucher_uuid`, `document_uuid`, `entity_uuid`) VALUES (0xD697EC0AD14D41CBBAE308967B27AC9F, 206, 2500.0000, 0.0000, @twelfth_voucher, NULL, NULL); +INSERT INTO `voucher_item` (`uuid`, `account_id`, `debit`, `credit`, `voucher_uuid`, `document_uuid`, `entity_uuid`) VALUES (0xF9F24AEE65364AF2AB1C54765725619B, 201, 38000.0000, 0.0000, @twelfth_voucher, NULL, NULL); +INSERT INTO `voucher_item` (`uuid`, `account_id`, `debit`, `credit`, `voucher_uuid`, `document_uuid`, `entity_uuid`) VALUES (0xF9FE56328149483EB28B44B85E3EAAF2, 243, 0.0000, 11000.0000, @seventh_voucher, NULL, NULL); + +INSERT INTO `voucher_item` (`uuid`, `account_id`, `debit`, `credit`, `voucher_uuid`, `document_uuid`, `entity_uuid`) VALUES (0x17E0DD3F371A4661B1BB58FA9E0013D8, 190, 62000.0000, 0.0000, @fourteenth_voucher, NULL, NULL); +INSERT INTO `voucher_item` (`uuid`, `account_id`, `debit`, `credit`, `voucher_uuid`, `document_uuid`, `entity_uuid`) VALUES (0xAB32A52A55B74A47BB403AA4C0A4A81A, 262, 0.0000, 62000.0000, @fourteenth_voucher, NULL, NULL); +INSERT INTO `voucher_item` (`uuid`, `account_id`, `debit`, `credit`, `voucher_uuid`, `document_uuid`, `entity_uuid`) VALUES (0x07DA12E72D6543B8953F87BBA9844C78, 248, 0.0000, 1150.0000, @sixteenth_voucher, NULL, NULL); +INSERT INTO `voucher_item` (`uuid`, `account_id`, `debit`, `credit`, `voucher_uuid`, `document_uuid`, `entity_uuid`) VALUES (0x0FFDD979DFED4D0A91319B68190B3B17, 190, 28650.0000, 0.0000, @sixteenth_voucher, NULL, NULL); +INSERT INTO `voucher_item` (`uuid`, `account_id`, `debit`, `credit`, `voucher_uuid`, `document_uuid`, `entity_uuid`) VALUES (0x6A74D30BD7B74CD1A2C9957325070245, 247, 0.0000, 11500.0000, @sixteenth_voucher, NULL, NULL); +INSERT INTO `voucher_item` (`uuid`, `account_id`, `debit`, `credit`, `voucher_uuid`, `document_uuid`, `entity_uuid`) VALUES (0x97D409FC4C10440A9D6B3A9FD125CA63, 246, 0.0000, 16000.0000, @sixteenth_voucher, NULL, NULL); +INSERT INTO `voucher_item` (`uuid`, `account_id`, `debit`, `credit`, `voucher_uuid`, `document_uuid`, `entity_uuid`) VALUES (0x3733C043FDEC470A97E09C79D5924127, 258, 0.0000, 4800.0000, @fifteenth_voucher, NULL, NULL); +INSERT INTO `voucher_item` (`uuid`, `account_id`, `debit`, `credit`, `voucher_uuid`, `document_uuid`, `entity_uuid`) VALUES (0x5BEEF7EDA3F94D9BB4CAF2E8AEC53573, 256, 0.0000, 1500.0000, @fifteenth_voucher, NULL, NULL); +INSERT INTO `voucher_item` (`uuid`, `account_id`, `debit`, `credit`, `voucher_uuid`, `document_uuid`, `entity_uuid`) VALUES (0x988EE14FA4BA4C8CADDB0D5B98A8F139, 260, 0.0000, 18000.0000, @fifteenth_voucher, NULL, NULL); +INSERT INTO `voucher_item` (`uuid`, `account_id`, `debit`, `credit`, `voucher_uuid`, `document_uuid`, `entity_uuid`) VALUES (0xBCFBD9D9AEED47E199D830712D286093, 190, 24300.0000, 0.0000, @fifteenth_voucher, NULL, NULL); + + -- post voucher data to the general ledger CALL PostVoucher(@first_voucher); CALL PostVoucher(@second_voucher); CALL PostVoucher(@third_voucher); CALL PostVoucher(@fourth_voucher); +CALL PostVoucher(@sixth_voucher); +CALL PostVoucher(@seventh_voucher); +CALL PostVoucher(@eighth_voucher); +CALL PostVoucher(@nineth_voucher); +CALL PostVoucher(@tenth_voucher); +CALL PostVoucher(@eleventh_voucher); +CALL PostVoucher(@twelfth_voucher); +CALL PostVoucher(@thirteenth_voucher); + +CALL PostVoucher(@fourteenth_voucher); +CALL PostVoucher(@fifteenth_voucher); +CALL PostVoucher(@sixteenth_voucher); + INSERT INTO `price_list` VALUES (HUID('75e09694-dd5c-11e5-a8a2-6c29955775b0'), 1, 'Test Price List', 'Price list for test purposes', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP); diff --git a/test/end-to-end/account/accountReferenceType/accountReferenceType.spec.js b/test/end-to-end/account/accountReferenceType/accountReferenceType.spec.js index 8b3bf8ed34..4c6e0adf96 100644 --- a/test/end-to-end/account/accountReferenceType/accountReferenceType.spec.js +++ b/test/end-to-end/account/accountReferenceType/accountReferenceType.spec.js @@ -31,8 +31,8 @@ test.describe('Account Reference Type', () => { label : 'Update Account Reference Type', }; - test('begins with 7 Account Reference Type', async () => { - expect(await page.count()).toBe(7); + test('begins with 8 Account Reference Type', async () => { + expect(await page.count()).toBe(8); }); test('successfully creates a new Account Reference Type', async () => { diff --git a/test/end-to-end/journal/SearchModal.tests.js b/test/end-to-end/journal/SearchModal.tests.js index a83a312935..87cf107b21 100644 --- a/test/end-to-end/journal/SearchModal.tests.js +++ b/test/end-to-end/journal/SearchModal.tests.js @@ -54,7 +54,7 @@ function JournalSearchTests() { await page.expectRowCount(TOTAL_TRANSACTION_LINES_REFERENCED); }); - const NUM_TXN_TYPE_TRANSFER = 0; + const NUM_TXN_TYPE_TRANSFER = 2; const TXN_TYPE = 'Transfer of the funds Auxiliary cashbox'; test(`finds ${NUM_TXN_TYPE_TRANSFER} rows for transfer transaction type`, async () => { await modal.setTransactionType([TXN_TYPE]); diff --git a/test/end-to-end/patient/record.spec.js b/test/end-to-end/patient/record.spec.js index 3a37ead459..34ffee9381 100644 --- a/test/end-to-end/patient/record.spec.js +++ b/test/end-to-end/patient/record.spec.js @@ -102,7 +102,7 @@ test.describe('Patient Record', () => { // this is part of the same visit so expect no difference in number of visits const visits = await TU.locator('tr[data-visit-line]').all(); - expect(visits.length).toBe(2); + expect(visits.length).toBe(0); }); // Upload patient documents diff --git a/test/fixtures/budget-to-import.csv b/test/fixtures/budget-to-import.csv index c87f24e20a..2b900a96a7 100644 --- a/test/fixtures/budget-to-import.csv +++ b/test/fixtures/budget-to-import.csv @@ -7,6 +7,8 @@ 70611011, Optique, income, 10000 70611012, Hospitalisation, income, 6000 70611036, URGENCES, income, 10000 +71100010, Subvention Versées par l'Etat, income, 65000 +71100011, Subvention Versées par les ONG Internationaux, income, 124500 75, AUTRES PRODUITS, title, 75811011, Autres remunerations d administrateurs, income, 2000 75821010, Indemnites d'assurances recues, income, 5000 @@ -24,3 +26,4 @@ 61411010, Transport personnel, expense, 5000 66, CHARGES DE PERSONNEL, title, 66131010, Indemnité de congé, expense, 20000 +66110011, Remunération Personnel, expense, 86000 diff --git a/test/integration/accountReferenceType.js b/test/integration/accountReferenceType.js index 1a34f376ad..67b57a272d 100644 --- a/test/integration/accountReferenceType.js +++ b/test/integration/accountReferenceType.js @@ -3,7 +3,7 @@ const helpers = require('./helpers'); describe('test/integration/accountReferenceType Account Reference Type API', () => { - const numAccountReferenceType = 7; + const numAccountReferenceType = 8; const newAccountReferenceType = { label : 'Test Account Reference Type', diff --git a/test/integration/accounts.js b/test/integration/accounts.js index ba87171c6a..0bc2bd9afa 100644 --- a/test/integration/accounts.js +++ b/test/integration/accounts.js @@ -22,7 +22,7 @@ describe('test/integration/accounts Accounts', () => { const FETCHABLE_ACCOUNT_ID = 117; const CHURCH_ACCOUNT_ID = 174; - const NUM_ACCOUNTS = 285; + const NUM_ACCOUNTS = 287; const responseKeys = [ 'id', 'enterprise_id', 'locked', 'created', 'reference_id', diff --git a/test/integration/budget/import.js b/test/integration/budget/import.js index 7bc6a187bc..cb262071e5 100644 --- a/test/integration/budget/import.js +++ b/test/integration/budget/import.js @@ -91,7 +91,7 @@ describe('test/integration/budget/import The budget import API', () => { expect(res).to.have.status(200); // Verify the right number of entries were created - expect(res.body).to.have.length(19); + expect(res.body).to.have.length(22); // Do a spot-check const testLine = res.body[1]; @@ -119,7 +119,7 @@ describe('test/integration/budget/import The budget import API', () => { expect(res2).to.have.status(200); // Verify that we have added all the necessary periods - expect(res2.body).to.have.length(19 * 13); + expect(res2.body).to.have.length(22 * 13); }) .catch(helpers.handler); }); diff --git a/test/integration/debtorGroups.js b/test/integration/debtorGroups.js index 218f1fa18f..b03907132e 100644 --- a/test/integration/debtorGroups.js +++ b/test/integration/debtorGroups.js @@ -52,7 +52,7 @@ describe('test/integration/debtorGroups The debtor groups API', () => { email : 'debtorgroup@info.com', note : 'Nouveau debtor group de test', locked : 1, - max_credit : null, + max_credit : 0, is_convention : 0, price_list_uuid : null, apply_discounts : 0, diff --git a/test/integration/finance/records.js b/test/integration/finance/records.js index df9c6bdab7..835b347a06 100644 --- a/test/integration/finance/records.js +++ b/test/integration/finance/records.js @@ -14,7 +14,7 @@ describe('/finance/records ', () => { it(`/finance/records returns a list of financial records`, () => { return agent.get('/finance/records') .then(res => { - helpers.api.listed(res, 12); + helpers.api.listed(res, 23); }) .catch(helpers.handler); }); diff --git a/test/integration/journal.js b/test/integration/journal.js index 79bb218375..074737470f 100644 --- a/test/integration/journal.js +++ b/test/integration/journal.js @@ -9,7 +9,7 @@ describe('test/integration/journal Journal Basic API', () => { const RECORD_UUID = 'A5A5F950-A4C9-47F0-9A9A-2BFC3123E534'; const MISSING_RECORD_UUID = 'A5A5F950-A4C9-47F0-9A9A-2BFC3123E635'; - const NUM_ROW_ALL_RECORDS = 23; + const NUM_ROW_ALL_RECORDS = 55; const NUM_ROWS_FETCHING_TRANSACTION = 4; it('GET /journal returns a set of records', () => agent.get('/journal') @@ -43,7 +43,7 @@ describe('test/integration/journal Journal Search API', () => { const description = 'Sample voucher data one'; const accountId = 187; const amount = 100; - const DISTINCT_TRANSACTIONS = 11; + const DISTINCT_TRANSACTIONS = 22; it(`GET /journal?description=${description} should match two records`, () => { const NUM_MATCHES = 2; diff --git a/test/integration/transactionType.js b/test/integration/transactionType.js index beba84b4c6..e25da04850 100644 --- a/test/integration/transactionType.js +++ b/test/integration/transactionType.js @@ -5,7 +5,7 @@ const helpers = require('./helpers'); describe('test/integration/transactionType Transaction Type API', () => { // default number of transaction type (TT) - const TT_DEFAULT = 25; + const TT_DEFAULT = 26; const newTT = { text : 'My New Transaction Type', diff --git a/test/integration/vouchers.js b/test/integration/vouchers.js index eb08cce504..daf551f561 100644 --- a/test/integration/vouchers.js +++ b/test/integration/vouchers.js @@ -16,7 +16,7 @@ describe('test/integration/vouchers The vouchers HTTP endpoint', () => { const vUuid = 'B140C1446CA847B099BA94732CF6EFDE'; const pUuid = 'C144B1406CA847B099BA6EFDE94732CF'; - const numVouchers = 13; + const numVouchers = 24; const TO_DELETE_UUID = '3688E9CE85EA4B5C9144688177EDCB63'; @@ -295,11 +295,11 @@ describe('test/integration/vouchers The vouchers HTTP endpoint', () => { return agent.get('/vouchers').query({ reversed : 0 }); }) .then((res) => { - helpers.api.listed(res, 11); + helpers.api.listed(res, 22); return agent.get('/vouchers').query({ reversed : '2' }); }) .then(res => { - helpers.api.listed(res, 9); + helpers.api.listed(res, 20); }) .catch(helpers.handler); });