QAD-INWARD

This commit is contained in:
velz2020 2017-12-12 17:50:09 +05:30
parent 7c65d39555
commit 1c0c3a5ddc
11 changed files with 2310 additions and 35 deletions

View File

@ -204,6 +204,7 @@ $route['ViewIncomeExpense'] = "cashbook/incomeExpenseList";
$route['addNewIncomeExpense'] = "cashbook/addNewIncomeExpenseLoad";
$route['addIncomeExpense'] = "cashbook/addIncomeExpense";
$route['qualityreportlist'] = "quality/reportList";
$route['qualityreportlistinward'] = "quality/reportListInward";
//<-------------Store page----------------->
$route['Stock'] = "storestatus/storeavailability";
$route['UpdatePOStatus'] = "servicepurchaseorder/UpdateServicePOStatus";

View File

@ -30,6 +30,7 @@ class quality extends BaseController
$data['products'] = $this->quality_model->getAllprodcuts();
$data['customers'] = $this->quality_model->getAllcustomers();
$data['existspec'] = $this->quality_model->getAllspec();
$data['existspecinward'] = $this->quality_model->getAllspecInward();
$this->global['pageTitle'] = 'Siddharth : Quality Master';
$this->loadViews("qualitymasterlistview", $this->global, $data , NULL);
@ -40,14 +41,27 @@ class quality extends BaseController
{
$data['records'] = $this->quality_model->getTestMasterforList();
$this->global['pageTitle'] = 'Siddharth : Quality Master';
$this->global['pageTitle'] = 'Siddharth : Prodcut Report List ';
$this->loadViews("reportmasterlist", $this->global, $data , NULL);
}
public function reportListInward()
{
$data['records'] = $this->quality_model->getTestMasterforListInward();
$this->global['pageTitle'] = 'Siddharth : Report List Inward';
$this->loadViews("reportmasterlist_inward", $this->global, $data , NULL);
}
function addNewPage()
{
$data['products'] = $this->quality_model->getAllprodcuts();
$data['customers'] = $this->quality_model->getAllcustomers();
$data['productsoutward'] = $this->quality_model->getAllprodcuts();
$data['customersoutward'] = $this->quality_model->getAllcustomers();
$data['productsinward'] = $this->quality_model->getAllprodcutsInward();
$data['customersinward'] = $this->quality_model->getAllcustomersInward();
$this->global['pageTitle'] = 'Siddharth : Quality Master';
@ -59,6 +73,9 @@ class quality extends BaseController
$product = $this->input->post('param2');
$customer = $this->input->post('param3');
$jsondata = $this->input->post('param1');
$type = $this->input->post('param4');
//echo $customer;exit();
$createdby = $this->session->userdata ( 'userId' );
$phpdata = json_decode($jsondata);
$total = 0;
@ -78,14 +95,14 @@ class quality extends BaseController
if($isExist[0]->count == 0)
{
$tostore = array('customer_id'=>$customer,'product_id'=>$product,'testtype'=>$name,'uom'=>$uom,'min'=>$min,'max'=>$max,'temp'=>$temp,'created_by'=>$createdby);
$tostore = array('customer_id'=>$customer,'product_id'=>$product,'testtype'=>$name,'uom'=>$uom,'min'=>$min,'max'=>$max,'temp'=>$temp,'type'=>$type,'created_by'=>$createdby);
$res = $this->quality_model->addSpecMast($tostore);
//echo 'i'.$res;
}
else if($isExist[0]->count == 1)
{
$tostore = array('uom'=>$uom,'min'=>$min,'max'=>$max,'temp'=>$temp,'updated_by'=>$createdby);
$tostore = array('uom'=>$uom,'min'=>$min,'max'=>$max,'temp'=>$temp,'type'=>$type,'updated_by'=>$createdby);
$res = $this->quality_model->updateSpecMast($tostore,$product,$customer,$name);
//echo 'u'.$res;
}
@ -143,17 +160,39 @@ class quality extends BaseController
}
function viewIndInwardReport()
{
$reportid = $this->uri->segment(3);
$data['reportdata'] = $this->quality_model->getIndividualInwardReportData($reportid);
$this->global['pageTitle'] = 'Siddharth : View Individual Report';
$this->loadViews("viewindInwardreport", $this->global, $data, NULL);
}
function printReportPDF()
{
$type = '';
$html = '';
$filename = '';
if($this->input->post('type'))
{
$type = $this->input->post('type');
}
$reportid = $this->input->post('rid');
$data['reportdata'] = $this->quality_model->getIndividualReportData($reportid);
$filename = 'PRE DESPATCH INSPECTION REPORT'.$reportid;
$html = $this->load->View("viewindreportpdf",$data,true);
if($type != 'INWARD' or $type == ''){
$data['reportdata'] = $this->quality_model->getIndividualReportData($reportid);
$filename = 'PRE DESPATCH INSPECTION REPORT'.$reportid;
$html = $this->load->View("viewindreportpdf",$data,true);
}
else if($type == 'INWARD')
{
$data['reportdata'] = $this->quality_model->getIndividualInwardReportData($reportid);
$filename = 'INWARD MATERIAL INSPECTION REPORT'.$reportid;
$html = $this->load->View("viewindinwardreportpdf",$data,true);
}
require APPPATH . '/third_party/mpdf/mpdf.php';
$mpdf=new mPDF('utf-8','A4-P',7,10,10, 10, 10, 24, 4, 6);
$mpdf->SetDisplayMode('fullpage');
@ -170,7 +209,7 @@ class quality extends BaseController
{
$productid = $this->input->post('param1');
$customerid = $this->input->post('param2');
//echo 'from cn'.$productid.'-'.$customerid;
//echo 'from cn'.$productid.'-'.$customerid;exit();
$res = $this->quality_model->getSpecifications($productid,$customerid);
echo json_encode($res);
}
@ -275,6 +314,140 @@ class quality extends BaseController
}
function saveInwardTestReportData()
{
date_default_timezone_get('Asia/Kolkata');
$testjson = $this->input->post('param1');
$loijson = $this->input->post('param2');
$afsjson = $this->input->post('param3');
$igrno = $this->input->post('param4');
$igrlineitemno = $this->input->post('param5');
$chart = $this->input->post('param7');
$report_date = $this->input->post('param8');
$report_date = date_format(date_create($report_date),'Y-m-d');
$approver = $this->input->post('param6');
$testphpdata = json_decode($testjson,true);
$loiphpdata = json_decode($loijson,true);
$afsphpdata = json_decode($afsjson,true);
//print_r($afsphpdata);die();
$createdon = date('Y-m-d H:i:s');
$createby = $this->session->userdata ( 'userId' );
$masterreportdata = array('igrno'=>$igrno,'igrlineitemno'=>$igrlineitemno,'batchdate'=>$report_date,'createdby'=>$createby,'createdon'=>$createdon,'approvedby'=>$approver,'chartdata'=>$chart);
$MASTERID = $this->quality_model->saveMasterTestData($masterreportdata);
// $descrition = '';
// $min = '';
// $max = '';
// $uom = '';
// $act1 = '';
// $act2 = '';
// $act3 = '';
// $average = '';
// $results = '';
// $remarks1 = '';
foreach($testphpdata as $data)
{
//print_r($data);die();
$descrition = $data['Description'];
$min = $data['SpecificationMin'];
$max = $data['SpecificationMax'];
$uom = $data['SpecificationUOM'];
$act1 = $data['ACT X1'];
$act2 = $data['ACT X2'];
$act3 = $data['ACT X3'];
$average = $data['Average'];
$results = $data['Results'];
$remarks1 = $data['Remarks'];
$testreportdata = array('testreport_id'=>$MASTERID,'description'=>$descrition,'min'=>$min,'max'=>$max,'UOM'=>$uom,'act1'=>$act1,'act2'=>$act2,'act3'=>$act3,'average'=>$average,'result'=>$results,'remarks'=>$remarks1);
$reportid = $this->quality_model->saveTestReportData($testreportdata);
}
// $start = '';
// $end = '';
// $temp = '';
// $w1 = '';
// $w2 = '';
// $w3 = '';
// $loip = '';
// $remark = '';
foreach($loiphpdata as $loi)
{
$start = $loi['Heating Timestart'];
$end = $loi['Heating Timeend'];
$temp = $loi['Temp *c'];
$w1 = $loi['Crucible Weight w1(g)'];
$w2 = $loi['Before Heatingw2(g)'];
$w3 = $loi['After Heatingw3(g)'];
$loip = $loi['L.O.I %'];
$remark = $loi['Remarks'];
//echo $loip;
//echo $remark;die();
$loitabledata = array('testreport_id'=>$MASTERID,'start_time'=>$start,'end_time'=>$end,'temp'=>$temp,'w1'=>$w1,'w2'=>$w2,'w3'=>$w3,'loi_percentage'=>$loip,'remarks'=>$remark);
$loiid = $this->quality_model->saveTestReportLOIData($loitabledata);
}
$count =0;
foreach($afsphpdata as $afs)
{
$count++;
if($count != 12){
$ssize = $afs['Sieve Size µm'];
$mesh_size = $afs['Mesh Size'];
$sandweight = $afs['Sand Weight'];
$Percentage = $afs['Percentage'];
$Multiplier = $afs['Multiplier'];
$Product = $afs['Product'];
$afstabledata = array('testreport_id'=>$MASTERID,'sieve_size'=>$ssize,'mesh_size'=>$mesh_size,'sandweight'=>$sandweight,'percentage'=>$Percentage,'multiplier'=>$Multiplier,'product'=>$Product);
$afsid = $this->quality_model->saveTestReportAFSData($afstabledata);
}
}
echo "Report Data Saved Successfully!";
}
function addNewInward_Report()
{
$data['records'] = $this->quality_model->getIGRNOforReport();
$data['emplist'] = $this->quality_model->getEmplistforReport();
$this->global['pageTitle'] = 'Siddharth : Inward Inspection';
$this->loadViews("inward_report_create", $this->global,$data,NULL);
}
function getIGRLineItemNo()
{
$igrno = $this->input->post('param1');
$data['igrdetails'] = $this->quality_model->getIGRLineItemNo($igrno);
//print_r($data['igrdetails']);
echo json_encode($data['igrdetails']);
}
function getIGRDetails()
{
$igrno = $this->input->post('param1');
$igrlineitemno = $this->input->post('param2');
$data['igrdetails'] = $this->quality_model->getIGRDataforReport($igrno,$igrlineitemno);
//print_r($data['igrdetails']);
echo json_encode($data['igrdetails']);
}
function pageNotFound()
{

View File

@ -18,6 +18,15 @@ class Quality_model extends CI_Model
return $result->result();
}
function getAllprodcutsInward()
{
$this->db->select('MaterialCode,MaterialName');
$this->db->from('T_MaterialMaster');
$this->db->like('T_MaterialMaster.Category','raw material');
$result = $this->db->get();
return $result->result();
}
function getAllcustomers()
{
$this->db->select('client_id,client_name');
@ -26,6 +35,15 @@ class Quality_model extends CI_Model
return $result->result();
}
function getAllcustomersInward()
{
$this->db->select('SupplierID,SupplierName');
$this->db->from('T_SupplierDetailsN');
$this->db->where('IsActive',1);
$result = $this->db->get();
return $result->result();
}
function checkExist($product,$customer,$name)
{
$this->db->select('count(*) as count');
@ -69,6 +87,16 @@ class Quality_model extends CI_Model
$result = $this->db->get();
return $result->result();
}
function getAllspecInward()
{
$this->db->select('T_Prodcut_Specification_Master.*,T_MaterialMaster.MaterialCode,T_MaterialMaster.MaterialName,T_SupplierDetailsN.SupplierID,T_SupplierDetailsN.SupplierName,count(*) as count');
$this->db->from('T_Prodcut_Specification_Master');
$this->db->join('T_MaterialMaster','T_Prodcut_Specification_Master.product_id=T_MaterialMaster.MaterialCode');
$this->db->join('T_SupplierDetailsN','T_Prodcut_Specification_Master.customer_id=T_SupplierDetailsN.SupplierID');
$this->db->group_by('product_id,customer_id');
$result = $this->db->get();
return $result->result();
}
function getIndividualSpec($prodcutid,$customerid)
@ -80,6 +108,20 @@ class Quality_model extends CI_Model
$this->db->where('T_Prodcut_Specification_Master.product_id',$prodcutid);
$this->db->where('T_Prodcut_Specification_Master.customer_id',$customerid);
$result = $this->db->get();
//print_r($result->result());
if(empty($result->result()))
{
$this->db->select('T_Prodcut_Specification_Master.*,T_MaterialMaster.MaterialCode,T_MaterialMaster.MaterialName as product_name,T_SupplierDetailsN.SupplierID,T_SupplierDetailsN.SupplierName as client_name');
$this->db->from('T_Prodcut_Specification_Master');
$this->db->join('T_MaterialMaster','T_Prodcut_Specification_Master.product_id=T_MaterialMaster.MaterialCode');
$this->db->join('T_SupplierDetailsN','T_Prodcut_Specification_Master.customer_id=T_SupplierDetailsN.SupplierID');
$this->db->where('T_Prodcut_Specification_Master.product_id',$prodcutid);
$this->db->where('T_Prodcut_Specification_Master.customer_id',$customerid);
$result = $this->db->get();
}
//exit();
return $result->result();
}
@ -111,10 +153,16 @@ class Quality_model extends CI_Model
function getSpecifications($productid,$customerid)
{
$this->db->where('product_id',$productid);
$this->db->where('customer_id',$customerid);
$res = $this->db->get('T_Prodcut_Specification_Master');
//echo 'from model'.$productid.'-'.$customerid;
// $this->db->where('product_id',$productid);
// $this->db->where('customer_id',$customerid);
// $res = $this->db->get('T_Prodcut_Specification_Master');
$sql = "Select * from T_Prodcut_Specification_Master where product_id = ? and customer_id = ?";
$res = $this->db->query($sql,array($productid,$customerid));
// print_r($this->db->last_query());
return $res->result();
//print_r($res->result());
}
function getEmplistforReport()
@ -210,6 +258,52 @@ class Quality_model extends CI_Model
}
function getIndividualInwardReportData($reportid)
{
$this->db->select('T_Test_Report_Master.chartdata,T_Test_Report_Master.batchdate,T_Test_Report_Master.testreport_id,T_IGR_Master.IGRNO,T_IGR_Master.DeliveryChellanOrInvoiceNo,T_IGR_Master.DeliveryChellanDate,T_IGR_Details.IGRItemNo,T_IGR_Details.QuantityAsPerInvoice,T_MaterialMaster.MaterialCode,T_MaterialMaster.Materialname,T_SupplierDetailsN.SupplierID,T_SupplierDetailsN.SupplierName,T_Test_Report_Master.approvedby,T_Employee_Details.EmpID,T_Employee_Details.FirstName,T_Employee_Details.LastName');
$this->db->from('T_Test_Report_Master');
$this->db->join('T_IGR_Master','T_Test_Report_Master.igrno=T_IGR_Master.IGRNO');
$this->db->join('T_IGR_Details','T_Test_Report_Master.igrlineitemno=T_IGR_Details.IGRItemNo');
$this->db->join('T_PurchaseOrder_Master','T_IGR_Master.PONO=T_PurchaseOrder_Master.PONO');
$this->db->join('T_MaterialMaster','T_IGR_Details.MaterialCode=T_MaterialMaster.MaterialCode');
$this->db->join('T_SupplierDetailsN','T_PurchaseOrder_Master.SupplierID=T_SupplierDetailsN.SupplierID');
$this->db->join('tbl_users','T_Test_Report_Master.createdby=tbl_users.userid');
$this->db->join('T_Employee_Details','tbl_users.EmpID=T_Employee_Details.EmpID');
$this->db->where('T_Test_Report_Master.testreport_id',$reportid);
$res = $this->db->get();
$reportdata['master'] = $res->result();
$this->db->select('T_Test_Report.*');
$this->db->from('T_Test_Report');
$this->db->where('testreport_id',$reportid);
$res1 = $this->db->get();
$reportdata['masterreport'] = $res1->result();
$this->db->select('T_Test_Report_LOI.*');
$this->db->from('T_Test_Report_LOI');
$this->db->where('testreport_id',$reportid);
$res1 = $this->db->get();
$reportdata['masterreportloi'] = $res1->result();
$this->db->select('T_Test_Report_AFS.*');
$this->db->from('T_Test_Report_AFS');
$this->db->where('testreport_id',$reportid);
$res1 = $this->db->get();
$reportdata['masterreportafs'] = $res1->result();
$this->db->select('T_Company_Details.CompanyName,T_Company_Details.Address,T_Company_Details.ProfilePic');
$this->db->from('T_Company_Details');
//$this->db->where('testreport_id',$reportid);
$res1 = $this->db->get();
$reportdata['company'] = $res1->result();
return $reportdata;
}
function getTestMasterforList()
{
$this->db->select('T_Test_Report_Master.testreport_id,T_Test_Report_Master.invoiceid,T_Test_Report_Master.batchdate,ip_clients.client_id,ip_clients.client_name,ip_products.product_id,ip_products.product_name,ip_products.product_description');
@ -218,9 +312,96 @@ class Quality_model extends CI_Model
$this->db->join('ip_clients','ip_invoices.client_id=ip_clients.client_id');
$this->db->join('ip_invoice_items','ip_invoices.invoice_id=ip_invoice_items.invoice_id');
$this->db->join('ip_products','ip_products.product_id=ip_invoice_items.item_product_id');
//$this->db->where('T_Test_Report_Master.invoiceid','!=0');
$res = $this->db->get();
return $res->result();
}
function getTestMasterforListInward()
{
// $this->db->select('T_Test_Report_Master.testreport_id,T_Test_Report_Master.igrno,T_Test_Report_Master.igrlineitemno,T_Test_Report_Master.batchdate,ip_clients.client_id,ip_clients.client_name,ip_products.product_id,ip_products.product_name,ip_products.product_description');
// $this->db->from('T_Test_Report_Master');
// $this->db->join('ip_invoices','T_Test_Report_Master.invoiceid=ip_invoices.invoice_number');
// $this->db->join('ip_clients','ip_invoices.client_id=ip_clients.client_id');
// $this->db->join('ip_invoice_items','ip_invoices.invoice_id=ip_invoice_items.invoice_id');
// $this->db->join('ip_products','ip_products.product_id=ip_invoice_items.item_product_id');
// $res = $this->db->get();
// return $res->result();
$this->db->select('T_Test_Report_Master.batchdate,T_Test_Report_Master.testreport_id,T_IGR_Master.IGRNO,T_IGR_Master.DeliveryChellanOrInvoiceNo,T_IGR_Master.DeliveryChellanDate,T_IGR_Details.IGRItemNo,T_IGR_Details.QuantityAsPerInvoice,T_MaterialMaster.MaterialCode,T_MaterialMaster.Materialname,T_SupplierDetailsN.SupplierID,T_SupplierDetailsN.SupplierName,T_Test_Report_Master.approvedby,T_Employee_Details.EmpID,T_Employee_Details.FirstName,T_Employee_Details.LastName');
$this->db->from('T_Test_Report_Master');
$this->db->join('T_IGR_Master','T_Test_Report_Master.igrno=T_IGR_Master.IGRNO');
$this->db->join('T_IGR_Details','T_Test_Report_Master.igrlineitemno=T_IGR_Details.IGRItemNo');
$this->db->join('T_PurchaseOrder_Master','T_IGR_Master.PONO=T_PurchaseOrder_Master.PONO');
$this->db->join('T_MaterialMaster','T_IGR_Details.MaterialCode=T_MaterialMaster.MaterialCode');
$this->db->join('T_SupplierDetailsN','T_PurchaseOrder_Master.SupplierID=T_SupplierDetailsN.SupplierID');
$this->db->join('tbl_users','T_Test_Report_Master.createdby=tbl_users.userid');
$this->db->join('T_Employee_Details','tbl_users.EmpID=T_Employee_Details.EmpID');
$this->db->order_by('testreport_id','desc');
$res = $this->db->get();
return $res->result();
}
function getIGRNOforReport()
{
// $this->db->distinct();
// $this->db->select('IGRNO');
// $this->db->from('T_IGR_Details');
// $this->db->join('T_MaterialMaster','T_IGR_Details.MaterialCode=T_MaterialMaster.MaterialCode');
// $this->db->like('T_MaterialMaster.Category','raw material');
$sql = 'select distinct IGRNO from T_IGR_Details
join T_MaterialMaster on T_IGR_Details.MaterialCode = T_MaterialMaster.MaterialCode
where T_MaterialMaster.Category like "%Raw Material%" order by IGRNO desc';
$result = $this->db->query($sql);
return $result->result();
}
function getIGRLineItemNo($igrno)
{
// $this->db->select('IGRItemNo');
// $this->db->from('T_IGR_Details');
// $this->db->where('IGRNO',$igrno);
$sql = 'select IGRItemNo from T_IGR_Details
join T_MaterialMaster on T_IGR_Details.MaterialCode = T_MaterialMaster.MaterialCode
where IGRNO = ? and T_MaterialMaster.Category like "%Raw Material%"';
$result = $this->db->query($sql,array($igrno));
return $result->result();
}
function getIGRDataforReport($igrno,$igrlineitemno)
{
//echo $igrno.'-'.$igrlineitemno;die();
// $this->db->select('T_IGR_Master.DeliveryChellanOrInvoiceNo,T_IGR_Master.DeliveryChellanDate,T_SupplierDetailsN.SupplierID,T_SupplierDetailsN.SupplierName,T_MaterialMaster.MaterialCode,T_MaterialMaster.MaterialName,T_IGR_Details.QuantityAsPerInvoice');
// $this->db->from('T_IGR_Master');
// $this->db->join('T_IGR_Details','T_IGR_Master.IGRNO=T_IGR_Details.IGRNO');
// $this->db->join('T_MaterialMaster','T_IGR_Details.MaterialCode=T_MaterialMaster.MaterialCode');
// $this->db->join('T_PurchaseOrder_Master','T_IGR_Master.PONO=T_PurchaseOrder_Master.PONO');
// $this->db->join('T_SupplierDetailsN','T_PurchaseOrder_Master.SupplierID=T_SupplierDetailsN.SupplierID');
// $this->db->where('T_IGR_Details.IGRNO',$igrno);
// $this->db->where('T_IGR_Details.IGRItemNo',$igrlineitemno);
// $this->db->order_by('T_IGR_Master.IGRNO');
// $res = $this->db->get();
// return $res->result();
$sql = 'select T_IGR_Master.DeliveryChellanOrInvoiceNo, date_format(T_IGR_Master.DeliveryChellanDate,"%d-%m-%Y") as DeliveryChellanDate,T_SupplierDetailsN.SupplierID,T_SupplierDetailsN.SupplierName,T_MaterialMaster.MaterialCode,
T_MaterialMaster.MaterialName,T_IGR_Details.QuantityAsPerInvoice
from T_IGR_Master
join T_IGR_Details on T_IGR_Master.IGRNO=T_IGR_Details.IGRNO
join T_MaterialMaster on T_IGR_Details.MaterialCode=T_MaterialMaster.MaterialCode
join T_PurchaseOrder_Master on T_IGR_Master.PONO=T_PurchaseOrder_Master.PONO
join T_SupplierDetailsN on T_PurchaseOrder_Master.SupplierID=T_SupplierDetailsN.SupplierID
where T_IGR_Master.IGRNO = ? and T_IGR_Details.IGRItemNo = ?';
$res = $this->db->query($sql,array($igrno,$igrlineitemno));
return $res->result();
}
}
?>

View File

@ -581,6 +581,13 @@ $(function() {
<span>Product Test Report</span>
</a>
</li>
<li class="treeview">
<a href="<?php echo base_url(); ?>qualityreportlistinward">
<i class="fa fa-hand-o-down"></i>
<span>Inward Material Test Report</span>
</a>
</li>
<?php
}

File diff suppressed because it is too large Load Diff

View File

@ -11,16 +11,29 @@ th{
$products2=array(-1=>'Select Products');
foreach($products as $product)
foreach($productsoutward as $product)
{
$products2[$product->product_id] =$product->product_id.'-'.$product->product_name.'-'.$product->product_description;
}
$customers2 = array(-1 => 'Select Customer');
foreach($customers as $customer)
foreach($customersoutward as $customer)
{
$customers2[$customer->client_id] = $customer->client_name;
}
$productsinward1=array(-1=>'Select Products');
foreach($productsinward as $product)
{
$productsinward1[$product->MaterialCode] =$product->MaterialCode.'-'.$product->MaterialName;
}
$customersinward1 = array(-1 => 'Select Customer');
foreach($customersinward as $customer)
{
$customersinward1[$customer->SupplierID] = $customer->SupplierName;
}
?>
<script src="<?php echo base_url()?>assets/lightswitch/lightswitch/lib/jquery.tabletojson.js"></script>
<script src="<?php echo base_url()?>assets/lightswitch/lightswitch/lib/jquery.tabletojson.min.js"></script>
@ -52,12 +65,46 @@ foreach($customers as $customer)
<div class="box-body">
<div class="row">
<div class="col-md-3">
<div class="col-md-1">
<?php
// $data = array(
// 'name' => 'newsletter',
// 'id' => 'newsletter',
// 'value' => 'accept',
// 'checked' => TRUE,
// 'style' => 'margin:10px'
// );
// echo form_checkbox($data);
?>
<input type="radio" value="1" name="type" id="OutWard" onclick="changeType(this.value);"/>&nbsp;&nbsp;OutWard
</div>
<div class="col-md-1">
<input type="radio" value="0" name="type" id="Inward" onclick="changeType(this.value);"/>&nbsp;&nbsp;InWard
</div>
<div id='outwardarea' style="display:block;">
<div class="col-md-3">
<?php echo form_dropdown('name="product"',$products2,set_value('product',$products2[-1]),'id="product"' ,'class="form-control select2');?>
</div>
<div class="col-md-3">
<?php echo form_dropdown('name="customer"',$customers2,set_value('customer',$customers2[-1]),'id="customer"' ,'class="form-control select2');?>
</div>
</div>
<div id='inwardarea' style="display:none;">
<div class="col-md-3">
<?php echo form_dropdown('name="productinward"',$productsinward1,set_value('productinward',$productsinward1[-1]),'id="productinward"' ,'class="form-control select2');?>
</div>
<div class="col-md-3">
<?php echo form_dropdown('name="customerinward"',$customersinward1,set_value('customerinward',$customersinward1[-1]),'id="customerinward"' ,'class="form-control select2');?>
</div>
</div>
<div class="col-md-3">
@ -182,19 +229,65 @@ foreach($customers as $customer)
</script>
<script>
$(document).ready(function() {
//alert();
$('#OutWard').attr('checked','true');
});
function changeType(v)
{
var val = v
// alert(val);
if(val == 0)
{
//alert('InWard');
$('#inwardarea').css({'display':'block'});
$('#outwardarea').css({'display':'none'});
}
else if(val == 1)
{
//alert('OutWard');
$('#inwardarea').css({'display':'none'});
$('#outwardarea').css({'display':'block'});
}
}
$('#addspec').click(function(){
var product = $('#product').val();
var customer = $('#customer').val();
if(product == -1 || customer == -1)
if($('#OutWard').is(':checked'))
{
alert('Please Select Product and Customer.');
var product = $('#product').val();
var customer = $('#customer').val();
if(product == -1 || customer == -1)
{
alert('Please Select Product and Customer.');
}
else
{
$('#specmodel').modal('show');
}
}
else
else//if($('#InWard').is(':checked'))
{
$('#specmodel').modal('show');
//alert('kj');
var productinward = $('#productinward').val();
var customerinward = $('#customerinward').val();
if(productinward == -1 || customerinward == -1)
{
alert('Please Select Product and Customer.');
}
else
{
$('#specmodel').modal('show');
}
//alert('kj');
}
});
@ -237,11 +330,25 @@ $("#specmodel").on("shown.bs.modal", function(e) {
function getAllData()
{
var type = '';
var product = '';
var customer = '';
if($('#OutWard').is(':checked'))
{
type = 'OUTWARD';
product = $('#product').val();
customer = $('#customer').val();
}
else
{
type = 'INWARD';
product = $('#productinward').val();
customer = $('#customerinward').val();
}
var alldata = $("#testspecifications").tableToJSON();
//alert(JSON.stringify(alldata));
alldata=JSON.stringify(alldata)
var product = $('#product').val();
var customer = $('#customer').val();
// alert(customer);exit();
if(product == -1 || customer == -1)
{
alert('Please Select Product and Customer.');
@ -249,16 +356,18 @@ $("#specmodel").on("shown.bs.modal", function(e) {
else{
$('#content').loader('show');
$.ajax({
data:{param1:alldata,param2:product,param3:customer},
data:{param1:alldata,param2:product,param3:customer,param4:type},
//dataType:"json",
type:"POST",
url:"<?php echo base_url() ?>quality/saveSpectficationData",
success:function(data) {
if(data)
{
$('#content').loader('hide');
alert(data);
//console.log(data);
window.location = "<?php echo base_url().'quality';?>";
$('#content').loader('hide');
}

View File

@ -56,6 +56,7 @@
<th>Product Name</th>
<th>Company Name</th>
<th>Type</th>
<th>Total Specification</th>
@ -71,11 +72,25 @@
//print_r($data);echo "</br></br>";
?>
<tr> <td><a href="<?php echo base_url()?>quality/viewSpec/<?php echo $data->product_id.'/'.$data->customer_id ?>"><?php echo $data->product_name.'-'.$data->product_description?></a></td> <td><a href="<?php echo base_url()?>quality/viewSpec/<?php echo $data->product_id.'/'.$data->customer_id ?>"><?php echo $data->client_name?></a></td> <td><?php echo $data->count?></td></tr>
<tr> <td><a href="<?php echo base_url()?>quality/viewSpec/<?php echo $data->product_id.'/'.$data->customer_id ?>"><?php echo $data->product_name.'-'.$data->product_description?></a></td> <td><a href="<?php echo base_url()?>quality/viewSpec/<?php echo $data->product_id.'/'.$data->customer_id ?>"><?php echo $data->client_name?></a></td> <td><?php echo $data->type?> </td><td><?php echo $data->count?></td></tr>
<?php
}
}
if(!empty($existspecinward))
{
foreach($existspecinward as $in)
{
//print_r($data);echo "</br></br>";
?>
<tr> <td><a href="<?php echo base_url()?>quality/viewSpec/<?php echo $in->MaterialCode.'/'.$in->SupplierID ?>"><?php echo $in->MaterialName?></a></td> <td><a href="<?php echo base_url()?>quality/viewSpec/<?php echo $in->MaterialCode.'/'.$in->SupplierID ?>"><?php echo $in->SupplierName?></a></td> <td><?php echo $in->type?> </td><td><?php echo $in->count?></td></tr>
<?php
}
}
?>
</tbody>
</table>
<p>&nbsp;</p>

View File

@ -0,0 +1,81 @@
<?php
//print_r($records);
?>
<div class="content-wrapper">
<!-- Content Header (Page header) -->
<section class="content-header">
<h1>
<center>Inward Product Test Reports List</center>
</h1>
</section>
<section class="content">
<div class="row">
<div class="col-xs-12">
<div class="box">
<div class="box-header">
<!--<center><h3 class="box-title">-->
<div class="box-tools">
<!-- <form action="<?php echo base_url() ?>assetListing" method="POST" id="searchList">-->
<div class="col-md-3">
<a href=" <?php echo base_url().'quality/addNewInward_Report';?> " type="button" class="btn btn-primary">Add New</a>
</div>
</form>
</div><!--</h3></center>-->
</div><!-- /.box-header -->
<div class="box-body">
<br/>
<table id="testspecifications" class="table table-bordered table-hover" style="background-color:#fff;font-size:12px;">
<thead style="background-color:#ddf">
<tr>
<th>Test Report ID</th>
<th>IGRNO</th>
<th>IGR Line Item No</th>
<th>Report Date</th>
<th>Product Name</th>
<th>Customer Name</th>
</tr>
</thead>
<tbody id="specAppend">
<?php
if(!empty($records))
{
foreach($records as $data)
{
//print_r($data);echo "</br></br>";
?>
<tr> <td><a href="<?php echo base_url()?>quality/viewIndInwardReport/<?php echo $data->testreport_id ?>"><?php echo $data->testreport_id?></a></td> <td><?php echo $data->IGRNO?></td> <td><?php echo $data->IGRItemNo?></td><td style="text-align:right;"><?php echo date_format(date_create($data->batchdate),'d-m-Y');?></td><td><?php echo $data->SupplierName;?></td><td><?php echo $data->Materialname;?></td></tr>
<?php
}
}
?>
</tbody>
</table>
<p>&nbsp;</p>
<div class="row">
</div>
</div><!-- /.box-body -->
<!-- <div class="box-footer clearfix">
</div> -->
</div><!-- /.box -->
</div>
</div>
</section>
</div>

View File

@ -4,17 +4,23 @@ th{
}
</style>
<?php
//print_r($specifications);
$pname = '';
$pdec = '';
$cnamme = '';
$pid='';
$cid='';
$type= '';
foreach($specifications as $s)
{
$pname = $s->product_description;
$pname = $s->product_name;
if(!empty($s->product_description)){
$pdec = $s->product_description;
}
$cname = $s->client_name;
$pid = $s->product_id;
$cid = $s->customer_id;
$type = $s->type;
break;
}
@ -50,7 +56,7 @@ foreach($specifications as $s)
<div class="row">
<div class="col-md-3">
<input type="text" name="p" id="p" class="form-control" value="<?php echo $pname;?>" readonly>
<input type="text" name="p" id="p" class="form-control" value="<?php echo $pname;if(!empty($pdec)){echo '-'.$pdec;};?>" readonly>
<input type="hidden" name="product" id="product" value="<?php echo $pid;?>">
</div>
@ -58,7 +64,9 @@ foreach($specifications as $s)
<input type="text" name="c" id="c" class="form-control" value="<?php echo $cname;?>" readonly>
<input type="hidden" name="customer" id="customer" value="<?php echo $cid;?>">
</div>
<div class="col-md-2">
<input type="text" id="ttype" class="form-control" value = "<?php echo $type;?>" readonly>
</div>
<div class="col-md-3">
<input type="button" id="addspec" class="btn btn-primary" value = "Add New Specification">
</div>
@ -243,6 +251,7 @@ $("#specmodel").on("shown.bs.modal", function(e) {
alldata=JSON.stringify(alldata)
var product = $('#product').val();
var customer = $('#customer').val();
var type = $('#ttype').val();
if(product == -1 || customer == -1)
{
alert('Please Select Product and Customer.');
@ -250,15 +259,17 @@ $("#specmodel").on("shown.bs.modal", function(e) {
else{
$('#content').loader('show');
$.ajax({
data:{param1:alldata,param2:product,param3:customer},
data:{param1:alldata,param2:product,param3:customer,param4:type},
//dataType:"json",
type:"POST",
url:"<?php echo base_url() ?>quality/saveSpectficationData",
success:function(data) {
if(data)
{
$('#content').loader('hide');
alert(data);
window.location = "<?php echo base_url().'quality';?>";
$('#content').loader('hide');
//console.log(data);

View File

@ -0,0 +1,482 @@
<style>
.edit{
background-color:#eeffcc ! important;
}
</style>
<?php
//print_r($reportdata['master']);
$reportid = '';
$igrno = '';
$igrlineitemno = '';
$customername = '';
$product_description = '';
$batchdate = '';
$qty = '';
$inspector = '';
$approvedby = '';
$DeliveryChellanOrInvoiceNo = '';
$DeliveryChellanDate = '';
foreach($reportdata['master'] as $m)
{
$reportid = $m->testreport_id;
$igrno = $m->IGRNO;
$igrlineitemno = $m->IGRItemNo;
$customername = $m->SupplierID.'-'.$m->SupplierName;
$product_description = $m->MaterialCode.'-'.$m->Materialname;
$DeliveryChellanOrInvoiceNo = $m->DeliveryChellanOrInvoiceNo;
$qty = $m->QuantityAsPerInvoice;
$DeliveryChellanDate = $m->DeliveryChellanDate;
$batchdate = $m->batchdate;
$inspector = $m->FirstName.' '.$m->LastName;
$approvedby = $m->approvedby;
}
?>
<style>
th{
text-align:center !important;
}
</style>
<div class="content-wrapper">
<!-- Content Header (Page header) -->
<section class="content-header">
<h1>
<center>Inward Material Inspection Report - Test Report No:<?php echo $reportid;?></center>
</h1>
</section>
<section class="content">
<div class="row">
<div class="col-xs-12">
<div class="box">
<div class="box-header">
<!--<center><h3 class="box-title">-->
<div class="box-tools">
<div class="col-md-3" id="savebutton">
<input type="button" id="submit" target="_blank" value = "Print" class="btn btn-primary" onclick="PrintFunction();">
</div>
<form id="printPDF">
</div><!--</h3></center>-->
</div><!-- /.box-header -->
<div class="box-body">
<div class="row">
<div class="col-md-3">
<label>IGR No</label>
<input type="text" class="form-control" value="<?php echo $igrno;?>" readonly>
<input type="hidden" class="form-control" value="<?php echo $reportid;?>" name="rid" readonly>
<input type="hidden" class="form-control" value="INWARD" name="type" readonly>
</div>
<div class="col-md-3">
<label>IGR Line Item No</label>
<input type="text" class="form-control" value="<?php echo $igrlineitemno;?>" readonly>
</div>
</form>
<div class="col-md-3">
<label>Invoice No</label>
<input type="text" id="invoicedate" name="invoicedate" value="<?php echo $DeliveryChellanOrInvoiceNo;?>" class="form-control" readonly>
</div>
<div class="col-md-3">
<label>Invoice Date</label>
<input type="text" id="invoicedate" name="invoicedate" value="<?php echo date_format(date_create($DeliveryChellanDate),'d-m-Y');?>" class="form-control" readonly>
</div>
<div class="col-md-3">
<label>Supplier Name</label>
<input type="text" id="customername" name="customername" value="<?php echo $customername;?>" class="form-control" readonly>
</div>
<div class="col-md-3">
<label>Grade</label>
<input type="text" id="productname" name="productname" value="<?php echo $product_description;?>" class="form-control" readonly>
</div>
<div class="col-md-3">
<label>Qty</label>
<input type="text" id="qty" name="qty" value="<?php echo $qty?>" class="form-control ;" readonly>
</div>
<div class="col-md-3">
<label>Batch Date</label>
<input type="text" id="reportdate" name="reportdate" class="form-control" value = "<?php echo date_format(date_create($batchdate),'d-m-Y');?>" readonly>
</div>
</div>
<br/>
<table id="testreport" class="table table-bordered table-hover" style="background-color:#fff;font-size:12px;text-align:center;">
<thead style="background-color:#ddf;">
<tr>
<th width="3px">SNO</th>
<th>Description</th>
<th width="5px">Specification</br>Min</th><th width="5px">Specification</br>Max</th><th width="5px">Specification</br>UOM</th><th>ACT X1</th><th>ACT X2</th><th>ACT X3</th><th width="5px">Average</th><th width="5px">Results</th><th>Remarks</th>
</tr>
</thead>
<tbody id="specAppend">
<?php
$index = 0;
foreach($reportdata['masterreport'] as $master)
{
$index++;
?>
<tr> <td><?php echo $index;?></td> <td><?php echo $master->description;?></td><td><?php echo $master->min;?></td> <td><?php echo $master->max;?></td> <td><?php echo $master->UOM;?></td><td><?php if(!empty($master->act1)){ echo $master->act1; }else {echo '0.00';}?></td><td><?php if(!empty($master->act2)){ echo $master->act2; } else {echo '0.00';}?></td> <td><?php if(!empty($master->act3)){ echo $master->act3; } else {echo '0.00';}?></td> <td><?php echo $master->average;?></td> <td><?php echo $master->result;?></td> <td><?php echo $master->remarks;?></td> </tr>
<?php
}
?>
</tbody>
</table>
<p>&nbsp;</p>
<hr>
<div class="col-md-12">
<div class="col-md-3"><b> L.O.I Details </b></div> <div class="col-md-1 col-md-offset-8 text-right"><i class="fa fa-expand" id="loibutton"></i></div>
</div>
<div id="loiarea">
<table id="loitable" class="table table-bordered table-hover" style="background-color:#fff;font-size:12px;text-align:center;">
<thead style="background-color:#ddf">
<tr>
<th><center>SNO</center></th><th><center>Heating Time</center></br><center>start</center></th><th><center>Heating Time</center></br><center>end</center></th><th>Temp *c</th><th><center>Crucible Weight</center></br> <center>w1(g)<center></th><th><center>Before Heating</center></br><center>w2(g)</center></th><th><center>After Heating<center></br>w3(g)</center></th><th>L.O.I %</th><th>Remarks</th>
</tr>
</thead>
<tbody id="loiAppend">
<?php
$indexx = 0;
foreach($reportdata['masterreportloi'] as $loi)
{
$indexx++;
?>
<tr> <td><?php echo $indexx;?></td> <td><?php echo $loi->start_time;?></td> <td><?php echo $loi->end_time;?></td> <td><?php echo $loi->temp;?></td> <td><?php echo $loi->w1;?></td> <td><?php echo $loi->w2;?></td> <td><?php echo $loi->w3;?></td> <td><?php echo $loi->loi_percentage;?></td> <td><?php echo $loi->remarks;?></td></tr>
<?php
}
?>
</tbody>
</table>
</div>
<div class="col-md-12">
<div class="col-md-3"><b> AFS Details </b></div> <div class="col-md-1 col-md-offset-8 text-right"><i class="fa fa-expand" id="afsbutton"></i></div>
</div>
<div id="afsarea">
<table id="afstable" class="table table-bordered table-hover" style="background-color:#fff;font-size:12px;text-align:center;">
<thead style="background-color:#ddf">
<tr>
<th>NO</th><th>Sieve Size µm</th><th>Mesh Size</th><th>Sand Weight</th><th>Percentage</th><th>Multiplier</th><th>Product</th>
</tr>
</thead>
<tbody id="afsAppend">
<?php
$ind = 0;
$total_sandweight = 0;
$totalproduct = 0;
foreach($reportdata['masterreportafs'] as $afs)
{
$ind++;
?>
<tr> <td><?php echo $ind;?></td> <td id="<?php echo $ind.'size';?>"><?php echo $afs->sieve_size?></td> <td><?php echo $afs->mesh_size;?></td><td id="<?php echo $ind.'p';?>"><?php echo $afs->sandweight;?></td><td><?php echo $afs->percentage?></td><td ><?php echo $afs->multiplier?></td><td><?php echo $afs->product;?></td></tr>
<?php
$total_sandweight = $total_sandweight + $afs->sandweight;
$totalproduct = $totalproduct + $afs->product;
}
?>
<tr id="12"> <td>&nbsp;</td> <td><b>Total</b></td> <td >&nbsp;</td><td id="12p"><?php echo $total_sandweight;?></td><td id="12m">&nbsp;</td><td id="12pt"><?php echo number_format($totalproduct,3,'.','');?></td></tr>
</tbody>
</table>
</div>
<div class="col-md-12">
<div class="col-md-3"><b>AFS CHART </b></div> <div class="col-md-1 col-md-offset-8 text-right"><i class="fa fa-expand" id="chartbutton"></i></div>
</div>
<div id="chartarea">
<div>
<center><canvas id="myCanvas" width="1000" height="350" style="border:1px solid #d3d3d3;">
Your browser does not support the HTML5 canvas tag.</canvas></center>
</div>
</div>
<div class="row">&nbsp;</div>
<div class="col-md-12">
<div class="col-md-3">
<label>Inspected By :</label>
<input type="text" id="inspector" class="form-control" value="<?php echo $inspector;?>" readonly>
</div>
<div class="col-md-3 col-md-offset-6 ">
<label>Approved By :</label>
<input type="text" id="inspector" class="form-control" value="<?php echo $approvedby;?>" readonly>
<!-- <input type="text" id="approvedby" class="form-control"> -->
</div>
</div>
<div class="row">&nbsp;</div>
<div>
<div class="row">&nbsp;</div>
<div class="row">
</div>
</div><!-- /.box-body -->
<!-- <div class="box-footer clearfix">
</div> -->
</div>
</div>
</section>
</div>
<script type="text/javascript" src="<?php echo base_url(); ?>assets/js/common.js" charset="utf-8"></script>
<script type="text/javascript">
$(function () {
$('#monthlylisting').DataTable({
"paging": true,
"lengthChange": true,
"searching": true,
"ordering": true,
"aaSorting": [[ 0, "asc" ]],
"info": true,
"autoWidth": true
});
});
</script>
<script>
$(document).ready(function(){
var dataset = [];
var datalabel = [];
for(x=1;x<=11;x++)
{
var swid = x+'p';
var sanddata = document.getElementById(swid).textContent;
dataset.push(sanddata);
var sizeid = x+'size';
var sizedata = document.getElementById(sizeid).textContent;
datalabel.push(sizedata);
}
drawChart(dataset,datalabel);
}); // End of document on ready funciton
function drawChart(dataset,datalabel){
var c = document.getElementById("myCanvas");
var ctx = c.getContext("2d");
ctx.clearRect(0, 0, c.width, c.height);
var xlabels = datalabel;
var xlabelscount = xlabels.length;
console.log(xlabelscount);
var dataset = dataset;
Array.prototype.max = function() {
return Math.max.apply(null, this);
};
var maxdataitem = dataset.max();
maxdataitem = Math.round((maxdataitem + 10)/5);
var dataset_locationsX = [];
var dataset_locationsY = [];
var canvaswidth = document.getElementById('myCanvas').offsetWidth;
var canvasheight = document.getElementById('myCanvas').offsetHeight;
ctx.beginPath();
ctx.moveTo(30,0);
ctx.lineTo(30,canvasheight);
ctx.strokeStyle="black";
ctx.stroke();
ctx.closePath();
ctx.beginPath();
ctx.moveTo(0,(canvasheight-30));
ctx.lineTo(canvaswidth,(canvasheight-30));
ctx.strokeStyle="black";
ctx.stroke();
ctx.closePath();
ctx.beginPath();
ctx.font = "bold 12px Arial";
ctx.fillStyle = "black";
ctx.fillText("Sieve Size µm",(canvaswidth/2),(canvasheight-2));
ctx.closePath();
var xaxislabelwidth = (canvaswidth/12);
var startingpointX = 30;
var startingpointY = (canvasheight-30);
for(i=1;i<=xlabelscount;i++) //X DataLabel
{
ctx.beginPath();
ctx.font = "10px Arial";
ctx.fillStyle = "black";
ctx.fillText(xlabels[i-1],(startingpointX+(xaxislabelwidth * i)),(startingpointY+15));
ctx.closePath();
}
for(i=1;i<=xlabelscount;i++) // X Data
{
ctx.beginPath();
ctx.arc((startingpointX+(xaxislabelwidth * i)),startingpointY,3,0,2*Math.PI);
ctx.fillStyle = "black";
ctx.fill();
ctx.closePath();
var xl = (startingpointX+(xaxislabelwidth * i));
dataset_locationsX.push(xl);
}
var j = 0;
var ylabel = 0;
for(i=1;i<=maxdataitem;i++) // y Data and Y labels
{
ctx.beginPath();
ctx.arc(startingpointX,(startingpointY-j),3,0,2*Math.PI);
ctx.fillStyle = "black";
ctx.fill();
var yl = ((startingpointY-j));
dataset_locationsY.push(yl);
ctx.fillStyle = "black";
ctx.font = "10px Arial";
ctx.fillText((j/7),(startingpointX-30),(startingpointY-j));
ylabel = ylabel + 5;
j=j+35;
ctx.closePath();
}
var finallocationofY = [];
var finallocationofX = [];
for(i=1;i<=xlabelscount;i++) //Exact chart Data Draw red circle
{
ctx.beginPath();
<!-- ctx.arc((parseFloat(dataset_locationsX[i-1])),((startingpointY - parseFloat(dataset[i-1]) * 7)),4,0,2*Math.PI); -->
ctx.fillStyle="red";
ctx.lineCap = 'round';
<!-- ctx.fill(); -->
ctx.fillRect((parseFloat(dataset_locationsX[i-1])-5),((startingpointY - parseFloat(dataset[i-1]) * 7)-5),8,8)
finallocationofY.push((startingpointY - parseFloat(dataset[i-1]) * 7));
finallocationofX.push(parseFloat(dataset_locationsX[i-1]));
ctx.closePath();
//Draw text for data points
ctx.beginPath();
ctx.font = "10px Arial";
ctx.fillStyle="blue";
ctx.fillText(dataset[i-1],(parseFloat(dataset_locationsX[i-1])),((startingpointY - parseFloat(dataset[i-1]) * 7)-10));
ctx.closePath();
}
for(i=0;i<=xlabelscount;i++) //Exact Chart Data Draw line
{
ctx.moveTo(finallocationofX[i],finallocationofY[i]);
ctx.lineTo(finallocationofX[i+1],finallocationofY[i+1]);
ctx.setLineDash([0,0]);
//ctx.strokeStyle="#1a75ff";
ctx.lineWidth=3;
//setInterval(function(){
ctx.stroke();
//},30000);
}
//ctx.beginPath();
for(i=1;i<=dataset_locationsY.length;i++) // Drawing Dashed Lines from Y
{
ctx.beginPath();
ctx.moveTo(startingpointX,dataset_locationsY[i]);
ctx.lineTo(canvaswidth,dataset_locationsY[i]);
ctx.setLineDash([3,6]);
ctx.strokeStyle="black";
ctx.lineWidth=0.2;
ctx.stroke();
ctx.closePath();
}
//sctx.closePath();
}
function PrintFunction()
{
// var reportid = <?php echo $reportid;?>;
// $.ajax({
// data:{param1:reportid},
// type:"POST",
// url:"<?php echo base_url() ?>quality/printReportPDF",
// success:function(data) {
// }
// });
$('#printPDF').attr('action', '<?php echo base_url() ?>quality/printReportPDF');
$('#printPDF').attr('method', 'post');
$('#printPDF').submit();
}
</script>

View File

@ -0,0 +1,188 @@
<?php
//print_r($reportdata);
$src='';
$reportid = '';
$igrno = '';
$igrlineitemno = '';
$invoiceno = '';
$invoicedate = '';
$customername = '';
$product_description = '';
$qty = '';
$batchdate = '';
$inspector = '';
$approvedby = '';
if(!empty($reportdata['master'])){
foreach($reportdata['master'] as $m)
{
$src = $m->chartdata;
$reportid = $m->testreport_id;
$invoiceno = $m->DeliveryChellanOrInvoiceNo;
$invoicedate = $m->DeliveryChellanDate;
$customername = $m->SupplierName;
$product_description = $m->Materialname;
$igrno = $m->IGRNO;
$igrlineitemno = $m->IGRItemNo;
$qty = $m->QuantityAsPerInvoice;
$batchdate = $m->batchdate;
$inspector = $m->FirstName.' '.$m->LastName;
$approvedby = $m->approvedby;
}
}
$cname = '';
$caddress = '';
$pic = '';
if(!empty($reportdata['company'])){
foreach($reportdata['company'] as $c)
{
$cname = $c->CompanyName;
$caddress = $c->Address;
$pic = $c->ProfilePic;
}
}
?>
<style>
td{
text-align:center;
height:17px;
}
table{
font-size:10px;
}
</style>
<html>
<body>
<!-- <table style="border-collapse:collapse;border-left-style:hidden;" border="1" cellspacing="0" cellpadding="0">
<tbody>
<tr><td colspan="6" style="text-align:center;"><h2>PRE DISPATCH INSPECTION REPORT</h2></td></tr>
<tr><td rowspan="5" style="text-align:center;width:20%"><img src="<?php echo base_url().'uploads/images/'.$pic;?>" alt="no image"/></td>
<td rowspan="5" style="text-align:center;"><b><?php echo $cname;?></b><br><?php echo $caddress;?></td>
<td style="text-align:center;width:30%">CUSTOMER NAME</td>
<td colspan="6"style="text-align:center;width:100%"><b><?php echo $customername;?></b></td>
</tr>
<tr><td style="text-align:center;width:10%">MATERIAL NAME</td><td style="text-align:center;width:20%"><b><?php echo $product_description;?><b></td><td style="text-align:center;width:20%">INVOICE NO</td><td style="text-align:center;width:10%"><b><?php echo $invoiceno;?></b></td></tr>
<tr><td rowspan="3">Qty</td> <td rowspan="3"> <b><?php echo $qty;?> kgs</b></td> <td>INVOICE DATE</td><td><b><?php echo date_format(date_create($invoicedate),'d-m-Y');?></b></td></tr>
<tr><td>Batch NO</td><td><b><?php echo $batchno;?></b></td></tr>
<tr><td>BATCH DATE</td><td><b><?php echo date_format(date_create($batchdate),'d-m-Y');?></b></td></tr>
</tbody>
</table> -->
<table style="border-collapse:collapse;border-left-style:hidden;width:100%" border="1" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td colspan="6"><h2>INWARD MATERIAL INSPECTION REPORT</h2></td>
</tr>
<tr >
<td rowspan="5" ><img src="<?php echo base_url().'uploads/images/'.$pic;?>" alt="no image"/></td>
<td rowspan="5" width="38%"><b><?php echo $cname;?></b><br><?php echo $caddress;?></td>
<td width="8%" rowspan="2">SUPPLIER NAME</td>
<td rowspan="2"><b><?php echo $customername;?></b></td>
<td width="8%" >IGRNO</td>
<td><b><?php echo $igrno;?></b></td>
<tr><td width="8%" >IGRItemNo</td>
<td><b><?php echo $igrlineitemno;?></b></td></tr>
</tr>
<tr>
<td rowspan="2" width="8%">MATERIAL NAME</td>
<td rowspan="2" ><b><?php echo $product_description;?></td>
<td >INVOICE NO</td>
<td ><b><?php echo $invoiceno;?></b></td>
</tr>
<tr>
<td >INVOICE DATE</td>
<td ><b><?php echo date_format(date_create($invoicedate),'d-m-Y');?></b></td>
</tr>
<tr >
<td rowspan="1" width="8%">QTY</td>
<td rowspan="1" ><b><?php echo $qty;?> kgs</b></td>
<!-- <td >BATCH NO</td>
<td ><b><?php echo "HI";?></b></td>-->
<td >BATCH DATE</td>
<td><b><?php echo date_format(date_create($batchdate),'d-m-Y');?></b></td>
</tr>
</tbody>
</table>
<br>
<table style="border-collapse: collapse;border-left-style:hidden;" border="1" cellspacing="0" cellpadding="0">
<tbody>
<tr><th rowspan="3">S.NO</th><th rowspan="3" width="160">DESCRIPTION</th><th rowspan="2" colspan="3" width="110">SPECIFICATION</th><th colspan="3" width="170">ACT</th> <th rowspan="3" width="50">Average</th> <th rowspan="3" width="110">Results</th> <th rowspan="3" width="90">Remarks</th> </tr> <tr><th rowspan="2">X1</th> <th rowspan="2">X2</th> <th rowspan="2">X3</th></tr><tr><th>Min</th><th>Max</th><th width="46">UOM</th></tr>
<?php
$index = 0;
foreach($reportdata['masterreport'] as $master)
{
$index++;
?>
<tr> <td><?php echo $index;?></td> <td style="text-align:left;"><?php echo $master->description;?></td><td><?php if($master->min == 0 || $master->min == '') { echo "-"; } else { echo $master->min;} ?></td> <td><?php if($master->max == 0 || $master->max == '') { echo '-'; } else { echo $master->max; }?></td> <td><?php echo $master->UOM;?></td><td><?php if(!empty($master->act1)){ echo $master->act1; }else {echo '0.00';}?></td><td><?php if(!empty($master->act2)){ echo $master->act2; } else {echo '0.00';}?></td> <td><?php if(!empty($master->act3)){ echo $master->act3; } else {echo '0.00';}?></td> <td><?php echo $master->average;?></td> <td><?php echo $master->result;?></td> <td style="text-align:left;"><?php echo $master->remarks;?></td> </tr>
<?php
}
?>
</tbody>
</table>
<h3>L.O.I DETAILS</h3>
<table style="border-collapse: collapse;border-left-style:hidden;" border="1" cellspacing="0" cellpadding="0">
<tbody>
<tr><th rowspan="2">S.NO</th><th width="160">HEATING TIME</th><th width="110">TEMP</th><th width="115">CRUCIBLE WEIGHT</th><th>BEFORE HEATING WEIGHT</th><th>AFTER HEATING WEIGHT</th> <th rowspan="2">L.O.I (%)</th><th rowspan="2">Remarks</th> </tr>
<tr><th>START TIME - END TIME</th><th>*C</th> <th>W1(g)</th> <th>W2(g)</th> <th>W3(g)</th></tr>
<?php
$indexx = 0;
foreach($reportdata['masterreportloi'] as $loi)
{
$indexx++;
?>
<tr> <td><?php echo $indexx;?></td> <td><?php echo $loi->start_time.'~'.$loi->end_time;?></td><td><?php echo $loi->temp;?></td> <td><?php echo $loi->w1;?></td> <td><?php echo $loi->w2;?></td> <td><?php echo $loi->w3;?></td> <td><?php echo $loi->loi_percentage;?></td> <td style="text-align:left;"><?php echo $loi->remarks;?></td></tr>
<?php
}
?>
</tbody>
</table>
<h3>AFS DETAILS</h3>
<table style="border-collapse: collapse;border-left-style:hidden;" border="1" cellspacing="0" cellpadding="0">
<tbody>
<tr > <th height="20">S.NO</th> <th width="160">Sieve Size µm </th> <th width="110">Mesh Size</th> <th width="110">SAND WEIGHT</th> <th width="110">Percantage</th> <th width="110">Multiplier</th> <th width="90">Product</th></tr>
<?php
$ind = 0;
$total_sandweight = 0;
$totalproduct = 0;
foreach($reportdata['masterreportafs'] as $afs)
{
$ind++;
?>
<tr> <td><?php echo $ind;?></td> <td id="<?php echo $ind.'size';?>"><?php echo $afs->sieve_size?></td> <td><?php echo $afs->mesh_size?></td><td id="<?php echo $ind.'p';?>"><?php echo $afs->sandweight;?></td><td><?php echo $afs->percentage?></td><td ><?php echo $afs->multiplier?></td><td><?php echo $afs->product;?></td></tr>
<?php
$total_sandweight = $total_sandweight + $afs->sandweight;
$totalproduct = $totalproduct + $afs->product;
}
?>
<tr id="12"> <td>&nbsp;</td> <td><b>Total</b></td> <td>&nbsp;</td><td id="12sw"><?php echo $total_sandweight;?></td><td id="12p"><?php echo $total_sandweight;?></td><td id="12m">&nbsp;</td><td id="12pt"><?php echo number_format($totalproduct,3,'.','');?></td></tr>
</tbody>
</table>
<br>
<div>
<!-- <center><canvas id="myCanvas" width="1000" height="350" style="border:1px solid #d3d3d3;"></canvas></center> -->
<center><img id="ren" src="<?php echo $src;?>" alt="NO"/></center>
</div>
<hr>
<br><br>
<table >
<tr><td>INSPECTOR NAME :<?php echo $inspector;?></td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>APPROVED BY :<?php echo $approvedby;?></td></tr>
<tr><td colspan="2">&nbsp;</td></tr>
<tr><td colspan="2">&nbsp;</td></tr>
<tr><td>Signature</td><td>&nbsp;</td></tr>
</table>
</body>
</html>