diff --git a/Areas/Inventory/Models/ItemMovementModel.cs b/Areas/Inventory/Models/ItemMovementModel.cs index 684f376..f8aa0cf 100644 --- a/Areas/Inventory/Models/ItemMovementModel.cs +++ b/Areas/Inventory/Models/ItemMovementModel.cs @@ -9,9 +9,9 @@ namespace PSTW_CentralSystem.Areas.Inventory.Models [Key] public int Id { get; set; } public int? ItemId { get; set; } - public int? ToStation { get; set; } - public int? ToStore { get; set; } - public int? ToUser { get; set; } + public int? LastStation { get; set; } + public int? LastStore { get; set; } + public int? LastUser { get; set; } [Comment("Repair, Calibration, Faulty, Ready To Deploy, On Delivery")] public string? ToOther { get; set; } public DateTime? sendDate { get; set; } @@ -21,15 +21,15 @@ namespace PSTW_CentralSystem.Areas.Inventory.Models public string? Remark { get; set; } public string? ConsignmentNote { get; set; } public DateTime Date { get; set; } - public int? LastUser { get; set; } - public int? LastStore{ get; set; } - public int? LastStation{ get; set; } + public int? ToUser { get; set; } + public int? ToStore{ get; set; } + public int? ToStation{ get; set; } [Comment("Repair, Calibration, Faulty, Ready To Deploy, On Delivery")] public string? LatestStatus { get; set; } public DateTime? receiveDate { get; set; } public bool MovementComplete { get; set; } = false; //public virtual ItemModel? Item { get; set; } - //[ForeignKey("ToStore")] + //[ForeignKey("LastStore")] [ForeignKey("ItemId")] public virtual ItemModel? Item { get; set; } [ForeignKey("ToStore")] diff --git a/Areas/Inventory/Views/InventoryMaster/ItemMovement.cshtml b/Areas/Inventory/Views/InventoryMaster/ItemMovement.cshtml index e788ac1..3b73f6b 100644 --- a/Areas/Inventory/Views/InventoryMaster/ItemMovement.cshtml +++ b/Areas/Inventory/Views/InventoryMaster/ItemMovement.cshtml @@ -228,12 +228,12 @@

- {{ movement.toOther === 'Return' ? 'Return' : (movement.toOther === 'On Delivery' ? 'Receive' : ( movement.toStation !== null ? 'Change' : ( movement.toOther == 'Faulty' || movement.toOther == 'Calibration' || movement.toOther == 'Repair' ? movement.toOther : ( movement.action == 'Register' ? 'Register' : 'Assign')))) }} + {{ movement.toOther === 'Return' ? 'Return' : (movement.toOther === 'On Delivery' ? 'Receive' : ( movement.lastStation !== null ? 'Change' : ( movement.toOther == 'Faulty' || movement.toOther == 'Calibration' || movement.toOther == 'Repair' ? movement.toOther : ( movement.action == 'Register' ? 'Register' : 'Assign')))) }}

@@ -278,13 +278,13 @@
- +

Start

-

User: {{ movement.toUserName }}

-

Station: {{ movement.toStationName }}

-

Store: {{ movement.toStoreName }}

+

User: {{ movement.lastUserName }}

+

Station: {{ movement.lastStationName }}

+

Store: {{ movement.lastStoreName }}

@@ -303,13 +303,13 @@
- +

End

-

User: {{ movement.lastUserName }}

-

Station: {{ movement.lastStationName }}

-

Store: {{ movement.lastStoreName }}

+

User: {{ movement.toUserName }}

+

Station: {{ movement.toStationName }}

+

Store: {{ movement.toStoreName }}

@@ -327,13 +327,13 @@

{{ movement.toOther === 'Return' ? 'Return' : (movement.toOther === 'On Delivery' ? 'Receive' : - ( movement.toStation !== null ? 'Change' : + ( movement.lastStation !== null ? 'Change' : ( movement.toOther == 'Faulty' || movement.toOther == 'Calibration' || movement.toOther == 'Repair' ? movement.toOther : ( movement.action == 'Register' ? 'Register' : 'Assign')))) }}

@@ -384,13 +384,13 @@
- +

Start

-

User: {{ movement.toUserName }}

-

Station: {{ movement.toStationName }}

-

Store: {{ movement.toStoreName }}

+

User: {{ movement.lastUserName }}

+

Station: {{ movement.lastStationName }}

+

Store: {{ movement.lastStoreName }}

@@ -409,13 +409,13 @@
- +

End

-

User: {{ movement.lastUserName }}

-

Station: {{ movement.lastStationName }}

-

Store: {{ movement.lastStoreName }}

+

User: {{ movement.toUserName }}

+

Station: {{ movement.toStationName }}

+

Store: {{ movement.toStoreName }}

@@ -458,12 +458,12 @@ Latest Movement

- {{ movement.toOther === 'Return' ? 'Return' : (movement.toOther === 'On Delivery' ? 'Receive' : ( movement.toStation !== null ? 'Change' : ( movement.toOther == 'Faulty' || movement.toOther == 'Calibration' || movement.toOther == 'Repair' ? movement.toOther : ( movement.action == 'Register' ? 'Register' : 'Assign')))) }} + {{ movement.toOther === 'Return' ? 'Return' : (movement.toOther === 'On Delivery' ? 'Receive' : ( movement.lastStation !== null ? 'Change' : ( movement.toOther == 'Faulty' || movement.toOther == 'Calibration' || movement.toOther == 'Repair' ? movement.toOther : ( movement.action == 'Register' ? 'Register' : 'Assign')))) }}

@@ -506,13 +506,13 @@
- +

Start

-

User: {{ movement.toUserName }}

-

Station: {{ movement.toStationName }}

-

Store: {{ movement.toStoreName }}

+

User: {{ movement.lastUserName }}

+

Station: {{ movement.lastStationName }}

+

Store: {{ movement.lastStoreName }}

@@ -529,13 +529,13 @@

- +

End

-

User: {{ movement.lastUserName }}

-

Station: {{ movement.lastStationName }}

-

Store: {{ movement.lastStoreName }}

+

User: {{ movement.toUserName }}

+

Station: {{ movement.toStationName }}

+

Store: {{ movement.toStoreName }}

@@ -552,12 +552,12 @@

- {{ movement.toOther === 'Return' ? 'Return' : (movement.toOther === 'On Delivery' ? 'Receive' : ( movement.toStation !== null ? 'Change' : ( movement.toOther == 'Faulty' || movement.toOther == 'Calibration' || movement.toOther == 'Repair' ? movement.toOther : ( movement.action == 'Register' ? 'Register' : 'Assign')))) }} + {{ movement.toOther === 'Return' ? 'Return' : (movement.toOther === 'On Delivery' ? 'Receive' : ( movement.lastStation !== null ? 'Change' : ( movement.toOther == 'Faulty' || movement.toOther == 'Calibration' || movement.toOther == 'Repair' ? movement.toOther : ( movement.action == 'Register' ? 'Register' : 'Assign')))) }}

@@ -606,9 +606,9 @@

Start

-

User: {{ movement.toUserName }}

-

Station: {{ movement.toStationName }}

-

Store: {{ movement.toStoreName }}

+

User: {{ movement.lastUserName }}

+

Station: {{ movement.lastStationName }}

+

Store: {{ movement.lastStoreName }}

@@ -627,13 +627,13 @@
- +

End

-

User: {{ movement.lastUserName }}

-

Station: {{ movement.lastStationName }}

-

Store: {{ movement.lastStoreName }}

+

User: {{ movement.toUserName }}

+

Station: {{ movement.toStationName }}

+

Store: {{ movement.toStoreName }}

@@ -741,7 +741,7 @@ selectedCompany: "", selectedDepartment: "", selectedTeamType: "", - selectedtoStation: "", + selectedlastStation: "", consignmentNoteUrl: "", assignStationDatatable: null, showItemModal: false, @@ -844,7 +844,7 @@ if (movements.length > 0) { let latestMovement = movements[0]; - let station = latestMovement.lastStationName || latestMovement.toStationName || "Not Assigned"; + let station = latestMovement.toStationName || latestMovement.lastStationName || "Not Assigned"; if (!groupedByStation[station]) { groupedByStation[station] = {}; } @@ -963,13 +963,13 @@ "columns": [ { title: "Unique Id", data: "id" }, { title: "Product Code", data: "uniqueID" }, - { title: "From User", data: "toUserName" }, - { title: "Last User", data: "lastUserName" }, + { title: "From User", data: "lastUserName" }, + { title: "Last User", data: "toUserName" }, { title: "Completion", data: "movementComplete", render: function (data) {return data ? "Completed" : "Pending";}}, - { title: "From Station", data: "toStationName" }, - { title: "Last Station", data: "lastStationName" }, - { title: "From Store", data: "toStoreName" }, - { title: "Last Store", data: "lastStoreName" }, + { title: "From Station", data: "lastStationName" }, + { title: "Last Station", data: "toStationName" }, + { title: "From Store", data: "lastStoreName" }, + { title: "Last Store", data: "toStoreName" }, { title: "Action", data: "action" }, { title: "Start Status", data: "toOther" }, { title: "Latest Status", data: "latestStatus" }, @@ -1063,10 +1063,10 @@ } else { const data = await response.json(); this.items = data.filter(item => - item.toUser === this.currentUser.id || item.lastUser === this.currentUser.id || - item.toStore === this.currentUser.store || - item.lastStore === this.currentUser.store + item.toUser === this.currentUser.id || + item.lastStore === this.currentUser.store || + item.toStore === this.currentUser.store ); this.initAllTables(); @@ -1163,10 +1163,10 @@ { title: "Product Code", data: "uniqueID" }, { title: "Action", data: "action" }, { title: "Send Date", data: "sendDate" , render: this.formatDate.bind(this)}, - { title: "From User", data: "toUserName" }, - { title: "Last User", data: "lastUserName" }, - { title: "From Station", data: "toStationName" }, - { title: "From Store", data: "toStoreName" }, + { title: "From User", data: "lastUserName" }, + { title: "Last User", data: "toUserName" }, + { title: "From Station", data: "lastStationName" }, + { title: "From Store", data: "lastStoreName" }, { title: "Start Status", data: "toOther" }, { title: "Product Category", data: "productCategory" }, { title: "Qty", data: "quantity" }, @@ -1186,12 +1186,12 @@ { title: "Send Date", data: "sendDate", render: this.formatDate.bind(this) }, { title: "Receive Date", data: "receiveDate", render: this.formatDate.bind(this) }, { title: "Action", data: "action" }, - { title: "From User", data: "toUserName" }, - { title: "Last User", data: "lastUserName" }, - { title: "From Station", data: "toStationName" }, - { title: "Last Station", data: "lastStationName" }, - { title: "From Store", data: "toStoreName" }, - { title: "Last Store", data: "lastStoreName" }, + { title: "From User", data: "lastUserName" }, + { title: "Last User", data: "toUserName" }, + { title: "From Station", data: "lastStationName" }, + { title: "Last Station", data: "toStationName" }, + { title: "From Store", data: "lastStoreName" }, + { title: "Last Store", data: "toStoreName" }, { title: "Start Status", data: "toOther" }, { title: "Latest Status", data: "latestStatus" }, { title: "Product Category", data: "productCategory" }, @@ -1210,9 +1210,9 @@ { title: "Product Code", data: "uniqueID" }, { title: "Assign Date", data: "sendDate", render: this.formatDate.bind(this) }, { title: "Action", data: "action" }, - { title: "Station User PIC", data: "toUserName" }, - { title: "From Station", data: "toStationName" }, - { title: "Last Station", data: "lastStationName" }, + { title: "Station User PIC", data: "lastUserName" }, + { title: "From Station", data: "lastStationName" }, + { title: "Last Station", data: "toStationName" }, { title: "Qty", data: "quantity" }, { title: "Note", data: "consignmentNote", render: renderFile }, { title: "Remark", data: "remark" }, diff --git a/Areas/Inventory/Views/InventoryMaster/QrMaster.cshtml b/Areas/Inventory/Views/InventoryMaster/QrMaster.cshtml index 3f39ef1..f88a720 100644 --- a/Areas/Inventory/Views/InventoryMaster/QrMaster.cshtml +++ b/Areas/Inventory/Views/InventoryMaster/QrMaster.cshtml @@ -107,7 +107,7 @@ User: - {{ thisItem.toUserName }} + {{ thisItem.lastUserName }} @@ -116,14 +116,14 @@ Store: - {{ thisItem.toStoreName }} + {{ thisItem.lastStoreName }}
  • Station: - {{ thisItem.toStationName || 'N/A' }} + {{ thisItem.lastStationName || 'N/A' }}
  • @@ -148,7 +148,7 @@ @* Inv Master Receive Item *@ -
    +

    Receive Item

    @@ -165,7 +165,7 @@
    -
    +

    Cancel Item Movement

    @@ -185,7 +185,7 @@
    -
    +

    Receive Item

    @@ -227,7 +227,7 @@
    @* Inv Master Return Item & Deploy to Station*@ -
    +

    Item Actions

    -
    + @*

    Add Item Movement

    @@ -268,7 +268,7 @@
    -
    +
    *@

    Add Item Movement

    @@ -652,7 +652,7 @@
    @@ -804,6 +804,19 @@ showSerialNumber() { return this.showProduct.category === 'Asset' || this.showProduct.category === 'Part'; }, + filteredStationList() { + if (!this.stationlist || !this.currentUser) return []; + + return this.stationlist.filter(station => { + // Check 1: Must match User's Department + // const isSameDept = station.departmentId === this.selectedDepartment; + + // Check 2: Must match User's ID as the Station PIC + const isPIC = station.stationPicID === this.currentUser.id; + + return isPIC; + }); + }, }, methods: { // Split Url dapatkan unique ID Je @@ -960,11 +973,20 @@ const now = new Date(); const formData = { - ...(this.selectedAction === 'user' ? { toStore: this.currentUser.store, toUser: this.currentUser.id, toOther: 'On Delivery', SendDate: this.assigndate, lastUser: this.selectedUser, MovementComplete: false, Remark: this.remark, ConsignmentNote: this.document} : {}), - ...(this.selectedAction === 'station' ? { toStore: this.currentUser.store, toUser: this.currentUser.id, toOther: 'On Delivery', SendDate: this.assigndate, lastStation: this.selectedStation, lastUser: this.selectedStationPIC, MovementComplete: false, Remark: this.remark, ConsignmentNote: this.document} : {}), - ...(this.selectedAction === 'store' ? { toStore: this.currentUser.store, toUser: this.currentUser.id, toOther: 'On Delivery', SendDate: this.assigndate, lastStore: this.selectedStore, MovementComplete: false, Remark: this.remark, ConsignmentNote: this.document} : {}), - ...(this.selectedAction === 'supplier' ? { toStore: this.currentUser.store, toUser: this.currentUser.id, toOther: this.selectedOther, SendDate: this.assigndate, Remark: this.remark + '. Item sent to ' + this.selectedSupplier + ' for ' + this.selectedOther, ConsignmentNote: this.document, lastUser: this.currentUser.id, lastStore: this.currentUser.store, MovementComplete: false, } : {}), - ...(this.selectedAction === 'faulty' ? { toStore: this.currentUser.store, toUser: this.currentUser.id,toOther: 'Faulty', SendDate: new Date(now.getTime() + 8 * 60 * 60 * 1000).toISOString(), ReceiveDate: new Date(now.getTime() + 8 * 60 * 60 * 1000).toISOString(), Remark: this.remark, ConsignmentNote: this.document, MovementComplete: true, } : {}), + ...(this.selectedAction === 'user' ? { lastStore: this.currentUser.store, lastUser: this.currentUser.id, toOther: 'On Delivery', SendDate: this.assigndate, toUser: this.selectedUser, MovementComplete: false, Remark: this.remark, ConsignmentNote: this.document} : {}), + ...(this.selectedAction === 'station' ? { + lastStore: this.currentUser.store, + lastUser: this.currentUser.id, + toOther: 'On Delivery', + SendDate: this.assigndate, + toStation: this.selectedStation, + toUser: this.selectedStationPIC, + MovementComplete: false, + Remark: this.remark, + ConsignmentNote: this.document} : {}), + ...(this.selectedAction === 'store' ? { lastStore: this.currentUser.store, lastUser: this.currentUser.id, toOther: 'On Delivery', SendDate: this.assigndate, toStore: this.selectedStore, MovementComplete: false, Remark: this.remark, ConsignmentNote: this.document} : {}), + ...(this.selectedAction === 'supplier' ? { lastStore: this.currentUser.store, lastUser: this.currentUser.id, toOther: this.selectedOther, SendDate: this.assigndate, Remark: this.remark + '. Item sent to ' + this.selectedSupplier + ' for ' + this.selectedOther, ConsignmentNote: this.document, toUser: this.currentUser.id, toStore: this.currentUser.store, MovementComplete: false, } : {}), + ...(this.selectedAction === 'faulty' ? { lastStore: this.currentUser.store, lastUser: this.currentUser.id,toOther: 'Faulty', SendDate: new Date(now.getTime() + 8 * 60 * 60 * 1000).toISOString(), ReceiveDate: new Date(now.getTime() + 8 * 60 * 60 * 1000).toISOString(), Remark: this.remark, ConsignmentNote: this.document, MovementComplete: true, } : {}), ItemId: this.thisItem.itemID, Action: 'Stock Out', @@ -1012,11 +1034,13 @@ // Determine the status based on specific conditions let statusToSave = ""; - // 1. YOUR NEW LOGIC: If it's On Delivery and the current user is the target lastUser, set to Delivered - if (this.thisItem.toOther === "On Delivery" && this.thisItem.lastUser == this.currentUser.id) { - statusToSave = "Delivered"; - } - // 2. KEEP EXISTING LOGIC: Calibration/Repair/Return/General Delivery goes to Ready to Deploy + // If it's On Delivery and the current user/store is the target toUser/toStore, set to Delivered + if (this.thisItem.toOther === "On Delivery" && + (this.thisItem.toUser == this.currentUser.id || this.thisItem.toStore == this.currentUser.store)) + { + statusToSave = "Delivered"; + } + // Calibration/Repair/Return/General Delivery goes to Ready to Deploy else if ( this.thisItem.toOther === "Return" || this.thisItem.toOther === "Calibration" || @@ -1025,16 +1049,13 @@ ) { statusToSave = "Ready To Deploy"; } - // 3. KEEP EXISTING LOGIC: Store-to-Store delivery check - else if (this.itemlateststatus == 'On Delivery' && this.thisItem.lastStore == this.currentUser.store) { - statusToSave = "Delivered"; - } const formData = { Id: this.thisItem.movementId, ReceiveDate: new Date(now.getTime() + 8 * 60 * 60 * 1000).toISOString(), Remark: this.thisItem.remark, - LastUser: this.thisItem.lastuser == null ? this.currentUser.id : this.thisItem.lastuser, + ToUser: this.thisItem.touser == null ? this.currentUser.id : this.thisItem.touser, + ToStore: this.currentUser.store, LatestStatus: statusToSave // Uses the prioritized status from above }; @@ -1075,11 +1096,12 @@ this.itemlateststatus = this.thisItem.latestStatus ? this.thisItem.latestStatus : this.thisItem.toOther; this.itemassignedtouser = ( - (this.thisItem.toStore === this.currentUser.store || this.thisItem.lastStore === this.currentUser.store) - && this.currentUser.store != null + this.thisItem.departmentId === this.selectedDepartment && + this.selectedDepartment != null && + this.selectedDepartment !== "" ); // Debugging logs to help you verify in the browser console - console.log('Item Store ID:', this.thisItem.toStore); + console.log('Item Store ID:', this.thisItem.lastStore); console.log('User Master Store ID:', this.currentUser.store); console.log('Is User Authorized Master for this item?', this.itemassignedtouser); @@ -1151,16 +1173,16 @@ // Second Movement: Re-registration/Re-stock Record const registrationMovementData = { ItemId: this.thisItem.itemID, - ToStore: this.currentUser.store, - ToUser: this.currentUser.id, + LastStore: this.currentUser.store, + LastUser: this.currentUser.id, ToOther: null, sendDate: null, Action: 'Register', Quantity: this.thisItem.movementQuantity, Remark: null, ConsignmentNote: null, - LastUser: this.currentUser.id, - LastStore: this.currentUser.store, + ToUser: this.currentUser.id, + ToStore: this.currentUser.store, LatestStatus: 'Ready To Deploy', receiveDate: null, MovementComplete: true, @@ -1320,20 +1342,39 @@ const now = new Date(); const formData = { - ItemId: this.thisItem.itemID, - ToStore: this.thisItem.toStore, - ToUser: this.thisItem.toUser, // This will be handled by the API logic - ToOther: "Return", - SendDate: new Date(now.getTime() + 8 * 60 * 60 * 1000).toISOString(), - Action: "StockIn", - Quantity: this.thisItem.quantity || 1, - Remark: this.remark + " (Returned)", - ConsignmentNote: this.document, // The base64 string from handleFileUpload - Date: new Date(now.getTime() + 8 * 60 * 60 * 1000).toISOString(), - LastUser: this.currentUser.id, - LastStore: this.thisItem.toStore, - LatestStatus: null, - MovementComplete: false + // ItemId: this.thisItem.itemID, + // LastStore: this.thisItem.lastStore, + // LastUser: this.thisItem.lastUser, This will be handled by the API logic + // ToOther: "Return", + // SendDate: new Date(now.getTime() + 8 * 60 * 60 * 1000).toISOString(), + // Action: "StockIn", + // Quantity: this.thisItem.quantity || 1, + // Remark: this.remark + " (Returned)", + // ConsignmentNote: this.document, The base64 string from handleFileUpload + // Date: new Date(now.getTime() + 8 * 60 * 60 * 1000).toISOString(), + // ToUser: this.currentUser.id, + // ToStore: this.thisItem.lastStore, + // LatestStatus: null, + // MovementComplete: false + + ItemId: this.thisItem.itemID, + LastStation: this.thisItem.currentStationId, + LastStore: this.thisItem.currentStoreId, + LastUser: this.currentUser.id, + ToOther: "Return", + SendDate: new Date(now.getTime() + 8 * 60 * 60 * 1000).toISOString(), + Action: "StockIn", + // Quantity: this.thisItem.quantity, + Quantity: this.thisItem.movementQuantity || 1, + Remark: this.remark, + ConsignmentNote: this.consignmentNote, + Date: new Date(now.getTime() + 8 * 60 * 60 * 1000).toISOString(), + ToUser: this.thisItem.lastUser, + ToStore: this.thisItem.lastStore, + // ToStation: this.thisItem.lastStation, + LatestStatus: null, + ReceiveDate: null, + MovementComplete: false, }; try { @@ -1373,9 +1414,9 @@ const now = new Date(); const formData = { ItemId: this.thisItem.itemID, - ToStation: this.thisItem.ToStation, - ToStore: this.thisItem.toStore, - ToUser: this.currentUser.id, + LastStation: this.thisItem.lastStation || this.thisItem.currentStationId || null, + LastStore: this.currentUser.store, + LastUser: this.currentUser.id, ToOther: "Delivered", SendDate: new Date(now.getTime() + 8 * 60 * 60 * 1000).toISOString(), Action: "Assign", @@ -1383,9 +1424,9 @@ Remark: this.remark || "Deployed to station", ConsignmentNote: this.document, // Base64 from file upload Date: new Date(now.getTime() + 8 * 60 * 60 * 1000).toISOString(), - LastUser: this.currentUser.id, - LastStore: this.thisItem.toStore, - LastStation: this.selectedStation, // The new station ID selected in modal + ToUser: this.currentUser.id, + ToStore: this.currentUser.store, + ToStation: this.selectedStation, // The new station ID selected in modal LatestStatus: "Delivered", receiveDate: new Date(now.getTime() + 8 * 60 * 60 * 1000).toISOString(), MovementComplete: true diff --git a/Areas/Inventory/Views/ItemMovement/ItemMovementUser.cshtml b/Areas/Inventory/Views/ItemMovement/ItemMovementUser.cshtml index 251a6e6..655fb5f 100644 --- a/Areas/Inventory/Views/ItemMovement/ItemMovementUser.cshtml +++ b/Areas/Inventory/Views/ItemMovement/ItemMovementUser.cshtml @@ -172,10 +172,10 @@ Latest Movement

    - {{ movement.toOther === 'Return' ? 'Return' : (movement.toOther === 'On Delivery' ? 'Receive' : ( movement.toStation !== null ? 'Change' : 'Assign')) }} + {{ movement.toOther === 'Return' ? 'Return' : (movement.toOther === 'On Delivery' ? 'Receive' : ( movement.lastStation !== null ? 'Change' : 'Assign')) }}

    @@ -220,13 +220,13 @@
    - +

    Start

    -

    User: {{ movement.toUserName }}

    -

    Station: {{ movement.toStationName }}

    -

    Store: {{ movement.toStoreName }}

    +

    User: {{ movement.lastUserName }}

    +

    Station: {{ movement.lastStationName }}

    +

    Store: {{ movement.lastStoreName }}

    @@ -245,13 +245,13 @@
    - +

    End

    -

    User: {{ movement.lastUserName }}

    -

    Station: {{ movement.lastStationName }}

    -

    Store: {{ movement.lastStoreName }}

    +

    User: {{ movement.toUserName }}

    +

    Station: {{ movement.toStationName }}

    +

    Store: {{ movement.toStoreName }}

    @@ -267,10 +267,10 @@

    - {{ movement.toOther === 'Return' ? 'Return' : (movement.toOther === 'On Delivery' ? 'Receive' : ( movement.toStation !== null ? 'Change' : 'Assign')) }} + {{ movement.toOther === 'Return' ? 'Return' : (movement.toOther === 'On Delivery' ? 'Receive' : ( movement.lastStation !== null ? 'Change' : 'Assign')) }}

    @@ -314,13 +314,13 @@
    - +

    Start

    -

    User: {{ movement.toUserName }}

    -

    Station: {{ movement.toStationName }}

    -

    Store: {{ movement.toStoreName }}

    +

    User: {{ movement.lastUserName }}

    +

    Station: {{ movement.lastStationName }}

    +

    Store: {{ movement.lastStoreName }}

    @@ -339,13 +339,13 @@
    - +

    End

    -

    User: {{ movement.lastUserName }}

    -

    Station: {{ movement.lastStationName }}

    -

    Store: {{ movement.lastStoreName }}

    +

    User: {{ movement.toUserName }}

    +

    Station: {{ movement.toStationName }}

    +

    Store: {{ movement.toStoreName }}

    @@ -388,10 +388,10 @@ Latest Movement

    - {{ movement.toOther === 'Return' ? 'Return' : (movement.toOther === 'On Delivery' ? 'Receive' : ( movement.toStation !== null ? 'Change' : 'Assign')) }} + {{ movement.toOther === 'Return' ? 'Return' : (movement.toOther === 'On Delivery' ? 'Receive' : ( movement.lastStation !== null ? 'Change' : 'Assign')) }}

    @@ -434,13 +434,13 @@
    - +

    Start

    -

    User: {{ movement.toUserName }}

    -

    Station: {{ movement.toStationName }}

    -

    Store: {{ movement.toStoreName }}

    +

    User: {{ movement.lastUserName }}

    +

    Station: {{ movement.lastStationName }}

    +

    Store: {{ movement.lastStoreName }}

    @@ -457,13 +457,13 @@

    - +

    End

    -

    User: {{ movement.lastUserName }}

    -

    Station: {{ movement.lastStationName }}

    -

    Store: {{ movement.lastStoreName }}

    +

    User: {{ movement.toUserName }}

    +

    Station: {{ movement.toStationName }}

    +

    Store: {{ movement.toStoreName }}

    @@ -480,10 +480,10 @@

    - {{ movement.toOther === 'Return' ? 'Return' : (movement.toOther === 'On Delivery' ? 'Receive' : ( movement.toStation !== null ? 'Change' : 'Assign')) }} + {{ movement.toOther === 'Return' ? 'Return' : (movement.toOther === 'On Delivery' ? 'Receive' : ( movement.lastStation !== null ? 'Change' : 'Assign')) }}

    @@ -529,13 +529,13 @@
    - +

    Start

    -

    User: {{ movement.toUserName }}

    -

    Station: {{ movement.toStationName }}

    -

    Store: {{ movement.toStoreName }}

    +

    User: {{ movement.lastUserName }}

    +

    Station: {{ movement.lastStationName }}

    +

    Store: {{ movement.lastStoreName }}

    @@ -554,13 +554,13 @@
    - +

    End

    -

    User: {{ movement.lastUserName }}

    -

    Station: {{ movement.lastStationName }}

    -

    Store: {{ movement.lastStoreName }}

    +

    User: {{ movement.toUserName }}

    +

    Station: {{ movement.toStationName }}

    +

    Store: {{ movement.toStoreName }}

    @@ -761,7 +761,7 @@ if (movements.length > 0) { let latestMovement = movements[0]; - let station = latestMovement.lastStationName || latestMovement.toStationName || "Self Assigned"; + let station = latestMovement.toStationName || latestMovement.lastStationName || "Self Assigned"; if (!groupedByStation[station]) { groupedByStation[station] = {}; @@ -1037,10 +1037,10 @@ { title: "Action", data: "action" }, { title: "Send Date", data: "sendDate", render: this.formatDate.bind(this) }, { title: "Start Status", data: "toOther" }, - { title: "From User", data: "toUserName" }, - { title: "Last User", data: "lastUserName" }, - { title: "From Station", data: "toStationName" }, - { title: "From Store", data: "toStoreName" }, + { title: "From User", data: "lastUserName" }, + { title: "Last User", data: "toUserName" }, + { title: "From Station", data: "lastStationName" }, + { title: "From Store", data: "lastStoreName" }, { title: "Quantity", data: "quantity" }, { title: "Note", data: "consignmentNote", render: renderFile }, { title: "Remark", data: "remark" }, @@ -1055,17 +1055,17 @@ { title: "Unique Id", data: "id" }, { title: "Product Name", data: "productName", render: (data, type, full) => { return `${data}
    ${renderFile(full.productImage)}`; } }, { title: "Product Code", data: "uniqueID" }, - { title: "Send Date", data: "sendDate", render: this.formatDate.bind(this) }, - { title: "Receive Date", data: "receiveDate", render: this.formatDate.bind(this) }, + { title: "Send Date", data: "sendDate", render: this.formatDate.bind(this) }, + { title: "Receive Date", data: "receiveDate", render: this.formatDate.bind(this) }, { title: "Action", data: "action" }, { title: "Start Status", data: "toOther" }, { title: "Latest Status", data: "latestStatus" }, - { title: "From User", data: "toUserName" }, - { title: "Last User", data: "lastUserName" }, - { title: "From Station", data: "toStationName" }, - { title: "Last Station", data: "lastStationName" }, - { title: "From Store", data: "toStoreName" }, - { title: "Last Store", data: "lastStoreName" }, + { title: "From User", data: "lastUserName" }, + { title: "Last User", data: "toUserName" }, + { title: "From Station", data: "lastStationName" }, + { title: "Last Station", data: "toStationName" }, + { title: "From Store", data: "lastStoreName" }, + { title: "Last Store", data: "toStoreName" }, { title: "Qty", data: "quantity" }, { title: "Note", data: "consignmentNote", render: renderFile }, { title: "Remark", data: "remark" }, @@ -1082,9 +1082,9 @@ { title: "Product Code", data: "uniqueID" }, { title: "Assign Date", data: "sendDate", render: this.formatDate.bind(this) }, { title: "Action", data: "action" }, - { title: "Station User PIC", data: "toUserName" }, - { title: "From Station", data: "toStationName" }, - { title: "Last Station", data: "lastStationName" }, + { title: "Station User PIC", data: "lastUserName" }, + { title: "From Station", data: "lastStationName" }, + { title: "Last Station", data: "toStationName" }, { title: "Qty", data: "quantity" }, { title: "Note", data: "consignmentNote", render: renderFile }, { title: "Remark", data: "remark" }, diff --git a/Areas/Inventory/Views/ItemMovement/QrUser.cshtml b/Areas/Inventory/Views/ItemMovement/QrUser.cshtml index c874f73..9734ba5 100644 --- a/Areas/Inventory/Views/ItemMovement/QrUser.cshtml +++ b/Areas/Inventory/Views/ItemMovement/QrUser.cshtml @@ -54,11 +54,11 @@
    -
    +

    Item Receive Information :

    Station Assign

    -
    +

    Item Receive Information :

    Self Assign

    @@ -220,7 +220,9 @@
    - +
    @@ -236,7 +238,9 @@