Compare commits

..

8 Commits

44 changed files with 1865 additions and 358 deletions

View File

@ -0,0 +1,15 @@
package com.utopiaindustries.auth;
import org.springframework.security.access.prepost.PreAuthorize;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
@Retention(RetentionPolicy.RUNTIME)
@Target({ElementType.METHOD, ElementType.TYPE})
@PreAuthorize( "hasAnyRole('ROLE_PURCHASE_ORDER','ROLE_ADMIN')")
public @interface PurchaseOrderCTPRole {
}

View File

@ -1,14 +1,15 @@
package com.utopiaindustries.controller;
import com.utopiaindustries.auth.PackagingRole;
import com.utopiaindustries.model.ctp.FinishedItemWrapper;
import com.utopiaindustries.service.InventoryAccountService;
import com.utopiaindustries.service.LocationService;
import com.utopiaindustries.service.PackagingService;
import com.utopiaindustries.util.StringUtils;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.servlet.mvc.support.RedirectAttributes;
import java.time.LocalDate;
@ -17,19 +18,39 @@ import java.time.LocalDate;
@RequestMapping("/packaging" )
public class PackagingController {
private final InventoryAccountService inventoryAccountService;
private final PackagingService packagingService;
private final LocationService locationService;
public PackagingController(InventoryAccountService inventoryAccountService, LocationService locationService) {
public PackagingController(InventoryAccountService inventoryAccountService, PackagingService packagingService, LocationService locationService) {
this.inventoryAccountService = inventoryAccountService;
this.packagingService = packagingService;
this.locationService = locationService;
}
@GetMapping
public String showHome( Model model ){
return "redirect:/packaging/inventory-accounts";
public String showHome(Model model ){
return "redirect:/packaging/receive-inventory";
}
@GetMapping("/receive-inventory")
public String packagingItemReceive( Model model ){
model.addAttribute("wrapper", new FinishedItemWrapper() );
return "/packaging/receive-inventory-form";
}
@PostMapping( "/packaging-items" )
public String packagingItems( @ModelAttribute FinishedItemWrapper wrapper,
RedirectAttributes redirectAttributes,
Model model ){
try {
packagingService.createPackagingItem( wrapper );
redirectAttributes.addFlashAttribute("success", "Items Successfully received !" );
} catch ( Exception e ){
redirectAttributes.addFlashAttribute("error", e.getMessage() );
}
return "redirect:/finishing/finished-items";
}
@GetMapping( "/inventory-accounts" )

View File

@ -0,0 +1,48 @@
package com.utopiaindustries.controller;
import com.utopiaindustries.auth.PurchaseOrderCTPRole;
import com.utopiaindustries.model.ctp.JobCard;
import com.utopiaindustries.service.PurchaseOrderCTPService;
import com.utopiaindustries.util.StringUtils;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import java.time.LocalDate;
import java.util.List;
@Controller
@RequestMapping("/purchase-order")
@PurchaseOrderCTPRole
public class PurchaseOrderCTPController {
private final PurchaseOrderCTPService purchaseOrderCTPService;
public PurchaseOrderCTPController(PurchaseOrderCTPService purchaseOrderCTPService) {
this.purchaseOrderCTPService = purchaseOrderCTPService;
}
@GetMapping
public String showJobCardList( @RequestParam( value = "purchaseOrderCode", required = false ) String purchaseOrderCode,
@RequestParam( value = "articleName", required = false ) String articleName,
@RequestParam( value = "created-start-date", required = false ) String createdStartDate,
@RequestParam( value = "created-end-date", required = false ) String createdEndDate,
@RequestParam( value = "limit" , required = false) Long limit,
Model model ){
LocalDate startDate = StringUtils.isNullOrEmpty(createdStartDate) ? LocalDate.now().minusDays(30) : LocalDate.parse(createdStartDate);
LocalDate endDate = StringUtils.isNullOrEmpty(createdEndDate) ? LocalDate.now() : LocalDate.parse(createdEndDate);
model.addAttribute("purchaseOrder", purchaseOrderCTPService.getAllPurchaseOrderCtp(purchaseOrderCode, articleName, startDate.toString(), endDate.toString(), limit) );
model.addAttribute("startDate", startDate);
model.addAttribute("endDate", endDate);
return "job-card-list";
}
@GetMapping( "/new" )
public String showPurchaseOrderCTPForm( Model model ){
model.addAttribute("purchaseOrder", purchaseOrderCTPService.createNewPurchaseOrderCTP() );
return "/purchaseOrder/purchase-order-form";
}
}

View File

@ -95,6 +95,36 @@ public class ReportingController {
return "/reporting/cutting-report";
}
@GetMapping( value = "/stitching-report" )
public String stitchingReport(@RequestParam(value = "job-card-id", required = false ) String jobCardId, @RequestParam(value = "accountId" , required = false) String accountId, @RequestParam(value = "start-date", required = false) String startDate, @RequestParam(value = "end-date", required = false) String endDate, Model model ){
LocalDate startDate1 = StringUtils.isNullOrEmpty(startDate) ? LocalDate.now().minusDays(31) : LocalDate.parse(startDate);
LocalDate endDate1 = StringUtils.isNullOrEmpty(endDate) ? LocalDate.now() : LocalDate.parse(endDate);
model.addAttribute("startDate", startDate1);
model.addAttribute("endDate", endDate1);
model.addAttribute("accounts" , inventoryAccountService.findInventoryAccounts( 2L ) );
model.addAttribute("stitching",reportingService.getStitchingDetails(jobCardId, accountId, startDate1.toString(), endDate1.toString()));
return "/reporting/stitching-report";
}
@GetMapping( "/inventory-transactions" )
public String getInventoryTransactionsByAccount( @RequestParam( value = "account-id", required = false) String accountId,
@RequestParam( value = "jobCard-id", required = false) String jobCardId,
@RequestParam( value = "sku", required = false) String sku,
@RequestParam( value = "startDate", required = false) String startDate,
@RequestParam( value = "endDate", required = false) String endDate,
Model model ){
LocalDate startDate1 = StringUtils.isNullOrEmpty(startDate) ? LocalDate.now().minusDays(31) : LocalDate.parse(startDate);
LocalDate endDate1 = StringUtils.isNullOrEmpty(endDate) ? LocalDate.now() : LocalDate.parse(endDate);
model.addAttribute("startDate", startDate1);
model.addAttribute("endDate", endDate1);
model.addAttribute("transactions", reportingService.stitchingItemsTransactions( jobCardId, accountId, sku, startDate1.toString(), endDate1.toString() ));
return "/reporting/accounts-transaction-table";
}
private ArrayList<LocalDate> generateDateList(LocalDate start, LocalDate end) {
ArrayList<LocalDate> localDates = new ArrayList<>();
while (start.isBefore(end)) {

View File

@ -74,8 +74,6 @@ public class StitchingController {
@RequestParam( value = "count", required = false ) Long count,
Model model ) {
// 2 for stitching
model.addAttribute("accounts", inventoryAccountService.getInventoryAccounts(id, title, active, createdBy, startDate, endDate, siteId, count, "PROCESS", "2", false));
model.addAttribute("locations", locationService.findAll() );
if(count == null){
@ -95,11 +93,11 @@ public class StitchingController {
@RequestParam( value = "end-date", required = false ) String endDate,
@RequestParam(value = "bundle-id", required = false) Long bundleId,
@RequestParam( value = "count", required = false, defaultValue = "100") Long count,
Model model
,RedirectAttributes redirect){
@RequestParam( value = "status", required = false) String status,
Model model, RedirectAttributes redirect){
LocalDate startDate1 = StringUtils.isNullOrEmpty(startDate) ? LocalDate.now().minusDays(30) : LocalDate.parse(startDate);
LocalDate endDate1 = StringUtils.isNullOrEmpty(endDate) ? LocalDate.now() : LocalDate.parse(endDate);
List<StitchingOfflineItem> itemList = bundleService.getStitchedOfflineItems( id, itemId, sku, startDate, endDate, bundleId ,count );
List<StitchingOfflineItem> itemList = bundleService.getStitchedOfflineItems( id, itemId, sku, status, startDate, endDate, bundleId ,count );
model.addAttribute("items", itemList ) ;
model.addAttribute("startDate", startDate1);
model.addAttribute("endDate", endDate1);

View File

@ -0,0 +1,101 @@
package com.utopiaindustries.dao.ctp;
import com.utopiaindustries.model.ctp.PackagingItems;
import com.utopiaindustries.model.ctp.PackagingItemsRowMapper;
import com.utopiaindustries.util.KeyHolderFunctions;
import org.springframework.jdbc.core.namedparam.MapSqlParameterSource;
import org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate;
import org.springframework.jdbc.support.GeneratedKeyHolder;
import org.springframework.jdbc.support.KeyHolder;
import org.springframework.stereotype.Repository;
import java.util.ArrayList;
import java.util.List;
@Repository
public class PackagingItemsDAO {
private final NamedParameterJdbcTemplate namedParameterJdbcTemplate;
private static final String TABLE_NAME = "packaging_items";
private static final String SELECT_BY_ID = String.format("SELECT * FROM %s WHERE id = :id", TABLE_NAME);
private static final String SELECT_ALL = String.format("SELECT * FROM %s ORDER BY id DESC", TABLE_NAME);
private static final String DELETE_BY_ID = String.format("DELETE FROM %s WHERE id = :id", TABLE_NAME);
private static final String SELECT_BY_JOB_CARD_ID = String.format("SELECT * FROM %s WHERE job_card_id = :job_card_id", TABLE_NAME);
private static final String INSERT_QUERY = String.format(
"INSERT INTO %s (" +
"id, item_id, sku, barcode, job_card_id, created_at, created_by, " +
"is_qa, finish_item_id, is_segregated, account_id, qa_status, bundle_id, account_title" +
") VALUES (" +
":id, :item_id, :sku, :barcode, :job_card_id, :created_at, :created_by, " +
":is_qa, :finish_item_id, :is_segregated, :account_id, :qa_status, :bundle_id, :account_title" +
") ON DUPLICATE KEY UPDATE " +
"item_id = VALUES(item_id), sku = VALUES(sku), barcode = VALUES(barcode), " +
"job_card_id = VALUES(job_card_id), created_at = VALUES(created_at), created_by = VALUES(created_by), " +
"is_qa = VALUES(is_qa), finish_item_id = VALUES(finish_item_id), " +
"is_segregated = VALUES(is_segregated), account_id = VALUES(account_id), " +
"qa_status = VALUES(qa_status), bundle_id = VALUES(bundle_id), account_title = VALUES(account_title)",
TABLE_NAME
);
public PackagingItemsDAO(NamedParameterJdbcTemplate namedParameterJdbcTemplate) {
this.namedParameterJdbcTemplate = namedParameterJdbcTemplate;
}
private MapSqlParameterSource prepareParams(PackagingItems item) {
return new MapSqlParameterSource()
.addValue("id", item.getId())
.addValue("item_id", item.getItemId())
.addValue("sku", item.getSku())
.addValue("barcode", item.getBarcode())
.addValue("job_card_id", item.getJobCardId())
.addValue("created_at", item.getCreatedAt())
.addValue("created_by", item.getCreatedBy())
.addValue("is_qa", item.getIsQa())
.addValue("finish_item_id", item.getFinishedItemId())
.addValue("is_segregated", item.getIsSegregated())
.addValue("account_id", item.getAccountId())
.addValue("qa_status", item.getQaStatus())
.addValue("bundle_id", item.getBundleId())
.addValue("account_title", item.getAccountTitle());
}
public PackagingItems find(long id) {
MapSqlParameterSource params = new MapSqlParameterSource("id", id);
return namedParameterJdbcTemplate.query(SELECT_BY_ID, params, new PackagingItemsRowMapper())
.stream().findFirst().orElse(new PackagingItems());
}
public List<PackagingItems> findAll() {
return namedParameterJdbcTemplate.query(SELECT_ALL, new PackagingItemsRowMapper());
}
public long save(PackagingItems item) {
KeyHolder keyHolder = new GeneratedKeyHolder();
MapSqlParameterSource params = prepareParams(item);
namedParameterJdbcTemplate.update(INSERT_QUERY, params, keyHolder);
return KeyHolderFunctions.getKey(item.getId(), keyHolder);
}
public int[] saveAll(List<PackagingItems> items) {
List<MapSqlParameterSource> batchParams = new ArrayList<>();
for (PackagingItems item : items) {
batchParams.add(prepareParams(item));
}
return namedParameterJdbcTemplate.batchUpdate(INSERT_QUERY, batchParams.toArray(new MapSqlParameterSource[0]));
}
public boolean delete(long id) {
MapSqlParameterSource params = new MapSqlParameterSource("id", id);
return namedParameterJdbcTemplate.update(DELETE_BY_ID, params) > 0;
}
public List<PackagingItems> findByJobCardId(long jobCardId) {
MapSqlParameterSource params = new MapSqlParameterSource("job_card_id", jobCardId);
return namedParameterJdbcTemplate.query(SELECT_BY_JOB_CARD_ID, params, new PackagingItemsRowMapper());
}
}

View File

@ -0,0 +1,112 @@
package com.utopiaindustries.dao.ctp;
import com.utopiaindustries.model.ctp.JobCard;
import com.utopiaindustries.model.ctp.PurchaseOrderCTP;
import com.utopiaindustries.util.KeyHolderFunctions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.namedparam.MapSqlParameterSource;
import org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate;
import org.springframework.jdbc.support.GeneratedKeyHolder;
import org.springframework.jdbc.support.KeyHolder;
import org.springframework.stereotype.Repository;
import java.util.ArrayList;
import java.util.List;
@Repository
public class PurchaseOrderCTPDao {
@Autowired
private NamedParameterJdbcTemplate namedParameterJdbcTemplate;
private final String TABLE_NAME = "cut_to_pack.purchase_order";
private final String SELECT_QUERY = String.format( "SELECT * FROM %s WHERE id = :id", TABLE_NAME );
private final String SELECT_ALL_QUERY = String.format( "SELECT * FROM %s ORDER BY id DESC", TABLE_NAME );
private final String SELECT_ALL_QUERY_WITH_LIMIT = String.format( "SELECT * FROM %s ORDER BY id DESC limit :limit", TABLE_NAME );
private final String DELETE_QUERY = String.format( "DELETE FROM %s WHERE id = :id", TABLE_NAME );
private final String INSERT_QUERY = String.format(
"INSERT INTO %s (id, purchase_order_code, purchase_order_quantity, purchase_order_quantity_required, article_name, created_by, status) " +
"VALUES (:id, :purchase_order_code, :purchase_order_quantity, :purchase_order_quantity_required, :article_name, :created_by, :status) " +
"ON DUPLICATE KEY UPDATE " +
"purchase_order_code = VALUES(purchase_order_code), " +
"purchase_order_quantity = VALUES(purchase_order_quantity), " +
"purchase_order_quantity_required = VALUES(purchase_order_quantity_required), " +
"article_name = VALUES(article_name), " +
"created_by = VALUES(created_by), " +
"status = VALUES(status)",
TABLE_NAME);
private final String SELECT_BY_LIMIT = String.format( "SELECT * FROM %s WHERE created_by = :created_by ORDER BY id ASC limit :limit", TABLE_NAME );
// prepare query params
private MapSqlParameterSource prepareInsertQueryParams(PurchaseOrderCTP purchaseOrderCTP) {
MapSqlParameterSource params = new MapSqlParameterSource();
params.addValue("id", purchaseOrderCTP.getId())
.addValue("purchase_order_code", purchaseOrderCTP.getPurchaseOrderCode())
.addValue("purchase_order_quantity", purchaseOrderCTP.getPurchaseOrderQuantity())
.addValue("purchase_order_quantity_required", purchaseOrderCTP.getPurchaseOrderQuantityRequired())
.addValue("article_name", purchaseOrderCTP.getArticleName())
.addValue("created_by", purchaseOrderCTP.getCreatedBy())
.addValue("status", purchaseOrderCTP.getStatus());
return params;
}
// find
public PurchaseOrderCTP find(long id ) {
MapSqlParameterSource params = new MapSqlParameterSource();
params.addValue( "id", id );
return namedParameterJdbcTemplate.query( SELECT_QUERY, params, new PurchaseOrderCTPRowMapper() )
.stream()
.findFirst()
.orElse( new PurchaseOrderCTP() );
}
// find all
public List<PurchaseOrderCTP> findAll() {
return namedParameterJdbcTemplate.query( SELECT_ALL_QUERY, new PurchaseOrderCTPRowMapper() );
}
// save
public long save( PurchaseOrderCTP PurchaseOrderCTP) {
KeyHolder keyHolder = new GeneratedKeyHolder();
MapSqlParameterSource params = prepareInsertQueryParams(PurchaseOrderCTP);
namedParameterJdbcTemplate.update( INSERT_QUERY, params, keyHolder );
return KeyHolderFunctions.getKey( PurchaseOrderCTP.getId(), keyHolder );
}
// save all
public int[] saveAll( List<PurchaseOrderCTP> purchaseOrderCTPS) {
List<MapSqlParameterSource> batchArgs = new ArrayList<>();
for ( PurchaseOrderCTP PurchaseOrderCTP : purchaseOrderCTPS) {
MapSqlParameterSource params = prepareInsertQueryParams(PurchaseOrderCTP);
batchArgs.add( params );
}
return namedParameterJdbcTemplate.batchUpdate( INSERT_QUERY, batchArgs.toArray(new MapSqlParameterSource[purchaseOrderCTPS.size()]) );
}
// delete
public boolean delete( long id ) {
MapSqlParameterSource params = new MapSqlParameterSource();
params.addValue( "id", id );
return namedParameterJdbcTemplate.update( DELETE_QUERY, params ) > 0;
}
public List<PurchaseOrderCTP> findByQuery(String query ){
return namedParameterJdbcTemplate.query( query, new PurchaseOrderCTPRowMapper() );
}
public List<PurchaseOrderCTP> findByUserAndLimit(String createdBy, Long limit ){
MapSqlParameterSource params = new MapSqlParameterSource();
params.addValue("limit", limit.intValue() );
params.addValue("created_by", createdBy );
return namedParameterJdbcTemplate.query( SELECT_BY_LIMIT, params, new PurchaseOrderCTPRowMapper() );
}
public List<PurchaseOrderCTP> findByAllWithLimit(Long limit){
MapSqlParameterSource params = new MapSqlParameterSource();
params.addValue("limit", limit.intValue());
return namedParameterJdbcTemplate.query( SELECT_ALL_QUERY_WITH_LIMIT, params, new PurchaseOrderCTPRowMapper() );
}
}

View File

@ -0,0 +1,24 @@
package com.utopiaindustries.dao.ctp;
import com.utopiaindustries.model.ctp.PurchaseOrderCTP;
import org.springframework.jdbc.core.RowMapper;
import java.sql.ResultSet;
import java.sql.SQLException;
public class PurchaseOrderCTPRowMapper implements RowMapper<PurchaseOrderCTP> {
public PurchaseOrderCTP mapRow(ResultSet rs, int rowNum) throws SQLException {
PurchaseOrderCTP PurchaseOrderCTP = new PurchaseOrderCTP();
PurchaseOrderCTP.setId(rs.getLong("id"));
PurchaseOrderCTP.setPurchaseOrderCode(rs.getString("purchase_order_code"));
PurchaseOrderCTP.setPurchaseOrderQuantity(rs.getInt("purchase_order_quantity"));
PurchaseOrderCTP.setPurchaseOrderQuantityRequired(rs.getInt("purchase_order_quantity_required"));
PurchaseOrderCTP.setArticleName(rs.getString("article_name"));
if (rs.getTimestamp("created_at") != null) {
PurchaseOrderCTP.setCreatedAt(rs.getTimestamp("created_at").toLocalDateTime());
}
PurchaseOrderCTP.setCreatedBy(rs.getString("created_by"));
PurchaseOrderCTP.setStatus(rs.getString("status"));
return PurchaseOrderCTP;
}
}

View File

@ -7,7 +7,7 @@ public enum BarcodeStickerSize {
SIZE_4_X_4( 4 * 72, 4 * 72, 8, 8, 8, 8, 200, 100, 250, 250, 14, 9, 7),
SIZE_1_75_X_3_5( 3.5f * 72, 1.75f * 72, 10, 10, 6, 6, 50, 50, 125, 125, 14, 9, 7),
SIZE_4_X_7( 7f * 72, 4f * 72, 200, 10, 40, 6, 50, 40, 125, 125, 14, 9, 7),
SIZE_1_X_2( 67.69f, 128.73f ,10 , 10, 20, 6, 60, 60, 125, 125, 4, 9, 7);
SIZE_1_X_2( 67.69f, 139.73f ,10 , 10, 20, 6, 60, 60, 125, 125, 4, 9, 7);
private final float width;
private final float height;

View File

@ -4,7 +4,7 @@ public class CuttingJobCardItemWrapper {
private long jobCardId;
private String poName;
private String sku;
private Long totalCutting;
private Long total;
private String width;
private String length;
private String gsm;
@ -13,8 +13,8 @@ public class CuttingJobCardItemWrapper {
private String articleName;
private boolean isComplete;
private String jobCardCode;
private String cuttingOperatorName;
private long cuttingAccountId;
private String operatorName;
private long accountId;
public long getJobCardId() {
return jobCardId;
@ -40,14 +40,6 @@ public class CuttingJobCardItemWrapper {
this.sku = sku;
}
public Long getTotalCutting() {
return totalCutting;
}
public void setTotalCutting(Long totalCutting) {
this.totalCutting = totalCutting;
}
public String getWidth() {
return width;
}
@ -104,13 +96,6 @@ public class CuttingJobCardItemWrapper {
this.jobCardCode = jobCardCode;
}
public long getCuttingAccountId() {
return cuttingAccountId;
}
public void setCuttingAccountId(long cuttingAccountId) {
this.cuttingAccountId = cuttingAccountId;
}
public String getLength() {
return length;
@ -120,31 +105,47 @@ public class CuttingJobCardItemWrapper {
this.length = length;
}
public String getCuttingOperatorName() {
return cuttingOperatorName;
public String getOperatorName() {
return operatorName;
}
public void setCuttingOperatorName(String cuttingOperatorName) {
this.cuttingOperatorName = cuttingOperatorName;
public void setOperatorName(String operatorName) {
this.operatorName = operatorName;
}
public long getAccountId() {
return accountId;
}
public void setAccountId(long accountId) {
this.accountId = accountId;
}
public Long getTotal() {
return total;
}
public void setTotal(Long total) {
this.total = total;
}
@Override
public String toString() {
return "CuttingJobCardItemWrapper{" +
"cuttingAccountId=" + cuttingAccountId +
", cuttingOperatorName='" + cuttingOperatorName + '\'' +
", jobCardCode='" + jobCardCode + '\'' +
", isComplete=" + isComplete +
", articleName='" + articleName + '\'' +
", ply='" + ply + '\'' +
", wtPly='" + wtPly + '\'' +
", gsm='" + gsm + '\'' +
", length='" + length + '\'' +
", width='" + width + '\'' +
", totalCutting=" + totalCutting +
", sku='" + sku + '\'' +
"jobCardId=" + jobCardId +
", poName='" + poName + '\'' +
", jobCardId=" + jobCardId +
", sku='" + sku + '\'' +
", total=" + total +
", width='" + width + '\'' +
", length='" + length + '\'' +
", gsm='" + gsm + '\'' +
", wtPly='" + wtPly + '\'' +
", ply='" + ply + '\'' +
", articleName='" + articleName + '\'' +
", isComplete=" + isComplete +
", jobCardCode='" + jobCardCode + '\'' +
", operatorName='" + operatorName + '\'' +
", accountId=" + accountId +
'}';
}
}

View File

@ -4,6 +4,7 @@ public enum InventoryArtifactType {
BUNDLE,
STITCHING_OFFLINE,
FINISHED_ITEM,
STITCH_BUNDLE
STITCH_BUNDLE,
PACKAGING
}

View File

@ -0,0 +1,180 @@
package com.utopiaindustries.model.ctp;
import org.springframework.format.annotation.DateTimeFormat;
import java.math.BigDecimal;
import java.time.LocalDateTime;
public class PackagingItems implements InventoryArtifact {
private long id;
private long itemId;
private String sku;
private String barcode;
private long jobCardId;
@DateTimeFormat( pattern = "yyyy-MM-dd HH:mm:ss" )
private LocalDateTime createdAt;
private String createdBy;
private boolean isQa;
private long finishedItemId;
private boolean isSegregated;
// wrapper
private JobCard jobCard;
private long accountId;
private String qaStatus;
private long bundleId;
private String accountTitle;
public long getId() {
return id;
}
@Override
public String getType() {
return "-";
}
public void setId(long id) {
this.id = id;
}
public long getItemId() {
return itemId;
}
public void setItemId(long itemId) {
this.itemId = itemId;
}
public String getSku() {
return sku;
}
public void setSku(String sku) {
this.sku = sku;
}
public String getBarcode() {
return barcode;
}
public void setBarcode(String barcode) {
this.barcode = barcode;
}
public LocalDateTime getCreatedAt() {
return createdAt;
}
public void setCreatedAt(LocalDateTime createdAt) {
this.createdAt = createdAt;
}
public String getCreatedBy() {
return createdBy;
}
public void setCreatedBy(String createdBy) {
this.createdBy = createdBy;
}
public long getJobCardId() {
return jobCardId;
}
public void setJobCardId(long jobCardId) {
this.jobCardId = jobCardId;
}
public boolean getIsQa() {
return isQa;
}
public void setIsQa(boolean qa) {
isQa = qa;
}
public long getFinishedItemId() {
return finishedItemId;
}
public void setFinishedItemId(long finishedItemId) {
this.finishedItemId = finishedItemId;
}
public JobCard getJobCard() {
return jobCard;
}
public void setJobCard(JobCard jobCard) {
this.jobCard = jobCard;
}
public boolean getIsSegregated() {
return isSegregated;
}
public void setIsSegregated(boolean segregated) {
isSegregated = segregated;
}
public long getAccountId() {
return accountId;
}
public void setAccountId(long accountId) {
this.accountId = accountId;
}
public String getQaStatus() {
return qaStatus;
}
public void setQaStatus(String qaStatus) {
this.qaStatus = qaStatus;
}
public BigDecimal getWrapQuantity(){
return null;
}
public long getMasterBundleId(){
return 0;
}
public long getBundleId(){
return bundleId;
}
public void setBundleId(long bundleId) {
this.bundleId = bundleId;
}
public String getAccountTitle() {
return accountTitle;
}
public void setAccountTitle(String accountTitle) {
this.accountTitle = accountTitle;
}
@Override
public String toString() {
return "PackagingItems{" +
"id=" + id +
", itemId=" + itemId +
", sku='" + sku + '\'' +
", barcode='" + barcode + '\'' +
", jobCardId=" + jobCardId +
", createdAt=" + createdAt +
", createdBy='" + createdBy + '\'' +
", isQa=" + isQa +
", finishedItemId=" + finishedItemId +
", isSegregated=" + isSegregated +
", jobCard=" + jobCard +
", accountId=" + accountId +
", qaStatus='" + qaStatus + '\'' +
", bundleId=" + bundleId +
", accountTitle='" + accountTitle + '\'' +
'}';
}
}

View File

@ -0,0 +1,28 @@
package com.utopiaindustries.model.ctp;
import org.springframework.jdbc.core.RowMapper;
import java.sql.ResultSet;
import java.sql.SQLException;
public class PackagingItemsRowMapper implements RowMapper<PackagingItems> {
@Override
public PackagingItems mapRow(ResultSet rs, int rowNum) throws SQLException {
PackagingItems item = new PackagingItems();
item.setId(rs.getLong("id"));
item.setItemId(rs.getLong("item_id"));
item.setSku(rs.getString("sku"));
item.setBarcode(rs.getString("barcode"));
item.setJobCardId(rs.getLong("job_card_id"));
item.setCreatedAt(rs.getTimestamp("created_at") != null ? rs.getTimestamp("created_at").toLocalDateTime() : null);
item.setCreatedBy(rs.getString("created_by"));
item.setIsQa(rs.getBoolean("is_qa"));
item.setFinishedItemId(rs.getLong("finish_item_id"));
item.setIsSegregated(rs.getBoolean("is_segregated"));
item.setAccountId(rs.getLong("account_id"));
item.setQaStatus(rs.getString("qa_status"));
item.setBundleId(rs.getLong("bundle_id"));
item.setAccountTitle(rs.getString("account_title"));
return item;
}
}

View File

@ -0,0 +1,84 @@
package com.utopiaindustries.model.ctp;
import java.time.LocalDateTime;
public class PurchaseOrderCTP {
public enum Status{
DRAFT,
POSTED,
}
private long id;
private String purchaseOrderCode;
private long purchaseOrderQuantity;
private long purchaseOrderQuantityRequired;
private String articleName;
private String createdBy;
private LocalDateTime createdAt;
private String status;
public long getId() {
return id;
}
public void setId(long id) {
this.id = id;
}
public String getPurchaseOrderCode() {
return purchaseOrderCode;
}
public void setPurchaseOrderCode(String purchaseOrderCode) {
this.purchaseOrderCode = purchaseOrderCode;
}
public long getPurchaseOrderQuantity() {
return purchaseOrderQuantity;
}
public void setPurchaseOrderQuantity(long purchaseOrderQuantity) {
this.purchaseOrderQuantity = purchaseOrderQuantity;
}
public long getPurchaseOrderQuantityRequired() {
return purchaseOrderQuantityRequired;
}
public void setPurchaseOrderQuantityRequired(long purchaseOrderQuantityRequired) {
this.purchaseOrderQuantityRequired = purchaseOrderQuantityRequired;
}
public String getArticleName() {
return articleName;
}
public void setArticleName(String articleName) {
this.articleName = articleName;
}
public String getCreatedBy() {
return createdBy;
}
public void setCreatedBy(String createdBy) {
this.createdBy = createdBy;
}
public LocalDateTime getCreatedAt() {
return createdAt;
}
public void setCreatedAt(LocalDateTime createdAt) {
this.createdAt = createdAt;
}
public String getStatus() {
return status;
}
public void setStatus(String status) {
this.status = status;
}
}

View File

@ -0,0 +1,46 @@
package com.utopiaindustries.querybuilder.ctp;
import com.utopiaindustries.querybuilder.QueryBuilder;
import com.utopiaindustries.util.CTPDateTimeFormat;
import com.utopiaindustries.util.StringUtils;
import java.time.LocalDate;
public class PurchaseOrderCTPQueryBuilder {
public static String buildQuery(String purchaseOrderCode, String articleName, String createdBy, String startDate, String endDate, Long count ){
// format date
String formattedDate;
String formattedEndDate;
String startDate1 = "";
String endDate1 = "";
String purchaseOrderCode1 = purchaseOrderCode == null ? "" : purchaseOrderCode;
String articleName1 = articleName == null ? "" : articleName;
if ( ! StringUtils.isNullOrEmpty( startDate ) ) {
formattedDate = CTPDateTimeFormat.getMySQLFormattedDateString( startDate, CTPDateTimeFormat.HTML5_DATE_INPUT_FORMAT );
formattedEndDate = CTPDateTimeFormat.getMySQLFormattedDateString( endDate, CTPDateTimeFormat.HTML5_DATE_INPUT_FORMAT );
startDate1 = String.format( "'%s 00:00:01'", formattedDate );
if ( ! StringUtils.isNullOrEmpty( endDate ) ) {
endDate1 = String.format("'%s 23:59:59'", formattedEndDate);
}
else {
endDate1 = String.format("'%s 23:59:59'", LocalDate.now() );
}
}
return (new QueryBuilder())
.setTable("cut_to_pack.purchase_order")
.setColumns("*")
.where()
.columnEquals("created_by", createdBy)
.and()
.columnLike("purchase_order_code", "%" + purchaseOrderCode1 + "%")
.and()
.columnLike("article_name", articleName)
.and()
.columnEqualToOrGreaterThan("created_at", startDate1)
.and()
.columnEqualToOrLessThan("created_at", endDate1)
.limit(count.intValue())
.build();
}
}

View File

@ -8,7 +8,7 @@ import java.time.LocalDate;
public class StichedOfflineItemQueryBuilder {
public static String buildQuery(String id, String itemId, String sku, String createdStartDate, String createdEndDate, Long bundleId, Long count) {
public static String buildQuery(String id, String itemId, String sku, String QaStatus,String createdStartDate, String createdEndDate, Long bundleId, Long count) {
// format date
String formattedDate;
String formattedEndDate;
@ -24,8 +24,7 @@ public class StichedOfflineItemQueryBuilder {
endDate1 = String.format("'%s 23:59:59'", LocalDate.now());
}
}
return ( new QueryBuilder() )
QueryBuilder qb = (new QueryBuilder())
.setTable("cut_to_pack.stitching_offline_item")
.setColumns("*")
.where()
@ -33,17 +32,20 @@ public class StichedOfflineItemQueryBuilder {
.and()
.columnEquals("sku", sku)
.and()
.columnEquals("item_id", itemId )
.columnEquals("item_id", itemId)
.and()
.columnEquals("bundle_id", bundleId )
.columnEquals("bundle_id", bundleId)
.and()
.columnEqualToOrGreaterThan("created_at", startDate1)
.and()
.columnEqualToOrLessThan("created_at", endDate1 )
.orderBy("id","DESC")
.limit(count)
.build();
.columnEqualToOrLessThan("created_at", endDate1);
if (!StringUtils.isNullOrEmpty(QaStatus)) {
qb.and().columnEquals("qa_status", QaStatus);
}
qb.orderBy("id", "DESC")
.limit(count);
return qb.build();
}
}

View File

@ -71,8 +71,11 @@ public class SummaryInventoryReportQueryBuilder {
public static String cuttingQueryBuild(long jobCardId,
List<Long> account,
String sku,
String startDate,
String endDate,String type) {
String endDate,
String type,
String parentDocumentType) {
QueryBuilder qb = new QueryBuilder()
.setTable(TABLE_NAME)
@ -84,11 +87,17 @@ public class SummaryInventoryReportQueryBuilder {
.and()
.columnEqualToOrLessThan("transaction_leg_datetime",endDate)
.and()
.columnEquals("type",type);
.columnEquals("type",type)
.and()
.columnEquals("parent_document_type",parentDocumentType);
if (jobCardId != 0){
qb.and()
.columnEquals("job_card_id", jobCardId );
}
if (!StringUtils.isNullOrEmpty(sku)){
qb.and()
.columnEquals("sku", sku );
}
return qb.build();
}
}

View File

@ -24,4 +24,9 @@ public class FinishedItemRestController {
@RequestParam( "is-segregated") boolean isSegregated ){
return finishedItemDAO.findByTerm( term, isSegregated );
}
@GetMapping( "/search-packaging" )
public List<FinishedItem> searchFinishedItemsForPackaging(@RequestParam( "term") String term,
@RequestParam( "is-segregated") boolean isSegregated ){
return finishedItemDAO.findByTerm( term, true );
}
}

View File

@ -312,7 +312,7 @@ public class BarcodeService {
float qrY =stickerSize.getMarginLeft()+50 ;
float qrX = stickerSize.getMarginTop();
qrCodeImage.setFixedPosition(qrX - 16, qrY-40);
qrCodeImage.setFixedPosition(qrX - 16, qrY-35);
document.add(qrCodeImage);
float textX = stickerSize.getMarginLeft() + 40;
@ -323,41 +323,61 @@ public class BarcodeService {
String combinedText = sku + " \\ " + jobCardCode + " \\ " + artifact.getBundleId();
combinedText = combinedText.replaceAll("\\s+", "");
int maxLength = 14;
int maxLength = 12;
int start = 0;
int lineCount = 0;
List<String> lines = new ArrayList<>();
for (int i = 0; i < 5; i++) {
int start = i * maxLength;
if (start < combinedText.length()) {
String part = combinedText.substring(start, Math.min(start + maxLength, combinedText.length())).replaceAll("\\s+", "");
lines.add(part);
while (start < combinedText.length() && lineCount < 5) {
int end = Math.min(start + maxLength, combinedText.length());
String part = combinedText.substring(start, end);
if (part.matches(".*[^a-zA-Z0-9 ].*")) {
if(combinedText.length() - start<=17 && combinedText.length() - start>0){
end = Math.min(start + maxLength + 5, combinedText.length());
part = combinedText.substring(start, end);
}else {
end = Math.min(start + maxLength + 3, combinedText.length());
part = combinedText.substring(start, end);
}
}
part = part.replaceAll("\\s+", "");
lines.add(part);
start = end;
lineCount++;
}
float labelWidth = 67.69f;
float textBoxWidth = 220;
float textBoxWidth = 120f;
float textY1 = textY-23;
float textXCenter = textX + (labelWidth / 2) - (textBoxWidth / 2)-50;
for (String line : lines) {
Paragraph rotatedText = new Paragraph(line)
.setFontColor(ColorConstants.BLACK)
.setFontSize(stickerSize.getTextSize() + 2)
.setFontSize(stickerSize.getTextSize()+2)
.setTextAlignment(TextAlignment.CENTER)
.setFixedPosition(textXCenter, textY1-18, textBoxWidth);
.setFixedPosition(textXCenter, textY1-13, textBoxWidth);
document.add(rotatedText);
textY1 -= 6;
}
PdfFont font = PdfFontFactory.createFont(StandardFonts.COURIER_OBLIQUE);
PdfFont font = PdfFontFactory.createFont(StandardFonts.COURIER);
String id = String.valueOf(artifact.getId());
float textSize = stickerSize.getTextSize() + 6;
float charWidth = textSize * 0.6f;
float idWidth = id.length() * charWidth;
float xCentered = (labelWidth / 2f) - (idWidth / 2f);
document.add(new Paragraph(id)
.setFont(font)
.setBold()
.setFontColor(ColorConstants.BLACK)
.setFontSize(stickerSize.getTextSize() + 8)
.setTextAlignment(TextAlignment.LEFT)
.setFixedPosition(textX - 25, textY + 13, 100));
.setFontSize(textSize)
.setFixedPosition(xCentered, textY + 18, 100));
float dottedLine = textY - 65;
for(int i= 0 ;i<16;i++){
@ -367,7 +387,7 @@ public class BarcodeService {
.setBold()
.setRotationAngle(-Math.PI / 2)
.setTextAlignment(TextAlignment.LEFT)
.setFixedPosition(dottedLine,textX+45, 100));
.setFixedPosition(dottedLine,textX+55, 100));
dottedLine += 7;
}
@ -380,7 +400,7 @@ public class BarcodeService {
.setBold()
.setRotationAngle(-Math.PI / 2)
.setTextAlignment(TextAlignment.LEFT)
.setFixedPosition(dottedLine2,textX+80, 100));
.setFixedPosition(dottedLine2,textX+90, 100));
dottedLine2 += 7;
}
@ -389,9 +409,11 @@ public class BarcodeService {
document.add(new AreaBreak());
}
}
if (pdfDoc.getNumberOfPages() > artifacts.size()) {
pdfDoc.removePage(pdfDoc.getNumberOfPages());
}
document.close();
sendPdfToZebraPrinter(pdfPath.toFile());
}

View File

@ -125,13 +125,13 @@ public class BundleService {
/*
* find finished Items by params
* */
public List<StitchingOfflineItem> getStitchedOfflineItems(String id, String itemId, String sku, String createdStartDate, String createdEndDate, Long bundleId, Long count ){
public List<StitchingOfflineItem> getStitchedOfflineItems(String id, String itemId, String sku,String status, String createdStartDate, String createdEndDate, Long bundleId, Long count ){
List<StitchingOfflineItem> stitchingOfflineItems = new ArrayList<>();
if( count == null ){
count = 100L;
}
if( StringUtils.isAnyNotNullOrEmpty(id, itemId, sku, createdStartDate, createdEndDate, String.valueOf(bundleId) ) ){
String query = StichedOfflineItemQueryBuilder.buildQuery( id, itemId, sku, createdStartDate, createdEndDate, bundleId , count );
String query = StichedOfflineItemQueryBuilder.buildQuery( id, itemId, sku, status,createdStartDate, createdEndDate, bundleId , count );
System.out.println( query );
stitchingOfflineItems = stitchingOfflineItemDAO.findByQuery( query );
} else {

View File

@ -28,8 +28,9 @@ public class InventoryService {
private final MasterBundleDAO masterBundleDAO;
private final FinishedItemDAO finishedItemDAO;
private final StitchingOfflineItemDAO stitchingOfflineItemDAO;
private final PackagingItemsDAO packagingItemsDAO;
public InventoryService( JobCardItemDAO jobCardItemDAO, CutPieceDAO cutPieceDAO, BundleDAO bundleDAO, InventoryTransactionLegDAO inventoryTransactionLegDAO, InventoryTransactionDAO inventoryTransactionDAO, JobCardDAO jobCardDAO, CryptographyService cryptographyService, MasterBundleDAO masterBundleDAO, FinishedItemDAO finishedItemDAO, StitchingOfflineItemDAO stitchingOfflineItemDAO) {
public InventoryService(JobCardItemDAO jobCardItemDAO, CutPieceDAO cutPieceDAO, BundleDAO bundleDAO, InventoryTransactionLegDAO inventoryTransactionLegDAO, InventoryTransactionDAO inventoryTransactionDAO, JobCardDAO jobCardDAO, CryptographyService cryptographyService, MasterBundleDAO masterBundleDAO, FinishedItemDAO finishedItemDAO, StitchingOfflineItemDAO stitchingOfflineItemDAO, PackagingItemsDAO packagingItemsDAO) {
this.jobCardItemDAO = jobCardItemDAO;
this.cutPieceDAO = cutPieceDAO;
this.bundleDAO = bundleDAO;
@ -40,6 +41,7 @@ public class InventoryService {
this.masterBundleDAO = masterBundleDAO;
this.finishedItemDAO = finishedItemDAO;
this.stitchingOfflineItemDAO = stitchingOfflineItemDAO;
this.packagingItemsDAO = packagingItemsDAO;
}
private void updateJobCardInventoryStatus( JobCard card ){
@ -601,27 +603,93 @@ public class InventoryService {
* item is approved and grade is selected then fI is move to grade account
*/
if ( finishedItem.getQaStatus( ).equalsIgnoreCase( "APPROVED") && finishedItem.getAccountId( ) != 0) {
finishedItem.setIsSegregated( true);
}
updatedItems.add( finishedItem);
}
// save finish items
finishedItemDAO.saveAll( updatedItems);
}
}
/*
* Packaging items
* */
@Transactional( rollbackFor = Exception.class, propagation = Propagation.NESTED )
public void createPackagingItemAndTransaction( FinishedItemWrapper wrapper) {
if ( wrapper != null && wrapper.getItems( ) != null) {
List<FinishedItem> items = wrapper.getItems( );
List<FinishedItem> updatedItems = new ArrayList<>( );
List<PackagingItems> packagingItems = new ArrayList<>( );
// finished ids
List<Long> finishedItemIds = items.stream( ).map( FinishedItem::getId)
.collect( Collectors.toList( ));
// stitched ids
List<Long> stitchedItemIds = items.stream( ).map( FinishedItem::getStitchedItemId)
.collect( Collectors.toList( ));
// find parent doc type last IN transaction map
Map<Long, InventoryTransactionLeg> lastFinishedItemIdInTransactionMap = inventoryTransactionLegDAO
.findLastTransactionByParentIdAndParentType( InventoryTransactionLeg.Type.IN.name( ), finishedItemIds, InventoryArtifactType.FINISHED_ITEM.name( ))
.stream( )
.collect( Collectors.toMap( InventoryTransactionLeg::getParentDocumentId, Function.identity( )));
// create transaction
InventoryTransaction transaction = createInventoryTransaction( "Against Segregation of Finished Items");
// create IN and OUT for all approved items
for ( FinishedItem finishedItem : items) {
InventoryTransactionLeg lastInvTransaction = lastFinishedItemIdInTransactionMap.getOrDefault( finishedItem.getId( ), null);
finishedItem.setIsQa( true);
if ( finishedItem.getQaStatus( ).equalsIgnoreCase( "APPROVED") && finishedItem.getIsSegregated( )) {
// create OUT and IN transactions for FI
PackagingItems packagingItems1 = (createPackagingItem(finishedItem));
packagingItems1.setId(packagingItemsDAO.save(packagingItems1));
if ( lastInvTransaction != null) {
// OUT
long fromAccount = lastInvTransaction.getAccountId( );
createInventoryTransactionLeg( transaction, finishedItem, fromAccount, InventoryTransactionLeg.Type.OUT.name( ), InventoryArtifactType.FINISHED_ITEM.name( ));
// IN
createInventoryTransactionLeg( transaction, finishedItem, finishedItem.getAccountId( ), InventoryTransactionLeg.Type.IN.name( ), InventoryArtifactType.FINISHED_ITEM.name( ));
createInventoryTransactionLeg( transaction, packagingItems1, 8, InventoryTransactionLeg.Type.IN.name( ), InventoryArtifactType.PACKAGING.name( ));
}
finishedItem.setIsSegregated( true);
packagingItems.add(packagingItems1);
}
updatedItems.add( finishedItem);
}
finishedItemDAO.saveAll( updatedItems);
// save finish items
finishedItemDAO.saveAll( updatedItems);
System.out.println(packagingItems);
}
}
/*
* find item summary by account
* */
public List<InventorySummary> findItemSummaryByAccountId( long accountId) {
return inventoryTransactionLegDAO.findSummaryByAccountId( accountId);
}
private PackagingItems createPackagingItem(FinishedItem finishedItem){
Authentication authentication = SecurityContextHolder.getContext( ).getAuthentication( );
PackagingItems packagingItems = new PackagingItems();
packagingItems.setItemId(finishedItem.getItemId());
packagingItems.setAccountId(finishedItem.getAccountId());
packagingItems.setFinishedItemId(finishedItem.getId());
packagingItems.setJobCardId(finishedItem.getJobCardId());
packagingItems.setJobCard(finishedItem.getJobCard());
packagingItems.setSku(finishedItem.getSku());
packagingItems.setBarcode(finishedItem.getBarcode());
packagingItems.setCreatedAt(LocalDateTime.now());
packagingItems.setCreatedBy(authentication.getName( ));
packagingItems.setIsQa(finishedItem.getIsQa());
packagingItems.setIsSegregated(finishedItem.getIsSegregated());
packagingItems.setQaStatus(finishedItem.getQaStatus());
return packagingItems;
}
}

View File

@ -0,0 +1,22 @@
package com.utopiaindustries.service;
import com.utopiaindustries.dao.ctp.PackagingItemsDAO;
import com.utopiaindustries.model.ctp.FinishedItemWrapper;
import org.springframework.stereotype.Service;
@Service
public class PackagingService {
private final InventoryService inventoryService;
private final PackagingItemsDAO packagingItemsDAO;
public PackagingService(InventoryService inventoryService, PackagingItemsDAO packagingItemsDAO) {
this.inventoryService = inventoryService;
this.packagingItemsDAO = packagingItemsDAO;
}
public void createPackagingItem(FinishedItemWrapper wrapper){
inventoryService.createPackagingItemAndTransaction(wrapper);
}
}

View File

@ -0,0 +1,75 @@
package com.utopiaindustries.service;
import com.utopiaindustries.dao.ctp.PurchaseOrderCTPDao;
import com.utopiaindustries.model.ctp.*;
import com.utopiaindustries.querybuilder.ctp.JobCardQueryBuilder;
import com.utopiaindustries.querybuilder.ctp.PurchaseOrderCTPQueryBuilder;
import com.utopiaindustries.util.StringUtils;
import org.springframework.security.core.Authentication;
import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.List;
@Service
public class PurchaseOrderCTPService {
private final PurchaseOrderCTPDao purchaseOrderCTPDao;
public PurchaseOrderCTPService(PurchaseOrderCTPDao purchaseOrderCTPDao) {
this.purchaseOrderCTPDao = purchaseOrderCTPDao;
}
/*
* search by id
* */
public PurchaseOrderCTP searchPurchaseOrderById(long id){
return purchaseOrderCTPDao.find(id);
}
/*
* create new job card
* */
public PurchaseOrderCTP createNewPurchaseOrderCTP() {
Authentication authentication = SecurityContextHolder.getContext().getAuthentication();
PurchaseOrderCTP purchaseOrderCTP = new PurchaseOrderCTP();
purchaseOrderCTP.setCreatedBy( authentication.getName() );
purchaseOrderCTP.setCreatedAt( LocalDateTime.now() );
return purchaseOrderCTP;
}
/*
* save card
* */
@Transactional( rollbackFor = Exception.class )
public void save(PurchaseOrderCTP purchaseOrderCTP) {
purchaseOrderCTPDao.save(purchaseOrderCTP);
}
public List<PurchaseOrderCTP> getAllPurchaseOrderCtp(String purchaseOrderCode, String articleName, String StartDate, String EndDate, Long limit) {
Authentication authentication = SecurityContextHolder.getContext().getAuthentication();
List<PurchaseOrderCTP> list = new ArrayList<>();
String createdBy = authentication.getName();
if( limit == null ){
limit = 100L;
}
if( !StringUtils.isAnyNotNullOrEmpty(purchaseOrderCode, articleName) ){
for (GrantedAuthority role : authentication.getAuthorities()){
if (role.toString().equals("ROLE_ADMIN")){
createdBy = "";
}
}
String query = PurchaseOrderCTPQueryBuilder.buildQuery(purchaseOrderCode, articleName, createdBy, StartDate, EndDate, limit );
System.out.println( query );
list = purchaseOrderCTPDao.findByQuery( query );
}else {
list = purchaseOrderCTPDao.findByUserAndLimit( authentication.getName(), limit );
}
return list;
}
}

View File

@ -32,8 +32,9 @@ public class ReportingService {
private final FinishedItemDAO finishedItemDAO;
private final StitchingOfflineItemDAO stitchingOfflineItemDAO;
private final InventoryAccountDAO inventoryAccountDAO;
private final PackagingItemsDAO packagingItemsDAO;
public ReportingService( JobCardItemDAO jobCardItemDAO, ProcessDAO processDAO, BundleDAO bundleDAO, InventoryTransactionLegDAO inventoryTransactionLegDAO, InventoryTransactionDAO inventoryTransactionDAO, JobCardDAO jobCardDAO, CryptographyService cryptographyService, MasterBundleDAO masterBundleDAO, FinishedItemDAO finishedItemDAO, StitchingOfflineItemDAO stitchingOfflineItemDAO, InventoryAccountDAO inventoryAccountDAO) {
public ReportingService(JobCardItemDAO jobCardItemDAO, ProcessDAO processDAO, BundleDAO bundleDAO, InventoryTransactionLegDAO inventoryTransactionLegDAO, InventoryTransactionDAO inventoryTransactionDAO, JobCardDAO jobCardDAO, CryptographyService cryptographyService, MasterBundleDAO masterBundleDAO, FinishedItemDAO finishedItemDAO, StitchingOfflineItemDAO stitchingOfflineItemDAO, InventoryAccountDAO inventoryAccountDAO, PackagingItemsDAO packagingItemsDAO) {
this.jobCardItemDAO = jobCardItemDAO;
this.processDAO = processDAO;
this.bundleDAO = bundleDAO;
@ -45,6 +46,7 @@ public class ReportingService {
this.finishedItemDAO = finishedItemDAO;
this.stitchingOfflineItemDAO = stitchingOfflineItemDAO;
this.inventoryAccountDAO = inventoryAccountDAO;
this.packagingItemsDAO = packagingItemsDAO;
}
public Map<String, Integer> getJobCardProgress(String jobCardID) {
@ -213,8 +215,14 @@ public class ReportingService {
HashMap<String,Integer> gradingItems = new HashMap<>();
List<InventoryAccount> inventoryAccounts = inventoryAccountDAO.getPackagingAccounts();
List<FinishedItem> finishedItems = finishedItemDAO.findByJobCardId(Long.parseLong(jobCardID));
List<PackagingItems> packagingItems = packagingItemsDAO.findByJobCardId(Long.parseLong(jobCardID));
List<Long> finishItemsIds = finishedItems.stream()
.map(FinishedItem::getId).collect(Collectors.toList());
List<Long> packagingItemsIds = packagingItems.stream()
.map(PackagingItems::getId).collect(Collectors.toList());
if (finishItemsIds.isEmpty()){
gradingItems.put("A GRADE",0);
gradingItems.put("B GRADE",0);
@ -222,9 +230,14 @@ public class ReportingService {
return gradingItems;
}else {
for (InventoryAccount inventoryAccount : inventoryAccounts){
if (inventoryAccount.getIsPackaging()){
long totalGradingItems = inventoryTransactionLegDAO.CalculateTotalGradingItems(packagingItemsIds,(int) inventoryAccount.getId());
gradingItems.put(inventoryAccount.getTitle(), (int) totalGradingItems);
}else {
long totalGradingItems = inventoryTransactionLegDAO.CalculateTotalGradingItems(finishItemsIds,(int) inventoryAccount.getId());
gradingItems.put(inventoryAccount.getTitle(), (int) totalGradingItems);
}
}
return gradingItems;
}
}
@ -371,6 +384,8 @@ public class ReportingService {
if (jobCardID == null) {
return Collections.emptyMap();
}
List<InventoryAccount> inventoryAccounts = inventoryAccountDAO.findByParentEntityTypeAndParentId("PROCESS",6L);
List<JobCardItem> jobCardItems = jobCardItemDAO.findByCardId(Long.parseLong(jobCardID));
BigDecimal actualProduction = jobCardItems.stream()
.map(item -> Optional.ofNullable(item.getActualProduction()).orElse(BigDecimal.ZERO))
@ -426,7 +441,8 @@ public class ReportingService {
qualityList.set(index, 0);
}
qualityList.set(index, qualityList.get(index) + leg.getQuantity().intValue());
}else if ("FINISHED_ITEM".equals(leg.getParentDocumentType()) && (leg.getAccountId().equals(8) || leg.getAccountId().equals(9) || leg.getAccountId().equals(10))) {
}
else if ("PACKAGING".equals(leg.getParentDocumentType()) && inventoryAccounts.stream().anyMatch(e -> e.getId() == leg.getAccountId().longValue())) {
if (index == 0 || !dateIndexMap.containsKey(dateKey)) {
finishItems.set(index, 0);
}
@ -618,7 +634,7 @@ public class ReportingService {
inventoryAccountIds = List.of(Long.parseLong(cuttingTableId));
}
String query = SummaryInventoryReportQueryBuilder.cuttingQueryBuild(jobCardIdTemp, inventoryAccountIds, startDate1, endDate1, "IN");
String query = SummaryInventoryReportQueryBuilder.cuttingQueryBuild(jobCardIdTemp, inventoryAccountIds, null, startDate1, endDate1, "IN","BUNDLE");
List<InventoryTransactionLeg> inventoryTransactionLegs = inventoryTransactionLegDAO.findByQuery(query);
Map<String, Integer> dateWiseProduction = new TreeMap<>();
@ -670,15 +686,15 @@ public class ReportingService {
wrapper.setGsm(item.getGsm());
wrapper.setPly(item.getPly());
wrapper.setSku(item.getSku());
wrapper.setTotalCutting(item.getActualProduction().longValue());
wrapper.setTotal(item.getActualProduction().longValue());
wrapper.setWidth(item.getWidth());
wrapper.setWtPly(item.getWtPly());
wrapper.setComplete(item.isComplete());
wrapper.setPoName(jobCard.getPurchaseOrderId());
wrapper.setCuttingOperatorName(bundle.getCreatedBy());
wrapper.setOperatorName(bundle.getCreatedBy());
wrapper.setJobCardId(item.getJobCardId());
wrapper.setLength(item.getLength());
wrapper.setCuttingAccountId(accountId);
wrapper.setAccountId(accountId);
return wrapper;
}).collect(Collectors.toList());
@ -691,6 +707,129 @@ public class ReportingService {
return cuttingDetails;
}
public Map<String, Object> getStitchingDetails(String jobCardId, String stitchingLine, String startDate, String endDate) {
Map<String, Object> stitchingDetails = new HashMap<>();
long jobCardIdTemp = 0L;
String startDate1 = null;
String endDate1 = null;
if (!StringUtils.isNullOrEmpty(startDate)) {
String formattedStart = CTPDateTimeFormat.getMySQLFormattedDateString(startDate, CTPDateTimeFormat.HTML5_DATE_INPUT_FORMAT);
String formattedEnd = !StringUtils.isNullOrEmpty(endDate)
? CTPDateTimeFormat.getMySQLFormattedDateString(endDate, CTPDateTimeFormat.HTML5_DATE_INPUT_FORMAT)
: LocalDate.now().toString();
startDate1 = String.format("'%s 00:00:01'", formattedStart);
endDate1 = String.format("'%s 23:59:59'", formattedEnd);
}
List<InventoryAccount> inventoryAccounts = inventoryAccountDAO.findByParentEntityTypeAndParentId("PROCESS", 2L);
List<Long> inventoryAccountIds = inventoryAccounts.stream().map(InventoryAccount::getId).collect(Collectors.toList());
if (!StringUtils.isNullOrEmpty(jobCardId)) {
jobCardIdTemp = Long.parseLong(jobCardId);
} else if (!StringUtils.isNullOrEmpty(stitchingLine)) {
inventoryAccountIds = List.of(Long.parseLong(stitchingLine));
}
String query = SummaryInventoryReportQueryBuilder.cuttingQueryBuild(jobCardIdTemp, inventoryAccountIds,null, startDate1, endDate1, "IN","STITCHING_OFFLINE");
List<InventoryTransactionLeg> inventoryTransactionLegs = inventoryTransactionLegDAO.findByQuery(query);
Map<String, Integer> dateWiseProduction = new TreeMap<>();
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("dd-MM-yyyy");
Map<LocalDate, List<Long>> dateWiseJobCardIds = inventoryTransactionLegs.stream()
.filter(e -> e.getTransactionLegDateTime() != null && e.getJobCardId() != 0)
.collect(Collectors.groupingBy(
e -> e.getTransactionLegDateTime().toLocalDate(),
Collectors.mapping(InventoryTransactionLeg::getJobCardId, Collectors.toList())
));
for (Map.Entry<LocalDate, List<Long>> entry : dateWiseJobCardIds.entrySet()) {
LocalDate date = entry.getKey();
List<Long> jobCardIds = entry.getValue();
if (!jobCardIds.isEmpty()) {
int totalProduction = inventoryTransactionLegs.stream()
.filter(item -> jobCardIds.contains(item.getJobCardId()) &&
"STITCHING_OFFLINE".equals(item.getParentDocumentType()) && item.getTransactionLegDateTime().toLocalDate().equals(date))
.mapToInt(item -> item.getQuantity().intValue())
.sum();
dateWiseProduction.put(date.format(formatter), totalProduction);
}
}
List<Long> distinctJobCardIds = inventoryTransactionLegs.stream()
.map(InventoryTransactionLeg::getJobCardId)
.filter(id -> id != 0)
.distinct()
.collect(Collectors.toList());
Map<Long, List<CuttingJobCardItemWrapper>> jobCardItemsStitchingDetailsMap = new HashMap<>();
Map<String, Integer> totalStitchingBasedOnAccountID = new HashMap<>();
for (long jobCardIdEntry : distinctJobCardIds) {
Long accountId = inventoryTransactionLegs.stream()
.filter(e -> e.getJobCardId() == jobCardIdEntry)
.map(e -> e.getAccountId().longValue())
.findFirst()
.orElse(0L);
JobCard jobCard = jobCardDAO.find(jobCardIdEntry);
List<StitchingOfflineItem> stitchingOfflineItem = stitchingOfflineItemDAO.findByJobCardId(jobCardIdEntry);
List<JobCardItem> jobCardItems = jobCardItemDAO.findByCardId(jobCardIdEntry);
List<CuttingJobCardItemWrapper> wrappers = jobCardItems.stream().map(item -> {
CuttingJobCardItemWrapper wrapper = new CuttingJobCardItemWrapper();
wrapper.setArticleName(jobCard.getArticleName());
wrapper.setJobCardId(jobCard.getId());
wrapper.setJobCardCode(jobCard.getCode());
wrapper.setSku(item.getSku());
wrapper.setPoName(jobCard.getPurchaseOrderId());
wrapper.setJobCardId(item.getJobCardId());
wrapper.setOperatorName(stitchingOfflineItem.get(0).getCreatedBy());
wrapper.setAccountId(accountId);
return wrapper;
}).collect(Collectors.toList());
totalStitchingBasedOnAccountID.put(jobCard.getId()+stitchingOfflineItem.get(0).getSku(), stitchingOfflineItem.size());
jobCardItemsStitchingDetailsMap.computeIfAbsent(accountId, k -> new ArrayList<>()).addAll(wrappers);
}
stitchingDetails.put("totalStitchingBasedOnAccountID", totalStitchingBasedOnAccountID);
stitchingDetails.put("jobCardItemsStitchingDetailsMap", jobCardItemsStitchingDetailsMap);
stitchingDetails.put("Date Wise Stitching", dateWiseProduction);
stitchingDetails.put("stitchingAccount", inventoryAccounts);
return stitchingDetails;
}
public List<StitchingOfflineItem> stitchingItemsTransactions(String jobCardId, String accountId, String sku, String startDate, String endDate) {
List<Long> accountID = new ArrayList<>();
String startDate1 = null;
String endDate1 = null;
if (!StringUtils.isNullOrEmpty(startDate) && !StringUtils.isNullOrEmpty(accountId) && !StringUtils.isNullOrEmpty(jobCardId)) {
String formattedStart = CTPDateTimeFormat.getMySQLFormattedDateString(startDate, CTPDateTimeFormat.HTML5_DATE_INPUT_FORMAT);
String formattedEnd = !StringUtils.isNullOrEmpty(endDate)
? CTPDateTimeFormat.getMySQLFormattedDateString(endDate, CTPDateTimeFormat.HTML5_DATE_INPUT_FORMAT)
: LocalDate.now().toString();
startDate1 = String.format("'%s 00:00:01'", formattedStart);
endDate1 = String.format("'%s 23:59:59'", formattedEnd);
accountID.add(Long.parseLong(accountId));
}
String query = SummaryInventoryReportQueryBuilder.cuttingQueryBuild(Long.parseLong(jobCardId), accountID, sku, startDate1, endDate1,"IN","STITCHING_OFFLINE");
List<InventoryTransactionLeg> inventoryTransactionLegs = inventoryTransactionLegDAO.findByQuery(query);
List<Long> stitchingItemsList = inventoryTransactionLegs.stream()
.map(InventoryTransactionLeg::getParentDocumentId)
.collect(Collectors.toList());
return stitchingOfflineItemDAO.findByIds(stitchingItemsList);
}
private StringBuilder generateTime(LocalDateTime startDate, LocalDateTime endDate){
StringBuilder totalTime = new StringBuilder();

View File

@ -185,7 +185,12 @@ document.addEventListener("DOMContentLoaded", function () {
format: '{value}%'
}
},
legend: {
itemStyle: {
fontSize: 10-fontSize,
fontWeight: 'bold'
}
},
scrollbar: {
enabled: true
},
@ -196,7 +201,6 @@ document.addEventListener("DOMContentLoaded", function () {
});
}
initializeGauges();
function initializeGauges() {
@ -256,7 +260,7 @@ document.addEventListener("DOMContentLoaded", function () {
createBarChart( divId, height, width, title, aHeading, aData, bHeading, bData, cHeading, cData, dHeading, dData, datesArray, fontSize, maxValue);
});
const cuttingBarChart = document.querySelectorAll('.cuttingBarChart');
const cuttingBarChart = document.querySelectorAll('.singleBarChart');
cuttingBarChart.forEach(function (div) {
const title = div.getAttribute('data-title');
const height = div.getAttribute('data-height');

View File

@ -90,7 +90,6 @@
},
methods : {
onItemSelect: function (id, item) {
console.log("wdwawdwwadwwdwda",item.id)
this.items.push(item);
},
removeItem: function (index) {

View File

@ -0,0 +1,92 @@
( async function(){
Vue.prototype.$accounts = window.ctp.accounts;
Vue.component('finish-item-table',{
props : [ 'items' ],
methods: {
getFormattedDateTime: function (dateTime) {
if (!!dateTime) {
return dateTime.split('T')[0] + ' ' + dateTime.split('T')[1];
}
return luxon.DateTime.now().toFormat('yyyy-MM-dd HH:mm:ss');
},
removeItem: function (index) {
this.$emit('remove-item', index)
}
},
template : `
<table class="table table-bordered bg-white col-sm-12">
<thead>
<tr>
<th>ID</th>
<th>Item ID</th>
<th>Sku</th>
<th>Created By</th>
<th>Created At</th>
<th>Job Card ID</th>
<th>Barcode</th>
<th>Status</th>
<th>Action</th>
</tr>
</thead>
<tbody>
<tr v-for="(item,index) in items">
<td>
<input hidden="hidden" v-bind:name="'items[' + index + '].id'" v-bind:value="item.id">
<input hidden="hidden" v-bind:name="'items[' + index + '].itemId'" v-bind:value="item.itemId">
<input hidden="hidden" v-bind:name="'items[' + index + '].sku'" v-bind:value="item.sku">
<input hidden="hidden" v-bind:name="'items[' + index + '].createdBy'" v-bind:value="item.createdBy">
<input hidden="hidden" v-bind:name="'items[' + index + '].createdAt'" v-bind:value="getFormattedDateTime(item.createdAt)">
<input hidden="hidden" v-bind:name="'items[' + index + '].jobCardId'" v-bind:value="item.jobCardId">
<input hidden="hidden" v-bind:name="'items[' + index + '].barcode'" v-bind:value="item.barcode" >
<input hidden="hidden" v-bind:name="'items[' + index + '].isQa'" v-bind:value="item.isQa">
<input hidden="hidden" v-bind:name="'items[' + index + '].stitchedItemId'" v-bind:value="item.stitchedItemId">
<input hidden="hidden" v-bind:name="'items[' + index + '].isSegregated'" v-bind:value="item.isSegregated">
<input hidden="hidden" v-bind:name="'items[' + index + '].qaStatus'" v-bind:value="item.qaStatus">
<input hidden="hidden" v-bind:name="'items[' + index + '].accountId'" v-bind:value="item.accountId">
<span> {{item.id}} </span>
</td>
<td> {{item.itemId}} </td>
<td> {{item.sku}} </td>
<td> {{item.createdBy}} </td>
<td> {{ getFormattedDateTime( item.createdAt) }} </td>
<td> {{item.jobCardId}}</td>
<td> {{item.barcode}} </td>
<td > {{item.qaStatus}} </td>
<td>
<button type="button" title="Remove" class="btn btn-light text-left" v-on:click="removeItem(index)">
<i class="bi bi-trash"></i>
</button>
</td>
</tr>
</tbody>
</table>
`,
})
let app = new Vue({
el : '#packagingApp',
data : {
items : []
},
methods : {
onItemSelect: function (id, item) {
this.items.push(item);
},
removeItem: function (index) {
this.items.splice(index, 1);
},
hasDuplicates: function () {
const ids = this.items.map(item => item.id);
const uniqueIds = new Set(ids);
return ids.length !== uniqueIds.size;
},
},
mounted : function () {
console.log( this.$accounts )
}
})
})(jQuery)

View File

@ -31,6 +31,10 @@
<img th:src="@{/img/utopia-industries-white.svg}" class="page-header__logo" alt="Utopia Industries">
</a>
<ul class="navbar-nav">
<!-- <li class="nav-item" sec:authorize="hasAnyRole('ROLE_PURCHASE_ORDER', 'ROLE_ADMIN')">-->
<!-- <a th:href="@{/purchase-order/}" class="nav-link"-->
<!-- th:classappend="${#strings.startsWith(#httpServletRequest.getRequestURI(), '/ctp/purchase-order') ? 'active' : ''}">Purchase Order</a>-->
<!-- </li>-->
<li class="nav-item" sec:authorize="hasAnyRole('ROLE_JOB_CARD', 'ROLE_ADMIN')">
<a th:href="@{/job-cards/}" class="nav-link"
th:classappend="${#strings.startsWith(#httpServletRequest.getRequestURI(), '/ctp/job-cards') ? 'active' : ''}">Job Cards</a>
@ -91,6 +95,16 @@
</div>
</div>
</nav>
<!-- second level purchase Order-->
<!-- <nav class="navbar navbar-light bg-light navbar-expand-lg justify-content-between"-->
<!-- th:if="${#strings.startsWith(#httpServletRequest.getRequestURI(), '/ctp/purchase-order')}">-->
<!-- <ul class="navbar-nav">-->
<!-- <li class="nav-item"-->
<!-- th:classappend="${#strings.startsWith(#httpServletRequest.getRequestURI(), '/ctp/purchase-order') ? 'active' : ''}">-->
<!-- <a th:href="@{/purchase-order/}" class="nav-link">Cards</a>-->
<!-- </li>-->
<!-- </ul>-->
<!-- </nav>-->
<!-- second level job cards-->
<nav class="navbar navbar-light bg-light navbar-expand-lg justify-content-between"
th:if="${#strings.startsWith(#httpServletRequest.getRequestURI(), '/ctp/job-cards')}">
@ -144,6 +158,10 @@
th:classappend="${#strings.startsWith(#httpServletRequest.getRequestURI(), '/ctp/reporting/cutting-report') ? 'active' : ''}">
<a th:href="@{/reporting/cutting-report}" class="nav-link">Cutting Tables Report</a>
</li>
<li class="nav-item"
th:classappend="${#strings.startsWith(#httpServletRequest.getRequestURI(), '/ctp/reporting/stitching-report') ? 'active' : ''}">
<a th:href="@{/reporting/stitching-report}" class="nav-link">Stitching Line Report</a>
</li>
<li class="nav-item"
th:classappend="${#strings.startsWith(#httpServletRequest.getRequestURI(), '/ctp/reporting/summary') ? 'active' : ''}">
<a th:href="@{/reporting/summary}" class="nav-link">Summary</a>
@ -204,6 +222,10 @@
<nav class="navbar navbar-light bg-light navbar-expand-lg justify-content-between"
th:if="${#strings.startsWith(#httpServletRequest.getRequestURI(), '/ctp/packaging')}">
<ul class="navbar-nav">
<li class="nav-item"
th:classappend="${#strings.startsWith(#httpServletRequest.getRequestURI(), '/ctp/packaging/receive-inventory') ? 'active' : ''}">
<a th:href="@{/packaging/receive-inventory}" class="nav-link">Receive Inventory</a>
</li>
<li class="nav-item"
th:classappend="${#strings.startsWith(#httpServletRequest.getRequestURI(), '/ctp/packaging/inventory-accounts') ? 'active' : ''}">
<a th:href="@{/packaging/inventory-accounts}" class="nav-link">Inventory Accounts</a>

View File

@ -33,7 +33,7 @@
<th>Created By</th>
<th>
<div class="mb-2">
<button class="btn btn-sm btn-outline-primary" type="submit">Generate Barcode</button>
<button class="btn btn-sm btn-outline-primary" type="submit">Generate Bundle Barcode</button>
</div>
<div><input type="checkbox" data-checkbox-all></div>
</th>

View File

@ -19,7 +19,7 @@
<form th:action="@{/cutting/generate-master-barcodes}" method="post">
<input hidden="hidden" name="artifactType" value="MasterBundle">
<table class="table table-striped table-bordered" data-bundle-table
data-order="[[ 0, &quot;desc&quot; ]]">
data-order="[[ 6, &quot;desc&quot; ]]">
<thead>
<tr>
<th></th>
@ -32,7 +32,7 @@
<th>Received</th>
<th>
<div class="mb-2">
<button class="btn btn-sm btn-outline-primary" type="submit">Generate
<button class="btn btn-sm btn-outline-primary" type="submit">Generate Master
Barcode
</button>
</div>

View File

@ -9,7 +9,7 @@
<main class="row page-main">
<div class="col-sm">
<div th:replace="_notices :: page-notices"></div>
<h3 class="pb-2">Receive Inventory</h3>
<h3 class="pb-2">Receive Inventory Against Job Card</h3>
<form th:action="@{/cutting/receive-inventory}"
method="POST"
id="receiveInvApp"

View File

@ -0,0 +1,54 @@
<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org" xmlns:sec="http://www.w3.org/1999/xhtml"
xmlns:v-bind="http://www.w3.org/1999/xhtml">
<head th:replace="_fragments :: head('Segregate Finished Items')"></head>
<body>
<div class="container-fluid">
<header class="row page-header" th:replace="_fragments :: page-header"></header>
<main class="row page-main">
<div class="col-sm">
<div class="mb-4 d-flex justify-content-between">
<h3>Receive Finished Items</h3>
</div>
<form th:action="'/ctp/packaging/packaging-items'" method="post" id="packagingApp">
<div class="bg-light p-3 mb-3">
<div class="form-row">
<div class="col-sm-3 form-group">
<search-item
url="/ctp/rest/finished-items/search-packaging"
v-on:finished-item-select="onItemSelect">
</search-item>
</div>
<div class="col-sm-3 form-group">
<!-- <label>Packaging Account</label>-->
<!-- <select class="form-control" name="account-id" th:field="*{finishedAccountId}" required>-->
<!-- <option value="">PLease select</option>-->
<!-- <option th:each="account : ${accounts}"-->
<!-- th:value="${account.id}"-->
<!-- th:text="${account.title}"></option>-->
<!-- </select>-->
</div>
</div>
</div>
<div class="bg-light p-3 mb-3">
<h6 class="mb-3">Search Finished Items</h6>
<finish-item-table
v-bind:items="items"
v-on:remove-item="removeItem"
></finish-item-table>
</div>
<div class="alert alert-danger" v-if="hasDuplicates()" >Duplicate Item Selected</div>
<button class="btn btn-primary" type="submit" v-bind:disabled="hasDuplicates()">Submit</button>
<a th:href="@{/finishing/finished-items}" class="btn btn-light">Cancel</a>
</form>
<script th:inline="javascript">
window.ctp.accounts = [[${accounts}]];
</script>
<script th:src="@{/js/vendor/compressor.min.js}"></script>
<script th:src="@{/js/packaging/packaging-item-form.js}"></script>
</div>
</main>
</div>
<div th:replace="_fragments :: page-footer-scripts"></div>
</body>
</html>

View File

@ -0,0 +1,38 @@
<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org" xmlns:sec="http://www.w3.org/1999/xhtml" xmlns:v-bind="http://www.w3.org/1999/xhtml">
<head th:replace="_fragments :: head('Home Page')"></head>
<body>
<div class="container-fluid">
<header class="row page-header" th:replace="_fragments :: page-header"></header>
<main class="row page-main">
<div class="col-sm" th:fragment="cardFragment">
<div th:replace="_notices :: page-notices"></div>
<form th:action="@{ ${purchaseOrderCTP.id} ? ('/purchase-order/edit/' + ${purchaseOrderCTP.id}) : '/purchase-order/edit' }"
method="POST"
th:object="${purchaseOrderCTP}"
id="purchaseOrderApp">
<input hidden="hidden" th:field="*{id}">
<input hidden="hidden" th:field="*{order}">
<div class="bg-light p-3 mb-3">
<h6 class="mb-3">Info</h6>
<div class="form-row">
<div class="col-sm-3 form-group">
<label>Job Order</label>
<input type="number" class="form-control" th:field="*{jobOrderId}" required>
</div>
</div>
</div>
<div>
<button class="btn btn-secondary" type="submit" name="user" value="draft" v-bind:disabled="hasEmptyItems()">Save Draft</button>
<button class="btn btn-primary" type="submit" name="user" value="post" v-bind:disabled="hasEmptyItems()">Post</button>
<a th:href="@{/job-cards}" class="btn btn-light">Cancel</a>
</div>
</form>
</div>
</main>
</div>
<div th:replace="_fragments :: page-footer-scripts"></div>
</body>
</html>

View File

@ -13,7 +13,7 @@
<div class="col-sm">
<div th:replace="_notices :: page-notices"></div>
<div class="mb-4 d-flex justify-content-between">
<h3>Finished Items</h3>
<h3>QC Items</h3>
<a th:href="@{/quality-control/qc-finished-item}" class="btn btn-primary">Add Items For QC</a>
</div>
<div th:replace="_fragments :: table-loading-skeleton"></div>

View File

@ -0,0 +1,10 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
</head>
<body>
</body>
</html>

View File

@ -0,0 +1,113 @@
<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.w3.org/1999/xhtml">
<head>
<meta charset="UTF-8">
<title>Title</title>
<style>
/* Custom CSS for full height and center alignment of span */
.vertical-divider {
display: flex;
justify-content: center; /* Center horizontally */
align-items: center; /* Center vertically */
}
.vertical-divider span {
display: inline-block;
width: 1px;
background-color: #dee2e6;
height: 100%; /* Take full height of the parent div */
}
</style>
</head>
<body>
<div class="container">
<div class="row">
<div class="col-sm-12">
<table th:if="${#lists.size(transactions) != 0 && #lists != null }" class="table table-bordered font-sm mb-4" data-account-tables>
<thead>
<tr>
<th>ID</th>
<th>Item ID</th>
<th>SKU</th>
<th>QR Code</th>
<th>Created By</th>
<th>Created At</th>
<th>Bundle Id</th>
<th>QA Status</th>
</tr>
</thead>
<tbody>
<tr th:each="transaction : ${transactions}" th:object="${transaction}">
<td th:text="*{id}"></td>
<td th:text="*{itemId}"></td>
<td th:text="*{sku}"></td>
<td th:text="*{barcode}"></td>
<td th:text="*{createdBy}"></td>
<td th:text="*{createdAt}"></td>
<td th:text="*{bundleId}"></td>
<td>
<span th:if="*{ not isQa}" class="badge badge-danger">NOT PERFORMED</span>
<div th:if="*{isQa}">
<span class="badge badge-APPROVED">PERFORMED</span>
</div>
</td>
</tr>
<!-- More rows as needed -->
</tbody>
</table>
<h5 th:if="${#lists.size(transactions) == 0}" class="mt-2">No Inventory Transactions found.</h5>
</div>
</div>
</div>
<div th:replace="_fragments :: page-footer-scripts"></div>
<script th:inline="javascript">
// Initialize DataTables for each individual table
$('table[data-account-tables]').each(function () {
const $table = $(this);
// Prevent reinitializing if already done
if (!$.fn.DataTable.isDataTable($table)) {
$table.DataTable({
pageLength: 5,
searching: true,
lengthChange: false,
processing: false,
dom: `
<'row'<'col-sm-5'B><'col-sm-7'f>>
<'row'<'col-sm-12't>>
<'row'<'col-sm-5'i><'col-sm-7'p>>`,
buttons: [{
extend: 'excel',
text: '',
className: 'bi bi-file-earmark-spreadsheet btn-sm d-none' // Keep it hidden
}]
});
}
});
(async function () {
const $selectAllCheckBox = $('[data-checkbox-all]');
$selectAllCheckBox.change(function () {
if ($selectAllCheckBox.prop('checked')) {
// When parent checkbox is checked, check all child checkboxes
$('[name="parent-doc-type-ids"]').each(function () {
let $this = $(this);
$this.prop('checked', true);
});
} else {
// When parent checkbox is unchecked, uncheck all child checkboxes
$('[name="parent-doc-type-ids"]').each(function () {
let $this = $(this);
$this.prop('checked', false);
});
}
});
})(jQuery)
</script>
</body>
</html>

View File

@ -22,7 +22,7 @@
<input type="date" class="form-control" name="end-date" th:value="${param['end-date'] ?: endDate}">
</div>
<div class="form-group">
<label>Cutting Account</label>
<label>Select Account</label>
<select class="form-control" name="accountId">
<option value="">Please Select</option>
<option th:each="account : ${accounts}"

View File

@ -9,13 +9,10 @@
<header class="row page-header" th:replace="_fragments :: page-header"></header>
<main class="row page-main">
<aside class="col-sm-2" th:replace="/reporting/cutting-report-sidebar :: sidebar"></aside>
<div class="col-sm">
<table class="table table-striped" data-account-table data-order="[[ 0, &quot;asc&quot; ]]">
<tbody>
<tr>
<td th:if="${cutting.get('Date Wise Cutting') != null}" style="padding-left: 150px;">
<div style="border: 2px solid #d5d8dc; padding-top: 10px; border-radius: 10px; height: 560px; width: 80%; overflow-x: auto;">
<div id="cuttingBarChart" class="cuttingBarChart" style="height: 500px; width: 1600px;"
<div class="col-lg-10">
<div th:if="${cutting.get('Date Wise Cutting') != null}" class="d-flex justify-content-center">
<div class="border rounded-3 pt-2 mx-auto overflow-auto" style="height: 560px; width: 80%;">
<div id="singleBarChart" class="singleBarChart" style="height: 500px; width: 1600px;"
th:data-width="1600"
th:data-height="500"
th:data-title="'Days Wise Progress'"
@ -29,11 +26,13 @@
th:data-fontSize="30"
></div>
</div>
</td>
</tr>
<tr th:if="${cutting.get('cuttingAccount') != null}" th:each="cuttingAccount, index : ${cutting.get('cuttingAccount')}">
<td th:if="${cutting.get('accountWiseCutting').containsKey(cuttingAccount.id)}" class="p-0 text-center">
<div class="bg-dark text-white py-2 px-3 fs-5 fw-bold text-center" th:text="${cuttingAccount.title}"></div>
</div>
<div class="mt-3" th:if="${cutting.get('cuttingAccount') != null}"
th:each="cuttingAccount, index : ${cutting.get('cuttingAccount')}">
<div th:if="${cutting.get('accountWiseCutting').containsKey(cuttingAccount.id)}"
class="p-0 text-center">
<div class="bg-dark text-white py-2 px-3 fs-5 fw-bold text-center"
th:text="${cuttingAccount.title}"></div>
<table class="table table-bordered mt-2">
<thead class="">
<tr>
@ -57,15 +56,15 @@
<td th:text="${wrap.poName}"></td>
<td th:text="${wrap.sku}"></td>
<td th:text="${wrap.articleName}"></td>
<td th:text="${wrap.totalCutting}"></td>
<td th:text="${wrap.cuttingOperatorName}"></td>
<td th:text="${wrap.total}"></td>
<td th:text="${wrap.operatorName}"></td>
<td th:text="${wrap.width}"></td>
<td th:text="${wrap.length}"></td>
<td th:text="${wrap.gsm}"></td>
<td th:text="${wrap.wtPly}"></td>
<td th:text="${wrap.ply}"></td>
<td>
<span th:if="${!wrap.Complete}" class="badge badge-danger" >Not Complete</span>
<span th:if="${!wrap.Complete}" class="badge badge-danger">Not Complete</span>
<div th:if="${wrap.Complete}">
<span class="badge badge-APPROVED">Completed</span>
</div>
@ -73,10 +72,8 @@
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</main>
</div>

View File

@ -9,38 +9,35 @@
<header class="row page-header" th:replace="_fragments :: page-header"></header>
<main class="row page-main">
<aside class="col-sm-2" th:replace="/reporting/job-card-report-sidebar :: sidebar"></aside>
<div class="col-sm">
<table class="table " >
<thead>
<tr th:if="${jobCardProgress == null}">
<th colspan="5" style="font-size:26px; text-align: center;">Please Select Job card</th>
</tr>
</thead>
<div class="col-lg-10">
<div th:if="${jobCardProgress == null}" class="text-center my-5">
<h2 class="fs-1">Please Select Job Card</h2>
</div>
<tbody>
<tr th:if="${jobCardProgress != null }">
<td style="padding:0px;">
<div style="border: 2px solid #d5d8dc; padding: 10px; border-radius: 10px; height: 370px;">
<h1 style="text-align: center;">Job Card Report</h1>
<div style="display: flex; align-items: center;">
<div style="text-align: center;margin-top: -45px">
<div style="width: 300px; height: 330px;"
<div th:if="${jobCardProgress != null}">
<div class="border rounded-3 pt-4 ">
<h1 class="text-center mb-5">Job Card Report</h1>
<div class="row justify-content-center align-items-start">
<div class="text-center">
<div class="gauge-chart2"
th:id="'gauge-chart2'"
class="gauge-chart2"
th:data-progress="${jobCardProgress.get('Job Card Progress')}"
th:data-title="${'Job Card Progress'}"
th:data-title="'Job Card Progress'"
th:data-width="350"
th:data-height="350"
th:data-totalProduction="${totalProduction}"
th:data-actualProduction="${completeProduction.get('Job Card Progress')}"
th:data-fontSize="30"
th:data-fontColor="'#17202a'"
th:data-color="'#566573'"></div>
th:data-color="'#566573'">
</div>
<div style="display: flex; ">
<div th:each="title, index : ${jobCardProgress.keySet()}" style="text-align: center; margin-top: 40px;">
<div th:if ="${ title != 'Job Card Progress' }"
th:id="'gauge-chart-' + ${index}" class="gauge-chart" style="width: 200px; height: 230px;"
</div>
<div class="d-flex flex-wrap justify-content-center gap-2 " style="margin-top: 70px;">
<div th:each="title, index : ${jobCardProgress.keySet()}"
th:if="${title != 'Job Card Progress'}" class="text-center">
<div class="gauge-chart"
th:id="'gauge-chart-' + ${index}"
th:data-progress="${jobCardProgress.get(title)}"
th:data-totalProduction="${totalProduction}"
th:data-actualProduction="${completeProduction.get(title)}"
@ -58,37 +55,38 @@
</div>
</div>
</div>
</td>
</tr>
<tr th:if="${phasesTimes != null }">
<td style="display: flex; flex-direction: column; align-items: center; border: none !important; outline: none;">
<div style="display: flex; gap: 10px;">
<div th:each="phase, index : ${phasesTimes.keySet()}" style="border: 2px solid #d5d8dc; border-radius: 10px; text-align: center; padding:20px;">
<H6 th:text="${phase}"></H6>
<H6 th:text="${phasesTimes.get(phase)}"></H6>
<H6 th:if="${pendingStatus.get(phase) != null}" th:text="${pendingStatus.get(phase)}"></H6>
<div th:if="${phasesTimes != null}" class="d-flex flex-column align-items-center my-2">
<div class="d-flex flex-wrap gap-3">
<div th:each="phase, index : ${phasesTimes.keySet()}"
class="border rounded-3 text-center p-3 mr-3">
<h6 th:text="${phase}"></h6>
<h6 th:text="${phasesTimes.get(phase)}"></h6>
<h6 th:if="${pendingStatus.get(phase) != null}" th:text="${pendingStatus.get(phase)}"></h6>
</div>
</div>
</td>
</tr>
<tr>
<!-- Cutting Details Column -->
<td th:if="${cuttingDetails != null && cuttingDetails.get('accounts') != null}" style="padding: 0px; text-align: center;">
<div style="background-color: black; color: white; padding: 10px; font-size: 18px; font-weight: bold; text-align: center;">
</div>
<div class="my-5">
<div class="row g-4">
<div class="col-md-6"
th:if="${cuttingDetails != null && cuttingDetails.get('accounts') != null}">
<div class="bg-dark text-white text-center py-2 rounded-3 mb-3">
Cutting Detail
</div>
<table class="table" style="width: 100%; border-collapse: collapse;">
<thead>
<div class="table-responsive">
<table class="table table-bordered align-middle">
<thead class="table-light">
<tr>
<th>ID</th>
<th>Title</th>
<th>Cutting</th>
<th>Cutting Date</th>
<th>Cutting Table Descriptions</th>
<th>Descriptions</th>
</tr>
</thead>
<tbody>
<tr th:if="${cuttingDetails != null}" th:each="detail, index : ${cuttingDetails.get('accounts').keySet()}">
<tr th:each="detail, index : ${cuttingDetails.get('accounts').keySet()}">
<td th:text="${cuttingDetails.get('accounts').get(detail).id}"></td>
<td th:text="${cuttingDetails.get('accounts').get(detail).title}"></td>
<td th:text="${cuttingDetails.get('personName').get(detail)}"></td>
@ -100,43 +98,47 @@
</tr>
</tbody>
</table>
</td>
</div>
</div>
<!-- Stitching Details Column -->
<td th:if="${stitchingDetails != null && stitchingDetails.get('accounts') != null}" style="padding: 0px; text-align: center;">
<div style="background-color: black; color: white; padding: 10px; font-size: 18px; font-weight: bold; text-align: center;">
<div class="col-md-6"
th:if="${stitchingDetails != null && stitchingDetails.get('accounts') != null}">
<div class="bg-dark text-white text-center py-2 rounded-3 mb-3">
Stitching Detail
</div>
<table class="table" style="width: 100%; border-collapse: collapse;">
<thead>
<div class="table-responsive">
<table class="table table-bordered align-middle">
<thead class="table-light">
<tr>
<th>ID</th>
<th>Title</th>
<th>Stitching</th>
<th>Stitching Day</th>
<th>Stitching Table Descriptions</th>
<th>Descriptions</th>
</tr>
</thead>
<tbody th:if="${stitchingDetails != null and stitchingDetails.get('accounts') != null}">
<tbody>
<tr th:each="detail : ${stitchingDetails.get('accounts').keySet()}">
<td th:text="${stitchingDetails.get('accounts').get(detail).id}"></td>
<td th:text="${stitchingDetails.get('accounts').get(detail).title}"></td>
<td th:text="${stitchingDetails.get('personName') != null ? stitchingDetails.get('personName').get(detail) : ''}"></td>
<td>
<span th:if="${stitchingDetails.get('date') != null and stitchingDetails.get('date').get(detail) != null}" th:text="${#temporals.format(stitchingDetails.get('date').get(detail), 'E')}"></span>
<span th:if="${stitchingDetails.get('date') != null and stitchingDetails.get('date').get(detail) != null}" ctp:formatdate="${stitchingDetails.get('date').get(detail)}"></span>
<span th:if="${stitchingDetails.get('date') != null and stitchingDetails.get('date').get(detail) != null}"
th:text="${#temporals.format(stitchingDetails.get('date').get(detail), 'E')}"></span>
<span th:if="${stitchingDetails.get('date') != null and stitchingDetails.get('date').get(detail) != null}"
ctp:formatdate="${stitchingDetails.get('date').get(detail)}"></span>
</td>
<td th:text="${stitchingDetails.get('accounts').get(detail).notes}"></td>
</tr>
</tbody>
</table>
</td>
</tr>
</div>
</div>
</div>
</div>
<tr th:if="${dailyProgress != null}">
<td colspan="5" style="padding-left: 150px;">
<div style="border: 2px solid #d5d8dc; padding-top: 10px; border-radius: 10px; height: 560px; width: 80%; overflow-x: auto;">
<div th:if="${dailyProgress != null}" class="d-flex justify-content-center my-5">
<div class="border rounded-3 p-3 w-75 overflow-auto" style="height: 560px;">
<div id="barChart" class="barChart" style="height: 500px; width: 1600px;"
th:data-width="1600"
th:data-height="500"
@ -147,13 +149,11 @@
th:data-quality="${dailyProgress.get('quality')}"
th:data-finishing="${dailyProgress.get('finishing')}"
th:data-totalProduction="${completeProduction.get('Cutting Progress')}"
th:data-fontSize="30"
></div>
th:data-fontSize="30">
</div>
</div>
</div>
</div>
</td>
</tr>
</tbody>
</table>
</div>
</main>
</div>

View File

@ -10,7 +10,8 @@
<div class="col-sm">
<table class="table">
<tbody>
<tr th:if="${allJobCard != null}" th:each="jobCard : ${allJobCard.keySet()}" style="padding-bottom:10px">
<tr th:if="${allJobCard != null}" th:each="jobCard : ${allJobCard.keySet()}"
style="padding-bottom:10px">
<td class="m-0 pb-3">
<table class="table mb-0 table-bordered text-center">
<thead>
@ -25,12 +26,16 @@
</thead>
<tbody>
<tr>
<td >
<span style="font-size: 14px; font-weight: bold;" th:text="'Total : ' + ${allJobCard.get(jobCard).get('Cutting Progress')}"></span>
<td>
<span style="font-size: 14px; font-weight: bold;"
th:text="'Total : ' + ${allJobCard.get(jobCard).get('Cutting Progress')}"></span>
<br>
<span style="font-size: 14px; font-weight: bold;" th:text="'Complete Products : ' + ${allJobCard.get(jobCard).get('Job Card Progress')}"></span>
<span style="font-size: 14px; font-weight: bold;"
th:text="'Complete Products : ' + ${allJobCard.get(jobCard).get('Job Card Progress')}"></span>
</td>
<td style="font-size: 14px;" th:if="${values != 'Job Card Progress'}" th:each="values : ${allJobCard.get(jobCard).keySet()}" th:text="${allJobCard.get(jobCard).get(values)}"></td>
<td style="font-size: 14px;" th:if="${values != 'Job Card Progress'}"
th:each="values : ${allJobCard.get(jobCard).keySet()}"
th:text="${allJobCard.get(jobCard).get(values)}"></td>
</tr>
</tbody>
</table>

View File

@ -0,0 +1,133 @@
<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org" xmlns:sec="http://www.w3.org/1999/xhtml"
xmlns:ctp="http://www.w3.org/1999/xhtml">
<head th:replace="_fragments :: head('Stitching Report')"></head>
<body>
<div class="container-fluid">
<header class="row page-header" th:replace="_fragments :: page-header"></header>
<main class="row page-main">
<aside class="col-sm-2" th:replace="/reporting/cutting-report-sidebar :: sidebar"></aside>
<div class="col-lg-10">
<div th:if="${stitching.get('Date Wise Stitching') != null}" class="d-flex justify-content-center">
<div class="border rounded-3 pt-2 mx-auto overflow-auto" style="height: 560px; width: 80%;">
<div id="singleBarChart" class="singleBarChart" style="height: 500px; width: 1600px;"
th:data-width="1600"
th:data-height="500"
th:data-title="'Days Wise Progress'"
th:data-dates="${stitching.get('Date Wise Stitching').keySet()}"
th:data-barData="${stitching.get('Date Wise Stitching').values()}"
th:data-barHeading="'Stitching'"
th:data-stitching="''"
th:data-quality="''"
th:data-finishing="''"
th:data-totalProduction="'30000'"
th:data-fontSize="30"
></div>
</div>
</div>
<div class="mt-3"
th:if="${stitching.get('stitchingAccount') != null && stitching.get('jobCardItemsStitchingDetailsMap').get(stitchingAccount.id) != null}"
th:each="stitchingAccount, index : ${stitching.get('stitchingAccount')}">
<div class="bg-dark text-white py-2 px-3 fs-5 fw-bold text-center mb-2"
th:text="${stitchingAccount.title}"></div>
<table class="table table-striped " data-account-table th:data-account-id="${stitchingAccount.id}">
<thead>
<tr>
<th></th>
<th>Job Card</th>
<th>PO Number</th>
<th>SKU</th>
<th>Article Name</th>
<th>Stitching Operator Name</th>
<th>Total Stitching</th>
</tr>
</thead>
<tbody>
<tr th:each="wrap, index : ${stitching.get('jobCardItemsStitchingDetailsMap').get(stitchingAccount.id)}">
<td data-show-dropdown-transactions
th:data-account-id="${stitchingAccount.id}"
th:data-jobcardid="${wrap.jobCardId}"
th:data-sku="${wrap.sku}"
th:data-start-date="${param['start-date'] ?: startDate}"
th:data-end-date="${param['end-date'] ?: endDate}"
title="Transactions">
<span data-dropdown-icon-transactions class="bi bi-caret-right-fill"></span>
</td>
<td th:text="${wrap.jobCardCode}"></td>
<td th:text="${wrap.poName}"></td>
<td th:text="${wrap.sku}"></td>
<td th:text="${wrap.articleName}"></td>
<td th:text="${wrap.operatorName}"></td>
<td th:text="${stitching.get('totalStitchingBasedOnAccountID').get(wrap.jobCardId+wrap.sku)}"></td>
</tr>
</tbody>
</table>
</div>
</div>
</main>
</div>
<script>
const $body = $('body');
// Initialize DataTables for each individual table
$('table[data-account-table]').each(function () {
$(this).DataTable({
paging: false,
pageLength: 100,
searching: false,
lengthChange: false,
processing: false,
dom: `
<'row'<'col-sm-5'B><'col-sm-7'f>>
<'row'<'col-sm-12't>>
<'row'<'col-sm-5'i><'col-sm-7'p>>`,
buttons: [{
extend: 'excel',
text: '',
className: 'bi bi-file-earmark-spreadsheet btn-sm d-none'
}]
});
});
// Dropdown transactions toggle
$body.on('click', '[data-show-dropdown-transactions]', function (e) {
e.preventDefault();
const $this = $(this);
const $tr = $this.closest('tr');
const $table = $this.closest('table');
const dataTable = $table.DataTable();
const $row = dataTable.row($tr);
const $spanDropdown = $this.find('[data-dropdown-icon-transactions]');
const accountId = $this.data('account-id');
const jobCardId = $this.data('jobcardid');
const sku = $this.data('sku');
const startDate = $this.data('start-date');
const endDate = $this.data('end-date');
$spanDropdown.toggleClass('bi-caret-right-fill bi-caret-down-fill');
if ($row.child.isShown()) {
$row.child.hide();
} else {
$row.child(`<span class="spinner-border text-center spinner-border-md" role="status"></span>`).show();
$.ajax({
url: `/ctp/reporting/inventory-transactions?account-id=${accountId}&jobCard-id=${jobCardId}&sku=${sku}&startDate=${startDate}&endDate=${endDate}`,
success: function (data) {
$row.child(data).show();
}
});
}
});
</script>
<!-- Load JavaScript file -->
<script th:src="@{/js/charts.js}"></script>
</body>
</html>

View File

@ -31,6 +31,15 @@
<label>End Date</label>
<input type="date" class="form-control" name="end-date" th:value="${param['end-date'] ?: endDate}">
</div>
<div class="form-group">
<label>Status</label>
<select class="form-control" name="status">
<option value="" th:selected="${param.status == null}">Please Select</option>
<option value="APPROVED" th:selected="${param.status == 'true'}">Approved</option>
<option value="REJECT" th:selected="${param.status == 'false'}">Reject</option>
</select>
</div>
<div class="form-group">
<label>Count</label>
<input type="number" class="form-control" name="count" maxlength="100" min="0" th:value="${param['count'] ?: 100}">

View File

@ -60,7 +60,7 @@
</div>
</div>
<div>
<button class="btn btn-primary" type="submit">Receive Inventory</button>
<button class="btn btn-primary" type="submit">Receive Master Bundle</button>
<a th:href="@{/job-cards}" class="btn btn-light">Cancel</a>
</div>
</form>

View File

@ -13,8 +13,8 @@
<div class="col-sm">
<div th:replace="_notices :: page-notices"></div>
<div class="mb-4 d-flex justify-content-between">
<h3>Stitching Offline Items</h3>
<a th:href="@{/stitching/create-stitching-items}" class="btn btn-primary">Create Stitched Items</a>
<h3>Stitching WIP's</h3>
<a th:href="@{/stitching/create-stitching-items}" class="btn btn-primary">Create Stitching WIP's</a>
</div>
<div th:replace="_fragments :: table-loading-skeleton"></div>
<form th:action="@{/stitching/generate-barcodes}" method="post">
@ -32,7 +32,7 @@
<th>Is QA</th>
<th>
<div class="mb-2">
<button class="btn btn-sm btn-outline-primary" type="submit">Generate Barcode</button>
<button class="btn btn-sm btn-outline-primary" type="submit">Generate QR code</button>
</div>
<div><input type="checkbox" data-checkbox-all></div>
</th>