forked from adempiere/adempiere-vue
-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: POS List Bank Accounts with mandatory Bank identifier.
- Loading branch information
1 parent
03fe378
commit 8beb12a
Showing
5 changed files
with
180 additions
and
100 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
/** | ||
* ADempiere-Vue (Frontend) for ADempiere ERP & CRM Smart Business Solution | ||
* Copyright (C) 2018-Present E.R.P. Consultores y Asociados, C.A. www.erpya.com | ||
* Contributor(s): Elsio Sanchez [email protected] https://github.com/elsiosanchez | ||
* This program is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with this program. If not, see <https://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
import { request } from '@/utils/ADempiere/request' | ||
|
||
/** | ||
* List Banks | ||
*/ | ||
export function listBanksRequest({ | ||
posId | ||
}) { | ||
return request({ | ||
url: `point-of-sales/${posId}/banks`, | ||
method: 'get', | ||
params: { | ||
page_size: 100 | ||
} | ||
}) | ||
} | ||
|
||
/** | ||
* Get Bank | ||
*/ | ||
export function getBankRequest({ | ||
posId, | ||
id | ||
}) { | ||
return request({ | ||
url: `point-of-sales/${posId}/banks/${id}`, | ||
method: 'get' | ||
}) | ||
} | ||
|
||
/** | ||
* List Bank Accounts | ||
*/ | ||
export function listBankAccountsRequest({ | ||
posId, | ||
bankId | ||
}) { | ||
return request({ | ||
url: `point-of-sales/${posId}/banks/${bankId}/bank-accounts`, | ||
method: 'get', | ||
params: { | ||
page_size: 100 | ||
} | ||
}) | ||
} | ||
|
||
/** | ||
* Get Bank Account | ||
*/ | ||
export function getBankAccountRequest({ | ||
posId, | ||
bankId, | ||
id | ||
}) { | ||
return request({ | ||
url: `point-of-sales/${posId}/banks/${bankId}/bank-accounts/${id}`, | ||
method: 'get' | ||
}) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,38 @@ | ||
// ADempiere-Vue (Frontend) for ADempiere ERP & CRM Smart Business Solution | ||
// Copyright (C) 2023-Present E.R.P. Consultores y Asociados, C.A. | ||
// Contributor(s): Elsio Sanchez [email protected] https://github.com/elsiosanchez | ||
// This program is free software: you can redistribute it and/or modify | ||
// it under the terms of the GNU General Public License as published by | ||
// the Free Software Foundation, either version 3 of the License, or | ||
// (at your option) any later version. | ||
|
||
// This program is distributed in the hope that it will be useful, | ||
// but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
// GNU General Public License for more details. | ||
|
||
// You should have received a copy of the GNU General Public License | ||
// along with this program. If not, see <https://www.gnu.org/licenses/>. | ||
/** | ||
* ADempiere-Vue (Frontend) for ADempiere ERP & CRM Smart Business Solution | ||
* Copyright (C) 2018-Present E.R.P. Consultores y Asociados, C.A. www.erpya.com | ||
* Contributor(s): Elsio Sanchez [email protected] https://github.com/elsiosanchez | ||
* This program is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with this program. If not, see <https://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
import lang from '@/lang' | ||
|
||
// API Request Methods | ||
import { | ||
listAvailablePaymentMethods, | ||
listAvailableCurrencies, | ||
createCustomerBankAccount, | ||
listCustomerCredits, | ||
listBankAccounts, | ||
validatePIN, | ||
listBanks | ||
validatePIN | ||
} from '@/api/ADempiere/form/VPOS' | ||
import { | ||
createCustomerBankAccount, | ||
listCustomerBankAccountsRequest | ||
} from '@/api/ADempiere/form/VPOS/customer' | ||
import { | ||
listBanksRequest | ||
} from '@/api/ADempiere/form/VPOS/banks' | ||
|
||
// Utils and Helper Methods | ||
import { isEmptyValue } from '@/utils/ADempiere/valueUtils.js' | ||
import { showMessage } from '@/utils/ADempiere/notification' | ||
|
@@ -204,8 +212,10 @@ export default { | |
}) { | ||
return new Promise(resolve => { | ||
const currentPos = getters.getVPOS | ||
if (isEmptyValue(currentPos.id)) resolve({}) | ||
listBanks({ | ||
if (isEmptyValue(currentPos.id)) { | ||
resolve({}) | ||
} | ||
listBanksRequest({ | ||
posId: currentPos.id | ||
}) | ||
.then(response => { | ||
|
@@ -236,21 +246,25 @@ export default { | |
}) | ||
}) | ||
}, | ||
listAccounts({ | ||
listCustomerBankAccounts({ | ||
commit, | ||
getters | ||
}) { | ||
return new Promise(resolve => { | ||
const currentPos = getters.getVPOS | ||
const currentOrder = getters.getCurrentOrder | ||
let bankId | ||
const banck = getters.getAttributeField({ | ||
const bank = getters.getAttributeField({ | ||
field: 'banks', | ||
attribute: 'recipientBank' | ||
}) | ||
if (banck) bankId = banck.id | ||
if (isEmptyValue(currentPos.id)) resolve({}) | ||
listBankAccounts({ | ||
if (bank) { | ||
bankId = bank.id | ||
} | ||
if (isEmptyValue(currentPos.id)) { | ||
resolve({}) | ||
} | ||
listCustomerBankAccountsRequest({ | ||
posId: currentPos.id, | ||
bankId, | ||
customerId: currentOrder.customer.id | ||
|