cashbook(pdf) and report(inward summary)

This commit is contained in:
venbatechnologies@gmail.com 2018-04-24 12:57:39 +05:30
parent ed9e23daff
commit a34a9db3fb
19 changed files with 924 additions and 255 deletions

View File

@ -243,7 +243,7 @@ $route['Report_cumulative_inward'] = "report/icumulative";
$route['Report_cumulative_raw'] = "report/rawi_cumulative";
$route['Report_consolidate_category'] = "report/rawi_consolidate";
$route['Report_pending_purchase'] = "report/pending_purchase";
$route['Report_purchase_attach'] = "report/iattach";
$route['Report_Material_inward_Register'] ="user/getMaterialInwardRegister";

View File

@ -319,7 +319,7 @@ class cashbook extends BaseController
$pathinfo = pathinfo($_FILES['myfile']['name']);
$config['upload_path'] = 'uploads/cashbook/';
$config['allowed_types'] = 'png|jpg|jpeg';
$config['allowed_types'] = 'png|jpg|jpeg|pdf';
$config['file_name'] = $_FILES['myfile']['name'];
//Load upload library and initialize configuration
@ -451,7 +451,7 @@ class cashbook extends BaseController
{
$cashfile = $this->input->post('id');
$cashid = $this->input->post('ide');
$filedata= $this->cashbook_model->deletefile($cashid);
$filedata= $this->cashbook_model->deletefile($cashid,$cashfile);
echo $filedata;
}
function Removepaymentdetails(){

View File

@ -610,7 +610,41 @@ class report extends BaseController
$this->loadviews("Report_purchase_inward",$this->global,$data, NULL);
}
}
public function iattach()
{
$this->global['pageTitle'] = $this->CompanyName.' : Reports';
if ($this->input->post('btn_submit')) {
$cname = $this->input->post('client_name');
$ab=$this->input->post('financialyear');
$fa=substr($ab,0,-5);
$aa=substr($ab,5,5);
$m=$this->input->post('month');
$frm = $this->input->post('from_date');
$t = $this->input->post('to_date');
//print_r($prod);
$data['material']=$this->dahsboard_Model->material_name();
$data['cust']=$this->dahsboard_Model->customer_name();
$data['finyear']=$this->dahsboard_Model->report_finyear();
$data['purchase']=$this->dahsboard_Model->ireport_attachment($cname,$fa,$aa,$m,$frm,$t);
}
$data['cust']=$this->dahsboard_Model->customer_name();
$data['finyear']=$this->dahsboard_Model->report_finyear();
// if($this->DEPCode == MANAGEMENT)
// {
$this->loadviews("Report_attach_inward",$this->global,$data, NULL);
// }
// else
// {
// $this->loadViews("access", $this->global, $data, NULL);
// }
}
public function iyear_wise()
{
$this->global['pageTitle'] = $this->CompanyName.' : Reports';

View File

@ -114,11 +114,13 @@ class cashbook_model extends CI_Model
}
function deletefile($cashid)
function deletefile($cashid,$cashfile)
{
$sql="UPDATE t_income_expense SET document = NULL
WHERE id = ?";
$query = $this->db->query($sql,array($cashid));
$query = $this->db->query($sql,array($cashid));
unlink("uploads/cashbook/".$cashfile);//this deletes the file on particular folder too
//print_r($this->db->last_query());
//echo $sql;
$r = $this->db->affected_rows();

View File

@ -1,15 +1,7 @@
<?php if(!defined('BASEPATH')) exit('No direct script access allowed');
<?php if(!defined('BASEPATH')) exit('No direct script access allowed');
class dahsboard_Model extends CI_Model
{
function getUserCount()
{
$sql="select count(userId) as users FROM tbl_users where isDeleted ='0'";
$query =$this->db->query($sql);
return $query->result();
}
/* HR DASHBOART Model START*/
@ -903,6 +895,7 @@ ifnull(if(POType = 'REVENUE',sum(distinct rt.AfterIGST),sum(distinct st.After_IG
ifnull(if(POType = 'REVENUE',sum(distinct rt.AfterDiscount),sum(distinct st.Afterdiscountval)),0) as discount,
ifnull(if(POType = 'REVENUE',sum(distinct rt.AfterFreightValue),sum(distinct st.AfterFreightValue)),0) as freight,
ifnull(if(POType = 'REVENUE',sum(distinct rt.AfterPackagingValue),0),0) as Package,
ifnull(rt.Insurance,0) as insurance,
round((
if(POType = 'IMPORT',sum(distinct pm.ExchangeRate * (pl.Quantity * pl.Rate)),
if(POType = 'CAPITAL' && CapitalRange = 0,sum(distinct pm.ExchangeRate * (pl.Quantity * pl.Rate)),
@ -912,6 +905,7 @@ ifnull(sum(pl.Quantity * pl.Rate),0)))
+ ifnull(if(POType = 'REVENUE',sum(distinct rt.AfterIGST),sum(distinct st.After_IGST)),0)
+ ifnull(if(POType = 'REVENUE',sum(distinct rt.AfterFreightValue),sum(distinct st.AfterFreightValue)),0)
+ ifnull(if(POType = 'REVENUE',sum(distinct rt.AfterPackagingValue),0),0)
+ ifnull(rt.Insurance,0)
- ifnull(if(POType = 'REVENUE',sum(distinct rt.AfterDiscount),sum(distinct st.Afterdiscountval)),0)),2) as total
FROM T_PurchaseOrder_Master pm
join T_PurchaseOrder_LineItem pl on pl.PONO = pm.PONO
@ -977,6 +971,7 @@ ifnull(if(POType = 'REVENUE',sum(distinct rt.AfterIGST),sum(distinct st.After_IG
ifnull(if(POType = 'REVENUE',sum(distinct rt.AfterDiscount),sum(distinct st.Afterdiscountval)),0) as discount,
ifnull(if(POType = 'REVENUE',sum(distinct rt.AfterFreightValue),sum(distinct st.AfterFreightValue)),0) as freight,
ifnull(if(POType = 'REVENUE',sum(distinct rt.AfterPackagingValue),0),0) as Package,
ifnull(rt.Insurance,0) as insurance,
round((
if(POType = 'IMPORT',sum(distinct pm.ExchangeRate * (pl.Quantity * pl.Rate)),
if(POType = 'CAPITAL' && CapitalRange = 0,sum(distinct pm.ExchangeRate * (pl.Quantity * pl.Rate)),
@ -986,6 +981,7 @@ ifnull(sum(pl.Quantity * pl.Rate),0)))
+ ifnull(if(POType = 'REVENUE',sum(distinct rt.AfterIGST),sum(distinct st.After_IGST)),0)
+ ifnull(if(POType = 'REVENUE',sum(distinct rt.AfterFreightValue),sum(distinct st.AfterFreightValue)),0)
+ ifnull(if(POType = 'REVENUE',sum(distinct rt.AfterPackagingValue),0),0)
+ ifnull(rt.Insurance,0)
- ifnull(if(POType = 'REVENUE',sum(distinct rt.AfterDiscount),sum(distinct st.Afterdiscountval)),0)),2) as total
FROM T_PurchaseOrder_Master pm
left join T_PurchaseOrder_LineItem pl on pl.PONO = pm.PONO
@ -1135,8 +1131,7 @@ group by supplier_name,material_name";
case pm.POType
when 'IMPORT'
then ifnull((sum(distinct(pl.Quantity * pl.Rate) * pm.ExchangeRate)
),0)
),0) + ifnull(rt.Insurance,0)
when 'CAPITAL'
then sum(distinct if(pm.CapitalRange=0,(( pl.Quantity * pl.Rate) * pm.ExchangeRate),( pl.Quantity * pl.Rate)
- st.Afterdiscountval))
@ -1144,6 +1139,7 @@ then sum(distinct if(pm.CapitalRange=0,(( pl.Quantity * pl.Rate) * pm.ExchangeR
+ ifnull(sum(distinct st.After_CGST),0)
+ ifnull(sum(distinct st.After_IGST),0)
+ ifnull(sum(distinct st.AfterFreightValue),0)
+ ifnull(rt.Insurance,0)
when 'SERVICE'
@ -1152,6 +1148,7 @@ then ifnull(sum(distinct pl.Quantity * pl.Rate),0)
+ ifnull(sum(distinct st.After_CGST),0)
+ ifnull(sum(distinct st.After_IGST),0)
+ ifnull(sum(distinct st.AfterFreightValue),0)
+ ifnull(rt.Insurance,0)
- ifnull(sum(distinct st.Afterdiscountval),0)
when 'REVENUE'
@ -1162,6 +1159,7 @@ then ifnull(sum(distinct pl.Quantity * pl.Rate),0)
+ ifnull(sum(distinct rt.AfterIGST),0)
+ ifnull(sum(distinct rt.AfterFreightValue),0)
+ ifnull(sum(distinct rt.AfterPackagingValue),0)
+ ifnull(rt.Insurance,0)
end
as total
@ -1400,32 +1398,56 @@ group by supplier_name,material_name";
function ireport_purchase($cname,$prod,$fa,$aa,$m,$frm,$t,$cat){
$sql="select im.IGRNO as igrn,im.PONO as pono,pm.POType as potype,date_format(im.CreatedDate,'%d-%m-%Y') as created_date,TIME_FORMAT(im.CreatedDate,'%l:%i %p') as created_time,mm.MaterialName as material_name,mm.Category as category,sd.SupplierName as supplier_name,mm.UOM as UOM, sum(distinct id.QuantityAsPerInvoice) as quantity,pl.Rate as rate,sum(distinct id.QuantityAsPerInvoice) * pl.Rate as value,if(POType = 'IMPORT' or POType = 'CAPITAL',sum(distinct pm.ExchangeRate),0) as exchange_rate,
ifnull(if(POType = 'REVENUE',sum(distinct rt.AfterSGST),sum(distinct st.After_SGST)),0) as sgst,
ifnull(if(POType = 'REVENUE',sum(distinct rt.AfterCGST),sum(distinct st.After_CGST)),0) as cgst,
ifnull(if(POType = 'REVENUE',sum(distinct rt.AfterIGST),sum(distinct st.After_IGST)),0) as igst,
ifnull(if(POType = 'REVENUE',sum(distinct rt.AfterDiscount),sum(distinct st.Afterdiscountval)),0) as discount,
ifnull(if(POType = 'REVENUE',sum(distinct rt.AfterFreightValue),sum(distinct st.AfterFreightValue)),0) as freight,
ifnull(if(POType = 'REVENUE',sum(distinct rt.AfterPackagingValue),0),0) as Package,
$sql="select im.IGRNO as igrn,pm.POType as potype,im.PONO as pono,date_format(im.CreatedDate,'%d-%m-%Y') as created_date,TIME_FORMAT(im.CreatedDate,'%l:%i %p') as created_time,mm.MaterialName as material_name,mm.Category as category,sd.SupplierName as supplier_name,mm.UOM as UOM, sum(id.QuantityAsPerInvoice) as quantity,pl.Rate as rate,round(sum(id.QuantityAsPerInvoice) * pl.Rate,2) as value,if(POType = 'IMPORT' or POType = 'CAPITAL',sum(pm.ExchangeRate),0) as exchange_rate,
round(ifnull(if(POType = 'REVENUE',
sum(id.QuantityAsPerInvoice * rt.AfterSGST / pl.Quantity),
sum(id.QuantityAsPerInvoice * st.After_SGST / pl.Quantity)),0),2) as sgst,
round(ifnull(if(POType = 'REVENUE',
sum(id.QuantityAsPerInvoice * rt.AfterCGST / pl.Quantity),
sum(id.QuantityAsPerInvoice * st.After_CGST / pl.Quantity)),0),2) as cgst,
round(ifnull(if(POType = 'REVENUE',
sum(id.QuantityAsPerInvoice * rt.AfterIGST / pl.Quantity),
sum(id.QuantityAsPerInvoice * st.After_IGST / pl.Quantity)),0),2) as igst,
round(ifnull(if(POType = 'REVENUE',
sum(id.QuantityAsPerInvoice * rt.AfterDiscount / pl.Quantity),
sum(id.QuantityAsPerInvoice * st.Afterdiscountval / pl.Quantity)),0),2) as discount,
round(ifnull(if(POType = 'REVENUE',
sum(id.QuantityAsPerInvoice * rt.AfterFreightValue / pl.Quantity),
sum(id.QuantityAsPerInvoice * st.AfterFreightValue / pl.Quantity)),0),2) as freight,
round(ifnull(if(POType = 'REVENUE',
sum(id.QuantityAsPerInvoice * rt.AfterPackagingValue / pl.Quantity),0),0),2) as Package,
round((
if(POType = 'IMPORT',sum(distinct pm.ExchangeRate * (id.QuantityAsPerInvoice * pl.Rate)),
if(POType = 'CAPITAL' && CapitalRange = 0,sum(distinct pm.ExchangeRate * (id.QuantityAsPerInvoice * pl.Rate)),
ifnull(sum(distinct id.QuantityAsPerInvoice * pl.Rate),0)))
+ ifnull(if(POType = 'REVENUE',sum(distinct rt.AfterSGST),sum(distinct st.After_SGST)),0)
+ ifnull(if(POType = 'REVENUE',sum(distinct rt.AfterCGST),sum(distinct st.After_CGST)),0)
+ ifnull(if(POType = 'REVENUE',sum(distinct rt.AfterIGST),sum(distinct st.After_IGST)),0)
+ ifnull(if(POType = 'REVENUE',sum(distinct rt.AfterFreightValue),sum(distinct st.AfterFreightValue)),0)
+ ifnull(if(POType = 'REVENUE',sum(distinct rt.AfterPackagingValue),0),0)
- ifnull(if(POType = 'REVENUE',sum(distinct rt.AfterDiscount),sum(distinct st.Afterdiscountval)),0)),2) as total,pb.FilePath as file
if(POType = 'IMPORT',sum(pm.ExchangeRate * (id.QuantityAsPerInvoice * pl.Rate)),
if(POType = 'CAPITAL' && CapitalRange = 0,sum(pm.ExchangeRate * (id.QuantityAsPerInvoice * pl.Rate)),
ifnull(sum(id.QuantityAsPerInvoice * pl.Rate),0)))
+ round(ifnull(if(POType = 'REVENUE',
sum(id.QuantityAsPerInvoice * rt.AfterSGST / pl.Quantity),
sum(id.QuantityAsPerInvoice * st.After_SGST / pl.Quantity)),0),2)
+ round(ifnull(if(POType = 'REVENUE',
sum(id.QuantityAsPerInvoice * rt.AfterCGST / pl.Quantity),
sum(id.QuantityAsPerInvoice * st.After_CGST / pl.Quantity)),0),2)
+ round(ifnull(if(POType = 'REVENUE',
sum(id.QuantityAsPerInvoice * rt.AfterIGST / pl.Quantity),
sum(id.QuantityAsPerInvoice * st.After_IGST / pl.Quantity)),0),2)
+ round(ifnull(if(POType = 'REVENUE',
sum(id.QuantityAsPerInvoice * rt.AfterFreightValue / pl.Quantity),
sum(id.QuantityAsPerInvoice * st.AfterFreightValue / pl.Quantity)),0),2)
+ round(ifnull(if(POType = 'REVENUE',
sum(id.QuantityAsPerInvoice * rt.AfterPackagingValue / pl.Quantity),0),0),2)
- round(ifnull(if(POType = 'REVENUE',
sum(id.QuantityAsPerInvoice * rt.AfterDiscount / pl.Quantity),
sum(id.QuantityAsPerInvoice * st.Afterdiscountval / pl.Quantity)),0),2)),2) as total,
pb.FilePath as file
from T_IGR_Master im
join T_IGR_Details id on id.IGRNO = im.IGRNO
join T_PurchaseOrder_LineItem pl on pl.PONO = im.PONO
join T_IGR_Details id on id.IGRNO = im.IGRNO and id.MaterialCode = pl.MaterialCode
join T_PurchaseOrder_Master pm on pm.PONO = pl.PONO
left join T_MaterialMaster mm on mm.MaterialCode = pl.MaterialCode
left join T_SupplierDetailsN sd on sd.SupplierID = pm.SupplierID
left join T_Service_Tax st on st.LineItemNo = pl.LineItemNo
left join T_Revenue_Tax rt on rt.LineItemNo = pl.LineItemNo
left join T_PurchaseOrder_BillUpload pb on pb.PONO=pm.PONO
left join T_PurchaseOrder_BillUpload pb on pb.IGRNO=im.IGRNO
where pm.Status != 'ST030' ";
if ($cname!= ''){
@ -1473,35 +1495,59 @@ $sql.="group by pono,material_name,category,supplier_name";
$query = $this->db->query($sql);
return $query->result();
}
function ireport_purchase_link($cname,$prod,$fa,$aa,$m,$frm,$t,$sid,$mid,$d,$cat){
function ireport_purchase_link($cname,$prod,$fa,$aa,$m,$frm,$t,$sid,$mid,$d,$cat,$da,$po){
$sql="select im.IGRNO as igrn,im.PONO as pono,pm.POType as potype,date_format(im.CreatedDate,'%d-%m-%Y') as created_date,TIME_FORMAT(im.CreatedDate,'%l:%i %p') as created_time,mm.MaterialName as material_name,mm.Category as category,sd.SupplierName as supplier_name,mm.UOM as UOM, sum(distinct id.QuantityAsPerInvoice) as quantity,pl.Rate as rate,sum(distinct id.QuantityAsPerInvoice) * pl.Rate as value,if(POType = 'IMPORT' or POType = 'CAPITAL',sum(distinct pm.ExchangeRate),0) as exchange_rate,
ifnull(if(POType = 'REVENUE',sum(distinct rt.AfterSGST),sum(distinct st.After_SGST)),0) as sgst,
ifnull(if(POType = 'REVENUE',sum(distinct rt.AfterCGST),sum(distinct st.After_CGST)),0) as cgst,
ifnull(if(POType = 'REVENUE',sum(distinct rt.AfterIGST),sum(distinct st.After_IGST)),0) as igst,
ifnull(if(POType = 'REVENUE',sum(distinct rt.AfterDiscount),sum(distinct st.Afterdiscountval)),0) as discount,
ifnull(if(POType = 'REVENUE',sum(distinct rt.AfterFreightValue),sum(distinct st.AfterFreightValue)),0) as freight,
ifnull(if(POType = 'REVENUE',sum(distinct rt.AfterPackagingValue),0),0) as Package,
$sql="select im.IGRNO as igrn,pm.POType as potype,im.PONO as pono,date_format(im.CreatedDate,'%d-%m-%Y') as created_date,TIME_FORMAT(im.CreatedDate,'%l:%i %p') as created_time,mm.MaterialName as material_name,mm.Category as category,sd.SupplierName as supplier_name,mm.UOM as UOM, sum(id.QuantityAsPerInvoice) as quantity,pl.Rate as rate,round(sum(id.QuantityAsPerInvoice) * pl.Rate,2) as value,if(POType = 'IMPORT' or POType = 'CAPITAL',sum(pm.ExchangeRate),0) as exchange_rate,
round(ifnull(if(POType = 'REVENUE',
sum(id.QuantityAsPerInvoice * rt.AfterSGST / pl.Quantity),
sum(id.QuantityAsPerInvoice * st.After_SGST / pl.Quantity)),0),2) as sgst,
round(ifnull(if(POType = 'REVENUE',
sum(id.QuantityAsPerInvoice * rt.AfterCGST / pl.Quantity),
sum(id.QuantityAsPerInvoice * st.After_CGST / pl.Quantity)),0),2) as cgst,
round(ifnull(if(POType = 'REVENUE',
sum(id.QuantityAsPerInvoice * rt.AfterIGST / pl.Quantity),
sum(id.QuantityAsPerInvoice * st.After_IGST / pl.Quantity)),0),2) as igst,
round(ifnull(if(POType = 'REVENUE',
sum(id.QuantityAsPerInvoice * rt.AfterDiscount / pl.Quantity),
sum(id.QuantityAsPerInvoice * st.Afterdiscountval / pl.Quantity)),0),2) as discount,
round(ifnull(if(POType = 'REVENUE',
sum(id.QuantityAsPerInvoice * rt.AfterFreightValue / pl.Quantity),
sum(id.QuantityAsPerInvoice * st.AfterFreightValue / pl.Quantity)),0),2) as freight,
round(ifnull(if(POType = 'REVENUE',
sum(id.QuantityAsPerInvoice * rt.AfterPackagingValue / pl.Quantity),0),0),2) as Package,
round((
if(POType = 'IMPORT',sum(distinct pm.ExchangeRate * (id.QuantityAsPerInvoice * pl.Rate)),
if(POType = 'CAPITAL' && CapitalRange = 0,sum(distinct pm.ExchangeRate * (id.QuantityAsPerInvoice * pl.Rate)),
ifnull(sum(distinct id.QuantityAsPerInvoice * pl.Rate),0)))
+ ifnull(if(POType = 'REVENUE',sum(distinct rt.AfterSGST),sum(distinct st.After_SGST)),0)
+ ifnull(if(POType = 'REVENUE',sum(distinct rt.AfterCGST),sum(distinct st.After_CGST)),0)
+ ifnull(if(POType = 'REVENUE',sum(distinct rt.AfterIGST),sum(distinct st.After_IGST)),0)
+ ifnull(if(POType = 'REVENUE',sum(distinct rt.AfterFreightValue),sum(distinct st.AfterFreightValue)),0)
+ ifnull(if(POType = 'REVENUE',sum(distinct rt.AfterPackagingValue),0),0)
- ifnull(if(POType = 'REVENUE',sum(distinct rt.AfterDiscount),sum(distinct st.Afterdiscountval)),0)),2) as total,pb.FilePath as file
if(POType = 'IMPORT',sum(pm.ExchangeRate * (id.QuantityAsPerInvoice * pl.Rate)),
if(POType = 'CAPITAL' && CapitalRange = 0,sum(pm.ExchangeRate * (id.QuantityAsPerInvoice * pl.Rate)),
ifnull(sum(id.QuantityAsPerInvoice * pl.Rate),0)))
+ round(ifnull(if(POType = 'REVENUE',
sum(id.QuantityAsPerInvoice * rt.AfterSGST / pl.Quantity),
sum(id.QuantityAsPerInvoice * st.After_SGST / pl.Quantity)),0),2)
+ round(ifnull(if(POType = 'REVENUE',
sum(id.QuantityAsPerInvoice * rt.AfterCGST / pl.Quantity),
sum(id.QuantityAsPerInvoice * st.After_CGST / pl.Quantity)),0),2)
+ round(ifnull(if(POType = 'REVENUE',
sum(id.QuantityAsPerInvoice * rt.AfterIGST / pl.Quantity),
sum(id.QuantityAsPerInvoice * st.After_IGST / pl.Quantity)),0),2)
+ round(ifnull(if(POType = 'REVENUE',
sum(id.QuantityAsPerInvoice * rt.AfterFreightValue / pl.Quantity),
sum(id.QuantityAsPerInvoice * st.AfterFreightValue / pl.Quantity)),0),2)
+ round(ifnull(if(POType = 'REVENUE',
sum(id.QuantityAsPerInvoice * rt.AfterPackagingValue / pl.Quantity),0),0),2)
- round(ifnull(if(POType = 'REVENUE',
sum(id.QuantityAsPerInvoice * rt.AfterDiscount / pl.Quantity),
sum(id.QuantityAsPerInvoice * st.Afterdiscountval / pl.Quantity)),0),2)),2) as total,
pb.FilePath as file
from T_IGR_Master im
join T_IGR_Details id on id.IGRNO = im.IGRNO
join T_PurchaseOrder_LineItem pl on pl.PONO = im.PONO
join T_IGR_Details id on id.IGRNO = im.IGRNO and id.MaterialCode = pl.MaterialCode
join T_PurchaseOrder_Master pm on pm.PONO = pl.PONO
left join T_MaterialMaster mm on mm.MaterialCode = pl.MaterialCode
left join T_SupplierDetailsN sd on sd.SupplierID = pm.SupplierID
left join T_Service_Tax st on st.LineItemNo = pl.LineItemNo
left join T_Revenue_Tax rt on rt.LineItemNo = pl.LineItemNo
left join T_PurchaseOrder_BillUpload pb on pb.PONO=pm.PONO
left join T_PurchaseOrder_BillUpload pb on pb.IGRNO=im.IGRNO
where pm.Status != 'ST030' ";
if ($cname!= ''){
@ -1555,6 +1601,16 @@ if ($cname!= ''){
$sql.=" and mm.Category = '".$cat."' ";
}
if ($da!= ''){
$ddd= date("Y-m-d",strtotime($da));
$sql.=" and date(im.CreatedDate) = '".$ddd."' ";
}
if ($po!= ''){
$sql.=" and im.PONO = '".$po."' ";
}
@ -1562,6 +1618,50 @@ if ($cname!= ''){
$sql.="group by pono,material_name,category,supplier_name";
// echo $m;
// echo $sid;
//echo $sql;
$query = $this->db->query($sql);
return $query->result();
}
function ireport_attachment($cname,$fa,$aa,$m,$frm,$t){
$sql="select pono,potype,date_format(created_date,'%d-%m-%Y') as created_date,supplier_name,
sum(total) as total,file
from igr
where status != 'ST030'
";
if ($cname!= ''){
$sql.="and supplier_name = '".$cname."'";
}
if ($fa and $aa != ''){
$sql.=" and (created_date >= '".$fa."-04-01' and created_date <= '".$aa."-03-31')";
}
if ($m!= ''){
$sql.="and monthname(created_date) = '".$m."'";
}
if ($frm and $t != ''){
$fromd= date("Y-m-d",strtotime($frm));
$tod=date("Y-m-d",strtotime($t));
$sql.="and date(created_date) >= '".$fromd."'
and date(created_date) <= '".$tod."'";
}
$sql.="group by pono";
// echo $m;
// echo $sid;
//echo $sql;
$query = $this->db->query($sql);
return $query->result();
@ -1607,51 +1707,55 @@ group by material_name,supplier_name";
function ireport_supplier($cname,$fa,$aa,$m,$frm,$t){
$sql="SELECT sd.SupplierID as sid,sd.SupplierName as supplier_name,count(im.PONO) as counts,ifnull(sum(id.QuantityAsPerInvoice),0) as quantity,round(ifnull(sum(id.QuantityAsPerInvoice * pl.Rate),0),2) as value,
$sql="SELECT sd.SupplierID as sid,sd.SupplierName as supplier_name,count(im.PONO) as counts,ifnull(sum(id.QuantityAsPerInvoice),0) as quantity,round(ifnull(sum(id.QuantityAsPerInvoice * pl.Rate),0),2) as value,
case pm.POType
when 'IMPORT'
then ifnull((sum(distinct(id.QuantityAsPerInvoice * pl.Rate) * pm.ExchangeRate)
then ifnull((sum((id.QuantityAsPerInvoice * pl.Rate) * pm.ExchangeRate)
+ ifnull(rt.Insurance,0)
),0)
when 'CAPITAL'
then sum(distinct if(pm.CapitalRange=0,(( id.QuantityAsPerInvoice * pl.Rate) * pm.ExchangeRate),( id.QuantityAsPerInvoice * pl.Rate)
then sum( if(pm.CapitalRange=0,(( id.QuantityAsPerInvoice * pl.Rate) * pm.ExchangeRate),( id.QuantityAsPerInvoice * pl.Rate)
- st.Afterdiscountval))
+ ifnull(sum(distinct st.After_SGST),0)
+ ifnull(sum(distinct st.After_CGST),0)
+ ifnull(sum(distinct st.After_IGST),0)
+ ifnull(sum(distinct st.AfterFreightValue),0)
+ ifnull(sum(st.After_SGST),0)
+ ifnull(sum(st.After_CGST),0)
+ ifnull(sum(st.After_IGST),0)
+ ifnull(sum(st.AfterFreightValue),0)
+ ifnull(rt.Insurance,0)
when 'SERVICE'
then ifnull(sum(distinct id.QuantityAsPerInvoice * pl.Rate),0)
+ ifnull(sum(distinct st.After_SGST),0)
+ ifnull(sum(distinct st.After_CGST),0)
+ ifnull(sum(distinct st.After_IGST),0)
+ ifnull(sum(distinct st.AfterFreightValue),0)
- ifnull(sum(distinct st.Afterdiscountval),0)
then ifnull(sum(id.QuantityAsPerInvoice * pl.Rate),0)
+ ifnull(sum(st.After_SGST),0)
+ ifnull(sum(st.After_CGST),0)
+ ifnull(sum(st.After_IGST),0)
+ ifnull(sum(st.AfterFreightValue),0)
+ ifnull(rt.Insurance,0)
- ifnull(sum(st.Afterdiscountval),0)
when 'REVENUE'
then ifnull(sum(distinct id.QuantityAsPerInvoice * pl.Rate),0)
- ifnull(sum(distinct rt.AfterDiscount),0)
+ ifnull(sum(distinct rt.AfterSGST),0)
+ ifnull(sum(distinct rt.AfterCGST),0)
+ ifnull(sum(distinct rt.AfterIGST),0)
+ ifnull(sum(distinct rt.AfterFreightValue),0)
+ ifnull(sum(distinct rt.AfterPackagingValue),0)
then ifnull(sum(id.QuantityAsPerInvoice * pl.Rate),0)
- ifnull(sum(rt.AfterDiscount),0)
+ ifnull(sum(rt.AfterSGST),0)
+ ifnull(sum(rt.AfterCGST),0)
+ ifnull(sum(rt.AfterIGST),0)
+ ifnull(sum(rt.AfterFreightValue),0)
+ ifnull(sum(rt.AfterPackagingValue),0)
+ ifnull(rt.Insurance,0)
end
as total
from T_IGR_Master im
join T_IGR_Details id on id.IGRNO = im.IGRNO
from T_IGR_Master im
join T_PurchaseOrder_LineItem pl on pl.PONO = im.PONO
join T_PurchaseOrder_Master pm on pm.PONO = pl.PONO
left join T_MaterialMaster mm on mm.MaterialCode = pl.MaterialCode
left join T_SupplierDetailsN sd on sd.SupplierID = pm.SupplierID
left join T_Service_Tax st on st.LineItemNo = pl.LineItemNo
left join T_Revenue_Tax rt on rt.LineItemNo = pl.LineItemNo
left join T_PurchaseOrder_BillUpload pb on pb.PONO=pm.PONO
where pm.Status != 'ST030' ";
join T_IGR_Details id on id.IGRNO = im.IGRNO and id.MaterialCode = pl.MaterialCode
join T_PurchaseOrder_Master pm on pm.PONO = pl.PONO
left join T_MaterialMaster mm on mm.MaterialCode = pl.MaterialCode
left join T_SupplierDetailsN sd on sd.SupplierID = pm.SupplierID
left join T_Service_Tax st on st.LineItemNo = pl.LineItemNo
left join T_Revenue_Tax rt on rt.LineItemNo = pl.LineItemNo
left join T_PurchaseOrder_BillUpload pb on pb.IGRNO=im.IGRNO
where pm.Status != 'ST030'";
if ($cname!= ''){
@ -2103,42 +2207,17 @@ if ($cname!= ''){
$query = $this->db->query($sql);
return $query->result();
}
function month_incexp_report($month,$year)
{
$sql="SELECT date_format(tinc.date,'%d-%m-%Y')as date,
ifnull(case
when tinc.type = 'PAYMENT'
then sum(tinc.total)
end,'0') as expense,
ifnull(case
when tinc.type = 'RECEIPT'
then sum(tinc.total)
end, '0') as income,
ifnull(case
when tinc.type = 'PAYMENT'
then tinc.towhom
end,'-') as paymentname,
ifnull(case
when tinc.type = 'RECEIPT'
then tinc.towhom
end, '-') as receiptname,
tinc.total,tinc.towhom,tinc.description,monthname(tinc.date)as month,tinc.type,tinc.account_code,ac.name FROM t_income_expense tinc join t_accountcode ac on ac.code=tinc.account_code where month(tinc.date)= ".$month." and year(tinc.date)=".$year." group by tinc.account_code";
$query = $this->db->query($sql);
return $query->result();
}
//home--this year//
function yearexpensereport($fa,$aa)
{
{
$sql="select monthname(date) as month,
sum(if(type='PAYMENT',total,0)) as exp,
sum(if(type='RECEIPT',total,0)) as inc,
sum(total) as total
from t_income_expense
where date >= '".$fa."-04-01' and date <= '".$aa."-03-31'
group by month
ORDER BY FIELD(month,'April','May','June','July','August','September','October','November','December','January', 'February', 'March')";
group by month ";
$query = $this->db->query($sql);
return $query->result();
@ -2155,8 +2234,7 @@ if ($cname!= ''){
function monthwise_data($value='')
{
$sql="SELECT type,Sum(total) as monthlydata FROM t_income_expense WHERE type = ? AND MONTH(date) = MONTH(curdate()) AND YEAR(date) = YEAR(curdate())";
//$sql="SELECT type,Sum(total) as monthlydata FROM resicoin_RIADev.t_income_expense WHERE type = ? AND MONTH(date) = MONTH(curdate()) And YEAR(date) = YEAR(curdate())"
$sql="SELECT type,Sum(total) as monthlydata FROM t_income_expense WHERE type = ? AND MONTH(date) = MONTH(curdate())";
$query = $this->db->query($sql,array($value));
return $query->result();
@ -2368,62 +2446,6 @@ function INRSymbol()
//echo $sql;
return $query->result();
}
function daybeforetotal($yesterday){
$sql="select date,
sum(if(type = 'PAYMENT',total,0)) as payment_amt,
sum(if(type = 'RECEIPT',total,0)) as receipt_amt
from t_income_expense
where date = ? ";
$query = $this->db->query($sql,array($yesterday));
return $query->result();
}
function minmaxdatevalue(){
$sql="SELECT MAX(date) AS Max_Date, MIN(date) AS Min_Date
FROM t_income_expense";
$query = $this->db->query($sql);
return $query->result();
}
// function monthbeforetotal($mindate,$maxdate){
// $sql="SELECT
// sum(if(type = 'PAYMENT',total,0)) as payment_amt,
// sum(if(type = 'RECEIPT',total,0)) as receipt_amt
// FROM t_income_expense
// WHERE date BETWEEN ? AND ? ";
// $query = $this->db->query($sql,array($mindate,$maxdate));
// return $query->result();
// }
function monthbeforetotal($month,$year){
$sql="SELECT month(date) as monthnum ,year(date) as yearnum,
sum(if(type = 'PAYMENT',total,0)) as payment_amt,
sum(if(type = 'RECEIPT',total,0)) as receipt_amt
FROM t_income_expense
WHERE
month(date) = '".$month."'and year(date) = '".$year."'";
$query = $this->db->query($sql);
return $query->result();
}
function yearbeforetotal($prefy,$fa){
$sql="SELECT
sum(if(type = 'PAYMENT',total,0)) as payment_amt,
sum(if(type = 'RECEIPT',total,0)) as receipt_amt
FROM t_income_expense
where date >= '".$prefy."-04-01' and date <= '".$fa."-03-31'";
$query = $this->db->query($sql);
return $query->result();
//print_r($query->result());
}
}
}
?>
?>

View File

@ -0,0 +1,369 @@
<?php
if(!empty($mms))
{
}
?>
<script>
$(document).ready(function () {
$("#client_name").select2();
$("#item_name").select2();
});
</script>
<link rel="stylesheet" href="https://cdn.datatables.net/buttons/1.4.2/css/buttons.dataTables.min.css">
<style>
.dataTables_filter input {padding: 4px;}
.dataTables_filter {
width: 50%;
float: right;
text-align: right;
}
.dataTables_paginate {
width: 50%;
float: right;
text-align: right;
}
div.dt-buttons {
position: relative;
float: right;
}
.btn-success {
background-color: #5d0411;
border-color: #5d0411;
}
</style>
<div class="content-wrapper">
<section class="content"><br/>
<div class="row" style="min-height: 600px;">
<!-- Left col -->
<div class="col-md-12">
<!-- TABLE: LATEST ORDERS -->
<div class="box box-info">
<div class="box-header with-border">
<center><h3 class="box-title"><p style="color:#5d0411"><b>Inward Summary</b><br><br>
<?php
if($this->input->post('client_name')){
$cl=$this->input->post('client_name');
echo $cl;
echo ' '.' ';
}
if($this->input->post('financialyear')){
$ab=$this->input->post('financialyear');
echo '('.$ab.')';
echo ' ';
}
if($this->input->post('month')){
$m=$this->input->post('month');
echo '('.$m.')';
echo ' ';
}
if($this->input->post('from_date') && $this->input->post('to_date')){
$frm = $this->input->post('from_date');
$t = $this->input->post('to_date');
echo $frm.'-to-'.$t;
}
?></p></h3></center>
</div>
<!-- /.box-header -->
<div class="panel-body">
<form method="post" action="<?php echo base_url($this->uri->uri_string()); ?>">
<div class="form-group has-feedback">
<div class="col-md-2">
<label for="client_name">
<?php echo 'Supplier'; ?>
</label>
<div class="input-group">
<select class="form-control" id="client_name" name="client_name" >
<option value="">Select Supplier</option>
<?php
foreach($cust as $item):
{?>
<option value="<?php echo $item->SupplierName;?>"><?php echo $item->SupplierName ; ?></option>
<?php } endforeach; ?>
</select>
</div>
</div>
<div class="col-md-2">
<label for="to_date">
<?php echo 'Year'; ?>
</label>
<div class="input-group">
<select class="form-control" id="financialyear" name="financialyear">
<option value="">Select Year</option>
<?php
foreach($finyear as $item):
{?>
<option value="<?php echo $item->financial_year;?>"><?php echo $item->financial_year ; ?></option>
<?php } endforeach; ?>
</select>
</div>
</div>
<div class="col-md-2">
<label for="to_date">
<?php echo 'Month'; ?>
</label>
<div class="input-group">
<select class="form-control" id="month" name="month">
<option value="">Select Month</option>
<option value="January">January</option>
<option value="February">February</option>
<option value="March">March</option>
<option value="April">April</option>
<option value="May">May</option>
<option value="June">June</option>
<option value="July">July</option>
<option value="August">August</option>
<option value="September">September</option>
<option value="October">October</option>
<option value="November">November</option>
<option value="December">December</option>
</select>
</div>
</div>
<div class="col-md-2">
<label for="from_date">
<?php echo 'From Date'; ?>
</label>
<div class="input-group">
<input name="from_date" id="max-date" class="form-control datepicker">
<span class="input-group-addon">
<i class="fa fa-calendar fa-fw"></i>
</span>
</div>
</div>
<div class="col-md-2">
<label for="to_date">
<?php echo 'To Date'; ?>
</label>
<div class="input-group">
<input name="to_date" id="min-date" class="form-control datepicker">
<span class="input-group-addon">
<i class="fa fa-calendar fa-fw"></i>
</span>
</div>
</div>
<div class="col-md-2 " ><br>
<input type="submit" class="btn btn-success" name="btn_submit"
value="View Report">
</div>
</div>
</form>
</div>
<div class="box-body">
<div>
<table class="table table-bordered table-hover" id="cc" >
<thead>
<tr>
<th style="text-align:center">PO No</th>
<th style="text-align:center">Date</th>
<th style="text-align:center">Supplier Name</th>
<th style="text-align:center">Total &nbsp;(<i class="fa fa-rupee "></i>)</th>
<th style="text-align:center">Attachments</th>
</tr>
</thead>
<tbody>
<?php if(!empty($purchase)){
$tot_tot = 0;
foreach($purchase as $rel)
{
?>
<tr>
<td><span>
<a href="<?php echo base_url().'purchaseorder/CreatePOPrint?PONO='.$rel->pono.'&ReqType='.$rel->potype; ?>"><?php echo $rel->pono;?></a>
</span></td>
<td style="text-align:center"><span><?php echo $rel->created_date;?></span></td>
<td><span>
<a href="<?= base_url() ?>report/ilink_purchase?po=<?php echo $rel->pono;?>"><?php echo $rel->supplier_name;?> </a>
</span></td>
<td style="text-align:right"><span><?php
$tot_tot= $tot_tot + round($rel->total,2);
echo $rel->total;
?></span></td>
<td style="text-align:center"><span>
<?php
if(!empty($rel->file1)){ ?>
<a target="_blank" href="<?php echo base_url().'uploads/BillFiles/'?><?php echo $rel->file1 ?>" data-toggle="tooltip" data-placement="left" title="Attachment Available for Download/View"><button>File Available</button></a>
<?php
}else
{
echo 'Not Available';
}
?>
</span></td>
</tr>
<?php
}
?>
</tbody>
<tfoot width="100%">
<tr>
<td style="text-align:center;"><strong>Total</strong></td>
<td><strong>&nbsp</strong></td>
<td><strong>&nbsp</strong></td>
<td class="amount" style="text-align:right">
<strong>
<?php
{
echo number_format($tot_tot,2,'.','');
}
?>
</strong></td>
<td><strong>&nbsp</strong></td>
</tr>
</tfoot>
<?php
}
?>
</table>
</div>
</div>
</div>
<!-- /.box -->
</div>
<!-- /.col -->
</div>
</section>
</div>
<script src="https://cdn.datatables.net/buttons/1.4.2/js/dataTables.buttons.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jszip/3.1.3/jszip.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.1.32/pdfmake.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.1.32/vfs_fonts.js"></script>
<script src="https://cdn.datatables.net/buttons/1.4.2/js/buttons.html5.min.js"></script>
<script src="https://cdn.datatables.net/buttons/1.4.2/js/buttons.colVis.min.js"></script>
<script>
// Bootstrap datepicker
// Set up your table
$(document).ready(function() {
table = $('#cc').DataTable( {
"dom": "<'row'<'col-md-6'l><'col-md-6'Bf>>" +
"<'row'<'col-md-6'><'col-md-6'>>" +
"<'row'<'col-md-12't>><'row'<'col-md-4'i><'col-md-8'p>>",
buttons: [
{
extend: 'excelHtml5',
footer: 'true',
messageTop: 'Report Purchase-Inward',
title: $('h3').text(),
exportOptions: {
columns: ':visible'
}
},
'colvis'
]
} );
} );
$( function() {
//var dateFormat = "mm/dd/yy",
from = $( "#min-date" )
.datepicker({
dateFormat: "dd-mm-yy",
defaultDate: "+0d",
changeMonth: true,
//numberOfMonths: 1
})
.on( "change", function() {
to.datepicker("option", "minDate", getDate( this ) );
}),
to = $( "#max-date" ).datepicker({
dateFormat: "dd-mm-yy",
defaultDate: "+0d",
changeMonth: true,
//numberOfMonths: 1
})
.on( "change", function() {
from.datepicker( "option", "maxDate", getDate( this ) );
});
function getDate( element ) {
var date;
try {
date = $.datepicker.parseDate( dateFormat, element.value );
} catch( error ) {
date = null;
}
return date;
}
} );
function Reset()
{
$('#mySelect').val('');
}
$(document).ready(function(){
$('[data-toggle="tooltip"]').tooltip();
});
</script>

View File

@ -26,19 +26,21 @@ if(!empty($mms))
}
.btn-success {
background-color: #3c8dbc;
border-color: #3c8dbc;
background-color: #5d0411;
border-color: #5d0411;
}
</style>
<div class="content-wrapper">
<section class="content"><br/>
<div class="row" style="min-height: 600px;">
<!-- Left col -->
<div class="col-md-12">
<!-- TABLE: LATEST ORDERS -->
<div class="box box-info">
<div class="box-header with-border">
<center><h3 class="box-title"><p style="color:#3c8dbc"><b>Report - Consolidate(<?php
<center><h3 class="box-title"><p style="color:#5d0411"><b>Report - Consolidate(<?php
$m = $this->input->get('m');
echo $m;
?>)</b></p></h3></center>
@ -147,6 +149,8 @@ if(!empty($mms))
</div>
<!-- /.col -->
</div>
</section>
</div>
<!-- <script src="https://cdn.datatables.net/1.10.16/js/jquery.dataTables.min.js"></script> -->
<script src="https://cdn.datatables.net/buttons/1.4.2/js/dataTables.buttons.min.js"></script>

View File

@ -27,19 +27,21 @@ if(!empty($mms))
}
.btn-success {
background-color: #3c8dbc;
border-color: #3c8dbc;
background-color: #5d0411;
border-color: #5d0411;
}
</style>
<div class="content-wrapper">
<section class="content"><br/>
<div class="row" style="min-height: 600px;">
<!-- Left col -->
<div class="col-md-12">
<!-- TABLE: LATEST ORDERS -->
<div class="box box-info">
<div class="box-header with-border">
<center><h3 class="box-title"><p style="color:#3c8dbc"><b>Report - Consolidate Month(<?php
<center><h3 class="box-title"><p style="color:#5d0411"><b>Report - Consolidate Month(<?php
$m = $this->input->get('m');
echo $m;
?>)</b></p></h3></center>
@ -159,6 +161,8 @@ if(!empty($mms))
</div>
<!-- /.col -->
</div>
</section>
</div>
<!-- <script src="https://cdn.datatables.net/1.10.16/js/jquery.dataTables.min.js"></script> -->
<script src="https://cdn.datatables.net/buttons/1.4.2/js/dataTables.buttons.min.js"></script>

View File

@ -26,19 +26,21 @@ if(!empty($mms))
}
.btn-success {
background-color: #3c8dbc;
border-color: #3c8dbc;
background-color: #5d0411;
border-color: #5d0411;
}
</style>
<div class="content-wrapper">
<section class="content"><br/>
<div class="row" style="min-height: 600px;">
<!-- Left col -->
<div class="col-md-12">
<!-- TABLE: LATEST ORDERS -->
<div class="box box-info">
<div class="box-header with-border">
<center><h3 class="box-title"><p style="color:#3c8dbc"><b>Report - Consolidate(<?php
<center><h3 class="box-title"><p style="color:#5d0411"><b>Report - Consolidate(<?php
$m = $this->input->get('ab');
echo $m;
?>)</b></p></h3></center>
@ -149,6 +151,8 @@ if(!empty($mms))
</div>
<!-- /.col -->
</div>
</section>
</div>
<!-- <script src="https://cdn.datatables.net/1.10.16/js/jquery.dataTables.min.js"></script> -->
<script src="https://cdn.datatables.net/buttons/1.4.2/js/dataTables.buttons.min.js"></script>

View File

@ -26,20 +26,22 @@ if(!empty($mms))
float: right;
}
.btn-success {
background-color: #3c8dbc;
border-color: #3c8dbc;
.btn-success {
background-color: #5d0411;
border-color: #5d0411;
}
</style>
<div class="content-wrapper">
<section class="content"><br/>
<div class="row" style="min-height: 600px;">
<!-- Left col -->
<div class="col-md-12">
<!-- TABLE: LATEST ORDERS -->
<div class="box box-info">
<div class="box-header with-border">
<center><h3 class="box-title"><p style="color:#3c8dbc"><b>Report - Consolidate Category-Wise(<?php
<center><h3 class="box-title"><p style="color:#5d0411"><b>Report - Consolidate Category-Wise(<?php
$m = $this->input->get('ab');
echo $m;
?>)</b></p></h3></center>
@ -160,6 +162,8 @@ if(!empty($mms))
</div>
<!-- /.col -->
</div>
</section>
</div>
<!-- <script src="https://cdn.datatables.net/1.10.16/js/jquery.dataTables.min.js"></script> -->
<script src="https://cdn.datatables.net/buttons/1.4.2/js/dataTables.buttons.min.js"></script>

View File

@ -32,6 +32,10 @@ if(!empty($mms))
</style>
<div class="content-wrapper">
<!-- Content Header (Page header) -->
<section class="content"><br/>
<div class="row" style="min-height: 600px;">
<!-- Left col -->
<div class="col-md-12">
@ -150,7 +154,8 @@ if(!empty($mms))
</div>
<!-- /.col -->
</div>
</section>
</div>
<!-- <script src="https://cdn.datatables.net/1.10.16/js/jquery.dataTables.min.js"></script> -->
<script src="https://cdn.datatables.net/buttons/1.4.2/js/dataTables.buttons.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jszip/3.1.3/jszip.min.js"></script>

View File

@ -33,6 +33,10 @@ if(!empty($mms))
</style>
<div class="content-wrapper">
<!-- Content Header (Page header) -->
<section class="content"><br/>
<div class="row" style="min-height: 600px;">
<!-- Left col -->
<div class="col-md-12">
@ -176,6 +180,8 @@ if(!empty($mms))
</div>
<!-- /.col -->
</div>
</section>
</div>
<!-- <script src="https://cdn.datatables.net/1.10.16/js/jquery.dataTables.min.js"></script> -->
<script src="https://cdn.datatables.net/buttons/1.4.2/js/dataTables.buttons.min.js"></script>

View File

@ -32,6 +32,10 @@ if(!empty($mms))
</style>
<div class="content-wrapper">
<!-- Content Header (Page header) -->
<section class="content"><br/>
<div class="row" style="min-height: 600px;">
<!-- Left col -->
<div class="col-md-12">
@ -181,7 +185,8 @@ if(!empty($mms))
</div>
<!-- /.col -->
</div>
</section>
</div>
<!-- <script src="https://cdn.datatables.net/1.10.16/js/jquery.dataTables.min.js"></script> -->
<script src="https://cdn.datatables.net/buttons/1.4.2/js/dataTables.buttons.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jszip/3.1.3/jszip.min.js"></script>

View File

@ -26,8 +26,8 @@ if(!empty($mms))
}
.btn-success {
background-color: #3c8dbc;
border-color: #3c8dbc;
background-color: #5d0411;
border-color: #5d0411;
}

View File

@ -32,6 +32,10 @@ if(!empty($mms))
</style>
<div class="content-wrapper">
<!-- Content Header (Page header) -->
<section class="content"><br/>
<div class="row" style="min-height: 600px;">
<!-- Left col -->
<div class="col-md-12">
@ -126,6 +130,8 @@ if(!empty($mms))
</div>
<!-- /.col -->
</div>
</section>
</div>
<!-- <script src="https://cdn.datatables.net/1.10.16/js/jquery.dataTables.min.js"></script> -->
<script src="https://cdn.datatables.net/buttons/1.4.2/js/dataTables.buttons.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jszip/3.1.3/jszip.min.js"></script>

View File

@ -198,7 +198,7 @@
<div class="col-md-4">
<b><span for="Description">File Upload:</span></b>
<img id="receiptslip" alt="your image" style="width: 139px;"/><br/>
<input type='file' input accept=".JPG,.PNG" onchange="readURL(this,this.id);" id="receiptfile" name="myfile" accept="image/*"/>
<input type='file' input accept=".JPG,.PNG,.PDF" onchange="readURL(this,this.id);" id="receiptfile" name="myfile" />
</div>
</div>
</div>
@ -343,7 +343,7 @@
<!-- <b><span for="fileupload">File Upload:</span></b> -->
<b><span for="Description">File Upload:</span></b>
<img id="paymentslip" alt="your image" style="width: 139px;"/><br/>
<input type='file' input accept=".JPG,.PNG" onchange="readURL(this,this.id);" id="paymentfile" name="myfile" accept="image/*"/>
<input type='file' input accept=".JPG,.PNG,.PDF" onchange="readURL(this,this.id);" id="paymentfile" name="myfile" />
</div>
</div>
</div>

View File

@ -213,13 +213,13 @@ if(!empty($PaymentMultiple))
</textarea>
</div>
<div class="col-md-4" style="border:0px solid;">
<b><span for="Description">File Upload: <span id="strname"><?php $strname = explode("/",$document); echo $strname[2]; ?></span></span></b>
<img id="receiptslip" src="<?php echo $final ?>" alt="No Receipt Available" style="width: 139px;height:139px;"/><br/>
<input type="button" onclick="DeleteRow();"class="btn btn-primary" value="Delete" />
<b><span for="Description">File Upload:</span></b>
<!-- <b><span for="Description">File Upload:</span></b> -->
<input type='file' input accept=".JPG,.PNG" onchange="readURL(this);" id="recepitfile" name="myfile" accept="image/*"/ value="<?php echo $document; ?>">
<input type='file' input accept=".JPG,.PNG,.PDF" onchange="readURL(this);" id="recepitfile" name="myfile" value="<?php echo $document; ?>">
</div>
<div>
@ -443,10 +443,10 @@ if(!empty($PaymentMultiple))
</div>
<div class="col-md-4" style="border:0px solid;">
<img id="paymentslip" src="<?php echo $final ?>" alt="No Receipt Available" style="width: 139px;height:139px;"/><br/>
<input type="button" onclick="DeleteRow();"class="btn btn-primary" value="Delete" />
<b><span for="Description">File Upload:</span></b>
<input type='file' input accept=".JPG,.PNG" onchange="paymentreadURL(this);" id="paymentfile" name="myfile" accept="image/*"/ value="<?php echo $document; ?>">
<b><span for="Description">File Upload: <span id="strname"><?php $strname = explode("/",$document); echo $strname[2]; ?></span></span></b>
<img id="paymentslip" src="<?php echo $final ?>" alt="No Receipt Available" style="width: 139px;height:139px;"/><br/>
<input type="button" onclick="DeleteRow();"class="btn btn-primary" value="Delete" />
<input type='file' input accept=".JPG,.PNG,.PDF" onchange="paymentreadURL(this);" id="paymentfile" name="myfile" value="<?php echo $document; ?>">
</div>
<div>
@ -577,6 +577,7 @@ if(type == "RECEIPT")
function readURL(input,id) {
//alert(id);
$("#strname").remove();
if (input.files && input.files[0]) {
var reader = new FileReader();
@ -608,7 +609,7 @@ function readURL(input,id) {
function paymentreadURL(input) {
$("#strname").remove();
if (input.files && input.files[0]) {
var reader = new FileReader();
@ -813,7 +814,7 @@ function GSTvalue(id)
{
$('#deleteflag').val(1);
var file = "<?php echo $file1;?>";
var file = "<?php echo $strname[2];?>";
//var id2='';
var id2= $('#id1').val();
//alert(file);
@ -826,8 +827,9 @@ $.ajax({
if(data==1)
{
$('#content').loader('hide');
alert('Delete Successfully');
$("#strname").remove();
$('#receiptslip').attr('src', '');
alert('Delete Successfully');
//window.location ="cashbook/incomeExpenseList";
}

View File

@ -12,67 +12,69 @@
<div class="content-wrapper">
<section class="content">
<div>
<right><h3 id="title">Reports</h3></right>
</div>
<section class="content">
<div>
<center><h3 id="title">Reports</h3></center>
</div>
<legend></legend>
<div class="row">
<div class="col-xs-12">
<div class="col-xs-3">
<h4><span class="fa fa-search-plus">&nbsp; Requisition </span></h4>
<a href="<?php echo base_url(); ?>reportpending" target="_blank" >Reportpending<p class="uk-text uk-margin-remove"></p></a>
<a href="<?php echo base_url(); ?>releasedpo" target="_blank" > Order Value - Released<p class="uk-text uk-margin-remove"></p></a>
<a href="<?php echo base_url(); ?>openOrder" target="_blank" >Open Orders - Pending <p class="uk-text-meta uk-margin-remove"></p></a>
<a href="<?php echo base_url(); ?>TotalOrder" target="_blank" > Total Orders<p class="uk-text-meta uk-margin-remove"></p></a>
</div>
<div class="col-xs-3">
<h4><span class="fa fa-shopping-cart">&nbsp; Purchase </span></h4>
<a href="<?php echo base_url(); ?>Report_purchase" target="_blank" >Purchase<p class="uk-text uk-margin-remove"></p></a>
<a href="<?php echo base_url(); ?>Report_year_wise" target="_blank" >Year Wise<p class="uk-text-meta uk-margin-remove"></p></a>
<a href="<?php echo base_url(); ?>Report_supplier" target="_blank" >Purchase Supplier - Wise<p class="uk-text uk-margin-remove"></p></a>
<a href="<?php echo base_url(); ?>Report_consolidate" target="_blank" >Consolidate Report<p class="uk-text-meta uk-margin-remove"></p></a>
<a href="<?php echo base_url(); ?>Report_cumulative" target="_blank" >Cumulative Report<p class="uk-text uk-margin-remove"></p></a>
<a href="<?php echo base_url(); ?>Report_pending_purchase" target="_blank" >Purchase Order Pending<p class="uk-text uk-margin-remove"></p></a>
</div>
<div class="col-xs-3">
<h4><span class="fa fa-codepen">&nbsp; Material Master </span></h4>
<a href="<?php echo base_url(); ?>Report_Material_Supplier" target="_blank" ><p class="uk-text uk-margin-remove">Material Master - supplier wise</p></a>
<a href="<?php echo base_url(); ?>Report_Material_Item" target="_blank" ><p class="uk-text uk-margin-remove">Material Master - Item wise</p></a>
<a href="<?php echo base_url(); ?>Report_Material_ReceiptValue" target="_blank" ><p class="uk-text uk-margin-remove">Material Master - Receipt Value</p></a>
</div>
<div class="col-xs-12">
<div class="col-xs-3">
<h4><span class="fa fa-truck">&nbsp; Inward</span></h4>
<a href="<?php echo base_url(); ?>Report_purchase_inward" target="_blank" >Purchase-Inward<p class="uk-text uk-margin-remove"></p></a>
<a href="<?php echo base_url(); ?>Report_year_wise_inward" target="_blank" >Year Wise-Inward<p class="uk-text-meta uk-margin-remove"></p></a>
<a href="<?php echo base_url(); ?>Report_supplier_inward" target="_blank" >Purchase Supplier - Wise-Inward<p class="uk-text uk-margin-remove"></p></a>
<a href="<?php echo base_url(); ?>Report_consolidate_inward" target="_blank" >Consolidate Report-Inward<p class="uk-text-meta uk-margin-remove"></p></a>
<a href="<?php echo base_url(); ?>Report_cumulative_inward" target="_blank" >Cumulative Report-Inward<p class="uk-text uk-margin-remove"></p></a>
<a href="<?php echo base_url(); ?>Report_cumulative_raw" target="_blank" >Cumulative Report - Category Wise-Inward<p class="uk-text uk-margin-remove"></p></a>
<a href="<?php echo base_url(); ?>Report_consolidate_category" target="_blank" >Consolidate Report - Category Wise-Inward<p class="uk-text-meta uk-margin-remove"></p></a>
<a href="<?php echo base_url(); ?>Report_Material_inward_Register" target="_blank" >Report - Material-Inward-Register<p class="uk-text-meta uk-margin-remove"></p></a>
</div>
<h4><span class="fa fa-search-plus">&nbsp; Requisition </span></h4>
<a href="<?php echo base_url(); ?>reportpending" target="_blank" >Reportpending<p class="uk-text uk-margin-remove"></p></a>
<a href="<?php echo base_url(); ?>releasedpo" target="_blank" > Order Value - Released<p class="uk-text uk-margin-remove"></p></a>
<a href="<?php echo base_url(); ?>openOrder" target="_blank" >Open Orders - Pending <p class="uk-text-meta uk-margin-remove"></p></a>
<a href="<?php echo base_url(); ?>TotalOrder" target="_blank" > Total Orders<p class="uk-text-meta uk-margin-remove"></p></a>
</div>
<div class="col-xs-3">
<h4><span class="fa fa-shopping-cart">&nbsp; Purchase </span></h4>
<a href="<?php echo base_url(); ?>Report_purchase" target="_blank" >Purchase<p class="uk-text uk-margin-remove"></p></a>
<a href="<?php echo base_url(); ?>Report_year_wise" target="_blank" >Year Wise<p class="uk-text-meta uk-margin-remove"></p></a>
<a href="<?php echo base_url(); ?>Report_supplier" target="_blank" >Purchase Supplier - Wise<p class="uk-text uk-margin-remove"></p></a>
<a href="<?php echo base_url(); ?>Report_consolidate" target="_blank" >Consolidate Report<p class="uk-text-meta uk-margin-remove"></p></a>
<a href="<?php echo base_url(); ?>Report_cumulative" target="_blank" >Cumulative Report<p class="uk-text uk-margin-remove"></p></a>
<a href="<?php echo base_url(); ?>Report_pending_purchase" target="_blank" >Purchase Order Pending<p class="uk-text uk-margin-remove"></p></a>
</div>
<div class="col-xs-3">
<h4><span class="fa fa-codepen">&nbsp; Material Master </span></h4>
<a href="<?php echo base_url(); ?>Report_Material_Supplier" target="_blank" ><p class="uk-text uk-margin-remove">Material Master - supplier wise</p></a>
<a href="<?php echo base_url(); ?>Report_Material_Item" target="_blank" ><p class="uk-text uk-margin-remove">Material Master - Item wise</p></a>
<a href="<?php echo base_url(); ?>Report_Material_ReceiptValue" target="_blank" ><p class="uk-text uk-margin-remove">Material Master - Receipt Value</p></a>
</div>
<div class="col-xs-3">
<h4><span class="fa fa-truck">&nbsp; Inward</span></h4>
<a href="<?php echo base_url(); ?>Report_purchase_inward" target="_blank" >Inward Details<p class="uk-text uk-margin-remove"></p></a>
<a href="<?php echo base_url(); ?>Report_purchase_attach" target="_blank" >Inward Summary<p class="uk-text uk-margin-remove"></p></a>
<a href="<?php echo base_url(); ?>Report_year_wise_inward" target="_blank" >Year Wise-Inward<p class="uk-text-meta uk-margin-remove"></p></a>
<a href="<?php echo base_url(); ?>Report_supplier_inward" target="_blank" >Inward-Supplier Wise<p class="uk-text uk-margin-remove"></p></a>
<a href="<?php echo base_url(); ?>Report_consolidate_inward" target="_blank" >Consolidate Report-Inward<p class="uk-text-meta uk-margin-remove"></p></a>
<a href="<?php echo base_url(); ?>Report_cumulative_inward" target="_blank" >Cumulative Report-Inward<p class="uk-text uk-margin-remove"></p></a>
<a href="<?php echo base_url(); ?>Report_cumulative_raw" target="_blank" >Cumulative Report - Category Wise-Inward<p class="uk-text uk-margin-remove"></p></a>
<a href="<?php echo base_url(); ?>Report_consolidate_category" target="_blank" >Consolidate Report - Category Wise-Inward<p class="uk-text-meta uk-margin-remove"></p></a>
<a href="<?php echo base_url(); ?>Report_Material_inward_Register" target="_blank" >Report - Material-Inward-Register<p class="uk-text-meta uk-margin-remove"></p></a>
<!-- <a href="<?php echo base_url(); ?>DeliveryPerformance" target="_blank" > Report - DeliveryPerformance<p class="uk-text-meta uk-margin-remove"></p></a> -->
</div>
</div>
</div>
<legend></legend>
<div class="row">
<div class="col-xs-12">
<div class="col-xs-3">
<h4><span class="fa fa-money ">&nbsp; Finance Reports </span></h4>
<a href="<?php echo base_url(); ?>Report_costcenter" target="_blank" > Cost Center <p class="uk-text uk-margin-remove"></p></a>
</div>
<div class="col-xs-3">
<h4><span class="fa fa-inr">&nbsp; Cashbook </span></h4>
<a href="<?php echo base_url(); ?>cashbookreport" target="_blank" ><p class="uk-text uk-margin-remove">Cashbook Reports</p></a>
</div>
</div>
</div>
<div class="col-xs-12">
<div class="col-xs-3">
<h4><span class="fa fa-money ">&nbsp; Finance Reports </span></h4>
<a href="<?php echo base_url(); ?>Report_costcenter" target="_blank" > Cost Center <p class="uk-text uk-margin-remove"></p></a>
</div>
<div class="col-xs-3">
<h4><span class="fa fa-inr">&nbsp; Cashbook </span></h4>
<a href="<?php echo base_url(); ?>cashbookreport" target="_blank" ><p class="uk-text uk-margin-remove">Cashbook Reports</p></a>
</div>
</div>
</div>
<legend></legend>
<div class="row">
<div class="col-xs-12">

View File

@ -1,4 +1,4 @@
<?php print_r($data);
<?php //print_r($data);
$extype= '';
$exname = '';
$flag = 0;
@ -35,6 +35,77 @@ if(!empty($data))
}
?>
<!-- <script src="pdf.js"></script> -->
<!-- <script src="<?php echo base_url()?>assets/plugins/pdf.js"></script> -->
<!-- <script src="<?php echo base_url()?>assets/plugins/pdf.worker.js"></script> -->
<!-- <script src="pdf.worker.js"></script> -->
<!-- <style type="text/css">
/* #upload-button {
width: 150px;
display: block;
margin: 20px auto;
} */
/* #file-to-upload {
display: none;
} */
#pdf-main-container {
width: 400px;
margin: 20px auto;
}
#pdf-loader {
display: none;
text-align: center;
color: #999999;
font-size: 13px;
line-height: 100px;
height: 100px;
}
#pdf-contents {
display: none;
}
#pdf-meta {
overflow: hidden;
margin: 0 0 20px 0;
}
#pdf-buttons {
float: left;
}
#page-count-container {
float: right;
}
#pdf-current-page {
display: inline;
}
#pdf-total-pages {
display: inline;
}
#pdf-canvas {
border: 1px solid rgba(0,0,0,0.2);
box-sizing: border-box;
}
#page-loader {
height: 100px;
line-height: 100px;
text-align: center;
display: none;
color: #999999;
font-size: 13px;
}
</style>
-->
<div class="content-wrapper">
@ -136,8 +207,37 @@ if(!empty($data))
<?php } ?>
</div>
<div class="col-md-5" style="border:0px solid;">
<?php
$strname = explode("/",$document);
$str = explode(".",$strname[2]);
if($str[1] == 'pdf'){
?>
<embed src="<?php echo $final ?>" style="width: 400px;height:400px;" type='application/pdf'>
<!-- <button id="upload-button">Select PDF</button> -->
<!-- <input type="hidden" id="file-to-upload" value="<?php echo $strname[2];?> "> -->
<!-- <input type="file" id="file-to-upload" accept="application/pdf" /> -->
<!-- <div id="pdf-main-container">
<div id="pdf-loader">Loading document ...</div>
<div id="pdf-contents">
<div id="pdf-meta">
<div id="pdf-buttons">
<button id="pdf-prev">Previous</button>
<button id="pdf-next">Next</button>
</div>
<div id="page-count-container">Page <div id="pdf-current-page"></div> of <div id="pdf-total-pages"></div></div>
</div>
<canvas id="pdf-canvas" width="400"></canvas>
<div id="page-loader">Loading page ...</div>
</div>
</div> -->
<?php }else { ?>
<img id="receipt" src="<?php echo $final ?>" alt="No Receipt Available" style="width: 400px;height:400px;"/><br/>
<?php } ?>
</div>
</div>
</div>
@ -162,5 +262,105 @@ $(function () {
"autoWidth": true
});
//showPDF();
});
</script>
// var __PDF_DOC,
// __CURRENT_PAGE,
// __TOTAL_PAGES,
// __PAGE_RENDERING_IN_PROGRESS = 0,
// __CANVAS = $('#pdf-canvas').get(0),
// __CANVAS_CTX = __CANVAS.getContext('2d');
// function showPDF() {
// $("#pdf-loader").show();
// PDFJS.getDocument({ url: <?php echo base_url() ?> }).then(function(<?php echo $document?>) {
// __PDF_DOC = <?php echo $document ?>;
// __TOTAL_PAGES = __PDF_DOC.numPages;
// // Hide the pdf loader and show pdf container in HTML
// $("#pdf-loader").hide();
// $("#pdf-contents").show();
// $("#pdf-total-pages").text(__TOTAL_PAGES);
// // Show the first page
// showPage(1);
// }).catch(function(error) {
// // If error re-show the upload button
// $("#pdf-loader").hide();
// // $("#upload-button").show();
// alert(error.message);
// });;
// }
// function showPage(page_no) {
// __PAGE_RENDERING_IN_PROGRESS = 1;
// __CURRENT_PAGE = page_no;
// // Disable Prev & Next buttons while page is being loaded
// $("#pdf-next, #pdf-prev").attr('disabled', 'disabled');
// // While page is being rendered hide the canvas and show a loading message
// $("#pdf-canvas").hide();
// $("#page-loader").show();
// // Update current page in HTML
// $("#pdf-current-page").text(page_no);
// // Fetch the page
// __PDF_DOC.getPage(page_no).then(function(page) {
// // As the canvas is of a fixed width we need to set the scale of the viewport accordingly
// var scale_required = __CANVAS.width / page.getViewport(1).width;
// // Get viewport of the page at required scale
// var viewport = page.getViewport(scale_required);
// // Set canvas height
// __CANVAS.height = viewport.height;
// var renderContext = {
// canvasContext: __CANVAS_CTX,
// viewport: viewport
// };
// // Render the page contents in the canvas
// page.render(renderContext).then(function() {
// __PAGE_RENDERING_IN_PROGRESS = 0;
// // Re-enable Prev & Next buttons
// $("#pdf-next, #pdf-prev").removeAttr('disabled');
// // Show the canvas and hide the page loader
// $("#pdf-canvas").show();
// $("#page-loader").hide();
// });
// });
// }
// // Upon click this should should trigger click on the #file-to-upload file input element
// // This is better than showing the not-good-looking file input element
// // $("#upload-button").on('click', function() {
// // $("#file-to-upload").trigger('click');
// // });
// // When user chooses a PDF file
// // $("#file-to-upload").on('change', function() {
// // showPDF(URL.createObjectURL($("#file-to-upload").get(0).files[0]));
// // });
// // Previous page of the PDF
// $("#pdf-prev").on('click', function() {
// if(__CURRENT_PAGE != 1)
// showPage(--__CURRENT_PAGE);
// });
// // Next page of the PDF
// $("#pdf-next").on('click', function() {
// if(__CURRENT_PAGE != __TOTAL_PAGES)
// showPage(++__CURRENT_PAGE);
// });
</script>