Skip to content

Commit

Permalink
Merge #6936
Browse files Browse the repository at this point in the history
6936: Improved purchase order module r=mbayopanda a=lomamech

- Display of purchase cost with 4 decimals
- Added the possibility to select the person responsible for the purchase order
- Added new purchase order register with details
- Add importation file in format PDF and xlsx

closes #6929

Co-authored-by: lomamech <lomamech@gmail.com>
  • Loading branch information
bors[bot] and lomamech committed Feb 10, 2023
2 parents cf13a7d + 28f8df5 commit 27ee59d
Show file tree
Hide file tree
Showing 28 changed files with 922 additions and 12 deletions.
1 change: 1 addition & 0 deletions client/src/i18n/en/form.json
Original file line number Diff line number Diff line change
Expand Up @@ -735,6 +735,7 @@
"REPORT_SOCIAL_CHARGES": "Social Expenses Report",
"REQUIRED": "Required",
"REQUISITION_REFERENCE": "Requisition reference",
"RESPONSIBLE": "Responsible",
"RESPONSABILITY" : "Responsability",
"RESULT_ACCOUNT_SCT": "Result Account section",
"RESULT": "Results",
Expand Down
2 changes: 2 additions & 0 deletions client/src/i18n/en/purchases.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
"WAITING_CONFIRMATION_DESC": "The supplier has not confirmed that the purchase order can be delivered"
},
"INFO": {
"BENEFICIARY": "Beneficiary",
"PURCHASE_NUMBER": "Purchase Number",
"PRF_NUMBER": "PRF Number",
"CONTACT_NAME": "Contact",
Expand All @@ -38,6 +39,7 @@
"PAYMENT_CONDITION": "Payment Condition",
"SPECIAL_INSTRUCTION": "Special Instruction",
"REQUESTED_BY": "Requested by",
"RESPONSIBLE": "Responsible",
"APPROVED_BY": "Approved by",
"APPROVED_TWO_BY": "Second Approval",
"REVIEWED_BY": "Reviewed by",
Expand Down
1 change: 1 addition & 0 deletions client/src/i18n/en/tree.json
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@
"PURCHASE_ORDER" : "Purchase Orders",
"PURCHASE" : "Purchase",
"PURCHASE_REGISTRY" : "Purchase Registry",
"PURCHASE_REGISTRY_DETAILED" : "Purchase Registry Detailed",
"PURCHASE_SETTINGS":"Purchase Settings",
"PURCHASING" : "Purchasing",
"REALIZED_PROFIT_REPORT": "Collection on invoices",
Expand Down
1 change: 1 addition & 0 deletions client/src/i18n/fr/form.json
Original file line number Diff line number Diff line change
Expand Up @@ -735,6 +735,7 @@
"REPORT_SOCIAL_CHARGES": "Rapport des Charges sociales",
"REQUIRED": "Champ obligatoire",
"REQUISITION_REFERENCE": "Référence de la réquisition",
"RESPONSIBLE": "Responsable",
"RESPONSABILITY" : "Responsabilité",
"RESULT_ACCOUNT_SCT": "Section Compte de Résultat",
"RESULT": "Resultats",
Expand Down
2 changes: 2 additions & 0 deletions client/src/i18n/fr/purchases.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
"WAITING_CONFIRMATION_DESC" : "Le fournisseur n'a pas encore confirmé qu'il saura fournir la commande"
},
"INFO" : {
"BENEFICIARY": "Bénéficiaire",
"PURCHASE_NUMBER" : "Numero commande",
"PRF_NUMBER" : "Numero PRF",
"CONTACT_NAME" : "Personne de contact",
Expand All @@ -38,6 +39,7 @@
"PAYMENT_CONDITION" : "Condition de paiement",
"SPECIAL_INSTRUCTION" : "Instruction speciale",
"REQUESTED_BY": "Demandé par (nom en caractères d'imprimerie)",
"RESPONSIBLE": "Responsable",
"REVIEWED_BY": "Revue par (nom en caractères d'imprimerie)",
"APPROVED_BY": "Approuvé par (nom en caractères d'imprimerie)",
"APPROVED_TWO_BY": "Deuxième approbation (nom en caractères d'imprimerie)",
Expand Down
1 change: 1 addition & 0 deletions client/src/i18n/fr/tree.json
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@
"PURCHASE_ORDER":"Achats",
"PURCHASE_ORDER_ANALYSIS": "Analyse de commande d'achat",
"PURCHASE_REGISTRY":"Registre des achats",
"PURCHASE_REGISTRY_DETAILED" : "Registre des achats détaillé",
"PURCHASE_SETTINGS":"Paramètres des achats",
"PURCHASING":"Achat",
"REALIZED_PROFIT_REPORT": "Recouvrement de factures",
Expand Down
8 changes: 8 additions & 0 deletions client/src/modules/purchases/create/createUpdate.html
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,14 @@
<div class="row" ng-if="PurchaseCtrl.enterprise.settings.enable_prf_details">
<!-- supplier contact -->
<div class="col-md-6">
<bh-entity-select
label = "PURCHASES.INFO.RESPONSIBLE"
entity-uuid="PurchaseCtrl.order.details.responsible"
on-select-callback="PurchaseCtrl.onSelectBeneficiary(entity)"
required="false">
<bh-clear on-clear="PurchaseCtrl.clear('responsible')"></bh-clear>
</bh-entity-select>

<bh-entity-select
label = "PURCHASES.INFO.REQUESTED_BY"
entity-uuid="PurchaseCtrl.order.details.requested_by"
Expand Down
5 changes: 5 additions & 0 deletions client/src/modules/purchases/create/createUpdate.js
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,11 @@ function PurchaseOrderController(
vm.order.details.approved_title = entity.title;
};

vm.onSelectBeneficiary = entity => {
vm.order.details.responsible = entity.uuid;
vm.order.details.responsible_title = entity.title;
};

function onChangeUnitCost(item) {
// Sanity check on new unit cost
const previousPurchases = item.stats.median_unit_cost !== null;
Expand Down
120 changes: 120 additions & 0 deletions client/src/modules/purchases/detailed/registry.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,120 @@
<div class="flex-header">
<div class="bhima-title">
<ol class="headercrumb">
<li class="static" translate>TREE.PURCHASE</li>
<li class="title" translate>TREE.PURCHASE_REGISTRY_DETAILED</li>
</ol>

<div class="toolbar">
<div class="toolbar-item">
<div uib-dropdown dropdown-append-to-body data-action="open-tools">
<a class="btn btn-default" uib-dropdown-toggle>
<span class="fa fa-bars"></span> <span class="hidden-xs" translate>FORM.LABELS.MENU</span> <span class="caret"></span>
</a>

<ul uib-dropdown-menu role="menu" class="dropdown-menu-right">
<li role="menuitem">
<a href data-method="configure" ng-click="PurchaseDetailedCtrl.openColumnConfiguration()">
<i class="fa fa-columns"></i> <span translate>FORM.LABELS.COLUMNS</span>
</a>
</li>

<li role="separator" class="divider"></li>
<li role="menuitem">
<a href data-method="save-state" ng-click="PurchaseDetailedCtrl.saveGridState()">
<i class="fa fa-save"></i> <span translate>FORM.BUTTONS.SAVE_GRID_CONFIGURATION</span>
</a>
</li>

<li role="menuitem">
<a href data-method="clear-state" ng-click="PurchaseDetailedCtrl.clearGridState()">
<i class="fa fa-close"></i> <span translate>FORM.BUTTONS.CLEAR_GRID_CONFIGURATION</span>
</a>
</li>

<li role="separator" class="divider"></li>
<li role="menuitem">
<a ng-href="/reports/finance/purchasesDetailed/?{{ PurchaseDetailedCtrl.download('pdf') }}" download="{{ 'PURCHASES.ORDER' | translate }}">
<span class="fa fa-file-pdf-o"></span> <span translate>DOWNLOADS.PDF</span>
</a>

</li>
<li role="menuitem">
<a ng-href="/reports/finance/purchasesDetailed/?{{ PurchaseDetailedCtrl.download('csv') }}" download="{{ 'PURCHASES.ORDER' | translate }}">
<span class="fa fa-file-excel-o"></span> <span translate>DOWNLOADS.CSV</span>
</a>
</li>

<li role="separator" class="divider" bh-require-enterprise-setting="barcodes"></li>
<li role="menuitem" bh-require-enterprise-setting="barcodes">
<a href ng-click="PurchaseDetailedCtrl.openBarcodeScanner()" data-action="scan-barcode">
<span class="fa fa-barcode"></span> <span translate>BARCODE.SCAN_BARCODE</span>
</a>
</li>

</ul>
</div>
</div>

<div class="toolbar-item">
<div class="btn-group" uib-dropdown>
<a class="btn btn-default"
ng-class="{ 'btn-info' : PurchaseDetailedCtrl.grouped }"
ng-click="PurchaseDetailedCtrl.toggleGroup(PurchaseDetailedCtrl.selectedGroup.value)"
ng-disabled="!PurchaseDetailedCtrl.selectedGroup.label">
<span>
<i class="fa fa-object-group"></i>
<span ng-hide="PurchaseDetailedCtrl.selectedGroup.label" translate>STOCK.GROUPING</span>
<span ng-show="PurchaseDetailedCtrl.selectedGroup.label" translate>
{{ PurchaseDetailedCtrl.selectedGroup.label }}
</span>
</span>
</a>
<a class="btn btn-default" uib-dropdown-toggle>
<span class="caret"></span>
</a>
<ul class="dropdown-menu" uib-dropdown-menu role="menu" aria-labelledby="single-button">
<li ng-repeat="option in PurchaseDetailedCtrl.groupingBox">
<a href ng-click="PurchaseDetailedCtrl.selectGroup(option)">
<span translate>{{ option.label }}</span>
</a>
</li>
</ul>
</div>
</div>

<bh-search-button on-click="PurchaseDetailedCtrl.search()"></bh-search-button>

<bh-filter-toggle on-toggle="PurchaseDetailedCtrl.toggleInlineFilter()">
</bh-filter-toggle>
</div>
</div>
</div>

<div class="flex-util bh-filter-bar">
<bh-filters
filters="PurchaseDetailedCtrl.latestViewFilters"
on-remove-filter="PurchaseDetailedCtrl.onRemoveFilter(filter)">
</bh-filters>
</div>

<div class="flex-content">
<div class="container-fluid">
<div
id="purchase-registry"
class="grid-full-height-with-filters"
ui-grid="PurchaseDetailedCtrl.uiGridOptions"
ui-grid-auto-resize
ui-grid-resize-columns
ui-grid-move-columns
ui-grid-save-state
ui-grid-grouping>

<bh-grid-loading-indicator
loading-state="PurchaseDetailedCtrl.loading"
empty-state="PurchaseDetailedCtrl.uiGridOptions.data.length === 0"
error-state="PurchaseDetailedCtrl.hasError">
</bh-grid-loading-indicator>
</div>
</div>
</div>
Loading

0 comments on commit 27ee59d

Please sign in to comment.