diff --git a/application/config/routes.php b/application/config/routes.php index b214a20a..350149a3 100755 --- a/application/config/routes.php +++ b/application/config/routes.php @@ -294,3 +294,6 @@ $route['Addaction'] = "purchaseorder/Nonconfirmative"; $route['ncrlist'] = "purchaseorder/Nonconfirmativelist"; /* End of file routes.php */ /* Location: ./application/config/routes.php */ + + +$route['DeliverPerformance']="user/deliver_perform"; diff --git a/application/controllers/user.php b/application/controllers/user.php index 1b210c8d..1a107d81 100755 --- a/application/controllers/user.php +++ b/application/controllers/user.php @@ -1376,6 +1376,40 @@ function Adduserdepartment() $this->loadViews("404", $this->global, NULL, NULL); } + //this function used to delivery performances + +function deliver_perform() +{ + // if ($this->input->post('btn_submit')) { + + $this->global['pageTitle'] = 'Siddharth : Delivery Performance'; + + + $ab=$this->input->post('financialyear'); + + $fa=substr($ab,0,-5); + $aa=substr($ab,5,5); + $m=$this->input->post('month'); + + //print_r($prod); + //die; + + $data['fy']=$this->user_model->fincalYear(); + $data['per']=$this->user_model->deliver_perform($fa,$aa,$m); + + // // print_r( $data['spurchse']); + + $this->loadviews("deliver_perform",$this->global,$data,NULL); + + + + + + + +// } + +} } ?> diff --git a/application/models/user_model.php b/application/models/user_model.php index 11b42096..64a5260b 100755 --- a/application/models/user_model.php +++ b/application/models/user_model.php @@ -234,6 +234,59 @@ class User_model extends CI_Model return TRUE; } + + + //this function used to delivery performances + + function deliver_perform($fa,$aa,$m) +{ + + + + $sql="select ip_invoices.*,ip_invoice_items.item_quantity as qty, + ip_clients.* from ip_invoices + join ip_clients on ip_clients.client_id=ip_invoices.client_id +join ip_invoice_items on ip_invoice_items .invoice_id =ip_invoices.invoice_id + join ip_invoice_custom icf on icf.invoice_id = ip_invoices.invoice_id + where icf.invoice_custom_fieldid = 8 and ip_invoices.invoice_status_id != 1"; + + + + if ($fa and $aa != ''){ + + $sql.=" and (ip_invoices.invoice_date_created >= '".$fa."-04-01' and ip_invoices.invoice_date_created <= '".$aa."-03-31')"; + + } + + + + + if ($m!= ''){ + + $sql.=" and monthname(ip_invoices.invoice_date_created) = '".$m."'"; + + } + + + $query = $this->db->query($sql); + return $query->result(); +} + + function fincalYear() + { + $sql="SELECT + CASE WHEN MONTH(invoice_date_created)>=4 THEN + concat(YEAR(invoice_date_created), '-',YEAR(invoice_date_created)+1) + ELSE concat(YEAR(invoice_date_created)-1,'-', YEAR(invoice_date_created)) END AS financial_year + FROM ip_invoices +GROUP BY financial_year "; + + $query = $this->db->query($sql); + //print_r($query->result()); + return $query->result(); + } + + } \ No newline at end of file diff --git a/application/views/deliver_perform.php b/application/views/deliver_perform.php new file mode 100644 index 00000000..07ab776a --- /dev/null +++ b/application/views/deliver_perform.php @@ -0,0 +1,309 @@ + + + + + + +
Delivery Performance
+ input->post('financialyear')){
+ $ab=$this->input->post('financialyear');
+ echo '('.$ab.')';
+ echo ' ';
+
+ }
+ if($this->input->post('month')){
+ $m=$this->input->post('month');
+ echo '('.$m.')';
+ echo ' ';
+ }
+
+ ?>
+
| S.No | +OrderedDate | +DispatchDate | +CustomerName | +InvoiceNumber | +OrderedQuantity | +DispatchQuantity | +Rating | + +
|---|---|---|---|---|---|---|---|
| + | invoice_date_created)); + echo $itemdate; + ?> + | +invoice_date_created)); + echo $invoicedate; + ?> + | + +client_name);?> | +invoice_number); ?> | + + +qty)); + ?> | + +qty); + echo number_format(round($rel->qty)); + ?> | + + + + +qty); + $DispatchQuantity= round($rel->qty); + $Rating =$DispatchQuantity / $OrderedQuantity *100; + + + echo number_format($Rating, 2, '.', ' ') ; ?> | + +