Compare commits

..

No commits in common. "0da5e307b6ed07743c9b0aff2dd3e919f9872596" and "87847bd054aec706d927821afe4f40b7a17fc6de" have entirely different histories.

10 changed files with 71 additions and 118 deletions

View File

@ -3,7 +3,6 @@ package com.utopiaindustries.controller;
import com.utopiaindustries.auth.AdminRole; import com.utopiaindustries.auth.AdminRole;
import com.utopiaindustries.model.ctp.InventoryAccount; import com.utopiaindustries.model.ctp.InventoryAccount;
import com.utopiaindustries.service.InventoryAccountService; import com.utopiaindustries.service.InventoryAccountService;
import com.utopiaindustries.util.StringUtils;
import org.springframework.stereotype.Controller; import org.springframework.stereotype.Controller;
import org.springframework.ui.Model; import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
@ -21,17 +20,8 @@ public class InventoryAccountController {
} }
@GetMapping @GetMapping
public String showInventoryAccounts( @RequestParam( value = "id", required = false ) String id, public String showInventoryAccounts( Model model ){
@RequestParam( value = "title", required = false) String title, model.addAttribute( "accounts", inventoryAccountService.findInventoryAccounts() );
@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"; return "inventory-account-list";
} }

View File

@ -54,25 +54,15 @@ public class InventoryAccountQueryBuilder {
.and() .and()
.columnEqualToOrLessThan("created_at", endDate1) .columnEqualToOrLessThan("created_at", endDate1)
.and() .and()
.columnEquals("location_site_id", siteId); .columnEquals("location_site_id", siteId)
.and()
.columnEquals("parent_entity_type", parentEntityType )
.and()
.columnEquals("parent_entity_id", parentEntityId )
.and()
.columnEquals("is_packaging", isPackaging );
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() qb.and()
.columnIn("id", accountIds.toArray( new Long[0] )); .columnIn("id", accountIds.toArray( new Long[0] ));
} }

View File

@ -78,36 +78,6 @@ public class InventoryAccountService {
return accounts; return accounts;
} }
public List<InventoryAccount> findInventoryAccountsByFilter(String id, String title, String active, String createdBy, String startDate, String endDate,
String siteId, Long count){
List<InventoryAccount> 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(){ public InventoryAccount createNewAccount(){
// get login user // get login user
Authentication authentication = SecurityContextHolder.getContext().getAuthentication(); Authentication authentication = SecurityContextHolder.getContext().getAuthentication();

View File

@ -308,7 +308,6 @@ public class InventoryService {
if(item.getTotalProduction() == null){ if(item.getTotalProduction() == null){
item.setTotalProduction(BigDecimal.ZERO); item.setTotalProduction(BigDecimal.ZERO);
} }
item.setJobCardId(jobCard.getId());
// select which has inventory // select which has inventory
if ( item.getProduction( ).compareTo( BigDecimal.ZERO ) != 0 ) { if ( item.getProduction( ).compareTo( BigDecimal.ZERO ) != 0 ) {
// production is completed out bundles // production is completed out bundles
@ -363,7 +362,7 @@ public class InventoryService {
stitchingOfflineItem.setCreatedBy( authentication.getName( )); stitchingOfflineItem.setCreatedBy( authentication.getName( ));
stitchingOfflineItem.setItemId( jobCardItem.getItemId( )); stitchingOfflineItem.setItemId( jobCardItem.getItemId( ));
stitchingOfflineItem.setSku( jobCardItem.getSku( )); stitchingOfflineItem.setSku( jobCardItem.getSku( ));
stitchingOfflineItem.setJobCardId( jobCardItem.getJobCardId( )); stitchingOfflineItem.setJobCardId( jobCardItem.getId( ));
stitchingOfflineItem.setIsQa( false ); stitchingOfflineItem.setIsQa( false );
long id = stitchingOfflineItemDAO.save( stitchingOfflineItem); long id = stitchingOfflineItemDAO.save( stitchingOfflineItem);
stitchingOfflineItem.setId( id); stitchingOfflineItem.setId( id);

View File

@ -53,9 +53,6 @@ if ( typeof Vue !== 'undefined' ) {
}, },
clearTextOnSelect: { clearTextOnSelect: {
default: false default: false
},
inputMode:{
default: 'text'
} }
}, },
data: function() { data: function() {
@ -215,7 +212,6 @@ if ( typeof Vue !== 'undefined' ) {
v-bind:required="required" v-bind:required="required"
v-bind:disabled="disabled" v-bind:disabled="disabled"
v-bind:readonly="readOnly" v-bind:readonly="readOnly"
v-bind:inputmode="inputMode"
v-bind:class="{ 'is-invalid': ( showInputErrorOnZeroId && ( entityId === 0 || entityId == null ) ) }" v-bind:class="{ 'is-invalid': ( showInputErrorOnZeroId && ( entityId === 0 || entityId == null ) ) }"
autocomplete="off"> autocomplete="off">
<!-- autocomplete list --> <!-- autocomplete list -->
@ -3402,9 +3398,6 @@ if ( typeof Vue !== 'undefined' ) {
}, },
filter : { filter : {
default : true default : true
},
inputMode: {
default : 'none'
} }
} }
}) })
@ -3441,9 +3434,6 @@ if ( typeof Vue !== 'undefined' ) {
}, },
received : { received : {
default : false default : false
},
inputMode: {
default : 'none'
} }
} }
}) })
@ -3477,9 +3467,6 @@ if ( typeof Vue !== 'undefined' ) {
codeFieldName : { codeFieldName : {
default : 'code' default : 'code'
}, },
inputMode: {
default : 'none'
}
} }
}); });
@ -3516,9 +3503,6 @@ if ( typeof Vue !== 'undefined' ) {
}, },
isSegregated : { isSegregated : {
default : false default : false
},
inputMode: {
default : 'none'
} }
} }
}) })
@ -3551,9 +3535,6 @@ if ( typeof Vue !== 'undefined' ) {
}, },
codeFieldName : { codeFieldName : {
default : 'bundleCode' default : 'bundleCode'
},
inputMode: {
default : 'none'
} }
} }
}) })

View File

@ -7,49 +7,72 @@
<div class="page-filters-sidebar"> <div class="page-filters-sidebar">
<form th:action="@{${#strings.replace(#httpServletRequest.requestURI, #request.getContextPath(), '')}}"> <form th:action="@{${#strings.replace(#httpServletRequest.requestURI, #request.getContextPath(), '')}}">
<h5 class="mb-4">Refine Your Search</h5> <h5 class="mb-4">Refine Your Search</h5>
<div class="form-group">
<label>ID</label>
<input type="text" class="form-control" name="id" maxlength="100" th:value="${param['id']}">
</div>
<div class="form-group"> <div class="form-group">
<label>Title</label> <label>Title</label>
<input type="text" class="form-control" name="title" maxlength="100" <input type="text" class="form-control" name="item-title" maxlength="100" th:value="${param['item-title']}">
th:value="${param['title']}">
</div> </div>
<div class="form-group"> <div class="form-group">
<label>Active</label> <label>Sku</label>
<select name="active" class="form-control" > <input type="text" class="form-control" name="item-sku" maxlength="100" th:value="${param['item-sku']}">
<option value="">Please select</option> </div>
<option value="1" th:selected="${#strings.equals(param['active'], #strings.toString(1))}">Active</option> <div class="form-group">
<option value="0" th:selected="${#strings.equals(param['active'], #strings.toString(0))}">In-Active</option> <label>Item Unit</label>
<select class="form-control" name="item-unit" th:value="${param['item-unit']}">
<option value="">Please Select</option>
<option th:each="itemUnit: ${itemUnits}"
th:value="${itemUnit.id}"
th:text="${itemUnit.title}"
th:selected="${#strings.equals(param['item-unit'], #strings.toString(itemUnit.id))}"></option>
</select> </select>
</div> </div>
<div class="form-group" th:if="${isShown}">
<label>Item Status</label>
<select class="form-control" name="item-request-approval-status" data-s2 multiple>
<option value="ALL" th:selected="${param['item-request-approval-status'] == null || #strings.equals('ALL', param['item-request-approval-status'])}">ALL</option>
<option th:each="status: ${T(com.utopiaindustries.uind.model.inventory.ItemRequestApprovalStatus).values()}"
th:value="${status}"
th:text="${status}"
th:selected="${param['item-request-approval-status'] == null ? false : #lists.contains(param['item-request-approval-status'], #strings.toString(status))}"></option>
</select>
</div>
<div data-item-type-category-container>
<div class="form-group">
<label>Type</label>
<select name="item-type-id" class="form-control" data-item-type>
<option data-empty-option value="">Please select</option>
</select>
</div>
<div class="form-group">
<label>Category</label>
<select name="item-category-id" class="form-control" data-item-category id = "item-category-select">
<option data-empty-option value="">Please select</option>
</select>
</div>
</div>
<!-- th:if="${isRequest}"-->
<div class="form-group"> <div class="form-group">
<label>Created By</label> <label>From Date</label>
<input type="text" class="form-control" name="created-by" maxlength="50" th:value="${param['created-by']}"> <input type="date" class="form-control" name="from-date" >
</div> </div>
<div class="form-group"> <div class="form-group">
<label>Created Start Date</label> <label>To Date</label>
<input type="date" class="form-control" name="start-date" th:value="${param['start-date']}"> <input type="date" class="form-control" name="to-date" >
</div> </div>
<div class="form-group"> <div class="form-group">
<label>Created End Date</label> <label>Status</label>
<input type="date" class="form-control" name="end-date" th:value="${param['end-date']}"> <select name="item-status" class="form-control">
</div> <option value="">All</option>
<div class="form-group" data-vue-app th:with="id=${param['site-id']},title=${param['site-title']}"> <option value="1" th:selected="${#strings.equals(param['item-status'], #strings.toString(1))}">Active</option>
<location-site-search th:attr="id=${id},title=${title}" <option value="0" th:selected="${#strings.equals(param['item-status'], #strings.toString(0))}">Inactive</option>
v-bind:id-field-name="'site-id'" </select>
v-bind:title-field-name="'site-title'"
></location-site-search>
</div> </div>
<!-- number of items -->
<div class="form-group"> <div class="form-group">
<label>Count</label> <label>Number of Items</label>
<input type="number" class="form-control" name="count" th:value="${param['count'] ?: 100}" min="0" step="1" /> <input type="number" class="form-control" name="item-count" th:value="(${param['item-count']} != null) ? ${param['item-count']} : 100">
</div> </div>
<input type="submit" class="btn btn-secondary btn-block" value="Search"> <input type="submit" class="btn btn-secondary btn-block" value="Search">
<a th:href="@{${#strings.replace(#httpServletRequest.requestURI, #request.getContextPath(), '')}}" <a th:href="@{${#strings.replace(#httpServletRequest.requestURI, #request.getContextPath(), '')}}" class="btn btn-secondary btn-block">Reset</a>
class="btn btn-secondary btn-block">Reset</a>
</form> </form>
</div> </div>
</aside> </aside>

View File

@ -45,7 +45,7 @@
<td th:text="*{title}"></td> <td th:text="*{title}"></td>
<td th:text="*{parentEntityType}"></td> <td th:text="*{parentEntityType}"></td>
<td> <td>
<span class="badge badge-ACTIVE " th:if="*{active}">ACTIVE</span> <span class="badge badge-ACTIVE" th:if="*{active}">ACTIVE</span>
<span class="badge badge-danger" th:unless="*{active}" >INACTIVE</span> <span class="badge badge-danger" th:unless="*{active}" >INACTIVE</span>
</td> </td>
<td th:text="*{createdBy}"></td> <td th:text="*{createdBy}"></td>

View File

@ -36,7 +36,7 @@
<td th:text="*{id}"></td> <td th:text="*{id}"></td>
<td th:text="*{title}"></td> <td th:text="*{title}"></td>
<td th:text="*{parentEntityType}"></td> <td th:text="*{parentEntityType}"></td>
<td > <i th:text="*{ active.equals(true) ? 'Active' : 'In-Active' }" class="font-sm" th:classappend="*{ active } ? 'badge badge-APPROVED' : 'badge badge-danger'"></i></td> <td th:text="*{active}" th:classappend="*{ active } ? 'badge badge-APPROVED' : 'badge badge-warning'"></td>
<td th:text="*{createdBy}"></td> <td th:text="*{createdBy}"></td>
<td ctp:formatdatetime="*{createdAt}"></td> <td ctp:formatdatetime="*{createdAt}"></td>
<td th:text="*{locationTitle}"></td> <td th:text="*{locationTitle}"></td>

View File

@ -37,11 +37,11 @@
<td><a class="text-reset" th:href="@{'/job-cards/view/' + *{id}}" th:text="*{code}"></a></td> <td><a class="text-reset" th:href="@{'/job-cards/view/' + *{id}}" th:text="*{code}"></a></td>
<td th:text="*{jobOrderId}"></td> <td th:text="*{jobOrderId}"></td>
<td> <td>
<span class="badge font-sm" th:classappend="'badge-' + *{status}" th:if="*{status}" th:text="*{status}"></span> <span class="badge" th:classappend="'badge-' + *{status}" th:if="*{status}" th:text="*{status}"></span>
<span th:unless="*{status}">-</span> <span th:unless="*{status}">-</span>
</td> </td>
<td> <td>
<span class="badge font-sm" th:classappend="'badge-' + *{inventoryStatus}" th:if="*{inventoryStatus}" th:text="*{inventoryStatus}"></span> <span class="badge" th:classappend="'badge-' + *{inventoryStatus}" th:if="*{inventoryStatus}" th:text="*{inventoryStatus}"></span>
<span th:unless="*{inventoryStatus}">-</span> <span th:unless="*{inventoryStatus}">-</span>
</td> </td>
<td th:text="*{customer}"></td> <td th:text="*{customer}"></td>

View File

@ -119,8 +119,8 @@
<td th:text="${cardStitchingItem.getSku()}"></td> <td th:text="${cardStitchingItem.getSku()}"></td>
<td th:text="${cardStitchingItem.getBarcode()}"></td> <td th:text="${cardStitchingItem.getBarcode()}"></td>
<td> <td>
<span th:if="${cardStitchingItem.getQaStatus() == 'APPROVED'}" th:text="${cardStitchingItem.getQaStatus()}" class="badge badge-APPROVED font-sm"></span> <span th:if="${cardStitchingItem.getQaStatus() == 'APPROVED'}" th:text="${cardStitchingItem.getQaStatus()}" class="badge badge-APPROVED"></span>
<span th:if="${cardStitchingItem.getQaStatus() == 'REJECT'}" th:text="${cardStitchingItem.getQaStatus()}" class="badge badge-warning font-sm"></span> <span th:if="${cardStitchingItem.getQaStatus() == 'REJECT'}" th:text="${cardStitchingItem.getQaStatus()}" class="badge badge-warning"></span>
</td> </td>
<td th:text="${cardStitchingItem.getQaRemarks()}"></td> <td th:text="${cardStitchingItem.getQaRemarks()}"></td>
<td ctp:formatdatetime="${cardStitchingItem.getCreatedAt()}"></td> <td ctp:formatdatetime="${cardStitchingItem.getCreatedAt()}"></td>
@ -153,9 +153,9 @@
<td th:text="${cardfinishItem.getSku()}"></td> <td th:text="${cardfinishItem.getSku()}"></td>
<td th:text="${cardfinishItem.getBarcode()}"></td> <td th:text="${cardfinishItem.getBarcode()}"></td>
<td> <td>
<span th:if="${cardfinishItem.getQaStatus() == 'APPROVED'}" th:text="${cardfinishItem.getQaStatus()}" class="badge badge-APPROVED font-sm"></span> <span th:if="${cardfinishItem.getQaStatus() == 'APPROVED'}" th:text="${cardfinishItem.getQaStatus()}" class="badge badge-APPROVED"></span>
<span th:if="${cardfinishItem.getQaStatus() == 'WASHED'}" th:text="${cardfinishItem.getQaStatus()}" class="badge badge-danger font-sm"></span> <span th:if="${cardfinishItem.getQaStatus() == 'WASHED'}" th:text="${cardfinishItem.getQaStatus()}" class="badge badge-danger"></span>
<span th:if="${cardfinishItem.getQaStatus() == 'ALTER'}" th:text="${cardfinishItem.getQaStatus()}" class="badge badge-warning font-sm"></span> <span th:if="${cardfinishItem.getQaStatus() == 'ALTER'}" th:text="${cardfinishItem.getQaStatus()}" class="badge badge-warning"></span>
</td> </td>
<td ctp:formatdatetime="${cardfinishItem.getCreatedAt()}"></td> <td ctp:formatdatetime="${cardfinishItem.getCreatedAt()}"></td>
<td th:text="${cardfinishItem.getCreatedBy()}"></td> <td th:text="${cardfinishItem.getCreatedBy()}"></td>