Skip to content

Commit

Permalink
Merge pull request #7678 from lomamech/debtor_group_insolvent_solvent
Browse files Browse the repository at this point in the history
feat(debtors): add option to filter client reports by solvency
  • Loading branch information
jmcameron authored Aug 31, 2024
2 parents fd3b7e2 + 3435703 commit f85419c
Show file tree
Hide file tree
Showing 18 changed files with 420 additions and 32 deletions.
14 changes: 10 additions & 4 deletions client/src/i18n/en/debtor_group.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,17 @@
"NEW_DEBTOR_GROUP": "New Debtor Group",
"NO_GROUPS" : "No debtor groups found",
"POLICIES": {
"CONVENTIONED": "Conventioned",
"INSOLVENT": "Insolvent",
"NOT_ASSIMILATED_CLIENT": "Not assimilated to client",
"SOLVENT": "Solvent",
"TITLE": "Group Policies",
"SUBSIDIES": {
"TITLE": "Subsidies",
"EMPTY": "This debtor group is not subscribed to any subsidies",
"INFO": "With this configuration unchecked no member of this debtor group will qualify for any subsidies",
"LABEL": "This group qualifies for subsidies",
"UPDATE": "Update Subsidies",
"EMPTY": "This debtor group is not subscribed to any subsidies"
"TITLE": "Subsidies",
"UPDATE": "Update Subsidies"
},
"DISCOUNTS": {
"TITLE": "Discounts",
Expand All @@ -42,14 +46,16 @@
"LABEL": "This group is exempt from paying invoicing fees",
"UPDATE": "Update Invoicing Fees",
"EMPTY": "This debtor group is not subscribed to any invoicing fees"
}
},
"NON_CLIENT_DEBTOR_GROUPS": "Non-Client Debtor Groups"
},
"TITLE": "Debtor Group Management",
"SUBSCRIBED": "Debtors subscribed",
"UPDATED": "Debtor group record updated",
"LOADING": "Fetching Debtor Group",
"CONVENTION": {
"TITLE": "Convention",
"DEBTOR_GROUP_INSOLVENT": "This debtor group is insolvent",
"DESCRIPTION": "The invoices of debtors in this group will be covered by this debtor group's account. Patients belonging to this group will be blocked from paying their bills at the cash window.",
"CANNOT_PAY": "This patient does not pay invoices. Its invoices are covered by"
},
Expand Down
12 changes: 11 additions & 1 deletion client/src/i18n/en/report.json
Original file line number Diff line number Diff line change
Expand Up @@ -82,12 +82,22 @@
"CHART_OF_ACCOUNTS": "Chart of Accounts",
"CLIENTS": {
"TITLE" : "Annual Clients Report",
"CLIENTS_REPORT": "Clients Report",
"DESCRIPTION": "This report displays all the debtor groups, their account balances at the beginning of the fiscal year, the debits and credits to their accounts, and their ending balances.",
"GLOBAL_DEBTOR_GROUP_REPORT": "Global Report of Debtor Groups",
"HIDE_LOCKED_CLIENTS" : "Hide Locked Clients",
"HIDE_LOCKED_CLIENTS_HELP_TEXT" : "Selecting yes will filter out all locked clients from the report. By default, the value is no.",
"INCLUDE_CASH_CLIENTS" : "Include Cash Clients",
"INCLUDE_CASH_CLIENTS_HELP_TEXT" : "Selecting this option will add in cash debtor groups. By default only non-cash clients (conventions) are queried.",
"NO_LOCKED_CLIENTS_FOUND" : "No locked clients found."
"INSOLVENT_CLIENTS_REPORT" : "Insolvent Clients Report",
"NO_LOCKED_CLIENTS_FOUND" : "No locked clients found.",
"BLOCKED_CLIENTS_REPORT": "Blocked Clients Report",
"REPORT_DEBT_GROUP_NON_CLIENT": "Report of debtor groups categorized as non-Clients (Cash Clients)",
"REPORT_OF_CONVENTIONED_CLIENTS": "Report of conventioned clients",
"REPORT_OF_NON_CONVENTIONED_CLIENTS": "Report of non-contracted customers",
"REPORT_SOLVENT_CLIENTS" : "Solvent Clients Report",
"OVERALL_CUSTOMER_REPORT": "Overall Customer Report",
"SHOW_ALL_DEBTOR_GROUPS": "Show all debtor groups"
},
"CLOSING_BALANCE": "Closing Balance",
"COMPARE_INVOICED_RECEIVED": {
Expand Down
14 changes: 10 additions & 4 deletions client/src/i18n/fr/debtor_group.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,17 @@
"NEW_DEBTOR_GROUP": "Nouveau Groupe de Débiteur",
"NO_GROUPS" : "Aucun Groupe Débiteur trouvés",
"POLICIES": {
"CONVENTIONED": "Conventioné",
"INSOLVENT": "Insolvable",
"NOT_ASSIMILATED_CLIENT": "Non assimilé aux clients",
"SOLVENT": "Solvable",
"TITLE": "Les stratégies de groupe",
"SUBSIDIES": {
"TITLE": "Subventions",
"EMPTY": "Ce groupe de Débiteurs n'est pas souscrit à des subventions",
"INFO": "Avec cette configuration, aucun membre de ce Groupe Débiteur ne sera subventionné",
"LABEL": "Ce groupe est qualifié pour les subventions",
"UPDATE": "Mettre à jour les subventions",
"EMPTY": "Ce groupe de Débiteurs n'est pas souscrit à des subventions"
"TITLE": "Subventions",
"UPDATE": "Mettre à jour les subventions"
},
"DISCOUNTS": {
"TITLE": "Réductions",
Expand All @@ -43,13 +47,15 @@
"LABEL": "Ce Groupe est exempté du paiement des services de facturation",
"EMPTY": "Ce Groupe Débiteur n'est pas abonné à des services de facturation",
"UPDATE": "Mettre à jour les services de facturation"
}
},
"NON_CLIENT_DEBTOR_GROUPS": "Groupes Débiteurs Non-Clients"
},
"TITLE": "Gestion des Groupes des Débiteurs",
"SUBSCRIBED": "Débiteurs abonnés",
"SUBSCRIPTIONS": "Abonnements",
"CONVENTION": {
"TITLE": "Convention",
"DEBTOR_GROUP_INSOLVENT": "Ce groupe débiteur est insolvable",
"DESCRIPTION": "Les factures des débiteurs de ce groupe seront couvertes par le compte de ce débiteur. Les patients appartenant à ce groupe seront empêchés de payer leurs factures à la caisse",
"CANNOT_PAY": "Ce patient ne paie pas de factures. Ses factures sont couvertes par"
},
Expand Down
11 changes: 10 additions & 1 deletion client/src/i18n/fr/report.json
Original file line number Diff line number Diff line change
Expand Up @@ -289,11 +289,20 @@
"CLIENTS" : {
"TITLE" : "Rapport Annuel des Clients",
"DESCRIPTION" : "Ce rapport affiche tous les groupes de débiteurs, leurs soldes de compte au début de l'exercice, les soldes actuels et leurs soldes de clôture.",
"GLOBAL_DEBTOR_GROUP_REPORT": "Rapport global des groupes débiteurs",
"HIDE_LOCKED_CLIENTS" : "Masquer les clients verrouillés",
"HIDE_LOCKED_CLIENTS_HELP_TEXT" : "Si vous sélectionnez oui, tous les clients verrouillés seront filtrés dans le rapport. Par défaut, la valeur est non.",
"INCLUDE_CASH_CLIENTS" : "Inclure les payant cash",
"INCLUDE_CASH_CLIENTS_HELP_TEXT" : "La sélection de cette option ajoutera des groupes de débiteurs en espèces. Par défaut, seules les conventions sont interrogées.",
"NO_LOCKED_CLIENTS_FOUND" : "Aucun client bloqué n'a été trouvé."
"INSOLVENT_CLIENTS_REPORT" : "Rapport des clients insolvables",
"NO_LOCKED_CLIENTS_FOUND" : "Aucun client bloqué n'a été trouvé.",
"BLOCKED_CLIENTS_REPORT": "Rapport des clients bloqués",
"REPORT_DEBT_GROUP_NON_CLIENT": "Rapport des groupes débiteurs categorisés comme non Clients",
"REPORT_OF_CONVENTIONED_CLIENTS": "Rapport des clients conventionnés",
"REPORT_OF_NON_CONVENTIONED_CLIENTS": "Rapport des clients non conventionnés (Payant cash)",
"REPORT_SOLVENT_CLIENTS" : "Rapport des clients solvables",
"OVERALL_CUSTOMER_REPORT": "Rapport global des clients",
"SHOW_ALL_DEBTOR_GROUPS": "Afficher tous les groupes débiteurs"
},
"UNPAID_INVOICE_PAYMENTS_REPORT": {
"TITLE": "Rapport de Factures Non-Payées",
Expand Down
2 changes: 1 addition & 1 deletion client/src/modules/debtors/groups.create.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ DebtorGroupCreateController.$inject = [

function DebtorGroupCreateController(
$state, ScrollTo, Session, DebtorGroups,
Accounts, Prices, Uuid, Notify, Color
Accounts, Prices, Uuid, Notify, Color,
) {
const vm = this;

Expand Down
14 changes: 14 additions & 0 deletions client/src/modules/debtors/groups.list.html
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,20 @@ <h4 style="margin-top : 0px;">
<i class="fa fa-circle" style="color: {{ debtorGroup.color }}"></i> <b>{{debtorGroup.name}}</b>
<span ng-if="debtorGroup.locked" class="fa fa-lock text-danger"></span>
</h4>
<h4>
<span ng-if="debtorGroup.is_insolvent" class="fa fa-exclamation-triangle text-danger"></span>
<span ng-if="debtorGroup.is_insolvent" class="text-warning" translate>
DEBTOR_GROUP.POLICIES.INSOLVENT
</span>
<span ng-if="debtorGroup.is_convention" class="fa fa-university text-primary"></span>
<span ng-if="debtorGroup.is_convention" class="text-primary" translate>
DEBTOR_GROUP.POLICIES.CONVENTIONED
</span>
<span ng-if="debtorGroup.is_non_client_debtor_groups" class="fa fa-home text-success"></span>
<span ng-if="debtorGroup.is_non_client_debtor_groups" class="text-success" translate>
DEBTOR_GROUP.POLICIES.NOT_ASSIMILATED_CLIENT
</span>
</h4>
<h5 style="margin-top : 0px;"></span><span translate> FORM.LABELS.ACCOUNT_NUMBER </span> : <b>{{debtorGroup.account_number}}</b></h5>
</div>
<div class="col-md-6 text-float-util">
Expand Down
24 changes: 23 additions & 1 deletion client/src/modules/debtors/groups.update.html
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,17 @@ <h5><b translate>DEBTOR_GROUP.CONVENTION.TITLE</b></h5>
<span translate>DEBTOR_GROUP.CONVENTION.TITLE</span>
</label>
</div>
<div class="checkbox">
<label>
<input
type="checkbox"
name="is_insolvent"
ng-model="GroupUpdateCtrl.group.is_insolvent"
ng-true-value="1"
ng-false-value="0">
<span translate>DEBTOR_GROUP.CONVENTION.DEBTOR_GROUP_INSOLVENT</span>
</label>
</div>
</div>
</div>

Expand All @@ -187,6 +198,17 @@ <h5><b translate>DEBTOR_GROUP.POLICIES.SUBSIDIES.TITLE</b></h5>
<span translate>DEBTOR_GROUP.POLICIES.SUBSIDIES.LABEL</span>
</label>
</div>
<div class="checkbox">
<label>
<input
type="checkbox"
name="is_non_client_debtor_groups"
ng-model="GroupUpdateCtrl.group.is_non_client_debtor_groups"
ng-true-value="1"
ng-false-value="0">
<span translate>DEBTOR_GROUP.POLICIES.NON_CLIENT_DEBTOR_GROUPS</span>
</label>
</div>
</div>
</div>
<div class="row">
Expand All @@ -201,7 +223,7 @@ <h5><b translate>DEBTOR_GROUP.POLICIES.DISCOUNTS.TITLE</b></h5>
<input ng-model="GroupUpdateCtrl.group.apply_discounts" name="apply_discounts" type="checkbox">
<span translate>DEBTOR_GROUP.POLICIES.DISCOUNTS.LABEL</span>
</label>
</div>
</div>
</div>
</div>
<div class="row">
Expand Down
5 changes: 3 additions & 2 deletions client/src/modules/debtors/groups.update.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ DebtorGroupsUpdateController.$inject = [

function DebtorGroupsUpdateController(
$state, DebtorGroups, Prices,
ScrollTo, util, Notify, Modal, Color
ScrollTo, util, Notify, Modal, Color,
) {
const vm = this;
vm.group = {};
Expand Down Expand Up @@ -51,7 +51,6 @@ function DebtorGroupsUpdateController(
vm.$loading = false;
});


function formatData(group) {
delete group.subsidies;
delete group.invoicingFees;
Expand All @@ -74,6 +73,8 @@ function DebtorGroupsUpdateController(
return;
}

vm.group.color = vm.group.is_insolvent ? '#FFA500' : '#000000';

let submitDebtorGroup = angular.copy(vm.group);
submitDebtorGroup = formatData(submitDebtorGroup);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,64 @@ <h3 class="text-capitalize" translate>REPORT.CLIENTS.TITLE</h3>
on-change-callback="ReportConfigCtrl.onIncludeCashClientsToggle(value)">
</bh-yes-no-radios>

<bh-yes-no-radios
label="REPORT.CLIENTS.SHOW_ALL_DEBTOR_GROUPS"
value="ReportConfigCtrl.reportDetails.showAllDebtorGroup"
name="showAllDebtorGroup"
on-change-callback="ReportConfigCtrl.onShowAllDebtorGroupToggle(value)">
</bh-yes-no-radios>

<div ng-if="!ReportConfigCtrl.reportDetails.showAllDebtorGroup" style="padding-left: 5%;">
<div class="checkbox">
<label>
<input type="checkbox" ng-model="ReportConfigCtrl.reportDetails.solvent" ng-true-value="1" ng-false-value="0">
<span translate>REPORT.CLIENTS.REPORT_SOLVENT_CLIENTS</span>
</label>
</div>

<div class="checkbox">
<label>
<input type="checkbox" ng-model="ReportConfigCtrl.reportDetails.insolvent" ng-true-value="1" ng-false-value="0">
<span translate>REPORT.CLIENTS.INSOLVENT_CLIENTS_REPORT</span>
</label>
</div>

<div class="checkbox">
<label>
<input type="checkbox" ng-model="ReportConfigCtrl.reportDetails.conventioned" ng-true-value="1" ng-false-value="0">
<span translate>REPORT.CLIENTS.REPORT_OF_CONVENTIONED_CLIENTS</span>
</label>
</div>

<div class="checkbox">
<label>
<input type="checkbox" ng-model="ReportConfigCtrl.reportDetails.non_conventioned" ng-true-value="1" ng-false-value="0">
<span translate>REPORT.CLIENTS.REPORT_OF_NON_CONVENTIONED_CLIENTS</span>
</label>
</div>

<div class="checkbox">
<label>
<input type="checkbox" ng-model="ReportConfigCtrl.reportDetails.group_client" ng-true-value="1" ng-false-value="0">
<span translate>REPORT.CLIENTS.OVERALL_CUSTOMER_REPORT</span>
</label>
</div>

<div class="checkbox">
<label>
<input type="checkbox" ng-model="ReportConfigCtrl.reportDetails.group_non_client" ng-true-value="1" ng-false-value="0">
<span translate>REPORT.CLIENTS.REPORT_DEBT_GROUP_NON_CLIENT</span>
</label>
</div>

<div class="checkbox">
<label>
<input type="checkbox" ng-model="ReportConfigCtrl.reportDetails.is_locked" ng-true-value="1" ng-false-value="0">
<span translate>REPORT.CLIENTS.BLOCKED_CLIENTS_REPORT</span>
</label>
</div>
</div>

<bh-currency-select
currency-id="ReportConfigCtrl.reportDetails.currencyId"
on-change="ReportConfigCtrl.onSelectCurrency(currency)">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ function AnnualClientsReportController($state, $sce, Notify, AppCache, SavedRepo
currencyId : Session.enterprise.currency_id,
hideLockedClients : 0,
includeCashClients : 0,
showAllDebtorGroup : 1,
};

checkCachedConfiguration();
Expand All @@ -48,6 +49,10 @@ function AnnualClientsReportController($state, $sce, Notify, AppCache, SavedRepo
Object.assign(vm.reportDetails, { includeCashClients });
};

vm.onShowAllDebtorGroupToggle = showAllDebtorGroup => {
vm.reportDetails.showAllDebtorGroup = showAllDebtorGroup;
};

vm.requestSaveAs = function requestSaveAs() {
const options = {
url : reportUrl,
Expand Down
Loading

0 comments on commit f85419c

Please sign in to comment.