mirror of
https://github.com/PanJiaChen/vue-element-admin.git
synced 2025-08-10 12:01:57 +08:00
Support Assign PO-Invoice-Receipt-Invoice (#960)
* setting up initial structure * add service Co-authored-by: elsiosanchez <elsiossanches@gmail.com>
This commit is contained in:
parent
d6e490a4e3
commit
5a5f32d934
@ -33,5 +33,8 @@
|
|||||||
},
|
},
|
||||||
"priceChecking": {
|
"priceChecking": {
|
||||||
"endpoint": "/form/addons/point-of-sales"
|
"endpoint": "/form/addons/point-of-sales"
|
||||||
|
},
|
||||||
|
"match": {
|
||||||
|
"endpoint": "/form/addons/match"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
76
package-lock.json
generated
76
package-lock.json
generated
@ -2861,56 +2861,6 @@
|
|||||||
"object.getownpropertydescriptors": "^2.0.3"
|
"object.getownpropertydescriptors": "^2.0.3"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"vue-loader-v16": {
|
|
||||||
"version": "npm:vue-loader@16.3.3",
|
|
||||||
"resolved": "https://registry.npmjs.org/vue-loader/-/vue-loader-16.3.3.tgz",
|
|
||||||
"integrity": "sha512-/1GzCuQ6MRORbC+leKTKoTGtpQt60bYe0gDGEextSteA2OM+v201FPha5jzmjQzVhRcwieZeUvezAtG5a/e5cw==",
|
|
||||||
"dev": true,
|
|
||||||
"optional": true,
|
|
||||||
"requires": {
|
|
||||||
"chalk": "^4.1.0",
|
|
||||||
"hash-sum": "^2.0.0",
|
|
||||||
"loader-utils": "^2.0.0"
|
|
||||||
},
|
|
||||||
"dependencies": {
|
|
||||||
"big.js": {
|
|
||||||
"version": "5.2.2",
|
|
||||||
"resolved": "https://registry.npmjs.org/big.js/-/big.js-5.2.2.tgz",
|
|
||||||
"integrity": "sha512-vyL2OymJxmarO8gxMr0mhChsO9QGwhynfuu4+MHTAW6czfq9humCB7rKpUjDd9YUiDPU4mzpyupFSvOClAwbmQ==",
|
|
||||||
"dev": true,
|
|
||||||
"optional": true
|
|
||||||
},
|
|
||||||
"emojis-list": {
|
|
||||||
"version": "3.0.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/emojis-list/-/emojis-list-3.0.0.tgz",
|
|
||||||
"integrity": "sha512-/kyM18EfinwXZbno9FyUGeFh87KC8HRQBQGildHZbEuRyWFOmv1U10o9BBp8XVZDVNNuQKyIGIu5ZYAAXJ0V2Q==",
|
|
||||||
"dev": true,
|
|
||||||
"optional": true
|
|
||||||
},
|
|
||||||
"json5": {
|
|
||||||
"version": "2.2.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/json5/-/json5-2.2.0.tgz",
|
|
||||||
"integrity": "sha512-f+8cldu7X/y7RAJurMEJmdoKXGB/X550w2Nr3tTbezL6RwEE/iMcm+tZnXeoZtKuOq6ft8+CqzEkrIgx1fPoQA==",
|
|
||||||
"dev": true,
|
|
||||||
"optional": true,
|
|
||||||
"requires": {
|
|
||||||
"minimist": "^1.2.5"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"loader-utils": {
|
|
||||||
"version": "2.0.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-2.0.0.tgz",
|
|
||||||
"integrity": "sha512-rP4F0h2RaWSvPEkD7BLDFQnvSf+nK+wr3ESUjNTyAGobqrijmW92zc+SO6d4p4B1wh7+B/Jg1mkQe5NYUEHtHQ==",
|
|
||||||
"dev": true,
|
|
||||||
"optional": true,
|
|
||||||
"requires": {
|
|
||||||
"big.js": "^5.2.2",
|
|
||||||
"emojis-list": "^3.0.0",
|
|
||||||
"json5": "^2.1.2"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"wrap-ansi": {
|
"wrap-ansi": {
|
||||||
"version": "6.2.0",
|
"version": "6.2.0",
|
||||||
"resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-6.2.0.tgz",
|
"resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-6.2.0.tgz",
|
||||||
@ -17933,6 +17883,32 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"vue-loader-v16": {
|
||||||
|
"version": "npm:vue-loader@16.5.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/vue-loader/-/vue-loader-16.5.0.tgz",
|
||||||
|
"integrity": "sha512-WXh+7AgFxGTgb5QAkQtFeUcHNIEq3PGVQ8WskY5ZiFbWBkOwcCPRs4w/2tVyTbh2q6TVRlO3xfvIukUtjsu62A==",
|
||||||
|
"dev": true,
|
||||||
|
"optional": true,
|
||||||
|
"requires": {
|
||||||
|
"chalk": "^4.1.0",
|
||||||
|
"hash-sum": "^2.0.0",
|
||||||
|
"loader-utils": "^2.0.0"
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"loader-utils": {
|
||||||
|
"version": "2.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-2.0.0.tgz",
|
||||||
|
"integrity": "sha512-rP4F0h2RaWSvPEkD7BLDFQnvSf+nK+wr3ESUjNTyAGobqrijmW92zc+SO6d4p4B1wh7+B/Jg1mkQe5NYUEHtHQ==",
|
||||||
|
"dev": true,
|
||||||
|
"optional": true,
|
||||||
|
"requires": {
|
||||||
|
"big.js": "^5.2.2",
|
||||||
|
"emojis-list": "^3.0.0",
|
||||||
|
"json5": "^2.1.2"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
"vue-multipane": {
|
"vue-multipane": {
|
||||||
"version": "0.9.5",
|
"version": "0.9.5",
|
||||||
"resolved": "https://registry.npmjs.org/vue-multipane/-/vue-multipane-0.9.5.tgz",
|
"resolved": "https://registry.npmjs.org/vue-multipane/-/vue-multipane-0.9.5.tgz",
|
||||||
|
75
src/api/ADempiere/form/match.js
Normal file
75
src/api/ADempiere/form/match.js
Normal file
@ -0,0 +1,75 @@
|
|||||||
|
// ADempiere-Vue (Frontend) for ADempiere ERP & CRM Smart Business Solution
|
||||||
|
// Copyright (C) 2017-Present E.R.P. Consultores y Asociados, C.A.
|
||||||
|
// Contributor(s): Elsio Sanchez elsiosanches@gmail.com www.erpya.com
|
||||||
|
// 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/>.
|
||||||
|
|
||||||
|
// Get Instance for connectionimport {
|
||||||
|
import { request } from '@/utils/ADempiere/request'
|
||||||
|
import { config } from '@/utils/ADempiere/config'
|
||||||
|
|
||||||
|
// Receipts List
|
||||||
|
export function receipts({
|
||||||
|
businessPartnerUuid,
|
||||||
|
formUuid
|
||||||
|
}) {
|
||||||
|
return request({
|
||||||
|
url: `${config.match.endpoint}/receipts`,
|
||||||
|
method: 'get',
|
||||||
|
params: {
|
||||||
|
business_partner_uuid: businessPartnerUuid,
|
||||||
|
form_uuid: formUuid
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.then(receiptsListResponse => {
|
||||||
|
return receiptsListResponse
|
||||||
|
})
|
||||||
|
}
|
||||||
|
// Invoices List
|
||||||
|
export function invoces({
|
||||||
|
businessPartnerUuid,
|
||||||
|
formUuid
|
||||||
|
}) {
|
||||||
|
return request({
|
||||||
|
url: `${config.match.endpoint}/invoices`,
|
||||||
|
method: 'get',
|
||||||
|
params: {
|
||||||
|
business_partner_uuid: businessPartnerUuid,
|
||||||
|
form_uuid: formUuid
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.then(invocesListResponse => {
|
||||||
|
return invocesListResponse
|
||||||
|
})
|
||||||
|
}
|
||||||
|
// Process Receipt
|
||||||
|
export function processReceipt({
|
||||||
|
businessPartnerUuid,
|
||||||
|
receiptUuid,
|
||||||
|
invoceUuid,
|
||||||
|
formUuid
|
||||||
|
}) {
|
||||||
|
return request({
|
||||||
|
url: `${config.match.endpoint}/process-receipt`,
|
||||||
|
method: 'post',
|
||||||
|
params: {
|
||||||
|
business_partner_uuid: businessPartnerUuid,
|
||||||
|
receipt_uuid: receiptUuid,
|
||||||
|
invoce_uuid: invoceUuid,
|
||||||
|
form_uuid: formUuid
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.then(response => {
|
||||||
|
return response
|
||||||
|
})
|
||||||
|
}
|
@ -27,7 +27,7 @@
|
|||||||
{{ item.description }}
|
{{ item.description }}
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
<div class="text item" style="height: 95%;">
|
<div class="text item" style="height: 90%;overflow: auto;">
|
||||||
<slot />
|
<slot />
|
||||||
</div>
|
</div>
|
||||||
</el-card>
|
</el-card>
|
||||||
|
@ -0,0 +1,55 @@
|
|||||||
|
<!--
|
||||||
|
ADempiere-Vue (Frontend) for ADempiere ERP & CRM Smart Business Solution
|
||||||
|
Copyright (C) 2017-Present E.R.P. Consultores y Asociados, C.A.
|
||||||
|
Contributor(s): Elsio Sanchez elsiosanchez@erpya.com www.erpya.com
|
||||||
|
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/>.
|
||||||
|
-->
|
||||||
|
<template>
|
||||||
|
<el-tabs type="border-card">
|
||||||
|
<el-tab-pane :label="$t('form.match.title.invoice')">
|
||||||
|
<table-from
|
||||||
|
:ref-table="ref"
|
||||||
|
:label="labelTable"
|
||||||
|
:records-data="invoiceList"
|
||||||
|
:selection="selectedInvoice"
|
||||||
|
:add-selection="selectInvoice"
|
||||||
|
:is-selection="true"
|
||||||
|
/>
|
||||||
|
</el-tab-pane>
|
||||||
|
</el-tabs>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import tableFrom from '../tableFrom'
|
||||||
|
import labelTable from '@/components/ADempiere/Form/VMatch/labelTable.js'
|
||||||
|
export default {
|
||||||
|
name: 'Invoices',
|
||||||
|
components: {
|
||||||
|
tableFrom
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
labelTable,
|
||||||
|
ref: 'Match',
|
||||||
|
selectInvoice: 'selectedInvoceMatch'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
invoiceList() {
|
||||||
|
return this.$store.getters.getInvoiceMatch
|
||||||
|
},
|
||||||
|
selectedInvoice() {
|
||||||
|
return this.$store.getters.getSelectedInvoceMatch
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
@ -0,0 +1,171 @@
|
|||||||
|
<!--
|
||||||
|
ADempiere-Vue (Frontend) for ADempiere ERP & CRM Smart Business Solution
|
||||||
|
Copyright (C) 2017-Present E.R.P. Consultores y Asociados, C.A.
|
||||||
|
Contributor(s): Elsio Sanchez elsiosanchez@erpya.com www.erpya.com
|
||||||
|
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/>.
|
||||||
|
-->
|
||||||
|
<template>
|
||||||
|
<div>
|
||||||
|
<el-tabs v-if="!isEmptyValue(selectedInvoice)" type="border-card">
|
||||||
|
<el-tab-pane :label="$t('form.match.title.invoice')">
|
||||||
|
<table-from
|
||||||
|
:label="labelTable"
|
||||||
|
:records-data="selectedInvoice"
|
||||||
|
:selection="selectedInvoice"
|
||||||
|
:is-selection="true"
|
||||||
|
/>
|
||||||
|
</el-tab-pane>
|
||||||
|
</el-tabs>
|
||||||
|
<el-tabs type="border-card">
|
||||||
|
<el-tab-pane :label="$t('form.match.title.deliveryReceipt')">
|
||||||
|
<br>
|
||||||
|
<el-row>
|
||||||
|
<template
|
||||||
|
v-for="(option, index) in filtersSearch"
|
||||||
|
>
|
||||||
|
<el-col :key="index" :span="4">
|
||||||
|
<el-checkbox v-model="option.value" :label="option.label" />
|
||||||
|
</el-col>
|
||||||
|
</template>
|
||||||
|
</el-row>
|
||||||
|
<br>
|
||||||
|
<table-from
|
||||||
|
:ref-table="ref"
|
||||||
|
:label="labelTable"
|
||||||
|
:records-data="receiptsList"
|
||||||
|
:selection="selectedReceipts"
|
||||||
|
:add-selection="selectReceipt"
|
||||||
|
:multi-selection="true"
|
||||||
|
/>
|
||||||
|
</el-tab-pane>
|
||||||
|
</el-tabs>
|
||||||
|
<el-form :inline="true" label-position="top" class="demo-form-inline">
|
||||||
|
<template
|
||||||
|
v-for="(item, index) in field"
|
||||||
|
>
|
||||||
|
<el-form-item :key="index" :label="item.label" style="width: 30%;text-align: center;">
|
||||||
|
<el-input-number v-model="item.value" :controls="false" disabled />
|
||||||
|
</el-form-item>
|
||||||
|
</template>
|
||||||
|
</el-form>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import tableFrom from '../tableFrom'
|
||||||
|
import labelTable from '@/components/ADempiere/Form/VMatch/labelTable.js'
|
||||||
|
export default {
|
||||||
|
name: 'Receipt',
|
||||||
|
components: {
|
||||||
|
tableFrom
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
labelTable,
|
||||||
|
key: 0,
|
||||||
|
field: [
|
||||||
|
{
|
||||||
|
label: this.$t('form.match.field.toAssigned'),
|
||||||
|
value: 0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: this.$t('form.match.field.assigning'),
|
||||||
|
value: 0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: this.$t('form.match.field.difference'),
|
||||||
|
value: 0
|
||||||
|
}
|
||||||
|
],
|
||||||
|
filtersSearch: [
|
||||||
|
{
|
||||||
|
label: this.$t('form.match.filtersSearch.sameBusinessPartner'),
|
||||||
|
columnName: 'C_BPartner_ID',
|
||||||
|
value: false
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: this.$t('form.match.filtersSearch.sameProduct'),
|
||||||
|
columnName: 'product',
|
||||||
|
value: false
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: this.$t('form.match.filtersSearch.sameQuantity'),
|
||||||
|
columnName: 'quantity',
|
||||||
|
value: false
|
||||||
|
}
|
||||||
|
],
|
||||||
|
ref: 'Receipt',
|
||||||
|
selectReceipt: 'selectedelectedReceiptsMatch'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
receiptsList() {
|
||||||
|
let receipts = this.$store.getters.getInvoiceMatch
|
||||||
|
this.filtersSearch.forEach(filter => {
|
||||||
|
if (filter.value) {
|
||||||
|
receipts = this.filterBills(receipts, filter)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
return receipts
|
||||||
|
},
|
||||||
|
selectedInvoice() {
|
||||||
|
return this.$store.getters.getSelectedInvoceMatch
|
||||||
|
},
|
||||||
|
selectedReceipts() {
|
||||||
|
return this.$store.getters.getSelectedReceiptsMatch
|
||||||
|
}
|
||||||
|
},
|
||||||
|
watch: {
|
||||||
|
selectedReceipts(value) {
|
||||||
|
this.assignmentSummary({
|
||||||
|
toAssigned: this.field[this.key],
|
||||||
|
assigning: this.field[1],
|
||||||
|
difference: this.field[2],
|
||||||
|
quantity: this.selectedInvoice[this.key].quantity
|
||||||
|
})
|
||||||
|
}
|
||||||
|
},
|
||||||
|
mounted() {
|
||||||
|
if (!this.isEmptyValue(this.selectedInvoice)) {
|
||||||
|
this.assignmentSummary({
|
||||||
|
toAssigned: this.field[this.key],
|
||||||
|
assigning: this.field[1],
|
||||||
|
difference: this.field[2],
|
||||||
|
quantity: this.selectedInvoice[this.key].quantity
|
||||||
|
})
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
sumQuantity(cash) {
|
||||||
|
let sum = 0
|
||||||
|
if (cash) {
|
||||||
|
cash.forEach((pay) => {
|
||||||
|
sum += pay.quantity
|
||||||
|
})
|
||||||
|
}
|
||||||
|
return sum
|
||||||
|
},
|
||||||
|
filterBills(recordList, element) {
|
||||||
|
return recordList.filter(record => {
|
||||||
|
if (record[element.columnName] === this.selectedInvoice[this.key][element.columnName]) {
|
||||||
|
return record
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
assignmentSummary({ toAssigned, assigning, difference, quantity }) {
|
||||||
|
toAssigned.value = quantity
|
||||||
|
assigning.value = this.sumQuantity(this.selectedReceipts)
|
||||||
|
difference.value = toAssigned.value - this.sumQuantity(this.selectedReceipts)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
@ -0,0 +1,48 @@
|
|||||||
|
<!--
|
||||||
|
ADempiere-Vue (Frontend) for ADempiere ERP & CRM Smart Business Solution
|
||||||
|
Copyright (C) 2017-Present E.R.P. Consultores y Asociados, C.A.
|
||||||
|
Contributor(s): Elsio Sanchez elsiosanchez@erpya.com www.erpya.com
|
||||||
|
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/>.
|
||||||
|
-->
|
||||||
|
<template>
|
||||||
|
<el-form v-if="!isEmptyValue(metadata)" label-position="top" class="from-main">
|
||||||
|
<el-form-item>
|
||||||
|
<el-row>
|
||||||
|
<el-col v-for="(field, index) in metadata" :key="index" :span="6">
|
||||||
|
<field
|
||||||
|
:key="field.columnName"
|
||||||
|
:metadata-field="field"
|
||||||
|
:v-model="field.value"
|
||||||
|
/>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import Field from '@/components/ADempiere/Field'
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: 'SearchCriteria',
|
||||||
|
components: {
|
||||||
|
Field
|
||||||
|
},
|
||||||
|
props: {
|
||||||
|
metadata: {
|
||||||
|
type: Array,
|
||||||
|
required: true,
|
||||||
|
default: () => []
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
211
src/components/ADempiere/Form/VMatch/components/tableFrom.vue
Normal file
211
src/components/ADempiere/Form/VMatch/components/tableFrom.vue
Normal file
@ -0,0 +1,211 @@
|
|||||||
|
<!--
|
||||||
|
ADempiere-Vue (Frontend) for ADempiere ERP & CRM Smart Business Solution
|
||||||
|
Copyright (C) 2017-Present E.R.P. Consultores y Asociados, C.A.
|
||||||
|
Contributor(s): Elsio Sanchez elsiosanchez@erpya.com www.erpya.com
|
||||||
|
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/>.
|
||||||
|
-->
|
||||||
|
<template>
|
||||||
|
<div
|
||||||
|
class="card-form"
|
||||||
|
style="height: 100%;overflow: auto;"
|
||||||
|
>
|
||||||
|
<el-table
|
||||||
|
:ref="refTable"
|
||||||
|
:data="recordsData"
|
||||||
|
style="width: 100%;height: 100%;overflow: auto;"
|
||||||
|
border
|
||||||
|
highlight-current-row
|
||||||
|
:show-summary="summary"
|
||||||
|
:summary-method="getSummaries"
|
||||||
|
:row-class-name="styleCell ? tableRowClassName : ''"
|
||||||
|
@select="handleSelectionChange"
|
||||||
|
@select-all="handleSelectionChange"
|
||||||
|
@current-change="handleCurrentChange"
|
||||||
|
>
|
||||||
|
<el-table-column
|
||||||
|
v-if="multiSelection"
|
||||||
|
type="selection"
|
||||||
|
width="50"
|
||||||
|
/>
|
||||||
|
<el-table-column
|
||||||
|
v-else
|
||||||
|
:type="multiSelection ? 'selection' : ''"
|
||||||
|
width="50"
|
||||||
|
>
|
||||||
|
<template v-if="selection && currentRow.nrDocument === scope.row.nrDocument" slot-scope="scope">
|
||||||
|
<i :class="currentRow.icon" />
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column
|
||||||
|
v-for="(valueOrder) in label"
|
||||||
|
:key="valueOrder.columnName"
|
||||||
|
:column-key="valueOrder.columnName"
|
||||||
|
:label="valueOrder.label"
|
||||||
|
width="auto"
|
||||||
|
:min-width="!valueOrder.isNumeric ? valueOrder.size : valueOrder.size"
|
||||||
|
:align="valueOrder.isNumeric ? 'right' : 'left'"
|
||||||
|
:prop="valueOrder.columnName"
|
||||||
|
:sortable="valueOrder.isNumeric"
|
||||||
|
/>
|
||||||
|
</el-table>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import { formatPrice } from '@/utils/ADempiere/valueFormat.js'
|
||||||
|
export default {
|
||||||
|
name: 'TableFrom',
|
||||||
|
props: {
|
||||||
|
refTable: {
|
||||||
|
type: String,
|
||||||
|
default: 'TableFrom'
|
||||||
|
},
|
||||||
|
label: {
|
||||||
|
type: Array,
|
||||||
|
default: () => []
|
||||||
|
},
|
||||||
|
recordsData: {
|
||||||
|
type: Array,
|
||||||
|
default: () => []
|
||||||
|
},
|
||||||
|
height: {
|
||||||
|
type: String,
|
||||||
|
default: ''
|
||||||
|
},
|
||||||
|
styleCell: {
|
||||||
|
type: Boolean,
|
||||||
|
default: false
|
||||||
|
},
|
||||||
|
isSelection: {
|
||||||
|
type: Boolean,
|
||||||
|
default: false
|
||||||
|
},
|
||||||
|
selection: {
|
||||||
|
type: Array,
|
||||||
|
default: () => []
|
||||||
|
},
|
||||||
|
addSelection: {
|
||||||
|
type: String,
|
||||||
|
default: ''
|
||||||
|
},
|
||||||
|
multiSelection: {
|
||||||
|
type: Boolean,
|
||||||
|
default: false
|
||||||
|
},
|
||||||
|
summary: {
|
||||||
|
type: Boolean,
|
||||||
|
default: false
|
||||||
|
}
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
currentRow: {
|
||||||
|
icon: 'el-icon-check'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
watch: {
|
||||||
|
selection(row) {
|
||||||
|
this.currentRow = {
|
||||||
|
...this.currentRow,
|
||||||
|
...row[0]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
mounted() {
|
||||||
|
this.toggleSelection(this.selection)
|
||||||
|
this.setCurrent(this.selection[0])
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
formatPrice,
|
||||||
|
handleSelectionChange(selection, row) {
|
||||||
|
this.$store.dispatch(this.addSelection, selection)
|
||||||
|
},
|
||||||
|
setCurrent(row) {
|
||||||
|
this.currentRow = {
|
||||||
|
...this.currentRow,
|
||||||
|
...row
|
||||||
|
}
|
||||||
|
},
|
||||||
|
handleCurrentChange(val) {
|
||||||
|
this.currentRow = {
|
||||||
|
...this.currentRow,
|
||||||
|
val
|
||||||
|
}
|
||||||
|
if (this.isSelection) {
|
||||||
|
this.$store.dispatch(this.addSelection, [val])
|
||||||
|
}
|
||||||
|
},
|
||||||
|
toggleSelection(rows) {
|
||||||
|
if (rows) {
|
||||||
|
rows.forEach(row => {
|
||||||
|
const selectionRow = this.recordsData.find(record => record.NrDocument === row.NrDocument)
|
||||||
|
this.$refs[this.refTable].toggleRowSelection(selectionRow)
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
this.$refs[this.refTable].clearSelection()
|
||||||
|
}
|
||||||
|
},
|
||||||
|
tableRowClassName({ row, rowIndex }) {
|
||||||
|
if (row.Difference > 0) {
|
||||||
|
'success-row'
|
||||||
|
}
|
||||||
|
return 'warning-row'
|
||||||
|
},
|
||||||
|
getSummaries(param) {
|
||||||
|
const { columns } = param
|
||||||
|
const sums = []
|
||||||
|
columns.forEach((column, index) => {
|
||||||
|
if (index === 0) {
|
||||||
|
sums[index] = 'Σ'
|
||||||
|
return
|
||||||
|
}
|
||||||
|
const values = this.selection.map(item => {
|
||||||
|
if (column.sortable) {
|
||||||
|
return Number(item[column.property])
|
||||||
|
} else {
|
||||||
|
return ''
|
||||||
|
}
|
||||||
|
})
|
||||||
|
if (values.every(value => value > 0) && !this.isEmptyValue(this.selection)) {
|
||||||
|
sums[index] = this.formatPrice(values.reduce((prev, curr) => {
|
||||||
|
const value = Number(curr)
|
||||||
|
if (!isNaN(value)) {
|
||||||
|
return prev + curr
|
||||||
|
} else {
|
||||||
|
return prev
|
||||||
|
}
|
||||||
|
}, 0))
|
||||||
|
} else {
|
||||||
|
sums[index] = ''
|
||||||
|
}
|
||||||
|
})
|
||||||
|
return sums
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
.card-form {
|
||||||
|
height: 100% !important;
|
||||||
|
overflow: auto;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
<style>
|
||||||
|
.el-table .warning-row {
|
||||||
|
background:#ff4949a6;
|
||||||
|
}
|
||||||
|
.el-table .success-row {
|
||||||
|
background: #8ff6bd80;
|
||||||
|
}
|
||||||
|
</style>
|
134
src/components/ADempiere/Form/VMatch/fieldList.js
Normal file
134
src/components/ADempiere/Form/VMatch/fieldList.js
Normal file
@ -0,0 +1,134 @@
|
|||||||
|
// ADempiere-Vue (Frontend) for ADempiere ERP & CRM Smart Business Solution
|
||||||
|
// Copyright (C) 2017-Present E.R.P. Consultores y Asociados, C.A.
|
||||||
|
// Contributor(s): Elsio Sanchez elsiosanches@gmail.com www.erpya.com
|
||||||
|
// 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/>.
|
||||||
|
|
||||||
|
// List of fields to send in search
|
||||||
|
// import language from '@/lang'
|
||||||
|
|
||||||
|
export default [
|
||||||
|
{
|
||||||
|
columnName: 'C_BPartner_ID',
|
||||||
|
tableName: 'M_InOut',
|
||||||
|
isFromDictionary: true,
|
||||||
|
overwriteDefinition: {
|
||||||
|
handleFocusGained: true,
|
||||||
|
handleFocusLost: true,
|
||||||
|
handleKeyPressed: true,
|
||||||
|
handleKeyReleased: true,
|
||||||
|
handleActionKeyPerformed: true,
|
||||||
|
handleActionPerformed: true,
|
||||||
|
size: 24,
|
||||||
|
sequence: 3,
|
||||||
|
isActiveLogics: true,
|
||||||
|
isMandatory: true
|
||||||
|
}
|
||||||
|
},
|
||||||
|
// M_Product_ID
|
||||||
|
{
|
||||||
|
columnName: 'M_Product_ID',
|
||||||
|
// elementColumnName: 'M_Product_ID',
|
||||||
|
tableName: 'M_MatchInv',
|
||||||
|
isFromDictionary: true,
|
||||||
|
overwriteDefinition: {
|
||||||
|
handleKeyPressed: true,
|
||||||
|
handleKeyReleased: true,
|
||||||
|
handleActionKeyPerformed: true,
|
||||||
|
handleActionPerformed: true,
|
||||||
|
size: 24,
|
||||||
|
sequence: 4
|
||||||
|
}
|
||||||
|
},
|
||||||
|
// Date From
|
||||||
|
{
|
||||||
|
elementColumnName: 'Date_From',
|
||||||
|
isFromDictionary: true,
|
||||||
|
overwriteDefinition: {
|
||||||
|
handleFocusGained: true,
|
||||||
|
handleFocusLost: true,
|
||||||
|
handleKeyPressed: true,
|
||||||
|
handleKeyReleased: true,
|
||||||
|
handleActionKeyPerformed: true,
|
||||||
|
handleActionPerformed: true,
|
||||||
|
size: 24,
|
||||||
|
name: 'Fecha Desde',
|
||||||
|
componentPath: 'FieldDate',
|
||||||
|
sequence: 6,
|
||||||
|
isActiveLogics: true,
|
||||||
|
isMandatory: true
|
||||||
|
}
|
||||||
|
},
|
||||||
|
// Date To
|
||||||
|
{
|
||||||
|
elementColumnName: 'Date_To',
|
||||||
|
isFromDictionary: true,
|
||||||
|
overwriteDefinition: {
|
||||||
|
handleFocusGained: true,
|
||||||
|
handleFocusLost: true,
|
||||||
|
handleKeyPressed: true,
|
||||||
|
handleKeyReleased: true,
|
||||||
|
handleActionKeyPerformed: true,
|
||||||
|
handleActionPerformed: true,
|
||||||
|
size: 24,
|
||||||
|
name: 'Fecha Hasta',
|
||||||
|
sequence: 7,
|
||||||
|
componentPath: 'FieldDate',
|
||||||
|
isActiveLogics: true,
|
||||||
|
isMandatory: true
|
||||||
|
}
|
||||||
|
},
|
||||||
|
// Assign From
|
||||||
|
{
|
||||||
|
elementColumnName: 'Assign_From',
|
||||||
|
isFromDictionary: true,
|
||||||
|
overwriteDefinition: {
|
||||||
|
size: 24,
|
||||||
|
sequence: 0,
|
||||||
|
name: 'Asignar Desde',
|
||||||
|
handleActionPerformed: true,
|
||||||
|
handleContentSelection: true,
|
||||||
|
handleActionKeyPerformed: true,
|
||||||
|
componentPath: 'FieldSelect'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
// Assign To
|
||||||
|
{
|
||||||
|
elementColumnName: 'Assign_To',
|
||||||
|
isFromDictionary: true,
|
||||||
|
overwriteDefinition: {
|
||||||
|
size: 24,
|
||||||
|
sequence: 1,
|
||||||
|
name: 'Asignar Hasta',
|
||||||
|
handleActionPerformed: true,
|
||||||
|
handleContentSelection: true,
|
||||||
|
handleActionKeyPerformed: true,
|
||||||
|
componentPath: 'FieldSelect'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
// Search Mode
|
||||||
|
{
|
||||||
|
elementColumnName: 'Search_Mode',
|
||||||
|
isFromDictionary: true,
|
||||||
|
overwriteDefinition: {
|
||||||
|
size: 24,
|
||||||
|
sequence: 2,
|
||||||
|
name: 'Modo de Búsqueda',
|
||||||
|
handleActionKeyPerformed: true,
|
||||||
|
handleActionPerformed: true,
|
||||||
|
isActiveLogics: true,
|
||||||
|
componentPath: 'FieldSelect',
|
||||||
|
isMandatory: true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
216
src/components/ADempiere/Form/VMatch/index.vue
Normal file
216
src/components/ADempiere/Form/VMatch/index.vue
Normal file
@ -0,0 +1,216 @@
|
|||||||
|
<!--
|
||||||
|
ADempiere-Vue (Frontend) for ADempiere ERP & CRM Smart Business Solution
|
||||||
|
Copyright (C) 2017-Present E.R.P. Consultores y Asociados, C.A.
|
||||||
|
Contributor(s): Elsio Sanchez esanchez@erpya.com www.erpya.com
|
||||||
|
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/>.
|
||||||
|
-->
|
||||||
|
<template>
|
||||||
|
<el-container style="height: 100% !important;">
|
||||||
|
<el-header>
|
||||||
|
<el-steps :active="active" finish-status="success" process-status="finish">
|
||||||
|
<el-step
|
||||||
|
v-for="(item, index) in step"
|
||||||
|
:key="index"
|
||||||
|
:title="item.name"
|
||||||
|
/>
|
||||||
|
</el-steps>
|
||||||
|
</el-header>
|
||||||
|
<carousel
|
||||||
|
:step-reference="metadata.fileName"
|
||||||
|
:steps="step"
|
||||||
|
:indicator="active"
|
||||||
|
style="display: contents;height: -webkit-fill-available;"
|
||||||
|
>
|
||||||
|
<search-criteria
|
||||||
|
v-if="active === 0"
|
||||||
|
:metadata="fieldsList"
|
||||||
|
/>
|
||||||
|
<invoices
|
||||||
|
v-if="active === 1"
|
||||||
|
/>
|
||||||
|
<receipt
|
||||||
|
v-if="active === 2"
|
||||||
|
/>
|
||||||
|
</carousel>
|
||||||
|
<div :class="styleFooter">
|
||||||
|
<el-button type="primary" :icon="iconStep" style="float: right;" @click="next" />
|
||||||
|
<el-button v-show="active > 0" type="danger" icon="el-icon-close" style="float: right;margin-right: 10px;" @click="prev" />
|
||||||
|
</div>
|
||||||
|
</el-container>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import Carousel from '@/components/ADempiere/Carousel'
|
||||||
|
import formMixin from '@/components/ADempiere/Form/formMixin.js'
|
||||||
|
import fieldsList from './fieldList.js'
|
||||||
|
import SearchCriteria from './components/SearchCriteria/index'
|
||||||
|
import Invoices from './components/Invoices/index'
|
||||||
|
import Receipt from './components/Receipt/index'
|
||||||
|
export default {
|
||||||
|
name: 'VMatch',
|
||||||
|
components: {
|
||||||
|
Carousel,
|
||||||
|
SearchCriteria,
|
||||||
|
Invoices,
|
||||||
|
Receipt
|
||||||
|
},
|
||||||
|
mixins: [
|
||||||
|
formMixin
|
||||||
|
],
|
||||||
|
props: {
|
||||||
|
metadata: {
|
||||||
|
type: Object,
|
||||||
|
default: () => {
|
||||||
|
return {
|
||||||
|
uuid: 'V-Match',
|
||||||
|
containerUuid: 'V-Match',
|
||||||
|
fieldsList
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
fieldsList,
|
||||||
|
active: 0
|
||||||
|
}
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
styleFooter() {
|
||||||
|
const showTitle = this.$store.getters.getIsShowTitleForm
|
||||||
|
if (showTitle) {
|
||||||
|
return 'show-title-footer'
|
||||||
|
}
|
||||||
|
return 'from-footer'
|
||||||
|
},
|
||||||
|
step() {
|
||||||
|
return [
|
||||||
|
{
|
||||||
|
name: this.$t('views.searchCriteria'),
|
||||||
|
description: this.$t('form.match.description.searchCriteria')
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: this.$t('form.match.title.invoice'),
|
||||||
|
description: this.$t('form.match.description.invoice')
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: this.$t('form.match.title.deliveryReceipt'),
|
||||||
|
description: this.$t('form.match.description.deliveryReceipt')
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
businessPartnerUuid() {
|
||||||
|
return this.$store.getters.getValueOfField({
|
||||||
|
containerUuid: this.$route.meta.uuid,
|
||||||
|
columnName: 'C_BPartner_ID_UUID'
|
||||||
|
})
|
||||||
|
},
|
||||||
|
selectedInvoice() {
|
||||||
|
return this.$store.getters.getSelectedInvoceMatch
|
||||||
|
},
|
||||||
|
selectedReceipts() {
|
||||||
|
return this.$store.getters.getSelectedReceiptsMatch
|
||||||
|
},
|
||||||
|
iconStep() {
|
||||||
|
const step = this.step.length - 1
|
||||||
|
if (step === this.active) {
|
||||||
|
return 'el-icon-s-tools'
|
||||||
|
}
|
||||||
|
return 'el-icon-check'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
watch: {
|
||||||
|
businessPartnerUuid(value) {
|
||||||
|
if (!this.isEmptyValue(value)) {
|
||||||
|
this.$store.dispatch('serverInvocesList', {
|
||||||
|
businessPartnerUuid: value,
|
||||||
|
formUuid: this.$route.meta.uuid
|
||||||
|
})
|
||||||
|
this.$store.dispatch('serverReceiptsList', {
|
||||||
|
businessPartnerUuid: value,
|
||||||
|
formUuid: this.$route.meta.uuid
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
next() {
|
||||||
|
if (this.iconStep !== 'el-icon-s-tools') {
|
||||||
|
this.active++
|
||||||
|
} else {
|
||||||
|
this.sendAssignment(this.businessPartnerUuid)
|
||||||
|
}
|
||||||
|
},
|
||||||
|
prev() {
|
||||||
|
this.active--
|
||||||
|
},
|
||||||
|
sendAssignment(businessPartnerUuid) {
|
||||||
|
this.$store.dispatch('processAssignment', {
|
||||||
|
businessPartnerUuid,
|
||||||
|
receiptUuid: this.selectedReceipts,
|
||||||
|
invoceUuid: this.selectedInvoice,
|
||||||
|
formUuid: this.$route.meta.uuid
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
.from-main {
|
||||||
|
padding-right: 1% !important;
|
||||||
|
padding-bottom: 0px !important;
|
||||||
|
padding-top: 0px !important;
|
||||||
|
padding-left: 1% !important;
|
||||||
|
height: 90%;
|
||||||
|
}
|
||||||
|
.card-form {
|
||||||
|
height: 100% !important;
|
||||||
|
overflow: auto;
|
||||||
|
}
|
||||||
|
.header {
|
||||||
|
padding-bottom: 0px;
|
||||||
|
box-sizing: border-box;
|
||||||
|
flex-shrink: 0;
|
||||||
|
height: 4% !important;
|
||||||
|
padding-left: 1%;
|
||||||
|
padding-right: 1%;
|
||||||
|
}
|
||||||
|
.from-footer {
|
||||||
|
height: 5% !important;
|
||||||
|
box-sizing: border-box;
|
||||||
|
flex-shrink: 0;
|
||||||
|
}
|
||||||
|
.show-title-footer {
|
||||||
|
height: 15% !important;
|
||||||
|
box-sizing: border-box;
|
||||||
|
flex-shrink: 0
|
||||||
|
}
|
||||||
|
.main {
|
||||||
|
height: 90%;
|
||||||
|
display: block;
|
||||||
|
-webkit-box-flex: 1;
|
||||||
|
-ms-flex: 1;
|
||||||
|
flex: 1;
|
||||||
|
-ms-flex-preferred-size: auto;
|
||||||
|
flex-basis: auto;
|
||||||
|
overflow: auto;
|
||||||
|
-webkit-box-sizing: border-box;
|
||||||
|
box-sizing: border-box;
|
||||||
|
padding-top: 0px;
|
||||||
|
padding-right: 20px;
|
||||||
|
padding-bottom: 20px;
|
||||||
|
padding-left: 20px;
|
||||||
|
}
|
||||||
|
</style>
|
63
src/components/ADempiere/Form/VMatch/labelTable.js
Normal file
63
src/components/ADempiere/Form/VMatch/labelTable.js
Normal file
@ -0,0 +1,63 @@
|
|||||||
|
// ADempiere-Vue (Frontend) for ADempiere ERP & CRM Smart Business Solution
|
||||||
|
// Copyright (C) 2017-Present E.R.P. Consultores y Asociados, C.A.
|
||||||
|
// Contributor(s): Elsio Sanchez elsiosanches@gmail.com www.erpya.com
|
||||||
|
// 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/>.
|
||||||
|
|
||||||
|
// List of fields to send in search
|
||||||
|
import language from '@/lang'
|
||||||
|
|
||||||
|
export default [
|
||||||
|
{
|
||||||
|
columnName: 'nrDocument',
|
||||||
|
label: language.t('form.match.table.nrDocument'),
|
||||||
|
isNumeric: false,
|
||||||
|
size: '150'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
columnName: 'date',
|
||||||
|
label: language.t('table.recentItems.date'),
|
||||||
|
isNumeric: false,
|
||||||
|
size: '150'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
columnName: 'C_BPartner_ID',
|
||||||
|
label: language.t('form.pos.order.BusinessPartnerCreate.businessPartner'),
|
||||||
|
isNumeric: false,
|
||||||
|
size: '200'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
columnName: 'noLínea',
|
||||||
|
label: language.t('form.pos.order.numberLines'),
|
||||||
|
isNumeric: true,
|
||||||
|
size: '150'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
columnName: 'product',
|
||||||
|
label: language.t('form.pos.tableProduct.product'),
|
||||||
|
isNumeric: true,
|
||||||
|
size: '150'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
columnName: 'quantity',
|
||||||
|
label: language.t('form.pos.tableProduct.quantity'),
|
||||||
|
isNumeric: true,
|
||||||
|
size: '150'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
columnName: 'assigned',
|
||||||
|
label: language.t('form.match.field.assigning'),
|
||||||
|
isNumeric: true,
|
||||||
|
size: '150'
|
||||||
|
}
|
||||||
|
]
|
@ -57,6 +57,9 @@ export default {
|
|||||||
case 'WFActivity':
|
case 'WFActivity':
|
||||||
form = import('@/components/ADempiere/Form/WorkflowActivity')
|
form = import('@/components/ADempiere/Form/WorkflowActivity')
|
||||||
break
|
break
|
||||||
|
case 'VMatch':
|
||||||
|
form = import('@/components/ADempiere/Form/VMatch')
|
||||||
|
break
|
||||||
case 'VPOS':
|
case 'VPOS':
|
||||||
form = import('@/components/ADempiere/Form/VPOS')
|
form = import('@/components/ADempiere/Form/VPOS')
|
||||||
break
|
break
|
||||||
|
@ -587,6 +587,30 @@ export default {
|
|||||||
title: 'Change Log',
|
title: 'Change Log',
|
||||||
description: 'Workflow timeline'
|
description: 'Workflow timeline'
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
match: {
|
||||||
|
title: {
|
||||||
|
invoice: 'Invoice',
|
||||||
|
deliveryReceipt: 'Delivery / Receipt'
|
||||||
|
},
|
||||||
|
description: {
|
||||||
|
searchCriteria: 'Select a Business Partner to check the pending documents to be assigned',
|
||||||
|
invoice: 'Select an Invoice to assign the corresponding Delivery/Receipt to',
|
||||||
|
deliveryReceipt: 'Select at least one Delivery/Receipt to which you require to assign the selected invoice'
|
||||||
|
},
|
||||||
|
field: {
|
||||||
|
toAssigned: 'To be Assigned',
|
||||||
|
assigning: 'Assigning',
|
||||||
|
difference: 'Difference'
|
||||||
|
},
|
||||||
|
filtersSearch: {
|
||||||
|
sameBusinessPartner: 'Same Business Partner',
|
||||||
|
sameProduct: 'Same Product ',
|
||||||
|
sameQuantity: 'SameQuantity '
|
||||||
|
},
|
||||||
|
table: {
|
||||||
|
nrDocument: 'Nr Document'
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -435,7 +435,7 @@ export default {
|
|||||||
tax: 'Impuesto',
|
tax: 'Impuesto',
|
||||||
total: 'Total',
|
total: 'Total',
|
||||||
itemQuantity: 'Cantidad de Árticulo',
|
itemQuantity: 'Cantidad de Árticulo',
|
||||||
numberLines: 'Cantidad de Lineas',
|
numberLines: 'Numero de Lineas',
|
||||||
pointSale: 'Punto de Venta',
|
pointSale: 'Punto de Venta',
|
||||||
collect: 'Cobrar',
|
collect: 'Cobrar',
|
||||||
collections: 'Cobros',
|
collections: 'Cobros',
|
||||||
@ -569,6 +569,30 @@ export default {
|
|||||||
description: 'Linea de tiempo del flujo de trabajo'
|
description: 'Linea de tiempo del flujo de trabajo'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
match: {
|
||||||
|
title: {
|
||||||
|
invoice: 'Factura',
|
||||||
|
deliveryReceipt: 'Entrega / Recibo'
|
||||||
|
},
|
||||||
|
description: {
|
||||||
|
searchCriteria: 'Seleccione un Socio de Negocio para verificar los documentos pendientes por asignar',
|
||||||
|
invoice: 'Seleccione una Factura para asignar las Entrega/Recibo correspondiente',
|
||||||
|
deliveryReceipt: 'Seleccione al menos una Entrega/Recibo a la cual requiere asignar la factura seleccionada'
|
||||||
|
},
|
||||||
|
field: {
|
||||||
|
toAssigned: 'Para ser Asignadas',
|
||||||
|
assigning: 'Asignando',
|
||||||
|
difference: 'Diferencia'
|
||||||
|
},
|
||||||
|
filtersSearch: {
|
||||||
|
sameBusinessPartner: 'Mismo Socio del Negocio',
|
||||||
|
sameProduct: 'Mismo Producto ',
|
||||||
|
sameQuantity: 'Misma Cantidad '
|
||||||
|
},
|
||||||
|
table: {
|
||||||
|
nrDocument: 'Nr Docuemnto'
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
122
src/store/modules/ADempiere/form/VMatch.js
Normal file
122
src/store/modules/ADempiere/form/VMatch.js
Normal file
@ -0,0 +1,122 @@
|
|||||||
|
import {
|
||||||
|
receipts,
|
||||||
|
invoces,
|
||||||
|
processReceipt
|
||||||
|
} from '@/api/ADempiere/form/match.js'
|
||||||
|
import { showMessage } from '@/utils/ADempiere/notification.js'
|
||||||
|
|
||||||
|
const match = {
|
||||||
|
invoices: [],
|
||||||
|
receipts: [],
|
||||||
|
selectedReceipt: [],
|
||||||
|
selectedInvoce: []
|
||||||
|
}
|
||||||
|
|
||||||
|
export default {
|
||||||
|
state: match,
|
||||||
|
mutations: {
|
||||||
|
setInvoiceLisMatch(state, list) {
|
||||||
|
state.invoices = list
|
||||||
|
},
|
||||||
|
setReceiptsListMatch(state, list) {
|
||||||
|
state.receipts = list
|
||||||
|
},
|
||||||
|
setSelectedReceiptMatch(state, select) {
|
||||||
|
state.selectedReceipt = select
|
||||||
|
},
|
||||||
|
setSelectedInvoceMatch(state, select) {
|
||||||
|
state.selectedInvoce = select
|
||||||
|
}
|
||||||
|
},
|
||||||
|
actions: {
|
||||||
|
serverReceiptsList({ commit }, {
|
||||||
|
businessPartnerUuid,
|
||||||
|
formUuid
|
||||||
|
}) {
|
||||||
|
receipts({
|
||||||
|
businessPartnerUuid,
|
||||||
|
formUuid
|
||||||
|
})
|
||||||
|
.then(response => {
|
||||||
|
commit('setReceiptsListMatch', response)
|
||||||
|
})
|
||||||
|
.catch(error => {
|
||||||
|
console.warn(`serverReceiptsList: ${error.message}. Code: ${error.code}.`)
|
||||||
|
showMessage({
|
||||||
|
type: 'error',
|
||||||
|
message: error.message,
|
||||||
|
showClose: true
|
||||||
|
})
|
||||||
|
})
|
||||||
|
},
|
||||||
|
serverInvocesList({ commit }, {
|
||||||
|
businessPartnerUuid,
|
||||||
|
formUuid
|
||||||
|
}) {
|
||||||
|
invoces({
|
||||||
|
businessPartnerUuid,
|
||||||
|
formUuid
|
||||||
|
})
|
||||||
|
.then(response => {
|
||||||
|
commit('setInvoiceLisMatch', response)
|
||||||
|
})
|
||||||
|
.catch(error => {
|
||||||
|
console.warn(`serverInvocesList: ${error.message}. Code: ${error.code}.`)
|
||||||
|
showMessage({
|
||||||
|
type: 'error',
|
||||||
|
message: error.message,
|
||||||
|
showClose: true
|
||||||
|
})
|
||||||
|
})
|
||||||
|
},
|
||||||
|
processAssignment({ commit }, {
|
||||||
|
businessPartnerUuid,
|
||||||
|
receiptUuid,
|
||||||
|
invoceUuid,
|
||||||
|
formUuid
|
||||||
|
}) {
|
||||||
|
processReceipt({
|
||||||
|
businessPartnerUuid,
|
||||||
|
receiptUuid,
|
||||||
|
invoceUuid,
|
||||||
|
formUuid
|
||||||
|
})
|
||||||
|
.then(response => {
|
||||||
|
showMessage({
|
||||||
|
type: 'success',
|
||||||
|
message: response.message,
|
||||||
|
showClose: true
|
||||||
|
})
|
||||||
|
})
|
||||||
|
.catch(error => {
|
||||||
|
console.warn(`processAssignment: ${error.message}. Code: ${error.code}.`)
|
||||||
|
showMessage({
|
||||||
|
type: 'error',
|
||||||
|
message: error.message,
|
||||||
|
showClose: true
|
||||||
|
})
|
||||||
|
})
|
||||||
|
},
|
||||||
|
selectedelectedReceiptsMatch({ commit }, select) {
|
||||||
|
commit('setSelectedReceiptMatch', select)
|
||||||
|
},
|
||||||
|
selectedInvoceMatch({ commit }, select) {
|
||||||
|
console.log({ select })
|
||||||
|
commit('setSelectedInvoceMatch', select)
|
||||||
|
}
|
||||||
|
},
|
||||||
|
getters: {
|
||||||
|
getInvoiceMatch: (state) => {
|
||||||
|
return state.invoices
|
||||||
|
},
|
||||||
|
getReceiptsMatch: (state) => {
|
||||||
|
return state.receipts
|
||||||
|
},
|
||||||
|
getSelectedReceiptsMatch: (state) => {
|
||||||
|
return state.selectedReceipt
|
||||||
|
},
|
||||||
|
getSelectedInvoceMatch: (state) => {
|
||||||
|
return state.selectedInvoce
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user