Merge branch 'new_theme' of bitbucket.org:venbainformationtechnology/ria into new_theme
This commit is contained in:
commit
70d0da83e1
@ -438,11 +438,11 @@ $routes->get('getInvoiceAttachment', 'Sales::getInvoiceAttachments');
|
|||||||
$routes->get('getInvoiceAttachments', 'Sales::getInvoiceAttachments');
|
$routes->get('getInvoiceAttachments', 'Sales::getInvoiceAttachments');
|
||||||
$routes->get('deleteAttachment', 'Sales::deleteAttachment');
|
$routes->get('deleteAttachment', 'Sales::deleteAttachment');
|
||||||
$routes->post('saveAttachment', 'Sales::saveAttachment');
|
$routes->post('saveAttachment', 'Sales::saveAttachment');
|
||||||
$routes->get('sales_invoice', 'Sales::sales_invoice');
|
|
||||||
$routes->post('sales_invoice', 'Sales::sales_invoice');
|
|
||||||
$routes->post('download_sales_invoice', 'Sales::download_sales_invoice');
|
$routes->post('download_sales_invoice', 'Sales::download_sales_invoice');
|
||||||
$routes->post('updateInvRecQty', 'Sales::updateInvRecQty');
|
$routes->post('updateInvRecQty', 'Sales::updateInvRecQty');
|
||||||
|
$routes->match(['GET', 'POST'],'sales_invoice', 'Sales::sales_invoice');
|
||||||
$routes->match(['GET', 'POST'], 'sales_report', 'Sales::sales_report');
|
$routes->match(['GET', 'POST'], 'sales_report', 'Sales::sales_report');
|
||||||
|
$routes->match(['GET', 'POST'],'credit_notes', 'Sales::credit_notes');
|
||||||
|
|
||||||
// transporter Routes
|
// transporter Routes
|
||||||
$routes->match(['GET', 'POST'],'transporterListing', 'Supplier::transporterListing');
|
$routes->match(['GET', 'POST'],'transporterListing', 'Supplier::transporterListing');
|
||||||
|
|||||||
@ -6,6 +6,7 @@ use App\Controllers\BaseController;
|
|||||||
|
|
||||||
use App\Models\Ipinvoice_model;
|
use App\Models\Ipinvoice_model;
|
||||||
use App\Models\Ipattachment_model;
|
use App\Models\Ipattachment_model;
|
||||||
|
use App\Models\CreditNoteModel;
|
||||||
require_once 'vendor/autoload.php';
|
require_once 'vendor/autoload.php';
|
||||||
|
|
||||||
use PhpOffice\PhpSpreadsheet\Spreadsheet;
|
use PhpOffice\PhpSpreadsheet\Spreadsheet;
|
||||||
@ -15,6 +16,7 @@ class Sales extends BaseController
|
|||||||
{
|
{
|
||||||
protected $ipinvoice_model;
|
protected $ipinvoice_model;
|
||||||
protected $ipattachment_model;
|
protected $ipattachment_model;
|
||||||
|
protected $CreditNoteModel;
|
||||||
protected $session;
|
protected $session;
|
||||||
|
|
||||||
public function __construct()
|
public function __construct()
|
||||||
@ -22,6 +24,7 @@ class Sales extends BaseController
|
|||||||
parent::__construct();
|
parent::__construct();
|
||||||
$this->ipinvoice_model = new Ipinvoice_model();
|
$this->ipinvoice_model = new Ipinvoice_model();
|
||||||
$this->ipattachment_model = new Ipattachment_model();
|
$this->ipattachment_model = new Ipattachment_model();
|
||||||
|
$this->CreditNoteModel = new CreditNoteModel();
|
||||||
$this->session = session();
|
$this->session = session();
|
||||||
$this->isLoggedIn();
|
$this->isLoggedIn();
|
||||||
}
|
}
|
||||||
@ -119,6 +122,33 @@ class Sales extends BaseController
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// credit_notes List
|
||||||
|
function credit_notes(){
|
||||||
|
$fromDate='';
|
||||||
|
$toDate='';
|
||||||
|
|
||||||
|
if ($this->request->getMethod() === 'GET')
|
||||||
|
{
|
||||||
|
$toDate = date('Y-m-d');
|
||||||
|
$fromDate = date('Y-m-d', strtotime('-90 days', strtotime($toDate)));
|
||||||
|
} elseif ($this->request->getMethod() === 'POST') {
|
||||||
|
$fromDate = $this->request->getPost('fromDate');
|
||||||
|
$toDate = $this->request->getPost('toDate');
|
||||||
|
$fromDate = date('Y-m-d', strtotime($fromDate));
|
||||||
|
$toDate = date('Y-m-d', strtotime($toDate));
|
||||||
|
}
|
||||||
|
|
||||||
|
$this->global['pageTitle'] = 'Credit Notes';
|
||||||
|
$data['credit_notes'] = $this->CreditNoteModel->getAllCreditNotes($fromDate , $toDate);
|
||||||
|
// dd($data);
|
||||||
|
$data['fromDate'] = date('d-m-Y', strtotime($fromDate));
|
||||||
|
$data['toDate'] = date('d-m-Y', strtotime($toDate));
|
||||||
|
|
||||||
|
|
||||||
|
$this->loadViews("credit_notes", $this->global, $data, NULL);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
public function sales_report()
|
public function sales_report()
|
||||||
{
|
{
|
||||||
$headline = '';
|
$headline = '';
|
||||||
|
|||||||
@ -147,24 +147,37 @@ class StockController extends BaseController
|
|||||||
public function loadView_incomingSilicaSandDetails()
|
public function loadView_incomingSilicaSandDetails()
|
||||||
{
|
{
|
||||||
|
|
||||||
|
//one remark is for comments and another remark here is alais status of the sand report , due to client request naming is given wrong ,
|
||||||
|
//hope you bear it..!!
|
||||||
|
//we did ..!!
|
||||||
|
|
||||||
|
|
||||||
|
//getting month in post
|
||||||
if ($this->request->getMethod() === 'POST') {
|
if ($this->request->getMethod() === 'POST') {
|
||||||
|
|
||||||
|
//getting remark value which is used to specify the issd entry is accepted/rejected/conditionally accepted..
|
||||||
$remark = $this->request->getPost('remark');
|
$remark = $this->request->getPost('remark');
|
||||||
|
|
||||||
$month = $this->request->getPost('month');
|
$month = $this->request->getPost('month');
|
||||||
|
|
||||||
|
//formatting the date format of Jan-2025 to 2025-01
|
||||||
$date = DateTime::createFromFormat('M-Y', $month);
|
$date = DateTime::createFromFormat('M-Y', $month);
|
||||||
|
|
||||||
$formattedDate = $date->format('Y-m');
|
$formattedDate = $date->format('Y-m');
|
||||||
|
|
||||||
|
|
||||||
$month = $formattedDate;
|
$month = $formattedDate;
|
||||||
|
|
||||||
|
//setting session for any month change
|
||||||
$session = session ();
|
$session = session ();
|
||||||
|
|
||||||
$session->set('stock_month',$month);
|
$session->set('stock_month',$month);
|
||||||
|
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
|
//if request is in get method getting remark in query params in new_header.php file(navbar)
|
||||||
|
|
||||||
$remark = $this->request->getVar('remark');
|
$remark = $this->request->getVar('remark');
|
||||||
|
|
||||||
$session = session();
|
$session = session();
|
||||||
@ -172,21 +185,25 @@ class StockController extends BaseController
|
|||||||
$month = $session->get('stock_month');
|
$month = $session->get('stock_month');
|
||||||
|
|
||||||
if (empty($month)) {
|
if (empty($month)) {
|
||||||
$month = date('Y-m'); // Default to the current month
|
//if no monthis set in session setting Default to the current month
|
||||||
|
$month = date('Y-m');
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$data['month'] = $month;
|
$data['month'] = $month;
|
||||||
|
|
||||||
|
//set page title
|
||||||
$this->global['pageTitle'] = 'Incoming Silica Sand Details';
|
$this->global['pageTitle'] = 'Incoming Silica Sand Details';
|
||||||
|
|
||||||
$materialCodes = [];
|
$materialCodes = [];
|
||||||
|
|
||||||
|
//getting all silica sand raw materials material code
|
||||||
$silicaSandMaterialCodes = $this->rawmaterialdetails_model->getAllSilicaRawMaterialCode();
|
$silicaSandMaterialCodes = $this->rawmaterialdetails_model->getAllSilicaRawMaterialCode();
|
||||||
|
|
||||||
$materialCodes [] = $silicaSandMaterialCodes;
|
$materialCodes [] = $silicaSandMaterialCodes;
|
||||||
|
|
||||||
|
//getting all waste Core Sand Material Codes
|
||||||
$wasteCoreSandMaterialCodes = $this->rawmaterialdetails_model->getAllWasteCoreSandMaterialCode();
|
$wasteCoreSandMaterialCodes = $this->rawmaterialdetails_model->getAllWasteCoreSandMaterialCode();
|
||||||
|
|
||||||
$materialCodes [] = $wasteCoreSandMaterialCodes;
|
$materialCodes [] = $wasteCoreSandMaterialCodes;
|
||||||
@ -195,6 +212,7 @@ class StockController extends BaseController
|
|||||||
|
|
||||||
|
|
||||||
if (!empty($materialCodes)) {
|
if (!empty($materialCodes)) {
|
||||||
|
//remark filter may apply or not
|
||||||
$data['igrDetails'] = $this->inwardGateRegister_model->findIgrDetailsForIncomingSilicaSand($materialCodes, $month, $remark);
|
$data['igrDetails'] = $this->inwardGateRegister_model->findIgrDetailsForIncomingSilicaSand($materialCodes, $month, $remark);
|
||||||
} else {
|
} else {
|
||||||
$data['igrDetails'] = [];
|
$data['igrDetails'] = [];
|
||||||
@ -202,11 +220,11 @@ class StockController extends BaseController
|
|||||||
|
|
||||||
$data['testedBy'] = [];
|
$data['testedBy'] = [];
|
||||||
|
|
||||||
$DesignationConfigID = 'C010';
|
//['lab assistant', 'factory manager', 'lab head']
|
||||||
|
$data['testedBy'] = $this->employeedetails_model->incomingSilicaSandTestedBy();
|
||||||
|
|
||||||
$data['testedBy'] = $this->employeedetails_model->incomingSilicaSandTestedBy($DesignationConfigID);
|
//['factory manager', 'lab head']
|
||||||
|
$data['approvedBy'] = $this->employeedetails_model->incomingSilicaSandApprovedBy();
|
||||||
$data['approvedBy'] = $this->employeedetails_model->incomingSilicaSandApprovedBy($DesignationConfigID);
|
|
||||||
|
|
||||||
|
|
||||||
$date = DateTime::createFromFormat('Y-m', $month);
|
$date = DateTime::createFromFormat('Y-m', $month);
|
||||||
@ -220,6 +238,7 @@ class StockController extends BaseController
|
|||||||
return $this->loadViews("stock/incomingSilicaSandDetails", $this->global, $data, NULL);
|
return $this->loadViews("stock/incomingSilicaSandDetails", $this->global, $data, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public function updateIncomingSilicaSandDetails()
|
public function updateIncomingSilicaSandDetails()
|
||||||
{
|
{
|
||||||
|
|
||||||
@ -290,6 +309,8 @@ class StockController extends BaseController
|
|||||||
echo "Data Saved Successfully";
|
echo "Data Saved Successfully";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//This is particulary updated by the lab technichians
|
||||||
public function updateLabReport()
|
public function updateLabReport()
|
||||||
{
|
{
|
||||||
|
|
||||||
@ -353,115 +374,143 @@ class StockController extends BaseController
|
|||||||
//Drier machine details
|
//Drier machine details
|
||||||
public function drierMachineDetails()
|
public function drierMachineDetails()
|
||||||
{
|
{
|
||||||
|
// Drier machine details follow a different method of processing stock month and date format than other stock records.
|
||||||
|
// The stock month and date format must be handled carefully while generating and updating data.
|
||||||
|
|
||||||
|
|
||||||
//drier will be processing different method than other stock in case of session stock month and date format for generating
|
|
||||||
//dummy data and updating the data . be cautious while updating the code..!!
|
|
||||||
|
|
||||||
if ($this->request->getMethod() === 'POST') {
|
if ($this->request->getMethod() === 'POST') {
|
||||||
|
|
||||||
|
// Retrieve the month value from the POST request (expected in "M-Y" format, e.g., "Jan-2025")
|
||||||
$currentMonth = $this->request->getPost('month');
|
$currentMonth = $this->request->getPost('month');
|
||||||
|
|
||||||
$date = DateTime::createFromFormat('M-Y', $currentMonth); //in M-Y format
|
// Convert the month format from "M-Y" (Jan-2025) to "Y-m" (2025-01) for database processing
|
||||||
|
$date = DateTime::createFromFormat('M-Y', $currentMonth);
|
||||||
$formattedDate = $date->format('Y-m'); //in Y-m format
|
$formattedDate = $date->format('Y-m');
|
||||||
|
|
||||||
|
|
||||||
$session = session ();
|
$session = session();
|
||||||
|
|
||||||
$session->set('stock_month',$formattedDate);
|
|
||||||
|
|
||||||
|
$session->set('stock_month', $formattedDate);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
$session = session();
|
$session = session();
|
||||||
|
|
||||||
$currentMonth = $session->get('stock_month');
|
$currentMonth = $session->get('stock_month');
|
||||||
|
|
||||||
|
// If no month is set in the session, default to the current month in "M-Y" format
|
||||||
if (empty($currentMonth)) {
|
if (empty($currentMonth)) {
|
||||||
$currentMonth = date('M-Y'); // Default to the current month
|
$currentMonth = date('M-Y');
|
||||||
}else{
|
} else {
|
||||||
$currentMonth = DateTime::createFromFormat('Y-m', $currentMonth); // in Y-m format
|
// Convert the stored "Y-m" format (e.g., 2025-01) back to "M-Y" (e.g., Jan-2025) for display
|
||||||
|
$currentMonth = DateTime::createFromFormat('Y-m', $currentMonth);
|
||||||
$currentMonth = $currentMonth->format('M-Y'); // in M-Y format
|
$currentMonth = $currentMonth->format('M-Y');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Retrieve the list of dates for the selected month in database-compatible format
|
||||||
$monthData = $this->getMonthDatesFromInput($currentMonth);
|
$monthData = $this->getMonthDatesFromInput($currentMonth);
|
||||||
|
|
||||||
$isActiveFilter = 1 ;
|
|
||||||
$data['startDate'] = $monthData[0]['database'];
|
// Set the active filter for suppliers (1 means active suppliers will be fetched)
|
||||||
$data['endDate'] = $monthData[count($monthData) - 1]['database'];
|
$isActiveFilter = 1;
|
||||||
|
|
||||||
|
|
||||||
|
$data['startDate'] = $monthData[0]['database']; // First day of the selected month
|
||||||
|
$data['endDate'] = $monthData[count($monthData) - 1]['database']; // Last day of the selected month
|
||||||
|
|
||||||
|
// Generate available time slots for drier machine processing
|
||||||
$data['timeDropdown'] = $this->generateTimeOptions();
|
$data['timeDropdown'] = $this->generateTimeOptions();
|
||||||
|
|
||||||
|
|
||||||
$data['supplierData'] = $this->supplier_model->supplierlisting($isActiveFilter);
|
$data['supplierData'] = $this->supplier_model->supplierlisting($isActiveFilter);
|
||||||
|
|
||||||
|
// Retrieve drier machine details for the selected date range
|
||||||
$data['drierDetails'] = $this->drierMachineDetails_model
|
$data['drierDetails'] = $this->drierMachineDetails_model
|
||||||
->where('date >=', $data['startDate'])
|
->where('date >=', $data['startDate'])
|
||||||
->where('date <=', $data['endDate'])
|
->where('date <=', $data['endDate'])
|
||||||
->orderBy('date','asc')
|
->orderBy('date', 'asc')
|
||||||
->findAll();
|
->findAll();
|
||||||
|
|
||||||
|
|
||||||
$data['datefordropdown'] = $currentMonth;
|
$data['datefordropdown'] = $currentMonth;
|
||||||
|
|
||||||
|
// Set the page title for display
|
||||||
$this->global['pageTitle'] = 'Drier Details';
|
$this->global['pageTitle'] = 'Drier Details';
|
||||||
|
|
||||||
$this->loadViews("stock/drierMachineDetails", $this->global, $data, NULL);
|
$this->loadViews("stock/drierMachineDetails", $this->global, $data, NULL);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public function addOrEditdrierMachineDetails()
|
public function addOrEditdrierMachineDetails()
|
||||||
{
|
{
|
||||||
|
// Retrieve form data from the POST request
|
||||||
|
|
||||||
$data = $this->request->getPost();
|
$data = $this->request->getPost();
|
||||||
|
|
||||||
|
// Map the received data into a structured format using the helper function `mapDrierEntry`
|
||||||
$drierData[] = $this->mapDrierEntry($data);
|
$drierData[] = $this->mapDrierEntry($data);
|
||||||
|
|
||||||
|
// Begin a database transaction to ensure atomicity
|
||||||
$this->db->transBegin();
|
$this->db->transBegin();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
// Arrays to store data for batch insert and batch update operations
|
||||||
$inserts = [];
|
$inserts = [];
|
||||||
$updates = [];
|
$updates = [];
|
||||||
|
|
||||||
|
|
||||||
foreach ($drierData as $row) {
|
foreach ($drierData as $row) {
|
||||||
|
// Retrieve the ID of the existing entry (if present)
|
||||||
$existingRow = $row['id'];
|
$existingRow = $row['id'];
|
||||||
$data = $row;
|
$data = $row;
|
||||||
|
|
||||||
|
if ($existingRow) {
|
||||||
|
|
||||||
if (($existingRow)) {
|
|
||||||
$existingRow = $this->drierMachineDetails_model->where('id', $row['id'] ?? '')->first();
|
$existingRow = $this->drierMachineDetails_model->where('id', $row['id'] ?? '')->first();
|
||||||
|
|
||||||
|
// Handle gas stock updates for the existing record
|
||||||
$this->handleGasStockUpdate($existingRow, $row);
|
$this->handleGasStockUpdate($existingRow, $row);
|
||||||
|
|
||||||
|
|
||||||
$updates[] = $data;
|
$updates[] = $data;
|
||||||
} else {
|
} else {
|
||||||
|
// If it's a new record, update gas stock consumption before inserting
|
||||||
$this->updateGasStockConsumption($data['date'], $data['total_gas_consumption']);
|
$this->updateGasStockConsumption($data['date'], $data['total_gas_consumption']);
|
||||||
|
|
||||||
|
|
||||||
$inserts[] = $data;
|
$inserts[] = $data;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (!empty($inserts)) {
|
if (!empty($inserts)) {
|
||||||
$this->drierMachineDetails_model->insertBatch($inserts);
|
$this->drierMachineDetails_model->insertBatch($inserts);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (!empty($updates)) {
|
if (!empty($updates)) {
|
||||||
$this->drierMachineDetails_model->updateBatch($updates, 'id');
|
$this->drierMachineDetails_model->updateBatch($updates, 'id');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Check if the transaction encountered any database errors
|
||||||
if ($this->db->transStatus() === false) {
|
if ($this->db->transStatus() === false) {
|
||||||
throw new \Exception('Transaction failed due to database error.');
|
throw new \Exception('Transaction failed due to database error.');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
$this->db->transCommit();
|
$this->db->transCommit();
|
||||||
|
|
||||||
|
|
||||||
return redirect()->to("/drierMachineDetails")->with('success', "Data Saved Successfully");
|
return redirect()->to("/drierMachineDetails")->with('success', "Data Saved Successfully");
|
||||||
|
|
||||||
} catch (\Exception $error) {
|
} catch (\Exception $error) {
|
||||||
|
// Rollback the transaction in case of an error
|
||||||
$this->db->transRollback();
|
$this->db->transRollback();
|
||||||
|
|
||||||
return redirect()->back()->with('error', ' ' . $error->getMessage());
|
return redirect()->back()->with('error', ' ' . $error->getMessage());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Maps input row to expected format.
|
* Maps input row to expected format.
|
||||||
*/
|
*/
|
||||||
@ -491,40 +540,37 @@ class StockController extends BaseController
|
|||||||
//Coating Machine Details starts
|
//Coating Machine Details starts
|
||||||
public function loadView_coatingMachineDetails()
|
public function loadView_coatingMachineDetails()
|
||||||
{
|
{
|
||||||
|
|
||||||
if ($this->request->getMethod() === 'POST') {
|
if ($this->request->getMethod() === 'POST') {
|
||||||
|
// Get the month from the request
|
||||||
$month = $this->request->getPost('month');
|
$month = $this->request->getPost('month');
|
||||||
|
|
||||||
|
// Convert month format from "M-Y" to "Y-m"
|
||||||
$date = DateTime::createFromFormat('M-Y', $month);
|
$date = DateTime::createFromFormat('M-Y', $month);
|
||||||
|
|
||||||
$formattedDate = $date->format('Y-m');
|
$formattedDate = $date->format('Y-m');
|
||||||
|
|
||||||
$month = $formattedDate;
|
$month = $formattedDate;
|
||||||
|
|
||||||
$session = session ();
|
// Store selected month in session
|
||||||
|
$session = session();
|
||||||
$session->set('stock_month',$month);
|
$session->set('stock_month', $month);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
$session = session();
|
$session = session();
|
||||||
|
|
||||||
$month = $session->get('stock_month');
|
$month = $session->get('stock_month');
|
||||||
|
|
||||||
|
// Default to the current month if no month is stored in session
|
||||||
if (empty($month)) {
|
if (empty($month)) {
|
||||||
$month = date('Y-m'); // Default to the current month
|
$month = date('Y-m');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
$data['month'] = $month;
|
||||||
|
$this->global['pageTitle'] = 'Coating Machine Details';
|
||||||
$data['month'] = $month ;
|
|
||||||
|
|
||||||
$this->global['pageTitle'] = 'Coating Machine Details ';
|
|
||||||
|
|
||||||
|
|
||||||
|
// Define start and end date for the selected month
|
||||||
$startDate = "$month-01";
|
$startDate = "$month-01";
|
||||||
$endDate = date("Y-m-t", strtotime($startDate));
|
$endDate = date("Y-m-t", strtotime($startDate));
|
||||||
|
|
||||||
|
// Fetch coating machine details with batch card file details
|
||||||
$data['coatingMachineDetails'] = $this->coatingMachineDetails_model
|
$data['coatingMachineDetails'] = $this->coatingMachineDetails_model
|
||||||
->select('t_coatingmachinedetails.*,
|
->select('t_coatingmachinedetails.*,
|
||||||
JSON_ARRAYAGG(
|
JSON_ARRAYAGG(
|
||||||
@ -542,16 +588,16 @@ class StockController extends BaseController
|
|||||||
->orderBy('t_coatingmachinedetails.date', 'asc')
|
->orderBy('t_coatingmachinedetails.date', 'asc')
|
||||||
->findAll();
|
->findAll();
|
||||||
|
|
||||||
|
// Convert month format from "Y-m" to "M-Y" for display
|
||||||
$date = DateTime::createFromFormat('Y-m', $month);
|
$date = DateTime::createFromFormat('Y-m', $month);
|
||||||
|
|
||||||
$formattedDate = $date->format('M-Y');
|
$formattedDate = $date->format('M-Y');
|
||||||
|
|
||||||
$data['month'] = $formattedDate;
|
$data['month'] = $formattedDate;
|
||||||
|
|
||||||
|
// Load the view with the required data
|
||||||
return $this->loadViews("stock/CoatingMachineDetail", $this->global, $data, NULL);
|
return $this->loadViews("stock/CoatingMachineDetail", $this->global, $data, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public function addNewCoatingMachineDetails()
|
public function addNewCoatingMachineDetails()
|
||||||
{
|
{
|
||||||
$message1 = '';
|
$message1 = '';
|
||||||
@ -559,7 +605,6 @@ class StockController extends BaseController
|
|||||||
$message3 = '';
|
$message3 = '';
|
||||||
|
|
||||||
$postData = $this->request->getPost();
|
$postData = $this->request->getPost();
|
||||||
|
|
||||||
$date = $postData['date'];
|
$date = $postData['date'];
|
||||||
$shift = $postData['shift'];
|
$shift = $postData['shift'];
|
||||||
|
|
||||||
@ -578,11 +623,10 @@ class StockController extends BaseController
|
|||||||
$this->db->transBegin();
|
$this->db->transBegin();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
// Insert into coating machine details table
|
// Insert data into coating machine details table
|
||||||
$insertedId = $this->coatingMachineDetails_model->insert($postData);
|
$insertedId = $this->coatingMachineDetails_model->insert($postData);
|
||||||
|
|
||||||
if ($insertedId !== false && $insertedId > 0) {
|
if ($insertedId !== false && $insertedId > 0) {
|
||||||
|
|
||||||
$message1 = 'Coating Machine details updated successfully';
|
$message1 = 'Coating Machine details updated successfully';
|
||||||
|
|
||||||
// Update gas stock consumption
|
// Update gas stock consumption
|
||||||
@ -591,30 +635,27 @@ class StockController extends BaseController
|
|||||||
$updatedResult = $this->updateGasStockConsumption($dateToBeInserted, $consumption);
|
$updatedResult = $this->updateGasStockConsumption($dateToBeInserted, $consumption);
|
||||||
|
|
||||||
if ($updatedResult === false || $updatedResult <= 0) {
|
if ($updatedResult === false || $updatedResult <= 0) {
|
||||||
// Explicit failure handling for gas stock update
|
|
||||||
throw new \Exception('Failed to update gas stock consumption.');
|
throw new \Exception('Failed to update gas stock consumption.');
|
||||||
}
|
}
|
||||||
|
|
||||||
$message2 = 'And updated gas stock consumption.';
|
$message2 = 'And updated gas stock consumption.';
|
||||||
$message3 = " Warning..!! Kindly Update the next subsequent month Gas Stock If older month Gas Stock Updated..!!";
|
$message3 = " Warning..!! Kindly Update the next subsequent month Gas Stock If older month Gas Stock Updated..!!";
|
||||||
} else {
|
} else {
|
||||||
throw new \Exception('Failed to insert Coating machine details.');
|
throw new \Exception('Failed to insert Coating machine details.');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Handle batch card file uploads
|
||||||
if ($insertedId !== false && $insertedId > 0) {
|
if ($insertedId !== false && $insertedId > 0) {
|
||||||
|
|
||||||
$batchCardFiles = $this->request->getFileMultiple('batchCard');
|
$batchCardFiles = $this->request->getFileMultiple('batchCard');
|
||||||
|
|
||||||
if (!empty($batchCardFiles) && !($batchCardFiles[0]->getError() === UPLOAD_ERR_NO_FILE)) {
|
if (!empty($batchCardFiles) && !($batchCardFiles[0]->getError() === UPLOAD_ERR_NO_FILE)) {
|
||||||
|
|
||||||
|
|
||||||
foreach ($batchCardFiles as $file) {
|
foreach ($batchCardFiles as $file) {
|
||||||
|
|
||||||
if ($file->isValid() && !$file->hasMoved()) {
|
if ($file->isValid() && !$file->hasMoved()) {
|
||||||
$clientGivenName = $file->getClientName(); // User-given filename
|
$clientGivenName = $file->getClientName(); // Original filename
|
||||||
$newName = $file->getRandomName();
|
$newName = $file->getRandomName();
|
||||||
|
|
||||||
if ($file->move(WRITEPATH . 'uploads/batchcard', $newName)) {
|
if ($file->move(WRITEPATH . 'uploads/batchcard', $newName)) {
|
||||||
// Only save to DB if file moved successfully
|
// Insert file details into the database
|
||||||
$db = \Config\Database::connect();
|
$db = \Config\Database::connect();
|
||||||
$builder = $db->table('t_batchcard_files');
|
$builder = $db->table('t_batchcard_files');
|
||||||
|
|
||||||
@ -624,27 +665,20 @@ class StockController extends BaseController
|
|||||||
'coating_id' => $insertedId
|
'coating_id' => $insertedId
|
||||||
];
|
];
|
||||||
|
|
||||||
$result = $builder->insert($data);
|
$builder->insert($data);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if ($this->db->transStatus() === false) {
|
if ($this->db->transStatus() === false) {
|
||||||
throw new \Exception('Transaction failed due to database errors.');
|
throw new \Exception('Transaction failed due to database errors.');
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->db->transCommit();
|
$this->db->transCommit();
|
||||||
|
|
||||||
|
// Redirect with success message
|
||||||
|
|
||||||
// Set flashdata for success message
|
|
||||||
return redirect()->to("/coatingMachineDetails")
|
return redirect()->to("/coatingMachineDetails")
|
||||||
->with('success', $message1 . " " . $message2 . " " . $message3);
|
->with('success', $message1 . " " . $message2 . " " . $message3);
|
||||||
} catch (\Exception $error) {
|
} catch (\Exception $error) {
|
||||||
@ -655,6 +689,7 @@ class StockController extends BaseController
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public function updateCoatingMachineDetails()
|
public function updateCoatingMachineDetails()
|
||||||
{
|
{
|
||||||
|
|
||||||
@ -679,7 +714,7 @@ class StockController extends BaseController
|
|||||||
|
|
||||||
$batchCardFiles = $this->request->getFileMultiple('batchCard');
|
$batchCardFiles = $this->request->getFileMultiple('batchCard');
|
||||||
|
|
||||||
|
if (is_array($batchCardFiles) && !empty($batchCardFiles)) {
|
||||||
// Step 4: Upload new files and insert into DB
|
// Step 4: Upload new files and insert into DB
|
||||||
foreach ($batchCardFiles as $index => $file) {
|
foreach ($batchCardFiles as $index => $file) {
|
||||||
|
|
||||||
@ -707,6 +742,10 @@ class StockController extends BaseController
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
if ($updated !== false && $updated > 0) {
|
if ($updated !== false && $updated > 0) {
|
||||||
$message1 = "successfully updated Coating machineDetail .";
|
$message1 = "successfully updated Coating machineDetail .";
|
||||||
//update Gas stock consumption if update is successfull..!!
|
//update Gas stock consumption if update is successfull..!!
|
||||||
@ -1020,14 +1059,13 @@ class StockController extends BaseController
|
|||||||
|
|
||||||
private function updateGasStockConsumption($date, $consumption)
|
private function updateGasStockConsumption($date, $consumption)
|
||||||
{
|
{
|
||||||
|
// Check if an entry exists for the given date
|
||||||
$resultExists = $this->gasStockDetails_model
|
$resultExists = $this->gasStockDetails_model
|
||||||
->where('date', $date)
|
->where('date', $date)
|
||||||
->first();
|
->first();
|
||||||
|
|
||||||
if ($resultExists) {
|
if ($resultExists) {
|
||||||
|
// Ensure the date is in the correct format
|
||||||
|
|
||||||
if ($date instanceof DateTime) {
|
if ($date instanceof DateTime) {
|
||||||
$date = $date->format('Y-m-d');
|
$date = $date->format('Y-m-d');
|
||||||
} elseif (!strtotime($date)) {
|
} elseif (!strtotime($date)) {
|
||||||
@ -1036,10 +1074,10 @@ class StockController extends BaseController
|
|||||||
$date = date('Y-m-d', strtotime($date));
|
$date = date('Y-m-d', strtotime($date));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Get the last date of the month for the given date
|
||||||
$endDate = date('Y-m-t', strtotime($date));
|
$endDate = date('Y-m-t', strtotime($date));
|
||||||
|
|
||||||
|
// Fetch all stock entries from the given date till the end of the month
|
||||||
//what happens if the updation is on the last day of the month?
|
|
||||||
$resultExists = $this->gasStockDetails_model
|
$resultExists = $this->gasStockDetails_model
|
||||||
->where('date >=', $date)
|
->where('date >=', $date)
|
||||||
->where('date <=', $endDate)
|
->where('date <=', $endDate)
|
||||||
@ -1049,25 +1087,26 @@ class StockController extends BaseController
|
|||||||
$updatedOpeningStock = 0;
|
$updatedOpeningStock = 0;
|
||||||
$updates = [];
|
$updates = [];
|
||||||
|
|
||||||
|
// Update stock values for each day in the month
|
||||||
foreach ($resultExists as $index => $result) {
|
foreach ($resultExists as $index => $result) {
|
||||||
|
|
||||||
if ($index == 0) {
|
if ($index == 0) {
|
||||||
|
// Update the first entry with new consumption
|
||||||
$result['consumption'] = (float)($result['consumption']) + (float)($consumption);
|
$result['consumption'] = (float)($result['consumption']) + (float)($consumption);
|
||||||
$result['total'] = (float)$result['opening'] + (float)$result['purchaseBharath'] + (float)$result['purchaseIndian'];
|
$result['total'] = (float)$result['opening'] + (float)$result['purchaseBharath'] + (float)$result['purchaseIndian'];
|
||||||
$result['balanceStock'] = $result['total'] - $result['consumption'];
|
$result['balanceStock'] = $result['total'] - $result['consumption'];
|
||||||
$updatedOpeningStock = (int)$result['balanceStock'];
|
$updatedOpeningStock = (int)$result['balanceStock'];
|
||||||
} else {
|
} else {
|
||||||
|
// Update subsequent entries based on previous balance
|
||||||
$result['opening'] = (float)$updatedOpeningStock;
|
$result['opening'] = (float)$updatedOpeningStock;
|
||||||
$result['total'] = (float)$result['opening'] + (float)$result['purchaseBharath'] + (float)$result['purchaseIndian'];
|
$result['total'] = (float)$result['opening'] + (float)$result['purchaseBharath'] + (float)$result['purchaseIndian'];
|
||||||
$result['balanceStock'] = (float)$result['total'] - (float)$result['consumption'];
|
$result['balanceStock'] = (float)$result['total'] - (float)$result['consumption'];
|
||||||
$updatedOpeningStock = (int)$result['balanceStock'];
|
$updatedOpeningStock = (int)$result['balanceStock'];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
$updates[] = $result;
|
$updates[] = $result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Perform batch update if there are changes
|
||||||
if (!empty($updates)) {
|
if (!empty($updates)) {
|
||||||
$result = $this->gasStockDetails_model->updateBatch($updates, 'id');
|
$result = $this->gasStockDetails_model->updateBatch($updates, 'id');
|
||||||
return ($result !== false && $result > 0) ? $result : 0;
|
return ($result !== false && $result > 0) ? $result : 0;
|
||||||
@ -1075,30 +1114,25 @@ class StockController extends BaseController
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
// Get the last date of the previous month
|
||||||
|
|
||||||
|
|
||||||
$previousMonthDate = new DateTime($date);
|
$previousMonthDate = new DateTime($date);
|
||||||
$previousMonthDate = $previousMonthDate->modify('first day of this month')
|
$previousMonthDate = $previousMonthDate->modify('first day of this month')
|
||||||
->modify('-1 day')
|
->modify('-1 day')
|
||||||
->format('Y-m-d');
|
->format('Y-m-d');
|
||||||
|
|
||||||
|
// Check if the previous month's last day entry exists
|
||||||
|
|
||||||
$previousMonthResultExists = $this->gasStockDetails_model
|
$previousMonthResultExists = $this->gasStockDetails_model
|
||||||
->where('date', $previousMonthDate)
|
->where('date', $previousMonthDate)
|
||||||
->first();
|
->first();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$opening = 0;
|
$opening = 0;
|
||||||
|
|
||||||
|
// Set opening stock based on previous month's balance stock
|
||||||
if (!empty($previousMonthResultExists) && isset($previousMonthResultExists['balanceStock'])) {
|
if (!empty($previousMonthResultExists) && isset($previousMonthResultExists['balanceStock'])) {
|
||||||
$opening = $previousMonthResultExists['balanceStock'];
|
$opening = $previousMonthResultExists['balanceStock'];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Generate a list of all dates in the current month
|
||||||
|
|
||||||
$startDate = DateTime::createFromFormat('Y-m-d', $date)->modify('first day of this month')->format('Y-m-d');
|
$startDate = DateTime::createFromFormat('Y-m-d', $date)->modify('first day of this month')->format('Y-m-d');
|
||||||
$endDate = DateTime::createFromFormat('Y-m-d', $date)->modify('last day of this month')->format('Y-m-d');
|
$endDate = DateTime::createFromFormat('Y-m-d', $date)->modify('last day of this month')->format('Y-m-d');
|
||||||
|
|
||||||
@ -1115,12 +1149,13 @@ class StockController extends BaseController
|
|||||||
$datesInMonth[] = $day->format('Y-m-d');
|
$datesInMonth[] = $day->format('Y-m-d');
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach ($datesInMonth as $datesInMonthIndex => $dateInMonth) {
|
// Insert stock records for each day in the month
|
||||||
|
foreach ($datesInMonth as $dateInMonth) {
|
||||||
//update previousMonthResultExists
|
|
||||||
$balanceStock = $opening;
|
$balanceStock = $opening;
|
||||||
$consumptionForDate = 0;
|
$consumptionForDate = 0;
|
||||||
|
|
||||||
if ($dateInMonth == $date) {
|
if ($dateInMonth == $date) {
|
||||||
|
// Assign the given consumption for the provided date
|
||||||
$consumptionForDate = $consumption;
|
$consumptionForDate = $consumption;
|
||||||
$balanceStock = $opening - $consumption;
|
$balanceStock = $opening - $consumption;
|
||||||
}
|
}
|
||||||
@ -1128,16 +1163,18 @@ class StockController extends BaseController
|
|||||||
$inserts[] = [
|
$inserts[] = [
|
||||||
'date' => $dateInMonth,
|
'date' => $dateInMonth,
|
||||||
'opening' => $opening,
|
'opening' => $opening,
|
||||||
'purchaseBharath' => Null,
|
'purchaseBharath' => null,
|
||||||
'purchaseIndian' => Null,
|
'purchaseIndian' => null,
|
||||||
'total' => Null,
|
'total' => null,
|
||||||
'consumption' => $consumptionForDate,
|
'consumption' => $consumptionForDate,
|
||||||
'balanceStock' => $balanceStock
|
'balanceStock' => $balanceStock
|
||||||
];
|
];
|
||||||
|
|
||||||
|
// Update opening for the next day
|
||||||
$opening = $balanceStock;
|
$opening = $balanceStock;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Perform batch insert if data is available
|
||||||
if (!empty($inserts)) {
|
if (!empty($inserts)) {
|
||||||
$result = $this->gasStockDetails_model->insertBatch($inserts);
|
$result = $this->gasStockDetails_model->insertBatch($inserts);
|
||||||
return ($result !== false && $result > 0) ? $result : 0;
|
return ($result !== false && $result > 0) ? $result : 0;
|
||||||
@ -1150,6 +1187,7 @@ class StockController extends BaseController
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//diesel stock details
|
//diesel stock details
|
||||||
|
|
||||||
public function dieselMachineStockDetails(){
|
public function dieselMachineStockDetails(){
|
||||||
@ -1293,13 +1331,6 @@ class StockController extends BaseController
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// Get the previous month's last date diesel stock details for next month updation
|
// Get the previous month's last date diesel stock details for next month updation
|
||||||
|
|
||||||
$previousMonth = DateTime::createFromFormat('Y-m', $month)->modify('-1 month')->format('Y-m');
|
$previousMonth = DateTime::createFromFormat('Y-m', $month)->modify('-1 month')->format('Y-m');
|
||||||
@ -1381,45 +1412,6 @@ class StockController extends BaseController
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
//temp_code_s_2025_02
|
|
||||||
|
|
||||||
// getting diesel machines for creating table headers
|
|
||||||
// checking already existing stock if yes then get the diesel machines id from the existing stock
|
|
||||||
// if not get all the diesel machines from the factory Machine master table
|
|
||||||
|
|
||||||
// if (!empty($data['groupedDieselMachineStockDetails'])) {
|
|
||||||
|
|
||||||
// $result = $groupedByDate[$date];
|
|
||||||
|
|
||||||
// $distinctMachineId = [];
|
|
||||||
|
|
||||||
// foreach ($result as $index => $eachResult) {
|
|
||||||
// $distinctMachineId[] = $result[$index]['machine_id'];
|
|
||||||
// }
|
|
||||||
|
|
||||||
// $dieselMachines = $this->factoryMachine_model
|
|
||||||
// ->whereIn('id', $distinctMachineId)
|
|
||||||
// ->orderBy('id', 'asc')
|
|
||||||
// ->get()
|
|
||||||
// ->getResultArray();
|
|
||||||
|
|
||||||
|
|
||||||
// } else {
|
|
||||||
|
|
||||||
// $dieselMachines = $this->factoryMachine_model
|
|
||||||
// ->where('is_active', 1)
|
|
||||||
// ->where('energy_type', 'Diesel')
|
|
||||||
// ->orderBy('id', 'asc')
|
|
||||||
// ->get()
|
|
||||||
// ->getResultArray();
|
|
||||||
|
|
||||||
// }
|
|
||||||
|
|
||||||
//temp_code_e_2025_02
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$dieselMachinesCount = count($dieselMachines);
|
$dieselMachinesCount = count($dieselMachines);
|
||||||
|
|
||||||
@ -1781,35 +1773,6 @@ class StockController extends BaseController
|
|||||||
$data['groupedPowerConsumptionStockDetails'] = array_values($groupedByDate);
|
$data['groupedPowerConsumptionStockDetails'] = array_values($groupedByDate);
|
||||||
|
|
||||||
|
|
||||||
//temp_code_s_2025_02
|
|
||||||
|
|
||||||
// getting electric machines for creating table headers
|
|
||||||
// checking already existing stock if yes then get the electric machines id from the existing stock
|
|
||||||
// if not get all the electric machines from the factory Machine master table
|
|
||||||
|
|
||||||
// if (!empty($data['groupedPowerConsumptionStockDetails'])) {
|
|
||||||
|
|
||||||
// $result = $groupedByDate[$date];
|
|
||||||
|
|
||||||
// $distinctMachineId = [];
|
|
||||||
|
|
||||||
// foreach ($result as $index => $eachResult) {
|
|
||||||
// $distinctMachineId[] = $result[$index]['machine_id'];
|
|
||||||
// }
|
|
||||||
|
|
||||||
// $electricMachines = $this->factoryMachine_model->getSelectedElectricMachines($distinctMachineId);
|
|
||||||
|
|
||||||
|
|
||||||
// } else {
|
|
||||||
|
|
||||||
// $electricMachines = $this->factoryMachine_model->getAllActiveElectricMachines();
|
|
||||||
|
|
||||||
// }
|
|
||||||
|
|
||||||
//temp_code_e_2025_02
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$electricMachinesCount = count($electricMachines);
|
$electricMachinesCount = count($electricMachines);
|
||||||
|
|
||||||
$data['electricMachinesCount'] = $electricMachinesCount;
|
$data['electricMachinesCount'] = $electricMachinesCount;
|
||||||
@ -2242,33 +2205,6 @@ class StockController extends BaseController
|
|||||||
$data['groupedResinStockDetails'] = array_values($groupedByDate);
|
$data['groupedResinStockDetails'] = array_values($groupedByDate);
|
||||||
|
|
||||||
|
|
||||||
//temp_code_s_2025_02
|
|
||||||
|
|
||||||
// getting resin material for creating table headers
|
|
||||||
// checking already existing stock if yes then get the material code from the existing stock
|
|
||||||
// if not get all the material codes currently isActive from the raw material details table
|
|
||||||
|
|
||||||
// if (!empty($data['groupedResinStockDetails'])) {
|
|
||||||
|
|
||||||
// $result = $groupedByDate[$date];
|
|
||||||
|
|
||||||
// $distinctMaterialCodes = [];
|
|
||||||
|
|
||||||
// foreach ($result as $index => $eachResult) {
|
|
||||||
// $distinctMaterialCodes[] = $result[$index]['materialCode'];
|
|
||||||
// }
|
|
||||||
|
|
||||||
// $resinMaterials = $this->rawmaterialdetails_model->getSelectedResinMaterialCode($distinctMaterialCodes);
|
|
||||||
|
|
||||||
// } else {
|
|
||||||
|
|
||||||
// $resinMaterials = $this->rawmaterialdetails_model->getAllResinMaterialCode();
|
|
||||||
|
|
||||||
// }
|
|
||||||
|
|
||||||
//temp_code_e_2025_02
|
|
||||||
|
|
||||||
|
|
||||||
// getting customer for creating table headers
|
// getting customer for creating table headers
|
||||||
// checking already existing stock if yes then get customer from the existing stock
|
// checking already existing stock if yes then get customer from the existing stock
|
||||||
// if not set customer in db , then set '' empty string
|
// if not set customer in db , then set '' empty string
|
||||||
@ -2619,31 +2555,6 @@ class StockController extends BaseController
|
|||||||
$data['groupedBagStockDetails'] = array_values($groupedByDate);
|
$data['groupedBagStockDetails'] = array_values($groupedByDate);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//temp_code_s_2025_02
|
|
||||||
|
|
||||||
// // getting bag material for creating table headers
|
|
||||||
// // checking already existing stock if yes then get the material code from the existing bag
|
|
||||||
// // if not get all the material codes from the raw material details table
|
|
||||||
|
|
||||||
// if (!empty($data['groupedBagStockDetails'])) {
|
|
||||||
// $result = $groupedByDate[$date];
|
|
||||||
|
|
||||||
// $distinctMaterialCodes = [];
|
|
||||||
|
|
||||||
// foreach ($result as $index => $eachResult) {
|
|
||||||
// $distinctMaterialCodes[] = $result[$index]['materialCode'];
|
|
||||||
// }
|
|
||||||
|
|
||||||
// $bagMaterials = $this->rawmaterialdetails_model->getSelectedBagMaterialCode($distinctMaterialCodes);
|
|
||||||
|
|
||||||
// } else {
|
|
||||||
// $bagMaterials = $this->rawmaterialdetails_model->getAllBagMaterialCode();
|
|
||||||
// }
|
|
||||||
|
|
||||||
//temp_code_e_2025_02
|
|
||||||
|
|
||||||
|
|
||||||
// getting customer for creating table headers
|
// getting customer for creating table headers
|
||||||
// checking already existing stock if yes then get customer from the existing stock
|
// checking already existing stock if yes then get customer from the existing stock
|
||||||
// if not set customer as '' empty string
|
// if not set customer as '' empty string
|
||||||
@ -3272,12 +3183,12 @@ class StockController extends BaseController
|
|||||||
*/
|
*/
|
||||||
private function handleGasStockUpdate($existingRow, $newRow)
|
private function handleGasStockUpdate($existingRow, $newRow)
|
||||||
{
|
{
|
||||||
$existingConsumption = $existingRow['total_gas_consumption'];
|
$existingConsumption = $existingRow['total_gas_consumption']; //eg:400
|
||||||
$updatedConsumption = $newRow['total_gas_consumption'];
|
$updatedConsumption = $newRow['total_gas_consumption']; //eg:500
|
||||||
|
|
||||||
if ($existingConsumption != $updatedConsumption) {
|
if ($existingConsumption != $updatedConsumption) {
|
||||||
$changeInConsumption = $updatedConsumption - $existingConsumption;
|
$changeInConsumption = $updatedConsumption - $existingConsumption; // 500-400 = 100
|
||||||
$this->updateGasStockConsumption($existingRow['date'], $changeInConsumption);
|
$this->updateGasStockConsumption($existingRow['date'], $changeInConsumption); // +100 will be the change
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -14,6 +14,7 @@ use App\Models\User_model;
|
|||||||
use App\Models\Ipinvoice_model;
|
use App\Models\Ipinvoice_model;
|
||||||
use App\Models\Ipattachment_model;
|
use App\Models\Ipattachment_model;
|
||||||
use App\Models\Zohobooks_api_model;
|
use App\Models\Zohobooks_api_model;
|
||||||
|
use App\Models\CreditNoteModel;
|
||||||
|
|
||||||
require_once 'vendor/autoload.php';
|
require_once 'vendor/autoload.php';
|
||||||
|
|
||||||
@ -34,6 +35,7 @@ class User extends BaseController
|
|||||||
protected $user_model;
|
protected $user_model;
|
||||||
protected $ipinvoice_model;
|
protected $ipinvoice_model;
|
||||||
protected $ipattachment_model;
|
protected $ipattachment_model;
|
||||||
|
protected $CreditNoteModel;
|
||||||
protected $session;
|
protected $session;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -50,6 +52,7 @@ class User extends BaseController
|
|||||||
$this->user_model = new User_model();
|
$this->user_model = new User_model();
|
||||||
$this->ipinvoice_model = new Ipinvoice_model();
|
$this->ipinvoice_model = new Ipinvoice_model();
|
||||||
$this->ipattachment_model = new Ipattachment_model();
|
$this->ipattachment_model = new Ipattachment_model();
|
||||||
|
$this->CreditNoteModel = new CreditNoteModel();
|
||||||
$this->session = session();
|
$this->session = session();
|
||||||
helper('form'); //$this->load->library('form_validation');
|
helper('form'); //$this->load->library('form_validation');
|
||||||
$this->isLoggedIn();
|
$this->isLoggedIn();
|
||||||
@ -1337,17 +1340,13 @@ class User extends BaseController
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
function zohobooks_api_fetch_all()
|
function zohobooks_api_fetch_all()
|
||||||
{
|
{
|
||||||
// print_r($_GET);
|
|
||||||
// echo isset($_GET['from']) ? $_GET['from'] : 'n';
|
|
||||||
// echo isset($_GET['to']) ? $_GET['to'] : 'n';
|
|
||||||
// die();
|
|
||||||
try {
|
try {
|
||||||
// if (isset($_POST['sync']) || $_GET['from'] != null && $_GET['to'] != null)
|
|
||||||
// {
|
|
||||||
// $ch=curl_init();
|
|
||||||
//$this->load->helper('zohobooks_fetch_api_helper');
|
|
||||||
helper('zohobook');
|
helper('zohobook');
|
||||||
$Zohobook_model = model('Zohobook_api_model');
|
$Zohobook_model = model('Zohobook_api_model');
|
||||||
if (isset($_GET['from']) && $_GET['from'] != null && isset($_GET['to']) && $_GET['to'] != null) {
|
if (isset($_GET['from']) && $_GET['from'] != null && isset($_GET['to']) && $_GET['to'] != null) {
|
||||||
@ -1357,15 +1356,13 @@ class User extends BaseController
|
|||||||
$date_today = date('Y-m-d');
|
$date_today = date('Y-m-d');
|
||||||
$date_yesterday = date('Y-m-d', strtotime('-3 day', strtotime($date_today)));
|
$date_yesterday = date('Y-m-d', strtotime('-3 day', strtotime($date_today)));
|
||||||
}
|
}
|
||||||
// echo $date_today.'--'.$date_yesterday;die;
|
|
||||||
$chk_acc_token_val = $Zohobook_model->get_data('zohobook_accesstoken', 'id', 1);
|
$chk_acc_token_val = $Zohobook_model->get_data('zohobook_accesstoken', 'id', 1);
|
||||||
// print_r($chk_acc_token_val);//die();
|
|
||||||
$date = new \DateTime($chk_acc_token_val[0]['created_at']);
|
$date = new \DateTime($chk_acc_token_val[0]['created_at']);
|
||||||
//print_r($date);
|
|
||||||
$date->add(new \DateInterval('PT1H'));
|
$date->add(new \DateInterval('PT1H'));
|
||||||
//print_r($date);
|
|
||||||
//echo '****************';
|
|
||||||
//print_r(date('Y-m-d h:i:s'));
|
|
||||||
$token = 0;
|
$token = 0;
|
||||||
if ($date->format('Y-m-d H:i:s') > date('Y-m-d H:i:s')) {
|
if ($date->format('Y-m-d H:i:s') > date('Y-m-d H:i:s')) {
|
||||||
$token = $chk_acc_token_val[0]['token'];
|
$token = $chk_acc_token_val[0]['token'];
|
||||||
@ -1377,17 +1374,23 @@ class User extends BaseController
|
|||||||
// $token = generateNewToken(); $tokendata['token'] = $token;
|
// $token = generateNewToken(); $tokendata['token'] = $token;
|
||||||
//$Zohobook_model->update($tokendata , 1,'zohobook_accesstoken');
|
//$Zohobook_model->update($tokendata , 1,'zohobook_accesstoken');
|
||||||
$result = getheringInvoiceDetails($date_today, $date_yesterday, $token);
|
$result = getheringInvoiceDetails($date_today, $date_yesterday, $token);
|
||||||
|
|
||||||
$headers_new = $result['headers_new'];
|
$headers_new = $result['headers_new'];
|
||||||
$res = json_decode($result['data'], true);
|
$res = json_decode($result['data'], true);
|
||||||
$inv_array = $res['invoices'];
|
$inv_array = $res['invoices'];
|
||||||
|
|
||||||
// $cteditNotes = getAllCreditNotes($date_today, $date_yesterday, $token);
|
|
||||||
// dd($cteditNotes);
|
|
||||||
|
|
||||||
// dd($inv_array);
|
$tokenWithCreditNoteScope = generateNewTokenForCreditNoteScope();
|
||||||
// print_r($inv_array);
|
$cteditNotesRes = getAllCreditNotes($date_today, $date_yesterday, $tokenWithCreditNoteScope);
|
||||||
// echo "rrrr";
|
$cteditNotesData = json_decode($cteditNotesRes['data'],true);
|
||||||
// die();
|
|
||||||
|
if(count($cteditNotesData['creditnotes']))
|
||||||
|
{
|
||||||
|
$this->saveOrUpdateCreditNote($cteditNotesData['creditnotes']);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
foreach ($inv_array as $inv) {
|
foreach ($inv_array as $inv) {
|
||||||
$invoice_id = $inv['invoice_id'];
|
$invoice_id = $inv['invoice_id'];
|
||||||
//filter only einvoice status pushed invoices only
|
//filter only einvoice status pushed invoices only
|
||||||
@ -1711,6 +1714,27 @@ class User extends BaseController
|
|||||||
}
|
}
|
||||||
// END zoho API
|
// END zoho API
|
||||||
|
|
||||||
|
public function saveOrUpdateCreditNote($data)
|
||||||
|
{
|
||||||
|
|
||||||
|
foreach ($data as $key => $value) {
|
||||||
|
|
||||||
|
$existingCreditNote = $this->CreditNoteModel->where('creditnote_id', $value['creditnote_id'])->first();
|
||||||
|
|
||||||
|
if ($existingCreditNote) {
|
||||||
|
// Update existing record
|
||||||
|
$this->CreditNoteModel->update($value['creditnote_id'], $value);
|
||||||
|
|
||||||
|
} else {
|
||||||
|
// Insert new record
|
||||||
|
$this->CreditNoteModel->insert($value);
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
function fetchEmployeeDetails()
|
function fetchEmployeeDetails()
|
||||||
{
|
{
|
||||||
$EmpID = $this->request->getPost('EmpID');
|
$EmpID = $this->request->getPost('EmpID');
|
||||||
|
|||||||
@ -110,69 +110,58 @@ if (! function_exists('test_helper')) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if (! function_exists('generateNewTokenForCreditNoteScope')) {
|
||||||
|
function generateNewTokenForCreditNoteScope()
|
||||||
|
{
|
||||||
|
// Initialize cURL
|
||||||
|
$ch = curl_init();
|
||||||
|
|
||||||
|
// Zoho API credentials
|
||||||
|
$organization_id = '776847408';
|
||||||
|
$client_id = '1000.0WMDLCXAZV5DR60IKE9P49YTYGVL6C';
|
||||||
|
$refresh_token = '1000.461f55fee6248d21aafe4c10b05c37dc.9fc8b11993aba1ca95e539740f3d411f';
|
||||||
|
$client_secret = '99da3a05cfa13cf91eb6476a3c44cfa3e21b6106a8';
|
||||||
|
$redirect_uri = 'https://resicoindustries.com/RIA';
|
||||||
|
|
||||||
|
|
||||||
|
// Construct URL to get the authentication token
|
||||||
|
$url_getauthtoken = 'https://accounts.zoho.com/oauth/v2/token?refresh_token='.$refresh_token.'&client_id='.$client_id.'&client_secret='.$client_secret.'&redirect_uri='.$redirect_uri.'&grant_type=refresh_token';
|
||||||
|
|
||||||
|
// Set cURL options
|
||||||
|
curl_setopt($ch, CURLOPT_URL, $url_getauthtoken);
|
||||||
|
curl_setopt($ch, CURLOPT_HEADER, 0);
|
||||||
|
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
|
||||||
|
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
|
||||||
|
|
||||||
|
// Execute cURL request
|
||||||
|
$res_token = curl_exec($ch);
|
||||||
|
|
||||||
|
// Decode the response
|
||||||
|
$ress = json_decode($res_token);
|
||||||
|
|
||||||
|
// Return access token
|
||||||
|
return $ress->access_token;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (! function_exists('getAllCreditNotes')) {
|
if (! function_exists('getAllCreditNotes')) {
|
||||||
// function getAllCreditNotes($date_today, $date_yesterday, $accesstoken)
|
|
||||||
// {
|
|
||||||
// // Initialize cURL
|
|
||||||
// $ch = curl_init();
|
|
||||||
|
|
||||||
// // Zoho API credentials
|
|
||||||
// $organization_id = '776847408';
|
|
||||||
// // $url_org = "https://books.zoho.com/api/v3/creditnotes?";
|
|
||||||
// $url_org = "https://www.zohoapis.com/books/v3/creditnotes?";
|
|
||||||
|
|
||||||
// // Construct query parameters
|
|
||||||
// $fields = array(
|
|
||||||
// "usestate" => "true",
|
|
||||||
// "organization_id" => $organization_id,
|
|
||||||
// "date_start" => $date_yesterday,
|
|
||||||
// "date_end" => $date_today
|
|
||||||
// );
|
|
||||||
// $data_all = http_build_query($fields);
|
|
||||||
|
|
||||||
// // Set headers
|
|
||||||
// $headers = array(
|
|
||||||
// 'Authorization: Zoho-oauthtoken '.$accesstoken,
|
|
||||||
// 'Content-Type: application/json'
|
|
||||||
// );
|
|
||||||
|
|
||||||
// // Construct URL
|
|
||||||
// $data_access = $url_org.$data_all;
|
|
||||||
|
|
||||||
// // Set cURL options
|
|
||||||
// curl_setopt($ch, CURLOPT_URL, $data_access);
|
|
||||||
// curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
|
|
||||||
|
|
||||||
// curl_setopt($ch, CURLOPT_HEADER, 0);
|
|
||||||
// curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "GET");
|
|
||||||
// curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
|
|
||||||
|
|
||||||
// // Execute cURL request
|
|
||||||
// $result = curl_exec($ch);
|
|
||||||
|
|
||||||
// // Store headers and data
|
|
||||||
// $data['headers_new'] = $headers;
|
|
||||||
// $data['data'] = curl_exec($ch);
|
|
||||||
// // Return data
|
|
||||||
// return $data;
|
|
||||||
// }
|
|
||||||
|
|
||||||
function getAllCreditNotes($date_today, $date_yesterday, $accesstoken)
|
function getAllCreditNotes($date_today, $date_yesterday, $accesstoken)
|
||||||
{
|
{
|
||||||
// Initialize cURL
|
// Initialize cURL
|
||||||
$ch = curl_init();
|
$ch = curl_init();
|
||||||
var_dump($accesstoken);
|
|
||||||
// Zoho API credentials
|
// Zoho API credentials
|
||||||
$organization_id = '776847408';
|
$organization_id = '776847408';
|
||||||
$url_org = "https://books.zoho.com/api/v3/creditnotes?";
|
$url_org = "https://www.zohoapis.com/books/v3/creditnotes?";
|
||||||
|
|
||||||
// Construct query parameters manually (Zoho might need raw values)
|
// Construct query parameters manually (Zoho might need raw values)
|
||||||
$query_string = "usestate=true&organization_id=$organization_id&date_start=$date_yesterday&date_end=$date_today";
|
$query_string = "organization_id=$organization_id&date_start=$date_yesterday&date_end=$date_today";
|
||||||
|
|
||||||
// Set headers
|
// Set headers
|
||||||
$headers = array(
|
$headers = array(
|
||||||
'Authorization: Zoho-oauthtoken ' . $accesstoken,
|
'Authorization: Zoho-oauthtoken ' . $accesstoken,
|
||||||
'Content-Type: application/json'
|
// 'Content-Type: application/json'
|
||||||
);
|
);
|
||||||
|
|
||||||
// Set cURL options
|
// Set cURL options
|
||||||
|
|||||||
89
app/Models/CreditNoteModel.php
Normal file
89
app/Models/CreditNoteModel.php
Normal file
@ -0,0 +1,89 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Models;
|
||||||
|
|
||||||
|
use CodeIgniter\Model;
|
||||||
|
|
||||||
|
class CreditNoteModel extends Model
|
||||||
|
{
|
||||||
|
protected $table = 'ip_credit_notes';
|
||||||
|
protected $primaryKey = 'creditnote_id';
|
||||||
|
protected $useAutoIncrement = false; // Since creditnote_id is BIGINT and not auto-incremented
|
||||||
|
|
||||||
|
protected $allowedFields = [
|
||||||
|
'creditnote_id',
|
||||||
|
'creditnote_number',
|
||||||
|
'status',
|
||||||
|
'reference_number',
|
||||||
|
'date',
|
||||||
|
'total',
|
||||||
|
'balance',
|
||||||
|
'customer_id',
|
||||||
|
'customer_name',
|
||||||
|
'applied_invoices',
|
||||||
|
'is_digitally_signed',
|
||||||
|
'is_edited_after_sign',
|
||||||
|
'is_emailed',
|
||||||
|
'is_signature_enabled_in_template',
|
||||||
|
'has_attachment',
|
||||||
|
'salesperson_name',
|
||||||
|
'salesperson_id',
|
||||||
|
'is_viewed_by_client',
|
||||||
|
'client_viewed_time',
|
||||||
|
'color_code',
|
||||||
|
'current_sub_status_id',
|
||||||
|
'current_sub_status',
|
||||||
|
'item_quantity',
|
||||||
|
'item_price',
|
||||||
|
'item_total_price',
|
||||||
|
'item_total',
|
||||||
|
'item_total_without_tax',
|
||||||
|
'currency_id',
|
||||||
|
'currency_code'
|
||||||
|
];
|
||||||
|
|
||||||
|
protected $useTimestamps = false; // Enable if you have created_at/updated_at fields
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Fetch all credit notes
|
||||||
|
*/
|
||||||
|
public function getAllCreditNotes($fromDate,$toDate)
|
||||||
|
{
|
||||||
|
return $this->where('date >=', $fromDate )
|
||||||
|
->where('date <=', $toDate )
|
||||||
|
->orderBy('date', 'DESC')
|
||||||
|
->findAll();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Fetch a single credit note by ID
|
||||||
|
*/
|
||||||
|
public function getCreditNoteById($id)
|
||||||
|
{
|
||||||
|
return $this->where('creditnote_id', $id)->first();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Insert a new credit note
|
||||||
|
*/
|
||||||
|
public function createCreditNote($data)
|
||||||
|
{
|
||||||
|
return $this->insert($data);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Update an existing credit note
|
||||||
|
*/
|
||||||
|
public function updateCreditNote($id, $data)
|
||||||
|
{
|
||||||
|
return $this->update($id, $data);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Delete a credit note by ID
|
||||||
|
*/
|
||||||
|
public function deleteCreditNote($id)
|
||||||
|
{
|
||||||
|
return $this->delete($id);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -6,7 +6,7 @@ use CodeIgniter\Model;
|
|||||||
|
|
||||||
class DrierMachineDetailsModel extends Model
|
class DrierMachineDetailsModel extends Model
|
||||||
{
|
{
|
||||||
protected $table = 't_drierMachineDetails';
|
protected $table = 't_driermachinedetails';
|
||||||
protected $primaryKey = 'id';
|
protected $primaryKey = 'id';
|
||||||
protected $useAutoIncrement = true;
|
protected $useAutoIncrement = true;
|
||||||
protected $returnType = 'array';
|
protected $returnType = 'array';
|
||||||
|
|||||||
@ -52,7 +52,7 @@ class Employeedetails_model extends Model
|
|||||||
return $query->getResult();
|
return $query->getResult();
|
||||||
}
|
}
|
||||||
|
|
||||||
function incomingSilicaSandTestedBy($ConfigID){
|
function incomingSilicaSandTestedBy(){
|
||||||
|
|
||||||
|
|
||||||
$builder = $this->db->table('t_employee_details Emp')
|
$builder = $this->db->table('t_employee_details Emp')
|
||||||
@ -67,7 +67,7 @@ class Employeedetails_model extends Model
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function incomingSilicaSandApprovedBy($ConfigID){
|
function incomingSilicaSandApprovedBy(){
|
||||||
|
|
||||||
$builder = $this->db->table('t_employee_details Emp')
|
$builder = $this->db->table('t_employee_details Emp')
|
||||||
->select(' Emp.*')
|
->select(' Emp.*')
|
||||||
|
|||||||
@ -92,7 +92,7 @@ class FactoryMachineModel extends Model
|
|||||||
$result = $this->db->table('t_factorymachinemaster')
|
$result = $this->db->table('t_factorymachinemaster')
|
||||||
->where('is_active', 1)
|
->where('is_active', 1)
|
||||||
->where('energy_type', 'diesel')
|
->where('energy_type', 'diesel')
|
||||||
->orderBy('id', 'desc')
|
->orderBy('id', 'asc')
|
||||||
->get()
|
->get()
|
||||||
->getResultArray();
|
->getResultArray();
|
||||||
|
|
||||||
|
|||||||
@ -6,7 +6,7 @@ use CodeIgniter\Model;
|
|||||||
|
|
||||||
class IncomingSilicaSandDetailsModel extends Model
|
class IncomingSilicaSandDetailsModel extends Model
|
||||||
{
|
{
|
||||||
protected $table = 't_incomingSilicaSandDetails';
|
protected $table = 't_incomingsilicasanddetails';
|
||||||
protected $primaryKey = 'id';
|
protected $primaryKey = 'id';
|
||||||
protected $useAutoIncrement = true;
|
protected $useAutoIncrement = true;
|
||||||
protected $returnType = 'array';
|
protected $returnType = 'array';
|
||||||
|
|||||||
@ -1216,7 +1216,7 @@ class Inwardgateregister_model extends Model
|
|||||||
|
|
||||||
$builder->groupBy('t_igr_details.IGRNO, t_igr_details.MaterialCode')
|
$builder->groupBy('t_igr_details.IGRNO, t_igr_details.MaterialCode')
|
||||||
->join('t_igr_master igrMast', 'igrMast.IGRNO = t_igr_details.IGRNO')
|
->join('t_igr_master igrMast', 'igrMast.IGRNO = t_igr_details.IGRNO')
|
||||||
->join('t_incomingSilicaSandDetails issd','issd.igrNo_fk = t_igr_details.IGRNO AND issd.materialCode = t_igr_details.MaterialCode','left')
|
->join('t_incomingsilicasanddetails issd','issd.igrNo_fk = t_igr_details.IGRNO AND issd.materialCode = t_igr_details.MaterialCode','left')
|
||||||
->join('t_materialmaster materialMaster', 'materialMaster.MaterialCode = t_igr_details.MaterialCode')
|
->join('t_materialmaster materialMaster', 'materialMaster.MaterialCode = t_igr_details.MaterialCode')
|
||||||
->join('t_configdetails cd','cd.key = materialMaster.Category','left')
|
->join('t_configdetails cd','cd.key = materialMaster.Category','left')
|
||||||
->join('t_purchaseorder_master poMaster', 'poMaster.PONO = igrMast.PONO', 'left')
|
->join('t_purchaseorder_master poMaster', 'poMaster.PONO = igrMast.PONO', 'left')
|
||||||
|
|||||||
@ -147,6 +147,10 @@ class Rawmaterialdetails_model extends Model
|
|||||||
|
|
||||||
$builder = $this->db->table('t_materialmaster')
|
$builder = $this->db->table('t_materialmaster')
|
||||||
->select('MaterialCode')
|
->select('MaterialCode')
|
||||||
|
|
||||||
|
/** Caution changing config key is posing risk to entire stock module * */
|
||||||
|
// 248 is the config detail key for silica sand
|
||||||
|
|
||||||
->where('Category', '248')
|
->where('Category', '248')
|
||||||
->orderBy('CreatedDate', 'desc');
|
->orderBy('CreatedDate', 'desc');
|
||||||
$query = $builder->get();
|
$query = $builder->get();
|
||||||
@ -159,6 +163,10 @@ class Rawmaterialdetails_model extends Model
|
|||||||
|
|
||||||
$builder = $this->db->table('t_materialmaster')
|
$builder = $this->db->table('t_materialmaster')
|
||||||
->select('MaterialCode')
|
->select('MaterialCode')
|
||||||
|
|
||||||
|
/** Caution changing config key is posing risk to entire stock module * */
|
||||||
|
// 328 is the config detail key for silica sand
|
||||||
|
|
||||||
->where('Category', '328')
|
->where('Category', '328')
|
||||||
->orderBy('CreatedDate', 'desc');
|
->orderBy('CreatedDate', 'desc');
|
||||||
$query = $builder->get();
|
$query = $builder->get();
|
||||||
|
|||||||
@ -146,7 +146,7 @@ class TrpProductionModel extends Model
|
|||||||
$builder->join('t_trp_sand_use tsu', 'tsu.date = tpmd.date', 'left');
|
$builder->join('t_trp_sand_use tsu', 'tsu.date = tpmd.date', 'left');
|
||||||
|
|
||||||
// Subquery: Coating Machine Gas Consumption
|
// Subquery: Coating Machine Gas Consumption
|
||||||
$subquery1 = $this->db->table('t_coatingMachineDetails')
|
$subquery1 = $this->db->table('t_coatingmachinedetails')
|
||||||
->select('date, SUM(totalGasConsumption) AS totalGasConsumption')
|
->select('date, SUM(totalGasConsumption) AS totalGasConsumption')
|
||||||
->groupBy('date')
|
->groupBy('date')
|
||||||
->getCompiledSelect(false); // Convert Query Builder to raw SQL;
|
->getCompiledSelect(false); // Convert Query Builder to raw SQL;
|
||||||
@ -154,7 +154,7 @@ class TrpProductionModel extends Model
|
|||||||
$builder->join("({$subquery1}) tcmd", 'tcmd.date = tpmd.date', 'left');
|
$builder->join("({$subquery1}) tcmd", 'tcmd.date = tpmd.date', 'left');
|
||||||
|
|
||||||
// Subquery: Drier Machine Gas Consumption
|
// Subquery: Drier Machine Gas Consumption
|
||||||
$subquery2 = $this->db->table('t_drierMachineDetails')
|
$subquery2 = $this->db->table('t_driermachinedetails')
|
||||||
->select('date, SUM(total_gas_consumption) AS totalGasConsumption')
|
->select('date, SUM(total_gas_consumption) AS totalGasConsumption')
|
||||||
->groupBy('date')
|
->groupBy('date')
|
||||||
->getCompiledSelect(false); // Convert Query Builder to raw SQL;
|
->getCompiledSelect(false); // Convert Query Builder to raw SQL;
|
||||||
|
|||||||
355
app/Views/credit_notes.php
Normal file
355
app/Views/credit_notes.php
Normal file
@ -0,0 +1,355 @@
|
|||||||
|
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0-beta3/css/all.min.css">
|
||||||
|
<style>
|
||||||
|
|
||||||
|
.edit-container {
|
||||||
|
display: inline-flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.edit-input-field {
|
||||||
|
padding: 2px;
|
||||||
|
font-size: 14px;
|
||||||
|
border: 1px solid #ccc;
|
||||||
|
border-radius: 4px;
|
||||||
|
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
|
||||||
|
width: 150px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.edit-input-field:focus {
|
||||||
|
outline: none;
|
||||||
|
border-color: #007bff;
|
||||||
|
box-shadow: 0 0 5px rgba(0, 123, 255, 0.5);
|
||||||
|
}
|
||||||
|
|
||||||
|
.save-btn, .cancel-btn {
|
||||||
|
border: none;
|
||||||
|
background: none;
|
||||||
|
cursor: pointer;
|
||||||
|
font-size: 16px;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
width: 30px;
|
||||||
|
height: 30px;
|
||||||
|
border-radius: 50%;
|
||||||
|
transition: background-color 0.3s ease;
|
||||||
|
}
|
||||||
|
|
||||||
|
.save-btn {
|
||||||
|
color: #28a745;
|
||||||
|
background-color: #e8f5e9;
|
||||||
|
}
|
||||||
|
|
||||||
|
.save-btn:hover {
|
||||||
|
background-color: #c3e6cb;
|
||||||
|
}
|
||||||
|
|
||||||
|
.cancel-btn {
|
||||||
|
color: #dc3545;
|
||||||
|
background-color: #f8d7da;
|
||||||
|
}
|
||||||
|
|
||||||
|
.cancel-btn:hover {
|
||||||
|
background-color: #f5c6cb;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/* Target the first child element of #datatable-buttons_wrapper */
|
||||||
|
#datatable-buttons_wrapper.dataTables_wrapper.dt-bootstrap4.no-footer> :nth-child(1) {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Target the third child element of #datatable-buttons_wrapper */
|
||||||
|
#datatable-buttons_wrapper.dataTables_wrapper.dt-bootstrap4.no-footer> :nth-child(3) {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.card_font_colorset_green {
|
||||||
|
font-size: 23.7215px;
|
||||||
|
font-weight: 500;
|
||||||
|
line-height: 1.2;
|
||||||
|
position: relative;
|
||||||
|
z-index: 1;
|
||||||
|
color: rgb(86, 166, 75);
|
||||||
|
}
|
||||||
|
|
||||||
|
.card_font_colorset_bule {
|
||||||
|
font-size: 23.7215px;
|
||||||
|
font-weight: 500;
|
||||||
|
line-height: 1.2;
|
||||||
|
position: relative;
|
||||||
|
z-index: 1;
|
||||||
|
color: rgb(31, 96, 196);
|
||||||
|
}
|
||||||
|
|
||||||
|
.card_font_colorset_red {
|
||||||
|
font-size: 23.7215px;
|
||||||
|
font-weight: 500;
|
||||||
|
line-height: 1.2;
|
||||||
|
position: relative;
|
||||||
|
z-index: 1;
|
||||||
|
color: rgb(173, 3, 23);
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
<style>
|
||||||
|
#Requisition_filter {
|
||||||
|
float: inline-end;
|
||||||
|
}
|
||||||
|
|
||||||
|
#Requisition_wrapper .row .col-sm-4 {
|
||||||
|
flex-basis: 50%;
|
||||||
|
float: inline-end;
|
||||||
|
}
|
||||||
|
|
||||||
|
#Requisition_paginate .pagination {
|
||||||
|
flex-basis: 50%;
|
||||||
|
float: inline-end;
|
||||||
|
margin: 0 0 15px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#Requisition_wrapper .row:nth-child(3),
|
||||||
|
#Requisition_wrapper .row:nth-child(1) {
|
||||||
|
padding: 0 15px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#Requisition_info {
|
||||||
|
margin-top: 5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.dataTables_wrapper {
|
||||||
|
padding-bottom: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
span.highlight {
|
||||||
|
background-color: yellow;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
||||||
|
<style>
|
||||||
|
.Date-filter-form {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 10px;
|
||||||
|
/* Adjust the gap as needed */
|
||||||
|
}
|
||||||
|
|
||||||
|
.Date-filter-form input,
|
||||||
|
.Date-filter-form button {
|
||||||
|
padding: 5px;
|
||||||
|
font-size: 14px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.Date-filter-form button {
|
||||||
|
background-color: #007bff;
|
||||||
|
color: white;
|
||||||
|
border: none;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
|
.Date-filter-form button:hover {
|
||||||
|
background-color: #0056b3;
|
||||||
|
}
|
||||||
|
|
||||||
|
.icon-button {
|
||||||
|
background: none;
|
||||||
|
border: none;
|
||||||
|
cursor: pointer;
|
||||||
|
color: #007bff;
|
||||||
|
font-size: 18px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.icon-button:hover {
|
||||||
|
color: #0056b3;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
<div class="content-page">
|
||||||
|
<div class="content">
|
||||||
|
<!-- Start Content-->
|
||||||
|
<div class="container-fluid">
|
||||||
|
<!-- start page title -->
|
||||||
|
<div>
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-12">
|
||||||
|
<div class="page-title-box page-title-box-alt">
|
||||||
|
<div class="page-title-right">
|
||||||
|
<ol class="breadcrumb m-0">
|
||||||
|
<li class="breadcrumb-item"><a href="javascript: void(0);">Sales</a></li>
|
||||||
|
|
||||||
|
<li class="breadcrumb-item active">
|
||||||
|
<h4 class="page-title">Credit Notes List</h4>
|
||||||
|
</li>
|
||||||
|
</ol>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-12">
|
||||||
|
<div class="card">
|
||||||
|
|
||||||
|
|
||||||
|
<div class="row">
|
||||||
|
|
||||||
|
<div class="col-md-10">
|
||||||
|
<form class="Date-filter-form" style="margin-top: 14px;margin-bottom: -11px;margin-left: 33px;"
|
||||||
|
method="post" action="<?= base_url('credit_notes'); ?>">
|
||||||
|
|
||||||
|
<label for="fromDate">From:</label>
|
||||||
|
<input class="form-control date_range form-date-search"
|
||||||
|
value="<?= $fromDate?>"
|
||||||
|
id="fromDate" name="fromDate" placeholder="Select From Date" autocomplete="off" required>
|
||||||
|
|
||||||
|
<label for="toDate">To:</label>
|
||||||
|
<input class="form-control date_range to-date-search"
|
||||||
|
value="<?= $toDate ?>"
|
||||||
|
id="toDate" name="toDate" placeholder="Select To Date" autocomplete="off" required>
|
||||||
|
|
||||||
|
<button type="submit" class="range_search_button" >
|
||||||
|
<i class="fe-search" aria-hidden="true" class="icon-button" title="Search"></i>
|
||||||
|
</button>
|
||||||
|
|
||||||
|
<i class="fe-rotate-cw range_reset_button"
|
||||||
|
style="cursor:pointer;"
|
||||||
|
aria-hidden="true" class="icon-button" id="resetButton" title="Reset"></i>
|
||||||
|
|
||||||
|
|
||||||
|
<div class="error" id="error"></div>
|
||||||
|
|
||||||
|
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
<div class="col-md-2 text-right" style="padding-right: 36px !important;">
|
||||||
|
<!-- <button class="btn btn-secondary" id="excel-download" style="margin-top: 14px; margin-bottom: -11px; " type="button"><span>Excel</span></button> -->
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<div class="card-body" style="overflow-x:scroll;">
|
||||||
|
<table id="datatable-buttosns" class="table dt-responsive nowrap w-100">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th>Date</th>
|
||||||
|
<th>Credit Note</th>
|
||||||
|
<th>Invoice</th>
|
||||||
|
<th>Client </th>
|
||||||
|
<th>Item Price</th>
|
||||||
|
<th>Item qty</th>
|
||||||
|
<th>Sub Total</th>
|
||||||
|
<th>GST</th>
|
||||||
|
<th>Total</th>
|
||||||
|
<th>Status</th>
|
||||||
|
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
|
||||||
|
<?php if (!empty($credit_notes)) {
|
||||||
|
foreach ($credit_notes as $val) { ?>
|
||||||
|
<!-- Main invoice row -->
|
||||||
|
<tr>
|
||||||
|
<td><?php echo date('d-m-Y', strtotime($val['date'])); ?></td>
|
||||||
|
<td><?php echo $val['creditnote_number'] ?></td>
|
||||||
|
<td><?php echo $val['applied_invoices'] ?></td>
|
||||||
|
<td><?php echo $val['customer_name'] ?></td>
|
||||||
|
<td><?php echo $val['item_price'] ?></td>
|
||||||
|
<td><?php echo $val['item_quantity'] ?></td>
|
||||||
|
<td><?php echo $val['item_total_without_tax'] ?></td>
|
||||||
|
<td><?php echo $val['item_total'] - $val['item_total_without_tax'] ?></td>
|
||||||
|
<td><?php echo $val['item_total'] ?></td>
|
||||||
|
<td><?php echo $val['status'] ?></td>
|
||||||
|
|
||||||
|
</tr>
|
||||||
|
<?php } } ?>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div> <!-- end card body-->
|
||||||
|
</div> <!-- end card -->
|
||||||
|
</div><!-- end col-->
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div> <!-- container -->
|
||||||
|
</div> <!-- content -->
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<script src="https://cdnjs.cloudflare.com/ajax/libs/xlsx/0.18.0/xlsx.full.min.js"></script>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
$(document).ready(function() {
|
||||||
|
// Initialize the DataTable
|
||||||
|
var table = $('#datatable-buttosns').DataTable({
|
||||||
|
|
||||||
|
dom: 'Blfrtip',
|
||||||
|
buttons: [
|
||||||
|
{
|
||||||
|
extend: 'excel',
|
||||||
|
text: 'Excel',
|
||||||
|
exportOptions: {
|
||||||
|
columns: ':not(:last-child)' // Exclude the last column
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
pageLength: 10,
|
||||||
|
lengthMenu: [
|
||||||
|
[10, 20, 30, 50, -1],
|
||||||
|
[10, 20, 30, 50, "All"]
|
||||||
|
],
|
||||||
|
responsive: false,
|
||||||
|
ordering: false,
|
||||||
|
|
||||||
|
language: {
|
||||||
|
paginate: {
|
||||||
|
next: '<i class="fas fa-angle-right"></i>', // Next button icon
|
||||||
|
previous: '<i class="fas fa-angle-left"></i>' // Previous button icon
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// Reset button functionality
|
||||||
|
$("#resetButton").click(function() {
|
||||||
|
$("#fromDate").val('');
|
||||||
|
$("#toDate").val('');
|
||||||
|
window.location="sales_invoice"
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
$(document).ready(function() {
|
||||||
|
$('#fromDate , #toDate').change(function() {
|
||||||
|
|
||||||
|
let fromDate = $('#fromDate').val();
|
||||||
|
let toDate = $('#toDate').val();
|
||||||
|
|
||||||
|
let fromDateObj = new Date(fromDate.split('-').reverse().join('-'));
|
||||||
|
let toDateObj = new Date(toDate.split('-').reverse().join('-'));
|
||||||
|
if (fromDateObj > toDateObj) {
|
||||||
|
alert('Incorrect Date Applied For Filter..!!');
|
||||||
|
$('#toDate').attr('min', fromDate);
|
||||||
|
$('#toDate').val('');
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
</script>
|
||||||
@ -654,6 +654,7 @@
|
|||||||
</a>
|
</a>
|
||||||
<div class="dropdown-menu" aria-labelledby="topnav-hr">
|
<div class="dropdown-menu" aria-labelledby="topnav-hr">
|
||||||
<a href="<?php echo base_url(); ?>sales_invoice" class="dropdown-item"><i class="ri-file-list-3-line align-middle mr-1"></i>Invoice</a>
|
<a href="<?php echo base_url(); ?>sales_invoice" class="dropdown-item"><i class="ri-file-list-3-line align-middle mr-1"></i>Invoice</a>
|
||||||
|
<a href="<?php echo base_url(); ?>credit_notes" class="dropdown-item"><i class="ri-file-list-3-line align-middle mr-1"></i>Credit Notes </a>
|
||||||
<a href="<?php echo base_url(); ?>sales_report" class="dropdown-item"><i class="ri-file-list-3-line align-middle mr-1"></i>Invoice Report</a>
|
<a href="<?php echo base_url(); ?>sales_report" class="dropdown-item"><i class="ri-file-list-3-line align-middle mr-1"></i>Invoice Report</a>
|
||||||
|
|
||||||
<?php if(session()->get('roleText') == 'System Administrator'){?>
|
<?php if(session()->get('roleText') == 'System Administrator'){?>
|
||||||
|
|||||||
@ -235,6 +235,10 @@
|
|||||||
z-index: 5!important;
|
z-index: 5!important;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
tfoot tr {
|
||||||
|
background-color:rgb(235, 236, 203);
|
||||||
|
}
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<div class="content-page">
|
<div class="content-page">
|
||||||
@ -456,34 +460,11 @@
|
|||||||
|
|
||||||
} ?>
|
} ?>
|
||||||
|
|
||||||
<table id="coatingMachineStockDetailsTableSummaryId" class="fht-table table-hover table-bordered">
|
<tfoot>
|
||||||
|
|
||||||
<thead >
|
|
||||||
|
|
||||||
<th class="celda_encabezado_total"
|
|
||||||
style="padding: 10px; background-color:#ffff;"> Date </th>
|
|
||||||
<th class="celda_encabezado_total" >Shift</th>
|
|
||||||
<th class="celda_encabezado_total" >Machine On Time</th>
|
|
||||||
<th class="celda_encabezado_total" >Machine Off Time</th>
|
|
||||||
<th class="celda_encabezado_total" >Machine Running(hr)</th>
|
|
||||||
<th class="celda_encabezado_total" >Customer Name </th>
|
|
||||||
<th class="celda_encabezado_total" >Grade</th>
|
|
||||||
<th class="celda_encabezado_total" >Total Coating</th>
|
|
||||||
<th class="celda_encabezado_total" >Total Coating Sand(kg)</th>
|
|
||||||
<th class="celda_encabezado_total" >Total Gas Consumption</th>
|
|
||||||
<th class="celda_encabezado_total" >Hour Gas</th>
|
|
||||||
<th class="celda_encabezado_total" >Hour QTY(kg)</th>
|
|
||||||
</thead>
|
|
||||||
|
|
||||||
<tbody>
|
|
||||||
|
|
||||||
<tr>
|
<tr>
|
||||||
|
|
||||||
<td style="background-color:rgb(189, 9, 6); color:#ffff;">
|
<td style="background-color:rgb(189, 9, 6); color:#ffff;">
|
||||||
<b> Total </b>
|
<b> Total </b>
|
||||||
</td>
|
</td>
|
||||||
|
|
||||||
|
|
||||||
<td class="celda_normal "> - </td>
|
<td class="celda_normal "> - </td>
|
||||||
<td class="celda_normal "> - </td>
|
<td class="celda_normal "> - </td>
|
||||||
<td class="celda_normal "> - </td>
|
<td class="celda_normal "> - </td>
|
||||||
@ -496,9 +477,9 @@
|
|||||||
<td class="celda_normal "><?=number_format($summary['totalGasConsumption']/$summary['totalMachineRunningHrs'], 2)?> (avg)</td>
|
<td class="celda_normal "><?=number_format($summary['totalGasConsumption']/$summary['totalMachineRunningHrs'], 2)?> (avg)</td>
|
||||||
<td class="celda_normal "><?=number_format($summary['totalCoatingSandInKg']/$summary['totalMachineRunningHrs'], 2)?> (avg)</td>
|
<td class="celda_normal "><?=number_format($summary['totalCoatingSandInKg']/$summary['totalMachineRunningHrs'], 2)?> (avg)</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
</tfoot>
|
||||||
|
|
||||||
|
|
||||||
</tbody>
|
|
||||||
</table>
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
@ -235,6 +235,9 @@
|
|||||||
} */
|
} */
|
||||||
|
|
||||||
|
|
||||||
|
tfoot tr {
|
||||||
|
background-color:rgb(235, 236, 203);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -304,7 +307,7 @@
|
|||||||
|
|
||||||
<div class="col-3">
|
<div class="col-3">
|
||||||
<input type="text" name="month" id="month" value="<?php echo "$month" ?>"
|
<input type="text" name="month" id="month" value="<?php echo "$month" ?>"
|
||||||
class="form-control mt-2" data-provide="datepicker"
|
class="form-control mt-2"
|
||||||
data-date-format="M-yyyy" data-date-min-view-mode="1" readonly>
|
data-date-format="M-yyyy" data-date-min-view-mode="1" readonly>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group col-md-3">
|
<div class="form-group col-md-3">
|
||||||
@ -419,7 +422,7 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- hidden fields -->
|
<!-- hidden fields -->
|
||||||
<input type="hidden" name="month" id="month" value="<?php echo "$month" ?>"
|
<input type="hidden" name="month" value="<?php echo "$month" ?>"
|
||||||
class="form-control mt-2" data-provide="datepicker"
|
class="form-control mt-2" data-provide="datepicker"
|
||||||
data-date-format="M-yyyy" data-date-min-view-mode="1">
|
data-date-format="M-yyyy" data-date-min-view-mode="1">
|
||||||
|
|
||||||
@ -585,22 +588,7 @@
|
|||||||
|
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
|
|
||||||
|
<tfoot>
|
||||||
<div class="table-responsive">
|
|
||||||
<table id="bagStockDetailsTableSummaryId" class="fht-table table-striped">
|
|
||||||
|
|
||||||
<thead >
|
|
||||||
<th class="celda_encabezado_total">Total Sum</th>
|
|
||||||
<?php foreach($summary as $each){ ?>
|
|
||||||
<th class="celda_encabezado_total">Opening Stock</th>
|
|
||||||
<th class="celda_encabezado_total">Receipt</th>
|
|
||||||
<th class="celda_encabezado_total">Used</th>
|
|
||||||
<th class="celda_encabezado_total">Balance Stock</th>
|
|
||||||
<?php } ?>
|
|
||||||
</thead>
|
|
||||||
|
|
||||||
<tbody>
|
|
||||||
|
|
||||||
<tr>
|
<tr>
|
||||||
|
|
||||||
<td style="background-color:rgb(189, 9, 6); color:#ffff;">
|
<td style="background-color:rgb(189, 9, 6); color:#ffff;">
|
||||||
@ -619,12 +607,9 @@
|
|||||||
<?php } ?>
|
<?php } ?>
|
||||||
|
|
||||||
</tr>
|
</tr>
|
||||||
|
</tfoot>
|
||||||
|
|
||||||
|
|
||||||
</tbody>
|
|
||||||
</table>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- this else condition work if groupedBagStockDetails is empty and creating new records
|
<!-- this else condition work if groupedBagStockDetails is empty and creating new records
|
||||||
with initial values 0 for entire month -->
|
with initial values 0 for entire month -->
|
||||||
<?php } else {
|
<?php } else {
|
||||||
@ -682,11 +667,14 @@
|
|||||||
>
|
>
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
|
foreach($previousMonthBagStockDetails as $index => $previousMonthBagStockDetail)
|
||||||
|
{
|
||||||
|
if($previousMonthBagStockDetail['materialCode'] == $bagMaterial['MaterialCode']){
|
||||||
|
echo $previousMonthBagStockDetail['balanceStock'] ;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
echo $previousMonthBagStockDetails[$bagMaterialIndex]['balanceStock'] ?? ' ';
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|
||||||
</td>
|
</td>
|
||||||
@ -704,7 +692,14 @@
|
|||||||
data-id="<?=$dateInMonth?> <?=$bagMaterial['MaterialCode']?>"
|
data-id="<?=$dateInMonth?> <?=$bagMaterial['MaterialCode']?>"
|
||||||
>
|
>
|
||||||
<?php
|
<?php
|
||||||
echo $previousMonthBagStockDetails[$bagMaterialIndex]['balanceStock'] ?? ' ';
|
foreach($previousMonthBagStockDetails as $index => $previousMonthBagStockDetail)
|
||||||
|
{
|
||||||
|
if($previousMonthBagStockDetail['materialCode'] == $bagMaterial['MaterialCode']){
|
||||||
|
echo $previousMonthBagStockDetail['balanceStock'] ;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
?>
|
?>
|
||||||
</td>
|
</td>
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
@ -1273,3 +1268,16 @@
|
|||||||
});
|
});
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
$(document).ready(function () {
|
||||||
|
$('#month').datepicker({
|
||||||
|
format: "M-yyyy", // Format as "Jan-2025"
|
||||||
|
minViewMode: 1, // Month-Year Picker
|
||||||
|
autoclose: true,
|
||||||
|
todayHighlight: true
|
||||||
|
}).on('focus', function() {
|
||||||
|
$(this).datepicker('show'); // Ensure it opens on focus
|
||||||
|
});
|
||||||
|
});
|
||||||
|
</script>
|
||||||
@ -226,8 +226,9 @@
|
|||||||
max-width: 100px;
|
max-width: 100px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
tfoot tr{
|
||||||
|
background-color:rgb(235, 236, 203);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -683,33 +684,7 @@ foreach ($period as $day) {
|
|||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<div class="table-responsive">
|
<tfoot>
|
||||||
<table id="dieselStockDetailsTableSummaryId" class="fht-table table-striped">
|
|
||||||
|
|
||||||
<thead >
|
|
||||||
|
|
||||||
<th class="celda_encabezado_total" >Total Sum</th>
|
|
||||||
|
|
||||||
<th class="celda_encabezado_total"> Opening</th>
|
|
||||||
<th class="celda_encabezado_total"> Purchase Diesel</th>
|
|
||||||
<th class="celda_encabezado_total"> Filling Diesel</th>
|
|
||||||
<th class="celda_encabezado_total"> Balance Stock</th>
|
|
||||||
|
|
||||||
<?php foreach($summary as $each){
|
|
||||||
if(is_array($each)){
|
|
||||||
?>
|
|
||||||
<th class="celda_encabezado_total">Opening Reading</th>
|
|
||||||
<th class="celda_encabezado_total">Closing Reading</th>
|
|
||||||
<th class="celda_encabezado_total">Filling Diesel</th>
|
|
||||||
<th class="celda_encabezado_total">Consumption</th>
|
|
||||||
<th class="celda_encabezado_total">Running Hours</th>
|
|
||||||
<th class="celda_encabezado_total">Mileage</th>
|
|
||||||
<?php }
|
|
||||||
} ?>
|
|
||||||
</thead>
|
|
||||||
|
|
||||||
<tbody>
|
|
||||||
|
|
||||||
<tr>
|
<tr>
|
||||||
|
|
||||||
<td style="background-color:rgb(189, 9, 6); color:#ffff;">
|
<td style="background-color:rgb(189, 9, 6); color:#ffff;">
|
||||||
@ -717,10 +692,10 @@ foreach ($period as $day) {
|
|||||||
</td>
|
</td>
|
||||||
|
|
||||||
|
|
||||||
<td><?= $summary['opening_diesel'] ?></td>
|
<td class="celda_normal "><?= $summary['opening_diesel'] ?></td>
|
||||||
<td><?= $summary['totalPurchaseDiesel'] ?></td>
|
<td class="celda_normal "><?= $summary['totalPurchaseDiesel'] ?></td>
|
||||||
<td><?= $summary['totalFillingDiesel'] ?></td>
|
<td class="celda_normal "><?= $summary['totalFillingDiesel'] ?></td>
|
||||||
<td><?= $summary['balanceStock'] ?></td>
|
<td class="celda_normal "><?= $summary['balanceStock'] ?></td>
|
||||||
|
|
||||||
<?php foreach($summary as $each){
|
<?php foreach($summary as $each){
|
||||||
if(is_array($each)){
|
if(is_array($each)){
|
||||||
@ -739,11 +714,10 @@ foreach ($period as $day) {
|
|||||||
?>
|
?>
|
||||||
|
|
||||||
</tr>
|
</tr>
|
||||||
|
</tfoot>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</tbody>
|
|
||||||
</table>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- this else condition work if groupeddieselStockDetails is empty and creating new records
|
<!-- this else condition work if groupeddieselStockDetails is empty and creating new records
|
||||||
with initial values 0 for entire month -->
|
with initial values 0 for entire month -->
|
||||||
@ -839,9 +813,17 @@ foreach ($period as $day) {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
><?= (!empty($previousMonthDieselMachineStockDetails) && isset($previousMonthDieselMachineStockDetails[$dieselMachineIndex]) )
|
>
|
||||||
? $previousMonthDieselMachineStockDetails[$dieselMachineIndex]['closing_reading']
|
|
||||||
:" " ;
|
<?php
|
||||||
|
foreach($previousMonthDieselMachineStockDetails as $index => $previousMonthDieselMachineStockDetail)
|
||||||
|
{
|
||||||
|
if($previousMonthDieselMachineStockDetail['machine_id'] == $dieselMachine['id']){
|
||||||
|
echo $previousMonthDieselMachineStockDetail['closing_reading'] ;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
?>
|
?>
|
||||||
</td>
|
</td>
|
||||||
|
|
||||||
@ -850,9 +832,18 @@ foreach ($period as $day) {
|
|||||||
oninput="closingReadingChange(this)"
|
oninput="closingReadingChange(this)"
|
||||||
contenteditable="true">
|
contenteditable="true">
|
||||||
|
|
||||||
<?= !empty($previousMonthDieselMachineStockDetails) && isset($previousMonthDieselMachineStockDetails[$dieselMachineIndex])
|
<?php
|
||||||
? $previousMonthDieselMachineStockDetails[$dieselMachineIndex]['closing_reading']
|
|
||||||
:" " ;
|
|
||||||
|
foreach($previousMonthDieselMachineStockDetails as $index => $previousMonthDieselMachineStockDetail)
|
||||||
|
{
|
||||||
|
if($previousMonthDieselMachineStockDetail['machine_id'] == $dieselMachine['id']){
|
||||||
|
echo $previousMonthDieselMachineStockDetail['closing_reading'] ;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
?>
|
?>
|
||||||
</td>
|
</td>
|
||||||
|
|
||||||
|
|||||||
@ -238,6 +238,10 @@ $datefordropdown = format_date($datefordropdown, 0, 'M-Y');
|
|||||||
z-index: 5!important;
|
z-index: 5!important;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
tfoot tr {
|
||||||
|
background-color:rgb(235, 236, 203);
|
||||||
|
}
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
<div class="content-page">
|
<div class="content-page">
|
||||||
<div class="content">
|
<div class="content">
|
||||||
@ -503,37 +507,7 @@ $datefordropdown = format_date($datefordropdown, 0, 'M-Y');
|
|||||||
|
|
||||||
|
|
||||||
</tbody>
|
</tbody>
|
||||||
<?php } ?>
|
<tfoot>
|
||||||
</table>
|
|
||||||
|
|
||||||
<?php if(!empty($drierDetails)){ ?>
|
|
||||||
|
|
||||||
<table id="drierTableSummaryId" class="fht-table ">
|
|
||||||
|
|
||||||
<thead >
|
|
||||||
|
|
||||||
<tr>
|
|
||||||
<th class="celda_encabezado_total"
|
|
||||||
style="padding:5px; border:#ffffff; background-color: #ffffff;">Date value</th>
|
|
||||||
<th class="celda_encabezado_total" >Drier On Time </th>
|
|
||||||
<th class="celda_encabezado_total" >Drier Off Time</th>
|
|
||||||
<th class="celda_encabezado_total" >Running Hrs</th>
|
|
||||||
<th class="celda_encabezado_total" >Supplier Name </th>
|
|
||||||
|
|
||||||
<th class="celda_encabezado_total" >input Sand Qty (Metric Ton)</th>
|
|
||||||
<th class="celda_encabezado_total" >inputp Sand Moisture(%)</th>
|
|
||||||
<th class="celda_encabezado_total" >Sand Dried Qty (Metric Ton)</th>
|
|
||||||
<th class="celda_encabezado_total" >Total Gas Consumption</th>
|
|
||||||
<th class="celda_encabezado_total" >Gas Per Ton</th>
|
|
||||||
<th class="celda_encabezado_total" >Qty Per Hrs (Metric Ton)</th>
|
|
||||||
<th class="celda_encabezado_total" >Moisture Loss Qty (Metric Ton)</th>
|
|
||||||
<th class="celda_encabezado_total" >Dust Qty (Metric Ton)</th>
|
|
||||||
|
|
||||||
</tr>
|
|
||||||
</thead>
|
|
||||||
|
|
||||||
<tbody>
|
|
||||||
|
|
||||||
<tr>
|
<tr>
|
||||||
|
|
||||||
<td style="background-color:rgb(189, 9, 6); color:#ffff;">
|
<td style="background-color:rgb(189, 9, 6); color:#ffff;">
|
||||||
@ -553,12 +527,9 @@ $datefordropdown = format_date($datefordropdown, 0, 'M-Y');
|
|||||||
<td class="celda_normal "><?=$summary['moisture_loss_qty']?></td>
|
<td class="celda_normal "><?=$summary['moisture_loss_qty']?></td>
|
||||||
<td class="celda_normal "><?=$summary['dust_qty']?></td>
|
<td class="celda_normal "><?=$summary['dust_qty']?></td>
|
||||||
</tr>
|
</tr>
|
||||||
|
</tfoot>
|
||||||
</tbody>
|
|
||||||
</table>
|
|
||||||
|
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
|
</table>
|
||||||
|
|
||||||
<?php if(empty($drierDetails)){ ?>
|
<?php if(empty($drierDetails)){ ?>
|
||||||
<br><br>
|
<br><br>
|
||||||
|
|||||||
@ -228,6 +228,10 @@
|
|||||||
max-width: 150px;
|
max-width: 150px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
tfoot tr {
|
||||||
|
background-color:rgb(235, 236, 203);
|
||||||
|
}
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
|
|
||||||
@ -273,10 +277,9 @@
|
|||||||
data-date-format="M-yyyy" data-date-min-view-mode="1" readonly>
|
data-date-format="M-yyyy" data-date-min-view-mode="1" readonly>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="form-group col-md-2">
|
<div class="form-group col-md-3">
|
||||||
<button type="submit" class="btn btn-success"> Change Month </button>
|
<button type="submit" class="btn btn-success"> Change Month </button>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-md-1"></div>
|
|
||||||
<div class="col-6">
|
<div class="col-6">
|
||||||
<div class="dropdown float-right">
|
<div class="dropdown float-right">
|
||||||
<a href="#" class="dropdown-toggle arrow-none" data-toggle="dropdown"
|
<a href="#" class="dropdown-toggle arrow-none" data-toggle="dropdown"
|
||||||
@ -378,9 +381,9 @@
|
|||||||
<tfoot>
|
<tfoot>
|
||||||
<tr>
|
<tr>
|
||||||
<td style="background-color:rgb(189, 9, 6); color:#ffff;"> Total </td>
|
<td style="background-color:rgb(189, 9, 6); color:#ffff;"> Total </td>
|
||||||
<td class="celda_normal "><?=$summary['finalRough']?></td>
|
<td class="celda_normal "> <b> <?=$summary['finalRough']?> </b> </td>
|
||||||
<td class="celda_normal "><?=$summary['dust']?></td>
|
<td class="celda_normal "> <b> <?=$summary['dust']?> </b> </td>
|
||||||
<td class="celda_normal "><?=$summary['total']?></td>
|
<td class="celda_normal "> <b> <?=$summary['total']?> </b> </td>
|
||||||
</tr>
|
</tr>
|
||||||
</tfoot>
|
</tfoot>
|
||||||
|
|
||||||
@ -680,3 +683,18 @@
|
|||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
||||||
|
<script>
|
||||||
|
$(document).ready(function () {
|
||||||
|
$('#month').datepicker({
|
||||||
|
format: "M-yyyy", // Format as "Jan-2025"
|
||||||
|
minViewMode: 1, // Month-Year Picker
|
||||||
|
autoclose: true,
|
||||||
|
todayHighlight: true,
|
||||||
|
orientation: "auto" // Adjusts automatically, or use "top" / "bottom"
|
||||||
|
}).on('focus', function() {
|
||||||
|
$(this).datepicker('show'); // Ensure it opens on focus
|
||||||
|
});
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
|
||||||
|
|||||||
@ -217,6 +217,9 @@
|
|||||||
max-width: 100px;
|
max-width: 100px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
tfoot tr {
|
||||||
|
background-color:rgb(235, 236, 203);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -501,49 +504,7 @@
|
|||||||
|
|
||||||
} ?>
|
} ?>
|
||||||
|
|
||||||
<div class="table-responsive">
|
<tfoot>
|
||||||
<table id="gasStockDetailsTableSummaryId" class="fht-table table-striped">
|
|
||||||
|
|
||||||
|
|
||||||
<thead class="celda_encabezado_total" style="padding: 10px;">
|
|
||||||
|
|
||||||
|
|
||||||
<tr>
|
|
||||||
<th class="celda_encabezado_total" rowspan="1" colspan="1">RIPL </th>
|
|
||||||
<th class="celda_encabezado_total" colspan="6">Gas Stock </th>
|
|
||||||
<th class="celda_encabezado_total">FBD 10 Ton Dryer</th>
|
|
||||||
<th class="celda_encabezado_total">Sand Dried</th>
|
|
||||||
<th class="celda_encabezado_total">Coating Machine</th>
|
|
||||||
<th class="celda_encabezado_total">Sand Coated</th>
|
|
||||||
<th class="celda_encabezado_total" colspan="2">TRP </th>
|
|
||||||
<th class="celda_encabezado_total">Sand TRP</th>
|
|
||||||
<th class="celda_encabezado_total">Rotary Drier </th>
|
|
||||||
</tr>
|
|
||||||
|
|
||||||
<tr>
|
|
||||||
<th class="celda_encabezado_total">Date </th>
|
|
||||||
<th class="celda_encabezado_total">Opening Stock</th>
|
|
||||||
<th class="celda_encabezado_total">Purchase(Bharath)</th>
|
|
||||||
<th class="celda_encabezado_total">Purchase(Indian)</th>
|
|
||||||
<th class="celda_encabezado_total">Total</th>
|
|
||||||
<th class="celda_encabezado_total">Consumption </th>
|
|
||||||
<th class="celda_encabezado_total">Balance Stock</th>
|
|
||||||
<th class="celda_encabezado_total">Consumption </th>
|
|
||||||
<th class="celda_encabezado_total">ton </th>
|
|
||||||
<th class="celda_encabezado_total">Consumption</th>
|
|
||||||
<th class="celda_encabezado_total">ton </th>
|
|
||||||
<th class="celda_encabezado_total">Panel Consumption</th>
|
|
||||||
<th class="celda_encabezado_total">Physical Consumption</th>
|
|
||||||
<th class="celda_encabezado_total">ton </th>
|
|
||||||
<th class="celda_encabezado_total">Consumption</th>
|
|
||||||
|
|
||||||
</tr>
|
|
||||||
|
|
||||||
|
|
||||||
</thead>
|
|
||||||
|
|
||||||
<tbody>
|
|
||||||
|
|
||||||
<tr>
|
<tr>
|
||||||
|
|
||||||
<td style="background-color:rgb(189, 9, 6); color:#ffff;">
|
<td style="background-color:rgb(189, 9, 6); color:#ffff;">
|
||||||
@ -569,11 +530,7 @@
|
|||||||
|
|
||||||
|
|
||||||
</tr>
|
</tr>
|
||||||
|
</tfoot>
|
||||||
|
|
||||||
</tbody>
|
|
||||||
</table>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -226,6 +226,9 @@
|
|||||||
z-index: 5!important;
|
z-index: 5!important;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
tfoot tr {
|
||||||
|
background-color:rgb(235, 236, 203);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -669,45 +672,11 @@
|
|||||||
} ?>
|
} ?>
|
||||||
|
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
|
||||||
|
|
||||||
<table id="incomingSilicaSandDetailsSummaryTable" class="fht-table table-striped " >
|
<tfoot>
|
||||||
<thead>
|
|
||||||
<tr>
|
<tr>
|
||||||
|
|
||||||
<th class="celda_encabezado_total"
|
<td class="celda_normal" style="display: none;" > -</td>
|
||||||
style="padding: 10px; border:#ffffff; background-color:#ffffff !important;">S.NO </th>
|
|
||||||
<th class="celda_encabezado_total"
|
|
||||||
style="padding: 10px; border:#ffffff; background-color:#ffffff !important;">IGR No </th>
|
|
||||||
<th class="celda_encabezado_total" style="padding: 10px;">Invoice No</th>
|
|
||||||
<th class="celda_encabezado_total" style="padding: 10px;">Invoice Date</th>
|
|
||||||
<th class="celda_encabezado_total" style="padding: 10px;">Received Date</th>
|
|
||||||
<th class="celda_encabezado_total" style="padding: 10px; min-width : 300px; max-width:300px;">Supplier Name</th>
|
|
||||||
<th class="celda_encabezado_total" style="padding: 10px;">Grade </th>
|
|
||||||
<th class="celda_encabezado_total" style="padding: 10px; min-width : 200px; max-width:200px;">Grade Condition</th>
|
|
||||||
<th class="celda_encabezado_total" style="padding: 10px;">Vehicle No</th>
|
|
||||||
<th class="celda_encabezado_total" style="padding: 10px;">Qty</th>
|
|
||||||
<th class="celda_encabezado_total" style="padding: 10px;">Lab Report</th>
|
|
||||||
<th class="celda_encabezado_total" style="padding: 10px;">AFS Spec</th>
|
|
||||||
<th class="celda_encabezado_total" style="padding: 10px;">AFS Actual</th>
|
|
||||||
<th class="celda_encabezado_total" style="padding: 10px;">Plus 20 loss%</th>
|
|
||||||
<th class="celda_encabezado_total" style="padding: 10px;">Plus 30 Loss %</th>
|
|
||||||
<th class="celda_encabezado_total" style="padding: 10px;">Moisture % Spec</th>
|
|
||||||
<th class="celda_encabezado_total" style="padding: 10px;">Moisture Actual</th>
|
|
||||||
<th class="celda_encabezado_total" style="padding: 10px;">Moisture Loss</th>
|
|
||||||
<th class="celda_encabezado_total" style="padding: 10px;">Moisture loss Qty</th>
|
|
||||||
<th class="celda_encabezado_total" style="padding: 10px;">Sieve Loss Qty</th>
|
|
||||||
<th class="celda_encabezado_total" style="padding: 10px;">Salable Qty</th>
|
|
||||||
|
|
||||||
</tr>
|
|
||||||
|
|
||||||
</thead>
|
|
||||||
|
|
||||||
<tbody>
|
|
||||||
|
|
||||||
<tr>
|
|
||||||
|
|
||||||
<td class="celda_normal" > -</td>
|
|
||||||
<td class="celda_normal" style="background-color:rgb(189, 9, 6); color:#fff ;"> <h5 style="color:#fff;"> Total </h5> </td>
|
<td class="celda_normal" style="background-color:rgb(189, 9, 6); color:#fff ;"> <h5 style="color:#fff;"> Total </h5> </td>
|
||||||
|
|
||||||
|
|
||||||
@ -718,6 +687,7 @@
|
|||||||
<td class="celda_normal" > -</td>
|
<td class="celda_normal" > -</td>
|
||||||
<td class="celda_normal" > -</td>
|
<td class="celda_normal" > -</td>
|
||||||
<td class="celda_normal" > -</td>
|
<td class="celda_normal" > -</td>
|
||||||
|
<td class="celda_normal" > -</td>
|
||||||
|
|
||||||
|
|
||||||
<td class="celda_normal" ><?=$summary['Qty']?></td>
|
<td class="celda_normal" ><?=$summary['Qty']?></td>
|
||||||
@ -736,9 +706,7 @@
|
|||||||
|
|
||||||
|
|
||||||
</tr>
|
</tr>
|
||||||
|
</tfoot>
|
||||||
</tbody>
|
|
||||||
|
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
<br>
|
<br>
|
||||||
|
|||||||
@ -235,6 +235,12 @@
|
|||||||
min-width: 100px;
|
min-width: 100px;
|
||||||
max-width: 100px;
|
max-width: 100px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
tfoot tr {
|
||||||
|
background-color:rgb(235, 236, 203);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
|
|
||||||
@ -685,51 +691,21 @@ foreach ($period as $day) {
|
|||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<div class="table-responsive">
|
<tfoot>
|
||||||
<table id="powerStockDetailsTableSummaryId" class="fht-table table-striped">
|
|
||||||
|
|
||||||
<thead>
|
|
||||||
|
|
||||||
<tr>
|
|
||||||
<th class="celda_encabezado_total" colspan="1">Date </th>
|
|
||||||
<th class="celda_encabezado_total">Opening Reading </th>
|
|
||||||
<th class="celda_encabezado_total">Final Reading</th>
|
|
||||||
<th class="celda_encabezado_total">Total Reading</th>
|
|
||||||
<th class="celda_encabezado_total">Total Units </th>
|
|
||||||
<th class="celda_encabezado_total">Average PF</th>
|
|
||||||
<th class="celda_encabezado_total">Present PF</th>
|
|
||||||
<th class="celda_encabezado_total">MD </th>
|
|
||||||
<th class="celda_encabezado_total">MF *60</th>
|
|
||||||
|
|
||||||
<?php foreach ($electricMachines as $powerMachine) { ?>
|
|
||||||
<!-- this will loop till machines present -->
|
|
||||||
<th class="celda_encabezado_total" style="display:none">Date</th>
|
|
||||||
<th class="celda_encabezado_total" style="display:none"> Machine Id</th>
|
|
||||||
<th class="celda_encabezado_total">Opening Units</th>
|
|
||||||
<th class="celda_encabezado_total">Final Units</th>
|
|
||||||
<th class="celda_encabezado_total">Total Units</th>
|
|
||||||
<?php } ?>
|
|
||||||
|
|
||||||
</tr>
|
|
||||||
|
|
||||||
</thead>
|
|
||||||
|
|
||||||
<tbody>
|
|
||||||
|
|
||||||
<tr>
|
<tr>
|
||||||
|
|
||||||
<td style="background-color:rgb(189, 9, 6); color:#ffff;">
|
<td style="background-color:rgb(189, 9, 6); color:#ffff;">
|
||||||
<b> Total </b>
|
<b> Total </b>
|
||||||
</td>
|
</td>
|
||||||
|
|
||||||
<td><?= $summary['openingReading'] ?></td>
|
<td class="celda_normal "><?= $summary['openingReading'] ?></td>
|
||||||
<td><?= $summary['finalReading'] ?></td>
|
<td class="celda_normal "><?= $summary['finalReading'] ?></td>
|
||||||
<td><?= $summary['totalReading'] ?></td>
|
<td class="celda_normal "><?= $summary['totalReading'] ?></td>
|
||||||
<td><?= $summary['totalUnits'] ?></td>
|
<td class="celda_normal "><?= $summary['totalUnits'] ?></td>
|
||||||
<td><?= $summary['averagePf'] ?></td>
|
<td class="celda_normal "><?= $summary['averagePf'] ?></td>
|
||||||
<td><?= $summary['presentPf'] ?></td>
|
<td class="celda_normal "><?= $summary['presentPf'] ?></td>
|
||||||
<td><?= $summary['md'] ?></td>
|
<td class="celda_normal "><?= $summary['md'] ?></td>
|
||||||
<td><?= $summary['mf'] ?></td>
|
<td class="celda_normal "><?= $summary['mf'] ?></td>
|
||||||
|
|
||||||
<?php foreach ($summary as $each) {
|
<?php foreach ($summary as $each) {
|
||||||
if (is_array($each)) {
|
if (is_array($each)) {
|
||||||
@ -745,11 +721,7 @@ foreach ($period as $day) {
|
|||||||
?>
|
?>
|
||||||
|
|
||||||
</tr>
|
</tr>
|
||||||
|
</tfoot>
|
||||||
|
|
||||||
</tbody>
|
|
||||||
</table>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- this else condition work if groupedpowerStockDetails is empty and creating new records
|
<!-- this else condition work if groupedpowerStockDetails is empty and creating new records
|
||||||
with initial values 0 for entire month -->
|
with initial values 0 for entire month -->
|
||||||
@ -786,7 +758,8 @@ foreach ($period as $day) {
|
|||||||
oninput="openingTPStockChange(this)"
|
oninput="openingTPStockChange(this)"
|
||||||
contenteditable="true"
|
contenteditable="true"
|
||||||
|
|
||||||
<?php } ?>><?php
|
<?php } ?>>
|
||||||
|
<?php
|
||||||
if (empty($previousMonthTotalPowerMachineStockDetails)) {
|
if (empty($previousMonthTotalPowerMachineStockDetails)) {
|
||||||
echo " ";
|
echo " ";
|
||||||
} else {
|
} else {
|
||||||
@ -794,6 +767,8 @@ foreach ($period as $day) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|
||||||
|
|
||||||
</td>
|
</td>
|
||||||
|
|
||||||
|
|
||||||
@ -859,11 +834,19 @@ foreach ($period as $day) {
|
|||||||
<?php } ?>
|
<?php } ?>
|
||||||
|
|
||||||
data-id="<?= $dateInMonth ?> <?= $powerMachine['id'] ?>">
|
data-id="<?= $dateInMonth ?> <?= $powerMachine['id'] ?>">
|
||||||
<?= (!empty($previousMonthPowerConsumptionStockDetails) && isset($previousMonthPowerConsumptionStockDetails[$powerMachineIndex]))
|
|
||||||
? $previousMonthPowerConsumptionStockDetails[$powerMachineIndex]['closing_units']
|
|
||||||
: " ";
|
|
||||||
|
|
||||||
|
|
||||||
|
<?php
|
||||||
|
foreach($previousMonthPowerConsumptionStockDetails as $index => $previousMonthPowerConsumptionStockDetail)
|
||||||
|
{
|
||||||
|
if($previousMonthPowerConsumptionStockDetail['machine_id'] == $powerMachine['id']){
|
||||||
|
echo $previousMonthPowerConsumptionStockDetail['closing_units'] ;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
?>
|
?>
|
||||||
|
|
||||||
</td>
|
</td>
|
||||||
|
|
||||||
<td class="celda_normal closingUnits"
|
<td class="celda_normal closingUnits"
|
||||||
@ -871,11 +854,17 @@ foreach ($period as $day) {
|
|||||||
oninput="closingUnitsChange(this)"
|
oninput="closingUnitsChange(this)"
|
||||||
contenteditable="true">
|
contenteditable="true">
|
||||||
|
|
||||||
<?= (!empty($previousMonthPowerConsumptionStockDetails) && isset($previousMonthPowerConsumptionStockDetails[$powerMachineIndex]))
|
<?php
|
||||||
? $previousMonthPowerConsumptionStockDetails[$powerMachineIndex]['closing_units']
|
foreach($previousMonthPowerConsumptionStockDetails as $index => $previousMonthPowerConsumptionStockDetail)
|
||||||
: " ";
|
{
|
||||||
|
if($previousMonthPowerConsumptionStockDetail['machine_id'] == $powerMachine['id']){
|
||||||
|
echo $previousMonthPowerConsumptionStockDetail['closing_units'] ;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
?>
|
?>
|
||||||
|
|
||||||
</td>
|
</td>
|
||||||
|
|
||||||
<td class="celda_normal totalUnits"
|
<td class="celda_normal totalUnits"
|
||||||
|
|||||||
@ -235,6 +235,10 @@
|
|||||||
min-width: 100px;
|
min-width: 100px;
|
||||||
max-width: 100px;
|
max-width: 100px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
tfoot tr {
|
||||||
|
background-color:rgb(235, 236, 203);
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
|
|
||||||
@ -569,21 +573,7 @@ foreach ($period as $day) {
|
|||||||
<?php } ?>
|
<?php } ?>
|
||||||
|
|
||||||
|
|
||||||
<div class="table-responsive">
|
<tfoot>
|
||||||
<table id="resinStockDetailsTableSummaryId" class="fht-table table-striped">
|
|
||||||
|
|
||||||
<thead>
|
|
||||||
<th class="celda_encabezado_total">Total Sum</th>
|
|
||||||
<?php foreach ($summary as $each) { ?>
|
|
||||||
<th class="celda_encabezado_total">Opening Stock</th>
|
|
||||||
<th class="celda_encabezado_total">Receipt</th>
|
|
||||||
<th class="celda_encabezado_total">Used</th>
|
|
||||||
<th class="celda_encabezado_total">Balance Stock</th>
|
|
||||||
<?php } ?>
|
|
||||||
</thead>
|
|
||||||
|
|
||||||
<tbody>
|
|
||||||
|
|
||||||
<tr>
|
<tr>
|
||||||
|
|
||||||
<td style="background-color:rgb(189, 9, 6); color:#ffff;">
|
<td style="background-color:rgb(189, 9, 6); color:#ffff;">
|
||||||
@ -601,12 +591,9 @@ foreach ($period as $day) {
|
|||||||
<?php } ?>
|
<?php } ?>
|
||||||
|
|
||||||
</tr>
|
</tr>
|
||||||
|
</tfoot>
|
||||||
|
|
||||||
|
|
||||||
</tbody>
|
|
||||||
</table>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- this else condition work if groupedBagStockDetails is empty and creating new records
|
<!-- this else condition work if groupedBagStockDetails is empty and creating new records
|
||||||
with initial values 0 for entire month -->
|
with initial values 0 for entire month -->
|
||||||
<?php } else { ?>
|
<?php } else { ?>
|
||||||
@ -659,7 +646,20 @@ foreach ($period as $day) {
|
|||||||
oninput="openingStockChange(this)"
|
oninput="openingStockChange(this)"
|
||||||
contenteditable="true"
|
contenteditable="true"
|
||||||
|
|
||||||
<?php } ?>><?= $previousMonthResinStockDetails[$resinMaterialIndex]['balanceStock'] ?? ' ' ?></td>
|
<?php } ?>>
|
||||||
|
|
||||||
|
<?php
|
||||||
|
foreach($previousMonthResinStockDetails as $index => $previousMonthResinStockDetail)
|
||||||
|
{
|
||||||
|
if($previousMonthResinStockDetail['materialCode'] == $resinMaterial['MaterialCode']){
|
||||||
|
echo $previousMonthResinStockDetail['balanceStock'] ;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
|
||||||
|
</td>
|
||||||
|
|
||||||
<td class="celda_normal receiptStock"
|
<td class="celda_normal receiptStock"
|
||||||
data-id="<?= $dateInMonth ?> <?= $resinMaterial['MaterialCode'] ?>"
|
data-id="<?= $dateInMonth ?> <?= $resinMaterial['MaterialCode'] ?>"
|
||||||
@ -672,7 +672,20 @@ foreach ($period as $day) {
|
|||||||
contenteditable="true"> <?= ' ' ?> </td>
|
contenteditable="true"> <?= ' ' ?> </td>
|
||||||
|
|
||||||
<td class="celda_normal balanceStock"
|
<td class="celda_normal balanceStock"
|
||||||
data-id="<?= $dateInMonth ?> <?= $resinMaterial['MaterialCode'] ?>"><?= $previousMonthResinStockDetails[$resinMaterialIndex]['balanceStock'] ?? ' ' ?></td>
|
data-id="<?= $dateInMonth ?> <?= $resinMaterial['MaterialCode'] ?>">
|
||||||
|
|
||||||
|
<?php
|
||||||
|
foreach($previousMonthResinStockDetails as $index => $previousMonthResinStockDetail)
|
||||||
|
{
|
||||||
|
if($previousMonthResinStockDetail['materialCode'] == $resinMaterial['MaterialCode']){
|
||||||
|
echo $previousMonthResinStockDetail['balanceStock'] ;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
|
||||||
|
</td>
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
</tr>
|
</tr>
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
|
|||||||
@ -230,6 +230,10 @@
|
|||||||
min-height: 200px;
|
min-height: 200px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
tfoot tr {
|
||||||
|
background-color:rgb(235, 236, 203);
|
||||||
|
}
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
|
|
||||||
@ -1004,151 +1008,7 @@ $timeOtions[] = "12:00 AM";
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
<table id="trpProductionStockSummaryTableId" class="fht-table table-striped">
|
<tfoot>
|
||||||
|
|
||||||
<thead class="celda_encabezado_general" style="padding: 10px;">
|
|
||||||
|
|
||||||
<tr>
|
|
||||||
<!-- th:eq(0) -->
|
|
||||||
<th class="celda_encabezado_total" rowspan="2">Date </th>
|
|
||||||
<!-- th:eq(1) -->
|
|
||||||
<th class="celda_encabezado_total" rowspan="2">Opening Time </th>
|
|
||||||
<!-- th:eq(2) -->
|
|
||||||
<th class="celda_encabezado_total" rowspan="2">Closing Time </th>
|
|
||||||
<!-- th:eq(3) -->
|
|
||||||
<th class="celda_encabezado_total" rowspan="2">Total Hours </th>
|
|
||||||
<!-- th:eq(4) -->
|
|
||||||
<th class="celda_encabezado_total" rowspan="2">Cold Start </th>
|
|
||||||
<!-- th:eq(5) -->
|
|
||||||
<th class="celda_encabezado_total" rowspan="2">Break Down Hours </th>
|
|
||||||
<!-- th:eq(6) -->
|
|
||||||
<th class="celda_encabezado_total" rowspan="2">Burner Firing Hours </th>
|
|
||||||
<!-- th:eq(7) -->
|
|
||||||
<th class="celda_encabezado_total" rowspan="2">Sand Feeding Hours </th>
|
|
||||||
<!-- th:eq(8) -->
|
|
||||||
<th class="celda_encabezado_total" colspan="2">Gas Receipt </th>
|
|
||||||
<!-- th:eq(9) -->
|
|
||||||
<th class="celda_encabezado_total" rowspan="2">Physical Gas Consumption </th>
|
|
||||||
<!-- th:eq(10) -->
|
|
||||||
<th class="celda_encabezado_total" rowspan="2">Drier Gas Consumption </th>
|
|
||||||
<!-- th:eq(11) -->
|
|
||||||
<th class="celda_encabezado_total" rowspan="2">Coating Gas Consumption </th>
|
|
||||||
<!-- th:eq(12) -->
|
|
||||||
<th class="celda_encabezado_total" rowspan="2">TRP plus Drier Gas Consumption </th>
|
|
||||||
<!-- th:eq(13) -->
|
|
||||||
<th class="celda_encabezado_total" rowspan="2">TRP Physical Gas Per Ton </th>
|
|
||||||
<!-- th:eq(14) -->
|
|
||||||
<th class="celda_encabezado_total" rowspan="2">Panel Gas Consumption </th>
|
|
||||||
<!-- th:eq(15) -->
|
|
||||||
<th class="celda_encabezado_total" rowspan="2">Panel Gas Per Ton </th>
|
|
||||||
|
|
||||||
<!-- th:eq(16) -->
|
|
||||||
|
|
||||||
<?php if(count($wcsSupplierList)>0){?>
|
|
||||||
<th class="celda_encabezado_total" colspan="<?=count($wcsSupplierList)?>">Incoming Sand/ Lump details </th>
|
|
||||||
<?php } ?>
|
|
||||||
|
|
||||||
<!-- th:eq(17) -->
|
|
||||||
<th class="celda_encabezado_total" colspan="3">ED details </th>
|
|
||||||
<!-- th:eq(18) -->
|
|
||||||
<th class="celda_encabezado_total" colspan="2">TRP Sand </th>
|
|
||||||
|
|
||||||
<th class="celda_encabezado_total" rowspan="2">Coating </th>
|
|
||||||
|
|
||||||
<!-- th:eq(19) -->
|
|
||||||
|
|
||||||
<?php if(count($crsClientList)>0){?>
|
|
||||||
<th class="celda_encabezado_total" colspan="<?=count($crsClientList)?>">Usage </th>
|
|
||||||
<?php } ?>
|
|
||||||
|
|
||||||
<!-- th:eq(20) -->
|
|
||||||
<th class="celda_encabezado_total" colspan="2">Water </th>
|
|
||||||
<!-- th:eq(21) -->
|
|
||||||
<th class="celda_encabezado_total" rowspan="2">EB Reading </th>
|
|
||||||
<!-- th:eq(22) -->
|
|
||||||
<th class="celda_encabezado_total" rowspan="2">EB Unit Per Ton </th>
|
|
||||||
<!-- th:eq(23) -->
|
|
||||||
<th class="celda_encabezado_total" colspan="4">Working Persons </th>
|
|
||||||
<!-- th:eq(24) -->
|
|
||||||
<th class="celda_encabezado_total" colspan="2"> Maintanence Details </th>
|
|
||||||
<!-- th:eq(25) -->
|
|
||||||
<th class="celda_encabezado_total" rowspan="2">Description </th>
|
|
||||||
<!-- th:eq(26) -->
|
|
||||||
<th class="celda_encabezado_total" rowspan="2">MS Seperation </th>
|
|
||||||
<!-- th:eq(27) -->
|
|
||||||
<th class="celda_encabezado_total" rowspan="2">ED Waste </th>
|
|
||||||
<!-- th:eq(28) -->
|
|
||||||
<th class="celda_encabezado_total" rowspan="2">Cooler Bags </th>
|
|
||||||
<!-- th:eq(29) -->
|
|
||||||
<th class="celda_encabezado_total" rowspan="2">ED +20 Waste </th>
|
|
||||||
<!-- th:eq(30) -->
|
|
||||||
<th class="celda_encabezado_total" rowspan="2">Cyclone Waste </th>
|
|
||||||
|
|
||||||
|
|
||||||
</tr>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<tr>
|
|
||||||
<!-- th:eq(0) -->
|
|
||||||
<th class="celda_encabezado_total" style="z-index:11;">BG</th>
|
|
||||||
<!-- th:eq(1) -->
|
|
||||||
<th class="celda_encabezado_total">PG </th>
|
|
||||||
|
|
||||||
<?php foreach($wcsSupplierList as $supplier){ ?>
|
|
||||||
|
|
||||||
<th class="celda_encabezado_total"><?=$supplier?> </th>
|
|
||||||
|
|
||||||
<?php } ?>
|
|
||||||
|
|
||||||
<!-- th:eq(10) -->
|
|
||||||
<th class="celda_encabezado_total">Running Hours </th>
|
|
||||||
<!-- th:eq(11) -->
|
|
||||||
<th class="celda_encabezado_total">Production </th>
|
|
||||||
<!-- th:eq(12) -->
|
|
||||||
<th class="celda_encabezado_total">Usage </th>
|
|
||||||
<!-- th:eq(13) -->
|
|
||||||
<th class="celda_encabezado_total">Production </th>
|
|
||||||
<!-- th:eq(14) -->
|
|
||||||
<th class="celda_encabezado_total">Production Per Hour </th>
|
|
||||||
<!-- th:eq(15) -->
|
|
||||||
|
|
||||||
<!-- th:eq(16) -->
|
|
||||||
|
|
||||||
<?php foreach($crsClientList as $client){ ?>
|
|
||||||
|
|
||||||
<th class="celda_encabezado_total"><?=$client?> </th>
|
|
||||||
|
|
||||||
<?php } ?>
|
|
||||||
|
|
||||||
|
|
||||||
<!-- th:eq(21) -->
|
|
||||||
<th class="celda_encabezado_total">Receipt </th>
|
|
||||||
<!-- th:eq(22) -->
|
|
||||||
<th class="celda_encabezado_total">Consumption </th>
|
|
||||||
<!-- th:eq(23) -->
|
|
||||||
<th class="celda_encabezado_total">Engineers </th>
|
|
||||||
<!-- th:eq(24) -->
|
|
||||||
<th class="celda_encabezado_total">Supervisors</th>
|
|
||||||
<!-- th:eq(25) -->
|
|
||||||
<th class="celda_encabezado_total">Operators </th>
|
|
||||||
<!-- th:eq(26) -->
|
|
||||||
<th class="celda_encabezado_total">Roller Drivers </th>
|
|
||||||
<!-- th:eq(27) -->
|
|
||||||
<th class="celda_encabezado_total">Nature Of Maintenance </th>
|
|
||||||
<!-- th:eq(28) -->
|
|
||||||
<th class="celda_encabezado_total">Location </th>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</tr>
|
|
||||||
|
|
||||||
|
|
||||||
</thead>
|
|
||||||
|
|
||||||
<tbody style="background-color: #fff;">
|
|
||||||
|
|
||||||
|
|
||||||
<tr>
|
<tr>
|
||||||
|
|
||||||
<!-- Total -->
|
<!-- Total -->
|
||||||
@ -1415,10 +1275,7 @@ $timeOtions[] = "12:00 AM";
|
|||||||
</td>
|
</td>
|
||||||
|
|
||||||
</tr>
|
</tr>
|
||||||
|
</tfoot>
|
||||||
|
|
||||||
</tbody>
|
|
||||||
</table>
|
|
||||||
|
|
||||||
<br><br><br>
|
<br><br><br>
|
||||||
|
|
||||||
|
|||||||
@ -222,6 +222,11 @@
|
|||||||
min-width: 150px;
|
min-width: 150px;
|
||||||
max-width: 150px;
|
max-width: 150px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
tfoot tr {
|
||||||
|
background-color:rgb(235, 236, 203);
|
||||||
|
}
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
|
|
||||||
@ -378,38 +383,30 @@
|
|||||||
|
|
||||||
} ?>
|
} ?>
|
||||||
|
|
||||||
<div class="table-responsive" >
|
<tfoot>
|
||||||
|
|
||||||
<table id="trpSandUseStockDetailsTableSummaryId" class="fht-table table-striped">
|
<tr class="total_row">
|
||||||
|
|
||||||
<thead >
|
|
||||||
<th class="celda_encabezado_total" >Total </th>
|
|
||||||
<th class="celda_encabezado_total" >Rough Kgs </th>
|
|
||||||
<th class="celda_encabezado_total" >Fine Kgs </th>
|
|
||||||
<th class="celda_encabezado_total" >Total Kgs </th>
|
|
||||||
</thead>
|
|
||||||
|
|
||||||
<tbody>
|
|
||||||
|
|
||||||
<tr>
|
|
||||||
|
|
||||||
<td style="background-color:rgb(189, 9, 6); color:#ffff;">
|
<td style="background-color:rgb(189, 9, 6); color:#ffff;">
|
||||||
<b> Total </b>
|
<b> Total </b>
|
||||||
</td>
|
</td>
|
||||||
|
|
||||||
<td class="celda_normal "><?=$summary['rough_kgs']?></td>
|
<td class="celda_normal "><b><?=$summary['rough_kgs']?></b></td>
|
||||||
<td class="celda_normal "><?=$summary['fine_kgs']?></td>
|
<td class="celda_normal "><b><?=$summary['fine_kgs']?></b></td>
|
||||||
<td class="celda_normal "><?=$summary['total_kgs']?></td>
|
<td class="celda_normal "><b><?=$summary['total_kgs']?></b></td>
|
||||||
|
<td class="celda_normal "> </td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
|
|
||||||
</tbody>
|
</tfoot>
|
||||||
</table>
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<?php }else{
|
<?php }else{
|
||||||
|
|
||||||
$date = DateTime::createFromFormat('M-Y', $month);
|
$date = DateTime::createFromFormat('M-Y', $month);
|
||||||
|
|||||||
@ -226,9 +226,9 @@
|
|||||||
<!-- Rec qty changed to invoice qty -->
|
<!-- Rec qty changed to invoice qty -->
|
||||||
<th>Invoice Qty</th>
|
<th>Invoice Qty</th>
|
||||||
<th>Net weight</th>
|
<th>Net weight</th>
|
||||||
<th>Taxable Amt</th>
|
<!-- <th>Taxable Amt</th>
|
||||||
<th>Tax Amt</th>
|
<th>Tax Amt</th>
|
||||||
<th>Total Amt</th>
|
<th>Total Amt</th> -->
|
||||||
<th>Vechicle No</th>
|
<th>Vechicle No</th>
|
||||||
<th>Driver</th>
|
<th>Driver</th>
|
||||||
<th>Transporter</th>
|
<th>Transporter</th>
|
||||||
@ -281,9 +281,9 @@
|
|||||||
<td align="right"><?php echo (int)$record->ReceivedQuantity ?></td>
|
<td align="right"><?php echo (int)$record->ReceivedQuantity ?></td>
|
||||||
|
|
||||||
<td align="right"><?php echo (int)$record->NetWeight ?></td>
|
<td align="right"><?php echo (int)$record->NetWeight ?></td>
|
||||||
<td align="right"><?php echo (int)$record->taxable_value ?></td>
|
<!-- <td align="right"><?php echo (int)$record->taxable_value ?></td>
|
||||||
<td align="right"><?php echo (int)$record->gst_amount ?></td>
|
<td align="right"><?php echo (int)$record->gst_amount ?></td>
|
||||||
<td align="right"><?php echo ((int)$record->taxable_value + (int)$record->gst_amount) ?></td>
|
<td align="right"><?php echo ((int)$record->taxable_value + (int)$record->gst_amount) ?></td> -->
|
||||||
|
|
||||||
<td><?php echo $record->VehicleNo ?></td>
|
<td><?php echo $record->VehicleNo ?></td>
|
||||||
<td><?php echo $record->DriverName ?></td>
|
<td><?php echo $record->DriverName ?></td>
|
||||||
|
|||||||
@ -25,7 +25,6 @@
|
|||||||
"kint-php/kint": "^5.0.4",
|
"kint-php/kint": "^5.0.4",
|
||||||
"mikey179/vfsstream": "^1.6",
|
"mikey179/vfsstream": "^1.6",
|
||||||
"nexusphp/cs-config": "^3.6",
|
"nexusphp/cs-config": "^3.6",
|
||||||
"phpunit/phpunit": "^10.5.16",
|
|
||||||
"predis/predis": "^1.1 || ^2.0"
|
"predis/predis": "^1.1 || ^2.0"
|
||||||
},
|
},
|
||||||
"suggest": {
|
"suggest": {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user