diff --git a/src/main/java/com/ffii/fpsms/modules/stock/entity/StockInLine.kt b/src/main/java/com/ffii/fpsms/modules/stock/entity/StockInLine.kt index 443d83e..d04760c 100644 --- a/src/main/java/com/ffii/fpsms/modules/stock/entity/StockInLine.kt +++ b/src/main/java/com/ffii/fpsms/modules/stock/entity/StockInLine.kt @@ -83,4 +83,10 @@ open class StockInLine : BaseEntity() { @Column(name = "productLotNo") open var productLotNo: String? = null + @Column(name = "dnNo") + open var dnNo: String? = null + + @Column(name = "invoiceNo") + open var invoiceNo: String? = null + } \ No newline at end of file diff --git a/src/main/java/com/ffii/fpsms/modules/stock/service/StockInLineService.kt b/src/main/java/com/ffii/fpsms/modules/stock/service/StockInLineService.kt index 1a3ad2e..499251f 100644 --- a/src/main/java/com/ffii/fpsms/modules/stock/service/StockInLineService.kt +++ b/src/main/java/com/ffii/fpsms/modules/stock/service/StockInLineService.kt @@ -268,6 +268,8 @@ open class StockInLineService( // user = null this.productionDate = request.productionDate?.atStartOfDay() // maybe need to change the request to LocalDateTime this.productLotNo = request.productLotNo + this.dnNo = request.dnNo + this.invoiceNo = request.invoiceNo this.receiptDate = request.receiptDate?.atStartOfDay() this.status = request.status this.expiryDate = stockInLine.expiryDate ?: request.expiryDate @@ -314,6 +316,8 @@ open class StockInLineService( this.purchaseOrder = stockInLine.purchaseOrderLine?.purchaseOrder this.purchaseOrderLine = stockInLine.purchaseOrderLine this.productLotNo = stockInLine.productLotNo + this.dnNo = stockInLine.dnNo + this.invoiceNo = stockInLine.invoiceNo this.receiptDate = stockInLine.receiptDate this.stockIn = stockInLine.stockIn this.demandQty = stockInLine.demandQty @@ -346,6 +350,8 @@ open class StockInLineService( this.lotNo = savedInventoryLot?.lotNo ?: stockInLine.lotNo this.expiryDate = stockInLine.expiryDate ?: request.expiryDate this.productLotNo = stockInLine.productLotNo ?: request.productLotNo + this.dnNo = stockInLine.dnNo ?: request.dnNo + this.invoiceNo = stockInLine.invoiceNo ?: request.invoiceNo } val stockInLineEntries = listOf(stockInLine, newStockInLine) diff --git a/src/main/java/com/ffii/fpsms/modules/stock/web/model/SaveStockInRequest.kt b/src/main/java/com/ffii/fpsms/modules/stock/web/model/SaveStockInRequest.kt index 47eb4b1..8177d9c 100644 --- a/src/main/java/com/ffii/fpsms/modules/stock/web/model/SaveStockInRequest.kt +++ b/src/main/java/com/ffii/fpsms/modules/stock/web/model/SaveStockInRequest.kt @@ -44,6 +44,8 @@ data class SaveStockInLineRequest( var status: String?, var expiryDate: LocalDate?, var productLotNo: String?, + var dnNo: String?, + var invoiceNo: String?, var receiptDate: LocalDate?, var productionDate: LocalDate?, var qcResult: List?, diff --git a/src/main/resources/db/changelog/changes/20250725_01_derek/01_update_stock_in_line_with_dnNo_and_invoiceNo.sql b/src/main/resources/db/changelog/changes/20250725_01_derek/01_update_stock_in_line_with_dnNo_and_invoiceNo.sql new file mode 100644 index 0000000..0c63562 --- /dev/null +++ b/src/main/resources/db/changelog/changes/20250725_01_derek/01_update_stock_in_line_with_dnNo_and_invoiceNo.sql @@ -0,0 +1,6 @@ +-- liquibase formatted sql +-- changeset derek:update_stock_in_line_with_dnNo_and_invoiceNo + +ALTER TABLE `stock_in_line` + ADD COLUMN `dnNo` VARCHAR(100) NULL AFTER `productLotNo`, + ADD COLUMN `invoiceNo` VARCHAR(100) NULL AFTER `dnNo`; \ No newline at end of file