Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
elsiosanchez authored Sep 24, 2024
1 parent 7ff3b59 commit e91e4af
Show file tree
Hide file tree
Showing 4 changed files with 53 additions and 25 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ along with this program. If not, see <https:www.gnu.org/licenses/>.
<el-row>
<el-col :span="24">
<el-divider>
{{ '1 ' + editLine.uom.uom.name + ' (' + editLine.uom.uom.symbol + ') ' + ' ~ ' + displayQuantity(editLine) + ' ' + editLine.uom.product_uom.name + ' (' + editLine.uom.product_uom.symbol + ') ' }}
{{ '1' + displayUOM(editLine) }}
</el-divider>
</el-col>
</el-row>
Expand Down Expand Up @@ -406,6 +406,14 @@ export default defineComponent({
})
}

function displayUOM(line) {
const {
uom,
product_uom
} = line.uom
return uom.name + ' (' + uom.symbol + ') ' + ' ~ ' + displayQuantity(line) + ' ' + product_uom.name + ' (' + product_uom.symbol + ') '
}

return {
visible,
listUOM,
Expand All @@ -419,6 +427,7 @@ export default defineComponent({
currentPos,
qtyWarehouseLine,
updateUOM,
displayUOM,
formatPrice,
updatePrice,
showListUOM,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,22 +27,19 @@ along with this program. If not, see <https:www.gnu.org/licenses/>.
type="danger"
icon="el-icon-delete"
style="margin-left: 2px;"
:disabled="line.isLoading"
:loading="line.isLoading"
:disabled="line.isLoading"
@click="deleteLine()"
/>
</p>
</template>

<script>
import { defineComponent } from '@vue/composition-api'
import store from '@/store'
// Components and Mixins
import infoLine from '@/components/ADempiere/Form/VPOS2/MainOrder/OptionLine/infoLine'
import editLine from '@/components/ADempiere/Form/VPOS2/MainOrder/OptionLine/editLine/index.vue'
// import lang from '@/lang'
import store from '@/store'
// Utils and Helper Methods
// import { copyToClipboard } from '@/utils/ADempiere/coreUtils.js'

export default defineComponent({
name: 'OptionLine',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,27 @@ along with this program. If not, see <https:www.gnu.org/licenses/>.
<template>
<el-popover
placement="right-start"
:title="$t('form.productInfo.productInformation')"
width="850"
trigger="click"
>
<el-card
shadow="never"
:body-style="{ padding: '5px' }"
>
<p
style="text-align: center;font-size: larger;"
>
<b>
{{ $t('form.productInfo.productInformation') }}
</b>
</p>
<el-row>
<el-col :span="6">
<el-skeleton style="width: 240px" :loading="true" animated>
<el-skeleton
style="width: 240px"
:loading="true"
animated
>
<template slot="template">
<el-skeleton-item
variant="image"
Expand All @@ -39,7 +49,9 @@ along with this program. If not, see <https:www.gnu.org/licenses/>.
<el-col :span="18">
<el-row>
<el-col :span="14">
<p style="text-align: left;">
<p
style="text-align: left;"
>
{{ $t('form.productInfo.code') }}:
<b>
{{ infoLine.product.value }}
Expand Down Expand Up @@ -92,7 +104,7 @@ along with this program. If not, see <https:www.gnu.org/licenses/>.
</el-col>
<el-col :span="24">
<el-divider>
{{ '1 ' + infoLine.uom.uom.name + ' (' + infoLine.uom.uom.symbol + ') ' + ' ~ ' + displayQuantity(infoLine) + ' ' + infoLine.uom.product_uom.name + ' (' + infoLine.uom.product_uom.symbol + ') ' }}
{{ '1 ' + displayUOM(infoLine) }}
</el-divider>
</el-col>
</el-row>
Expand All @@ -108,29 +120,37 @@ along with this program. If not, see <https:www.gnu.org/licenses/>.
</template>

<script>
import { defineComponent, computed } from '@vue/composition-api'
// import lang from '@/lang'
import store from '@/store'
import {
defineComponent,
computed,
ref
} from '@vue/composition-api'
// Utils and Helper Methods
import { formatPrice, formatQuantity } from '@/utils/ADempiere/formatValue/numberFormat'
import { isEmptyValue } from '@/utils/ADempiere/valueUtils'
// import { copyToClipboard } from '@/utils/ADempiere/coreUtils.js'

export default defineComponent({
name: 'infoLine',
name: 'InfoLine',
props: {
infoLine: {
type: Object,
default: () => {}
}
},
setup() {
// Ref
const activeName = ref('infoProduct')
// Computed
const currency = computed(() => {
const { price_list } = store.getters.getCurrentOrder
if (!isEmptyValue(price_list)) return price_list.currency.iso_code
return ''
})

// Methods

function displayQuantity(line) {
const { uom } = line
const {
Expand All @@ -140,8 +160,22 @@ export default defineComponent({
if (Number(divide_rate.value) >= Number(multiply_rate.value)) return formatQuantity({ value: divide_rate.value })
return formatQuantity({ value: multiply_rate.value })
}

function displayUOM(line) {
const {
uom,
product_uom
} = line.uom
return uom.name + ' ( ' + uom.symbol + ' ) ' + ' ~ ' + displayQuantity(line) + ' ' + product_uom.name + ' (' + product_uom.symbol + ') '
}

return {
// Ref
activeName,
// Computed
currency,
// Methods
displayUOM,
formatPrice,
formatQuantity,
displayQuantity
Expand Down
12 changes: 0 additions & 12 deletions src/components/ADempiere/Form/VPOS2/MainOrder/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -63,11 +63,6 @@ along with this program. If not, see <https:www.gnu.org/licenses/>.
:handle-change="updateCurrentPrice"
/>
</span>
<!-- <edit-amount
v-if="scope.row.isEditCurrentPrice && valueOrder.columnName === 'CurrentPrice'"
:value="Number(scope.row.price)"
:handle-change="updateCurrentPrice"
/> -->
<span
v-else-if="scope.row.isEditQtyEntered && valueOrder.columnName === 'QtyEntered'"
>
Expand Down Expand Up @@ -116,12 +111,10 @@ along with this program. If not, see <https:www.gnu.org/licenses/>.
width="150"
style="padding: 0px !important;"
>
<!-- <template slot-scope="scope"> -->
<option-line
slot-scope="scope"
:line="scope.row"
/>
<!-- </template> -->
</el-table-column>
</el-table>
</span>
Expand Down Expand Up @@ -243,11 +236,6 @@ export default defineComponent({

function editLine(row, column, cell) {
const { columnKey } = column
// const {
// is_modify_price,
// is_allows_modify_quantity,
// is_allows_modify_discount
// } = currentPos.value
if (columnKey === 'CurrentPrice') row.isEditCurrentPrice = true
if (columnKey === 'QtyEntered') row.isEditQtyEntered = true
if (columnKey === 'Discount') row.isEditDiscount = true
Expand Down

0 comments on commit e91e4af

Please sign in to comment.