Skip to content

Commit

Permalink
improvement(Repport Analysis of Cashbox)
Browse files Browse the repository at this point in the history
- Use Singular for the name of report
- Set a legend above the title
- Update data.sql fix combinaison of account - currency and cashbox

closes #6169
  • Loading branch information
lomamech committed Jan 24, 2022
1 parent 6e3bec3 commit 3cf8f6f
Show file tree
Hide file tree
Showing 11 changed files with 37 additions and 30 deletions.
3 changes: 2 additions & 1 deletion client/src/i18n/en/form.json
Original file line number Diff line number Diff line change
Expand Up @@ -552,7 +552,8 @@
"LAST_NAME": "Last Name",
"LAST_PAGE": "Last Page Visited",
"LATITUDE": "Latitude",
"LEVEL_OF_STUDY" : "Level of study",
"LEGEND" : "Legend",
"LEVEL_OF_STUDY" : "Level of study",
"LIMIT": "Limit",
"LIST_STRUCTURE": "List structure",
"LOCATION_REGISTER": "Location Register",
Expand Down
4 changes: 2 additions & 2 deletions client/src/i18n/en/report.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@
"QUANTITY_DISTRIBUTED_TO_PATIENTS": "Quantity distributed to patients",
"AVG_DISTRIBUTION_PER_PATIENT": "Avg distribution per patient"
},
"ANALYSIS_AUX_CASHBOXES": {
"TITLE": "Analysis of Auxiliary Cashboxes",
"ANALYSIS_AUX_CASHBOX": {
"TITLE": "Analysis of Auxiliary Cashbox",
"AUXILIARY_TRANSFERT": "Auxiliary Cashbox to transfer account",
"DESCRIPTION": "This report makes it possible to track the monthly payments and disbursements of the auxiliary cashboxes",
"STATUS": {
Expand Down
3 changes: 2 additions & 1 deletion client/src/i18n/fr/form.json
Original file line number Diff line number Diff line change
Expand Up @@ -556,7 +556,8 @@
"LAST_NAME": "Nom",
"LAST_PAGE": "La dernière page visitée",
"LATITUDE": "Latitude",
"LEVEL_OF_STUDY" : "Niveau d'étude",
"LEGEND" : "Legende",
"LEVEL_OF_STUDY" : "Niveau d'étude",
"LIMIT": "Limite",
"LIST_STRUCTURE": "Liste",
"LOCATION_REGISTER": "Enregistrer une localisation",
Expand Down
4 changes: 2 additions & 2 deletions client/src/i18n/fr/report.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@
"QUANTITY_DISTRIBUTED_TO_PATIENTS": "Quantité distribuée aux patients",
"AVG_DISTRIBUTION_PER_PATIENT": "Distribution moyenne par patient"
},
"ANALYSIS_AUX_CASHBOXES": {
"TITLE": "Analyse des caisses auxiliaires",
"ANALYSIS_AUX_CASHBOX": {
"TITLE": "Analyse de la caisse auxiliaire",
"AUXILIARY_TRANSFERT": "Caisse auxiliaire vers compte de transfert",
"DESCRIPTION": "Ce rapport permet de faire la suivie mensuel des encaissements et décaissements des caisses auxilliaires",
"STATUS": {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
angular.module('bhima.controllers')
.controller('analysis_auxiliary_cashboxesController', analysisAuxiliaryCashboxesController);
.controller('analysis_auxiliary_cashboxController', analysisAuxiliaryCashboxController);

analysisAuxiliaryCashboxesController.$inject = [
analysisAuxiliaryCashboxController.$inject = [
'$sce', 'NotifyService', 'BaseReportService', 'AppCache',
'reportData', '$state',
];

function analysisAuxiliaryCashboxesController($sce, Notify, SavedReports, AppCache,
function analysisAuxiliaryCashboxController($sce, Notify, SavedReports, AppCache,
reportData, $state) {
const vm = this;
const cache = new AppCache('analysis_auxiliary_cashboxes');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
<div ng-show="!ReportConfigCtrl.previewGenerated">
<div class="row">
<div class="col-md-12">
<h3 class="text-capitalize" translate>REPORT.ANALYSIS_AUX_CASHBOXES.TITLE</h3>
<p class="text-info" translate>REPORT.ANALYSIS_AUX_CASHBOXES.DESCRIPTION</p>
<h3 class="text-capitalize" translate>REPORT.ANALYSIS_AUX_CASHBOX.TITLE</h3>
<p class="text-info" translate>REPORT.ANALYSIS_AUX_CASHBOX.DESCRIPTION</p>
</div>
</div>

Expand Down
2 changes: 1 addition & 1 deletion client/src/modules/reports/reports.routes.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ angular.module('bhima.routes')
'aged_creditors',
'aged_debtors',
'aggregated_stock_consumption',
'analysis_auxiliary_cashboxes',
'analysis_auxiliary_cashbox',
'annual_clients_report',
'avg_med_costs_per_patient',
'balance_report',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,6 @@ async function report(req, res, next) {
GROUP BY ledger.trans_date;
`;


const [transactions, transfers, primaryTransfers] = await Promise.all([
db.exec(sqlCashBox, cashboxParams),
db.exec(sqlTransfertAccount, transfertParams),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,42 +1,48 @@
<!doctype html>
<html>
{{> head title="REPORT.ANALYSIS_AUX_CASHBOXES.TITLE" }}
{{> head title="REPORT.ANALYSIS_AUX_CASHBOX.TITLE" }}
<body class="container">
{{> header}}

<!-- body -->
<div class="row">
<div class="col-xs-12">
<!-- page title -->
<h3 class="text-center text-bold text-uppercase">{{translate 'REPORT.ANALYSIS_AUX_CASHBOXES.TITLE'}}</h3>
<h3 class="text-center text-bold text-uppercase">{{ report.cashboxLabel }}</h3>
<h4 class="text-center text-bold text-uppercase">{{ report.periodLabel }}</h4>

<table style="width: 50%; float: right; margin-bottom: 1.5%">
<tr>
<td colspan="2" width="90%">&nbsp;<strong>{{translate 'FORM.LABELS.LEGEND'}}</strong></td>
</tr>
<tr>
<td width="10%" style="background-color: #5cb85c; color:white; text-align:center"> ✔ </td>
<td width="90%">&nbsp;<strong>{{translate 'REPORT.ANALYSIS_AUX_CASHBOXES.STATUS.CORRECT'}}</strong></td>
<td width="90%">&nbsp;<strong>{{translate 'REPORT.ANALYSIS_AUX_CASHBOX.STATUS.CORRECT'}}</strong></td>
</tr>
<tr>
<td width="10%" style="background-color: #777777; color:white; text-align:center"> X </td>
<td width="90%">&nbsp;<strong>{{translate 'REPORT.ANALYSIS_AUX_CASHBOXES.STATUS.TRANSFERT_PENDING'}}</strong></td>
<td width="90%">&nbsp;<strong>{{translate 'REPORT.ANALYSIS_AUX_CASHBOX.STATUS.TRANSFERT_PENDING'}}</strong></td>
</tr>
<tr>
<td width="10%" style="background-color: #f0ad4e; color:white; text-align:center"> ▲ </td>
<td width="90%">&nbsp;<strong>{{translate 'REPORT.ANALYSIS_AUX_CASHBOXES.STATUS.TRANSFERT_GREATER'}}</strong></td>
<td width="90%">&nbsp;<strong>{{translate 'REPORT.ANALYSIS_AUX_CASHBOX.STATUS.TRANSFERT_GREATER'}}</strong></td>
</tr>
<tr>
<td width="10%" style="background-color: #d9534f; color:white; text-align:center"> ▼ </td>
<td width="90%">&nbsp;<strong>{{translate 'REPORT.ANALYSIS_AUX_CASHBOXES.STATUS.TRANSFERT_LOWWER'}}</strong></td>
<td width="90%">&nbsp;<strong>{{translate 'REPORT.ANALYSIS_AUX_CASHBOX.STATUS.TRANSFERT_LOWWER'}}</strong></td>
</tr>
</table>
</div>

<div class="col-xs-12">

<!-- page title -->
<h3 class="text-center text-bold text-uppercase">{{translate 'REPORT.ANALYSIS_AUX_CASHBOX.TITLE'}}</h3>
<h3 class="text-center text-bold text-uppercase">{{ report.cashboxLabel }}</h3>
<h4 class="text-center text-bold text-uppercase">{{ report.periodLabel }}</h4>

<table class="table table-striped table-condensed table-report table-bordered">
<thead>
<th width="10%"></th>
<th width="35%" class="text-uppercase" colspan="4"> {{translate 'REPORT.ANALYSIS_AUX_CASHBOXES.AUXILIARY_TRANSFERT'}} </th>
<th width="35%" class="text-uppercase" colspan="4">{{translate 'REPORT.ANALYSIS_AUX_CASHBOXES.TRANSFER_PRINCIPAL'}}</th>
<th width="20%" class="text-uppercase" colspan="3">{{translate 'REPORT.ANALYSIS_AUX_CASHBOXES.TARGET'}}</th>
<th width="35%" class="text-uppercase" colspan="4"> {{translate 'REPORT.ANALYSIS_AUX_CASHBOX.AUXILIARY_TRANSFERT'}} </th>
<th width="35%" class="text-uppercase" colspan="4">{{translate 'REPORT.ANALYSIS_AUX_CASHBOX.TRANSFER_PRINCIPAL'}}</th>
<th width="20%" class="text-uppercase" colspan="3">{{translate 'REPORT.ANALYSIS_AUX_CASHBOX.TARGET'}}</th>
</thead>
<tbody>
<tr>
Expand Down
4 changes: 2 additions & 2 deletions server/models/bhima.sql
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ INSERT INTO unit VALUES
(245,'Debtor Summary Report','REPORT.DEBTOR_SUMMARY.TITLE','Debtor summary report',281,'/reports/debtor_summary'),
(246,'Client Debts Report','TREE.CLIENT_DEBTS_REPORT','Client debts report',281,'/reports/client_debts'),
(247,'Client Support Report','TREE.CLIENT_SUPPORT_REPORT','Client support report',281,'/reports/client_support'),
(248,'Analysis of Cashboxes','REPORT.ANALYSIS_AUX_CASHBOXES.TITLE','Analysis of auxiliary cashboxes',281,'/reports/analysis_auxiliary_cashboxes'),
(248,'Analysis of Cashbox','REPORT.ANALYSIS_AUX_CASHBOX.TITLE','Analysis of auxiliary cashbox',281,'/reports/analysis_auxiliary_cashbox'),
(249,'Realized Profit Report','TREE.REALIZED_PROFIT_REPORT','Realized profit report / Collection on Invoicies',281,'/reports/realized_profit'),
(250,'System Usage Statistics','REPORT.SYSTEM_USAGE_STAT.TITLE','System usage statistics',280,'/reports/system_usage_stat'),
(251,'Indexes','TREE.INDEXES','The payroll index',57,'/PAYROLL_INDEX_FOLDER'),
Expand Down Expand Up @@ -234,7 +234,7 @@ INSERT INTO `report` (`report_key`, `title_key`) VALUES
('debtor_summary', 'REPORT.DEBTOR_SUMMARY.TITLE'),
('client_debts', 'REPORT.CLIENT_SUMMARY.TITLE'),
('client_support', 'REPORT.CLIENT_SUPPORT.TITLE'),
('analysis_auxiliary_cashboxes', 'REPORT.ANALYSIS_AUX_CASHBOXES.TITLE'),
('analysis_auxiliary_cashbox', 'REPORT.ANALYSIS_AUX_CASHBOX.TITLE'),
('realized_profit', 'REPORT.REALIZED_PROFIT.TITLE'),
('recovery_capacity', 'REPORT.RECOVERY_CAPACITY.TITLE'),
('system_usage_stat', 'REPORT.SYSTEM_USAGE_STAT.TITLE'),
Expand Down
4 changes: 2 additions & 2 deletions test/data.sql
Original file line number Diff line number Diff line change
Expand Up @@ -400,8 +400,8 @@ SET @CaisseAux = 2;
INSERT INTO `cash_box_account_currency` (id, currency_id, cash_box_id, account_id, transfer_account_id) VALUES
(1, @USD, @CaissePrincipale, 190, 195),
(2, @FC, @CaissePrincipale, 187, 198),
(3, @USD, @CaisseAux, 191, 194),
(4, @FC, @CaisseAux, 188, 197);
(3, @FC, @CaisseAux, 191, 194),
(4, @USD, @CaisseAux, 188, 197);

-- Set Cashbox Management By User
INSERT INTO cashbox_permission (user_id, cashbox_id) VALUES
Expand Down

0 comments on commit 3cf8f6f

Please sign in to comment.