Selaa lähdekoodia

Merge branch 'master' of https://git.2fi-solutions.com/jason/FPSMS-backend

reset-do-picking-order
Fai Luk 5 päivää sitten
vanhempi
commit
f312b45180
9 muutettua tiedostoa jossa 381 lisäystä ja 208 poistoa
  1. +65
    -0
      src/main/java/com/ffii/fpsms/modules/common/internalSetup/SetupController.kt
  2. +93
    -0
      src/main/java/com/ffii/fpsms/modules/common/internalSetup/inventorySetup.kt
  3. +6
    -2
      src/main/java/com/ffii/fpsms/modules/report/service/ReportService.kt
  4. +5
    -5
      src/main/java/com/ffii/fpsms/modules/report/service/StockTakeVarianceReportService.kt
  5. +8
    -8
      src/main/java/com/ffii/fpsms/modules/report/web/StockTakeVarianceReportController.kt
  6. +12
    -1
      src/main/java/com/ffii/fpsms/modules/stock/entity/InventoryLotLineRepository.kt
  7. +1
    -1
      src/main/resources/jasper/StockItemConsumptionTrendReport.jrxml
  8. +1
    -1
      src/main/resources/jasper/StockTakeVarianceReport.jrxml
  9. +190
    -190
      src/main/resources/qrCodeLabel/poItemPDF.jrxml

+ 65
- 0
src/main/java/com/ffii/fpsms/modules/common/internalSetup/SetupController.kt Näytä tiedosto

@@ -274,4 +274,69 @@ class SetupController(
)
}
}
@PostMapping("/inventory/print-lot-stockin-labels-by-store-ids")
fun printLotStockInLabelsByStoreIds(
@RequestBody request: Map<String, Any>
): ResponseEntity<Map<String, Any>> {

val printerId = (request["printerId"] as? Number)?.toLong()
val printQty = (request["printQty"] as? Number)?.toInt() ?: 1
val fromIndex = (request["fromIndex"] as? Number)?.toInt()
val toIndex = (request["toIndex"] as? Number)?.toInt()
// storeIds: ["2F","4F"]
val storeIds = (request["storeIds"] as? List<*>)?.mapNotNull { it?.toString() } ?: emptyList()

if (printerId == null) {
return ResponseEntity.badRequest().body(
mapOf(
"success" to false,
"message" to "printerId is required"
)
)
}
if (storeIds.isEmpty()) {
return ResponseEntity.badRequest().body(
mapOf(
"success" to false,
"message" to "storeIds is required"
)
)
}

return try {
val result = inventorySetup.printLotStockInLabelsByStoreIdsV1(
printerId = printerId,
storeIds = storeIds,
printQty = printQty,
fromIndex = fromIndex,
toIndex = toIndex
)

val body =
if (result.success) {
mapOf(
"success" to true,
"message" to "Lot stock-in labels printed successfully",
"lastIndex" to result.lastIndex,
"totalLots" to result.totalLots
)
} else {
mapOf(
"success" to false,
"message" to (result.errorMessage ?: "Printer error"),
"lastIndex" to result.lastIndex,
"totalLots" to result.totalLots
)
}

ResponseEntity.ok(body)
} catch (e: Exception) {
ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR).body(
mapOf(
"success" to false,
"message" to (e.message ?: "Unknown error occurred while printing lot stock-in labels")
)
)
}
}
}

+ 93
- 0
src/main/java/com/ffii/fpsms/modules/common/internalSetup/inventorySetup.kt Näytä tiedosto

@@ -471,4 +471,97 @@ open class InventorySetup {
errorMessage = null
)
}
@Transactional(rollbackFor = [Exception::class])
open fun printLotStockInLabelsByStoreIdsV1(
printerId: Long,
storeIds: List<String>,
printQty: Int = 1,
fromIndex: Int? = null,
toIndex: Int? = null
): PrintProgressResult {

if (storeIds.isEmpty()) {
return PrintProgressResult(
success = false,
lastIndex = -1,
totalLots = 0,
errorMessage = "storeIds is empty"
)
}

// 1. 查出对应 store_id 的 lot line
val allInventoryLotLines = inventoryLotLineRepository
.findAllByStoreIdsAndHasStockInLine(storeIds)

if (allInventoryLotLines.isEmpty()) {
return PrintProgressResult(
success = false,
lastIndex = -1,
totalLots = 0,
errorMessage = "no lots found for given storeIds"
)
}

val effectiveTotal = allInventoryLotLines.size

// 2. 计算要打印的 index 范围
val startIndex = (fromIndex ?: 0).coerceAtLeast(0)
val endIndex = (toIndex ?: (effectiveTotal - 1)).coerceAtMost(effectiveTotal - 1)

if (startIndex > endIndex || startIndex >= effectiveTotal) {
return PrintProgressResult(
success = false,
lastIndex = startIndex - 1,
totalLots = effectiveTotal,
errorMessage = "invalid index range"
)
}

var lastIndex = startIndex - 1

// 3. 逐张打印,遇到打印机错误就立即返回,支持断点续打
for (globalIndex in startIndex..endIndex) {
val inventoryLotLine = allInventoryLotLines[globalIndex]
val stockInLineId = inventoryLotLine.inventoryLot?.stockInLine?.id
?: return PrintProgressResult(
success = false,
lastIndex = lastIndex,
totalLots = effectiveTotal,
errorMessage = "Stock in line missing for inventoryLotLineId=${inventoryLotLine.id}"
)

try {
stockInLineService.printQrCode(
PrintQrCodeForSilRequest(
stockInLineId = stockInLineId,
printerId = printerId,
printQty = printQty
)
)
lastIndex = globalIndex
} catch (e: Exception) {
val msg = when {
e.message?.contains("paper", ignoreCase = true) == true ->
"Printer error (maybe out of paper): ${e.message}"
else ->
"Printer error: ${e.message}"
}

return PrintProgressResult(
success = false,
lastIndex = lastIndex,
totalLots = effectiveTotal,
errorMessage = msg
)
}
}

// 全部打印成功
return PrintProgressResult(
success = true,
lastIndex = lastIndex,
totalLots = effectiveTotal,
errorMessage = null
)
}
}

+ 6
- 2
src/main/java/com/ffii/fpsms/modules/report/service/ReportService.kt Näytä tiedosto

@@ -876,12 +876,16 @@ fun searchMaterialStockOutTraceabilityReport(
CASE WHEN COALESCE(item_agg.totalMisInputAndLost, 0) < 0 THEN CONCAT('(', FORMAT(-item_agg.totalMisInputAndLost, 0), ')') ELSE FORMAT(COALESCE(item_agg.totalMisInputAndLost, 0), 0) END as totalMisInputAndLost,
CASE WHEN COALESCE(item_agg.totalVariance, 0) < 0 THEN CONCAT('(', FORMAT(-item_agg.totalVariance, 0), ')') ELSE FORMAT(COALESCE(item_agg.totalVariance, 0), 0) END as totalVariance,
CASE WHEN COALESCE(item_agg.totalDefectiveGoods, 0) < 0 THEN CONCAT('(', FORMAT(-item_agg.totalDefectiveGoods, 0), ')') ELSE FORMAT(COALESCE(item_agg.totalDefectiveGoods, 0), 0) END as totalDefectiveGoods,
FORMAT(ROUND(COALESCE(item_agg.total_in_value, 0) - COALESCE(item_agg.total_out_value, 0), 2), 2) as totalStockBalance,
CASE
WHEN COALESCE(item_agg.totalCurrentBalance, 0) > 0
THEN FORMAT(ROUND((COALESCE(item_agg.total_in_value, 0) - COALESCE(item_agg.total_out_value, 0)) / item_agg.totalCurrentBalance, 2), 2)
ELSE '0.00'
END as avgUnitPrice
END as avgUnitPrice,
CASE
WHEN COALESCE(item_agg.totalCurrentBalance, 0) > 0
THEN FORMAT(ROUND(item_agg.totalCurrentBalance * (COALESCE(item_agg.total_in_value, 0) - COALESCE(item_agg.total_out_value, 0)) / item_agg.totalCurrentBalance, 2), 2)
ELSE '0.00'
END as totalStockBalance
FROM (
SELECT
agg.itemCode AS itemNo,


+ 5
- 5
src/main/java/com/ffii/fpsms/modules/report/service/StockTakeVarianceReportService.kt Näytä tiedosto

@@ -38,8 +38,8 @@ open class StockTakeVarianceReportService(
stockCategory: String?,
itemCode: String?,
storeLocation: String?,
lastInDateStart: String?, // 前端 startDateStart
lastInDateEnd: String?, // 前端 startDateEnd
stockTakeDateStart: String?,
stockTakeDateEnd: String?,
): List<Map<String, Any>> {
val args = mutableMapOf<String, Any>()
@@ -64,12 +64,12 @@ open class StockTakeVarianceReportService(
}
// 1) toDate:有填用傳入,沒填用今天
val toDate = (lastInDateEnd?.replace("/", "-")
val toDate = (stockTakeDateEnd?.replace("/", "-")
?: LocalDate.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd")))
// 2) fromDate:有填用傳入,沒填查 stock_ledger 最早日期
val fromDate = if (!lastInDateStart.isNullOrBlank()) {
lastInDateStart.replace("/", "-")
val fromDate = if (!stockTakeDateStart.isNullOrBlank()) {
stockTakeDateStart.replace("/", "-")
} else {
val minDateSql = """
SELECT DATE_FORMAT(MIN(sl.date), '%Y-%m-%d') AS firstDate


+ 8
- 8
src/main/java/com/ffii/fpsms/modules/report/web/StockTakeVarianceReportController.kt Näytä tiedosto

@@ -28,15 +28,15 @@ class StockTakeVarianceReportController(
* - stockCategory
* - itemCode
* - storeLocation
* - lastInDateStart / lastInDateEnd
* - stockTakeDateStart / stockTakeDateEnd
*/
@GetMapping("/print-stock-take-variance")
fun generateStockTakeVarianceReport(
@RequestParam(required = false) stockCategory: String?,
@RequestParam(required = false) itemCode: String?,
@RequestParam(required = false) storeLocation: String?,
@RequestParam(required = false) lastInDateStart: String?,
@RequestParam(required = false) lastInDateEnd: String?,
@RequestParam(required = false) stockTakeDateStart: String?,
@RequestParam(required = false) stockTakeDateEnd: String?,
): ResponseEntity<ByteArray> {
val parameters = mutableMapOf<String, Any>()

@@ -51,9 +51,9 @@ class StockTakeVarianceReportController(
parameters["balanceFilterStart"] = ""
parameters["balanceFilterEnd"] = ""

parameters["lastInDateStart"] = lastInDateStart ?: ""
parameters["lastInDateEnd"] = lastInDateEnd ?: ""
parameters["lastOutDateStart"] = ""
parameters["stockTakeDateStart"] = stockTakeDateStart ?: ""
parameters["stockTakeDateEnd"] = stockTakeDateEnd ?: ""
parameters["lastInDateEnd"] = ""
parameters["lastOutDateEnd"] = ""


@@ -62,8 +62,8 @@ class StockTakeVarianceReportController(
stockCategory = stockCategory,
itemCode = itemCode,
storeLocation = storeLocation,
lastInDateStart = lastInDateStart,
lastInDateEnd = lastInDateEnd,
stockTakeDateStart = stockTakeDateStart,
stockTakeDateEnd = stockTakeDateEnd,
)
val stockTakeDateDisplay = dbData
.mapNotNull { it["stockTakeDate"] as? String }


+ 12
- 1
src/main/java/com/ffii/fpsms/modules/stock/entity/InventoryLotLineRepository.kt Näytä tiedosto

@@ -106,5 +106,16 @@ fun findExpiredItems(@Param("today") today: LocalDate): List<InventoryLotLine>
""")
fun findAllByDeletedIsFalseAndHasStockInLine(): List<InventoryLotLine>


@Query("""
SELECT ill FROM InventoryLotLine ill
JOIN ill.warehouse w
JOIN ill.inventoryLot il
WHERE w.store_id IN :storeIds
AND ill.deleted = false
AND il.stockInLine IS NOT NULL
ORDER BY w.store_id, il.item.code, il.lotNo
""")
fun findAllByStoreIdsAndHasStockInLine(
@Param("storeIds") storeIds: List<String>
): List<InventoryLotLine>
}

+ 1
- 1
src/main/resources/jasper/StockItemConsumptionTrendReport.jrxml Näytä tiedosto

@@ -461,7 +461,7 @@
<textElement textAlignment="Left" verticalAlignment="Middle">
<font fontName="微軟正黑體" size="12" isBold="true"/>
</textElement>
<textFieldExpression><![CDATA[$P{lastOutDateStart} + " " + $P{lastOutDateEnd}]]></textFieldExpression>
<textFieldExpression><![CDATA[$P{lastOutDateStart} + " " + $P{lastOutDateEnd}]]></textFieldExpression>
</textField>
<staticText>
<reportElement x="10" y="53" width="90" height="23" uuid="fb09a559-f5fa-4e56-a891-87c600a2745a">


+ 1
- 1
src/main/resources/jasper/StockTakeVarianceReport.jrxml Näytä tiedosto

@@ -164,7 +164,7 @@
<textElement textAlignment="Left" verticalAlignment="Middle">
<font fontName="微軟正黑體" size="12" isBold="true"/>
</textElement>
<textFieldExpression><![CDATA[$P{stockTakeDateStart}+"至"+$P{stockTakeDateEnd}]]></textFieldExpression>
<textFieldExpression><![CDATA[$P{stockTakeDateStart}+" "+$P{stockTakeDateEnd}]]></textFieldExpression>
</textField>
<staticText>
<reportElement x="747" y="0" width="21" height="23" uuid="5a1b4b58-b7b1-48c9-b229-7e96392c6425">


+ 190
- 190
src/main/resources/qrCodeLabel/poItemPDF.jrxml Näytä tiedosto

@@ -1,192 +1,192 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- Created with Jaspersoft Studio version 6.17.0.final using JasperReports Library version 6.17.0-6d93193241dd8cc42629e188b94f9e0bc5722efd -->
<jasperReport xmlns="http://jasperreports.sourceforge.net/jasperreports" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports http://jasperreports.sourceforge.net/xsd/jasperreport.xsd" name="poItemPDF" printOrder="Horizontal" pageWidth="425" pageHeight="283" orientation="Landscape" columnWidth="421" leftMargin="2" rightMargin="2" topMargin="2" bottomMargin="2" uuid="6cb85eb9-3573-42f3-a293-099db250aec0">
<property name="com.jaspersoft.studio.unit." value="pixel"/>
<parameter name="lotNo" class="java.lang.String"/>
<parameter name="itemName" class="java.lang.String"/>
<parameter name="itemNo" class="java.lang.String"/>
<parameter name="poCode" class="java.lang.String"/>
<parameter name="qrCode" class="java.awt.Image"/>
<parameter name="acceptedQty" class="java.math.BigDecimal"/>
<parameter name="uom" class="java.lang.String"/>
<parameter name="isTransfer" class="java.lang.String"/>
<queryString>
<![CDATA[]]>
</queryString>
<field name="lotNo" class="java.lang.String"/>
<field name="itemName" class="java.lang.String"/>
<field name="itemNo" class="java.lang.String"/>
<field name="acceptedQty" class="java.lang.String"/>
<field name="uom" class="java.lang.String"/>
<field name="qrCode" class="java.awt.Image"/>
<field name="poCode" class="java.lang.String"/>
<field name="supplier" class="java.lang.String"/>
<field name="productionDate" class="java.lang.String"/>
<field name="expiryDate" class="java.lang.String"/>
<background>
<band splitType="Stretch"/>
</background>
<detail>
<band height="279" splitType="Stretch">
<textField>
<reportElement x="90" y="21" width="150" height="16" uuid="402f35fc-b11a-4bf1-982d-e12c622f38ea">
<property name="com.jaspersoft.studio.unit.height" value="px"/>
<property name="com.jaspersoft.studio.unit.width" value="px"/>
</reportElement>
<textElement>
<font fontName="微軟正黑體" size="12"/>
</textElement>
<textFieldExpression><![CDATA[$F{lotNo}]]></textFieldExpression>
</textField>
<staticText>
<reportElement x="10" y="21" width="80" height="16" uuid="f5f145f1-123f-4fe5-90fa-8550b3d2eb63"/>
<textElement textAlignment="Left">
<font fontName="微軟正黑體" size="12"/>
</textElement>
<text><![CDATA[批次編號:]]></text>
</staticText>
<staticText>
<reportElement x="10" y="49" width="80" height="16" uuid="c2041205-51f8-45bb-a1d1-e3de37eebed7"/>
<textElement textAlignment="Left">
<font fontName="微軟正黑體" size="12"/>
</textElement>
<text><![CDATA[供應商:]]></text>
</staticText>
<textField>
<reportElement x="90" y="49" width="150" height="16" uuid="ab82ca39-8840-4471-b7c0-cdeec9cb5693">
<property name="com.jaspersoft.studio.unit.height" value="px"/>
<property name="com.jaspersoft.studio.unit.width" value="px"/>
</reportElement>
<textElement>
<font fontName="微軟正黑體" size="12"/>
</textElement>
<textFieldExpression><![CDATA[$F{supplier}]]></textFieldExpression>
</textField>
<staticText>
<reportElement x="10" y="104" width="80" height="16" uuid="96d46fb1-939d-4f3e-b8f0-172b69b85e9f"/>
<textElement textAlignment="Left">
<font fontName="微軟正黑體" size="12"/>
</textElement>
<text><![CDATA[物料編號:]]></text>
</staticText>
<textField>
<reportElement x="90" y="104" width="150" height="16" uuid="1f289946-b945-4f79-8515-212368b8be3b">
<property name="com.jaspersoft.studio.unit.height" value="px"/>
<property name="com.jaspersoft.studio.unit.width" value="px"/>
</reportElement>
<textElement>
<font fontName="微軟正黑體" size="12"/>
</textElement>
<textFieldExpression><![CDATA[$F{itemNo}]]></textFieldExpression>
</textField>
<staticText>
<reportElement x="10" y="170" width="80" height="16" uuid="53a2d7cf-bd50-4264-abee-346823cd49dd"/>
<textElement textAlignment="Left">
<font fontName="微軟正黑體" size="12"/>
</textElement>
<text><![CDATA[數量:]]></text>
</staticText>
<textField textAdjust="StretchHeight">
<reportElement x="90" y="170" width="150" height="16" uuid="629d9af8-c73f-4614-ba9d-a582e2ed4a29">
<property name="com.jaspersoft.studio.unit.width" value="px"/>
<property name="com.jaspersoft.studio.unit.height" value="px"/>
</reportElement>
<textElement>
<font fontName="微軟正黑體" size="12"/>
</textElement>
<textFieldExpression><![CDATA[$F{acceptedQty} + " " + $F{uom}]]></textFieldExpression>
</textField>
<image>
<reportElement x="230" y="45" width="190" height="190" uuid="5dd35c73-973b-4f0d-9cad-13305a29a9fd">
<property name="com.jaspersoft.studio.unit.width" value="px"/>
<property name="com.jaspersoft.studio.unit.height" value="px"/>
</reportElement>
<imageExpression><![CDATA[$F{qrCode}]]></imageExpression>
</image>
<staticText>
<reportElement x="10" y="216" width="80" height="16" uuid="c62ac00a-c495-462c-93bc-97bdd3cdb395">
<property name="com.jaspersoft.studio.unit.height" value="px"/>
</reportElement>
<textElement textAlignment="Left">
<font fontName="微軟正黑體" size="12"/>
</textElement>
<text><![CDATA[收貨日期:]]></text>
</staticText>
<textField>
<reportElement x="90" y="216" width="150" height="16" uuid="74a5cfba-046d-42f4-92d7-113729514a6f">
<property name="com.jaspersoft.studio.unit.height" value="px"/>
<property name="com.jaspersoft.studio.unit.width" value="px"/>
</reportElement>
<textElement>
<font fontName="微軟正黑體" size="12"/>
</textElement>
<textFieldExpression><![CDATA[$F{productionDate}]]></textFieldExpression>
</textField>
<staticText>
<reportElement x="10" y="77" width="80" height="16" uuid="1b1efafd-049a-432e-93c4-9662273011f7"/>
<textElement textAlignment="Left">
<font fontName="微軟正黑體" size="12"/>
</textElement>
<text><![CDATA[採購訂單編號:]]></text>
</staticText>
<textField>
<reportElement x="90" y="77" width="150" height="16" uuid="b805e20a-9a36-45c8-8255-23b6cc58f47c">
<property name="com.jaspersoft.studio.unit.height" value="px"/>
<property name="com.jaspersoft.studio.unit.width" value="px"/>
</reportElement>
<textElement>
<font fontName="微軟正黑體" size="12"/>
</textElement>
<textFieldExpression><![CDATA[$P{poCode}]]></textFieldExpression>
</textField>
<staticText>
<reportElement x="10" y="132" width="80" height="16" uuid="5c3f9b03-222c-4c94-ab58-6bc86d44c5ce"/>
<textElement textAlignment="Left">
<font fontName="微軟正黑體" size="12"/>
</textElement>
<text><![CDATA[物料名稱:]]></text>
</staticText>
<textField textAdjust="StretchHeight">
<reportElement x="90" y="132" width="150" height="16" uuid="e04b094d-2d16-4060-b6d9-2e6033a673ab">
<property name="com.jaspersoft.studio.unit.width" value="px"/>
<property name="com.jaspersoft.studio.unit.height" value="px"/>
</reportElement>
<textElement>
<font fontName="微軟正黑體" size="12"/>
</textElement>
<textFieldExpression><![CDATA[$F{itemName}]]></textFieldExpression>
</textField>
<staticText>
<reportElement x="10" y="244" width="80" height="16" uuid="32edcad1-23c1-4d41-8c9a-352d9e6ef377"/>
<textElement textAlignment="Left">
<font fontName="微軟正黑體" size="12"/>
</textElement>
<text><![CDATA[到期日:]]></text>
</staticText>
<textField>
<reportElement x="90" y="244" width="150" height="16" uuid="97e4a9bb-fc84-4074-b523-ddf9eb9ed2d2">
<property name="com.jaspersoft.studio.unit.height" value="px"/>
<property name="com.jaspersoft.studio.unit.width" value="px"/>
</reportElement>
<textElement>
<font fontName="微軟正黑體" size="12"/>
</textElement>
<textFieldExpression><![CDATA[$F{expiryDate}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="250" y="216" width="150" height="44" uuid="d66a64b0-3335-4846-bcb0-a67594520055">
<property name="com.jaspersoft.studio.unit.width" value="px"/>
<property name="com.jaspersoft.studio.unit.height" value="px"/>
<printWhenExpression><![CDATA[$P{isTransfer} != null && !$P{isTransfer}.toString().trim().isEmpty()]]></printWhenExpression>
</reportElement>
<box>
<pen lineWidth="2.0"/>
</box>
<textElement textAlignment="Center" verticalAlignment="Middle">
<font fontName="微軟正黑體" size="12" isBold="true" isUnderline="true"/>
</textElement>
<textFieldExpression><![CDATA[$P{isTransfer}]]></textFieldExpression>
</textField>
</band>
</detail>
<!-- Created with Jaspersoft Studio version 6.21.3.final using JasperReports Library version 6.21.3-4a3078d20785ebe464f18037d738d12fc98c13cf -->
<jasperReport xmlns="http://jasperreports.sourceforge.net/jasperreports" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports http://jasperreports.sourceforge.net/xsd/jasperreport.xsd" name="poItemPDF" printOrder="Horizontal" pageWidth="425" pageHeight="283" orientation="Landscape" columnWidth="425" leftMargin="0" rightMargin="0" topMargin="0" bottomMargin="0" uuid="6cb85eb9-3573-42f3-a293-099db250aec0">
<property name="com.jaspersoft.studio.unit." value="pixel"/>
<parameter name="lotNo" class="java.lang.String"/>
<parameter name="itemName" class="java.lang.String"/>
<parameter name="itemNo" class="java.lang.String"/>
<parameter name="poCode" class="java.lang.String"/>
<parameter name="qrCode" class="java.awt.Image"/>
<parameter name="acceptedQty" class="java.math.BigDecimal"/>
<parameter name="uom" class="java.lang.String"/>
<parameter name="isTransfer" class="java.lang.String"/>
<queryString>
<![CDATA[]]>
</queryString>
<field name="lotNo" class="java.lang.String"/>
<field name="itemName" class="java.lang.String"/>
<field name="itemNo" class="java.lang.String"/>
<field name="acceptedQty" class="java.lang.String"/>
<field name="uom" class="java.lang.String"/>
<field name="qrCode" class="java.awt.Image"/>
<field name="poCode" class="java.lang.String"/>
<field name="supplier" class="java.lang.String"/>
<field name="productionDate" class="java.lang.String"/>
<field name="expiryDate" class="java.lang.String"/>
<background>
<band splitType="Stretch"/>
</background>
<detail>
<band height="279" splitType="Stretch">
<textField>
<reportElement x="90" y="14" width="150" height="16" uuid="402f35fc-b11a-4bf1-982d-e12c622f38ea">
<property name="com.jaspersoft.studio.unit.height" value="px"/>
<property name="com.jaspersoft.studio.unit.width" value="px"/>
</reportElement>
<textElement>
<font fontName="微軟正黑體" size="12"/>
</textElement>
<textFieldExpression><![CDATA[$F{lotNo}]]></textFieldExpression>
</textField>
<staticText>
<reportElement x="10" y="14" width="80" height="16" uuid="f5f145f1-123f-4fe5-90fa-8550b3d2eb63"/>
<textElement textAlignment="Left">
<font fontName="微軟正黑體" size="12"/>
</textElement>
<text><![CDATA[批次編號:]]></text>
</staticText>
<staticText>
<reportElement x="10" y="42" width="80" height="16" uuid="c2041205-51f8-45bb-a1d1-e3de37eebed7"/>
<textElement textAlignment="Left">
<font fontName="微軟正黑體" size="12"/>
</textElement>
<text><![CDATA[供應商:]]></text>
</staticText>
<textField>
<reportElement x="90" y="42" width="150" height="16" uuid="ab82ca39-8840-4471-b7c0-cdeec9cb5693">
<property name="com.jaspersoft.studio.unit.height" value="px"/>
<property name="com.jaspersoft.studio.unit.width" value="px"/>
</reportElement>
<textElement>
<font fontName="微軟正黑體" size="12"/>
</textElement>
<textFieldExpression><![CDATA[$F{supplier}]]></textFieldExpression>
</textField>
<staticText>
<reportElement x="10" y="97" width="80" height="16" uuid="96d46fb1-939d-4f3e-b8f0-172b69b85e9f"/>
<textElement textAlignment="Left">
<font fontName="微軟正黑體" size="12"/>
</textElement>
<text><![CDATA[物料編號:]]></text>
</staticText>
<textField>
<reportElement x="90" y="97" width="150" height="16" uuid="1f289946-b945-4f79-8515-212368b8be3b">
<property name="com.jaspersoft.studio.unit.height" value="px"/>
<property name="com.jaspersoft.studio.unit.width" value="px"/>
</reportElement>
<textElement>
<font fontName="微軟正黑體" size="12"/>
</textElement>
<textFieldExpression><![CDATA[$F{itemNo}]]></textFieldExpression>
</textField>
<staticText>
<reportElement x="10" y="163" width="80" height="16" uuid="53a2d7cf-bd50-4264-abee-346823cd49dd"/>
<textElement textAlignment="Left">
<font fontName="微軟正黑體" size="12"/>
</textElement>
<text><![CDATA[數量:]]></text>
</staticText>
<textField textAdjust="StretchHeight">
<reportElement x="90" y="163" width="150" height="16" uuid="629d9af8-c73f-4614-ba9d-a582e2ed4a29">
<property name="com.jaspersoft.studio.unit.width" value="px"/>
<property name="com.jaspersoft.studio.unit.height" value="px"/>
</reportElement>
<textElement>
<font fontName="微軟正黑體" size="12"/>
</textElement>
<textFieldExpression><![CDATA[$F{acceptedQty} + " " + $F{uom}]]></textFieldExpression>
</textField>
<image>
<reportElement x="230" y="45" width="190" height="190" uuid="5dd35c73-973b-4f0d-9cad-13305a29a9fd">
<property name="com.jaspersoft.studio.unit.width" value="px"/>
<property name="com.jaspersoft.studio.unit.height" value="px"/>
</reportElement>
<imageExpression><![CDATA[$F{qrCode}]]></imageExpression>
</image>
<staticText>
<reportElement x="10" y="209" width="80" height="16" uuid="c62ac00a-c495-462c-93bc-97bdd3cdb395">
<property name="com.jaspersoft.studio.unit.height" value="px"/>
</reportElement>
<textElement textAlignment="Left">
<font fontName="微軟正黑體" size="12"/>
</textElement>
<text><![CDATA[收貨日期:]]></text>
</staticText>
<textField>
<reportElement x="90" y="209" width="150" height="16" uuid="74a5cfba-046d-42f4-92d7-113729514a6f">
<property name="com.jaspersoft.studio.unit.height" value="px"/>
<property name="com.jaspersoft.studio.unit.width" value="px"/>
</reportElement>
<textElement>
<font fontName="微軟正黑體" size="12"/>
</textElement>
<textFieldExpression><![CDATA[$F{productionDate}]]></textFieldExpression>
</textField>
<staticText>
<reportElement x="10" y="70" width="80" height="16" uuid="1b1efafd-049a-432e-93c4-9662273011f7"/>
<textElement textAlignment="Left">
<font fontName="微軟正黑體" size="12"/>
</textElement>
<text><![CDATA[採購訂單編號:]]></text>
</staticText>
<textField>
<reportElement x="90" y="70" width="150" height="16" uuid="b805e20a-9a36-45c8-8255-23b6cc58f47c">
<property name="com.jaspersoft.studio.unit.height" value="px"/>
<property name="com.jaspersoft.studio.unit.width" value="px"/>
</reportElement>
<textElement>
<font fontName="微軟正黑體" size="12"/>
</textElement>
<textFieldExpression><![CDATA[$P{poCode}]]></textFieldExpression>
</textField>
<staticText>
<reportElement x="10" y="125" width="80" height="16" uuid="5c3f9b03-222c-4c94-ab58-6bc86d44c5ce"/>
<textElement textAlignment="Left">
<font fontName="微軟正黑體" size="12"/>
</textElement>
<text><![CDATA[物料名稱:]]></text>
</staticText>
<textField textAdjust="StretchHeight">
<reportElement x="90" y="125" width="150" height="16" uuid="e04b094d-2d16-4060-b6d9-2e6033a673ab">
<property name="com.jaspersoft.studio.unit.width" value="px"/>
<property name="com.jaspersoft.studio.unit.height" value="px"/>
</reportElement>
<textElement>
<font fontName="微軟正黑體" size="12"/>
</textElement>
<textFieldExpression><![CDATA[$F{itemName}]]></textFieldExpression>
</textField>
<staticText>
<reportElement x="10" y="237" width="80" height="16" uuid="32edcad1-23c1-4d41-8c9a-352d9e6ef377"/>
<textElement textAlignment="Left">
<font fontName="微軟正黑體" size="12"/>
</textElement>
<text><![CDATA[到期日:]]></text>
</staticText>
<textField>
<reportElement x="90" y="237" width="150" height="16" uuid="97e4a9bb-fc84-4074-b523-ddf9eb9ed2d2">
<property name="com.jaspersoft.studio.unit.height" value="px"/>
<property name="com.jaspersoft.studio.unit.width" value="px"/>
</reportElement>
<textElement>
<font fontName="微軟正黑體" size="12"/>
</textElement>
<textFieldExpression><![CDATA[$F{expiryDate}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="250" y="216" width="150" height="44" uuid="d66a64b0-3335-4846-bcb0-a67594520055">
<property name="com.jaspersoft.studio.unit.width" value="px"/>
<property name="com.jaspersoft.studio.unit.height" value="px"/>
<printWhenExpression><![CDATA[$P{isTransfer} != null && !$P{isTransfer}.toString().trim().isEmpty()]]></printWhenExpression>
</reportElement>
<box>
<pen lineWidth="2.0"/>
</box>
<textElement textAlignment="Center" verticalAlignment="Middle">
<font fontName="微軟正黑體" size="12" isBold="true" isUnderline="true"/>
</textElement>
<textFieldExpression><![CDATA[$P{isTransfer}]]></textFieldExpression>
</textField>
</band>
</detail>
</jasperReport>

Ladataan…
Peruuta
Tallenna