From 6ecd56dd9523c468979627868082ba33805fc8fe Mon Sep 17 00:00:00 2001 From: "usama.jameel" Date: Tue, 7 Jan 2025 11:18:21 +0500 Subject: [PATCH 1/3] fixed transactions And job card view --- .../java/com/utopiaindustries/service/InventoryService.java | 3 ++- src/main/resources/templates/inventory-account-list.html | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/utopiaindustries/service/InventoryService.java b/src/main/java/com/utopiaindustries/service/InventoryService.java index 659a53b..f469fbb 100644 --- a/src/main/java/com/utopiaindustries/service/InventoryService.java +++ b/src/main/java/com/utopiaindustries/service/InventoryService.java @@ -308,6 +308,7 @@ public class InventoryService { if(item.getTotalProduction() == null){ item.setTotalProduction(BigDecimal.ZERO); } + item.setJobCardId(jobCard.getId()); // select which has inventory if ( item.getProduction( ).compareTo( BigDecimal.ZERO ) != 0 ) { // production is completed out bundles @@ -362,7 +363,7 @@ public class InventoryService { stitchingOfflineItem.setCreatedBy( authentication.getName( )); stitchingOfflineItem.setItemId( jobCardItem.getItemId( )); stitchingOfflineItem.setSku( jobCardItem.getSku( )); - stitchingOfflineItem.setJobCardId( jobCardItem.getId( )); + stitchingOfflineItem.setJobCardId( jobCardItem.getJobCardId( )); stitchingOfflineItem.setIsQa( false ); long id = stitchingOfflineItemDAO.save( stitchingOfflineItem); stitchingOfflineItem.setId( id); diff --git a/src/main/resources/templates/inventory-account-list.html b/src/main/resources/templates/inventory-account-list.html index 6db5c9d..fd1cf58 100644 --- a/src/main/resources/templates/inventory-account-list.html +++ b/src/main/resources/templates/inventory-account-list.html @@ -36,7 +36,7 @@ - + From aeaf74c021e08988c84d435c887100bd69eb50a8 Mon Sep 17 00:00:00 2001 From: "usama.jameel" Date: Tue, 7 Jan 2025 12:45:34 +0500 Subject: [PATCH 2/3] fixed inventory account sidebar And add functionality in backend --- .../InventoryAccountController.java | 14 +++- .../ctp/InventoryAccountQueryBuilder.java | 26 ++++-- .../service/InventoryAccountService.java | 30 +++++++ .../templates/_inventory-account-sidebar.html | 79 +++++++------------ .../templates/cutting/inventory-accounts.html | 2 +- .../resources/templates/job-card-list.html | 4 +- .../resources/templates/job-card-view.html | 10 +-- 7 files changed, 96 insertions(+), 69 deletions(-) diff --git a/src/main/java/com/utopiaindustries/controller/InventoryAccountController.java b/src/main/java/com/utopiaindustries/controller/InventoryAccountController.java index 4a450c2..30f0400 100644 --- a/src/main/java/com/utopiaindustries/controller/InventoryAccountController.java +++ b/src/main/java/com/utopiaindustries/controller/InventoryAccountController.java @@ -3,6 +3,7 @@ package com.utopiaindustries.controller; import com.utopiaindustries.auth.AdminRole; import com.utopiaindustries.model.ctp.InventoryAccount; import com.utopiaindustries.service.InventoryAccountService; +import com.utopiaindustries.util.StringUtils; import org.springframework.stereotype.Controller; import org.springframework.ui.Model; import org.springframework.web.bind.annotation.*; @@ -20,8 +21,17 @@ public class InventoryAccountController { } @GetMapping - public String showInventoryAccounts( Model model ){ - model.addAttribute( "accounts", inventoryAccountService.findInventoryAccounts() ); + public String showInventoryAccounts( @RequestParam( value = "id", required = false ) String id, + @RequestParam( value = "title", required = false) String title, + @RequestParam( value = "active", required = false ) String active, + @RequestParam( value = "created-by", required = false ) String createdBy, + @RequestParam( value = "start-date", required = false ) String startDate, + @RequestParam( value = "end-date", required = false ) String endDate, + @RequestParam( value = "site-id", required = false ) String siteId, + @RequestParam( value = "count", required = false ) Long count, + Model model ){ + + model.addAttribute( "accounts", inventoryAccountService.findInventoryAccountsByFilter(id, title, active, createdBy, startDate, endDate, siteId, count) ); return "inventory-account-list"; } diff --git a/src/main/java/com/utopiaindustries/querybuilder/ctp/InventoryAccountQueryBuilder.java b/src/main/java/com/utopiaindustries/querybuilder/ctp/InventoryAccountQueryBuilder.java index 11e5df9..d8618eb 100644 --- a/src/main/java/com/utopiaindustries/querybuilder/ctp/InventoryAccountQueryBuilder.java +++ b/src/main/java/com/utopiaindustries/querybuilder/ctp/InventoryAccountQueryBuilder.java @@ -54,15 +54,25 @@ public class InventoryAccountQueryBuilder { .and() .columnEqualToOrLessThan("created_at", endDate1) .and() - .columnEquals("location_site_id", siteId) - .and() - .columnEquals("parent_entity_type", parentEntityType ) - .and() - .columnEquals("parent_entity_id", parentEntityId ) - .and() - .columnEquals("is_packaging", isPackaging ); + .columnEquals("location_site_id", siteId); - if (!accountIds.isEmpty()) { + + if (isPackaging != null){ + qb.and() + .columnEquals("is_packaging", isPackaging ); + } + + if (parentEntityId != null && !parentEntityId.equals("")){ + qb.and() + .columnEquals("parent_entity_id", parentEntityId ); + } + + if (parentEntityType != null && !parentEntityType.equals("")){ + qb.and() + .columnEquals("parent_entity_type", parentEntityType ); + } + + if ( accountIds != null && !accountIds.isEmpty()) { qb.and() .columnIn("id", accountIds.toArray( new Long[0] )); } diff --git a/src/main/java/com/utopiaindustries/service/InventoryAccountService.java b/src/main/java/com/utopiaindustries/service/InventoryAccountService.java index d83b4a7..70d2af4 100644 --- a/src/main/java/com/utopiaindustries/service/InventoryAccountService.java +++ b/src/main/java/com/utopiaindustries/service/InventoryAccountService.java @@ -78,6 +78,36 @@ public class InventoryAccountService { return accounts; } + public List findInventoryAccountsByFilter(String id, String title, String active, String createdBy, String startDate, String endDate, + String siteId, Long count){ + List accounts; + if( StringUtils.isAnyNotNullOrEmpty( id,title, active, createdBy, startDate, endDate, siteId ) ){ + String query = InventoryAccountQueryBuilder.buildQuery( + id, + title, + active, + createdBy, + startDate, + endDate, + siteId, + count, + null, + "", + "", + null + + ); + System.out.println( query ); + accounts = inventoryAccountDAO.findByQuery( query ); + } else { + accounts = inventoryAccountDAO.findAll(); + } + for( InventoryAccount account : accounts ){ + account.setLocationTitle( locationSiteDAO.find( account.getLocationSiteId() ).getTitle() ); + } + return accounts; + } + public InventoryAccount createNewAccount(){ // get login user Authentication authentication = SecurityContextHolder.getContext().getAuthentication(); diff --git a/src/main/resources/templates/_inventory-account-sidebar.html b/src/main/resources/templates/_inventory-account-sidebar.html index 5e10cbf..484e305 100644 --- a/src/main/resources/templates/_inventory-account-sidebar.html +++ b/src/main/resources/templates/_inventory-account-sidebar.html @@ -7,72 +7,49 @@
Refine Your Search
+
+ + +
- +
- - -
-
- - + + +
-
- - -
-
-
- - -
-
- - -
-
-
- - + +
- - + +
- - + + +
+
+
-
- - + +
+ - Reset + Reset
diff --git a/src/main/resources/templates/cutting/inventory-accounts.html b/src/main/resources/templates/cutting/inventory-accounts.html index 044c3dc..6151dcd 100644 --- a/src/main/resources/templates/cutting/inventory-accounts.html +++ b/src/main/resources/templates/cutting/inventory-accounts.html @@ -45,7 +45,7 @@ - ACTIVE + ACTIVE INACTIVE diff --git a/src/main/resources/templates/job-card-list.html b/src/main/resources/templates/job-card-list.html index 37ba409..c0cba3f 100644 --- a/src/main/resources/templates/job-card-list.html +++ b/src/main/resources/templates/job-card-list.html @@ -37,11 +37,11 @@ - + - - + - diff --git a/src/main/resources/templates/job-card-view.html b/src/main/resources/templates/job-card-view.html index 8d785da..5fda209 100644 --- a/src/main/resources/templates/job-card-view.html +++ b/src/main/resources/templates/job-card-view.html @@ -119,8 +119,8 @@ - - + + @@ -153,9 +153,9 @@ - - - + + + From ff953006cff2bb0d09b53312d43c2a72ed62e22e Mon Sep 17 00:00:00 2001 From: "usama.jameel" Date: Wed, 8 Jan 2025 12:51:42 +0500 Subject: [PATCH 3/3] fixed keyboard option on barcode scan field for tablet --- .../resources/static/js/vue-components.js | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/src/main/resources/static/js/vue-components.js b/src/main/resources/static/js/vue-components.js index cb34779..db173f3 100644 --- a/src/main/resources/static/js/vue-components.js +++ b/src/main/resources/static/js/vue-components.js @@ -53,6 +53,9 @@ if ( typeof Vue !== 'undefined' ) { }, clearTextOnSelect: { default: false + }, + inputMode:{ + default: 'text' } }, data: function() { @@ -212,6 +215,7 @@ if ( typeof Vue !== 'undefined' ) { v-bind:required="required" v-bind:disabled="disabled" v-bind:readonly="readOnly" + v-bind:inputmode="inputMode" v-bind:class="{ 'is-invalid': ( showInputErrorOnZeroId && ( entityId === 0 || entityId == null ) ) }" autocomplete="off"> @@ -3398,6 +3402,9 @@ if ( typeof Vue !== 'undefined' ) { }, filter : { default : true + }, + inputMode: { + default : 'none' } } }) @@ -3434,6 +3441,9 @@ if ( typeof Vue !== 'undefined' ) { }, received : { default : false + }, + inputMode: { + default : 'none' } } }) @@ -3467,6 +3477,9 @@ if ( typeof Vue !== 'undefined' ) { codeFieldName : { default : 'code' }, + inputMode: { + default : 'none' + } } }); @@ -3503,6 +3516,9 @@ if ( typeof Vue !== 'undefined' ) { }, isSegregated : { default : false + }, + inputMode: { + default : 'none' } } }) @@ -3535,6 +3551,9 @@ if ( typeof Vue !== 'undefined' ) { }, codeFieldName : { default : 'bundleCode' + }, + inputMode: { + default : 'none' } } })