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('deleteAttachment', 'Sales::deleteAttachment');
|
||||
$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('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'],'credit_notes', 'Sales::credit_notes');
|
||||
|
||||
// transporter Routes
|
||||
$routes->match(['GET', 'POST'],'transporterListing', 'Supplier::transporterListing');
|
||||
|
||||
@ -6,6 +6,7 @@ use App\Controllers\BaseController;
|
||||
|
||||
use App\Models\Ipinvoice_model;
|
||||
use App\Models\Ipattachment_model;
|
||||
use App\Models\CreditNoteModel;
|
||||
require_once 'vendor/autoload.php';
|
||||
|
||||
use PhpOffice\PhpSpreadsheet\Spreadsheet;
|
||||
@ -15,6 +16,7 @@ class Sales extends BaseController
|
||||
{
|
||||
protected $ipinvoice_model;
|
||||
protected $ipattachment_model;
|
||||
protected $CreditNoteModel;
|
||||
protected $session;
|
||||
|
||||
public function __construct()
|
||||
@ -22,6 +24,7 @@ class Sales extends BaseController
|
||||
parent::__construct();
|
||||
$this->ipinvoice_model = new Ipinvoice_model();
|
||||
$this->ipattachment_model = new Ipattachment_model();
|
||||
$this->CreditNoteModel = new CreditNoteModel();
|
||||
$this->session = session();
|
||||
$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()
|
||||
{
|
||||
$headline = '';
|
||||
|
||||
@ -146,25 +146,38 @@ class StockController extends BaseController
|
||||
//incoming Silica Sand Details starts
|
||||
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') {
|
||||
|
||||
//getting remark value which is used to specify the issd entry is accepted/rejected/conditionally accepted..
|
||||
$remark = $this->request->getPost('remark');
|
||||
|
||||
|
||||
$month = $this->request->getPost('month');
|
||||
|
||||
//formatting the date format of Jan-2025 to 2025-01
|
||||
$date = DateTime::createFromFormat('M-Y', $month);
|
||||
|
||||
$formattedDate = $date->format('Y-m');
|
||||
|
||||
|
||||
$month = $formattedDate;
|
||||
|
||||
//setting session for any month change
|
||||
$session = session ();
|
||||
|
||||
$session->set('stock_month',$month);
|
||||
|
||||
|
||||
} else {
|
||||
|
||||
//if request is in get method getting remark in query params in new_header.php file(navbar)
|
||||
|
||||
$remark = $this->request->getVar('remark');
|
||||
|
||||
$session = session();
|
||||
@ -172,21 +185,25 @@ class StockController extends BaseController
|
||||
$month = $session->get('stock_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;
|
||||
|
||||
//set page title
|
||||
$this->global['pageTitle'] = 'Incoming Silica Sand Details';
|
||||
|
||||
$materialCodes = [];
|
||||
|
||||
//getting all silica sand raw materials material code
|
||||
$silicaSandMaterialCodes = $this->rawmaterialdetails_model->getAllSilicaRawMaterialCode();
|
||||
|
||||
$materialCodes [] = $silicaSandMaterialCodes;
|
||||
|
||||
//getting all waste Core Sand Material Codes
|
||||
$wasteCoreSandMaterialCodes = $this->rawmaterialdetails_model->getAllWasteCoreSandMaterialCode();
|
||||
|
||||
$materialCodes [] = $wasteCoreSandMaterialCodes;
|
||||
@ -195,6 +212,7 @@ class StockController extends BaseController
|
||||
|
||||
|
||||
if (!empty($materialCodes)) {
|
||||
//remark filter may apply or not
|
||||
$data['igrDetails'] = $this->inwardGateRegister_model->findIgrDetailsForIncomingSilicaSand($materialCodes, $month, $remark);
|
||||
} else {
|
||||
$data['igrDetails'] = [];
|
||||
@ -202,11 +220,11 @@ class StockController extends BaseController
|
||||
|
||||
$data['testedBy'] = [];
|
||||
|
||||
$DesignationConfigID = 'C010';
|
||||
//['lab assistant', 'factory manager', 'lab head']
|
||||
$data['testedBy'] = $this->employeedetails_model->incomingSilicaSandTestedBy();
|
||||
|
||||
$data['testedBy'] = $this->employeedetails_model->incomingSilicaSandTestedBy($DesignationConfigID);
|
||||
|
||||
$data['approvedBy'] = $this->employeedetails_model->incomingSilicaSandApprovedBy($DesignationConfigID);
|
||||
//['factory manager', 'lab head']
|
||||
$data['approvedBy'] = $this->employeedetails_model->incomingSilicaSandApprovedBy();
|
||||
|
||||
|
||||
$date = DateTime::createFromFormat('Y-m', $month);
|
||||
@ -220,6 +238,7 @@ class StockController extends BaseController
|
||||
return $this->loadViews("stock/incomingSilicaSandDetails", $this->global, $data, NULL);
|
||||
}
|
||||
|
||||
|
||||
public function updateIncomingSilicaSandDetails()
|
||||
{
|
||||
|
||||
@ -290,6 +309,8 @@ class StockController extends BaseController
|
||||
echo "Data Saved Successfully";
|
||||
}
|
||||
|
||||
|
||||
//This is particulary updated by the lab technichians
|
||||
public function updateLabReport()
|
||||
{
|
||||
|
||||
@ -353,115 +374,143 @@ class StockController extends BaseController
|
||||
//Drier machine details
|
||||
public function drierMachineDetails()
|
||||
{
|
||||
|
||||
|
||||
//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..!!
|
||||
|
||||
// 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.
|
||||
|
||||
|
||||
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');
|
||||
|
||||
$date = DateTime::createFromFormat('M-Y', $currentMonth); //in M-Y format
|
||||
|
||||
$formattedDate = $date->format('Y-m'); //in Y-m format
|
||||
|
||||
|
||||
$session = session ();
|
||||
|
||||
$session->set('stock_month',$formattedDate);
|
||||
|
||||
|
||||
} else {
|
||||
|
||||
|
||||
// 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');
|
||||
|
||||
|
||||
$session = session();
|
||||
|
||||
$session->set('stock_month', $formattedDate);
|
||||
|
||||
} else {
|
||||
|
||||
$session = session();
|
||||
|
||||
$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)) {
|
||||
$currentMonth = date('M-Y'); // Default to the current month
|
||||
}else{
|
||||
$currentMonth = DateTime::createFromFormat('Y-m', $currentMonth); // in Y-m format
|
||||
|
||||
$currentMonth = $currentMonth->format('M-Y'); // in M-Y format
|
||||
$currentMonth = date('M-Y');
|
||||
} else {
|
||||
// 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');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Retrieve the list of dates for the selected month in database-compatible format
|
||||
$monthData = $this->getMonthDatesFromInput($currentMonth);
|
||||
|
||||
$isActiveFilter = 1 ;
|
||||
$data['startDate'] = $monthData[0]['database'];
|
||||
$data['endDate'] = $monthData[count($monthData) - 1]['database'];
|
||||
|
||||
|
||||
// Set the active filter for suppliers (1 means active suppliers will be fetched)
|
||||
$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['supplierData'] = $this->supplier_model->supplierlisting($isActiveFilter);
|
||||
|
||||
|
||||
// Retrieve drier machine details for the selected date range
|
||||
$data['drierDetails'] = $this->drierMachineDetails_model
|
||||
->where('date >=', $data['startDate'])
|
||||
->where('date <=', $data['endDate'])
|
||||
->orderBy('date','asc')
|
||||
->findAll();
|
||||
|
||||
|
||||
->where('date >=', $data['startDate'])
|
||||
->where('date <=', $data['endDate'])
|
||||
->orderBy('date', 'asc')
|
||||
->findAll();
|
||||
|
||||
|
||||
$data['datefordropdown'] = $currentMonth;
|
||||
|
||||
|
||||
// Set the page title for display
|
||||
$this->global['pageTitle'] = 'Drier Details';
|
||||
|
||||
$this->loadViews("stock/drierMachineDetails", $this->global, $data, NULL);
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
public function addOrEditdrierMachineDetails()
|
||||
{
|
||||
|
||||
// Retrieve form data from the POST request
|
||||
$data = $this->request->getPost();
|
||||
|
||||
$data = $this->request->getPost();
|
||||
|
||||
$drierData[] = $this->mapDrierEntry($data);
|
||||
|
||||
// Map the received data into a structured format using the helper function `mapDrierEntry`
|
||||
$drierData[] = $this->mapDrierEntry($data);
|
||||
|
||||
// Begin a database transaction to ensure atomicity
|
||||
$this->db->transBegin();
|
||||
|
||||
try {
|
||||
// Arrays to store data for batch insert and batch update operations
|
||||
$inserts = [];
|
||||
$updates = [];
|
||||
|
||||
|
||||
foreach ($drierData as $row) {
|
||||
// Retrieve the ID of the existing entry (if present)
|
||||
$existingRow = $row['id'];
|
||||
$data = $row;
|
||||
|
||||
$data = $row;
|
||||
|
||||
if (($existingRow)) {
|
||||
if ($existingRow) {
|
||||
|
||||
$existingRow = $this->drierMachineDetails_model->where('id', $row['id'] ?? '')->first();
|
||||
|
||||
|
||||
// Handle gas stock updates for the existing record
|
||||
$this->handleGasStockUpdate($existingRow, $row);
|
||||
|
||||
|
||||
$updates[] = $data;
|
||||
} else {
|
||||
// If it's a new record, update gas stock consumption before inserting
|
||||
$this->updateGasStockConsumption($data['date'], $data['total_gas_consumption']);
|
||||
|
||||
|
||||
$inserts[] = $data;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (!empty($inserts)) {
|
||||
$this->drierMachineDetails_model->insertBatch($inserts);
|
||||
}
|
||||
|
||||
|
||||
if (!empty($updates)) {
|
||||
$this->drierMachineDetails_model->updateBatch($updates, 'id');
|
||||
}
|
||||
|
||||
// Check if the transaction encountered any database errors
|
||||
if ($this->db->transStatus() === false) {
|
||||
throw new \Exception('Transaction failed due to database error.');
|
||||
}
|
||||
|
||||
|
||||
$this->db->transCommit();
|
||||
|
||||
return redirect()->to("/drierMachineDetails")->with('success', "Data Saved Successfully");
|
||||
|
||||
} catch (\Exception $error) {
|
||||
$this->db->transRollback();
|
||||
return redirect()->back()->with('error', ' ' . $error->getMessage());
|
||||
}
|
||||
|
||||
|
||||
return redirect()->to("/drierMachineDetails")->with('success', "Data Saved Successfully");
|
||||
|
||||
} catch (\Exception $error) {
|
||||
// Rollback the transaction in case of an error
|
||||
$this->db->transRollback();
|
||||
|
||||
return redirect()->back()->with('error', ' ' . $error->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Maps input row to expected format.
|
||||
*/
|
||||
@ -491,160 +540,145 @@ class StockController extends BaseController
|
||||
//Coating Machine Details starts
|
||||
public function loadView_coatingMachineDetails()
|
||||
{
|
||||
|
||||
if ($this->request->getMethod() === 'POST') {
|
||||
|
||||
// Get the month from the request
|
||||
$month = $this->request->getPost('month');
|
||||
|
||||
|
||||
// Convert month format from "M-Y" to "Y-m"
|
||||
$date = DateTime::createFromFormat('M-Y', $month);
|
||||
|
||||
$formattedDate = $date->format('Y-m');
|
||||
|
||||
$month = $formattedDate;
|
||||
|
||||
$session = session ();
|
||||
|
||||
$session->set('stock_month',$month);
|
||||
|
||||
} else {
|
||||
|
||||
|
||||
// Store selected month in session
|
||||
$session = session();
|
||||
$session->set('stock_month', $month);
|
||||
|
||||
} else {
|
||||
$session = session();
|
||||
|
||||
$month = $session->get('stock_month');
|
||||
|
||||
|
||||
// Default to the current month if no month is stored in session
|
||||
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";
|
||||
$endDate = date("Y-m-t", strtotime($startDate));
|
||||
|
||||
// Fetch coating machine details with batch card file details
|
||||
$data['coatingMachineDetails'] = $this->coatingMachineDetails_model
|
||||
->select('t_coatingmachinedetails.*,
|
||||
JSON_ARRAYAGG(
|
||||
JSON_OBJECT(
|
||||
"client_given_name", t_batchcard_files.client_file_name,
|
||||
"filename", t_batchcard_files.filename,
|
||||
"batchCardId" , t_batchcard_files.id,
|
||||
"coating_id", t_batchcard_files.coating_id
|
||||
)
|
||||
) as batchcard_files')
|
||||
->join('t_batchcard_files', 't_batchcard_files.coating_id = t_coatingmachinedetails.id', 'left')
|
||||
->where('t_coatingmachinedetails.date >=', $startDate)
|
||||
->where('t_coatingmachinedetails.date <=', $endDate)
|
||||
->groupBy('t_coatingmachinedetails.id')
|
||||
->orderBy('t_coatingmachinedetails.date', 'asc')
|
||||
->findAll();
|
||||
|
||||
|
||||
->select('t_coatingmachinedetails.*,
|
||||
JSON_ARRAYAGG(
|
||||
JSON_OBJECT(
|
||||
"client_given_name", t_batchcard_files.client_file_name,
|
||||
"filename", t_batchcard_files.filename,
|
||||
"batchCardId" , t_batchcard_files.id,
|
||||
"coating_id", t_batchcard_files.coating_id
|
||||
)
|
||||
) as batchcard_files')
|
||||
->join('t_batchcard_files', 't_batchcard_files.coating_id = t_coatingmachinedetails.id', 'left')
|
||||
->where('t_coatingmachinedetails.date >=', $startDate)
|
||||
->where('t_coatingmachinedetails.date <=', $endDate)
|
||||
->groupBy('t_coatingmachinedetails.id')
|
||||
->orderBy('t_coatingmachinedetails.date', 'asc')
|
||||
->findAll();
|
||||
|
||||
// Convert month format from "Y-m" to "M-Y" for display
|
||||
$date = DateTime::createFromFormat('Y-m', $month);
|
||||
|
||||
$formattedDate = $date->format('M-Y');
|
||||
|
||||
$data['month'] = $formattedDate;
|
||||
|
||||
|
||||
// Load the view with the required data
|
||||
return $this->loadViews("stock/CoatingMachineDetail", $this->global, $data, NULL);
|
||||
}
|
||||
|
||||
|
||||
public function addNewCoatingMachineDetails()
|
||||
{
|
||||
$message1 = '';
|
||||
$message2 = '';
|
||||
$message3 = '';
|
||||
|
||||
|
||||
$postData = $this->request->getPost();
|
||||
|
||||
$date = $postData['date'];
|
||||
$shift = $postData['shift'];
|
||||
|
||||
|
||||
// Check if the same shift already exists on the same date
|
||||
$sameShiftOnDateExists = $this->coatingMachineDetails_model
|
||||
->where('date', $date)
|
||||
->where('shift', $shift)
|
||||
->where('is_active', 1)
|
||||
->first();
|
||||
|
||||
|
||||
if (!empty($sameShiftOnDateExists)) {
|
||||
return redirect()->back()->with('error', 'Already same shift exists on the same date ..!!');
|
||||
}
|
||||
|
||||
|
||||
// Start transaction
|
||||
$this->db->transBegin();
|
||||
|
||||
|
||||
try {
|
||||
// Insert into coating machine details table
|
||||
// Insert data into coating machine details table
|
||||
$insertedId = $this->coatingMachineDetails_model->insert($postData);
|
||||
|
||||
|
||||
if ($insertedId !== false && $insertedId > 0) {
|
||||
|
||||
$message1 = 'Coating Machine details updated successfully';
|
||||
|
||||
|
||||
// Update gas stock consumption
|
||||
$dateToBeInserted = $postData['date'];
|
||||
$consumption = $postData['totalGasConsumption'];
|
||||
$updatedResult = $this->updateGasStockConsumption($dateToBeInserted, $consumption);
|
||||
|
||||
|
||||
if ($updatedResult === false || $updatedResult <= 0) {
|
||||
// Explicit failure handling for gas stock update
|
||||
throw new \Exception('Failed to update 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..!!";
|
||||
} else {
|
||||
throw new \Exception('Failed to insert Coating machine details.');
|
||||
}
|
||||
|
||||
|
||||
// Handle batch card file uploads
|
||||
if ($insertedId !== false && $insertedId > 0) {
|
||||
|
||||
$batchCardFiles = $this->request->getFileMultiple('batchCard');
|
||||
|
||||
|
||||
if (!empty($batchCardFiles) && !($batchCardFiles[0]->getError() === UPLOAD_ERR_NO_FILE)) {
|
||||
|
||||
|
||||
foreach ($batchCardFiles as $file) {
|
||||
|
||||
if ($file->isValid() && !$file->hasMoved()) {
|
||||
$clientGivenName = $file->getClientName(); // User-given filename
|
||||
$clientGivenName = $file->getClientName(); // Original filename
|
||||
$newName = $file->getRandomName();
|
||||
|
||||
|
||||
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();
|
||||
$builder = $db->table('t_batchcard_files');
|
||||
|
||||
|
||||
$data = [
|
||||
'client_file_name' => $clientGivenName,
|
||||
'filename' => $newName,
|
||||
'coating_id' => $insertedId
|
||||
];
|
||||
|
||||
$result = $builder->insert($data);
|
||||
|
||||
|
||||
$builder->insert($data);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
if ($this->db->transStatus() === false) {
|
||||
throw new \Exception('Transaction failed due to database errors.');
|
||||
}
|
||||
|
||||
|
||||
$this->db->transCommit();
|
||||
|
||||
|
||||
|
||||
// Set flashdata for success message
|
||||
|
||||
// Redirect with success message
|
||||
return redirect()->to("/coatingMachineDetails")
|
||||
->with('success', $message1 . " " . $message2 . " " . $message3);
|
||||
} catch (\Exception $error) {
|
||||
@ -652,6 +686,7 @@ class StockController extends BaseController
|
||||
return redirect()->back()->with('error', ' ' . $error->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@ -679,32 +714,36 @@ class StockController extends BaseController
|
||||
|
||||
$batchCardFiles = $this->request->getFileMultiple('batchCard');
|
||||
|
||||
|
||||
// Step 4: Upload new files and insert into DB
|
||||
foreach ($batchCardFiles as $index => $file) {
|
||||
if (is_array($batchCardFiles) && !empty($batchCardFiles)) {
|
||||
// Step 4: Upload new files and insert into DB
|
||||
foreach ($batchCardFiles as $index => $file) {
|
||||
|
||||
if ( !empty($batchCardFiles[$index]) && !($batchCardFiles[$index]->getError() === UPLOAD_ERR_NO_FILE)) {
|
||||
|
||||
$db = \Config\Database::connect();
|
||||
$builder = $db->table('t_batchcard_files');
|
||||
|
||||
if ($file->isValid() && !$file->hasMoved()) {
|
||||
$clientGivenName = $file->getClientName(); // User-given filename
|
||||
$newName = $file->getRandomName(); // Randomized unique filename
|
||||
|
||||
// Move the new file to storage
|
||||
if ($file->move(WRITEPATH . 'uploads/batchcard', $newName)) {
|
||||
// Insert new file record into the database
|
||||
$data = [
|
||||
'client_file_name' => $clientGivenName,
|
||||
'filename' => $newName,
|
||||
'coating_id' => $id
|
||||
];
|
||||
$builder->insert($data);
|
||||
if ( !empty($batchCardFiles[$index]) && !($batchCardFiles[$index]->getError() === UPLOAD_ERR_NO_FILE)) {
|
||||
|
||||
$db = \Config\Database::connect();
|
||||
$builder = $db->table('t_batchcard_files');
|
||||
|
||||
if ($file->isValid() && !$file->hasMoved()) {
|
||||
$clientGivenName = $file->getClientName(); // User-given filename
|
||||
$newName = $file->getRandomName(); // Randomized unique filename
|
||||
|
||||
// Move the new file to storage
|
||||
if ($file->move(WRITEPATH . 'uploads/batchcard', $newName)) {
|
||||
// Insert new file record into the database
|
||||
$data = [
|
||||
'client_file_name' => $clientGivenName,
|
||||
'filename' => $newName,
|
||||
'coating_id' => $id
|
||||
];
|
||||
$builder->insert($data);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
if ($updated !== false && $updated > 0) {
|
||||
@ -1020,14 +1059,13 @@ class StockController extends BaseController
|
||||
|
||||
private function updateGasStockConsumption($date, $consumption)
|
||||
{
|
||||
|
||||
// Check if an entry exists for the given date
|
||||
$resultExists = $this->gasStockDetails_model
|
||||
->where('date', $date)
|
||||
->first();
|
||||
|
||||
|
||||
if ($resultExists) {
|
||||
|
||||
|
||||
// Ensure the date is in the correct format
|
||||
if ($date instanceof DateTime) {
|
||||
$date = $date->format('Y-m-d');
|
||||
} elseif (!strtotime($date)) {
|
||||
@ -1035,39 +1073,40 @@ class StockController extends BaseController
|
||||
} else {
|
||||
$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));
|
||||
|
||||
|
||||
//what happens if the updation is on the last day of the month?
|
||||
|
||||
// Fetch all stock entries from the given date till the end of the month
|
||||
$resultExists = $this->gasStockDetails_model
|
||||
->where('date >=', $date)
|
||||
->where('date <=', $endDate)
|
||||
->orderBy('date', 'asc')
|
||||
->findAll();
|
||||
|
||||
|
||||
$updatedOpeningStock = 0;
|
||||
$updates = [];
|
||||
|
||||
|
||||
|
||||
// Update stock values for each day in the month
|
||||
foreach ($resultExists as $index => $result) {
|
||||
|
||||
if ($index == 0) {
|
||||
// Update the first entry with new consumption
|
||||
$result['consumption'] = (float)($result['consumption']) + (float)($consumption);
|
||||
$result['total'] = (float)$result['opening'] + (float)$result['purchaseBharath'] + (float)$result['purchaseIndian'];
|
||||
$result['balanceStock'] = $result['total'] - $result['consumption'];
|
||||
$updatedOpeningStock = (int)$result['balanceStock'];
|
||||
} else {
|
||||
// Update subsequent entries based on previous balance
|
||||
$result['opening'] = (float)$updatedOpeningStock;
|
||||
$result['total'] = (float)$result['opening'] + (float)$result['purchaseBharath'] + (float)$result['purchaseIndian'];
|
||||
$result['balanceStock'] = (float)$result['total'] - (float)$result['consumption'];
|
||||
$updatedOpeningStock = (int)$result['balanceStock'];
|
||||
}
|
||||
|
||||
|
||||
|
||||
$updates[] = $result;
|
||||
}
|
||||
|
||||
|
||||
// Perform batch update if there are changes
|
||||
if (!empty($updates)) {
|
||||
$result = $this->gasStockDetails_model->updateBatch($updates, 'id');
|
||||
return ($result !== false && $result > 0) ? $result : 0;
|
||||
@ -1075,69 +1114,67 @@ class StockController extends BaseController
|
||||
return 0;
|
||||
}
|
||||
} else {
|
||||
|
||||
|
||||
|
||||
// Get the last date of the previous month
|
||||
$previousMonthDate = new DateTime($date);
|
||||
$previousMonthDate = $previousMonthDate->modify('first day of this month')
|
||||
->modify('-1 day')
|
||||
->format('Y-m-d');
|
||||
|
||||
|
||||
|
||||
|
||||
// Check if the previous month's last day entry exists
|
||||
$previousMonthResultExists = $this->gasStockDetails_model
|
||||
->where('date', $previousMonthDate)
|
||||
->first();
|
||||
|
||||
|
||||
|
||||
|
||||
$opening = 0;
|
||||
|
||||
|
||||
// Set opening stock based on previous month's balance stock
|
||||
if (!empty($previousMonthResultExists) && isset($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');
|
||||
$endDate = DateTime::createFromFormat('Y-m-d', $date)->modify('last day of this month')->format('Y-m-d');
|
||||
|
||||
|
||||
$datesInMonth = [];
|
||||
$inserts = [];
|
||||
|
||||
|
||||
$period = new DatePeriod(
|
||||
new DateTime($startDate),
|
||||
new DateInterval('P1D'),
|
||||
(new DateTime($endDate))->modify('+1 day')
|
||||
);
|
||||
|
||||
|
||||
foreach ($period as $day) {
|
||||
$datesInMonth[] = $day->format('Y-m-d');
|
||||
}
|
||||
|
||||
foreach ($datesInMonth as $datesInMonthIndex => $dateInMonth) {
|
||||
|
||||
//update previousMonthResultExists
|
||||
|
||||
// Insert stock records for each day in the month
|
||||
foreach ($datesInMonth as $dateInMonth) {
|
||||
$balanceStock = $opening;
|
||||
$consumptionForDate = 0;
|
||||
|
||||
if ($dateInMonth == $date) {
|
||||
// Assign the given consumption for the provided date
|
||||
$consumptionForDate = $consumption;
|
||||
$balanceStock = $opening - $consumption;
|
||||
}
|
||||
|
||||
|
||||
$inserts[] = [
|
||||
'date' => $dateInMonth,
|
||||
'opening' => $opening,
|
||||
'purchaseBharath' => Null,
|
||||
'purchaseIndian' => Null,
|
||||
'total' => Null,
|
||||
'purchaseBharath' => null,
|
||||
'purchaseIndian' => null,
|
||||
'total' => null,
|
||||
'consumption' => $consumptionForDate,
|
||||
'balanceStock' => $balanceStock
|
||||
];
|
||||
|
||||
|
||||
// Update opening for the next day
|
||||
$opening = $balanceStock;
|
||||
}
|
||||
|
||||
|
||||
// Perform batch insert if data is available
|
||||
if (!empty($inserts)) {
|
||||
$result = $this->gasStockDetails_model->insertBatch($inserts);
|
||||
return ($result !== false && $result > 0) ? $result : 0;
|
||||
@ -1146,6 +1183,7 @@ class StockController extends BaseController
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@ -1293,13 +1331,6 @@ class StockController extends BaseController
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// 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');
|
||||
@ -1378,46 +1409,7 @@ class StockController extends BaseController
|
||||
|
||||
// Reset the structure to have indexed arrays without the date keys
|
||||
$data['groupedDieselMachineStockDetails'] = array_values($groupedByDate);
|
||||
|
||||
|
||||
|
||||
//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
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@ -1781,35 +1773,6 @@ class StockController extends BaseController
|
||||
$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);
|
||||
|
||||
$data['electricMachinesCount'] = $electricMachinesCount;
|
||||
@ -2241,34 +2204,7 @@ class StockController extends BaseController
|
||||
// Reset the structure to have indexed arrays without the date keys
|
||||
$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
|
||||
// checking already existing stock if yes then get customer from the existing stock
|
||||
// if not set customer in db , then set '' empty string
|
||||
@ -2617,32 +2553,7 @@ class StockController extends BaseController
|
||||
|
||||
// Reset the structure to have indexed arrays without the date keys
|
||||
$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
|
||||
// checking already existing stock if yes then get customer from the existing stock
|
||||
@ -3272,12 +3183,12 @@ class StockController extends BaseController
|
||||
*/
|
||||
private function handleGasStockUpdate($existingRow, $newRow)
|
||||
{
|
||||
$existingConsumption = $existingRow['total_gas_consumption'];
|
||||
$updatedConsumption = $newRow['total_gas_consumption'];
|
||||
$existingConsumption = $existingRow['total_gas_consumption']; //eg:400
|
||||
$updatedConsumption = $newRow['total_gas_consumption']; //eg:500
|
||||
|
||||
if ($existingConsumption != $updatedConsumption) {
|
||||
$changeInConsumption = $updatedConsumption - $existingConsumption;
|
||||
$this->updateGasStockConsumption($existingRow['date'], $changeInConsumption);
|
||||
$changeInConsumption = $updatedConsumption - $existingConsumption; // 500-400 = 100
|
||||
$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\Ipattachment_model;
|
||||
use App\Models\Zohobooks_api_model;
|
||||
use App\Models\CreditNoteModel;
|
||||
|
||||
require_once 'vendor/autoload.php';
|
||||
|
||||
@ -34,6 +35,7 @@ class User extends BaseController
|
||||
protected $user_model;
|
||||
protected $ipinvoice_model;
|
||||
protected $ipattachment_model;
|
||||
protected $CreditNoteModel;
|
||||
protected $session;
|
||||
|
||||
/**
|
||||
@ -50,6 +52,7 @@ class User extends BaseController
|
||||
$this->user_model = new User_model();
|
||||
$this->ipinvoice_model = new Ipinvoice_model();
|
||||
$this->ipattachment_model = new Ipattachment_model();
|
||||
$this->CreditNoteModel = new CreditNoteModel();
|
||||
$this->session = session();
|
||||
helper('form'); //$this->load->library('form_validation');
|
||||
$this->isLoggedIn();
|
||||
@ -1337,17 +1340,13 @@ class User extends BaseController
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
function zohobooks_api_fetch_all()
|
||||
{
|
||||
// print_r($_GET);
|
||||
// echo isset($_GET['from']) ? $_GET['from'] : 'n';
|
||||
// echo isset($_GET['to']) ? $_GET['to'] : 'n';
|
||||
// die();
|
||||
|
||||
try {
|
||||
// if (isset($_POST['sync']) || $_GET['from'] != null && $_GET['to'] != null)
|
||||
// {
|
||||
// $ch=curl_init();
|
||||
//$this->load->helper('zohobooks_fetch_api_helper');
|
||||
|
||||
helper('zohobook');
|
||||
$Zohobook_model = model('Zohobook_api_model');
|
||||
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_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);
|
||||
// print_r($chk_acc_token_val);//die();
|
||||
|
||||
$date = new \DateTime($chk_acc_token_val[0]['created_at']);
|
||||
//print_r($date);
|
||||
|
||||
$date->add(new \DateInterval('PT1H'));
|
||||
//print_r($date);
|
||||
//echo '****************';
|
||||
//print_r(date('Y-m-d h:i:s'));
|
||||
|
||||
$token = 0;
|
||||
if ($date->format('Y-m-d H:i:s') > date('Y-m-d H:i:s')) {
|
||||
$token = $chk_acc_token_val[0]['token'];
|
||||
@ -1377,17 +1374,23 @@ class User extends BaseController
|
||||
// $token = generateNewToken(); $tokendata['token'] = $token;
|
||||
//$Zohobook_model->update($tokendata , 1,'zohobook_accesstoken');
|
||||
$result = getheringInvoiceDetails($date_today, $date_yesterday, $token);
|
||||
|
||||
$headers_new = $result['headers_new'];
|
||||
$res = json_decode($result['data'], true);
|
||||
$inv_array = $res['invoices'];
|
||||
|
||||
// $cteditNotes = getAllCreditNotes($date_today, $date_yesterday, $token);
|
||||
// dd($cteditNotes);
|
||||
|
||||
// dd($inv_array);
|
||||
// print_r($inv_array);
|
||||
// echo "rrrr";
|
||||
// die();
|
||||
$tokenWithCreditNoteScope = generateNewTokenForCreditNoteScope();
|
||||
$cteditNotesRes = getAllCreditNotes($date_today, $date_yesterday, $tokenWithCreditNoteScope);
|
||||
$cteditNotesData = json_decode($cteditNotesRes['data'],true);
|
||||
|
||||
if(count($cteditNotesData['creditnotes']))
|
||||
{
|
||||
$this->saveOrUpdateCreditNote($cteditNotesData['creditnotes']);
|
||||
}
|
||||
|
||||
|
||||
|
||||
foreach ($inv_array as $inv) {
|
||||
$invoice_id = $inv['invoice_id'];
|
||||
//filter only einvoice status pushed invoices only
|
||||
@ -1711,6 +1714,27 @@ class User extends BaseController
|
||||
}
|
||||
// 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()
|
||||
{
|
||||
$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')) {
|
||||
// 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)
|
||||
{
|
||||
// Initialize cURL
|
||||
$ch = curl_init();
|
||||
var_dump($accesstoken);
|
||||
|
||||
// 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 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
|
||||
$headers = array(
|
||||
'Authorization: Zoho-oauthtoken ' . $accesstoken,
|
||||
'Content-Type: application/json'
|
||||
// 'Content-Type: application/json'
|
||||
);
|
||||
|
||||
// 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
|
||||
{
|
||||
protected $table = 't_drierMachineDetails';
|
||||
protected $table = 't_driermachinedetails';
|
||||
protected $primaryKey = 'id';
|
||||
protected $useAutoIncrement = true;
|
||||
protected $returnType = 'array';
|
||||
|
||||
@ -52,7 +52,7 @@ class Employeedetails_model extends Model
|
||||
return $query->getResult();
|
||||
}
|
||||
|
||||
function incomingSilicaSandTestedBy($ConfigID){
|
||||
function incomingSilicaSandTestedBy(){
|
||||
|
||||
|
||||
$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')
|
||||
->select(' Emp.*')
|
||||
|
||||
@ -92,7 +92,7 @@ class FactoryMachineModel extends Model
|
||||
$result = $this->db->table('t_factorymachinemaster')
|
||||
->where('is_active', 1)
|
||||
->where('energy_type', 'diesel')
|
||||
->orderBy('id', 'desc')
|
||||
->orderBy('id', 'asc')
|
||||
->get()
|
||||
->getResultArray();
|
||||
|
||||
|
||||
@ -6,7 +6,7 @@ use CodeIgniter\Model;
|
||||
|
||||
class IncomingSilicaSandDetailsModel extends Model
|
||||
{
|
||||
protected $table = 't_incomingSilicaSandDetails';
|
||||
protected $table = 't_incomingsilicasanddetails';
|
||||
protected $primaryKey = 'id';
|
||||
protected $useAutoIncrement = true;
|
||||
protected $returnType = 'array';
|
||||
|
||||
@ -1216,7 +1216,7 @@ class Inwardgateregister_model extends Model
|
||||
|
||||
$builder->groupBy('t_igr_details.IGRNO, t_igr_details.MaterialCode')
|
||||
->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_configdetails cd','cd.key = materialMaster.Category','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')
|
||||
->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')
|
||||
->orderBy('CreatedDate', 'desc');
|
||||
$query = $builder->get();
|
||||
@ -159,6 +163,10 @@ class Rawmaterialdetails_model extends Model
|
||||
|
||||
$builder = $this->db->table('t_materialmaster')
|
||||
->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')
|
||||
->orderBy('CreatedDate', 'desc');
|
||||
$query = $builder->get();
|
||||
|
||||
@ -146,7 +146,7 @@ class TrpProductionModel extends Model
|
||||
$builder->join('t_trp_sand_use tsu', 'tsu.date = tpmd.date', 'left');
|
||||
|
||||
// Subquery: Coating Machine Gas Consumption
|
||||
$subquery1 = $this->db->table('t_coatingMachineDetails')
|
||||
$subquery1 = $this->db->table('t_coatingmachinedetails')
|
||||
->select('date, SUM(totalGasConsumption) AS totalGasConsumption')
|
||||
->groupBy('date')
|
||||
->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');
|
||||
|
||||
// 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')
|
||||
->groupBy('date')
|
||||
->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>
|
||||
<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(); ?>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>
|
||||
|
||||
<?php if(session()->get('roleText') == 'System Administrator'){?>
|
||||
|
||||
@ -235,6 +235,10 @@
|
||||
z-index: 5!important;
|
||||
}
|
||||
|
||||
tfoot tr {
|
||||
background-color:rgb(235, 236, 203);
|
||||
}
|
||||
|
||||
</style>
|
||||
|
||||
<div class="content-page">
|
||||
@ -456,49 +460,26 @@
|
||||
|
||||
} ?>
|
||||
|
||||
<table id="coatingMachineStockDetailsTableSummaryId" class="fht-table table-hover table-bordered">
|
||||
<tfoot>
|
||||
<tr>
|
||||
<td style="background-color:rgb(189, 9, 6); color:#ffff;">
|
||||
<b> Total </b>
|
||||
</td>
|
||||
<td class="celda_normal "> - </td>
|
||||
<td class="celda_normal "> - </td>
|
||||
<td class="celda_normal "> - </td>
|
||||
<td class="celda_normal "> <?=$summary['totalMachineRunningHrs']?></td>
|
||||
<td class="celda_normal "> - </td>
|
||||
<td class="celda_normal "> - </td>
|
||||
<td class="celda_normal "><?=$summary['totalCoating']?></td>
|
||||
<td class="celda_normal "><?=$summary['totalCoatingSandInKg']?></td>
|
||||
<td class="celda_normal "><?=$summary['totalGasConsumption']?></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>
|
||||
</tr>
|
||||
</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>
|
||||
|
||||
<td style="background-color:rgb(189, 9, 6); color:#ffff;">
|
||||
<b> Total </b>
|
||||
</td>
|
||||
|
||||
|
||||
<td class="celda_normal "> - </td>
|
||||
<td class="celda_normal "> - </td>
|
||||
<td class="celda_normal "> - </td>
|
||||
<td class="celda_normal "> <?=$summary['totalMachineRunningHrs']?></td>
|
||||
<td class="celda_normal "> - </td>
|
||||
<td class="celda_normal "> - </td>
|
||||
<td class="celda_normal "><?=$summary['totalCoating']?></td>
|
||||
<td class="celda_normal "><?=$summary['totalCoatingSandInKg']?></td>
|
||||
<td class="celda_normal "><?=$summary['totalGasConsumption']?></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>
|
||||
</tr>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
@ -235,6 +235,9 @@
|
||||
} */
|
||||
|
||||
|
||||
tfoot tr {
|
||||
background-color:rgb(235, 236, 203);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -304,7 +307,7 @@
|
||||
|
||||
<div class="col-3">
|
||||
<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>
|
||||
</div>
|
||||
<div class="form-group col-md-3">
|
||||
@ -419,7 +422,7 @@
|
||||
</div>
|
||||
|
||||
<!-- 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"
|
||||
data-date-format="M-yyyy" data-date-min-view-mode="1">
|
||||
|
||||
@ -585,45 +588,27 @@
|
||||
|
||||
<?php } ?>
|
||||
|
||||
<tfoot>
|
||||
<tr>
|
||||
|
||||
<div class="table-responsive">
|
||||
<table id="bagStockDetailsTableSummaryId" class="fht-table table-striped">
|
||||
<td style="background-color:rgb(189, 9, 6); color:#ffff;">
|
||||
<b> Total </b>
|
||||
</td>
|
||||
|
||||
<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>
|
||||
<?php foreach($summary as $each){
|
||||
?>
|
||||
|
||||
<tr>
|
||||
|
||||
<td class="celda_normal "><?=$each['opening']?></td>
|
||||
<td class="celda_normal "><?=$each['receipt']?></td>
|
||||
<td class="celda_normal "><?=$each['used']?></td>
|
||||
<td class="celda_normal "><?=$each['balanceStock']?></td>
|
||||
|
||||
<td style="background-color:rgb(189, 9, 6); color:#ffff;">
|
||||
<b> Total </b>
|
||||
</td>
|
||||
|
||||
<?php foreach($summary as $each){
|
||||
?>
|
||||
|
||||
|
||||
<td class="celda_normal "><?=$each['opening']?></td>
|
||||
<td class="celda_normal "><?=$each['receipt']?></td>
|
||||
<td class="celda_normal "><?=$each['used']?></td>
|
||||
<td class="celda_normal "><?=$each['balanceStock']?></td>
|
||||
|
||||
<?php } ?>
|
||||
<?php } ?>
|
||||
|
||||
</tr>
|
||||
|
||||
</tfoot>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<!-- this else condition work if groupedBagStockDetails is empty and creating new records
|
||||
with initial values 0 for entire month -->
|
||||
@ -682,12 +667,15 @@
|
||||
>
|
||||
|
||||
<?php
|
||||
|
||||
echo $previousMonthBagStockDetails[$bagMaterialIndex]['balanceStock'] ?? ' ';
|
||||
|
||||
|
||||
|
||||
?>
|
||||
foreach($previousMonthBagStockDetails as $index => $previousMonthBagStockDetail)
|
||||
{
|
||||
if($previousMonthBagStockDetail['materialCode'] == $bagMaterial['MaterialCode']){
|
||||
echo $previousMonthBagStockDetail['balanceStock'] ;
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
?>
|
||||
|
||||
</td>
|
||||
|
||||
@ -704,8 +692,15 @@
|
||||
data-id="<?=$dateInMonth?> <?=$bagMaterial['MaterialCode']?>"
|
||||
>
|
||||
<?php
|
||||
echo $previousMonthBagStockDetails[$bagMaterialIndex]['balanceStock'] ?? ' ';
|
||||
?>
|
||||
foreach($previousMonthBagStockDetails as $index => $previousMonthBagStockDetail)
|
||||
{
|
||||
if($previousMonthBagStockDetail['materialCode'] == $bagMaterial['MaterialCode']){
|
||||
echo $previousMonthBagStockDetail['balanceStock'] ;
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
?>
|
||||
</td>
|
||||
<?php } ?>
|
||||
</tr>
|
||||
@ -1272,4 +1267,17 @@
|
||||
};
|
||||
});
|
||||
|
||||
</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;
|
||||
}
|
||||
|
||||
|
||||
|
||||
tfoot tr{
|
||||
background-color:rgb(235, 236, 203);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -683,67 +684,40 @@ foreach ($period as $day) {
|
||||
}
|
||||
?>
|
||||
|
||||
<div class="table-responsive">
|
||||
<table id="dieselStockDetailsTableSummaryId" class="fht-table table-striped">
|
||||
<tfoot>
|
||||
<tr>
|
||||
|
||||
<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>
|
||||
|
||||
<td style="background-color:rgb(189, 9, 6); color:#ffff;">
|
||||
<b> Total </b>
|
||||
</td>
|
||||
<td style="background-color:rgb(189, 9, 6); color:#ffff;">
|
||||
<b> Total </b>
|
||||
</td>
|
||||
|
||||
|
||||
<td><?= $summary['opening_diesel'] ?></td>
|
||||
<td><?= $summary['totalPurchaseDiesel'] ?></td>
|
||||
<td><?= $summary['totalFillingDiesel'] ?></td>
|
||||
<td><?= $summary['balanceStock'] ?></td>
|
||||
<td class="celda_normal "><?= $summary['opening_diesel'] ?></td>
|
||||
<td class="celda_normal "><?= $summary['totalPurchaseDiesel'] ?></td>
|
||||
<td class="celda_normal "><?= $summary['totalFillingDiesel'] ?></td>
|
||||
<td class="celda_normal "><?= $summary['balanceStock'] ?></td>
|
||||
|
||||
<?php foreach($summary as $each){
|
||||
if(is_array($each)){
|
||||
?>
|
||||
<?php foreach($summary as $each){
|
||||
if(is_array($each)){
|
||||
?>
|
||||
|
||||
<td class="celda_normal "><?=$each['opening_reading']?> </td>
|
||||
<td class="celda_normal "><?=$each['closing_reading']?></td>
|
||||
<td class="celda_normal "><?=$each['filling_diesel']?></td>
|
||||
<td class="celda_normal "><?=$each['consumption']?></td>
|
||||
<td class="celda_normal "><?=$each['running_hours']?></td>
|
||||
<td class="celda_normal "><?=$each['mileage']?></td>
|
||||
<td class="celda_normal "><?=$each['opening_reading']?> </td>
|
||||
<td class="celda_normal "><?=$each['closing_reading']?></td>
|
||||
<td class="celda_normal "><?=$each['filling_diesel']?></td>
|
||||
<td class="celda_normal "><?=$each['consumption']?></td>
|
||||
<td class="celda_normal "><?=$each['running_hours']?></td>
|
||||
<td class="celda_normal "><?=$each['mileage']?></td>
|
||||
|
||||
<?php
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
</tr>
|
||||
</tfoot>
|
||||
|
||||
<?php
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
</tr>
|
||||
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<!-- this else condition work if groupeddieselStockDetails is empty and creating new records
|
||||
with initial values 0 for entire month -->
|
||||
@ -839,10 +813,18 @@ 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 class="celda_normal closingReading"
|
||||
@ -850,10 +832,19 @@ foreach ($period as $day) {
|
||||
oninput="closingReadingChange(this)"
|
||||
contenteditable="true">
|
||||
|
||||
<?= !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 class="celda_normal fillingDiesel"
|
||||
|
||||
@ -238,6 +238,10 @@ $datefordropdown = format_date($datefordropdown, 0, 'M-Y');
|
||||
z-index: 5!important;
|
||||
}
|
||||
|
||||
tfoot tr {
|
||||
background-color:rgb(235, 236, 203);
|
||||
}
|
||||
|
||||
</style>
|
||||
<div class="content-page">
|
||||
<div class="content">
|
||||
@ -503,62 +507,29 @@ $datefordropdown = format_date($datefordropdown, 0, 'M-Y');
|
||||
|
||||
|
||||
</tbody>
|
||||
<?php } ?>
|
||||
</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>
|
||||
|
||||
<tfoot>
|
||||
<tr>
|
||||
|
||||
<td style="background-color:rgb(189, 9, 6); color:#ffff;">
|
||||
<b> Total </b>
|
||||
</td>
|
||||
<td class="celda_normal ">-</td>
|
||||
<td class="celda_normal ">-</td>
|
||||
<td class="celda_normal "><?=$summary['drier_running_hours']?></td>
|
||||
<td class="celda_normal ">-</td>
|
||||
|
||||
<td class="celda_normal "><?=$summary['input_sand_qty']?></td>
|
||||
<td class="celda_normal ">-</td>
|
||||
<td class="celda_normal "><?=$summary['sand_dried_qty']?></td>
|
||||
<td class="celda_normal "><?=$summary['total_gas_consumption']?></td>
|
||||
<td class="celda_normal "></td>
|
||||
<td class="celda_normal "></td>
|
||||
<td class="celda_normal "><?=$summary['moisture_loss_qty']?></td>
|
||||
<td class="celda_normal "><?=$summary['dust_qty']?></td>
|
||||
</tr>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<?php } ?>
|
||||
<td style="background-color:rgb(189, 9, 6); color:#ffff;">
|
||||
<b> Total </b>
|
||||
</td>
|
||||
<td class="celda_normal ">-</td>
|
||||
<td class="celda_normal ">-</td>
|
||||
<td class="celda_normal "><?=$summary['drier_running_hours']?></td>
|
||||
<td class="celda_normal ">-</td>
|
||||
|
||||
<td class="celda_normal "><?=$summary['input_sand_qty']?></td>
|
||||
<td class="celda_normal ">-</td>
|
||||
<td class="celda_normal "><?=$summary['sand_dried_qty']?></td>
|
||||
<td class="celda_normal "><?=$summary['total_gas_consumption']?></td>
|
||||
<td class="celda_normal "></td>
|
||||
<td class="celda_normal "></td>
|
||||
<td class="celda_normal "><?=$summary['moisture_loss_qty']?></td>
|
||||
<td class="celda_normal "><?=$summary['dust_qty']?></td>
|
||||
</tr>
|
||||
</tfoot>
|
||||
<?php } ?>
|
||||
</table>
|
||||
|
||||
<?php if(empty($drierDetails)){ ?>
|
||||
<br><br>
|
||||
|
||||
@ -228,6 +228,10 @@
|
||||
max-width: 150px;
|
||||
}
|
||||
|
||||
tfoot tr {
|
||||
background-color:rgb(235, 236, 203);
|
||||
}
|
||||
|
||||
</style>
|
||||
|
||||
|
||||
@ -273,10 +277,9 @@
|
||||
data-date-format="M-yyyy" data-date-min-view-mode="1" readonly>
|
||||
</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>
|
||||
</div>
|
||||
<div class="col-md-1"></div>
|
||||
<div class="col-6">
|
||||
<div class="dropdown float-right">
|
||||
<a href="#" class="dropdown-toggle arrow-none" data-toggle="dropdown"
|
||||
@ -378,9 +381,9 @@
|
||||
<tfoot>
|
||||
<tr>
|
||||
<td style="background-color:rgb(189, 9, 6); color:#ffff;"> Total </td>
|
||||
<td class="celda_normal "><?=$summary['finalRough']?></td>
|
||||
<td class="celda_normal "><?=$summary['dust']?></td>
|
||||
<td class="celda_normal "><?=$summary['total']?></td>
|
||||
<td class="celda_normal "> <b> <?=$summary['finalRough']?> </b> </td>
|
||||
<td class="celda_normal "> <b> <?=$summary['dust']?> </b> </td>
|
||||
<td class="celda_normal "> <b> <?=$summary['total']?> </b> </td>
|
||||
</tr>
|
||||
</tfoot>
|
||||
|
||||
@ -680,3 +683,18 @@
|
||||
|
||||
</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;
|
||||
}
|
||||
|
||||
tfoot tr {
|
||||
background-color:rgb(235, 236, 203);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -501,50 +504,8 @@
|
||||
|
||||
} ?>
|
||||
|
||||
<div class="table-responsive">
|
||||
<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>
|
||||
<tfoot>
|
||||
<tr>
|
||||
|
||||
<td style="background-color:rgb(189, 9, 6); color:#ffff;">
|
||||
<b> Total </b>
|
||||
@ -568,12 +529,8 @@
|
||||
|
||||
|
||||
|
||||
</tr>
|
||||
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</tr>
|
||||
</tfoot>
|
||||
|
||||
|
||||
|
||||
|
||||
@ -226,6 +226,9 @@
|
||||
z-index: 5!important;
|
||||
}
|
||||
|
||||
tfoot tr {
|
||||
background-color:rgb(235, 236, 203);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -669,48 +672,14 @@
|
||||
} ?>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<table id="incomingSilicaSandDetailsSummaryTable" class="fht-table table-striped " >
|
||||
<thead>
|
||||
<tfoot>
|
||||
<tr>
|
||||
|
||||
<th class="celda_encabezado_total"
|
||||
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="display: none;" > -</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" > -</td>
|
||||
<td class="celda_normal" > -</td>
|
||||
<td class="celda_normal" > -</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" ><?=$summary['Qty']?></td>
|
||||
@ -732,13 +702,11 @@
|
||||
<td class="celda_normal" ><?=$summary['moistureLossQty']?></td>
|
||||
<td class="celda_normal" ><?=$summary['sieveLossQty']?></td>
|
||||
<td class="celda_normal" ><?=$summary['salableQty']?></td>
|
||||
|
||||
|
||||
|
||||
</tr>
|
||||
|
||||
</tbody>
|
||||
|
||||
</tr>
|
||||
</tfoot>
|
||||
</table>
|
||||
|
||||
<br>
|
||||
|
||||
@ -235,6 +235,12 @@
|
||||
min-width: 100px;
|
||||
max-width: 100px;
|
||||
}
|
||||
|
||||
tfoot tr {
|
||||
background-color:rgb(235, 236, 203);
|
||||
}
|
||||
|
||||
|
||||
</style>
|
||||
|
||||
|
||||
@ -685,71 +691,37 @@ foreach ($period as $day) {
|
||||
}
|
||||
?>
|
||||
|
||||
<div class="table-responsive">
|
||||
<table id="powerStockDetailsTableSummaryId" class="fht-table table-striped">
|
||||
<tfoot>
|
||||
<tr>
|
||||
|
||||
<thead>
|
||||
<td style="background-color:rgb(189, 9, 6); color:#ffff;">
|
||||
<b> Total </b>
|
||||
</td>
|
||||
|
||||
<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>
|
||||
<td class="celda_normal "><?= $summary['openingReading'] ?></td>
|
||||
<td class="celda_normal "><?= $summary['finalReading'] ?></td>
|
||||
<td class="celda_normal "><?= $summary['totalReading'] ?></td>
|
||||
<td class="celda_normal "><?= $summary['totalUnits'] ?></td>
|
||||
<td class="celda_normal "><?= $summary['averagePf'] ?></td>
|
||||
<td class="celda_normal "><?= $summary['presentPf'] ?></td>
|
||||
<td class="celda_normal "><?= $summary['md'] ?></td>
|
||||
<td class="celda_normal "><?= $summary['mf'] ?></td>
|
||||
|
||||
<?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 } ?>
|
||||
<?php foreach ($summary as $each) {
|
||||
if (is_array($each)) {
|
||||
?>
|
||||
|
||||
</tr>
|
||||
<td class="celda_normal "><?= $each['opening_units'] ?> </td>
|
||||
<td class="celda_normal "><?= $each['closing_units'] ?></td>
|
||||
<td class="celda_normal "><?= $each['total_units'] ?></td>
|
||||
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
|
||||
<tr>
|
||||
|
||||
<td style="background-color:rgb(189, 9, 6); color:#ffff;">
|
||||
<b> Total </b>
|
||||
</td>
|
||||
|
||||
<td><?= $summary['openingReading'] ?></td>
|
||||
<td><?= $summary['finalReading'] ?></td>
|
||||
<td><?= $summary['totalReading'] ?></td>
|
||||
<td><?= $summary['totalUnits'] ?></td>
|
||||
<td><?= $summary['averagePf'] ?></td>
|
||||
<td><?= $summary['presentPf'] ?></td>
|
||||
<td><?= $summary['md'] ?></td>
|
||||
<td><?= $summary['mf'] ?></td>
|
||||
|
||||
<?php foreach ($summary as $each) {
|
||||
if (is_array($each)) {
|
||||
?>
|
||||
|
||||
<td class="celda_normal "><?= $each['opening_units'] ?> </td>
|
||||
<td class="celda_normal "><?= $each['closing_units'] ?></td>
|
||||
<td class="celda_normal "><?= $each['total_units'] ?></td>
|
||||
|
||||
<?php
|
||||
}
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
}
|
||||
?>
|
||||
|
||||
</tr>
|
||||
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</tr>
|
||||
</tfoot>
|
||||
|
||||
<!-- this else condition work if groupedpowerStockDetails is empty and creating new records
|
||||
with initial values 0 for entire month -->
|
||||
@ -786,7 +758,8 @@ foreach ($period as $day) {
|
||||
oninput="openingTPStockChange(this)"
|
||||
contenteditable="true"
|
||||
|
||||
<?php } ?>><?php
|
||||
<?php } ?>>
|
||||
<?php
|
||||
if (empty($previousMonthTotalPowerMachineStockDetails)) {
|
||||
echo " ";
|
||||
} else {
|
||||
@ -794,6 +767,8 @@ foreach ($period as $day) {
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
|
||||
</td>
|
||||
|
||||
|
||||
@ -859,11 +834,19 @@ foreach ($period as $day) {
|
||||
<?php } ?>
|
||||
|
||||
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 class="celda_normal closingUnits"
|
||||
@ -871,11 +854,17 @@ foreach ($period as $day) {
|
||||
oninput="closingUnitsChange(this)"
|
||||
contenteditable="true">
|
||||
|
||||
<?= (!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 class="celda_normal totalUnits"
|
||||
|
||||
@ -235,6 +235,10 @@
|
||||
min-width: 100px;
|
||||
max-width: 100px;
|
||||
}
|
||||
|
||||
tfoot tr {
|
||||
background-color:rgb(235, 236, 203);
|
||||
}
|
||||
</style>
|
||||
|
||||
|
||||
@ -569,44 +573,27 @@ foreach ($period as $day) {
|
||||
<?php } ?>
|
||||
|
||||
|
||||
<div class="table-responsive">
|
||||
<table id="resinStockDetailsTableSummaryId" class="fht-table table-striped">
|
||||
<tfoot>
|
||||
<tr>
|
||||
|
||||
<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>
|
||||
<td style="background-color:rgb(189, 9, 6); color:#ffff;">
|
||||
<b> Total </b>
|
||||
</td>
|
||||
|
||||
<tbody>
|
||||
|
||||
<tr>
|
||||
|
||||
<td style="background-color:rgb(189, 9, 6); color:#ffff;">
|
||||
<b> Total </b>
|
||||
</td>
|
||||
|
||||
<?php foreach ($summary as $each) { ?>
|
||||
<?php foreach ($summary as $each) { ?>
|
||||
|
||||
|
||||
<td class="celda_normal "><?= $each['opening'] ?></td>
|
||||
<td class="celda_normal "><?= $each['receipt'] ?></td>
|
||||
<td class="celda_normal "><?= $each['used'] ?></td>
|
||||
<td class="celda_normal "><?= $each['balanceStock'] ?></td>
|
||||
<td class="celda_normal "><?= $each['opening'] ?></td>
|
||||
<td class="celda_normal "><?= $each['receipt'] ?></td>
|
||||
<td class="celda_normal "><?= $each['used'] ?></td>
|
||||
<td class="celda_normal "><?= $each['balanceStock'] ?></td>
|
||||
|
||||
<?php } ?>
|
||||
<?php } ?>
|
||||
|
||||
</tr>
|
||||
</tr>
|
||||
</tfoot>
|
||||
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<!-- this else condition work if groupedBagStockDetails is empty and creating new records
|
||||
with initial values 0 for entire month -->
|
||||
<?php } else { ?>
|
||||
@ -659,7 +646,20 @@ foreach ($period as $day) {
|
||||
oninput="openingStockChange(this)"
|
||||
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"
|
||||
data-id="<?= $dateInMonth ?> <?= $resinMaterial['MaterialCode'] ?>"
|
||||
@ -672,7 +672,20 @@ foreach ($period as $day) {
|
||||
contenteditable="true"> <?= ' ' ?> </td>
|
||||
|
||||
<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 } ?>
|
||||
</tr>
|
||||
<?php } ?>
|
||||
|
||||
@ -230,6 +230,10 @@
|
||||
min-height: 200px;
|
||||
}
|
||||
|
||||
tfoot tr {
|
||||
background-color:rgb(235, 236, 203);
|
||||
}
|
||||
|
||||
</style>
|
||||
|
||||
|
||||
@ -1004,421 +1008,274 @@ $timeOtions[] = "12:00 AM";
|
||||
|
||||
|
||||
|
||||
<table id="trpProductionStockSummaryTableId" class="fht-table table-striped">
|
||||
|
||||
<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;">
|
||||
|
||||
|
||||
<tfoot>
|
||||
<tr>
|
||||
|
||||
<!-- Total -->
|
||||
<!-- td:eq(0) -->
|
||||
<td style="background-color:rgb(189, 9, 6); color:#ffff;">
|
||||
<b> Total </b>
|
||||
</td>
|
||||
<!-- Total -->
|
||||
<!-- td:eq(0) -->
|
||||
<td style="background-color:rgb(189, 9, 6); color:#ffff;">
|
||||
<b> Total </b>
|
||||
</td>
|
||||
|
||||
<!-- openingTime -->
|
||||
<!-- td:eq(1) -->
|
||||
<td class="celda_normal">
|
||||
|
||||
</td>
|
||||
<!-- openingTime -->
|
||||
<!-- td:eq(1) -->
|
||||
<td class="celda_normal">
|
||||
|
||||
</td>
|
||||
|
||||
<!-- closingTime -->
|
||||
<!-- td:eq(2) -->
|
||||
<td class="celda_normal">
|
||||
<!-- closingTime -->
|
||||
<!-- td:eq(2) -->
|
||||
<td class="celda_normal">
|
||||
|
||||
</td>
|
||||
</td>
|
||||
|
||||
<!-- totalHours -->
|
||||
<!-- td:eq(3) -->
|
||||
<td class="celda_normal ">
|
||||
<?= $summary['totalHours'] ?>
|
||||
</td>
|
||||
<!-- totalHours -->
|
||||
<!-- td:eq(3) -->
|
||||
<td class="celda_normal ">
|
||||
<?= $summary['totalHours'] ?>
|
||||
</td>
|
||||
|
||||
<!-- coldStart -->
|
||||
<!-- td:eq(4) -->
|
||||
<td class="celda_normal">
|
||||
<?=$summary['coldStart']?>
|
||||
</td>
|
||||
<!-- coldStart -->
|
||||
<!-- td:eq(4) -->
|
||||
<td class="celda_normal">
|
||||
<?=$summary['coldStart']?>
|
||||
</td>
|
||||
|
||||
<!-- breakdownHours -->
|
||||
<!-- td:eq(5) -->
|
||||
<td class="celda_normal">
|
||||
<?=$summary['breakdownHours']?>
|
||||
</td>
|
||||
<!-- breakdownHours -->
|
||||
<!-- td:eq(5) -->
|
||||
<td class="celda_normal">
|
||||
<?=$summary['breakdownHours']?>
|
||||
</td>
|
||||
|
||||
<!-- burnerFiringHours -->
|
||||
<!-- td:eq(6) -->
|
||||
<td class="celda_normal ">
|
||||
<?= $summary['burnerFiringHours'] ?>
|
||||
</td>
|
||||
<!-- burnerFiringHours -->
|
||||
<!-- td:eq(6) -->
|
||||
<td class="celda_normal ">
|
||||
<?= $summary['burnerFiringHours'] ?>
|
||||
</td>
|
||||
|
||||
<!-- sandFeedingHours -->
|
||||
<!-- td:eq(7) -->
|
||||
<td class="celda_normal">
|
||||
<?=$summary['sandFeedingHours'] ?>
|
||||
</td>
|
||||
<!-- sandFeedingHours -->
|
||||
<!-- td:eq(7) -->
|
||||
<td class="celda_normal">
|
||||
<?=$summary['sandFeedingHours'] ?>
|
||||
</td>
|
||||
|
||||
<!-- gasReceiptBg -->
|
||||
<!-- td:eq(8) -->
|
||||
<td class="celda_normal">
|
||||
<?=$summary['gasReceiptBg'] ?>
|
||||
</td>
|
||||
<!-- gasReceiptBg -->
|
||||
<!-- td:eq(8) -->
|
||||
<td class="celda_normal">
|
||||
<?=$summary['gasReceiptBg'] ?>
|
||||
</td>
|
||||
|
||||
<!-- gasReceiptPg -->
|
||||
<!-- td:eq(9) -->
|
||||
<td class="celda_normal">
|
||||
<?=$summary['gasReceiptPg'] ?>
|
||||
</td>
|
||||
<!-- gasReceiptPg -->
|
||||
<!-- td:eq(9) -->
|
||||
<td class="celda_normal">
|
||||
<?=$summary['gasReceiptPg'] ?>
|
||||
</td>
|
||||
|
||||
|
||||
|
||||
<!-- physicalGasConsumption -->
|
||||
<!-- td:eq(10) -->
|
||||
<td class="celda_normal">
|
||||
<?=$summary['physicalGasConsumption']?>
|
||||
</td>
|
||||
<!-- physicalGasConsumption -->
|
||||
<!-- td:eq(10) -->
|
||||
<td class="celda_normal">
|
||||
<?=$summary['physicalGasConsumption']?>
|
||||
</td>
|
||||
|
||||
|
||||
|
||||
<!-- drierGasConsumption -->
|
||||
<!-- td:eq(11) -->
|
||||
<td class="celda_normal">
|
||||
<?=$summary['drierGasConsumption']?>
|
||||
</td>
|
||||
<!-- drierGasConsumption -->
|
||||
<!-- td:eq(11) -->
|
||||
<td class="celda_normal">
|
||||
<?=$summary['drierGasConsumption']?>
|
||||
</td>
|
||||
|
||||
<!-- coatingGasConsumption -->
|
||||
<!-- td:eq(12) -->
|
||||
<td class="celda_normal">
|
||||
<?=$summary['coatingGasConsumption'] ?>
|
||||
</td>
|
||||
<!-- coatingGasConsumption -->
|
||||
<!-- td:eq(12) -->
|
||||
<td class="celda_normal">
|
||||
<?=$summary['coatingGasConsumption'] ?>
|
||||
</td>
|
||||
|
||||
|
||||
<!-- trpPlusDrierGasConsumption -->
|
||||
<!-- td:eq(13) -->
|
||||
<td class="celda_normal">
|
||||
<?=$summary['trpPlusDrierGasConsumption']?>
|
||||
</td>
|
||||
<!-- trpPlusDrierGasConsumption -->
|
||||
<!-- td:eq(13) -->
|
||||
<td class="celda_normal">
|
||||
<?=$summary['trpPlusDrierGasConsumption']?>
|
||||
</td>
|
||||
|
||||
<!-- trpPhysicalGasPerTon -->
|
||||
<!-- td:eq(14) -->
|
||||
<td class="celda_normal">
|
||||
<?=$summary['trpPhysicalGasPerTon']?>
|
||||
</td>
|
||||
<!-- trpPhysicalGasPerTon -->
|
||||
<!-- td:eq(14) -->
|
||||
<td class="celda_normal">
|
||||
<?=$summary['trpPhysicalGasPerTon']?>
|
||||
</td>
|
||||
|
||||
|
||||
<!-- panelGasConsumption -->
|
||||
<!-- td:eq(15) -->
|
||||
<td class="celda_normal">
|
||||
<?= $summary['panelGasConsumption'] ?>
|
||||
</td>
|
||||
<!-- panelGasConsumption -->
|
||||
<!-- td:eq(15) -->
|
||||
<td class="celda_normal">
|
||||
<?= $summary['panelGasConsumption'] ?>
|
||||
</td>
|
||||
|
||||
<!-- panelGasPerTon -->
|
||||
<!-- td:eq(16) -->
|
||||
<td class="celda_normal">
|
||||
<?=$summary['panelGasPerTon']?>
|
||||
</td>
|
||||
<!-- panelGasPerTon -->
|
||||
<!-- td:eq(16) -->
|
||||
<td class="celda_normal">
|
||||
<?=$summary['panelGasPerTon']?>
|
||||
</td>
|
||||
|
||||
|
||||
|
||||
<?php
|
||||
foreach($wcsSupplierList as $supplier){ ?>
|
||||
<td class="celda_normal">
|
||||
<?=$summary[$supplier]?>
|
||||
</td>
|
||||
<?php } ?>
|
||||
<?php
|
||||
foreach($wcsSupplierList as $supplier){ ?>
|
||||
<td class="celda_normal">
|
||||
<?=$summary[$supplier]?>
|
||||
</td>
|
||||
<?php } ?>
|
||||
|
||||
|
||||
<!-- edRunningHours -->
|
||||
<!-- td:eq(24) -->
|
||||
<td class="celda_normal">
|
||||
<?= $summary['edRunningHours']?>
|
||||
</td>
|
||||
<!-- edRunningHours -->
|
||||
<!-- td:eq(24) -->
|
||||
<td class="celda_normal">
|
||||
<?= $summary['edRunningHours']?>
|
||||
</td>
|
||||
|
||||
|
||||
|
||||
<!-- edProduction -->
|
||||
<!-- td:eq(25) -->
|
||||
<td class="celda_normal">
|
||||
<?= $summary['edProduction'] ?>
|
||||
</td>
|
||||
<!-- edProduction -->
|
||||
<!-- td:eq(25) -->
|
||||
<td class="celda_normal">
|
||||
<?= $summary['edProduction'] ?>
|
||||
</td>
|
||||
|
||||
<!-- edUsage -->
|
||||
<!-- td:eq(26) -->
|
||||
<td class="celda_normal">
|
||||
<?=$summary['edUsage'] ?>
|
||||
</td>
|
||||
<!-- edUsage -->
|
||||
<!-- td:eq(26) -->
|
||||
<td class="celda_normal">
|
||||
<?=$summary['edUsage'] ?>
|
||||
</td>
|
||||
|
||||
<!-- trpProduction -->
|
||||
<!-- td:eq(27) -->
|
||||
<td class="celda_normal">
|
||||
<?=$summary['trpProduction'] ?>
|
||||
</td>
|
||||
<!-- trpProduction -->
|
||||
<!-- td:eq(27) -->
|
||||
<td class="celda_normal">
|
||||
<?=$summary['trpProduction'] ?>
|
||||
</td>
|
||||
|
||||
<!-- trpProductionPerHour -->
|
||||
<!-- td:eq(28) -->
|
||||
<td class="celda_normal">
|
||||
<?=$summary['trpProductionPerHour'] ?>
|
||||
</td>
|
||||
<!-- trpProductionPerHour -->
|
||||
<!-- td:eq(28) -->
|
||||
<td class="celda_normal">
|
||||
<?=$summary['trpProductionPerHour'] ?>
|
||||
</td>
|
||||
|
||||
<!-- coating -->
|
||||
<!-- td:eq(29) -->
|
||||
<td class="celda_normal">
|
||||
<?=$summary['coating'] ?>
|
||||
</td>
|
||||
|
||||
|
||||
<?php
|
||||
foreach($crsClientList as $client){ ?>
|
||||
<td class="celda_normal">
|
||||
<?=$summary[$client]?>
|
||||
</td>
|
||||
<?php } ?>
|
||||
<!-- coating -->
|
||||
<!-- td:eq(29) -->
|
||||
<td class="celda_normal">
|
||||
<?=$summary['coating'] ?>
|
||||
</td>
|
||||
|
||||
|
||||
<!-- waterReceipt -->
|
||||
<!-- td:eq(35) -->
|
||||
<td class="celda_normal">
|
||||
<?=$summary['waterReceipt'] ?>
|
||||
</td>
|
||||
|
||||
<!-- waterConsumption -->
|
||||
<!-- td:eq(36) -->
|
||||
<td class="celda_normal">
|
||||
<?=$summary['waterConsumption'] ?>
|
||||
</td>
|
||||
|
||||
<!-- ebReading -->
|
||||
<!-- td:eq(37) -->
|
||||
<td class="celda_normal">
|
||||
<?=$summary['ebReading'] ?>
|
||||
</td>
|
||||
|
||||
<!-- ebReadingPerUnitTon -->
|
||||
<!-- td:eq(38) -->
|
||||
<td class="celda_normal">
|
||||
<?=$summary['ebReadingPerUnitTon'] ?>
|
||||
</td>
|
||||
<?php
|
||||
foreach($crsClientList as $client){ ?>
|
||||
<td class="celda_normal">
|
||||
<?=$summary[$client]?>
|
||||
</td>
|
||||
<?php } ?>
|
||||
|
||||
|
||||
<!-- workingPersonEngineers -->
|
||||
<!-- td:eq(39) -->
|
||||
<td class="celda_normal">
|
||||
<?=$summary['workingPersonEngineers'] ?>
|
||||
</td>
|
||||
<!-- waterReceipt -->
|
||||
<!-- td:eq(35) -->
|
||||
<td class="celda_normal">
|
||||
<?=$summary['waterReceipt'] ?>
|
||||
</td>
|
||||
|
||||
<!-- workingPersonSupervisiors -->
|
||||
<!-- td:eq(40) -->
|
||||
<td class="celda_normal">
|
||||
<?=$summary['workingPersonSupervisiors'] ?>
|
||||
</td>
|
||||
<!-- waterConsumption -->
|
||||
<!-- td:eq(36) -->
|
||||
<td class="celda_normal">
|
||||
<?=$summary['waterConsumption'] ?>
|
||||
</td>
|
||||
|
||||
<!-- workingPersonOperators -->
|
||||
<!-- td:eq(41) -->
|
||||
<td class="celda_normal">
|
||||
<?=$summary['workingPersonOperators'] ?>
|
||||
</td>
|
||||
<!-- ebReading -->
|
||||
<!-- td:eq(37) -->
|
||||
<td class="celda_normal">
|
||||
<?=$summary['ebReading'] ?>
|
||||
</td>
|
||||
|
||||
<!-- rollerDrivers -->
|
||||
<!-- td:eq(42) -->
|
||||
<td class="celda_normal">
|
||||
<?=" " ?>
|
||||
</td>
|
||||
|
||||
<!-- natureOfMaintenance -->
|
||||
<!-- td:eq(43) -->
|
||||
<td class="celda_normal">
|
||||
<?=" " ?>
|
||||
</td>
|
||||
|
||||
<!-- location -->
|
||||
<!-- td:eq(44) -->
|
||||
<td class="celda_normal location">
|
||||
<?=" "?>
|
||||
</td>
|
||||
|
||||
<!-- description -->
|
||||
<!-- td:eq(45) -->
|
||||
<td class="celda_normal description">
|
||||
<?=" " ?>
|
||||
</td>
|
||||
<!-- ebReadingPerUnitTon -->
|
||||
<!-- td:eq(38) -->
|
||||
<td class="celda_normal">
|
||||
<?=$summary['ebReadingPerUnitTon'] ?>
|
||||
</td>
|
||||
|
||||
|
||||
<!-- msSeperation -->
|
||||
<!-- td:eq(46) -->
|
||||
<td class="celda_normal">
|
||||
<?=$summary['msSeperation'] ?>
|
||||
</td>
|
||||
<!-- workingPersonEngineers -->
|
||||
<!-- td:eq(39) -->
|
||||
<td class="celda_normal">
|
||||
<?=$summary['workingPersonEngineers'] ?>
|
||||
</td>
|
||||
|
||||
<!-- edWaste -->
|
||||
<!-- td:eq(47) -->
|
||||
<td class="celda_normal">
|
||||
<?=$summary['edWaste'] ?>
|
||||
</td>
|
||||
<!-- workingPersonSupervisiors -->
|
||||
<!-- td:eq(40) -->
|
||||
<td class="celda_normal">
|
||||
<?=$summary['workingPersonSupervisiors'] ?>
|
||||
</td>
|
||||
|
||||
<!-- coolerBags -->
|
||||
<!-- td:eq(48) -->
|
||||
<td class="celda_normal">
|
||||
<?=$summary['coolerBags'] ?>
|
||||
</td>
|
||||
<!-- workingPersonOperators -->
|
||||
<!-- td:eq(41) -->
|
||||
<td class="celda_normal">
|
||||
<?=$summary['workingPersonOperators'] ?>
|
||||
</td>
|
||||
|
||||
<!-- edPlus20Waste -->
|
||||
<!-- td:eq(49) -->
|
||||
<td class="celda_normal">
|
||||
<?=$summary['edPlus20Waste'] ?>
|
||||
</td>
|
||||
<!-- rollerDrivers -->
|
||||
<!-- td:eq(42) -->
|
||||
<td class="celda_normal">
|
||||
<?=" " ?>
|
||||
</td>
|
||||
|
||||
<!--cycloneWaste -->
|
||||
<!-- td:eq(50) -->
|
||||
<td class="celda_normal">
|
||||
<?=$summary['cycloneWaste'] ?>
|
||||
</td>
|
||||
<!-- natureOfMaintenance -->
|
||||
<!-- td:eq(43) -->
|
||||
<td class="celda_normal">
|
||||
<?=" " ?>
|
||||
</td>
|
||||
|
||||
<!-- location -->
|
||||
<!-- td:eq(44) -->
|
||||
<td class="celda_normal location">
|
||||
<?=" "?>
|
||||
</td>
|
||||
|
||||
<!-- description -->
|
||||
<!-- td:eq(45) -->
|
||||
<td class="celda_normal description">
|
||||
<?=" " ?>
|
||||
</td>
|
||||
|
||||
|
||||
<!-- msSeperation -->
|
||||
<!-- td:eq(46) -->
|
||||
<td class="celda_normal">
|
||||
<?=$summary['msSeperation'] ?>
|
||||
</td>
|
||||
|
||||
<!-- edWaste -->
|
||||
<!-- td:eq(47) -->
|
||||
<td class="celda_normal">
|
||||
<?=$summary['edWaste'] ?>
|
||||
</td>
|
||||
|
||||
<!-- coolerBags -->
|
||||
<!-- td:eq(48) -->
|
||||
<td class="celda_normal">
|
||||
<?=$summary['coolerBags'] ?>
|
||||
</td>
|
||||
|
||||
<!-- edPlus20Waste -->
|
||||
<!-- td:eq(49) -->
|
||||
<td class="celda_normal">
|
||||
<?=$summary['edPlus20Waste'] ?>
|
||||
</td>
|
||||
|
||||
<!--cycloneWaste -->
|
||||
<!-- td:eq(50) -->
|
||||
<td class="celda_normal">
|
||||
<?=$summary['cycloneWaste'] ?>
|
||||
</td>
|
||||
|
||||
</tr>
|
||||
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</tfoot>
|
||||
|
||||
<br><br><br>
|
||||
|
||||
|
||||
@ -222,6 +222,11 @@
|
||||
min-width: 150px;
|
||||
max-width: 150px;
|
||||
}
|
||||
|
||||
tfoot tr {
|
||||
background-color:rgb(235, 236, 203);
|
||||
}
|
||||
|
||||
</style>
|
||||
|
||||
|
||||
@ -378,35 +383,27 @@
|
||||
|
||||
} ?>
|
||||
|
||||
<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>
|
||||
<td style="background-color:rgb(189, 9, 6); color:#ffff;">
|
||||
<b> Total </b>
|
||||
</td>
|
||||
|
||||
<tr>
|
||||
<td class="celda_normal "><b><?=$summary['rough_kgs']?></b></td>
|
||||
<td class="celda_normal "><b><?=$summary['fine_kgs']?></b></td>
|
||||
<td class="celda_normal "><b><?=$summary['total_kgs']?></b></td>
|
||||
<td class="celda_normal "> </td>
|
||||
</tr>
|
||||
|
||||
<td style="background-color:rgb(189, 9, 6); color:#ffff;">
|
||||
<b> Total </b>
|
||||
</td>
|
||||
|
||||
<td class="celda_normal "><?=$summary['rough_kgs']?></td>
|
||||
<td class="celda_normal "><?=$summary['fine_kgs']?></td>
|
||||
<td class="celda_normal "><?=$summary['total_kgs']?></td>
|
||||
</tr>
|
||||
|
||||
</tfoot>
|
||||
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@ -226,9 +226,9 @@
|
||||
<!-- Rec qty changed to invoice qty -->
|
||||
<th>Invoice Qty</th>
|
||||
<th>Net weight</th>
|
||||
<th>Taxable Amt</th>
|
||||
<!-- <th>Taxable Amt</th>
|
||||
<th>Tax Amt</th>
|
||||
<th>Total Amt</th>
|
||||
<th>Total Amt</th> -->
|
||||
<th>Vechicle No</th>
|
||||
<th>Driver</th>
|
||||
<th>Transporter</th>
|
||||
@ -281,9 +281,9 @@
|
||||
<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->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->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->DriverName ?></td>
|
||||
|
||||
@ -25,7 +25,6 @@
|
||||
"kint-php/kint": "^5.0.4",
|
||||
"mikey179/vfsstream": "^1.6",
|
||||
"nexusphp/cs-config": "^3.6",
|
||||
"phpunit/phpunit": "^10.5.16",
|
||||
"predis/predis": "^1.1 || ^2.0"
|
||||
},
|
||||
"suggest": {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user