diff --git a/client/src/assets/IMAicon.jpg b/client/src/assets/IMAicon.jpg
index 504829854d..7187adcfcd 100644
Binary files a/client/src/assets/IMAicon.jpg and b/client/src/assets/IMAicon.jpg differ
diff --git a/client/src/assets/favicon.ico b/client/src/assets/favicon.ico
index e8f2ad5f26..1e6ffb5c2d 100644
Binary files a/client/src/assets/favicon.ico and b/client/src/assets/favicon.ico differ
diff --git a/client/src/assets/icon.png b/client/src/assets/icon.png
index 031cf01a28..dc49e63e1a 100644
Binary files a/client/src/assets/icon.png and b/client/src/assets/icon.png differ
diff --git a/client/src/i18n/en/enterprise.json b/client/src/i18n/en/enterprise.json
index 8fe473644a..65ec6ee299 100644
--- a/client/src/i18n/en/enterprise.json
+++ b/client/src/i18n/en/enterprise.json
@@ -25,6 +25,8 @@
"ENABLE_BARCODES_HELP_TEXT" : "Enable to place barcodes on most printed records and enable options to scan barcodes for document inputs.",
"ENABLE_AUTO_EMAIL_REPORT_LABEL" : "Enable sending automatic reports by email",
"ENABLE_AUTO_EMAIL_REPORT_HELP_TEXT" : "Enabling this option allows users to configure schedules to automatically send reports to a list of email addresses.",
+ "ENABLE_REQUIRE_COST_CENTER_FOR_POSTING" : "Enable cost centers requirement for posting to general ledger",
+ "ENABLE_REQUIRE_COST_CENTER_FOR_POSTING_HELP_TEXT" : "Require cost centers for operating accounts (6 and 7) before posting entries in the general ledger",
"ENABLE_INDEX_PAYMENT_SYSTEM" : "Enabling index payment system",
"HELPDESK_TEXT" : "Helpdesk Contact Information",
"HELPDESK_TEXT_HELP" : "If provided, show this information about how to contact the help desk on the bottom of the login page"
diff --git a/client/src/i18n/fr/enterprise.json b/client/src/i18n/fr/enterprise.json
index 8814a9d988..5f01073fb8 100644
--- a/client/src/i18n/fr/enterprise.json
+++ b/client/src/i18n/fr/enterprise.json
@@ -25,6 +25,8 @@
"ENABLE_BARCODES_HELP_TEXT" : "L'activation de cette fonction placera des codes à barres sur la plupart des enregistrements imprimés et activera les options permettant de numériser des codes à barres pour les entrées de document.",
"ENABLE_AUTO_EMAIL_REPORT_LABEL" : "Activer l'envoie des rapports automatiques par email",
"ENABLE_AUTO_EMAIL_REPORT_HELP_TEXT" : "L'activation de cette option permet aux utilisateurs de configurer des planifications pour envoyer automatiquement des rapports à une liste d'adresses électroniques.",
+ "ENABLE_REQUIRE_COST_CENTER_FOR_POSTING" : "Activer l'exigence des centres de cout pour le postage dans le grand livre",
+ "ENABLE_REQUIRE_COST_CENTER_FOR_POSTING_HELP_TEXT" : "Exiger les centres de cout pour les comptes d'exploitation (6 et 7) avant de poster les ecritures dans le grand livre",
"ENABLE_INDEX_PAYMENT_SYSTEM" : "Activer le systeme de payement par indice",
"HELPDESK_TEXT" : "Coordonnées du service d'assistance",
"HELPDESK_TEXT_HELP" : "Si défini, affichez ces informations sur la façon de contacter le service d'assistance en bas de la page de connexion"
diff --git a/client/src/modules/enterprises/enterprises.html b/client/src/modules/enterprises/enterprises.html
index cc172e119f..bd0eb56366 100644
--- a/client/src/modules/enterprises/enterprises.html
+++ b/client/src/modules/enterprises/enterprises.html
@@ -283,6 +283,14 @@
help-text="ENTERPRISE.SETTINGS.ENABLE_AUTO_EMAIL_REPORT_HELP_TEXT"
on-change-callback="EnterpriseCtrl.enableAutoEmailReportSetting(value)">
+
+
+
diff --git a/client/src/modules/enterprises/enterprises.js b/client/src/modules/enterprises/enterprises.js
index 79919a09d8..e69b05853d 100644
--- a/client/src/modules/enterprises/enterprises.js
+++ b/client/src/modules/enterprises/enterprises.js
@@ -223,6 +223,7 @@ function EnterpriseController(Enterprises, util, Notify, Projects, Modal, Scroll
vm.enableBalanceOnInvoiceReceipSetting = proxy('enable_balance_on_invoice_receipt');
vm.enableBarcodesSetting = proxy('enable_barcodes');
vm.enableAutoEmailReportSetting = proxy('enable_auto_email_report');
+ vm.enableRequireCostCenterForPostingSetting = proxy('enable_require_cost_center_for_posting');
startup();
}
diff --git a/client/src/modules/journal/trial-balance/errors.js b/client/src/modules/journal/trial-balance/errors.js
index bfaeefff0f..3d2d8c5de3 100644
--- a/client/src/modules/journal/trial-balance/errors.js
+++ b/client/src/modules/journal/trial-balance/errors.js
@@ -18,11 +18,6 @@ function TrialBalanceErrorsController(TrialBalance, Notify, $state) {
// FIXME(@jniles): why doesn't ui-sref work here?
vm.goToOverviewView = () => $state.go('TrialBalanceOverview');
- // links the errors to the posting journal via their record uuid
- const link = `
-
-
`;
-
const columns = [{
field : 'code',
displayName : 'TABLE.COLUMNS.ERROR_TYPE',
@@ -37,7 +32,6 @@ function TrialBalanceErrorsController(TrialBalance, Notify, $state) {
headerCellClass : 'ui-grid-header-cell-error',
}];
-
vm.gridOptions = {
appScopeProvider : vm,
enableColumnMenus : false,
diff --git a/server/controllers/admin/enterprises.js b/server/controllers/admin/enterprises.js
index 2f56afdc3b..f5620c3a80 100644
--- a/server/controllers/admin/enterprises.js
+++ b/server/controllers/admin/enterprises.js
@@ -26,7 +26,7 @@ exports.list = function list(req, res, next) {
gain_account_id, loss_account_id, enable_price_lock, enable_prepayments,
enable_password_validation, enable_balance_on_invoice_receipt, enable_barcodes,
enable_auto_email_report, enable_index_payment_system, base_index_growth_rate,
- posting_payroll_cost_center_mode
+ posting_payroll_cost_center_mode, enable_require_cost_center_for_posting
FROM enterprise LEFT JOIN enterprise_setting
ON enterprise.id = enterprise_setting.enterprise_id
;`;
@@ -51,6 +51,7 @@ exports.list = function list(req, res, next) {
'enable_index_payment_system',
'base_index_growth_rate',
'posting_payroll_cost_center_mode',
+ 'enable_require_cost_center_for_posting',
];
row.settings = _.pick(row, settings);
diff --git a/server/controllers/auth.js b/server/controllers/auth.js
index 49e211d38f..8af8b448e4 100644
--- a/server/controllers/auth.js
+++ b/server/controllers/auth.js
@@ -5,7 +5,6 @@
* This controller is responsible for managing user authentication and
* authorization to the entire application stack.
*
- * @requires q
* @requires lodash
* @requires debug
* @requires lib/db
@@ -13,7 +12,6 @@
*/
const _ = require('lodash');
-const q = require('q');
const debug = require('debug')('app');
const db = require('../lib/db');
const Unauthorized = require('../lib/errors/Unauthorized');
diff --git a/server/models/migrations/next/migrate.sql b/server/models/migrations/next/migrate.sql
index 9c7d188840..15fd3e91fd 100644
--- a/server/models/migrations/next/migrate.sql
+++ b/server/models/migrations/next/migrate.sql
@@ -1,3 +1,9 @@
/*
- * Migration file from v1.21.1
- */
\ No newline at end of file
+ * Migration file from v1.21.4
+ */
+
+ /*
+ * @author: mbayopanda
+ * @date: 2021-12-04
+ */
+CALL add_column_if_missing('enterprise_setting', 'enable_require_cost_center_for_posting', 'TINYINT(1) NOT NULL DEFAULT 0 AFTER `posting_payroll_cost_center_mode`');
diff --git a/server/models/procedures/trial_balance.sql b/server/models/procedures/trial_balance.sql
index e2f7c23747..c8c3d6670e 100644
--- a/server/models/procedures/trial_balance.sql
+++ b/server/models/procedures/trial_balance.sql
@@ -126,6 +126,9 @@ BEGIN
FROM posting_journal AS pj
JOIN stage_trial_balance_transaction AS temp ON pj.record_uuid = temp.record_uuid
JOIN account a ON pj.account_id = a.id
+ JOIN project proj ON proj.id = pj.project_id
+ JOIN enterprise e ON e.id = proj.enterprise_id
+ JOIN enterprise_setting es ON es.enterprise_id = e.id AND es.enable_require_cost_center_for_posting = 1
WHERE a.type_id IN (income_account_id, expense_account_id) AND pj.cost_center_id IS NULL
GROUP BY pj.record_uuid;
@@ -135,6 +138,9 @@ BEGIN
FROM posting_journal AS pj
JOIN stage_trial_balance_transaction AS temp ON pj.record_uuid = temp.record_uuid
JOIN account a ON pj.account_id = a.id
+ JOIN project proj ON proj.id = pj.project_id
+ JOIN enterprise e ON e.id = proj.enterprise_id
+ JOIN enterprise_setting es ON es.enterprise_id = e.id AND es.enable_require_cost_center_for_posting = 1
WHERE a.type_id NOT IN (income_account_id, expense_account_id) AND pj.cost_center_id IS NOT NULL
GROUP BY pj.record_uuid;
diff --git a/server/models/schema.sql b/server/models/schema.sql
index 4f208e5d7d..09ed95c10b 100644
--- a/server/models/schema.sql
+++ b/server/models/schema.sql
@@ -591,6 +591,7 @@ CREATE TABLE `enterprise_setting` (
`enable_index_payment_system` TINYINT(1) NOT NULL DEFAULT 0,
`base_index_growth_rate` TINYINT(3) UNSIGNED NOT NULL DEFAULT 0,
`posting_payroll_cost_center_mode` VARCHAR(100) NOT NULL DEFAULT 'default', -- With this function, transactions related to employee payment are done in bulk and require that each expense account be linked to a cost center
+ `enable_require_cost_center_for_posting` TINYINT(1) NOT NULL DEFAULT 0,
PRIMARY KEY (`enterprise_id`),
CONSTRAINT `enterprise_setting__enterprise` FOREIGN KEY (`enterprise_id`) REFERENCES `enterprise` (`id`)
) ENGINE=InnoDB DEFAULT CHARACTER SET = utf8mb4 DEFAULT COLLATE = utf8mb4_unicode_ci;