Skip to content

Commit

Permalink
Merge pull request #561 from mbayopanda/transfert_type
Browse files Browse the repository at this point in the history
Voucher Registry Module
  • Loading branch information
jniles authored Jul 9, 2016
2 parents cd9a472 + 20adb89 commit a764aff
Show file tree
Hide file tree
Showing 28 changed files with 819 additions and 132 deletions.
1 change: 1 addition & 0 deletions client/src/css/structure.css
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,7 @@
border: none;
max-height : 42px;
border-bottom : 1px solid #ccc;
min-height: 35px;
}

.bhima-title {
Expand Down
42 changes: 27 additions & 15 deletions client/src/i18n/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,9 @@
"CREATED" : "Created",
"DATE" : "Date",
"DATE_CREATED" : "Date Created",
"DATE_FROM" : "Start",
"DATE_REGISTRATION" : "Registration Date",
"DATE_TO" : "End",
"DEBIT" : "Debit",
"DEBITOR_GROUP" : "Debtor Group",
"DEBTOR_GROUP" : "Form debtor group record",
Expand Down Expand Up @@ -500,8 +502,11 @@
"SUPPLIER" : "Supplier",
"TEL" : "TEL",
"TELEPHONE" : "Telephone",
"THIS_MONTH" : "This Month",
"THIS_WEEK" : "This week",
"TITLE" : "Title",
"TITLE_ACCOUNT" : "Title Account",
"TODAY" : "Today",
"TOTAL" : "Total",
"TOTAL_BILLED" : "Total Billed",
"TOTAL_PAID" : "Total Paid",
Expand All @@ -511,6 +516,7 @@
"TRANSFER_TYPE" : "Transfer Type",
"TYPE" : "Type",
"UNCONFIGURED" : "Unconfigured",
"UNDEFINED" : "Undefined",
"UPDATE" : "UPDATE",
"UPDATE_GROUP_DEBTOR" : "Debtor group assignment updated",
"UPDATE_PATIENT_GROUP" : "Patient group membership updated",
Expand Down Expand Up @@ -569,6 +575,7 @@
"SELECT_COUNTRY" : "Select Country",
"SELECT_CREDITOR" : "Select a creditor",
"SELECT_CREDITOR_GROUP" : "Select a Creditor Group",
"SELECT_DATE_INTERVAL" : "Select a date interval",
"SELECT_DEBITOR_GROUP" : "Select a Debtor Group",
"SELECT_ENTERPRISE" : "Select an Enterprise",
"SELECT_FUNCTION" : "Select function",
Expand Down Expand Up @@ -1175,6 +1182,8 @@
"TRANSACTIONS_BY_ACCOUNT" : "Transactions by Account",
"UPDATE_STOCK" : "Update stock",
"USERS" : "Users",
"VALIDATE_PURCHASE" : "Validation",
"VOUCHER_REGISTRY" : "Voucher Registry",
"VALIDATE_PURCHASE" : "Validate Purchase"
},
"VILLAGE": {
Expand All @@ -1188,21 +1197,6 @@
"TITLE" : "Village Management"
},
"VOUCHERS": {
"SIMPLE": {
"CASH_PAYMENT" : "Client Payment",
"CASH_RETURN" : "Cash Return (Payback)",
"CONVENTION_PAYMENT" : "Convention Payment",
"EXPENSE" : "Expenses",
"INCOME" : "Incomes",
"SALARY_PAYMENT" : "Salary Payment",
"GENERIC_EXPENSE" : "Other Expenses",
"GENERIC_INCOME" : "Other Incomes",
"PURCHASES" : "Purchases",
"SUPPORT_INCOME" : "Support Incomes",
"TITLE" : "Simple Voucher",
"TRANSFER" : "Money Transfer"
},
"TITLE" : "Voucher",
"COMPLEX": {
"ADD_ITEMS" : "Add item(s)",
"CASH_PAYMENT" : "Cash Payment",
Expand All @@ -1224,6 +1218,24 @@
"TITLE" : "Advanced Journal Vouchers",
"VALID_TOTALS" : "Transactions are valid (balanced transaction)",
"VOUCHER" : "Voucher"
},
"GLOBAL" : {
"REPORT" : "Voucher Report",
"TITLE" : "Voucher"
},
"SIMPLE": {
"CASH_PAYMENT" : "Client Payment",
"CASH_RETURN" : "Cash Return (Payback)",
"CONVENTION_PAYMENT" : "Convention Payment",
"EXPENSE" : "Expenses",
"INCOME" : "Incomes",
"SALARY_PAYMENT" : "Salary Payment",
"GENERIC_EXPENSE" : "Other Expenses",
"GENERIC_INCOME" : "Other Incomes",
"PURCHASES" : "Purchases",
"SUPPORT_INCOME" : "Support Incomes",
"TITLE" : "Simple Voucher",
"TRANSFER" : "Money Transfer"
}
},
"GRAPHS" : {
Expand Down
45 changes: 29 additions & 16 deletions client/src/i18n/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,9 @@
"CURRENT_LOCATION" : "Localisation actuelle",
"DATE" : "Date",
"DATE_CREATED" : "Date de création",
"DATE_FROM" : "Debut",
"DATE_REGISTRATION" : "Date d'enregistrement",
"DATE_TO" : "Fin",
"DEBIT" : "Débit",
"DEBITOR_GROUP" : "Groupe Débiteur",
"DEBTOR_GROUP" : "Formulaire d'enregistrement de groupe débiteur",
Expand Down Expand Up @@ -442,6 +444,7 @@
"OTHER" : "Autres",
"OPTIONAL_INFO" : "Informations optionnelles",
"ORIGIN_LOCATION" : "Localisation d'origine",
"OTHER" : "Autre",
"PARENT_ACCOUNT" : "Compte parent",
"PASSIVE" : "Passive",
"PASSWORD" : "Mot de passe",
Expand Down Expand Up @@ -498,8 +501,11 @@
"SUPPLIER" : "Fournisseur",
"TEL" : "Tél",
"TELEPHONE" : "Téléphone",
"THIS_MONTH" : "Ce Mois",
"THIS_WEEK" : "Cette Semaine",
"TITLE" : "Titre",
"TITLE_ACCOUNT" : "Comptes Titre",
"TODAY" : "Aujourd'hui",
"TOTAL" : "Total",
"TOTAL_BILLED" : "Total Facture",
"TOTAL_PAID" : "Total paye",
Expand All @@ -509,6 +515,7 @@
"TRANSFER_TYPE" : "Type de Transfert",
"TYPE" : "Type",
"UNCONFIGURED" : "Non configuree",
"UNDEFINED" : "Non defini",
"UNIT" : "Forme galenique",
"UNIT_WEIGHT" : "Poids",
"UNIT_VOLUME" : "Volume",
Expand Down Expand Up @@ -567,6 +574,7 @@
"SELECT_COUNTRY" : "Sélectionner pays",
"SELECT_CREDITOR" : "Sélectionner un Créditeur",
"SELECT_CREDITOR_GROUP" : "Sélectionner Groupe de créditeurs",
"SELECT_DATE_INTERVAL" : "Sélectionner un intervalle de date",
"SELECT_DEBITOR_GROUP" : "Sélectionner Groupe de Débiteurs",
"SELECT_ENTERPRISE" : "Sélectionner entreprise",
"SELECT_FUNCTION" : "Sélectionner une fonction",
Expand Down Expand Up @@ -1183,7 +1191,9 @@
"TRANSACTIONS_BY_ACCOUNT" : "Transactions par Compte",
"UPDATE_STOCK" : "Mettre à Jour les Stocks",
"USERS" : "Utilisateurs",
"VALIDATE_PURCHASE" : "Validation"
"VALIDATE_PURCHASE" : "Validation",
"VOUCHER_REGISTRY" : "Registre des Bordereaux",
"VALIDATE_PURCHASE" : "Validation Achat"
},
"VILLAGE": {
"CONFIG" : "Configuration de Gestion des Villages",
Expand All @@ -1196,21 +1206,6 @@
"TITLE" : "Gestion des Villages"
},
"VOUCHERS": {
"SIMPLE": {
"CASH_PAYMENT" : "Paiement des clients",
"CASH_RETURN" : "Remboursement",
"CONVENTION_PAYMENT" : "Paiement des Conventions",
"EXPENSE" : "Dépenses",
"INCOME" : "Récettes",
"SALARY_PAYMENT" : "Paiement des Salaires",
"GENERIC_EXPENSE" : "Autres Depenses",
"GENERIC_INCOME" : "Autres Recettes",
"PURCHASES" : "Achats",
"SUPPORT_INCOME" : "Paiement Prise en charge",
"TITLE" : "Bordereau de transfert",
"TRANSFER" : "Transfert d'argent"
},
"TITLE" : "Quittance",
"COMPLEX": {
"ADD_ITEMS" : "Ajouter item(s)",
"CASH_PAYMENT" : "Paiement Caisse",
Expand All @@ -1232,6 +1227,24 @@
"TITLE" : "Ajout des transactions",
"VALID_TOTALS" : "Les transactions sont valides (Transactions balancées)",
"VOUCHER" : "Bordereau de Transfert"
},
"GLOBAL" : {
"REPORT" : "Rapport des Quittances",
"TITLE" : "Quittance"
},
"SIMPLE": {
"CASH_PAYMENT" : "Paiement des clients",
"CASH_RETURN" : "Remboursement",
"CONVENTION_PAYMENT" : "Paiement des Conventions",
"EXPENSE" : "Dépenses",
"INCOME" : "Récettes",
"SALARY_PAYMENT" : "Paiement des Salaires",
"GENERIC_EXPENSE" : "Autres Depenses",
"GENERIC_INCOME" : "Autres Recettes",
"PURCHASES" : "Achats",
"SUPPORT_INCOME" : "Paiement Prise en charge",
"TITLE" : "Bordereau de transfert",
"TRANSFER" : "Transfert d'argent"
}
}
}
5 changes: 5 additions & 0 deletions client/src/js/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,11 @@ function bhimaConfig($stateProvider, $urlRouterProvider, $urlMatcherFactoryProvi
controller: 'ComplexJournalVoucherController as ComplexVoucherCtrl',
templateUrl: 'partials/vouchers/complex.html'
})
.state('vouchers', {
url : '/vouchers',
controller: 'VoucherController as VoucherCtrl',
templateUrl: 'partials/vouchers/index.html'
})

/* 2.X Journal routes */
.state('journal', {
Expand Down
4 changes: 2 additions & 2 deletions client/src/js/components/bhPDFPrint.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ bhPDFPrintController.$inject = ['$window', '$http', '$sce', '$timeout'];
* options="options">
* </bh-pdf-print>
*/
function bhPDFPrintController($window, $http, $sce, $timeout) {
function bhPDFPrintController($window, $http, $sce, $timeout, uuid) {
var cachedRequest;
var component = this;

Expand All @@ -57,7 +57,7 @@ function bhPDFPrintController($window, $http, $sce, $timeout) {
var loadingIndicatorDelay = 1000;

component.$loading = false;
component.embeddedContentId = 'pdfdirect';
component.embeddedContentId = 'pdfdirect' + Date.now();

// expose the print method to the view
component.print = print;
Expand Down
22 changes: 22 additions & 0 deletions client/src/js/services/ModalService.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,9 @@ function ModalService(Modal) {
// inventory list action : add or edit
service.openInventoryListActions = openInventoryListActions;

// date interval modal
service.openDateInterval = openDateInterval;

/**
* Opens a "confirm delete" modal with a button for "Confirm" or "Cancel".
* The modal is a safe replacement for $window.confirm(), since you cannot
Expand Down Expand Up @@ -279,4 +282,23 @@ function ModalService(Modal) {
return instance.result;
}

/** Find by Date interval modal */
function openDateInterval(request) {

var params = angular.extend(modalParameters, {
templateUrl : 'partials/templates/modals/dateInterval.tmpl.html',
controller : 'DateIntervalModalController',
controllerAs : '$ctrl',
size : 'xs',
backdrop : 'static',
animation : false,
resolve : {
data : function dataProvider() { return request; }
}
});

var instance = Modal.open(params);
return instance.result;
}

}
19 changes: 17 additions & 2 deletions client/src/js/services/PrototypeApiService.js
Original file line number Diff line number Diff line change
Expand Up @@ -244,17 +244,32 @@ function PrototypeApiService($http, util) {

// append the id to the base url
var target = this.url.concat('reports/', param);
return reportBuilder(param, filetype);
}

/**
* Receipt
*/
function receipt(param, filetype) {

// append the id to the base url
var target = this.url.concat('receipts/', param);
return reportBuilder(param, filetype);
}

/** report builder */
function reportBuilder(param, filetype) {

// filetype setup
var responseType = filetype === 'pdf' ? 'arraybuffer' : null;
var params = { renderer: filetype };

// send the GET request
return this.$http.get(target, {
return $http.get(target, {
params: params,
responseType: responseType
})
.then(util.unwrapHttpResponse);
.then(util.unwrapHttpResponse);
}

return Api;
Expand Down
15 changes: 1 addition & 14 deletions client/src/partials/inventory/list/list.js
Original file line number Diff line number Diff line change
Expand Up @@ -128,20 +128,7 @@ function InventoryListController ($translate, Inventory, Notify, uiGridConstants

/** print inventory list */
function printList() {
var buttonState = JSON.parse(JSON.stringify(vm.bcButtons[2]));
vm.bcButtons[2].disabled = true;
vm.bcButtons[2].icon = 'fa fa-spinner fa-pulse';

Inventory.report('pdf')
.then(function (result) {
vm.report = result;
return Modal.openReports({ report: vm.report, renderer: 'pdf' });
})
.then(function () {
vm.bcButtons[2] = JSON.parse(JSON.stringify(buttonState));
vm.bcButtons[2].action = printList;
})
.catch(Notify.errorHandler);
Modal.openReports({ url: '/inventory/reports/metadata', renderer: 'pdf' });
}

/** startup */
Expand Down
8 changes: 8 additions & 0 deletions client/src/partials/templates/grid/linkFilePDF.tmpl.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<div style="padding: 5px;">
<a href=""
ng-if="row.entity.uuid"
ng-click="grid.appScope.showReceipt(row.entity.uuid)"
data-link-receipt="{{ row.entity.uuid }}">
<i class="fa fa-file-pdf-o"></i> {{ "TABLE.COLUMNS.RECEIPT" | translate }}
</a>
</div>
7 changes: 7 additions & 0 deletions client/src/partials/templates/grid/voucherType.tmpl.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<div style="padding: 5px;">
<span ng-class="{'label label-success': grid.appScope.getType(row.entity.type_id).incomeExpense == 'income', 'label label-warning': grid.appScope.getType(row.entity.type_id).incomeExpense == 'expense'}" href="">
{{ grid.appScope.getType(row.entity.type_id).text | translate }}
<span ng-if="row.groupHeader">{{ COL_FIELD }}</span>
</span>
<a ng-if="grid.appScope.isDefined(row.entity)" class="label label-default">{{ "FORM.LABELS.UNDEFINED" | translate }}</a>
</div>
Loading

0 comments on commit a764aff

Please sign in to comment.