Add computed properties for costs in DestinationMassHandlingCostRow, refine tariff rate message, and enhance description handling logic in MaterialFastExcelMapper
This commit is contained in:
parent
aa6b2db962
commit
607c057beb
3 changed files with 35 additions and 5 deletions
|
|
@ -29,7 +29,7 @@
|
||||||
<div>
|
<div>
|
||||||
<div>Automatic tariff rate determination was ambiguous</div>
|
<div>Automatic tariff rate determination was ambiguous</div>
|
||||||
<div class="tariff-rate-info-text">
|
<div class="tariff-rate-info-text">
|
||||||
Please contact a customs expert to obtain correct HS code and tariff rate.
|
Please correct tariff rate or continue with default value.
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -27,7 +27,7 @@
|
||||||
|
|
||||||
<div class="text-container" :class="{disabled: disabled}">
|
<div class="text-container" :class="{disabled: disabled}">
|
||||||
<input class="input-field"
|
<input class="input-field"
|
||||||
v-model="row.handling_costs"
|
v-model="handling"
|
||||||
@blur="validateHandlingCost($event, 'handling')"
|
@blur="validateHandlingCost($event, 'handling')"
|
||||||
autocomplete="off"
|
autocomplete="off"
|
||||||
:disabled="disabled"/>
|
:disabled="disabled"/>
|
||||||
|
|
@ -38,7 +38,7 @@
|
||||||
|
|
||||||
<div class="text-container" :class="{disabled: disabled}">
|
<div class="text-container" :class="{disabled: disabled}">
|
||||||
<input class="input-field"
|
<input class="input-field"
|
||||||
v-model="row.repackaging_costs"
|
v-model="repackaging"
|
||||||
@blur="validateHandlingCost($event, 'repackaging')"
|
@blur="validateHandlingCost($event, 'repackaging')"
|
||||||
autocomplete="off"
|
autocomplete="off"
|
||||||
:disabled="disabled"/>
|
:disabled="disabled"/>
|
||||||
|
|
@ -49,7 +49,7 @@
|
||||||
|
|
||||||
<div class="text-container" :class="{disabled: disabled}">
|
<div class="text-container" :class="{disabled: disabled}">
|
||||||
<input class="input-field"
|
<input class="input-field"
|
||||||
v-model="row.disposal_costs"
|
v-model="disposal"
|
||||||
@blur="validateHandlingCost($event, 'disposal')"
|
@blur="validateHandlingCost($event, 'disposal')"
|
||||||
autocomplete="off"
|
autocomplete="off"
|
||||||
:disabled="disabled"/>
|
:disabled="disabled"/>
|
||||||
|
|
@ -79,6 +79,33 @@ export default {
|
||||||
required: true
|
required: true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
computed: {
|
||||||
|
repackaging: {
|
||||||
|
get() {
|
||||||
|
return this.row.repackaging_costs?.toFixed(2) ?? '';
|
||||||
|
},
|
||||||
|
set(value) {
|
||||||
|
this.row.repackaging_costs && (this.row.repackaging_costs = value);
|
||||||
|
},
|
||||||
|
},
|
||||||
|
handling: {
|
||||||
|
get() {
|
||||||
|
return this.row.handling_costs?.toFixed(2) ?? '';
|
||||||
|
},
|
||||||
|
set(value) {
|
||||||
|
this.row.handling_costs && (this.row.handling_costs = value);
|
||||||
|
},
|
||||||
|
},
|
||||||
|
disposal: {
|
||||||
|
get() {
|
||||||
|
return this.row.disposal_costs?.toFixed(2) ?? '';
|
||||||
|
},
|
||||||
|
set(value) {
|
||||||
|
this.row.disposal_costs && (this.row.disposal_costs = value);
|
||||||
|
},
|
||||||
|
|
||||||
|
}
|
||||||
|
},
|
||||||
methods: {
|
methods: {
|
||||||
handleMouseDown(event) {
|
handleMouseDown(event) {
|
||||||
if (event.shiftKey || event.ctrlKey) {
|
if (event.shiftKey || event.ctrlKey) {
|
||||||
|
|
|
||||||
|
|
@ -167,10 +167,13 @@ public class MaterialFastExcelMapper {
|
||||||
try {
|
try {
|
||||||
// Extract and validate data
|
// Extract and validate data
|
||||||
String partNumber = getCellValue(row, MaterialHeader.PART_NUMBER.ordinal(), rowNumber);
|
String partNumber = getCellValue(row, MaterialHeader.PART_NUMBER.ordinal(), rowNumber);
|
||||||
String description = getCellValue(row, MaterialHeader.DESCRIPTION.ordinal(), rowNumber);
|
String description = getCellValueAllowEmpty(row, MaterialHeader.DESCRIPTION.ordinal(), rowNumber);
|
||||||
String hsCode = getCellValueAllowEmpty(row, MaterialHeader.HS_CODE.ordinal(), rowNumber);
|
String hsCode = getCellValueAllowEmpty(row, MaterialHeader.HS_CODE.ordinal(), rowNumber);
|
||||||
String operation = getCellValue(row, MaterialHeader.OPERATION.ordinal(), rowNumber);
|
String operation = getCellValue(row, MaterialHeader.OPERATION.ordinal(), rowNumber);
|
||||||
|
|
||||||
|
if(description == null || description.isEmpty())
|
||||||
|
description = partNumber;
|
||||||
|
|
||||||
// Validate lengths
|
// Validate lengths
|
||||||
validateLength(partNumber, 0, 12, "Part Number", rowNumber);
|
validateLength(partNumber, 0, 12, "Part Number", rowNumber);
|
||||||
if (hsCode != null)
|
if (hsCode != null)
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue