add po items size, color wise
parent
7704bbd655
commit
06a5adbf93
|
@ -2,10 +2,7 @@ package com.utopiaindustries.controller;
|
||||||
|
|
||||||
import com.utopiaindustries.auth.PurchaseOrderCTPRole;
|
import com.utopiaindustries.auth.PurchaseOrderCTPRole;
|
||||||
import com.utopiaindustries.model.ctp.POsDetails;
|
import com.utopiaindustries.model.ctp.POsDetails;
|
||||||
import com.utopiaindustries.service.InventoryAccountService;
|
import com.utopiaindustries.service.*;
|
||||||
import com.utopiaindustries.service.PurchaseOrderService;
|
|
||||||
import com.utopiaindustries.service.ReportingService;
|
|
||||||
import com.utopiaindustries.service.SummaryInventoryReportService;
|
|
||||||
import org.springframework.core.io.InputStreamResource;
|
import org.springframework.core.io.InputStreamResource;
|
||||||
import org.springframework.http.MediaType;
|
import org.springframework.http.MediaType;
|
||||||
import org.springframework.http.ResponseEntity;
|
import org.springframework.http.ResponseEntity;
|
||||||
|
@ -20,11 +17,13 @@ public class POStatusController {
|
||||||
|
|
||||||
private final ReportingService reportingService;
|
private final ReportingService reportingService;
|
||||||
private final PurchaseOrderService purchaseOrderService;
|
private final PurchaseOrderService purchaseOrderService;
|
||||||
|
private final JobCardItemService jobCardItemService;
|
||||||
|
|
||||||
|
|
||||||
public POStatusController(ReportingService reportingService, PurchaseOrderService purchaseOrderService) {
|
public POStatusController(ReportingService reportingService, PurchaseOrderService purchaseOrderService, JobCardItemService jobCardItemService) {
|
||||||
this.reportingService = reportingService;
|
this.reportingService = reportingService;
|
||||||
this.purchaseOrderService = purchaseOrderService;
|
this.purchaseOrderService = purchaseOrderService;
|
||||||
|
this.jobCardItemService = jobCardItemService;
|
||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping
|
@GetMapping
|
||||||
|
@ -33,12 +32,31 @@ public class POStatusController {
|
||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping( "/all-pos")
|
@GetMapping( "/all-pos")
|
||||||
public String poReport(@RequestParam(value = "poName", required = false) String poName, Model model){
|
public String poReport(@RequestParam(value = "poName", required = false) String poName,
|
||||||
|
@RequestParam(value = "size", required = false) String size,
|
||||||
|
@RequestParam(value = "color", required = false) String color,
|
||||||
|
Model model){
|
||||||
|
|
||||||
|
model.addAttribute("allSize",jobCardItemService.getAllSizesOFItems());
|
||||||
|
model.addAttribute("allColor",jobCardItemService.getAllColorOFItems());
|
||||||
|
model.addAttribute("allPOs", reportingService.getAllPOs(poName, size, color));
|
||||||
|
model.addAttribute("dw", reportingService.getPoItemsSizeOrColor(4, size, color));
|
||||||
|
|
||||||
model.addAttribute("allPOs", reportingService.getAllPOs(poName));
|
|
||||||
return "/reporting/po-report";
|
return "/reporting/po-report";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@GetMapping( "/po-items")
|
||||||
|
public String poReport(@RequestParam("poId") long poId,
|
||||||
|
@RequestParam(value = "size", required = false) String size,
|
||||||
|
@RequestParam(value = "color", required = false) String color,
|
||||||
|
Model model){
|
||||||
|
|
||||||
|
model.addAttribute("allSize",jobCardItemService.getAllSizesOFItems());
|
||||||
|
model.addAttribute("allColor",jobCardItemService.getAllColorOFItems());
|
||||||
|
model.addAttribute("poJobcardItems", reportingService.getPoItemsSizeOrColor(poId, size, color));
|
||||||
|
return "/reporting/po-jobcard-items-table";
|
||||||
|
}
|
||||||
|
|
||||||
@GetMapping( value = "/po-report-view/{poId}" )
|
@GetMapping( value = "/po-report-view/{poId}" )
|
||||||
public String showJobCardDetail(@PathVariable("poId") long poId, @RequestParam(value = "select-date", required = false) String selectDate ,
|
public String showJobCardDetail(@PathVariable("poId") long poId, @RequestParam(value = "select-date", required = false) String selectDate ,
|
||||||
Model model ){
|
Model model ){
|
||||||
|
@ -46,11 +64,15 @@ public class POStatusController {
|
||||||
return "/reporting/po-job-card-report";
|
return "/reporting/po-job-card-report";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@GetMapping(value = "/generate-po-pdf", produces = MediaType.APPLICATION_PDF_VALUE)
|
@GetMapping(value = "/generate-po-pdf", produces = MediaType.APPLICATION_PDF_VALUE)
|
||||||
public ResponseEntity<InputStreamResource> sendPoAndReturnPdf(@ModelAttribute POsDetails pOsDetails,
|
public ResponseEntity<InputStreamResource> sendPoAndReturnPdf(@ModelAttribute POsDetails pOsDetails,
|
||||||
@RequestParam(required = false, defaultValue = "true") boolean includeJobCard,
|
@RequestParam(required = false, defaultValue = "true") boolean includeItemsDetail,
|
||||||
@RequestParam(required = false, defaultValue = "true") boolean includeStoreDetails,
|
@RequestParam(required = false, defaultValue = "true") boolean includeStoreDetails,
|
||||||
|
@RequestParam String color,
|
||||||
|
@RequestParam String size,
|
||||||
Model model) throws Exception{
|
Model model) throws Exception{
|
||||||
return purchaseOrderService.generatePOPdf(pOsDetails, model, includeJobCard, includeStoreDetails);
|
return purchaseOrderService.generatePOPdf(pOsDetails, model, includeItemsDetail, includeStoreDetails, size, color);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,6 +9,7 @@ import org.springframework.jdbc.support.KeyHolder;
|
||||||
import org.springframework.stereotype.Repository;
|
import org.springframework.stereotype.Repository;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@Repository
|
@Repository
|
||||||
|
@ -26,7 +27,12 @@ public class JobCardItemDAO {
|
||||||
private final String SELECT_BY_IDS = String.format( "SELECT * FROM %s WHERE id IN (:ids)", TABLE_NAME );
|
private final String SELECT_BY_IDS = String.format( "SELECT * FROM %s WHERE id IN (:ids)", TABLE_NAME );
|
||||||
private final String SELECT_BY_JOB_CARD_AND_ACCOUNT_IDS = String.format( "SELECT * FROM %s WHERE job_card_id = :job_card_id AND account_id IN (:account_ids) AND is_complete = FALSE ", TABLE_NAME );
|
private final String SELECT_BY_JOB_CARD_AND_ACCOUNT_IDS = String.format( "SELECT * FROM %s WHERE job_card_id = :job_card_id AND account_id IN (:account_ids) AND is_complete = FALSE ", TABLE_NAME );
|
||||||
private final String SELECT_ALL_ACTIVE_ITEM = String.format("SELECT CASE WHEN MIN(is_complete) = TRUE THEN TRUE ELSE FALSE END FROM %s WHERE job_card_id = :job_card_id AND id IN (:id)", TABLE_NAME);
|
private final String SELECT_ALL_ACTIVE_ITEM = String.format("SELECT CASE WHEN MIN(is_complete) = TRUE THEN TRUE ELSE FALSE END FROM %s WHERE job_card_id = :job_card_id AND id IN (:id)", TABLE_NAME);
|
||||||
private final String SELECT_BY_JOB_CARD_IDS = String.format( "SELECT * FROM %s WHERE job_card_id IN (:job_card_id)", TABLE_NAME );
|
private final String SELECT_BY_JOB_CARD_IDS_AND_COLOR_SIZE = String.format(
|
||||||
|
"SELECT * FROM %s WHERE job_card_id IN (:job_card_id) ",
|
||||||
|
TABLE_NAME
|
||||||
|
);
|
||||||
|
private final String SELECT_ALL_SIZE_GROUP_BY = String.format( "SELECT size FROM %s GROUP BY size", TABLE_NAME );
|
||||||
|
private final String SELECT_ALL_COLOR_GROUP_BY = String.format( "SELECT color FROM %s GROUP BY color", TABLE_NAME );
|
||||||
|
|
||||||
public JobCardItemDAO(NamedParameterJdbcTemplate namedParameterJdbcTemplate) {
|
public JobCardItemDAO(NamedParameterJdbcTemplate namedParameterJdbcTemplate) {
|
||||||
this.namedParameterJdbcTemplate = namedParameterJdbcTemplate;
|
this.namedParameterJdbcTemplate = namedParameterJdbcTemplate;
|
||||||
|
@ -133,9 +139,29 @@ public class JobCardItemDAO {
|
||||||
return Boolean.TRUE.equals(allComplete);
|
return Boolean.TRUE.equals(allComplete);
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<JobCardItem> findByJobCardIds(List<Long> ids){
|
//find By jobCard ids, color and size
|
||||||
|
public List<JobCardItem> findByJobCardIdsAndSizeColor(List<Long> ids, String size, String color){
|
||||||
MapSqlParameterSource params = new MapSqlParameterSource();
|
MapSqlParameterSource params = new MapSqlParameterSource();
|
||||||
params.addValue("job_card_id", ids);
|
params.addValue("job_card_id", ids);
|
||||||
return namedParameterJdbcTemplate.query( SELECT_BY_JOB_CARD_IDS, params, new JobCardItemRowMapper() );
|
StringBuilder sql = new StringBuilder(SELECT_BY_JOB_CARD_IDS_AND_COLOR_SIZE);
|
||||||
|
if (color != null && !color.isEmpty() && !"null".equalsIgnoreCase(color)) {
|
||||||
|
sql.append(" AND color = :color");
|
||||||
|
params.addValue("color", color);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (size != null && !size.isEmpty() && !"null".equalsIgnoreCase(size)) {
|
||||||
|
sql.append(" AND size = :size");
|
||||||
|
params.addValue("size", size);
|
||||||
|
}
|
||||||
|
return namedParameterJdbcTemplate.query( sql.toString(), params, new JobCardItemRowMapper() );
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<String> getAllSize() {
|
||||||
|
return namedParameterJdbcTemplate.queryForList(SELECT_ALL_SIZE_GROUP_BY, new HashMap<>(), String.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<String> getAllColor() {
|
||||||
|
return namedParameterJdbcTemplate.queryForList(SELECT_ALL_COLOR_GROUP_BY, new HashMap<>(), String.class);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
|
@ -0,0 +1,58 @@
|
||||||
|
package com.utopiaindustries.model.ctp;
|
||||||
|
|
||||||
|
public class PoItemsWrapper {
|
||||||
|
private int totalCutting;
|
||||||
|
private int totalStitching;
|
||||||
|
private int totalProduction;
|
||||||
|
private String size;
|
||||||
|
private String color;
|
||||||
|
private String sku;
|
||||||
|
|
||||||
|
public int getTotalCutting() {
|
||||||
|
return totalCutting;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTotalCutting(int totalCutting) {
|
||||||
|
this.totalCutting = totalCutting;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getTotalStitching() {
|
||||||
|
return totalStitching;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTotalStitching(int totalStitching) {
|
||||||
|
this.totalStitching = totalStitching;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getTotalProduction() {
|
||||||
|
return totalProduction;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTotalProduction(int totalProduction) {
|
||||||
|
this.totalProduction = totalProduction;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getSize() {
|
||||||
|
return size;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSize(String size) {
|
||||||
|
this.size = size;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getColor() {
|
||||||
|
return color;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setColor(String color) {
|
||||||
|
this.color = color;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getSku() {
|
||||||
|
return sku;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSku(String sku) {
|
||||||
|
this.sku = sku;
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,23 @@
|
||||||
|
package com.utopiaindustries.service;
|
||||||
|
|
||||||
|
import com.utopiaindustries.dao.ctp.JobCardItemDAO;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Service
|
||||||
|
public class JobCardItemService {
|
||||||
|
|
||||||
|
private final JobCardItemDAO jobCardItemDAO;
|
||||||
|
|
||||||
|
public JobCardItemService(JobCardItemDAO jobCardItemDAO) {
|
||||||
|
this.jobCardItemDAO = jobCardItemDAO;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<String> getAllSizesOFItems() {
|
||||||
|
return jobCardItemDAO.getAllSize();
|
||||||
|
}
|
||||||
|
public List<String> getAllColorOFItems() {
|
||||||
|
return jobCardItemDAO.getAllColor();
|
||||||
|
}
|
||||||
|
}
|
|
@ -23,13 +23,15 @@ public class PurchaseOrderService {
|
||||||
private final PurchaseOrderDAO purchaseOrderDAO;
|
private final PurchaseOrderDAO purchaseOrderDAO;
|
||||||
private final PurchaseOrderCTPService purchaseOrderCTPService;
|
private final PurchaseOrderCTPService purchaseOrderCTPService;
|
||||||
private final HTMLBuilder htmlBuilder;
|
private final HTMLBuilder htmlBuilder;
|
||||||
private PDFResponseEntityInputStreamResource pdfGenerator;
|
private final PDFResponseEntityInputStreamResource pdfGenerator;
|
||||||
|
private final ReportingService reportingService;
|
||||||
|
|
||||||
public PurchaseOrderService(PurchaseOrderDAO purchaseOrderDAO, PurchaseOrderCTPService purchaseOrderCTPService, HTMLBuilder htmlBuilder, PDFResponseEntityInputStreamResource pdfGenerator) {
|
public PurchaseOrderService(PurchaseOrderDAO purchaseOrderDAO, PurchaseOrderCTPService purchaseOrderCTPService, HTMLBuilder htmlBuilder, PDFResponseEntityInputStreamResource pdfGenerator, ReportingService reportingService) {
|
||||||
this.purchaseOrderDAO = purchaseOrderDAO;
|
this.purchaseOrderDAO = purchaseOrderDAO;
|
||||||
this.purchaseOrderCTPService = purchaseOrderCTPService;
|
this.purchaseOrderCTPService = purchaseOrderCTPService;
|
||||||
this.htmlBuilder = htmlBuilder;
|
this.htmlBuilder = htmlBuilder;
|
||||||
this.pdfGenerator = pdfGenerator;
|
this.pdfGenerator = pdfGenerator;
|
||||||
|
this.reportingService = reportingService;
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<PurchaseOrder> findByTerm( String term ){
|
public List<PurchaseOrder> findByTerm( String term ){
|
||||||
|
@ -37,21 +39,28 @@ public class PurchaseOrderService {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Print Job card *
|
* Print po pdf *
|
||||||
* **/
|
* **/
|
||||||
public ResponseEntity<InputStreamResource> generatePOPdf(POsDetails pOsDetails, Model model, boolean jobCardDetail, boolean storeDetail ) throws Exception {
|
public ResponseEntity<InputStreamResource> generatePOPdf(POsDetails pOsDetails, Model model, boolean includeItemsDetail, boolean storeDetail, String size, String color ) throws Exception {
|
||||||
Map<String,Integer> storeItems = purchaseOrderCTPService.getStoreItemsByPoId(pOsDetails.getPoId());
|
Map<String,Integer> storeItems = purchaseOrderCTPService.getStoreItemsByPoId(pOsDetails.getPoId());
|
||||||
model.addAttribute("poDetail", pOsDetails);
|
model.addAttribute("poDetail", pOsDetails);
|
||||||
model.addAttribute( "baseUrl", URLUtils.getCurrentBaseUrl() );
|
model.addAttribute( "baseUrl", URLUtils.getCurrentBaseUrl() );
|
||||||
|
|
||||||
|
if (includeItemsDetail){
|
||||||
|
model.addAttribute("showItems", true);
|
||||||
|
model.addAttribute("poItems", reportingService.getPoItemsSizeOrColor(pOsDetails.getPoId(), size, color));
|
||||||
|
}else {
|
||||||
|
model.addAttribute("showItems", false);
|
||||||
|
}
|
||||||
|
|
||||||
if (storeDetail && !storeItems.isEmpty()){
|
if (storeDetail && !storeItems.isEmpty()){
|
||||||
model.addAttribute("showStore", true);
|
model.addAttribute("showStore", true);
|
||||||
model.addAttribute("store", storeItems);
|
model.addAttribute("store", storeItems);
|
||||||
}else {
|
}else {
|
||||||
model.addAttribute("showStore", false);
|
model.addAttribute("showStore", false);
|
||||||
}
|
}
|
||||||
|
|
||||||
String htmlStr = htmlBuilder.buildHTML( "po-status-pdf", model );
|
String htmlStr = htmlBuilder.buildHTML( "po-status-pdf", model );
|
||||||
// return pdf
|
|
||||||
return pdfGenerator.generatePdf( htmlStr, "Po-status", "inline" );
|
return pdfGenerator.generatePdf( htmlStr, "Po-status", "inline" );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -437,7 +437,7 @@ public class ReportingService {
|
||||||
return barChartData;
|
return barChartData;
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<POsDetails> getAllPOs(String poCode) {
|
public List<POsDetails> getAllPOs(String poCode, String size, String color) {
|
||||||
|
|
||||||
List<POsDetails> pOsDetailsList = new ArrayList<>();
|
List<POsDetails> pOsDetailsList = new ArrayList<>();
|
||||||
List<PurchaseOrderCTP> purchaseOrderCTPList;
|
List<PurchaseOrderCTP> purchaseOrderCTPList;
|
||||||
|
@ -461,34 +461,41 @@ public class ReportingService {
|
||||||
long storeItems = 0L;
|
long storeItems = 0L;
|
||||||
long packagingItems = 0L;
|
long packagingItems = 0L;
|
||||||
POsDetails pOsDetails = new POsDetails();
|
POsDetails pOsDetails = new POsDetails();
|
||||||
for (JobCard jobCard : jobCards) {
|
|
||||||
List<JobCardItem> jobCardItems = jobCardItemDAO.findByCardId(jobCard.getId());
|
List<Long> jobCardIds = jobCards.stream()
|
||||||
|
.map(JobCard::getId)
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
List<JobCardItem> jobCardItems = new ArrayList<>();
|
||||||
|
if (!jobCardIds.isEmpty()) {
|
||||||
|
jobCardItems = jobCardItemDAO.findByJobCardIdsAndSizeColor(jobCardIds,size, color);
|
||||||
|
}else {
|
||||||
|
jobCardItems = new ArrayList<>();
|
||||||
|
}
|
||||||
|
|
||||||
expectedProduction = expectedProduction.add(jobCardItems.stream()
|
expectedProduction = expectedProduction.add(jobCardItems.stream()
|
||||||
.map(item -> Optional.ofNullable(item.getExpectedProduction()).orElse(BigDecimal.ZERO))
|
.map(item -> Optional.ofNullable(item.getExpectedProduction()).orElse(BigDecimal.ZERO))
|
||||||
.reduce(BigDecimal.ZERO, BigDecimal::add));
|
.reduce(BigDecimal.ZERO, BigDecimal::add));
|
||||||
|
|
||||||
totalProduction = totalProduction.add(jobCardItems.stream()
|
|
||||||
.map(item -> Optional.ofNullable(item.getTotalProduction()).orElse(BigDecimal.ZERO))
|
|
||||||
.reduce(BigDecimal.ZERO, BigDecimal::add));
|
|
||||||
|
|
||||||
actualProduction = actualProduction.add(jobCardItems.stream()
|
actualProduction = actualProduction.add(jobCardItems.stream()
|
||||||
.map(item -> Optional.ofNullable(item.getActualProduction()).orElse(BigDecimal.ZERO))
|
.map(item -> Optional.ofNullable(item.getActualProduction()).orElse(BigDecimal.ZERO))
|
||||||
.reduce(BigDecimal.ZERO, BigDecimal::add));
|
.reduce(BigDecimal.ZERO, BigDecimal::add));
|
||||||
|
if(!jobCardItems.isEmpty() || (size == null || color == null)) {
|
||||||
|
for (JobCardItem jobCardItem : jobCardItems) {
|
||||||
|
|
||||||
//stitching detail
|
//stitching detail
|
||||||
stitchingIn += Optional.of(stitchingOfflineItemDAO.findByJobCardId(jobCard.getId()).size()).orElse(0);
|
stitchingIn += Optional.of(stitchingOfflineItemDAO.findByJobCardId(jobCardItem.getJobCardId()).size()).orElse(0);
|
||||||
stitchingOut += Optional.ofNullable(stitchingOfflineItemDAO.CalculateTotalQA(jobCard.getId())).orElse(0L);
|
stitchingOut += Optional.ofNullable(stitchingOfflineItemDAO.CalculateTotalQA(jobCardItem.getJobCardId())).orElse(0L);
|
||||||
|
|
||||||
//finishItems detail
|
//finishItems detail
|
||||||
List<FinishedItem> finishedItems = finishedItemDAO.findByJobCardId(jobCard.getId());
|
List<FinishedItem> finishedItems = finishedItemDAO.findByJobCardId(jobCardItem.getJobCardId());
|
||||||
finishApprovedItem += finishedItems.stream().filter(e -> e.getQaStatus().equals("APPROVED")).count();
|
finishApprovedItem += finishedItems.stream().filter(e -> e.getQaStatus().equals("APPROVED")).count();
|
||||||
finishRejectItem += finishedItems.stream().filter(e -> e.getQaStatus().equals("REJECT")).count();
|
finishRejectItem += finishedItems.stream().filter(e -> e.getQaStatus().equals("REJECT")).count();
|
||||||
|
|
||||||
//reject store details
|
//reject store details
|
||||||
storeItems += Optional.ofNullable(storeItemDao.calculateTotalRejectItemByJobCardId(jobCard.getId())).orElse(0L);
|
storeItems += Optional.ofNullable(storeItemDao.calculateTotalRejectItemByJobCardId(jobCardItem.getJobCardId())).orElse(0L);
|
||||||
|
|
||||||
//reject packaging details
|
//reject packaging details
|
||||||
packagingItems += Optional.of(packagingItemsDAO.findByJobCardId(jobCard.getId()).size()).orElse(0);
|
packagingItems += Optional.of(packagingItemsDAO.findByJobCardId(jobCardItem.getJobCardId()).size()).orElse(0);
|
||||||
|
|
||||||
}
|
}
|
||||||
pOsDetails.setPoId(pos.getId());
|
pOsDetails.setPoId(pos.getId());
|
||||||
|
@ -497,10 +504,10 @@ public class ReportingService {
|
||||||
pOsDetails.setPoQuantity(pos.getPurchaseOrderQuantity());
|
pOsDetails.setPoQuantity(pos.getPurchaseOrderQuantity());
|
||||||
pOsDetails.setPoRequiredQuantity(pos.getPurchaseOrderQuantityRequired());
|
pOsDetails.setPoRequiredQuantity(pos.getPurchaseOrderQuantityRequired());
|
||||||
pOsDetails.setActualCutting(expectedProduction.longValue());
|
pOsDetails.setActualCutting(expectedProduction.longValue());
|
||||||
pOsDetails.setBalanceToCutting(pos.getPurchaseOrderQuantityRequired() - actualProduction.longValue());
|
pOsDetails.setBalanceToCutting(pos.getPurchaseOrderQuantityRequired() - expectedProduction.longValue());
|
||||||
pOsDetails.setCuttingReceived(expectedProduction.longValue());
|
pOsDetails.setCuttingReceived(expectedProduction.longValue());
|
||||||
pOsDetails.setCuttingOki(actualProduction.intValue());
|
pOsDetails.setCuttingOki(expectedProduction.intValue());
|
||||||
pOsDetails.setCuttingReject(expectedProduction.subtract(actualProduction).intValue());
|
pOsDetails.setCuttingReject(expectedProduction.subtract(expectedProduction).intValue());
|
||||||
pOsDetails.setStitchingIn(stitchingIn);
|
pOsDetails.setStitchingIn(stitchingIn);
|
||||||
pOsDetails.setStitchingOut(stitchingOut);
|
pOsDetails.setStitchingOut(stitchingOut);
|
||||||
pOsDetails.setStitchingWips(stitchingIn - stitchingOut);
|
pOsDetails.setStitchingWips(stitchingIn - stitchingOut);
|
||||||
|
@ -519,6 +526,7 @@ public class ReportingService {
|
||||||
pOsDetails.setPoStatus(false);
|
pOsDetails.setPoStatus(false);
|
||||||
pOsDetailsList.add(pOsDetails);
|
pOsDetailsList.add(pOsDetails);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return pOsDetailsList;
|
return pOsDetailsList;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -590,6 +598,39 @@ public class ReportingService {
|
||||||
return poJobCardItemsProgress;
|
return poJobCardItemsProgress;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//get po related items size, poId or color
|
||||||
|
public HashMap<String, PoItemsWrapper> getPoItemsSizeOrColor(long poId, String size, String color) {
|
||||||
|
List<JobCard> jobCards = jobCardDAO.findByPoId(poId);
|
||||||
|
List<Long> jobCardIds = jobCards.stream()
|
||||||
|
.map(JobCard::getId)
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
|
||||||
|
HashMap<String, PoItemsWrapper> poItemsWrapperHashMap = new HashMap<>();
|
||||||
|
|
||||||
|
if(!jobCardIds.isEmpty()){
|
||||||
|
List<JobCardItem> jobCardItems = jobCardItemDAO.findByJobCardIdsAndSizeColor(jobCardIds, size, color);
|
||||||
|
jobCardItems.forEach(e -> {
|
||||||
|
String sku = e.getSku();
|
||||||
|
PoItemsWrapper poItemsWrapper = poItemsWrapperHashMap.getOrDefault(sku, new PoItemsWrapper());
|
||||||
|
poItemsWrapper.setColor(e.getColor());
|
||||||
|
poItemsWrapper.setSize(e.getSize());
|
||||||
|
poItemsWrapper.setSku(e.getSku());
|
||||||
|
poItemsWrapper.setTotalCutting(
|
||||||
|
poItemsWrapper.getTotalCutting() + (e.getActualProduction() != null ? e.getActualProduction().intValue() : 0)
|
||||||
|
);
|
||||||
|
poItemsWrapper.setTotalStitching(
|
||||||
|
poItemsWrapper.getTotalStitching() + (e.getTotalProduction() != null ? e.getTotalProduction().intValue() : 0)
|
||||||
|
);
|
||||||
|
poItemsWrapper.setTotalProduction(
|
||||||
|
poItemsWrapper.getTotalProduction() + (e.getExpectedProduction() != null ? e.getExpectedProduction().intValue() : 0)
|
||||||
|
);
|
||||||
|
|
||||||
|
poItemsWrapperHashMap.put(sku, poItemsWrapper);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
return poItemsWrapperHashMap;
|
||||||
|
}
|
||||||
|
|
||||||
public Map<String, Object> getCuttingTableDetails(String jobCardId, String cuttingTableId, String startDate, String endDate) {
|
public Map<String, Object> getCuttingTableDetails(String jobCardId, String cuttingTableId, String startDate, String endDate) {
|
||||||
Map<String, Object> cuttingDetails = new HashMap<>();
|
Map<String, Object> cuttingDetails = new HashMap<>();
|
||||||
long jobCardIdTemp = 0L;
|
long jobCardIdTemp = 0L;
|
||||||
|
@ -631,7 +672,7 @@ public class ReportingService {
|
||||||
for (Map.Entry<LocalDate, List<Long>> entry : dateWiseJobCardIds.entrySet()) {
|
for (Map.Entry<LocalDate, List<Long>> entry : dateWiseJobCardIds.entrySet()) {
|
||||||
List<Long> jobCardIds = entry.getValue();
|
List<Long> jobCardIds = entry.getValue();
|
||||||
if (!jobCardIds.isEmpty()) {
|
if (!jobCardIds.isEmpty()) {
|
||||||
List<JobCardItem> jobCardItems = jobCardItemDAO.findByJobCardIds(jobCardIds);
|
List<JobCardItem> jobCardItems = jobCardItemDAO.findByJobCardIdsAndSizeColor(jobCardIds, null, null);
|
||||||
int totalProduction = jobCardItems.stream()
|
int totalProduction = jobCardItems.stream()
|
||||||
.filter(item -> item.getActualProduction() != null)
|
.filter(item -> item.getActualProduction() != null)
|
||||||
.mapToInt(item -> item.getActualProduction().intValue())
|
.mapToInt(item -> item.getActualProduction().intValue())
|
||||||
|
|
|
@ -40,10 +40,12 @@
|
||||||
<input type="text" class="form-control" name="lot-number" maxlength="100" th:value="${param['lot-number']}">
|
<input type="text" class="form-control" name="lot-number" maxlength="100" th:value="${param['lot-number']}">
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group" data-vue-app th:with="id=${param['purchase-order-id']},title=${param['purchase-order-id']}">
|
<div class="form-group" data-vue-app th:with="id=${param['purchase-order-id']},title=${param['purchase-order-id']}">
|
||||||
<purchase-order-search th:attr="id=${id},title=${title}"
|
<search-ctp-po
|
||||||
v-bind:id-field-name="'purchase-order-id'"
|
v-bind:id-field-name="'purchase-order-id'"
|
||||||
v-bind:code-field-name="'purchase-order-code'"
|
v-on:select-po="onPoSelect"
|
||||||
></purchase-order-search>
|
v-bind:required="false"
|
||||||
|
v-bind:selected="purchaseOrderCode">
|
||||||
|
</search-ctp-po>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group" data-vue-app th:with="id=${param['site-id']},title=${param['site-title']}">
|
<div class="form-group" data-vue-app th:with="id=${param['site-id']},title=${param['site-title']}">
|
||||||
<location-site-search th:attr="id=${id},title=${title}"
|
<location-site-search th:attr="id=${id},title=${title}"
|
||||||
|
|
|
@ -2,14 +2,15 @@
|
||||||
<!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" xmlns:uind="http://www.w3.org/1999/xhtml"
|
<html xmlns="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">
|
||||||
<head>
|
<head>
|
||||||
<title>Job Card</title>
|
<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|}">
|
<link rel="stylesheet" type="text/css" th:href="@{|${baseUrl}/css/print.css|}">
|
||||||
|
<link href="https://fonts.googleapis.com/css?family=Open+Sans+Condensed:700|Open+Sans:400,400i" rel="stylesheet">
|
||||||
|
|
||||||
<style type="text/css">
|
<style type="text/css">
|
||||||
@page {
|
@page {
|
||||||
size: landscape;
|
size: landscape;
|
||||||
|
@ -136,7 +137,11 @@
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
<table class="bordered" style="width: 50%; margin-top: 20px;" th:if="${showStore}">
|
<table>
|
||||||
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<td style="width: 50%; margin-top: 20px;" th:if="${showStore}">
|
||||||
|
<table class="bordered" style="margin-top: 10px;">
|
||||||
<tr class="tr-header">
|
<tr class="tr-header">
|
||||||
<td colspan="2" style="text-align: center" th:text="'Reject Items In Store'"></td>
|
<td colspan="2" style="text-align: center" th:text="'Reject Items In Store'"></td>
|
||||||
</tr>
|
</tr>
|
||||||
|
@ -150,6 +155,36 @@
|
||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
|
</td>
|
||||||
|
<td style="width: 50%; margin-top: 20px;" th:if="${showItems && poItems.values() != null and not poItems.values().isEmpty() }">
|
||||||
|
<table class="bordered" style="margin-top: 10px;">
|
||||||
|
<thead>
|
||||||
|
<tr class="tr-header">
|
||||||
|
<td>Sku</td>
|
||||||
|
<td>Color</td>
|
||||||
|
<td>Size</td>
|
||||||
|
<td>Total</td>
|
||||||
|
<td>Total Cutting</td>
|
||||||
|
<td>Total Stitching</td>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
<tr th:each="items : ${poItems.values()}" th:object="${items}">
|
||||||
|
<td th:text="*{sku}"></td>
|
||||||
|
<td th:text="*{color}"></td>
|
||||||
|
<td th:text="*{size}"></td>
|
||||||
|
<td th:text="*{totalProduction}"></td>
|
||||||
|
<td th:text="*{totalCutting}"></td>
|
||||||
|
<td th:text="*{totalStitching}"></td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
|
@ -0,0 +1,65 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en" xmlns:th="http://www.w3.org/1999/xhtml">
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<title>Title</title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div class="container">
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-sm-8">
|
||||||
|
<table th:if="${#lists != null && #lists.size(poJobcardItems.keySet()) != 0 }" class="table table-bordered font-sm mb-4" data-dropdown-icon-summary >
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th>Sku</th>
|
||||||
|
<th>Color</th>
|
||||||
|
<th>Size</th>
|
||||||
|
<th>Total</th>
|
||||||
|
<th>Total Cutting</th>
|
||||||
|
<th>Total Stitching</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
<tr th:each="poItems : ${poJobcardItems.values()}" th:object="${poItems}">
|
||||||
|
<td th:text="*{sku}"></td>
|
||||||
|
<td th:text="*{color}"></td>
|
||||||
|
<td th:text="*{size}"></td>
|
||||||
|
<td th:text="*{totalProduction}"></td>
|
||||||
|
<td th:text="*{totalCutting}"></td>
|
||||||
|
<td th:text="*{totalStitching}"></td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
<h5 th:if="${#lists.size(poJobcardItems.keySet()) == 0}" class="mt-2">No Items 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-dropdown-icon-summary]').each(function () {
|
||||||
|
const $table = $(this);
|
||||||
|
|
||||||
|
// Prevent reinitializing if already done
|
||||||
|
if (!$.fn.DataTable.isDataTable($table)) {
|
||||||
|
$table.DataTable({
|
||||||
|
paging: false,
|
||||||
|
searching: false,
|
||||||
|
lengthChange: false,
|
||||||
|
info: false,
|
||||||
|
dom: 't',
|
||||||
|
buttons: [{
|
||||||
|
extend: 'excel',
|
||||||
|
text: '',
|
||||||
|
className: 'bi bi-file-earmark-spreadsheet btn-sm d-none'
|
||||||
|
}]
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
</script>
|
||||||
|
|
||||||
|
</body>
|
||||||
|
</html>
|
|
@ -11,6 +11,28 @@
|
||||||
<label>PO Code</label>
|
<label>PO Code</label>
|
||||||
<input type="text" class="form-control" name="poName" th:value="${param['poName'] ?: poName}">
|
<input type="text" class="form-control" name="poName" th:value="${param['poName'] ?: poName}">
|
||||||
</div>
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label>Size</label>
|
||||||
|
<select class="form-control" name="size">
|
||||||
|
<option value="">Please Select</option>
|
||||||
|
<option th:each="size: ${allSize}"
|
||||||
|
th:value="${size}"
|
||||||
|
th:text="${size}"
|
||||||
|
th:selected="${param['size'] == null ? false : #strings.equals(param['size'], size) }">
|
||||||
|
</option>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label>Color</label>
|
||||||
|
<select class="form-control" name="color">
|
||||||
|
<option value="">Please Select</option>
|
||||||
|
<option th:each="color: ${allColor}"
|
||||||
|
th:value="${color}"
|
||||||
|
th:text="${color}"
|
||||||
|
th:selected="${param['color'] == null ? false : #strings.equals(param['color'], color) }">
|
||||||
|
</option>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
<input type="submit" class="btn btn-secondary btn-block" value="Search">
|
<input type="submit" class="btn btn-secondary btn-block" value="Search">
|
||||||
<a th:href="@{${#strings.replace(#httpServletRequest.requestURI, #request.getContextPath(), '')}}"
|
<a th:href="@{${#strings.replace(#httpServletRequest.requestURI, #request.getContextPath(), '')}}"
|
||||||
class="btn btn-secondary btn-block">Reset</a>
|
class="btn btn-secondary btn-block">Reset</a>
|
||||||
|
|
|
@ -37,6 +37,7 @@
|
||||||
<th>Shipped Scan</th>
|
<th>Shipped Scan</th>
|
||||||
<th>Shipped Net</th>
|
<th>Shipped Net</th>
|
||||||
<th></th>
|
<th></th>
|
||||||
|
<th></th>
|
||||||
<th>PO Status</th>
|
<th>PO Status</th>
|
||||||
<th>Generate PDF</th>
|
<th>Generate PDF</th>
|
||||||
</tr>
|
</tr>
|
||||||
|
@ -73,6 +74,10 @@
|
||||||
title="Store-Items">
|
title="Store-Items">
|
||||||
<span data-dropdown-icon-transactions class="bi bi-caret-right-fill"></span>
|
<span data-dropdown-icon-transactions class="bi bi-caret-right-fill"></span>
|
||||||
</td>
|
</td>
|
||||||
|
<td data-show-dropdown-summary
|
||||||
|
th:data-po-id="${poDetail.poId}" title="Summary">
|
||||||
|
<span data-dropdown-icon-summary class="bi bi-caret-right"></span>
|
||||||
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<span class="badge font-sm badge-danger" th:if="*{poDetail.poStatus}" th:text="'CLOSE'"></span>
|
<span class="badge font-sm badge-danger" th:if="*{poDetail.poStatus}" th:text="'CLOSE'"></span>
|
||||||
<span class="badge font-sm badge-ACTIVE" th:if="*{!poDetail.poStatus}" th:text="'OPEN'"></span>
|
<span class="badge font-sm badge-ACTIVE" th:if="*{!poDetail.poStatus}" th:text="'OPEN'"></span>
|
||||||
|
@ -126,12 +131,12 @@
|
||||||
<h5 class="modal-title">Select PDF Options</h5>
|
<h5 class="modal-title">Select PDF Options</h5>
|
||||||
</div>
|
</div>
|
||||||
<div class="modal-body">
|
<div class="modal-body">
|
||||||
<!-- <div class="form-check">-->
|
<div class="form-check">
|
||||||
<!-- <input class="form-check-input" type="checkbox" id="includeJobCard" name="includeJobCard" value="true" checked>-->
|
<input class="form-check-input" type="checkbox" id="includeItemsDetail" name="includeItemsDetail" value="true" checked>
|
||||||
<!-- <label class="form-check-label" for="includeJobCard">-->
|
<label class="form-check-label" for="includeItemsDetail">
|
||||||
<!-- Include Job Card Details-->
|
Include Items Details
|
||||||
<!-- </label>-->
|
</label>
|
||||||
<!-- </div>-->
|
</div>
|
||||||
<div class="form-check">
|
<div class="form-check">
|
||||||
<input class="form-check-input" type="checkbox" id="includeStoreDetails" name="includeStoreDetails" value="true" checked>
|
<input class="form-check-input" type="checkbox" id="includeStoreDetails" name="includeStoreDetails" value="true" checked>
|
||||||
<label class="form-check-label" for="includeStoreDetails">
|
<label class="form-check-label" for="includeStoreDetails">
|
||||||
|
@ -149,6 +154,14 @@
|
||||||
</div>
|
</div>
|
||||||
<div th:replace="_fragments :: page-footer-scripts"></div>
|
<div th:replace="_fragments :: page-footer-scripts"></div>
|
||||||
<script>
|
<script>
|
||||||
|
|
||||||
|
const params = new URLSearchParams(window.location.search);
|
||||||
|
|
||||||
|
// Extract individual parameters
|
||||||
|
const size = params.get("size");
|
||||||
|
const color = params.get("color");
|
||||||
|
|
||||||
|
|
||||||
// PDF Generation Functions
|
// PDF Generation Functions
|
||||||
let currentPoIdForPdf = null;
|
let currentPoIdForPdf = null;
|
||||||
|
|
||||||
|
@ -165,9 +178,11 @@
|
||||||
// Remove existing options if they exist
|
// Remove existing options if they exist
|
||||||
const existingJobCard = form.querySelector('input[name="includeJobCard"]');
|
const existingJobCard = form.querySelector('input[name="includeJobCard"]');
|
||||||
const existingStoreDetails = form.querySelector('input[name="includeStoreDetails"]');
|
const existingStoreDetails = form.querySelector('input[name="includeStoreDetails"]');
|
||||||
|
const existingItemsDetail = form.querySelector('input[name="includeItemsDetail"]');
|
||||||
|
|
||||||
if (existingJobCard) form.removeChild(existingJobCard);
|
if (existingJobCard) form.removeChild(existingJobCard);
|
||||||
if (existingStoreDetails) form.removeChild(existingStoreDetails);
|
if (existingStoreDetails) form.removeChild(existingStoreDetails);
|
||||||
|
if (existingItemsDetail) form.removeChild(existingItemsDetail);
|
||||||
|
|
||||||
// Add params to show store details in pdf
|
// Add params to show store details in pdf
|
||||||
const includeStoreDetails = document.createElement('input');
|
const includeStoreDetails = document.createElement('input');
|
||||||
|
@ -176,6 +191,27 @@
|
||||||
includeStoreDetails.value = document.getElementById('includeStoreDetails').checked;
|
includeStoreDetails.value = document.getElementById('includeStoreDetails').checked;
|
||||||
form.appendChild(includeStoreDetails);
|
form.appendChild(includeStoreDetails);
|
||||||
|
|
||||||
|
// Add params to show store details in pdf
|
||||||
|
const itemColors = document.createElement('input');
|
||||||
|
itemColors.type = 'hidden';
|
||||||
|
itemColors.name = 'color';
|
||||||
|
itemColors.value = color
|
||||||
|
form.appendChild(itemColors);
|
||||||
|
|
||||||
|
// Add params to show store details in pdf
|
||||||
|
const itemSize = document.createElement('input');
|
||||||
|
itemSize.type = 'hidden';
|
||||||
|
itemSize.name = 'size';
|
||||||
|
itemSize.value = size;
|
||||||
|
form.appendChild(itemSize);
|
||||||
|
|
||||||
|
// Add params to show store details in pdf
|
||||||
|
const includeItemsDetails = document.createElement('input');
|
||||||
|
includeItemsDetails.type = 'hidden';
|
||||||
|
includeItemsDetails.name = 'includeItemsDetail';
|
||||||
|
includeItemsDetails.value = document.getElementById('includeItemsDetail').checked;
|
||||||
|
form.appendChild(includeItemsDetails);
|
||||||
|
|
||||||
form.submit();
|
form.submit();
|
||||||
$('#pdfOptionsModal').modal('hide');
|
$('#pdfOptionsModal').modal('hide');
|
||||||
}
|
}
|
||||||
|
@ -188,7 +224,7 @@
|
||||||
$('table[data-account-table]').each(function () {
|
$('table[data-account-table]').each(function () {
|
||||||
$(this).DataTable({
|
$(this).DataTable({
|
||||||
paging: false,
|
paging: false,
|
||||||
pageLength: 100,
|
pageLength: 10,
|
||||||
searching: false,
|
searching: false,
|
||||||
lengthChange: false,
|
lengthChange: false,
|
||||||
processing: false,
|
processing: false,
|
||||||
|
@ -243,6 +279,32 @@
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
$body.on( 'click', '[data-show-dropdown-summary]', 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 = $tr.find( '[data-dropdown-icon-summary]' );
|
||||||
|
const poId = $this.data('po-id');
|
||||||
|
$spanDropdown.toggleClass( 'bi-caret-right bi-caret-down' );
|
||||||
|
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/po-status/po-items?poId=${poId}&size=${size}&color=${color}`,
|
||||||
|
success: function( data ){
|
||||||
|
// show fetched page
|
||||||
|
$row.child( data ).show();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue