aggio modif
This commit is contained in:
@@ -8255,9 +8255,28 @@ export const tools = {
|
||||
return 0
|
||||
},
|
||||
|
||||
getUnitsMeasure(unit: number, short: boolean) {
|
||||
const unitrec = shared_consts.Units_Of_Measure_ListBox.find((rec: any) => rec.value === unit)
|
||||
return unitrec ? (short ? unitrec.short : unitrec.label) : ''
|
||||
getUnitsMeasure(unit: number, short: boolean, weight: number | undefined) {
|
||||
let unitrec = shared_consts.Units_Of_Measure_ListBox.find((rec: any) => rec.value === unit)
|
||||
let mystr = ''
|
||||
if (unitrec && unitrec.value === shared_consts.UNITS_OF_MEASURE.CHILI && weight && weight < 1) {
|
||||
unitrec = shared_consts.Units_Of_Measure_ListBox.find((rec: any) => rec.value === shared_consts.UNITS_OF_MEASURE.GRAMMI)
|
||||
}
|
||||
if (unitrec && unitrec.value === shared_consts.UNITS_OF_MEASURE.LITRI && weight && weight < 1) {
|
||||
unitrec = shared_consts.Units_Of_Measure_ListBox.find((rec: any) => rec.value === shared_consts.UNITS_OF_MEASURE.MILLILITRI)
|
||||
}
|
||||
mystr = unitrec ? (short ? unitrec.short : unitrec.label) : ''
|
||||
return mystr
|
||||
},
|
||||
|
||||
getWeightByUnit(unit: number, short: boolean, weight: number|undefined) {
|
||||
let unitrec = shared_consts.Units_Of_Measure_ListBox.find((rec: any) => rec.value === unit)
|
||||
if (unitrec && unitrec.value === shared_consts.UNITS_OF_MEASURE.CHILI && weight && weight < 1) {
|
||||
return weight * 1000
|
||||
}
|
||||
if (unitrec && unitrec.value === shared_consts.UNITS_OF_MEASURE.LITRI && weight && weight < 1) {
|
||||
return weight * 1000
|
||||
}
|
||||
return weight
|
||||
},
|
||||
|
||||
getWeightTotalByOrder(order: IOrder) {
|
||||
|
||||
Reference in New Issue
Block a user