fix po pdf layout

fix-po-pdf-layout
usama.jameel 2025-06-12 15:04:57 +05:00
parent 59a430de50
commit 2fa65059c4
7 changed files with 399 additions and 211 deletions

View File

@ -9,17 +9,24 @@ public class POsDetails {
private long poRequiredQuantity;
// items detail
private long totalCutting;
private long remainingCutting;
private long totalStitching;
private long remainingStitching;
private long totalEndLineQC;
private long remainingEndLineQC;
private long totalFinishing;
private long remainingFinishing;
private long totalAGradeItem;
private long totalBGradeItem;
private long totalCGradeItem;
private long actualCutting;
private long balanceToCutting;
private long cuttingReceived;
private long cuttingOki;
private long cuttingReject;
private long stitchingIn;
private long stitchingWips;
private long stitchingOut;
private long finishIn;
private long finishRej;
private long finishQaApproved;
private long storeReceived;
private long storeWaiting;
private long packagingIn;
private long packagingOut;
private long packagingStock;
private long shippedScan;
private long shippedNet;
private boolean poStatus;
public long getPoQuantity() {
@ -46,94 +53,6 @@ public class POsDetails {
this.articleTitle = articleTitle;
}
public long getTotalCutting() {
return totalCutting;
}
public void setTotalCutting(long totalCutting) {
this.totalCutting = totalCutting;
}
public long getRemainingCutting() {
return remainingCutting;
}
public void setRemainingCutting(long remainingCutting) {
this.remainingCutting = remainingCutting;
}
public long getTotalStitching() {
return totalStitching;
}
public void setTotalStitching(long totalStitching) {
this.totalStitching = totalStitching;
}
public long getRemainingStitching() {
return remainingStitching;
}
public void setRemainingStitching(long remainingStitching) {
this.remainingStitching = remainingStitching;
}
public long getTotalEndLineQC() {
return totalEndLineQC;
}
public void setTotalEndLineQC(long totalEndLineQC) {
this.totalEndLineQC = totalEndLineQC;
}
public long getRemainingEndLineQC() {
return remainingEndLineQC;
}
public void setRemainingEndLineQC(long remainingEndLineQC) {
this.remainingEndLineQC = remainingEndLineQC;
}
public long getTotalFinishing() {
return totalFinishing;
}
public void setTotalFinishing(long totalFinishing) {
this.totalFinishing = totalFinishing;
}
public long getRemainingFinishing() {
return remainingFinishing;
}
public void setRemainingFinishing(long remainingFinishing) {
this.remainingFinishing = remainingFinishing;
}
public long getTotalAGradeItem() {
return totalAGradeItem;
}
public void setTotalAGradeItem(long totalAGradeItem) {
this.totalAGradeItem = totalAGradeItem;
}
public long getTotalBGradeItem() {
return totalBGradeItem;
}
public void setTotalBGradeItem(long totalBGradeItem) {
this.totalBGradeItem = totalBGradeItem;
}
public long getTotalCGradeItem() {
return totalCGradeItem;
}
public void setTotalCGradeItem(long totalCGradeItem) {
this.totalCGradeItem = totalCGradeItem;
}
public long getPoId() {
return poId;
}
@ -150,6 +69,150 @@ public class POsDetails {
this.poRequiredQuantity = poRequiredQuantity;
}
public long getActualCutting() {
return actualCutting;
}
public void setActualCutting(long actualCutting) {
this.actualCutting = actualCutting;
}
public long getBalanceToCutting() {
return balanceToCutting;
}
public void setBalanceToCutting(long balanceToCutting) {
this.balanceToCutting = balanceToCutting;
}
public long getCuttingReceived() {
return cuttingReceived;
}
public void setCuttingReceived(long cuttingReceived) {
this.cuttingReceived = cuttingReceived;
}
public long getCuttingOki() {
return cuttingOki;
}
public void setCuttingOki(long cuttingOki) {
this.cuttingOki = cuttingOki;
}
public long getCuttingReject() {
return cuttingReject;
}
public void setCuttingReject(long cuttingReject) {
this.cuttingReject = cuttingReject;
}
public long getStitchingIn() {
return stitchingIn;
}
public void setStitchingIn(long stitchingIn) {
this.stitchingIn = stitchingIn;
}
public long getStitchingWips() {
return stitchingWips;
}
public void setStitchingWips(long stitchingWips) {
this.stitchingWips = stitchingWips;
}
public long getStitchingOut() {
return stitchingOut;
}
public void setStitchingOut(long stitchingOut) {
this.stitchingOut = stitchingOut;
}
public long getFinishIn() {
return finishIn;
}
public void setFinishIn(long finishIn) {
this.finishIn = finishIn;
}
public long getFinishRej() {
return finishRej;
}
public void setFinishRej(long finishRej) {
this.finishRej = finishRej;
}
public long getFinishQaApproved() {
return finishQaApproved;
}
public void setFinishQaApproved(long finishQaApproved) {
this.finishQaApproved = finishQaApproved;
}
public long getStoreReceived() {
return storeReceived;
}
public void setStoreReceived(long storeReceived) {
this.storeReceived = storeReceived;
}
public long getStoreWaiting() {
return storeWaiting;
}
public void setStoreWaiting(long storeWaiting) {
this.storeWaiting = storeWaiting;
}
public long getPackagingIn() {
return packagingIn;
}
public void setPackagingIn(long packagingIn) {
this.packagingIn = packagingIn;
}
public long getPackagingOut() {
return packagingOut;
}
public void setPackagingOut(long packagingOut) {
this.packagingOut = packagingOut;
}
public long getPackagingStock() {
return packagingStock;
}
public void setPackagingStock(long packagingStock) {
this.packagingStock = packagingStock;
}
public long getShippedScan() {
return shippedScan;
}
public void setShippedScan(long shippedScan) {
this.shippedScan = shippedScan;
}
public long getShippedNet() {
return shippedNet;
}
public void setShippedNet(long shippedNet) {
this.shippedNet = shippedNet;
}
public boolean isPoStatus() {
return poStatus;
}
@ -161,17 +224,29 @@ public class POsDetails {
@Override
public String toString() {
return "POsDetails{" +
"totalCutting=" + totalCutting +
", remainingCutting=" + remainingCutting +
", totalStitching=" + totalStitching +
", remainingStitching=" + remainingStitching +
", totalEndLineQC=" + totalEndLineQC +
", remainingEndLineQC=" + remainingEndLineQC +
", totalFinishing=" + totalFinishing +
", remainingFinishing=" + remainingFinishing +
", totalAGradeItem=" + totalAGradeItem +
", totalBGradeItem=" + totalBGradeItem +
", totalCGradeItem=" + totalCGradeItem +
"poId=" + poId +
", poNumber='" + poNumber + '\'' +
", articleTitle='" + articleTitle + '\'' +
", poQuantity=" + poQuantity +
", poRequiredQuantity=" + poRequiredQuantity +
", actualCutting=" + actualCutting +
", balanceToCutting=" + balanceToCutting +
", cuttingReceived=" + cuttingReceived +
", cuttingOki=" + cuttingOki +
", cuttingReject=" + cuttingReject +
", stitchingIn=" + stitchingIn +
", stitchingWips=" + stitchingWips +
", stitchingOut=" + stitchingOut +
", finishIn=" + finishIn +
", finishRej=" + finishRej +
", finishQaApproved=" + finishQaApproved +
", storeReceived=" + storeReceived +
", storeWaiting=" + storeWaiting +
", packagingIn=" + packagingIn +
", packagingOut=" + packagingOut +
", packagingStock=" + packagingStock +
", shippedScan=" + shippedScan +
", shippedNet=" + shippedNet +
'}';
}
}

View File

@ -17,6 +17,6 @@ public class PackagingService {
public void createPackagingItem(FinishedItemWrapper wrapper){
inventoryService.createPackagingItemAndTransaction(wrapper, wrapper.getAccountId());
}
}

View File

@ -43,6 +43,7 @@ public class PurchaseOrderService {
Map<String,Integer> storeItems = purchaseOrderCTPService.getStoreItemsByPoId(pOsDetails.getPoId());
model.addAttribute("poDetail", pOsDetails);
model.addAttribute( "baseUrl", URLUtils.getCurrentBaseUrl() );
if (storeDetail && !storeItems.isEmpty()){
model.addAttribute("showStore", true);
model.addAttribute("store", storeItems);

View File

@ -30,8 +30,9 @@ public class ReportingService {
private final InventoryAccountDAO inventoryAccountDAO;
private final PurchaseOrderCTPDao purchaseOrderCTPDao;
private final StoreItemDao storeItemDao;
private final PackagingItemsDAO packagingItemsDAO;
public ReportingService(JobCardItemDAO jobCardItemDAO, BundleDAO bundleDAO, InventoryTransactionLegDAO inventoryTransactionLegDAO, JobCardDAO jobCardDAO, FinishedItemDAO finishedItemDAO, StitchingOfflineItemDAO stitchingOfflineItemDAO, InventoryAccountDAO inventoryAccountDAO, PurchaseOrderCTPDao purchaseOrderCTPDao, StoreItemDao storeItemDao) {
public ReportingService(JobCardItemDAO jobCardItemDAO, BundleDAO bundleDAO, InventoryTransactionLegDAO inventoryTransactionLegDAO, JobCardDAO jobCardDAO, FinishedItemDAO finishedItemDAO, StitchingOfflineItemDAO stitchingOfflineItemDAO, InventoryAccountDAO inventoryAccountDAO, PurchaseOrderCTPDao purchaseOrderCTPDao, StoreItemDao storeItemDao, PackagingItemsDAO packagingItemsDAO) {
this.jobCardItemDAO = jobCardItemDAO;
this.bundleDAO = bundleDAO;
this.inventoryTransactionLegDAO = inventoryTransactionLegDAO;
@ -41,6 +42,7 @@ public class ReportingService {
this.inventoryAccountDAO = inventoryAccountDAO;
this.purchaseOrderCTPDao = purchaseOrderCTPDao;
this.storeItemDao = storeItemDao;
this.packagingItemsDAO = packagingItemsDAO;
}
public Map<String, Integer> getJobCardProgress(String jobCardID) {
@ -446,18 +448,25 @@ public class ReportingService {
purchaseOrderCTPList = purchaseOrderCTPDao.findAll();
}
Map<String,Integer> jobCardCompleteItems = new HashMap<>();
for (PurchaseOrderCTP pos : purchaseOrderCTPList) {
List<JobCard> jobCards = jobCardDAO.findByPoId(pos.getId());
BigDecimal totalProduction = BigDecimal.ZERO;
BigDecimal expectedProduction = BigDecimal.ZERO;
BigDecimal actualProduction = BigDecimal.ZERO;
Long qaProgressItems = 0L;
Long totalFinishItem = 0L;
Long totalRejectPieces = 0L;
long stitchingIn = 0L;
long stitchingOut = 0L;
long finishApprovedItem = 0L;
long finishRejectItem = 0L;
long storeItems = 0L;
long packagingItems = 0L;
POsDetails pOsDetails = new POsDetails();
for (JobCard jobCard : jobCards) {
List<JobCardItem> jobCardItems = jobCardItemDAO.findByCardId(jobCard.getId());
expectedProduction = expectedProduction.add(jobCardItems.stream()
.map(item -> Optional.ofNullable(item.getExpectedProduction()).orElse(BigDecimal.ZERO))
.reduce(BigDecimal.ZERO, BigDecimal::add));
totalProduction = totalProduction.add(jobCardItems.stream()
.map(item -> Optional.ofNullable(item.getTotalProduction()).orElse(BigDecimal.ZERO))
.reduce(BigDecimal.ZERO, BigDecimal::add));
@ -465,34 +474,49 @@ public class ReportingService {
actualProduction = actualProduction.add(jobCardItems.stream()
.map(item -> Optional.ofNullable(item.getActualProduction()).orElse(BigDecimal.ZERO))
.reduce(BigDecimal.ZERO, BigDecimal::add));
qaProgressItems += Optional.ofNullable(stitchingOfflineItemDAO.CalculateTotalQA(jobCard.getId())).orElse(0L);
totalFinishItem += Optional.ofNullable(finishedItemDAO.calculateTotalFinishItem(jobCard.getId())).orElse(0L);
totalRejectPieces += Optional.ofNullable(storeItemDao.calculateTotalRejectItemByJobCardId(jobCard.getId())).orElse(0L);
jobCardCompleteItems = getSegregateItems(String.valueOf(jobCard.getId()));
if (jobCardCompleteItems == null) {
jobCardCompleteItems = new HashMap<>();
}
//stitching detail
stitchingIn += Optional.of(stitchingOfflineItemDAO.findByJobCardId(jobCard.getId()).size()).orElse(0);
stitchingOut += Optional.ofNullable(stitchingOfflineItemDAO.CalculateTotalQA(jobCard.getId())).orElse(0L);
//finishItems detail
List<FinishedItem> finishedItems = finishedItemDAO.findByJobCardId(jobCard.getId());
finishApprovedItem += finishedItems.stream().filter(e -> e.getQaStatus().equals("APPROVED")).count();
finishRejectItem += finishedItems.stream().filter(e -> e.getQaStatus().equals("REJECT")).count();
//reject store details
storeItems += Optional.ofNullable(storeItemDao.calculateTotalRejectItemByJobCardId(jobCard.getId())).orElse(0L);
//reject packaging details
packagingItems += Optional.of(packagingItemsDAO.findByJobCardId(jobCard.getId()).size()).orElse(0);
}
pOsDetails.setPoId(pos.getId());
pOsDetails.setPoNumber(pos.getPurchaseOrderCode());
pOsDetails.setArticleTitle(pos.getArticleName());
pOsDetails.setPoQuantity(pos.getPurchaseOrderQuantity());
pOsDetails.setPoRequiredQuantity(pos.getPurchaseOrderQuantityRequired());
pOsDetails.setTotalCutting(actualProduction.intValue());
pOsDetails.setTotalStitching(qaProgressItems);
pOsDetails.setTotalEndLineQC(qaProgressItems.intValue());
pOsDetails.setTotalFinishing(totalFinishItem);
pOsDetails.setActualCutting(expectedProduction.longValue());
pOsDetails.setBalanceToCutting(pos.getPurchaseOrderQuantityRequired() - actualProduction.longValue());
pOsDetails.setCuttingReceived(expectedProduction.longValue());
pOsDetails.setCuttingOki(actualProduction.intValue());
pOsDetails.setCuttingReject(expectedProduction.subtract(actualProduction).intValue());
pOsDetails.setStitchingIn(stitchingIn);
pOsDetails.setStitchingOut(stitchingOut);
pOsDetails.setStitchingWips(stitchingIn - stitchingOut);
pOsDetails.setFinishIn(stitchingOut);
pOsDetails.setFinishRej(finishRejectItem);
pOsDetails.setFinishQaApproved(finishApprovedItem);
pOsDetails.setStoreReceived(storeItems);
pOsDetails.setStoreWaiting(finishRejectItem - storeItems);
pOsDetails.setFinishQaApproved(finishApprovedItem);
pOsDetails.setPackagingIn(packagingItems);
pOsDetails.setPackagingOut(packagingItems);
pOsDetails.setPackagingStock(0);
pOsDetails.setShippedScan(packagingItems);
pOsDetails.setShippedNet(packagingItems);
pOsDetails.setPackagingStock(0);
pOsDetails.setPoStatus(false);
pOsDetails.setRemainingCutting(pos.getPurchaseOrderQuantityRequired() - actualProduction.intValue());
pOsDetails.setRemainingStitching(pos.getPurchaseOrderQuantityRequired() - qaProgressItems);
pOsDetails.setRemainingEndLineQC(pos.getPurchaseOrderQuantityRequired() - qaProgressItems);
pOsDetails.setRemainingFinishing(pos.getPurchaseOrderQuantityRequired() - totalFinishItem);
pOsDetails.setTotalAGradeItem(jobCardCompleteItems.getOrDefault("A GRADE", 0));
pOsDetails.setTotalBGradeItem(totalRejectPieces.intValue());
pOsDetailsList.add(pOsDetails);
}
return pOsDetailsList;

View File

@ -10,43 +10,60 @@
<title>Job Card</title>
<link href="https://fonts.googleapis.com/css?family=Open+Sans+Condensed:700|Open+Sans:400,400i&display=swap" rel="stylesheet">
<link rel="stylesheet" type="text/css" th:href="@{|${baseUrl}/css/print.css|}">
<style type="text/css">
@page {
size: landscape;
margin: 10mm;
}
@media print {
body {
transform: rotate(0deg); /* Not needed for @page landscape */
width: 100%;
}
}
.td-value{
text-align: center;
border: 1px solid black;
}
</style>
</head>
<body>
<div class="container-fluid">
<table>
<tr>
<td width="400">
<td width="50%">
<img width="200" th:src="@{|${baseUrl}/img/utopia-industries.png|}" alt="Utopia Industries">
</td>
<td width="400">
<td width="50%">
<table class="bordered">
<tr class="tr-header">
<td colspan="2" th:text="'PO Online Status'"></td>
<td colspan="2" style="text-align: center" th:text="'PO Online Status'"></td>
</tr>
<tbody>
<tr>
<td style="width: 40%; border: 1px solid black;"><i>PO Code</i></td>
<td style="width: 60%; border: 1px solid black;">
<td style="width: 40%;"><i>PO Code</i></td>
<td style="width: 60%;">
<a class="text-reset" target="_blank" th:text="${poDetail.getPoNumber()}"></a>
</td>
</tr>
<tr>
<td style="width: 40%; border: 1px solid black;"><i>Article Name</i></td>
<td style="width: 60%; border: 1px solid black;">
<td style="width: 40%;"><i>Article Name</i></td>
<td style="width: 60%;">
<a class="text-reset" target="_blank" th:text="${poDetail.getArticleTitle()}"></a>
</td>
</tr>
<tr>
<td class="align-middle" style="border: 1px solid black;"><i>PO Quantity</i></td>
<td style="border: 1px solid black;"><span th:text="${poDetail.getPoQuantity()}"></span></td>
<td class="align-middle"><i>PO Quantity</i></td>
<td><span th:text="${poDetail.getPoQuantity()}"></span></td>
</tr>
<tr>
<td class="align-middle" style="border: 1px solid black;"><i>PO Required Excess+</i></td>
<td style="border: 1px solid black;"><span th:text="${poDetail.getPoRequiredQuantity()}"></span></td>
<td class="align-middle"><i>PO Required Excess+</i></td>
<td><span th:text="${poDetail.getPoRequiredQuantity()}"></span></td>
</tr>
<tr>
<td class="align-middle" style="border: 1px solid black;"><i>PO Status</i></td>
<td style="border: 1px solid black;">
<td class="align-middle"><i>PO Status</i></td>
<td>
<span th:if="*{poDetail.isPoStatus}" th:text="'CLOSE'"></span>
<span th:if="*{!poDetail.isPoStatus}" th:text="'OPEN'"></span>
</td>
@ -57,47 +74,77 @@
</tr>
</table>
<table class="bordered" style="width: 100%; margin-top: 10px; border-collapse: collapse; ">
<table style="margin-top: 10px;">
<h5 class="no-margin-top no-margin-bottom" style="margin-top: 10px;">PO Details</h5>
<thead >
<thead>
<tr class="tr-header">
<td>Cutting</td>
<td>Cutting Balance</td>
<td>Stitching</td>
<td>Stitching Balance</td>
<td>End Line QC</td>
<td>End Line QC Balance</td>
<td>Finishing Items</td>
<td>Finishing Items Balance</td>
<td>A Grade Items</td>
<td>Reject Items In Store</td>
<td style="width: 70px; text-align: center"></td>
<td style="width: 60px; text-align: center">Cutting Insp.</td>
<td style="width: 150px; text-align: center">Stitching</td>
<td style="width: 60px; text-align: center">Finished</td>
<td style="width: 90px; text-align: center; padding-left: 40px">Rej. Store</td>
<td style="width: 100px; text-align: center">Packaging</td>
<td style="width: 80px; text-align: center">Shipped</td>
</tr>
</thead>
</table>
<table >
<thead>
<tr class="tr-header">
<td style="width: 50px; text-align: center" >Actual Cut</td>
<td style="width: 50px; text-align: center; border-right: 1px solid white;">Bal.To Cut</td>
<td style="width: 50px; text-align: center;">Rcvd.</td>
<td style="width: 50px; text-align: center">Ok</td>
<td style="width: 50px; text-align: center; border-right: 1px solid white;">Rej.</td>
<td style="width: 50px; text-align: center">In</td>
<td style="width: 50px; text-align: center">WIP</td>
<td style="width: 50px; text-align: center; border-right: 1px solid white;">Out</td>
<td style="width: 50px; text-align: center">In</td>
<td style="width: 50px; text-align: center">Rej</td>
<td style="width: 50px; text-align: center; border-right: 1px solid white;">QA Approv.</td>
<td style="width: 50px; text-align: center">Rcvd.</td>
<td style="width: 50px; text-align: center; border-right: 1px solid white;">waiting</td>
<td style="width: 50px; text-align: center">In</td>
<td style="width: 50px; text-align: center">Out</td>
<td style="width: 50px; text-align: center; border-right: 1px solid white;">Stock</td>
<td style="width: 50px; text-align: center">Scan</td>
<td style="width: 50px; text-align: center; border-right: 1px solid white;">Net</td>
</tr>
</thead>
<tbody>
<tr >
<td style="border: 1px solid black;" th:text="${poDetail.getTotalCutting()}"></td>
<td style="border: 1px solid black;" th:text="${poDetail.getRemainingCutting()}"></td>
<td style="border: 1px solid black;" th:text="${poDetail.getTotalStitching()}"></td>
<td style="border: 1px solid black;" th:text="${poDetail.getRemainingStitching()}"></td>
<td style="border: 1px solid black;" th:text="${poDetail.getTotalEndLineQC()}"></td>
<td style="border: 1px solid black;" th:text="${poDetail.getRemainingEndLineQC()}"></td>
<td style="border: 1px solid black;" th:text="${poDetail.getTotalFinishing()}"></td>
<td style="border: 1px solid black;" th:text="${poDetail.getRemainingFinishing()}"></td>
<td style="border: 1px solid black;" th:text="${poDetail.getTotalAGradeItem()}"></td>
<td style="border: 1px solid black;" th:text="${poDetail.getTotalBGradeItem()}"></td>
<td th:text="${poDetail.getActualCutting()}" class="td-value"></td>
<td th:text="${poDetail.getBalanceToCutting()}" class="td-value"></td>
<td th:text="${poDetail.getCuttingReceived()}" class="td-value"></td>
<td th:text="${poDetail.getCuttingOki()}" class="td-value"></td>
<td th:text="${poDetail.getCuttingReject()}" class="td-value"></td>
<td th:text="${poDetail.getStitchingIn()}" class="td-value"></td>
<td th:text="${poDetail.getStitchingWips()}" class="td-value"></td>
<td th:text="${poDetail.getStitchingOut()}" class="td-value"></td>
<td th:text="${poDetail.getFinishIn()}" class="td-value"></td>
<td th:text="${poDetail.getFinishRej()}" class="td-value"></td>
<td th:text="${poDetail.getFinishQaApproved()}" class="td-value"></td>
<td th:text="${poDetail.getStoreReceived()}" class="td-value"></td>
<td th:text="${poDetail.getStoreWaiting()}" class="td-value"></td>
<td th:text="${poDetail.getPackagingIn()}" class="td-value"></td>
<td th:text="${poDetail.getPackagingOut()}" class="td-value"></td>
<td th:text="${poDetail.getPackagingStock()}" class="td-value"></td>
<td th:text="${poDetail.getShippedScan()}" class="td-value"></td>
<td th:text="${poDetail.getShippedNet()}" class="td-value"></td>
</tr>
</tbody>
</table>
<table class="bordered" style="width: 50%; margin-top: 20px;" th:if="${showStore}">
<tr class="tr-header">
<td colspan="2" th:text="'Reject Items In Store'"></td>
<td colspan="2" style="text-align: center" th:text="'Reject Items In Store'"></td>
</tr>
<tbody>
<tr th:each="heading : ${store.keySet()}"
th:if="${store != null and not store.isEmpty()}">
<td style="width: 40%; border: 1px solid black;"><i th:text="${heading}"></i></td>
<td style="width: 60%; border: 1px solid black;">
<td style="width: 40%;"><i th:text="${heading}"></i></td>
<td style="width: 60%;">
<a class="text-reset" target="_blank" th:text="${store.get(heading)}"></a>
</td>
</tr>

View File

@ -7,25 +7,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/po-report-sidebar :: sidebar"></aside>
<div class="col-lg-10 col-sm-10">
<h3>All PO's </h3>
<table th:if="${ #lists != null && #lists.size(allPOs) != 0 }" class="table table-striped font-sm" data-account-tables data-order="[[ 0, &quot;asc&quot; ]]">
<div class="col-lg-10 col-sm-10" style="overflow-x: auto;">
<h3>All PO's</h3>
<div class="table-responsive"> <!-- Bootstrap responsive table wrapper -->
<table th:if="${ #lists != null && #lists.size(allPOs) != 0 }"
class="table table-striped font-sm" style="min-width: 1500px;">
<thead>
<tr>
<th>PO Number</th>
<th>PO Article</th>
<th>PO Quantity</th>
<th>Req+ Excess</th>
<th>Cutting</th>
<th>Cutting Balance</th>
<th>Stitching</th>
<th>Stitching Balance</th>
<th>End Line QC</th>
<th>End Line QC Balance</th>
<th>Finishing Items</th>
<th>Finishing Items Balance</th>
<th>A Grade Items</th>
<th>Reject Items In Store</th>
<th>Cut.</th>
<th>Cut Bal.</th>
<th>Cut Recv.</th>
<th>Cut oki</th>
<th>Cut Rej.</th>
<th>Stit. In</th>
<th>Stit. Out</th>
<th>Stit. Wips</th>
<th>finish In</th>
<th>finish Rej.</th>
<th>finish QA APP.</th>
<th>Rej. Store Rcvd</th>
<th>Rej. Store Waiting</th>
<th>Packed In</th>
<th>Packed Out</th>
<th>Packed Stock</th>
<th>Shipped Scan</th>
<th>Shipped Net</th>
<th></th>
<th>PO Status</th>
<th>Generate PDF</th>
@ -39,16 +49,25 @@
<td th:text="${poDetail.articleTitle}"></td>
<td th:text="${poDetail.poQuantity}"></td>
<td th:text="${poDetail.poRequiredQuantity}"></td>
<td th:text="${poDetail.totalCutting}"></td>
<td th:text="${poDetail.remainingCutting}"></td>
<td th:text="${poDetail.totalStitching}"></td>
<td th:text="${poDetail.remainingStitching}"></td>
<td th:text="${poDetail.totalEndLineQC}"></td>
<td th:text="${poDetail.remainingEndLineQC}"></td>
<td th:text="${poDetail.totalFinishing}"></td>
<td th:text="${poDetail.remainingFinishing}"></td>
<td th:text="${poDetail.totalAGradeItem}"></td>
<td th:text="${poDetail.totalBGradeItem}"></td>
<td th:text="${poDetail.actualCutting}"></td>
<td th:text="${poDetail.balanceToCutting}"></td>
<td th:text="${poDetail.cuttingReceived}"></td>
<td th:text="${poDetail.cuttingOki}"></td>
<td th:text="${poDetail.cuttingReject}"></td>
<td th:text="${poDetail.stitchingIn}"></td>
<td th:text="${poDetail.stitchingOut}"></td>
<td th:text="${poDetail.stitchingWips}"></td>
<td th:text="${poDetail.finishIn}"></td>
<td th:text="${poDetail.finishRej}"></td>
<td th:text="${poDetail.finishQaApproved}"></td>
<td th:text="${poDetail.storeReceived}"></td>
<td th:text="${poDetail.storeWaiting}"></td>
<td th:text="${poDetail.packagingIn}"></td>
<td th:text="${poDetail.packagingOut}"></td>
<td th:text="${poDetail.packagingStock}"></td>
<td th:text="${poDetail.shippedScan}"></td>
<td th:text="${poDetail.shippedNet}"></td>
<td data-show-dropdown-transactions
th:data-po-id="${poDetail.poId}"
title="Store-Items">
@ -67,18 +86,25 @@
<input type="hidden" name="articleTitle" th:value="${poDetail.articleTitle}"/>
<input type="hidden" name="poQuantity" th:value="${poDetail.poQuantity}"/>
<input type="hidden" name="poRequiredQuantity" th:value="${poDetail.poRequiredQuantity}"/>
<input type="hidden" name="totalCutting" th:value="${poDetail.totalCutting}"/>
<input type="hidden" name="remainingCutting" th:value="${poDetail.remainingCutting}"/>
<input type="hidden" name="totalStitching" th:value="${poDetail.totalStitching}"/>
<input type="hidden" name="remainingStitching" th:value="${poDetail.remainingStitching}"/>
<input type="hidden" name="totalEndLineQC" th:value="${poDetail.totalEndLineQC}"/>
<input type="hidden" name="remainingEndLineQC" th:value="${poDetail.remainingEndLineQC}"/>
<input type="hidden" name="totalFinishing" th:value="${poDetail.totalFinishing}"/>
<input type="hidden" name="remainingFinishing" th:value="${poDetail.remainingFinishing}"/>
<input type="hidden" name="totalAGradeItem" th:value="${poDetail.totalAGradeItem}"/>
<input type="hidden" name="totalBGradeItem" th:value="${poDetail.totalBGradeItem}"/>
<input type="hidden" name="actualCutting" th:value="${poDetail.actualCutting}"/>
<input type="hidden" name="balanceToCutting" th:value="${poDetail.balanceToCutting}"/>
<input type="hidden" name="cuttingReceived" th:value="${poDetail.cuttingReceived}"/>
<input type="hidden" name="cuttingOki" th:value="${poDetail.cuttingOki}"/>
<input type="hidden" name="cuttingReject" th:value="${poDetail.cuttingReject}"/>
<input type="hidden" name="stitchingIn" th:value="${poDetail.stitchingIn}"/>
<input type="hidden" name="stitchingOut" th:value="${poDetail.stitchingOut}"/>
<input type="hidden" name="stitchingWips" th:value="${poDetail.stitchingWips}"/>
<input type="hidden" name="finishIn" th:value="${poDetail.finishIn}"/>
<input type="hidden" name="finishRej" th:value="${poDetail.finishRej}"/>
<input type="hidden" name="finishQaApproved" th:value="${poDetail.finishQaApproved}"/>
<input type="hidden" name="storeReceived" th:value="${poDetail.storeReceived}"/>
<input type="hidden" name="storeWaiting" th:value="${poDetail.storeWaiting}"/>
<input type="hidden" name="packagingIn" th:value="${poDetail.packagingIn}"/>
<input type="hidden" name="packagingOut" th:value="${poDetail.packagingOut}"/>
<input type="hidden" name="packagingStock" th:value="${poDetail.packagingStock}"/>
<input type="hidden" name="shippedScan" th:value="${poDetail.shippedScan}"/>
<input type="hidden" name="shippedNet" th:value="${poDetail.shippedNet}"/>
<input type="hidden" name="poStatus" th:value="${poDetail.poStatus}"/>
<a href="javascript:void(0);"
th:onclick="'showPdfOptions(' + ${poDetail.poId} + ')'"
class="btn btn-sm btn-secondary"
@ -92,6 +118,7 @@
</table>
<h4 th:if="${#lists.size(allPOs) == 0 }">No PO found.</h4>
</div>
</div>
<div class="modal fade" id="pdfOptionsModal" tabindex="-1" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
@ -196,8 +223,22 @@
$row.child(`<span class="spinner-border text-center spinner-border-md" role="status"></span>`).show();
$.ajax({
url: `/ctp/purchase-order/store-items/${poId}`,
success: function (data) {
$row.child(data).show();
success: function(data) {
if (data.includes('page-login') ||
data.includes('login__form') ||
data.includes('Sign in')) {
// Redirect to login page
window.location.href = '/ctp/login?logout';
} else {
$row.child(data).show();
}
},
error: function(xhr) {
if (xhr.status === 401) {
window.location.href = '/ctp/login?logout';
} else {
$row.child('<span class="text-danger">Error loading data</span>').show();
}
}
});
}

View File

@ -20,7 +20,7 @@
</tr>
</tbody>
</table>
<h5 th:if="${#lists.size(storeItems.keySet()) == 0}" class="mt-2">No Inventory Transactions found.</h5>
<h5 th:if="${#lists.size(storeItems.keySet()) == 0}" class="mt-2">No Items found.</h5>
</div>
</div>
</div>