Skip to content

Commit

Permalink
improvement(component cashbox select)
Browse files Browse the repository at this point in the history
- add filter for primary cashbox
  • Loading branch information
lomamech committed Feb 4, 2022
1 parent 7b6515b commit ed1171b
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 2 deletions.
5 changes: 5 additions & 0 deletions client/src/js/components/bhCashboxSelect.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ angular.module('bhima.components')
validationTrigger : '<?',
restrictToUser : '<?',
isAuxiliary : '<?',
isPrimary : '<?',
},
});

Expand Down Expand Up @@ -48,6 +49,10 @@ function CashboxSelectController(Cashbox, Notify, Session) {
params.is_auxiliary = 1;
}

if ($ctrl.isPrimary) {
params.is_auxiliary = 0;
}

// load all Cashbox
Cashbox.read(null, params)
.then(cashboxes => {
Expand Down
2 changes: 1 addition & 1 deletion client/src/modules/vouchers/complex-voucher.html
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
</li>

<li role="menuitem">
<a href data-action="payment-employee" ng-click="ComplexVoucherCtrl.openAdvancesLoansInstallments()">
<a href data-action="advance-loans-installments" ng-click="ComplexVoucherCtrl.openAdvancesLoansInstallments()">
<i class="fa fa-money"></i> <span translate>VOUCHERS.GLOBAL.ADVANCES_LOANS_INSTALLMENTS</span>
</a>
</li>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,6 @@
ng-change="grid.appScope.onChanges()"
ng-disabled="row.entity.locked"
type="number"
ng-min="0"
class="form-control text-right">
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@
cashbox-id = "ToolCtrl.searchQueries.cashbox_id"
name = "cashbox_id"
on-select-callback = "ToolCtrl.onSelectCashbox(cashbox)"
restrict-to-user = "false">
restrict-to-user = "false"
required = "true"
is-primary = "true">
</bh-cashbox-select>

<bh-account-select
Expand Down

0 comments on commit ed1171b

Please sign in to comment.