GWM : ordering issue

This commit is contained in:
Smart 2024-10-28 13:56:24 +05:30
parent 7b6d45f25c
commit 302c4fdc61
5 changed files with 18 additions and 31 deletions

View File

@ -2571,6 +2571,8 @@ class Purchaseorder extends BaseController
$fromDate = date('Y-m-d', strtotime($fromDate));
$toDate = date('Y-m-d', strtotime($toDate));
}
// dd($fromDate,$toDate);
$q = "RELEASE";
$this->global['pageTitle'] = 'Purchase Order Release';

View File

@ -1596,8 +1596,6 @@ mstr.CourierNo,pom.Status,pom.POType') //,bill.BillNo,bill.FilePath,
$builder = $this->db->table('t_purchaseorder_master mast')->distinct()
->select('mast.PODate,mast.PONO,mast.TotalOrderValue,st.StatusCode,st.StatusName,emp.FirstName,mast.CreatedDate,ccm.CostCenterName,ccm.CostCenterCode,mast.POType as RType,mast.Remarks,DepartmentName,mast.ApprovedBy,(select EmpID from tbl_users where userId=mast.ApprovedBy )as EID,rmast.ReqType,mast.Status,mast.CapitalRange,
(select FirstName from t_employee_details where EmpID=EID)as Approver,sup.SupplierName,sup.MSME')
// ->orderBy('mast.Status',"PO_CREATED");
->join('t_supplierdetailsn sup', 'sup.SupplierID = mast.SupplierID')
->join('t_status st', 'st.StatusCode=mast.Status')
->join('t_purchaseorder_lineitem req', 'req.PONO= mast.PONO')
@ -1608,30 +1606,12 @@ mstr.CourierNo,pom.Status,pom.POType') //,bill.BillNo,bill.FilePath,
->join('t_employee_details as emp', 'emp.empid=tbl.empid', 'left')
->join('t_departmentdetails as Dep', 'Dep.DEPCode=emp.Departmentcode', 'left');
// old Status Don't Delete it.
// if ($type == 'APPROVAL') {
// $builder->orWhere('mast.Status', PO_DRAFT);
// $builder->orWhere('mast.Status', PO_CREATED);
// $builder->orWhere('mast.Status', PO_APPROVER_ONHOLD);
// $builder->orWhere('mast.Status', PO_AWAITING_RELEASE);
// $builder->orWhere('mast.Status', PO_RELEASED);
// $builder->orWhere('mast.Status', REQITEM_Emergency_PO_CREATED);
// $builder->orderBy('mast.Status');
// }
// else if ($type == 'RELEASE') {
// $builder->orWhere('mast.Status', PO_DRAFT);
// $builder->orWhere('mast.Status', PO_AWAITING_RELEASE);
// $builder->orWhere('mast.Status', PO_RELEASER_ONHOLD);
// $builder->orWhere('mast.Status', PO_RELEASED);
// $builder->orderBy('mast.Status');
// }
$builder->where('mast.CreatedDate >=', $fromDate . '00:00:00');
$builder->where('mast.CreatedDate <=', $toDate .'00:00:00');
$builder->where('DATE(mast.CreatedDate) >=', $fromDate);
$builder->where('DATE(mast.CreatedDate) <=', $toDate);
$builder->orderBy('mast.CreatedDate', 'DESC');
if ($type == 'RELEASE') {
$builder->groupStart();
$builder->orWhere('mast.Status', PO_DRAFT);
$builder->orWhere('mast.Status', PO_CREATED);
$builder->orWhere('mast.Status', PO_APPROVER_ONHOLD);
@ -1639,13 +1619,16 @@ mstr.CourierNo,pom.Status,pom.POType') //,bill.BillNo,bill.FilePath,
$builder->orWhere('mast.Status', PO_RELEASER_ONHOLD);
$builder->orWhere('mast.Status', PO_RELEASED);
$builder->orWhere('mast.Status', REQITEM_Emergency_PO_CREATED);
// $builder->orderBy('mast.Status');
$builder->groupEnd();
}
$result = $builder->get();
// Get the last executed query
// $lastQuery = $this->db->getLastQuery();
// echo $lastQuery;
// die;
return $result->getResult();
}

View File

@ -767,11 +767,13 @@
<div class="dropdown-menu" aria-labelledby="topnav-stock">
<div class="">
<a href="<?php echo base_url(); ?>incomingSilicaSandDetails" class="dropdown-item"><i class="ri-file-info-line align-middle mr-1"></i>incoming silica sand Details</a>
<a href="<?php echo base_url(); ?>drierMachineDetails" class="dropdown-item"><i class="ri-file-info-line align-middle mr-1"></i>10 TON Drier Details</a>
<a href="<?php echo base_url(); ?>coatingMachineDetails" class="dropdown-item"><i class="ri-file-info-line align-middle mr-1"></i>Coating Machine Details</a>
<a href="<?php echo base_url(); ?>incomingSilicaSandDetails" class="dropdown-item"><i class="ri-file-info-line align-middle mr-1"></i>incoming silica sand Details</a>
<a href="<?php echo base_url(); ?>factoryVehicleDieselDetails" class="dropdown-item"><i class="ri-file-info-line align-middle mr-1"></i>Diesel - Factory Vehicle </a>
<a href="<?php echo base_url(); ?>bagStockDetails" class="dropdown-item"><i class="ri-file-info-line align-middle mr-1"></i>Bag Stock Details</a>
</div>

View File

@ -185,7 +185,7 @@ if (empty($Status)) {
<?php if ($record->StatusCode == PO_APPROVER_ONHOLD or $record->StatusCode == PO_CREATED or $record->StatusCode == REQITEM_Emergency_PO_CREATED) { ?>
<select name="selectId" id="selectId" onchange="showvalue('<?php echo $record->PONO ?>','<?php echo $index; ?>',this.options[this.selectedIndex].value,'<?php echo $record->Remarks ?>');">
<select name="selectId" id="selectId" onchange="showvalue('<?php echo $record->PONO ?>','<?php echo $index; ?>',this.options[this.selectedIndex].value,'<?php echo $record->Remarks ?>');" style="width: 193px;">
<option value="-1">Select Action</option>
<!-- <option value="1">Release</option> -->
<option value="1">Approve And Release</option>
@ -471,14 +471,14 @@ if (empty($Status)) {
var table = $('#po_release').DataTable({
dom: 'Blfrtip', // Buttons, length menu, filter, table, information, pagination
buttons: [
'csv', 'excel', 'pdf' // Export buttons
'excel', 'pdf'
],
pageLength: 10, // Default rows per page
lengthMenu: [
[10, 20, 30, 50, -1],
[10, 20, 30, 50, "All"]
], // Rows per page options
responsive: true,
responsive: false,
order: false,
language: {

View File

@ -107,7 +107,7 @@
$cdate = date('d-m-Y', strtotime($record->CreatedDate));
} ?>
<td style="width:8%;"><?php echo $cdate; ?></td>
<td style="width:9%;"><u><a class="a_tag_link" href="<?php echo base_url() . 'viewRawmaterial?RID=' . $record->MaterialCode . '&MType=' . $record->MaterialType . '&UOM=' . $record->UOM . '&date1=' . $date ?>" data-toggle="tooltip" title="<?php echo $record->MaterialCode; ?> - Click here to view Material details"><?php echo $record->MaterialCode ?> </a></u></td>
<td style="width:9%;"><a class="a_tag_link" href="<?php echo base_url() . 'viewRawmaterial?RID=' . $record->MaterialCode . '&MType=' . $record->MaterialType . '&UOM=' . $record->UOM . '&date1=' . $date ?>" data-toggle="tooltip" title="<?php echo $record->MaterialCode; ?> - Click here to view Material details"><?php echo $record->MaterialCode ?> </a></td>
<td style="width:12%;"><?php echo $record->MaterialName ?></td>
<td style="width:10%;"><?php echo $record->MaterialType ?></td>
<td style="width:7%;"><?php echo $record->UOM ?></td>
@ -146,7 +146,7 @@
var table = $('#raw_material_list_table').DataTable({
dom: 'Blfrtip', // Buttons, length menu, filter, table, information, pagination
buttons: [
'csv', 'excel', 'pdf'
'excel', 'pdf'
],
pageLength: 10, // Default rows per page
lengthMenu: [