add date and time in po pdf and remove total stitching #35

Merged
usama.jameel merged 1 commits from add-date-time-po-pdf into main 2025-06-23 10:27:30 +00:00
4 changed files with 12 additions and 17 deletions

View File

@ -13,6 +13,7 @@ import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.ui.Model; import org.springframework.ui.Model;
import java.time.LocalDateTime;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.stream.Collectors; import java.util.stream.Collectors;
@ -46,6 +47,7 @@ public class PurchaseOrderService {
model.addAttribute("poDetail", pOsDetails); model.addAttribute("poDetail", pOsDetails);
model.addAttribute( "baseUrl", URLUtils.getCurrentBaseUrl() ); model.addAttribute( "baseUrl", URLUtils.getCurrentBaseUrl() );
model.addAttribute("date", LocalDateTime.now());
if (includeItemsDetail){ if (includeItemsDetail){
model.addAttribute("showItems", true); model.addAttribute("showItems", true);
model.addAttribute("poItems", reportingService.getPoItemsSizeOrColor(pOsDetails.getPoId(), size, color)); model.addAttribute("poItems", reportingService.getPoItemsSizeOrColor(pOsDetails.getPoId(), size, color));

View File

@ -618,9 +618,6 @@ public class ReportingService {
poItemsWrapper.setTotalCutting( poItemsWrapper.setTotalCutting(
poItemsWrapper.getTotalCutting() + (e.getActualProduction() != null ? e.getActualProduction().intValue() : 0) poItemsWrapper.getTotalCutting() + (e.getActualProduction() != null ? e.getActualProduction().intValue() : 0)
); );
poItemsWrapper.setTotalStitching(
poItemsWrapper.getTotalStitching() + (e.getTotalProduction() != null ? e.getTotalProduction().intValue() : 0)
);
poItemsWrapper.setTotalProduction( poItemsWrapper.setTotalProduction(
poItemsWrapper.getTotalProduction() + (e.getExpectedProduction() != null ? e.getExpectedProduction().intValue() : 0) poItemsWrapper.getTotalProduction() + (e.getExpectedProduction() != null ? e.getExpectedProduction().intValue() : 0)
); );

View File

@ -2,7 +2,7 @@
<!DOCTYPE html <!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" <html xmlns="http://www.w3.org/1999/xhtml" xmlns:ctp="http://www.w3.org/1999/xhtml"
xml:lang="en" xml:lang="en"
lang="en" lang="en"
xmlns:th="http://www.thymeleaf.org"> xmlns:th="http://www.thymeleaf.org">
@ -58,10 +58,6 @@
<td class="align-middle"><i>PO Quantity</i></td> <td class="align-middle"><i>PO Quantity</i></td>
<td><span th:text="${poDetail.getPoQuantity()}"></span></td> <td><span th:text="${poDetail.getPoQuantity()}"></span></td>
</tr> </tr>
<tr>
<td class="align-middle"><i>PO Required Excess+</i></td>
<td><span th:text="${poDetail.getPoRequiredQuantity()}"></span></td>
</tr>
<tr> <tr>
<td class="align-middle"><i>PO Status</i></td> <td class="align-middle"><i>PO Status</i></td>
<td> <td>
@ -76,13 +72,15 @@
</table> </table>
<table style="margin-top: 10px;"> <table style="margin-top: 10px;">
<h5 class="no-margin-top no-margin-bottom" style="margin-top: 10px;">PO Details</h5> <h5 class="no-margin-top no-margin-bottom" style="margin-top: 10px;">PO Details</h5>
<h5 class="no-margin-top no-margin-bottom" style="margin-top: 10px;" ctp:formatdatetime="${date}"></h5>
<thead> <thead>
<tr class="tr-header"> <tr class="tr-header">
<td style="width: 70px; text-align: center"></td> <td style="width: 90px; text-align: center"></td>
<td style="width: 60px; text-align: center">Cutting Insp.</td> <td style="width: 60px; text-align: center">Cutting Insp.</td>
<td style="width: 150px; text-align: center">Stitching</td> <td style="width: 140px; text-align: center">Stitching</td>
<td style="width: 60px; text-align: center">Finished</td> <td style="width: 65px; text-align: center">Finished</td>
<td style="width: 90px; text-align: center; padding-left: 40px">Rej. Store</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: 100px; text-align: center">Packaging</td>
<td style="width: 80px; text-align: center">Shipped</td> <td style="width: 80px; text-align: center">Shipped</td>
@ -93,6 +91,7 @@
<table > <table >
<thead> <thead>
<tr class="tr-header"> <tr class="tr-header">
<td style="width: 50px; text-align: center" >Req.+ Excess</td>
<td style="width: 50px; text-align: center" >Actual Cut</td> <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; 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;">Rcvd.</td>
@ -115,6 +114,7 @@
</thead> </thead>
<tbody> <tbody>
<tr > <tr >
<td th:text="${poDetail.getPoRequiredQuantity()}" class="td-value"></td>
<td th:text="${poDetail.getActualCutting()}" class="td-value"></td> <td th:text="${poDetail.getActualCutting()}" class="td-value"></td>
<td th:text="${poDetail.getBalanceToCutting()}" 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.getCuttingReceived()}" class="td-value"></td>
@ -164,9 +164,8 @@
<td>Sku</td> <td>Sku</td>
<td>Color</td> <td>Color</td>
<td>Size</td> <td>Size</td>
<td>Total</td> <td>Expected Production</td>
<td>Total Cutting</td> <td>Total Cutting</td>
<td>Total Stitching</td>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
@ -176,7 +175,6 @@
<td th:text="*{size}"></td> <td th:text="*{size}"></td>
<td th:text="*{totalProduction}"></td> <td th:text="*{totalProduction}"></td>
<td th:text="*{totalCutting}"></td> <td th:text="*{totalCutting}"></td>
<td th:text="*{totalStitching}"></td>
</tr> </tr>
</tbody> </tbody>
</table> </table>

View File

@ -14,9 +14,8 @@
<th>Sku</th> <th>Sku</th>
<th>Color</th> <th>Color</th>
<th>Size</th> <th>Size</th>
<th>Total</th> <th>Expected Production</th>
<th>Total Cutting</th> <th>Total Cutting</th>
<th>Total Stitching</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
@ -26,7 +25,6 @@
<td th:text="*{size}"></td> <td th:text="*{size}"></td>
<td th:text="*{totalProduction}"></td> <td th:text="*{totalProduction}"></td>
<td th:text="*{totalCutting}"></td> <td th:text="*{totalCutting}"></td>
<td th:text="*{totalStitching}"></td>
</tr> </tr>
</tbody> </tbody>
</table> </table>