fix order table

po-store-category-items
usama.jameel 2025-06-11 11:17:48 +05:00
parent c80cca6811
commit 59a430de50
5 changed files with 8 additions and 7 deletions

View File

@ -23,7 +23,7 @@ public class PurchaseOrderCTPDao {
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 = String.format( "SELECT * FROM %s ", TABLE_NAME );
private final String SELECT_BY_PO_CODE = String.format( "SELECT * FROM %s WHERE purchase_order_code = :purchase_order_code", TABLE_NAME );
private final String DELETE_QUERY = String.format( "DELETE FROM %s WHERE id = :id", TABLE_NAME );
private final String INSERT_QUERY = String.format(

View File

@ -14,6 +14,7 @@ import org.springframework.stereotype.Service;
import org.springframework.ui.Model;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
@Service
@ -39,11 +40,12 @@ public class PurchaseOrderService {
* Print Job card *
* **/
public ResponseEntity<InputStreamResource> generatePOPdf(POsDetails pOsDetails, Model model, boolean jobCardDetail, boolean storeDetail ) throws Exception {
Map<String,Integer> storeItems = purchaseOrderCTPService.getStoreItemsByPoId(pOsDetails.getPoId());
model.addAttribute("poDetail", pOsDetails);
model.addAttribute( "baseUrl", URLUtils.getCurrentBaseUrl() );
if (storeDetail){
if (storeDetail && !storeItems.isEmpty()){
model.addAttribute("showStore", true);
model.addAttribute("store", purchaseOrderCTPService.getStoreItemsByPoId(pOsDetails.getPoId()));
model.addAttribute("store", storeItems);
}else {
model.addAttribute("showStore", false);
}

View File

@ -91,7 +91,7 @@
<table class="bordered" style="width: 50%; margin-top: 20px;" th:if="${showStore}">
<tr class="tr-header">
<td colspan="2" th:text="'Store Items'"></td>
<td colspan="2" th:text="'Reject Items In Store'"></td>
</tr>
<tbody>
<tr th:each="heading : ${store.keySet()}"

View File

@ -9,8 +9,7 @@
<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-order="[[ 0, &quot;asc&quot; ]]">
<table th:if="${ #lists != null && #lists.size(allPOs) != 0 }" class="table table-striped font-sm" data-account-tables data-order="[[ 0, &quot;asc&quot; ]]">
<thead>
<tr>
<th>PO Number</th>

View File

@ -8,7 +8,7 @@
<div class="container">
<div class="row">
<div class="col-sm-8">
<table th:if="${#lists != null && #lists.size(storeItems.keySet()) != 0 }" class="table table-bordered font-sm mb-4" data-account-tables>
<table th:if="${#lists != null && #lists.size(storeItems.keySet()) != 0 }" class="table table-bordered font-sm mb-4" data-account-tables >
<thead>
<tr>
<th th:each="heading : ${storeItems.keySet()}" th:text="${heading}"></th>