Skip to content
This repository has been archived by the owner on Nov 25, 2024. It is now read-only.

Commit

Permalink
fix: POS Add billing address with copy shipping address. (#1780)
Browse files Browse the repository at this point in the history
  • Loading branch information
EdwinBetanc0urt authored Dec 18, 2023
1 parent 9d3dd21 commit 7ee697c
Show file tree
Hide file tree
Showing 3 changed files with 70 additions and 55 deletions.
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
<!--
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): Edwin Betancourt EdwinBetanc0urt@outlook.com https://github.com/EdwinBetanc0urt
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.
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): Edwin Betancourt EdwinBetanc0urt@outlook.com https://github.com/EdwinBetanc0urt
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.
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/>.
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>
Expand All @@ -31,7 +31,7 @@ along with this program. If not, see <https:www.gnu.org/licenses/>.
<el-form
label-position="top"
size="small"
class="location-address"
class="location-address form-min-label"
>
<el-col :span="spanCol">
<el-card
Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,19 @@
<!--
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 elsiosanchez15@outlook.com 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 elsiosanchez15@outlook.com 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/>.
-->

<template>
Expand All @@ -28,6 +30,7 @@ along with this program. If not, see <https:www.gnu.org/licenses/>.
<el-form
label-position="top"
inline
class="form-min-label"
style="border: 1px solid hsl(220, 100%, 99%);border-radius: 10px;padding: 10px;"
>
<el-row :gutter="20">
Expand All @@ -53,6 +56,7 @@ import {

export default defineComponent({
name: 'CustomerData',

setup() {
const listComponents = computed(() => {
return [
Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,19 @@
<!--
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 elsiosanchez15@outlook.com 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 elsiosanchez15@outlook.com 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/>.
-->

<template>
Expand Down Expand Up @@ -80,47 +82,56 @@ import store from '@/store'
// Components and Mixins
import CustomerData from './CustomerData.vue'
import AddAddress from './AddAddress/index.vue'
// utils and helper methods

// Utils and Helper Methods
import { isEmptyValue } from '@/utils/ADempiere'

export default defineComponent({
name: 'NewCustomer',

components: {
CustomerData,
AddAddress
},

setup() {
// Ref

const activeNames = ref(['1', '2'])
const isVisibleAddress = ref(false)
const copyShippingAddress = ref(true)
const isLoading = ref(false)

// Computed

const isDisabled = computed(() => {
const code = store.getters.getAttributeFieldCustomer({
attribute: 'code'
})
const name = store.getters.getAttributeFieldCustomer({
attribute: 'name'
})
const countryBilling = store.getters.getAttributeFieldLocationsCustomers({
typeLocations: 'billingAddress',
attribute: 'countryId'
})
const countryShipping = store.getters.getAttributeFieldLocationsCustomers({
typeLocations: 'shippingAddress',
attribute: 'countryId'
})
if (isEmptyValue(name) || isEmptyValue(code)) {
return true
}

if (isVisibleAddress.value) {
if (copyShippingAddress.value) {
return isEmptyValue(countryShipping) || isEmptyValue(countryBilling) || isEmptyValue(name) || isEmptyValue(code)
if (!copyShippingAddress.value) {
const countryShipping = store.getters.getAttributeFieldLocationsCustomers({
typeLocations: 'shippingAddress',
attribute: 'countryId'
})
if (isEmptyValue(countryShipping)) {
return true
}
}
const countryBilling = store.getters.getAttributeFieldLocationsCustomers({
typeLocations: 'billingAddress',
attribute: 'countryId'
})
if (isEmptyValue(countryBilling)) {
return true
}
return isEmptyValue(countryBilling) || isEmptyValue(name) || isEmptyValue(code)
}
return isEmptyValue(name) || isEmptyValue(code)
return false
})

const addresses = computed(() => {
Expand Down

0 comments on commit 7ee697c

Please sign in to comment.