diff --git a/src/main/java/com/ffii/fpsms/modules/jobOrder/service/PlasticBagPrinterService.kt b/src/main/java/com/ffii/fpsms/modules/jobOrder/service/PlasticBagPrinterService.kt
index 74ac5e7..334fc94 100644
--- a/src/main/java/com/ffii/fpsms/modules/jobOrder/service/PlasticBagPrinterService.kt
+++ b/src/main/java/com/ffii/fpsms/modules/jobOrder/service/PlasticBagPrinterService.kt
@@ -43,11 +43,12 @@ open class PlasticBagPrinterService(
val baos = ByteArrayOutputStream()
ZipOutputStream(baos).use { zos ->
- // Reduced sizes to make files smaller while keeping readability/scanability
- val productBmp = createMonochromeBitmap(productName, 520) // was 704
- val codeBmp = createMonochromeBitmap(itemCode, 900) // was 1173
- val expBmp = createMonochromeBitmap(expiryDate, 900) // was 1173
- val qrBmp = createQrCodeBitmap("$itemCode|$lotNo|$expiryDate", 450) // was 1000
+ // Reduced heights by ~80% to hit the 12KB-17KB file size target
+ // These heights (100-180) will produce much smaller BMP files
+ val productBmp = createMonochromeBitmap(productName, 100)
+ val codeBmp = createMonochromeBitmap(itemCode, 180)
+ val expBmp = createMonochromeBitmap(expiryDate, 180)
+ val qrBmp = createQrCodeBitmap("$itemCode|$lotNo|$expiryDate", 250)
val nameFile = "${lotNo}_product.bmp"
val codeFile = "${lotNo}_code.bmp"
@@ -59,8 +60,8 @@ open class PlasticBagPrinterService(
addToZip(zos, expFile, expBmp.bytes)
addToZip(zos, qrFile, qrBmp.bytes)
- // Minified XML - no indentation/newlines between tags
- val imageXml = """""".trimIndent()
+ // The XML Width/Height must match the ACTUAL generated bitmap dimensions
+ val imageXml = """""".trimIndent()
addToZip(zos, "$lotNo.image", imageXml.toByteArray(Charsets.UTF_8))
diff --git a/src/main/java/com/ffii/fpsms/modules/master/service/ProductionScheduleService.kt b/src/main/java/com/ffii/fpsms/modules/master/service/ProductionScheduleService.kt
index 496c8b3..8df80c1 100644
--- a/src/main/java/com/ffii/fpsms/modules/master/service/ProductionScheduleService.kt
+++ b/src/main/java/com/ffii/fpsms/modules/master/service/ProductionScheduleService.kt
@@ -837,7 +837,7 @@ open class ProductionScheduleService(
if(isFriSat){
//record.daysLeft = record.daysLeft
- safetyStockDay = 2.6
+ safetyStockDay = 3.0
redLine = 3.0
}
@@ -1431,7 +1431,7 @@ open class ProductionScheduleService(
val sheet = workbook.createSheet(safeSheetName)
val headers = listOf(
- "Item Name", "Avg Qty Last Month", "Stock Qty", "Days Left",
+ "Item Code", "Item Name", "Avg Qty Last Month", "Stock Qty", "Days Left",
"Output Qty", "Batch Need", "Priority"
)
@@ -1449,13 +1449,15 @@ open class ProductionScheduleService(
val row = sheet.createRow(index + 1)
row.heightInPoints = 35f // Slightly taller for portrait readability
- row.createCell(0).apply { setCellValue(line["itemName"]?.toString() ?: ""); cellStyle = wrapStyle }
- row.createCell(1).apply { setCellValue(asDouble(line["avgQtyLastMonth"])); cellStyle = wrapStyle }
- row.createCell(2).apply { setCellValue(asDouble(line["stockQty"])); cellStyle = wrapStyle }
- row.createCell(3).apply { setCellValue(asDouble(line["daysLeft"])); cellStyle = wrapStyle }
- row.createCell(4).apply { setCellValue(asDouble(line["outputdQty"] ?: line["outputQty"])); cellStyle = wrapStyle }
- row.createCell(5).apply { setCellValue(asDouble(line["batchNeed"])); cellStyle = wrapStyle }
- row.createCell(6).apply { setCellValue(asDouble(line["itemPriority"])); cellStyle = wrapStyle }
+ var j = 0;
+ row.createCell(j++).apply { setCellValue(line["itemCode"]?.toString() ?: ""); cellStyle = wrapStyle }
+ row.createCell(j++).apply { setCellValue(line["itemName"]?.toString() ?: ""); cellStyle = wrapStyle }
+ row.createCell(j++).apply { setCellValue(asDouble(line["avgQtyLastMonth"])); cellStyle = wrapStyle }
+ row.createCell(j++).apply { setCellValue(asDouble(line["stockQty"])); cellStyle = wrapStyle }
+ row.createCell(j++).apply { setCellValue(asDouble(line["daysLeft"])); cellStyle = wrapStyle }
+ row.createCell(j++).apply { setCellValue(asDouble(line["outputdQty"] ?: line["outputQty"])); cellStyle = wrapStyle }
+ row.createCell(j++).apply { setCellValue(asDouble(line["batchNeed"])); cellStyle = wrapStyle }
+ row.createCell(j++).apply { setCellValue(asDouble(line["itemPriority"])); cellStyle = wrapStyle }
}
// Auto-size with wider limits for portrait
@@ -1744,7 +1746,8 @@ open class ProductionScheduleService(
where ps.produceAt >= :fromDate
and ps.id = (select id from production_schedule where produceAt = ps.produceAt order by id desc limit 1)
- -- and it.code = 'PP2236'
+ -- This is water
+ AND it.code != 'GI3236'
-- order by ps.produceAt asc, psl.itemPriority desc, itemCode asc
group by matCode
""";
@@ -1796,6 +1799,7 @@ open class ProductionScheduleService(
LIMIT 1
)
AND bm.itemId IS NOT NULL
+ AND itm.code != 'GI3236'
GROUP BY
itm.id,
DATE(ps.produceAt)