| @@ -36,10 +36,10 @@ interface StockInLineInfo { | |||||
| var productLotNo: String? | var productLotNo: String? | ||||
| @get:Value("#{target.stockIn?.supplier?.name}") | @get:Value("#{target.stockIn?.supplier?.name}") | ||||
| val supplier: String? | val supplier: String? | ||||
| @get:Value("#{target.purchaseOrderLine?.uom}") | |||||
| @get:Value("#{target.purchaseOrderLine?.uom ?: target.stockTakeLine?.uom}") | |||||
| val uom: UomConversion | val uom: UomConversion | ||||
| @get:Value("#{target.stockIn?.purchaseOrder?.code}") | @get:Value("#{target.stockIn?.purchaseOrder?.code}") | ||||
| val poCode: String | |||||
| val poCode: String? | |||||
| @get:Value("#{target.item?.type}") | @get:Value("#{target.item?.type}") | ||||
| val itemType: String | val itemType: String | ||||
| val dnNo: String | val dnNo: String | ||||
| @@ -197,26 +197,26 @@ open class InventoryLotLineService( | |||||
| val qrContent = QrContent(itemId = info.itemId, stockInLineId = info.id) | val qrContent = QrContent(itemId = info.itemId, stockInLineId = info.id) | ||||
| val qrCodeContent = (Json.encodeToString(qrContent)) | val qrCodeContent = (Json.encodeToString(qrContent)) | ||||
| // field["itemId"] = info.itemId | // field["itemId"] = info.itemId | ||||
| field["itemName"] = info.itemName!! | |||||
| field["itemName"] = info.itemName ?: "N/A" | |||||
| field["itemNo"] = info.itemNo | field["itemNo"] = info.itemNo | ||||
| field["poCode"] = info.poCode | |||||
| field["poCode"] = info.poCode ?: "N/A" | |||||
| field["itemType"] = info.itemType | field["itemType"] = info.itemType | ||||
| field["acceptedQty"] = info.acceptedQty.toString() | field["acceptedQty"] = info.acceptedQty.toString() | ||||
| field["uom"] = info.uom.udfudesc.toString() | |||||
| field["productionDate"] = info.productionDate?.format(DateTimeFormatter.ISO_LOCAL_DATE) ?: "" | |||||
| field["expiryDate"] = info.expiryDate?.format(DateTimeFormatter.ISO_LOCAL_DATE) ?: "" | |||||
| field["uom"] = (info.uom.udfudesc ?: "N/A").toString() | |||||
| field["productionDate"] = info.productionDate?.format(DateTimeFormatter.ISO_LOCAL_DATE) ?: "N/A" | |||||
| field["expiryDate"] = info.expiryDate?.format(DateTimeFormatter.ISO_LOCAL_DATE) ?: "N/A" | |||||
| field["lotNo"] = info.lotNo!! | field["lotNo"] = info.lotNo!! | ||||
| field["supplier"] = info.supplier!! | |||||
| field["supplier"] = info.supplier ?: "N/A" | |||||
| val image = QrCodeUtil.generateQRCodeImage(qrCodeContent) | val image = QrCodeUtil.generateQRCodeImage(qrCodeContent) | ||||
| field["qrCode"] = image | field["qrCode"] = image | ||||
| fields.add(field) | fields.add(field) | ||||
| } | } | ||||
| val params: MutableMap<String, Any> = mutableMapOf( | val params: MutableMap<String, Any> = mutableMapOf( | ||||
| "poCode" to qrCodeInfo[0].poCode | |||||
| "poCode" to (qrCodeInfo[0].poCode ?: "N/A") | |||||
| ) | ) | ||||
| return mapOf( | return mapOf( | ||||
| "report" to PdfUtils.fillReport(poLabel,fields, params), | "report" to PdfUtils.fillReport(poLabel,fields, params), | ||||
| "fileName" to qrCodeInfo[0].poCode | |||||
| "fileName" to (qrCodeInfo[0].poCode ?: qrCodeInfo[0].lotNo ?: "N/A") | |||||
| ); | ); | ||||
| } | } | ||||
| @@ -493,26 +493,26 @@ open class StockInLineService( | |||||
| val qrContent = QrContent(info.itemId, info.id) | val qrContent = QrContent(info.itemId, info.id) | ||||
| val qrCodeContent = (Json.encodeToString(qrContent)) | val qrCodeContent = (Json.encodeToString(qrContent)) | ||||
| // field["itemId"] = info.itemId | // field["itemId"] = info.itemId | ||||
| field["itemName"] = info.itemName!! | |||||
| field["itemName"] = info.itemName ?: "N/A" | |||||
| field["itemNo"] = info.itemNo | field["itemNo"] = info.itemNo | ||||
| field["poCode"] = info.poCode | |||||
| field["poCode"] = info.poCode ?: "N/A" | |||||
| field["itemType"] = info.itemType | field["itemType"] = info.itemType | ||||
| field["acceptedQty"] = info.acceptedQty.toString() | field["acceptedQty"] = info.acceptedQty.toString() | ||||
| field["uom"] = info.uom.udfudesc.toString() | |||||
| field["productionDate"] = info.productionDate?.format(DateTimeFormatter.ISO_LOCAL_DATE) ?: "" | |||||
| field["expiryDate"] = info.expiryDate?.format(DateTimeFormatter.ISO_LOCAL_DATE) ?: "" | |||||
| field["lotNo"] = info.lotNo ?: "" | |||||
| field["supplier"] = info.supplier!! | |||||
| field["uom"] = (info.uom.udfudesc ?: "N/A").toString() | |||||
| field["productionDate"] = info.productionDate?.format(DateTimeFormatter.ISO_LOCAL_DATE) ?: "N/A" | |||||
| field["expiryDate"] = info.expiryDate?.format(DateTimeFormatter.ISO_LOCAL_DATE) ?: "N/A" | |||||
| field["lotNo"] = info.lotNo ?: "N/A" | |||||
| field["supplier"] = info.supplier ?: "N/A" | |||||
| val image = QrCodeUtil.generateQRCodeImage(qrCodeContent) | val image = QrCodeUtil.generateQRCodeImage(qrCodeContent) | ||||
| field["qrCode"] = image | field["qrCode"] = image | ||||
| fields.add(field) | fields.add(field) | ||||
| } | } | ||||
| val params: MutableMap<String, Any> = mutableMapOf( | val params: MutableMap<String, Any> = mutableMapOf( | ||||
| "poCode" to qrCodeInfo[0].poCode | |||||
| "poCode" to (qrCodeInfo[0].poCode ?: "N/A") | |||||
| ) | ) | ||||
| return mapOf( | return mapOf( | ||||
| "report" to PdfUtils.fillReport(poLabel,fields, params), | "report" to PdfUtils.fillReport(poLabel,fields, params), | ||||
| "fileName" to qrCodeInfo[0].poCode | |||||
| "fileName" to (qrCodeInfo[0].poCode ?: qrCodeInfo[0].lotNo ?: "N/A") | |||||
| ); | ); | ||||
| } | } | ||||