| @@ -158,6 +158,7 @@ open class JobOrderService( | |||||
| val (sufficientCount, insufficientCount) = if (jobOrder != null) { | val (sufficientCount, insufficientCount) = if (jobOrder != null) { | ||||
| calculateStockCounts(jobOrder, inventoriesMap) | calculateStockCounts(jobOrder, inventoriesMap) | ||||
| } else { | } else { | ||||
| Pair(null, null) | Pair(null, null) | ||||
| } | } | ||||
| @@ -688,7 +689,7 @@ open class JobOrderService( | |||||
| params["finishedGoodItemCode"] = stockInLineInfo.itemNo ?: "N/A" | params["finishedGoodItemCode"] = stockInLineInfo.itemNo ?: "N/A" | ||||
| params["finishedGoodItemName"] = stockInLineInfo.itemName ?: "N/A" | params["finishedGoodItemName"] = stockInLineInfo.itemName ?: "N/A" | ||||
| params["finishedGoodLotNo"] = stockInLineInfo.lotNo ?: "N/A" | params["finishedGoodLotNo"] = stockInLineInfo.lotNo ?: "N/A" | ||||
| params["productionQty"] = stockInLineInfo.acceptedQty?.toString() ?: "0" | |||||
| params["FGStockInQty"] = stockInLineInfo.acceptedQty?.toString() ?: "0" | |||||
| params["productionDate"] = productionDate | params["productionDate"] = productionDate | ||||
| params["expiryDate"] = expiryDate | params["expiryDate"] = expiryDate | ||||
| params["uom"] = uomDesc | params["uom"] = uomDesc | ||||
| @@ -13,5 +13,5 @@ interface WarehouseRepository : AbstractRepository<Warehouse, Long> { | |||||
| fun findByIdAndDeletedIsFalse(id: Serializable): Warehouse?; | fun findByIdAndDeletedIsFalse(id: Serializable): Warehouse?; | ||||
| fun findByCodeAndDeletedIsFalse(code: String): Warehouse?; | fun findByCodeAndDeletedIsFalse(code: String): Warehouse?; | ||||
| } | } | ||||
| @@ -633,8 +633,8 @@ open class BomService( | |||||
| val resolver = PathMatchingResourcePatternResolver() | val resolver = PathMatchingResourcePatternResolver() | ||||
| // val excels = resolver.getResources("bomImport/*.xlsx") | // val excels = resolver.getResources("bomImport/*.xlsx") | ||||
| //val excels = resolver.getResources("file:C:/Users/Kelvin YAU/Downloads/bom/*.xlsx") | //val excels = resolver.getResources("file:C:/Users/Kelvin YAU/Downloads/bom/*.xlsx") | ||||
| //val excels = resolver.getResources("file:C:/Users/Kelvin YAU/Downloads/bom/*.xlsx") | |||||
| val excels = resolver.getResources("file:C:/Users/kw093/Downloads/bom/bom/*.xlsx") | |||||
| val excels = resolver.getResources("file:C:/Users/Kelvin YAU/Downloads/bom/*.xlsx") | |||||
| //val excels = resolver.getResources("file:C:/Users/kw093/Downloads/bom/bom/*.xlsx") | |||||
| // val excels = resolver.getResources("file:C:/Users/2Fi/Desktop/Third Wave of BOM Excel/*.xlsx") | // val excels = resolver.getResources("file:C:/Users/2Fi/Desktop/Third Wave of BOM Excel/*.xlsx") | ||||
| println("size: ${excels.size}") | println("size: ${excels.size}") | ||||
| val logExcel = ClassPathResource("excelTemplate/bom_excel_issue_log.xlsx") | val logExcel = ClassPathResource("excelTemplate/bom_excel_issue_log.xlsx") | ||||
| @@ -158,6 +158,14 @@ open class StockInLineService( | |||||
| itemNo = item.code | itemNo = item.code | ||||
| this.stockIn = stockIn | this.stockIn = stockIn | ||||
| acceptedQty = request.acceptedQty | acceptedQty = request.acceptedQty | ||||
| // Set demandQty based on source | |||||
| if (jo != null && jo?.bom != null) { | |||||
| // For job orders, demandQty comes from BOM's outputQty | |||||
| this.demandQty = jo?.bom?.outputQty | |||||
| } else if (pol != null) { | |||||
| // For purchase orders, demandQty comes from PurchaseOrderLine's qty | |||||
| this.demandQty = pol.qty | |||||
| } | |||||
| dnNo = request.dnNo | dnNo = request.dnNo | ||||
| receiptDate = request.receiptDate?.atStartOfDay() ?: LocalDateTime.now() | receiptDate = request.receiptDate?.atStartOfDay() ?: LocalDateTime.now() | ||||
| productLotNo = request.productLotNo | productLotNo = request.productLotNo | ||||
| @@ -391,12 +399,20 @@ open class StockInLineService( | |||||
| // TODO: check all status to prevent reverting progress due to multiple users access to the same po? | // TODO: check all status to prevent reverting progress due to multiple users access to the same po? | ||||
| // return list of stock in line, update data grid with the list | // return list of stock in line, update data grid with the list | ||||
| stockInLine.apply { | stockInLine.apply { | ||||
| this.productionDate = request.productionDate?.atStartOfDay() ?: this.productionDate// maybe need to change the request to LocalDateTime | |||||
| this.productionDate = request.productionDate?.atStartOfDay() ?: this.productionDate | |||||
| this.productLotNo = request.productLotNo ?: this.productLotNo | this.productLotNo = request.productLotNo ?: this.productLotNo | ||||
| this.dnNo = request.dnNo ?: this.dnNo | this.dnNo = request.dnNo ?: this.dnNo | ||||
| // this.dnDate = request.dnDate?.atStartOfDay() ?: this.dnDate | // this.dnDate = request.dnDate?.atStartOfDay() ?: this.dnDate | ||||
| this.acceptedQty = request.acceptedQty | |||||
| this.demandQty = request.acceptQty | |||||
| this.acceptedQty = request.acceptQty ?: request.acceptedQty ?: this.acceptedQty | |||||
| // Set demandQty based on source | |||||
| if (this.jobOrder != null && this.jobOrder?.bom != null) { | |||||
| // For job orders, demandQty comes from BOM's outputQty | |||||
| this.demandQty = this.jobOrder?.bom?.outputQty ?: this.demandQty | |||||
| } else if (this.purchaseOrderLine != null) { | |||||
| // For purchase orders, demandQty comes from PurchaseOrderLine's qty | |||||
| this.demandQty = this.purchaseOrderLine?.qty ?: this.demandQty | |||||
| } | |||||
| // Don't overwrite demandQty with acceptQty from QC form | |||||
| this.invoiceNo = request.invoiceNo | this.invoiceNo = request.invoiceNo | ||||
| this.receiptDate = request.receiptDate?.atStartOfDay() ?: this.receiptDate | this.receiptDate = request.receiptDate?.atStartOfDay() ?: this.receiptDate | ||||
| // this.status = request.status | // this.status = request.status | ||||
| @@ -14,7 +14,7 @@ | |||||
| <parameter name="finishedGoodItemCode" class="java.lang.String"/> | <parameter name="finishedGoodItemCode" class="java.lang.String"/> | ||||
| <parameter name="finishedGoodItemName" class="java.lang.String"/> | <parameter name="finishedGoodItemName" class="java.lang.String"/> | ||||
| <parameter name="finishedGoodLotNo" class="java.lang.String"/> | <parameter name="finishedGoodLotNo" class="java.lang.String"/> | ||||
| <parameter name="productionQty" class="java.lang.String"/> | |||||
| <parameter name="FGStockInQty" class="java.lang.String"/> | |||||
| <parameter name="productionDate" class="java.lang.String"/> | <parameter name="productionDate" class="java.lang.String"/> | ||||
| <parameter name="expiryDate" class="java.lang.String"/> | <parameter name="expiryDate" class="java.lang.String"/> | ||||
| <parameter name="uom" class="java.lang.String"/> | <parameter name="uom" class="java.lang.String"/> | ||||
| @@ -79,7 +79,7 @@ | |||||
| <textElement verticalAlignment="Middle"> | <textElement verticalAlignment="Middle"> | ||||
| <font fontName="微軟正黑體" size="16" isBold="false"/> | <font fontName="微軟正黑體" size="16" isBold="false"/> | ||||
| </textElement> | </textElement> | ||||
| <textFieldExpression><![CDATA[$P{productionQty} + $P{shortName} + " (" + $P{uom} +")"]]></textFieldExpression> | |||||
| <textFieldExpression><![CDATA[$P{FGStockInQty} + $P{shortName} + " (" + $P{uom} +")"]]></textFieldExpression> | |||||
| </textField> | </textField> | ||||
| <line> | <line> | ||||
| <reportElement x="0" y="160" width="380" height="1" uuid="3e37c027-d6e9-4a88-b64d-58ba1dd3b22e"> | <reportElement x="0" y="160" width="380" height="1" uuid="3e37c027-d6e9-4a88-b64d-58ba1dd3b22e"> | ||||
| @@ -144,7 +144,7 @@ | |||||
| <textElement verticalAlignment="Middle"> | <textElement verticalAlignment="Middle"> | ||||
| <font fontName="微軟正黑體" size="16"/> | <font fontName="微軟正黑體" size="16"/> | ||||
| </textElement> | </textElement> | ||||
| <text><![CDATA[產出數量: | |||||
| <text><![CDATA[數量: | |||||
| ]]></text> | ]]></text> | ||||
| </staticText> | </staticText> | ||||
| <image> | <image> | ||||