| @@ -524,12 +524,22 @@ open class StockInLineService( | |||||
| val field = mutableMapOf<String, Any>() | val field = mutableMapOf<String, Any>() | ||||
| val qrContent = QrContent(info.itemId, info.id) | val qrContent = QrContent(info.itemId, info.id) | ||||
| val qrCodeContent = (Json.encodeToString(qrContent)) | val qrCodeContent = (Json.encodeToString(qrContent)) | ||||
| val stockItemUom = itemUomRepository.findBaseUnitByItemIdAndStockUnitIsTrueAndDeletedIsFalse( | |||||
| info.itemId | |||||
| ) | |||||
| val purchaseItemUom = itemUomRepository.findByItemIdAndPurchaseUnitIsTrueAndDeletedIsFalse(info.itemId) | |||||
| val acceptedQty = if (stockItemUom != null && purchaseItemUom != null) { | |||||
| (info.acceptedQty) * (purchaseItemUom.ratioN!! / purchaseItemUom.ratioD!!) / (stockItemUom.ratioN!! / stockItemUom.ratioD!!) | |||||
| } else { | |||||
| (info.acceptedQty) | |||||
| } | |||||
| // field["itemId"] = info.itemId | // field["itemId"] = info.itemId | ||||
| field["itemName"] = info.itemName ?: "N/A" | field["itemName"] = info.itemName ?: "N/A" | ||||
| field["itemNo"] = info.itemNo | field["itemNo"] = info.itemNo | ||||
| field["poCode"] = info.poCode ?: "N/A" | field["poCode"] = info.poCode ?: "N/A" | ||||
| field["itemType"] = info.itemType ?: "N/A" | field["itemType"] = info.itemType ?: "N/A" | ||||
| field["acceptedQty"] = info.acceptedQty.toString() | |||||
| field["acceptedQty"] = "%.2f".format(acceptedQty) | |||||
| field["uom"] = info.uom?.udfudesc.toString() ?: "N/A" | field["uom"] = info.uom?.udfudesc.toString() ?: "N/A" | ||||
| field["productionDate"] = info.productionDate?.format(DateTimeFormatter.ISO_LOCAL_DATE) ?: "" | field["productionDate"] = info.productionDate?.format(DateTimeFormatter.ISO_LOCAL_DATE) ?: "" | ||||
| field["expiryDate"] = info.expiryDate?.format(DateTimeFormatter.ISO_LOCAL_DATE) ?: "" | field["expiryDate"] = info.expiryDate?.format(DateTimeFormatter.ISO_LOCAL_DATE) ?: "" | ||||