report issues and duplicate file issues fixes
This commit is contained in:
parent
bab8d8ec9a
commit
581219bb7b
@ -119,6 +119,25 @@ define('STORE_ISSUSED', 'ST037');
|
|||||||
define('STORE_PARTIALLYISSUSED', 'ST055');
|
define('STORE_PARTIALLYISSUSED', 'ST055');
|
||||||
define('STORE_ONHOLD', 'ST038');
|
define('STORE_ONHOLD', 'ST038');
|
||||||
define('STORE_REJECT', 'ST039');
|
define('STORE_REJECT', 'ST039');
|
||||||
|
/* OGR status */
|
||||||
|
define('OGR_PARTIAL_COMPLETE', 'ST064');
|
||||||
|
define('OGR_COMPLETE', 'ST057');
|
||||||
|
define('ST044', 'ST044');
|
||||||
|
define('PO', 'PO');
|
||||||
|
define('ST063', 'ST063');
|
||||||
|
define('OGR_CREATED', 'ST059');
|
||||||
|
define('OGR_NOT_CREATED', 'ST069');
|
||||||
|
|
||||||
|
//pomaster status update//
|
||||||
|
define('AMOUNT_PAID', 'ST057');
|
||||||
|
define('NO_PAID', 'ST058');
|
||||||
|
define('PARTIALLY_PAID', 'ST059');
|
||||||
|
define('AMOUNT_RECEIVED', 'ST065');
|
||||||
|
define('NO_RECEIVED', 'ST066');
|
||||||
|
define('PARTIALLY_RECEIVED', 'ST067');
|
||||||
|
define('AMOUNT_PAIDIGR', 'ST070');
|
||||||
|
define('PARTIALLY_PAIDIGR', 'ST071');
|
||||||
|
define('NO_PAIDIGR', 'ST072');
|
||||||
|
|
||||||
/* Work status code */
|
/* Work status code */
|
||||||
|
|
||||||
@ -309,6 +328,18 @@ define('Capital_CustomDutyExpenses_Charge1',
|
|||||||
define('Capital_RMCIncludingCustomers_Charge1', '(purchaserate+CustomDutyExpenses)');
|
define('Capital_RMCIncludingCustomers_Charge1', '(purchaserate+CustomDutyExpenses)');
|
||||||
|
|
||||||
|
|
||||||
|
//stock final product
|
||||||
|
|
||||||
|
define('Consumables', 'Consumables');
|
||||||
|
define('RawMaterial', 'Raw Material');
|
||||||
|
define('Packingmaterial', 'Packing material');
|
||||||
|
define('FinalProduct', 'Final Product');
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//Adavnce Payments and Receipts
|
||||||
|
define('Apayment', '0009');
|
||||||
|
define('AReceipt', '0013');
|
||||||
|
|
||||||
|
|
||||||
/* End of file constants.php */
|
/* End of file constants.php */
|
||||||
|
|||||||
@ -296,6 +296,7 @@ $route['Report_cumulative_raw'] = "report/rawi_cumulative";
|
|||||||
$route['Report_consolidate_category'] = "report/rawi_consolidate";
|
$route['Report_consolidate_category'] = "report/rawi_consolidate";
|
||||||
$route['Report_pending_purchase'] = "report/pending_purchase";
|
$route['Report_pending_purchase'] = "report/pending_purchase";
|
||||||
$route['Report_purchase_attach'] = "report/iattach";
|
$route['Report_purchase_attach'] = "report/iattach";
|
||||||
|
$route['Report_monthly_gst'] = "report/monthly_gst";
|
||||||
$route['Report_Material_inward_Register'] ="user/getMaterialInwardRegister";
|
$route['Report_Material_inward_Register'] ="user/getMaterialInwardRegister";
|
||||||
$route['DeliveryPerformance']="user/deliver_perform";
|
$route['DeliveryPerformance']="user/deliver_perform";
|
||||||
|
|
||||||
|
|||||||
@ -292,15 +292,57 @@ class inwardgateregister extends BaseController
|
|||||||
$this->loadViews("ogr", $this->global, $data, NULL);
|
$this->loadViews("ogr", $this->global, $data, NULL);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function GetInvoices()
|
||||||
|
{
|
||||||
|
|
||||||
|
$CustomerId = $this->input->post('customerId');
|
||||||
|
|
||||||
|
$data = $this->inwardgateregister_model->getInvoice($CustomerId);
|
||||||
|
echo json_encode($data);
|
||||||
|
}
|
||||||
|
|
||||||
|
function GetPO()
|
||||||
|
{
|
||||||
|
$supplierId = $this->input->post('supplierId');
|
||||||
|
|
||||||
|
$data = $this->inwardgateregister_model->getPO($supplierId);
|
||||||
|
echo json_encode($data);
|
||||||
|
}
|
||||||
|
|
||||||
|
function getPODetails()
|
||||||
|
{
|
||||||
|
$PONO = $this->input->post('PONO');
|
||||||
|
$data = $this->inwardgateregister_model->getPODetails($PONO);
|
||||||
|
//$data['poout'] = $this->inwardgateregister_model->getPODetails($PONO);
|
||||||
|
|
||||||
|
echo json_encode($data);
|
||||||
|
}
|
||||||
|
|
||||||
|
function getPOmrir()
|
||||||
|
{
|
||||||
|
$PONO = $this->input->post('PONO');
|
||||||
|
$data = $this->inwardgateregister_model->getPOmrir($PONO);
|
||||||
|
//$data['poout'] = $this->inwardgateregister_model->getPODetails($PONO);
|
||||||
|
echo json_encode($data);
|
||||||
|
}
|
||||||
|
|
||||||
|
function getMRIRDetails()
|
||||||
|
{
|
||||||
|
$MRIRno = $this->input->post('mrirno');
|
||||||
|
$PONO = $this->input->post('PONO');
|
||||||
|
$materialcode = $this->input->post('materialcode');
|
||||||
|
$data = $this->inwardgateregister_model->getPOMRIRDetails($MRIRno,$PONO,$materialcode);
|
||||||
|
|
||||||
|
echo json_encode($data);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
function ViewOgr()
|
function ViewOgr()
|
||||||
{
|
{
|
||||||
$this->load->model('inwardgateregister_model');
|
$this->load->model('inwardgateregister_model');
|
||||||
$this->global['pageTitle'] = $this->CompanyName.' : View Outward Gate Register';
|
$this->global['pageTitle'] = $this->CompanyName.' : View Outward Gate Register';
|
||||||
|
|
||||||
$data['OGR_Data'] = $this->inwardgateregister_model->getOGRData();
|
$data['OGR_Data'] = $this->inwardgateregister_model->getOGRData();
|
||||||
|
|
||||||
$this->loadViews("ogrlist", $this->global, $data, NULL);
|
$this->loadViews("ogrlist", $this->global, $data, NULL);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@ -1016,7 +1016,13 @@ class report extends BaseController
|
|||||||
// $data['monthlywiseincome']=$this->dahsboard_Model->monthwise_data_income();
|
// $data['monthlywiseincome']=$this->dahsboard_Model->monthwise_data_income();
|
||||||
// $data['monthlywiseexpense']=$this->dahsboard_Model->monthwise_data_expense();
|
// $data['monthlywiseexpense']=$this->dahsboard_Model->monthwise_data_expense();
|
||||||
// $data['todayincome']=$this->dahsboard_Model->today_data_income();
|
// $data['todayincome']=$this->dahsboard_Model->today_data_income();
|
||||||
// $data['todayexpense']=$this->dahsboard_Model->today_data_expense();
|
// $data['todayexpense']=$this->dahsboard_Model->today_data_expense();
|
||||||
|
|
||||||
|
$now = new DateTime();
|
||||||
|
$currentdate = $now->format('Y-m-d'); // MySQL datetime format
|
||||||
|
$yesterday = date('Y-m-d', strtotime("-1 day"));
|
||||||
|
|
||||||
|
$data['yesterdaybalances'] = $this->dahsboard_Model->getDailyOpeningAmt($yesterday);
|
||||||
|
|
||||||
|
|
||||||
$this->loadviews("reportcashbook",$this->global,$data, NULL);
|
$this->loadviews("reportcashbook",$this->global,$data, NULL);
|
||||||
@ -1036,7 +1042,7 @@ class report extends BaseController
|
|||||||
$currentdate = $now->format('Y-m-d'); // MySQL datetime format
|
$currentdate = $now->format('Y-m-d'); // MySQL datetime format
|
||||||
$yesterday = date('Y-m-d', strtotime("-1 day"));
|
$yesterday = date('Y-m-d', strtotime("-1 day"));
|
||||||
|
|
||||||
$data['yesterdaytotal'] = $this->dahsboard_Model->daybeforetotal($yesterday);
|
$data['yesterdaytotal'] = $this->dahsboard_Model->getDailyOpeningAmt($yesterday);
|
||||||
|
|
||||||
$this->loadviews("cashbooktoday",$this->global,$data, NULL);
|
$this->loadviews("cashbooktoday",$this->global,$data, NULL);
|
||||||
}
|
}
|
||||||
@ -1199,6 +1205,53 @@ class report extends BaseController
|
|||||||
$this->loadviews("cashbook_cumulative_month_report",$this->global,$data, NULL);
|
$this->loadviews("cashbook_cumulative_month_report",$this->global,$data, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** GST Monthly-report */
|
||||||
|
public function monthly_gst()
|
||||||
|
{
|
||||||
|
|
||||||
|
$this->global['pageTitle'] = $this->CompanyName.' : GST Monthly-Reports';
|
||||||
|
if ($this->input->post('btn_submit')) {
|
||||||
|
|
||||||
|
$m=$this->input->post('month');
|
||||||
|
$frm = $this->input->post('from_date');
|
||||||
|
$t = $this->input->post('to_date');
|
||||||
|
$ab=$this->input->post('financialyear');
|
||||||
|
$fa=substr($ab,0,-5);
|
||||||
|
$aa=substr($ab,5,5);
|
||||||
|
//print_r($prod);
|
||||||
|
|
||||||
|
$data['monthly_gst_purchase']=$this->dahsboard_Model->monthly_gst_purchase($m,$frm,$t,$fa,$aa);
|
||||||
|
$data['monthly_gst_sales']=$this->dahsboard_Model->monthly_gst_sales($m,$frm,$t,$fa,$aa);
|
||||||
|
|
||||||
|
}
|
||||||
|
$data['finyear']=$this->dahsboard_Model->report_finyear();
|
||||||
|
$this->loadviews("Report_monthly_gst",$this->global,$data, NULL);
|
||||||
|
//print_r($data);die();
|
||||||
|
}
|
||||||
|
public function monthly_gst_table()
|
||||||
|
{
|
||||||
|
|
||||||
|
$this->global['pageTitle'] = $this->CompanyName.' : GST Monthly-Reports';
|
||||||
|
|
||||||
|
|
||||||
|
$m=$this->input->get('m');
|
||||||
|
$frm = $this->input->get('frm');
|
||||||
|
$t = $this->input->get('t');
|
||||||
|
$ab=$this->input->get('financialyear');
|
||||||
|
$fa=substr($ab,0,-5);
|
||||||
|
$aa=substr($ab,5,5);
|
||||||
|
// print_r($frm);
|
||||||
|
// print_r($t);
|
||||||
|
// print_r($m);die();
|
||||||
|
|
||||||
|
$data['monthly_gst_purchase']=$this->dahsboard_Model->purchase_gst($m,$frm,$t,$fa,$aa);
|
||||||
|
$data['monthly_gst_sales']=$this->dahsboard_Model->sales_gst($m,$frm,$t,$fa,$aa);
|
||||||
|
|
||||||
|
|
||||||
|
$this->loadviews("Report_monthly_gst_table",$this->global,$data, NULL);
|
||||||
|
//print_r($data);die();
|
||||||
|
}
|
||||||
|
|
||||||
function Viewfiles()
|
function Viewfiles()
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|||||||
@ -2,11 +2,11 @@
|
|||||||
|
|
||||||
class batchcard_model extends CI_Model
|
class batchcard_model extends CI_Model
|
||||||
{
|
{
|
||||||
function __construct(){
|
// function __construct(){
|
||||||
parent::__construct();
|
// parent::__construct();
|
||||||
//load our second db and put in $db2
|
// //load our second db and put in $db2
|
||||||
$this->db2 = $this->load->database('invoicedb', TRUE);
|
// $this->db2 = $this->load->database('invoicedb', TRUE);
|
||||||
}
|
// }
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* stock details
|
* stock details
|
||||||
@ -26,9 +26,9 @@ class batchcard_model extends CI_Model
|
|||||||
function getinvoice_products()
|
function getinvoice_products()
|
||||||
{
|
{
|
||||||
|
|
||||||
$this->db2->select('product_id,product_name');
|
$this->db->select('product_id,product_name');
|
||||||
$this->db2->from('ip_products');
|
$this->db->from('ip_products');
|
||||||
$supp = $this->db2->get();
|
$supp = $this->db->get();
|
||||||
return $supp->result();
|
return $supp->result();
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -319,7 +319,7 @@ class batchcard_model extends CI_Model
|
|||||||
{
|
{
|
||||||
$this->db->select('T_FinalProduct_Master.*,product_name,product_description');
|
$this->db->select('T_FinalProduct_Master.*,product_name,product_description');
|
||||||
$this->db->from('T_FinalProduct_Master');
|
$this->db->from('T_FinalProduct_Master');
|
||||||
$this->db->join('invoicedb.ip_products','invoicedb.ip_products.product_id=T_FinalProduct_Master.MaterialCode');
|
$this->db->join('ip_products','ip_products.product_id=T_FinalProduct_Master.MaterialCode');
|
||||||
$res = $this->db->get();
|
$res = $this->db->get();
|
||||||
return $res->result();
|
return $res->result();
|
||||||
|
|
||||||
@ -332,7 +332,7 @@ class batchcard_model extends CI_Model
|
|||||||
{
|
{
|
||||||
$this->db->select('T_FinalProduct_Master.*,product_name,product_description');
|
$this->db->select('T_FinalProduct_Master.*,product_name,product_description');
|
||||||
$this->db->from('T_FinalProduct_Master');
|
$this->db->from('T_FinalProduct_Master');
|
||||||
$this->db->join('invoicedb.ip_products','invoicedb.ip_products.product_id=T_FinalProduct_Master.MaterialCode');
|
$this->db->join('ip_products','ip_products.product_id=T_FinalProduct_Master.MaterialCode');
|
||||||
$this->db->where('T_FinalProduct_Master.FPId',$FPId);
|
$this->db->where('T_FinalProduct_Master.FPId',$FPId);
|
||||||
$res = $this->db->get();
|
$res = $this->db->get();
|
||||||
return $res->result();
|
return $res->result();
|
||||||
@ -387,7 +387,7 @@ class batchcard_model extends CI_Model
|
|||||||
{
|
{
|
||||||
$subQuery ='select T_FinalProduct_CoProduct_Materials.*,product_name
|
$subQuery ='select T_FinalProduct_CoProduct_Materials.*,product_name
|
||||||
from T_FinalProduct_CoProduct_Materials
|
from T_FinalProduct_CoProduct_Materials
|
||||||
join invoicedb.ip_products on invoicedb.ip_products.product_id = T_FinalProduct_CoProduct_Materials.MaterialCode
|
join ip_products on ip_products.product_id = T_FinalProduct_CoProduct_Materials.MaterialCode
|
||||||
where T_FinalProduct_CoProduct_Materials.FPId=?';
|
where T_FinalProduct_CoProduct_Materials.FPId=?';
|
||||||
|
|
||||||
$query = $this->db->query($subQuery,array($FPId));
|
$query = $this->db->query($subQuery,array($FPId));
|
||||||
@ -650,7 +650,7 @@ class batchcard_model extends CI_Model
|
|||||||
|
|
||||||
$subQuery='select RefID,ProductCode,Quantity,Price,Transactiondate,TransactionType,product_name
|
$subQuery='select RefID,ProductCode,Quantity,Price,Transactiondate,TransactionType,product_name
|
||||||
from T_FinalProduct_History
|
from T_FinalProduct_History
|
||||||
join invoicedb.ip_products on invoicedb.ip_products.product_id= T_FinalProduct_History.ProductCode
|
join ip_products on ip_products.product_id= T_FinalProduct_History.ProductCode
|
||||||
where ProductCode=? and Transactiondate >= ? and Transactiondate <= ?';
|
where ProductCode=? and Transactiondate >= ? and Transactiondate <= ?';
|
||||||
|
|
||||||
$query = $this->db->query($subQuery,array($product_id,$starting_date,$end_date));
|
$query = $this->db->query($subQuery,array($product_id,$starting_date,$end_date));
|
||||||
|
|||||||
@ -2763,5 +2763,237 @@ function INRSymbol()
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** GST monthly-Report queries */
|
||||||
|
function monthly_gst_purchase($m,$frm,$t,$fa,$aa){
|
||||||
|
|
||||||
|
$sql="select g.doc_no,g.date,g.doc_type,g.hsn_code,sum(g.value) as value,sum(g.others) as others,sum(g.sgst) as sgst,sum(g.cgst) as cgst,sum(g.igst) as igst,sum(g.total) as total from
|
||||||
|
(SELECT pm.PONO as doc_no,date_format(pm.PODate,'%d-%m-%Y') as date,
|
||||||
|
'Purchase' as doc_type,mm.HSNCODE as hsn_code,
|
||||||
|
mm.MaterialName as material_name,sd.SupplierName as supplier_name,
|
||||||
|
round(ifnull(sum(distinct pl.Quantity * pl.Rate),0),2) 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.AfterPackagingValue),0),0)
|
||||||
|
+ifnull(if(POType = 'REVENUE',sum(distinct rt.AfterFreightValue),sum(distinct st.AfterFreightValue)),0)
|
||||||
|
+ifnull(rt.Insurance,0)
|
||||||
|
-ifnull(if(POType = 'REVENUE',sum(distinct rt.AfterDiscount),sum(distinct st.Afterdiscountval)),0)) as others,
|
||||||
|
round((
|
||||||
|
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))
|
||||||
|
,2) as total
|
||||||
|
FROM T_PurchaseOrder_Master pm
|
||||||
|
join T_PurchaseOrder_LineItem pl on pl.PONO = pm.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
|
||||||
|
where
|
||||||
|
pm.Status != 'ST030' and pm.Status != 'ST056' and pm.Status != 'ST027'
|
||||||
|
group by doc_no,material_name,supplier_name) as g
|
||||||
|
left join T_PurchaseOrder_Master p on p.PONO = g.doc_no
|
||||||
|
where g.doc_no != 'null' ";
|
||||||
|
|
||||||
|
if ($m!= ''){
|
||||||
|
|
||||||
|
$sql.="and monthname(p.PODate) = '".$m."'";
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($frm and $t != ''){
|
||||||
|
$fromd= date("Y-m-d",strtotime($frm));
|
||||||
|
$tod=date("Y-m-d",strtotime($t));
|
||||||
|
|
||||||
|
$sql.="and p.PODate >= '".$fromd."'
|
||||||
|
and p.PODate <= '".$tod."'";
|
||||||
|
|
||||||
|
}
|
||||||
|
if ($fa and $aa != ''){
|
||||||
|
|
||||||
|
$sql.=" and (p.PODate >= '".$fa."-04-01' and p.PODate <= '".$aa."-03-31')";
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//echo $sql;
|
||||||
|
$query = $this->db->query($sql);
|
||||||
|
return $query->result();
|
||||||
|
}
|
||||||
|
public function monthly_gst_sales($m=null,$frm=null,$t=null,$fa=null,$aa=null)
|
||||||
|
{
|
||||||
|
|
||||||
|
$sql = "select ii.invoice_id as invoice_id,ii.invoice_number as invoice_number,date_format(ii.invoice_date_created,'%d-%m-%Y') as dates,
|
||||||
|
sum(ifnull(((sgst.tax_rate_percent * (iit.item_quantity * iit.item_price))/100),0))
|
||||||
|
as sgst,
|
||||||
|
sum(ifnull(((iit.item_quantity * iit.item_price) * cgst.tax_rate_percent)/100,0))
|
||||||
|
as cgst,
|
||||||
|
sum(ifnull((igst.tax_rate_percent * (iit.item_quantity * iit.item_price))/100,0))
|
||||||
|
as igst,
|
||||||
|
sum((ifnull(((sgst.tax_rate_percent * iia.item_subtotal)/100),0)
|
||||||
|
+
|
||||||
|
ifnull(((iia.item_subtotal * cgst.tax_rate_percent)/100),0)
|
||||||
|
+
|
||||||
|
ifnull(((igst.tax_rate_percent * iia.item_subtotal)/100),0)))
|
||||||
|
as total
|
||||||
|
from ip_invoices ii
|
||||||
|
join ip_invoice_custom icf on icf.invoice_id = ii.invoice_id
|
||||||
|
join ip_invoice_items iit on iit.invoice_id = ii.invoice_id
|
||||||
|
join ip_invoice_item_amounts iia on iia.item_id = iit.item_id
|
||||||
|
join ip_clients ic on ic.client_id = ii.client_id
|
||||||
|
join ip_products ip on ip.product_id = iit.item_product_id
|
||||||
|
left join ip_tax_rates sgst on sgst.tax_rate_id = iit.sgst_item_tax_rate_id
|
||||||
|
left join ip_tax_rates cgst on cgst.tax_rate_id = iit.cgst_item_tax_rate_id
|
||||||
|
left join ip_tax_rates igst on igst.tax_rate_id = iit.igst_item_tax_rate_id
|
||||||
|
where icf.invoice_custom_fieldid = '8' and ii.invoice_status_id != 1 ";
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
if ($m!= ''){
|
||||||
|
|
||||||
|
$sql.="and monthname(ii.invoice_date_created) = '".$m."'";
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($frm and $t != ''){
|
||||||
|
$fromdate= date("Y-m-d",strtotime($frm));
|
||||||
|
$todate=date("Y-m-d",strtotime($t));
|
||||||
|
|
||||||
|
$sql.="and ii.invoice_date_created >= '".$fromdate."'
|
||||||
|
and ii.invoice_date_created <= '".$todate."'";
|
||||||
|
|
||||||
|
}
|
||||||
|
if ($fa and $aa != ''){
|
||||||
|
|
||||||
|
$sql.=" and (ii.invoice_date_created >= '".$fa."-04-01' and ii.invoice_date_created <= '".$aa."-03-31')";
|
||||||
|
|
||||||
|
}
|
||||||
|
//echo $sql;
|
||||||
|
$query = $this->db->query($sql);
|
||||||
|
return $query->result();
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
function sales_gst($m=null,$frm=null,$t=null,$fa=null,$aa=null)
|
||||||
|
{
|
||||||
|
|
||||||
|
$sql = "select ii.invoice_id as invoice_id,ii.client_id as client_id,ip.product_sku as hsn_code,ii.invoice_number as doc_no,date_format(ii.invoice_date_created,'%d-%m-%Y') as date,'Sales' as doc_type,TIME_FORMAT(ii.invoice_time_created,'%l:%i %p') as invoice_time_created,icf.invoice_custom_fieldvalue as vehicle_no,ip.product_description as product_description,concat(ic.client_name,'-',ic.client_surname)as client_name,sum(iit.item_quantity) as item_quantity,sum(iit.item_price) as item_price,sum(iia.item_subtotal) as value,
|
||||||
|
sum(ifnull(((sgst.tax_rate_percent * (iit.item_quantity * iit.item_price))/100),0))
|
||||||
|
as sgst,
|
||||||
|
sum(ifnull(((iit.item_quantity * iit.item_price) * cgst.tax_rate_percent)/100,0))
|
||||||
|
as cgst,
|
||||||
|
sum(ifnull((igst.tax_rate_percent * (iit.item_quantity * iit.item_price))/100,0))
|
||||||
|
as igst,
|
||||||
|
round(sum((iia.item_subtotal + ifnull(((sgst.tax_rate_percent * iia.item_subtotal)/100),0)
|
||||||
|
+
|
||||||
|
ifnull(((iia.item_subtotal * cgst.tax_rate_percent)/100),0)
|
||||||
|
+
|
||||||
|
ifnull(((igst.tax_rate_percent * iia.item_subtotal)/100),0))),2)
|
||||||
|
as total
|
||||||
|
from ip_invoices ii
|
||||||
|
join ip_invoice_custom icf on icf.invoice_id = ii.invoice_id
|
||||||
|
join ip_invoice_items iit on iit.invoice_id = ii.invoice_id
|
||||||
|
join ip_invoice_item_amounts iia on iia.item_id = iit.item_id
|
||||||
|
join ip_clients ic on ic.client_id = ii.client_id
|
||||||
|
join ip_products ip on ip.product_id = iit.item_product_id
|
||||||
|
left join ip_tax_rates sgst on sgst.tax_rate_id = iit.sgst_item_tax_rate_id
|
||||||
|
left join ip_tax_rates cgst on cgst.tax_rate_id = iit.cgst_item_tax_rate_id
|
||||||
|
left join ip_tax_rates igst on igst.tax_rate_id = iit.igst_item_tax_rate_id
|
||||||
|
where icf.invoice_custom_fieldid = '8' and ii.invoice_status_id != 1 ";
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
if ($m!= ''){
|
||||||
|
|
||||||
|
$sql.="and monthname(ii.invoice_date_created) = '".$m."'";
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($frm and $t != ''){
|
||||||
|
$fromdate= date("Y-m-d",strtotime($frm));
|
||||||
|
$todate=date("Y-m-d",strtotime($t));
|
||||||
|
|
||||||
|
$sql.="and ii.invoice_date_created >= '".$fromdate."'
|
||||||
|
and ii.invoice_date_created <= '".$todate."'";
|
||||||
|
|
||||||
|
}
|
||||||
|
if ($fa and $aa != ''){
|
||||||
|
|
||||||
|
$sql.=" and (ii.invoice_date_created >= '".$fa."-04-01' and ii.invoice_date_created <= '".$aa."-03-31')";
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
$sql.="group by doc_no,product_description";
|
||||||
|
$query = $this->db->query($sql);
|
||||||
|
return $query->result();
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
function purchase_gst($m,$frm,$t,$fa,$aa){
|
||||||
|
|
||||||
|
|
||||||
|
$sql="SELECT pm.PONO as doc_no,pm.POType as potype,date_format(pm.PODate,'%d-%m-%Y') as date,
|
||||||
|
TIME_FORMAT(pm.PODate,'%l:%i %p') as created_time,'Purchase' as doc_type,mm.HSNCODE as hsn_code,
|
||||||
|
mm.MaterialName as material_name,sd.SupplierName as supplier_name,
|
||||||
|
ifnull(sum(distinct pl.Quantity),0) as quantity,mm.UOM as UOM,ifnull(sum(distinct pl.Rate),0) as rate,
|
||||||
|
round(ifnull(sum(distinct pl.Quantity * pl.Rate),0),2) 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.AfterPackagingValue),0),0)
|
||||||
|
+ifnull(if(POType = 'REVENUE',sum(distinct rt.AfterFreightValue),sum(distinct st.AfterFreightValue)),0)
|
||||||
|
+ifnull(rt.Insurance,0)
|
||||||
|
-ifnull(if(POType = 'REVENUE',sum(distinct rt.AfterDiscount),sum(distinct st.Afterdiscountval)),0)) as others,
|
||||||
|
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)),
|
||||||
|
ifnull(sum(pl.Quantity * 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(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
|
||||||
|
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
|
||||||
|
where
|
||||||
|
pm.Status != 'ST030' and pm.Status != 'ST056' and pm.Status != 'ST027' ";
|
||||||
|
|
||||||
|
|
||||||
|
if ($m!= ''){
|
||||||
|
|
||||||
|
$sql.="and monthname(pm.PODate) = '".$m."'";
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($frm and $t != ''){
|
||||||
|
$fromd= date("Y-m-d",strtotime($frm));
|
||||||
|
$tod=date("Y-m-d",strtotime($t));
|
||||||
|
|
||||||
|
$sql.="and date(pm.PODate) >= '".$fromd."'
|
||||||
|
and date(pm.PODate) <= '".$tod."'";
|
||||||
|
|
||||||
|
}
|
||||||
|
if ($fa and $aa != ''){
|
||||||
|
|
||||||
|
$sql.=" and (pm.PODate >= '".$fa."-04-01' and pm.PODate <= '".$aa."-03-31')";
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
$sql.="group by doc_no,material_name,supplier_name";
|
||||||
|
|
||||||
|
$query = $this->db->query($sql);
|
||||||
|
return $query->result();
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
@ -2,12 +2,91 @@
|
|||||||
|
|
||||||
class inwardgateregister_model extends CI_Model
|
class inwardgateregister_model extends CI_Model
|
||||||
{
|
{
|
||||||
|
// function __construct(){
|
||||||
|
// parent::__construct();
|
||||||
|
// //load our second db and put in $db2
|
||||||
|
// $this->db2 = $this->load->database('invoicedb', TRUE);
|
||||||
|
// }
|
||||||
|
|
||||||
|
function updatefile($bill,$Picture,$oldfile)
|
||||||
|
{
|
||||||
|
|
||||||
|
// if($oldfile != ''){
|
||||||
|
// //unlink("uploads/BillFiles/".$oldfile);//this deletes the file on particular folder too
|
||||||
|
// }
|
||||||
|
|
||||||
|
$this->db->set('FilePath', $Picture); //value that used to update column
|
||||||
|
$this->db->where('BillNo', $bill); //which row want to upgrade
|
||||||
|
$this->db->update('T_Inwardgateregister_fileupload');
|
||||||
|
$afftectedRows = $this->db->affected_rows();
|
||||||
|
return $afftectedRows;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function getfies($igr)
|
||||||
|
{
|
||||||
|
|
||||||
|
$this->db->select('*');
|
||||||
|
|
||||||
|
|
||||||
|
$this->db->from('T_Inwardgateregister_fileupload');
|
||||||
|
|
||||||
|
$this->db->where('IGRNO',$igr);
|
||||||
|
|
||||||
|
$query = $this->db->get();
|
||||||
|
|
||||||
|
return $query->result();
|
||||||
|
}
|
||||||
|
|
||||||
|
function fileupload($myfiles)
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
$this->db->insert('T_Inwardgateregister_fileupload',$myfiles);
|
||||||
|
$myfile=$this->db->affected_rows();
|
||||||
|
return $myfile;
|
||||||
|
}
|
||||||
|
|
||||||
|
function addMaterialStockHistory($MaterialstockHistoryadd)
|
||||||
|
{
|
||||||
|
|
||||||
|
$this->db->trans_start();
|
||||||
|
$this->db->insert('T_Material_stock_history', $MaterialstockHistoryadd);
|
||||||
|
$insert_id = $this->db->affected_rows();
|
||||||
|
$this->db->trans_complete();
|
||||||
|
// print_r($this->db->last_query());
|
||||||
|
//print_r($insert_id);
|
||||||
|
if($insert_id>0)
|
||||||
|
{
|
||||||
|
$subQuery = 'select * from T_Material_stock_history';
|
||||||
|
|
||||||
|
$query = $this->db->query($subQuery);
|
||||||
|
|
||||||
|
return $query->result();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/*------------------------------------------------------------*/
|
||||||
|
// function igrListing()
|
||||||
|
// {
|
||||||
|
// $this->db->select('igr.*,PO.DeliveryDate,sup.SupplierName,igr.file');
|
||||||
|
// $this->db->from('T_IGR_Master igr');
|
||||||
|
// $this->db->join('T_PurchaseOrder_Master PO','igr.PONO = PO.PONO');
|
||||||
|
// $this->db->join('T_SupplierDetailsN` sup','PO.SupplierID = sup.SupplierID');
|
||||||
|
// $this->db->order_by('igr.CreatedDate','desc');
|
||||||
|
// $query = $this->db->get();
|
||||||
|
// $result = $query->result();
|
||||||
|
// return $result;
|
||||||
|
// }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* To get the IGR details for listing
|
* To get the IGR details for listing
|
||||||
* @return array $result : result of the query (returns igr informations)
|
* @return array $result : result of the query (returns igr informations)
|
||||||
*/
|
*/
|
||||||
function igrListing()
|
function igrListing()
|
||||||
{
|
{
|
||||||
|
|
||||||
$this->db->select('igr.*,PO.DeliveryDate,sup.SupplierName,igr.file,igrdetail.*,POL.Quantity,MM.MaterialName');
|
$this->db->select('igr.*,PO.DeliveryDate,sup.SupplierName,igr.file,igrdetail.*,POL.Quantity,MM.MaterialName');
|
||||||
@ -25,6 +104,21 @@ class inwardgateregister_model extends CI_Model
|
|||||||
return $result;
|
return $result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function viewIGRFile($IGRNO)
|
||||||
|
{
|
||||||
|
$this->db->distinct();
|
||||||
|
$this->db->select('*'); //BillNo,IGRNO,FilePath,PONO
|
||||||
|
$this->db->from('T_Inwardgateregister_fileupload');
|
||||||
|
$this->db->where('IGRNO',$IGRNO);
|
||||||
|
|
||||||
|
$query = $this->db->get();
|
||||||
|
|
||||||
|
$result = $query->result();
|
||||||
|
// print_r($result);die;
|
||||||
|
//print_r($this->db->last_query());
|
||||||
|
return $result;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* To get the po details
|
* To get the po details
|
||||||
* @return array $result : result of the query (returns po information)
|
* @return array $result : result of the query (returns po information)
|
||||||
@ -32,15 +126,17 @@ class inwardgateregister_model extends CI_Model
|
|||||||
function getpurchaseorder()
|
function getpurchaseorder()
|
||||||
{
|
{
|
||||||
$this->db->distinct();
|
$this->db->distinct();
|
||||||
$this->db->select('POM.PONO,POM.ServiceDescription,POM.DeliveryDate,sup.SupplierName,sup.Address,POM.status');
|
$this->db->select('POM.PONO,POM.ServiceDescription,POM.DeliveryDate,sup.SupplierName,sup.Address,POM.status,POL.OGR_Status');
|
||||||
$this->db->from('T_PurchaseOrder_Master POM');
|
$this->db->from('T_PurchaseOrder_Master POM');
|
||||||
$this->db->join('T_PurchaseOrder_LineItem POL', 'POL.PONO = POM.PONO');
|
$this->db->join('T_PurchaseOrder_LineItem POL', 'POL.PONO = POM.PONO');
|
||||||
$this->db->join('T_SupplierDetailsN sup', 'POM.SupplierID = sup.SupplierID');
|
$this->db->join('T_SupplierDetailsN sup', 'POM.SupplierID = sup.SupplierID');
|
||||||
|
$this->db->join('T_OGR_Master OGM ', 'POM.PONO = OGM.PONO_INV','left');
|
||||||
$this->db->where('POM.Status',PO_RELEASED);
|
$this->db->where('POM.Status',PO_RELEASED);
|
||||||
$this->db->where('POM.POType !=',SERVICE);
|
$this->db->where('POM.POType !=',SERVICE);
|
||||||
$this->db->or_where('POM.Status',IGR_CREATED);
|
$this->db->or_where('POM.Status',IGR_CREATED);
|
||||||
$this->db->or_where('POM.Status',MRIR_CREATED);
|
$this->db->or_where('POM.Status',MRIR_CREATED);
|
||||||
$this->db->or_where('POM.Status',MRIR_APPROVED);
|
$this->db->or_where('POM.Status',MRIR_APPROVED);
|
||||||
|
$this->db->or_where('POM.Status',OGR_COMPLETE);
|
||||||
$query = $this->db->get();
|
$query = $this->db->get();
|
||||||
|
|
||||||
$result = $query->result();
|
$result = $query->result();
|
||||||
@ -56,13 +152,15 @@ class inwardgateregister_model extends CI_Model
|
|||||||
function viewpurchaseorder($PO)
|
function viewpurchaseorder($PO)
|
||||||
{
|
{
|
||||||
|
|
||||||
$subQuery ='SELECT distinct POM.PONO,POL.MaterialCode,POL.Quantity,POL.ReceivedQuantity,(POL.Quantity -POL.ReceivedQuantity ) as PendingQty,POL.PONO,MM.MaterialName,MM.UOM
|
$subQuery ='SELECT distinct POM.PONO,POL.MaterialCode,POL.Quantity,POL.ReceivedQuantity,(POL.Quantity -POL.ReceivedQuantity ) as PendingQty,QuantityRejected,POL.PONO,MM.MaterialName,MM.UOM
|
||||||
from T_PurchaseOrder_Master POM
|
from T_PurchaseOrder_Master POM
|
||||||
left join T_PurchaseOrder_LineItem POL on POL.PONO = POM.PONO
|
left join T_PurchaseOrder_LineItem POL on POL.PONO = POM.PONO
|
||||||
left join T_IGR_Master IGM on IGM.PONO =POL.PONO
|
left join T_IGR_Master IGM on IGM.PONO =POL.PONO
|
||||||
left join T_IGR_Details igr on igr.MaterialCode = POL.MaterialCode and IGM.PONO =POL.PONO
|
left join T_IGR_Details igr on igr.MaterialCode = POL.MaterialCode and IGM.PONO =POL.PONO
|
||||||
left join T_MaterialMaster MM
|
left join T_MaterialMaster MM on MM.MaterialCode = POL.MaterialCode
|
||||||
on MM.MaterialCode = POL.MaterialCode where POM.PONO=? ';
|
left join T_MRIR_Master MRM on POM.PONO=MRM.PONO
|
||||||
|
left join T_MRIR_Details MRD on MRM.MRIRNO=MRD.MRIRNO and POL.MaterialCode=MRD.MaterialCode
|
||||||
|
where POM.PONO=? group by POL.MaterialCode';// and POM.Status not in(?) ';
|
||||||
|
|
||||||
$query = $this->db->query($subQuery, array($PO,IGR_CREATED));
|
$query = $this->db->query($subQuery, array($PO,IGR_CREATED));
|
||||||
return $query->result();
|
return $query->result();
|
||||||
@ -116,6 +214,29 @@ class inwardgateregister_model extends CI_Model
|
|||||||
return $query->result();
|
return $query->result();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
function addmaterialhistory($historydetails)
|
||||||
|
{
|
||||||
|
|
||||||
|
$this->db->trans_start();
|
||||||
|
$this->db->insert('T_Material_stock_history', $historydetails);
|
||||||
|
$insert_id = $this->db->affected_rows();
|
||||||
|
$this->db->trans_complete();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function getitemvalue($pono,$MaterialCode)
|
||||||
|
{
|
||||||
|
$this->db->select('Rate,SupplierID');
|
||||||
|
$this->db->from('T_PurchaseOrder_LineItem');
|
||||||
|
$this->db->join('T_PurchaseOrder_Master','T_PurchaseOrder_Master.PONO=T_PurchaseOrder_LineItem.PONO');
|
||||||
|
$this->db->where('T_PurchaseOrder_LineItem.PONO',$pono);
|
||||||
|
$this->db->where('MaterialCode',$MaterialCode);
|
||||||
|
$query = $this->db->get();
|
||||||
|
$result = $query->result();
|
||||||
|
return $result;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* To get igr details for revalant IGRNO
|
* To get igr details for revalant IGRNO
|
||||||
@ -165,7 +286,41 @@ class inwardgateregister_model extends CI_Model
|
|||||||
* @param number $updatedBy : This is updater's id
|
* @param number $updatedBy : This is updater's id
|
||||||
* @param array $Lineitem : This will have all edited po lineitem details
|
* @param array $Lineitem : This will have all edited po lineitem details
|
||||||
*/
|
*/
|
||||||
function UpdatePOMaster($PONO,$updatedBy)
|
function UpdateMRIROUTQty($mrirarray,$MRIRNO,$MaterialCode)
|
||||||
|
{
|
||||||
|
|
||||||
|
$this->db->where('MRIRNO', $MRIRNO);
|
||||||
|
$this->db->where('MaterialCode', $MaterialCode);
|
||||||
|
$this->db->update('T_MRIR_Details', $mrirarray);
|
||||||
|
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function UpdatePOMasterOGRStatus($pono,$POMasterStatuss)
|
||||||
|
{
|
||||||
|
$this->db->where('PONO', $pono);
|
||||||
|
$this->db->update('T_PurchaseOrder_Master', $POMasterStatuss);
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function update_OGR($PONO,$status)
|
||||||
|
{
|
||||||
|
$this->db->select('*');
|
||||||
|
$this->db->from('T_OGR_Master');
|
||||||
|
$this->db->where('PONO_INV',$PONO);
|
||||||
|
$query= $this->db->get();
|
||||||
|
|
||||||
|
if($query->num_rows!=0)
|
||||||
|
{
|
||||||
|
$this->db->where('PONO_INV',$PONO);
|
||||||
|
$ogrstatus=array('Status'=>$status);
|
||||||
|
$this->db->update('T_OGR_Master',$ogrstatus);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function UpdatePOMaster($PONO,$updatedBy)
|
||||||
{
|
{
|
||||||
$this->db->select('*');
|
$this->db->select('*');
|
||||||
$this->db->from('T_PurchaseOrder_LineItem');
|
$this->db->from('T_PurchaseOrder_LineItem');
|
||||||
@ -189,7 +344,74 @@ class inwardgateregister_model extends CI_Model
|
|||||||
* @param number $MaterialCode : This is material code
|
* @param number $MaterialCode : This is material code
|
||||||
* @return array $result : result of the query (returns po received quantity )
|
* @return array $result : result of the query (returns po received quantity )
|
||||||
*/
|
*/
|
||||||
function getPOLineItemReceivedQty($PONO,$MaterialCode)
|
function UpdateOGRMasterOGRStatus($OGRNO)
|
||||||
|
{
|
||||||
|
$this->db->select('*');
|
||||||
|
$this->db->from('T_OGR_Details');
|
||||||
|
$this->db->where('OGRNO',$OGRNO);
|
||||||
|
$this->db->where('Status !=',OGR_PARTIAL_COMPLETE);
|
||||||
|
|
||||||
|
$query = $this->db->get();
|
||||||
|
|
||||||
|
if ($query->num_rows == 0) {
|
||||||
|
$this->db->where('OGRNO', $OGRNO);
|
||||||
|
$OGRStatus = array('status'=>OGR_PARTIAL_COMPLETE);
|
||||||
|
$this->db->update('T_OGR_Master', $OGRStatus);
|
||||||
|
}
|
||||||
|
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$this->db->where('OGRNO', $OGRNO);
|
||||||
|
$OGRStatus = array('status'=>OGR_COMPLETE);
|
||||||
|
$this->db->update('T_OGR_Master', $OGRStatus);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
function UpdateMRIRMasterOGRStatus($MRIRNO,$OGRNO)
|
||||||
|
{
|
||||||
|
$this->db->select('*');
|
||||||
|
$this->db->from('T_OGR_Details');
|
||||||
|
$this->db->where('OGRNO',$OGRNO);
|
||||||
|
$this->db->where('Status !=',OGR_PARTIAL_COMPLETE);
|
||||||
|
|
||||||
|
$query = $this->db->get();
|
||||||
|
|
||||||
|
if ($query->num_rows == 0) {
|
||||||
|
$this->db->where('MRIRNO', $MRIRNO);
|
||||||
|
$OGRStatus = array('OGRstatus'=>OGR_PARTIAL_COMPLETE);
|
||||||
|
$this->db->update('T_MRIR_Master', $OGRStatus);
|
||||||
|
}
|
||||||
|
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$this->db->where('MRIRNO', $MRIRNO);
|
||||||
|
$OGRStatus = array('OGRstatus'=>OGR_COMPLETE);
|
||||||
|
$this->db->update('T_MRIR_Master', $OGRStatus);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
function updateogrpomaster($pono)
|
||||||
|
{
|
||||||
|
$this->db->select('*');
|
||||||
|
$this->db->from('T_PurchaseOrder_LineItem');
|
||||||
|
$this->db->where('PONO',$pono);
|
||||||
|
$this->db->where('OGR_Status !=','ST064');
|
||||||
|
|
||||||
|
$query = $this->db->get();
|
||||||
|
|
||||||
|
|
||||||
|
if ($query->num_rows == 0) {
|
||||||
|
$this->db->where('PONO',$pono);
|
||||||
|
$POStatus = array('status'=>'ST063');
|
||||||
|
$this->db->update('T_PurchaseOrder_Master', $POStatus);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function getPOLineItemReceivedQty($PONO,$MaterialCode)
|
||||||
{
|
{
|
||||||
$this->db->select('ReceivedQuantity');
|
$this->db->select('ReceivedQuantity');
|
||||||
$this->db->from('T_PurchaseOrder_LineItem');
|
$this->db->from('T_PurchaseOrder_LineItem');
|
||||||
@ -200,12 +422,373 @@ class inwardgateregister_model extends CI_Model
|
|||||||
return $result;
|
return $result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function GetMRIROutQty($MRIRNO,$MaterialCode)
|
||||||
|
{
|
||||||
|
$this->db->select('Ogr_Out_Qty');
|
||||||
|
$this->db->from('T_MRIR_Details');
|
||||||
|
$this->db->where('MRIRNO',$MRIRNO);
|
||||||
|
$this->db->where('MaterialCode',$MaterialCode);
|
||||||
|
$query = $this->db->get();
|
||||||
|
// print_r( $this->db->last_query());
|
||||||
|
$result = $query->result();
|
||||||
|
return $result;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function getCustomer()
|
||||||
|
{
|
||||||
|
$subQuery='select client_id,client_name from ip_clients';
|
||||||
|
$query = $this->db->query($subQuery);
|
||||||
|
return $query->result();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function getSupplier()
|
||||||
|
{
|
||||||
|
$subQuery='select SupplierID,SupplierName from T_SupplierDetailsN';
|
||||||
|
$query = $this->db->query($subQuery);
|
||||||
|
//print_r( $this->db->last_query());
|
||||||
|
return $query->result();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function getstoredmaterialcode()
|
||||||
|
{
|
||||||
|
$subQuery='select MaterialCode,MaterialName from T_MaterialMaster';
|
||||||
|
$query = $this->db->query($subQuery);
|
||||||
|
return $query->result();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
function getOGRData()
|
||||||
|
{
|
||||||
|
$this->db->select('T_OGR_Master.*,T_OGR_Details.*,T_SupplierDetailsN.SupplierName,sup.SupplierName as Servicesupplier');
|
||||||
|
$this->db->from('T_OGR_Master');
|
||||||
|
$this->db->join('T_OGR_Details','T_OGR_Details.OGRNO=T_OGR_Master.OGRNO');
|
||||||
|
$this->db->join('T_PurchaseOrder_Master','T_PurchaseOrder_Master.PONO=T_OGR_Master.PONO_INV','left');
|
||||||
|
$this->db->join('T_SupplierDetailsN','T_SupplierDetailsN.SupplierID=T_PurchaseOrder_Master.SupplierID','left');
|
||||||
|
$this->db->join('T_SupplierDetailsN sup','sup.SupplierID=T_OGR_Details.SupplierID','left');
|
||||||
|
$this->db->group_by('T_OGR_Master.OGRNO');
|
||||||
|
//$this->db->where();
|
||||||
|
$query = $this->db->get();
|
||||||
|
//print_r( $this->db->last_query());
|
||||||
|
$result = $query->result();
|
||||||
|
return $result;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function getOGRDataforedit($OGRNO)
|
||||||
|
{
|
||||||
|
$this->db->select('T_OGR_Master.*,T_SupplierDetailsN.SupplierName,T_OGR_Details.*,sup.SupplierName as ServiceSupname,T_MaterialMaster.MaterialName as Matname,Remark');
|
||||||
|
$this->db->from('T_OGR_Master');
|
||||||
|
$this->db->join('T_OGR_Details','T_OGR_Details.OGRNO=T_OGR_Master.OGRNO');
|
||||||
|
$this->db->join('T_PurchaseOrder_Master','T_PurchaseOrder_Master.PONO=T_OGR_Master.PONO_INV','left');
|
||||||
|
$this->db->join('T_SupplierDetailsN','T_SupplierDetailsN.SupplierID=T_PurchaseOrder_Master.SupplierID','left');
|
||||||
|
$this->db->join('T_SupplierDetailsN sup','sup.SupplierID=T_OGR_Details.SupplierID','left');
|
||||||
|
|
||||||
|
$this->db->join('T_MaterialMaster','T_MaterialMaster.MaterialCode=T_OGR_Details.MaterialCode','left');
|
||||||
|
$this->db->where('T_OGR_Master.OGRNO',$OGRNO);
|
||||||
|
//$this->db->group_by('T_OGR_Master.OGRNO');
|
||||||
|
|
||||||
|
$query = $this->db->get();
|
||||||
|
//print_r( $this->db->last_query());
|
||||||
|
$result = $query->result();
|
||||||
|
return $result;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
function getOGRlineDataforedit($OGRNO,$MRIRNO)
|
||||||
|
{
|
||||||
|
$this->db->select('T_OGR_Details.*,MaterialName,ActualQuantityReceived,Quantity,QuantityRejected');
|
||||||
|
$this->db->from('T_OGR_Details');
|
||||||
|
$this->db->join('T_MaterialMaster','T_MaterialMaster.MaterialCode=T_OGR_Details.MaterialCode');
|
||||||
|
$this->db->join('T_OGR_Master','T_OGR_Master.OGRNO=T_OGR_Details.OGRNO');
|
||||||
|
$this->db->join('T_MRIR_Master','T_MRIR_Master.PONO=T_OGR_Master.PONO_INV','left');
|
||||||
|
$this->db->join('T_MRIR_Details','T_MRIR_Details.MRIRNO=T_MRIR_Master.MRIRNO and T_MRIR_Details.MaterialCode=T_OGR_Details.MaterialCode');
|
||||||
|
$this->db->join('T_PurchaseOrder_Master','T_PurchaseOrder_Master.PONO=T_MRIR_Master.PONO');
|
||||||
|
$this->db->join('T_PurchaseOrder_LineItem','T_PurchaseOrder_Master.PONO=T_PurchaseOrder_LineItem.PONO and T_OGR_Details.MaterialCode=T_PurchaseOrder_LineItem.MaterialCode');
|
||||||
|
$this->db->where('T_OGR_Details.OGRNO',$OGRNO);
|
||||||
|
$this->db->where('T_MRIR_Details.MRIRNO',$MRIRNO);
|
||||||
|
$this->db->group_by('T_OGR_Details.MaterialCode');
|
||||||
|
|
||||||
|
$query = $this->db->get();
|
||||||
|
// print_r( $this->db->last_query());
|
||||||
|
$result = $query->result();
|
||||||
|
return $result;
|
||||||
|
}
|
||||||
|
|
||||||
|
function getInvoice($CustomerId)
|
||||||
|
{
|
||||||
|
|
||||||
|
$this->db->select('ip_invoices.invoice_id,invoice_number,item_product_id,item_name,item_quantity');
|
||||||
|
$this->db->from('ip_invoices');
|
||||||
|
$this->db->join('ip_invoice_items','ip_invoice_items.invoice_id = ip_invoices.invoice_id');
|
||||||
|
$this->db->join('ip_clients','ip_invoices.client_id = ip_clients.client_id');
|
||||||
|
$this->db->where('ip_invoices.client_id',$CustomerId);
|
||||||
|
|
||||||
|
$query = $this->db->get();
|
||||||
|
//print_r( $this->db->last_query());
|
||||||
|
$result = $query->result();
|
||||||
|
return $result;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function getPOmrir($PONO)
|
||||||
|
{
|
||||||
|
$this->db->select('MRIRNO');
|
||||||
|
$this->db->from('T_MRIR_Master');
|
||||||
|
$this->db->where('T_MRIR_Master.PONO',$PONO);
|
||||||
|
$this->db->where('T_MRIR_Master.OGRstatus !=',OGR_COMPLETE);
|
||||||
|
//$this->db->where('Status !=',IGR_CREATED);
|
||||||
|
$query = $this->db->get();
|
||||||
|
//print_r( $this->db->last_query());
|
||||||
|
//die();
|
||||||
|
$result = $query->result();
|
||||||
|
return $result;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
function getPO($supplierId)
|
||||||
|
{
|
||||||
|
|
||||||
|
/// echo $supplierId;
|
||||||
|
$subQuery='select T_PurchaseOrder_Master.PONO from T_PurchaseOrder_Master
|
||||||
|
join T_MRIR_Master on T_MRIR_Master.PONO= T_PurchaseOrder_Master.PONO
|
||||||
|
where T_PurchaseOrder_Master.SupplierID=? and (T_PurchaseOrder_Master.Status=? or T_PurchaseOrder_Master.Status=? or T_PurchaseOrder_Master.Status=? or T_PurchaseOrder_Master.Status=? or T_PurchaseOrder_Master.Status=? or T_PurchaseOrder_Master.Status=? or T_PurchaseOrder_Master.Status=?) group by T_PurchaseOrder_Master.PONO';
|
||||||
|
|
||||||
|
//$query= $this->db->query($subQuery, array($supplierId,ST044,PO,ST063));
|
||||||
|
$query= $this->db->query($subQuery, array($supplierId,ST044,PO,PO_RELEASED,IGR_CREATED,MRIR_CREATED,PARTIAL_MRIRAPPROVED,OGR_COMPLETE,OGR_PARTIAL_COMPLETE,OGR_CREATED));
|
||||||
|
//print_r( $this->db->last_query());
|
||||||
|
return $query->result();
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
function getPODetails($PONO)
|
||||||
|
{
|
||||||
|
|
||||||
|
$subQuery ='select distinct T_PurchaseOrder_Master.PONO,T_PurchaseOrder_LineItem.MaterialCode,
|
||||||
|
T_PurchaseOrder_LineItem.Quantity as Oqty,T_MRIR_Details.ActualQuantityReceived,
|
||||||
|
T_MRIR_Details.QuantityRejected,MaterialName,balance_Qty
|
||||||
|
from T_PurchaseOrder_Master
|
||||||
|
join T_PurchaseOrder_LineItem on T_PurchaseOrder_LineItem.PONO = T_PurchaseOrder_Master.PONO
|
||||||
|
join T_MRIR_Master on T_MRIR_Master.PONO = T_PurchaseOrder_Master.PONO
|
||||||
|
join T_MRIR_Details on T_MRIR_Master.MRIRNO = T_MRIR_Details.MRIRNO and T_PurchaseOrder_LineItem.MaterialCode=T_MRIR_Details.MaterialCode
|
||||||
|
join T_MaterialMaster on T_MRIR_Details.MaterialCode=T_MaterialMaster.MaterialCode
|
||||||
|
left join T_OGR_Master on T_PurchaseOrder_Master.PONO=T_OGR_Master.PONO_INV
|
||||||
|
left join T_OGR_Details on T_OGR_Master.OGRNO=T_OGR_Details.OGRNO and T_PurchaseOrder_LineItem.MaterialCode= T_OGR_Details.MaterialCode
|
||||||
|
where T_PurchaseOrder_Master.PONO=?';
|
||||||
|
|
||||||
|
$query = $this->db->query($subQuery, array($PONO));
|
||||||
|
//print_r($this->db->last_query());
|
||||||
|
return $query->result();
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
function getPOMRIRDetails($MRIRno,$PONO,$materialcode)
|
||||||
|
{
|
||||||
|
$subQuery='select T_MRIR_Details.MaterialCode,ActualQuantityReceived,QuantityAccepted,QuantityRejected,
|
||||||
|
MaterialName,Quantity as Oqty,SUM(Ogr_Out_Qty) as allowedQty
|
||||||
|
from T_MRIR_Details
|
||||||
|
join T_MaterialMaster on T_MRIR_Details.MaterialCode=T_MaterialMaster.MaterialCode
|
||||||
|
join T_MRIR_Master on T_MRIR_Details.MRIRNO = T_MRIR_Master.MRIRNO
|
||||||
|
join T_PurchaseOrder_LineItem on T_MRIR_Master.PONO = T_PurchaseOrder_LineItem.PONO and T_PurchaseOrder_LineItem.MaterialCode=T_MRIR_Details.MaterialCode
|
||||||
|
where T_MRIR_Details.MRIRNO=? and T_MRIR_Master.PONO=? and T_MRIR_Details.MaterialCode=? group by T_MRIR_Details.MaterialCode;';
|
||||||
|
$query = $this->db->query($subQuery, array($MRIRno,$PONO,$materialcode));
|
||||||
|
//print_r($this->db->last_query());
|
||||||
|
return $query->result();
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function getPOMRIRMaterial($MRIRno,$PONO)
|
||||||
|
{
|
||||||
|
$this->db->select('MaterialCode');
|
||||||
|
$this->db->from('T_MRIR_Details');
|
||||||
|
$this->db->join('T_MRIR_Master','T_MRIR_Master.MRIRNO=T_MRIR_Details.MRIRNO');
|
||||||
|
$this->db->where('T_MRIR_Details.MRIRNO',$MRIRno);
|
||||||
|
$this->db->where('PONO',$PONO);
|
||||||
|
$this->db->group_by('T_MRIR_Details.MaterialCode');
|
||||||
|
$query = $this->db->get();
|
||||||
|
//print_r( $this->db->last_query());
|
||||||
|
$result = $query->result();
|
||||||
|
return $result;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function gettotalout($PONO,$materialcode)
|
||||||
|
{
|
||||||
|
$subQuery='select SUM(Ogr_Out_Qty)
|
||||||
|
from T_MRIR_Details
|
||||||
|
join T_MRIR_Master on T_MRIR_Master.MRIRNO= T_MRIR_Details.MRIRNO
|
||||||
|
where PONO =? and MaterialCode = ?; ';
|
||||||
|
|
||||||
|
$query = $this->db->query($subQuery, array($PONO,$materialcode));
|
||||||
|
//print_r($this->db->last_query());
|
||||||
|
return $query->result();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
function getPOmaterialDetails($PONO,$materialcode)
|
||||||
|
{
|
||||||
|
$subQuery='select distinct T_PurchaseOrder_LineItem.MaterialCode,MaterialName,T_PurchaseOrder_LineItem.Quantity as Oqty,T_MRIR_Details.ActualQuantityReceived,T_MRIR_Details.QuantityRejected,balance_Qty
|
||||||
|
from T_PurchaseOrder_Master
|
||||||
|
join T_PurchaseOrder_LineItem on T_PurchaseOrder_LineItem.PONO = T_PurchaseOrder_Master.PONO
|
||||||
|
join T_MRIR_Master on T_MRIR_Master.PONO = T_PurchaseOrder_Master.PONO
|
||||||
|
join T_MRIR_Details on T_MRIR_Master.MRIRNO = T_MRIR_Details.MRIRNO and T_PurchaseOrder_LineItem.MaterialCode=T_MRIR_Details.MaterialCode
|
||||||
|
join T_MaterialMaster on T_MRIR_Details.MaterialCode=T_MaterialMaster.MaterialCode
|
||||||
|
left join T_OGR_Master on T_PurchaseOrder_Master.PONO=T_OGR_Master.PONO_INV
|
||||||
|
left join T_OGR_Details on T_OGR_Master.OGRNO=T_OGR_Details.OGRNO and T_PurchaseOrder_LineItem.MaterialCode= T_OGR_Details.MaterialCode
|
||||||
|
where T_PurchaseOrder_LineItem.PONO=? and T_PurchaseOrder_LineItem.MaterialCode=?'
|
||||||
|
;
|
||||||
|
$query = $this->db->query($subQuery, array($PONO,$materialcode));
|
||||||
|
// print_r($this->db->last_query());
|
||||||
|
return $query->result();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function getPOmaterial($PONO)
|
||||||
|
{
|
||||||
|
$subQuery ='select MaterialCode from T_PurchaseOrder_LineItem where PONO=?';
|
||||||
|
|
||||||
|
$query = $this->db->query($subQuery, array($PONO));
|
||||||
|
//print_r($this->db->last_query());
|
||||||
|
return $query->result();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
function AddOGR($ogrmaster)
|
||||||
|
{
|
||||||
|
$this->db->trans_start();
|
||||||
|
$this->db->insert('T_OGR_Master', $ogrmaster);
|
||||||
|
$insert_id = $this->db->affected_rows();
|
||||||
|
$this->db->trans_complete();
|
||||||
|
// print_r($this->db->last_query());
|
||||||
|
//print_r($insert_id);
|
||||||
|
if($insert_id>0)
|
||||||
|
{
|
||||||
|
$subQuery = 'select max(OGRNO) as OGRNO from T_OGR_Master';
|
||||||
|
|
||||||
|
$query = $this->db->query($subQuery);
|
||||||
|
|
||||||
|
return $query->result();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
function getlastogrline()
|
||||||
|
{
|
||||||
|
$subQuery = 'select max(OGRItemNO) as OGRItemNO from T_OGR_Details';
|
||||||
|
|
||||||
|
$query = $this->db->query($subQuery);
|
||||||
|
|
||||||
|
return $query->result();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function UpdateOGR($updateogrmaster,$OGRNO)
|
||||||
|
{
|
||||||
|
$this->db->where('OGRNO',$OGRNO);
|
||||||
|
//$this->db->where('MaterialCode', $MaterialCode);
|
||||||
|
$this->db->update('T_OGR_Master', $updateogrmaster);
|
||||||
|
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function AddOgrLine($Ogrline)
|
||||||
|
{
|
||||||
|
$this->db->trans_start();
|
||||||
|
$this->db->insert('T_OGR_Details',$Ogrline);
|
||||||
|
$insert_id = $this->db->affected_rows();
|
||||||
|
$this->db->trans_complete();
|
||||||
|
return $insert_id;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// function GetIGR_Details($pono)
|
||||||
|
// {
|
||||||
|
// $this->db->select('IGRNO,MRIRNO,MaterialCode,');
|
||||||
|
// $this->db->from('ip_invoices');
|
||||||
|
// $this->db->join('ip_invoice_items','ip_invoice_items.invoice_id = ip_invoices.invoice_id');
|
||||||
|
// $this->db->join('ip_clients','ip_invoices.client_id = ip_clients.client_id');
|
||||||
|
|
||||||
|
// $this->db->where('ip_invoices.client_id',$CustomerId);
|
||||||
|
|
||||||
|
// $query = $this->db->get();
|
||||||
|
// //print_r( $this->db->last_query());
|
||||||
|
// $result = $query->result();
|
||||||
|
// return $result;
|
||||||
|
// }
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
function GetPreSavedQty($pono,$MaterialCode)
|
||||||
|
{
|
||||||
|
// $subQuery = 'select Total_OutwardQty from T_PurchaseOrder_LineItem where PONO=? and MaterialCode=?';
|
||||||
|
// $query = $this->db->query($subQuery, array($pono,$MaterialCode));
|
||||||
|
// //print_r($this->db->last_query());
|
||||||
|
// return $query->result();
|
||||||
|
|
||||||
|
|
||||||
|
$this->db->select('Total_OutwardQty');
|
||||||
|
$this->db->from('T_PurchaseOrder_LineItem');
|
||||||
|
$this->db->where('PONO',$pono);
|
||||||
|
$this->db->where('MaterialCode',$MaterialCode);
|
||||||
|
$query = $this->db->get();
|
||||||
|
//print_r( $this->db->last_query());
|
||||||
|
$result = $query->result();
|
||||||
|
return $result;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function check_PO($pono)
|
||||||
|
{
|
||||||
|
$subQuery='select * from T_OGR_Master where PONO_INV=?';
|
||||||
|
$query=$this->db->query($subQuery,array($pono));
|
||||||
|
return $query->result();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function UpdatePOMasterOGR($postatus,$pono)
|
||||||
|
{
|
||||||
|
$this->db->where('PONO',$pono);
|
||||||
|
//$this->db->where('MaterialCode', $MaterialCode);
|
||||||
|
$this->db->update('T_PurchaseOrder_Master', $postatus);
|
||||||
|
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* To Update IGR master details for material recieved data and delivery ch date
|
* To Update IGR master details for material recieved data and delivery ch date
|
||||||
* @param number $IGRNo : This is igr no
|
* @param number $IGRNo : This is igr no
|
||||||
* @return array $igrarr : Igr Array
|
* @return array $igrarr : Igr Array
|
||||||
*/
|
*/
|
||||||
function updateigr($igrarr,$IGRNo){
|
|
||||||
|
function updateigr($igrarr,$IGRNo){
|
||||||
|
|
||||||
//$this->db->where('PONO',$PONO);
|
//$this->db->where('PONO',$PONO);
|
||||||
$this->db->where('IGRNO',$IGRNo);
|
$this->db->where('IGRNO',$IGRNo);
|
||||||
|
|||||||
@ -33,6 +33,7 @@ class mrir_model extends CI_Model
|
|||||||
$this->db->join('T_PurchaseOrder_LineItem POL','igr.PONO = POL.PONO and POL.MaterialCode=igrdetail.MaterialCode');
|
$this->db->join('T_PurchaseOrder_LineItem POL','igr.PONO = POL.PONO and POL.MaterialCode=igrdetail.MaterialCode');
|
||||||
$this->db->join('T_MaterialMaster MM', 'MM.MaterialCode = igrdetail.MaterialCode');
|
$this->db->join('T_MaterialMaster MM', 'MM.MaterialCode = igrdetail.MaterialCode');
|
||||||
$this->db->where('igr.IGRStatus !=',MRIR_CREATED);
|
$this->db->where('igr.IGRStatus !=',MRIR_CREATED);
|
||||||
|
$this->db->where('PO.IsQualityChkReqired',1);
|
||||||
$this->db->order_by("CreatedDate","desc");
|
$this->db->order_by("CreatedDate","desc");
|
||||||
$query = $this->db->get();
|
$query = $this->db->get();
|
||||||
$result = $query->result();
|
$result = $query->result();
|
||||||
|
|||||||
@ -1866,10 +1866,6 @@ return $amendment->result();
|
|||||||
|
|
||||||
function updatefile($bill,$Picture,$oldfile)
|
function updatefile($bill,$Picture,$oldfile)
|
||||||
{
|
{
|
||||||
|
|
||||||
// if($oldfile != ''){
|
|
||||||
// //unlink("uploads/BillFiles/".$oldfile);//this deletes the file on particular folder too
|
|
||||||
// }
|
|
||||||
$this->db->set('FilePath', $Picture); //value that used to update column
|
$this->db->set('FilePath', $Picture); //value that used to update column
|
||||||
$this->db->where('BillNo', $bill); //which row want to upgrade
|
$this->db->where('BillNo', $bill); //which row want to upgrade
|
||||||
$this->db->update('T_PurchaseOrder_BillUpload');
|
$this->db->update('T_PurchaseOrder_BillUpload');
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
$insuranceStatus = array(
|
$insuranceStatus = array(
|
||||||
array("name"=>"NO","value"=>"0"),array("name"=>"YES","value"=>"1")
|
array("name"=>"NO","value"=>"0"),array("name"=>"YES","value"=>"1")
|
||||||
);
|
);
|
||||||
$DeliverOption='';
|
$DeliverOption='';
|
||||||
@ -93,24 +93,28 @@ if(!empty($POMaster))
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if(!empty($RequistionDetails))
|
if(!empty($RequistionDetails))
|
||||||
{
|
{
|
||||||
|
|
||||||
foreach ($RequistionDetails as $ReqDet)
|
foreach ($RequistionDetails as $ReqDet)
|
||||||
{
|
{
|
||||||
|
// $Reqon=$ReqDet->ReqDate;
|
||||||
$Reqonn=new DateTime($ReqDet->ReqDate);
|
$Reqonn=new DateTime($ReqDet->ReqDate);
|
||||||
$Reqon=$Reqonn->format('d-m-Y');
|
$Reqon=$Reqonn->format('d-m-Y');
|
||||||
$Requestedby=$ReqDet->Requestedby;
|
$Requestedby=$ReqDet->Requestedby;
|
||||||
$RequesterName=$ReqDet->FirstName;
|
$RequesterName=$ReqDet->FirstName;
|
||||||
|
//$Status=$ReqDet->Status;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//echo "$WrkStatus";
|
||||||
|
|
||||||
if(!empty($AvlBudAmt))
|
if(!empty($AvlBudAmt))
|
||||||
{
|
{
|
||||||
$AvlAmount = number_format($AvlBudAmt, 2, '.', '');
|
|
||||||
|
$AvlAmount = number_format($AvlBudAmt, 2, '.', '');
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -192,38 +196,52 @@ if(statuscheck=="<?php echo SPECIAL_PO;?>" )//|| statuscheck=="<?php echo PO_AW
|
|||||||
{
|
{
|
||||||
$('#splpodiv').show();
|
$('#splpodiv').show();
|
||||||
}
|
}
|
||||||
|
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$('#splpodiv').hide();
|
$('#splpodiv').hide();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*****************************/
|
||||||
var update = '<?php echo json_encode($update)?>';
|
var update = '<?php echo json_encode($update)?>';
|
||||||
|
|
||||||
|
|
||||||
if(update !='null')
|
if(update !='null')
|
||||||
|
|
||||||
{
|
{
|
||||||
$('#editpodiv').show();
|
$('#editpodiv').show();
|
||||||
}
|
}
|
||||||
|
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$('#editpodiv').hide();
|
$('#editpodiv').hide();
|
||||||
}
|
}
|
||||||
|
/*****************************/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$('#PoTypeOptions').attr("style", "pointer-events: none;");
|
$('#PoTypeOptions').attr("style", "pointer-events: none;");
|
||||||
if(insuranceOpt=="1"){}
|
if(insuranceOpt=="1"){
|
||||||
|
|
||||||
|
}
|
||||||
else{
|
else{
|
||||||
$('#insuranceTxtDiv').hide();
|
$('#insuranceTxtDiv').hide();
|
||||||
}
|
}
|
||||||
|
if(DelOpt=="0"){
|
||||||
if(DelOpt=="0"){
|
$('#Deliverydtdiv').show();
|
||||||
$('#Deliverydtdiv').show();
|
$('#Schedulediv').hide();
|
||||||
$('#Schedulediv').hide();
|
$('#Deliverydt').val(DelDt);
|
||||||
$('#Deliverydt').val(DelDt);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
else if(DelOpt=="1"){
|
else if(DelOpt=="1"){
|
||||||
$('#Deliverydtdiv').hide();
|
$('#Deliverydtdiv').hide();
|
||||||
$('#Schedulediv').show();
|
$('#Schedulediv').show();
|
||||||
$('#Deliverydt').val('');
|
$('#Deliverydt').val('');
|
||||||
$('#Scheduleby').val(SchName);
|
|
||||||
|
$('#Scheduleby').val(SchName);
|
||||||
}
|
}
|
||||||
var PaymentOther = '<?php echo $otherPayment; ?>';
|
var PaymentOther = '<?php echo $otherPayment; ?>';
|
||||||
var PayTerms = '<?php echo $Terms; ?>';
|
var PayTerms = '<?php echo $Terms; ?>';
|
||||||
@ -247,15 +265,13 @@ var AvilBudAmt = '';
|
|||||||
var SelectedMaterialList = {
|
var SelectedMaterialList = {
|
||||||
Mat: []
|
Mat: []
|
||||||
};
|
};
|
||||||
|
$(function() {
|
||||||
$(function() {
|
|
||||||
$("#PODate").datepicker({
|
$("#PODate").datepicker({
|
||||||
//minDate : d,
|
//minDate : d,
|
||||||
//maxDate : 'now',
|
//maxDate : 'now',
|
||||||
dateFormat: 'dd-mm-yy',changeMonth: true, changeYear: true
|
dateFormat: 'dd-mm-yy',changeMonth: true, changeYear: true
|
||||||
}); //yearRange: '-100:+0'
|
}); //yearRange: '-100:+0'
|
||||||
|
$("#Deliverydt").datepicker({
|
||||||
$("#Deliverydt").datepicker({
|
|
||||||
minDate : 'now',
|
minDate : 'now',
|
||||||
dateFormat: 'dd-mm-yy',changeMonth: true, changeYear: true,yearRange: '0:+10'
|
dateFormat: 'dd-mm-yy',changeMonth: true, changeYear: true,yearRange: '0:+10'
|
||||||
});
|
});
|
||||||
@ -267,9 +283,10 @@ $("#Deliverydt").datepicker({
|
|||||||
$('#drpSupplier').change(function() {
|
$('#drpSupplier').change(function() {
|
||||||
|
|
||||||
var cd = $("#drpSupplier option:selected").text();
|
var cd = $("#drpSupplier option:selected").text();
|
||||||
|
//swal(cd);
|
||||||
$("#changeSup").val(cd);
|
$("#changeSup").val(cd);
|
||||||
var PaymentOtherData = '<?php echo $otherPayment; ?>';
|
var PaymentOtherData = '<?php echo $otherPayment; ?>';
|
||||||
var id = $('#drpSupplier').val();
|
var id = $('#drpSupplier').val();
|
||||||
|
|
||||||
$("#SupAddress").val('');
|
$("#SupAddress").val('');
|
||||||
|
|
||||||
@ -283,9 +300,14 @@ $('#drpSupplier').change(function() {
|
|||||||
$.each(y, function(idx, obj) {
|
$.each(y, function(idx, obj) {
|
||||||
if(obj.SupplierID === id)
|
if(obj.SupplierID === id)
|
||||||
{
|
{
|
||||||
$("#SupAddress").val(obj.Address);
|
$("#SupAddress").val(obj.Address);
|
||||||
PaymentID = obj.PaymentID;
|
|
||||||
|
PaymentID = obj.PaymentID;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
if(PaymentID!='PT08'){
|
if(PaymentID!='PT08'){
|
||||||
$('#otheroptiondiv').hide();
|
$('#otheroptiondiv').hide();
|
||||||
@ -294,18 +316,28 @@ $('#drpSupplier').change(function() {
|
|||||||
else if(PaymentID=='PT08'){
|
else if(PaymentID=='PT08'){
|
||||||
$('#otheroptiondiv').show();
|
$('#otheroptiondiv').show();
|
||||||
$('#Otherpayment').val(PaymentOtherData);
|
$('#Otherpayment').val(PaymentOtherData);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
$.each(Payment, function(pay, payobj) {
|
$.each(Payment, function(pay, payobj) {
|
||||||
if(payobj.PaymentID == PaymentID)
|
if(payobj.PaymentID == PaymentID)
|
||||||
{
|
{
|
||||||
$("#PaymentTerms").append( $('<option></option>').val(payobj.PaymentID).html(payobj.PaymentTerms));
|
|
||||||
|
|
||||||
|
$("#PaymentTerms").append( $('<option></option>').val(payobj.PaymentID).html(payobj.PaymentTerms));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
});
|
});
|
||||||
$.each(Payment, function(pay, payobj) {
|
$.each(Payment, function(pay, payobj) {
|
||||||
if(payobj.PaymentID == PaymentID){}
|
if(payobj.PaymentID == PaymentID)
|
||||||
else{
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
else{
|
||||||
$("#PaymentTerms").append( $('<option></option>').val(payobj.PaymentID).html(payobj.PaymentTerms));
|
$("#PaymentTerms").append( $('<option></option>').val(payobj.PaymentID).html(payobj.PaymentTerms));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
@ -384,6 +416,7 @@ $("#EditQuantity").val('');
|
|||||||
$.each(Material[i], function(idx, obj) {
|
$.each(Material[i], function(idx, obj) {
|
||||||
if(obj.MaterialCode === id)
|
if(obj.MaterialCode === id)
|
||||||
{
|
{
|
||||||
|
|
||||||
$("#EditItemName").val(obj.MaterialName);
|
$("#EditItemName").val(obj.MaterialName);
|
||||||
$("#EditUOM").val(obj.UOM);
|
$("#EditUOM").val(obj.UOM);
|
||||||
$("#EditQuantity").val(obj.Quantity);
|
$("#EditQuantity").val(obj.Quantity);
|
||||||
@ -400,12 +433,15 @@ $("#EditQuantity").val('');
|
|||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
function ChangeSgst(){
|
function ChangeSgst(){
|
||||||
|
|
||||||
$('#Sgst').val($('#Cgst').val());
|
$('#Sgst').val($('#Cgst').val());
|
||||||
Ratechange();
|
Ratechange();
|
||||||
}
|
}
|
||||||
function ChangeEditSgst(){
|
function ChangeEditSgst(){
|
||||||
|
|
||||||
$('#EditSgst').val($('#EditCgst').val());
|
$('#EditSgst').val($('#EditCgst').val());
|
||||||
EditRatechange();
|
EditRatechange();
|
||||||
}
|
}
|
||||||
@ -440,7 +476,8 @@ function Ratechange(){
|
|||||||
var Tot = txtQuantity * frequencyValue * txtUnitPrice;
|
var Tot = txtQuantity * frequencyValue * txtUnitPrice;
|
||||||
$('#txtBasicValue').val(parseFloat(Tot).toFixed(2));
|
$('#txtBasicValue').val(parseFloat(Tot).toFixed(2));
|
||||||
|
|
||||||
|
//Service Tax calculation
|
||||||
|
|
||||||
$('#AfterCgst').val(calculateCgstTax($('#txtBasicValue').val(),$("#Cgst").val()== '' ? "0.00" : $('#Cgst').val()));
|
$('#AfterCgst').val(calculateCgstTax($('#txtBasicValue').val(),$("#Cgst").val()== '' ? "0.00" : $('#Cgst').val()));
|
||||||
$('#AfterSgst').val(calculateSgstTax($('#txtBasicValue').val(),$("#Sgst").val()== '' ? "0.00" : $('#Sgst').val()));
|
$('#AfterSgst').val(calculateSgstTax($('#txtBasicValue').val(),$("#Sgst").val()== '' ? "0.00" : $('#Sgst').val()));
|
||||||
$('#AfterIgst').val(calculateIgstTax($('#txtBasicValue').val(),$("#Igst").val()== '' ? "0.00" : $('#Igst').val()));
|
$('#AfterIgst').val(calculateIgstTax($('#txtBasicValue').val(),$("#Igst").val()== '' ? "0.00" : $('#Igst').val()));
|
||||||
@ -473,10 +510,12 @@ function EditRatechange(){
|
|||||||
var txtQuantity = parseFloat( $('#EditQuantity').val());
|
var txtQuantity = parseFloat( $('#EditQuantity').val());
|
||||||
var txtUnitPrice = parseFloat($('#EditRate').val());
|
var txtUnitPrice = parseFloat($('#EditRate').val());
|
||||||
var frequencyValue = parseFloat($('#EditFrequencyNo').val());
|
var frequencyValue = parseFloat($('#EditFrequencyNo').val());
|
||||||
|
|
||||||
var Tot = txtQuantity * frequencyValue * txtUnitPrice
|
var Tot = txtQuantity * frequencyValue * txtUnitPrice
|
||||||
$('#txtEditBasicValue').val(parseFloat(Tot).toFixed(2));
|
$('#txtEditBasicValue').val(parseFloat(Tot).toFixed(2));
|
||||||
ExceedBudget(Tot, $('#EditAvlBudAmt').val());
|
ExceedBudget(Tot, $('#EditAvlBudAmt').val());
|
||||||
|
|
||||||
|
|
||||||
$('#EditAfterCgst').val(calculateCgstTax($('#txtEditBasicValue').val(),$("#EditCgst").val()== '' ? "0.00" : $('#EditCgst').val()));
|
$('#EditAfterCgst').val(calculateCgstTax($('#txtEditBasicValue').val(),$("#EditCgst").val()== '' ? "0.00" : $('#EditCgst').val()));
|
||||||
$('#EditAfterSgst').val(calculateSgstTax($('#txtEditBasicValue').val(),$("#EditSgst").val()== '' ? "0.00" : $('#EditSgst').val()));
|
$('#EditAfterSgst').val(calculateSgstTax($('#txtEditBasicValue').val(),$("#EditSgst").val()== '' ? "0.00" : $('#EditSgst').val()));
|
||||||
$('#EditAfterIgst').val(calculateIgstTax($('#txtEditBasicValue').val(),$("#EditIgst").val()== '' ? "0.00" : $('#EditIgst').val()));
|
$('#EditAfterIgst').val(calculateIgstTax($('#txtEditBasicValue').val(),$("#EditIgst").val()== '' ? "0.00" : $('#EditIgst').val()));
|
||||||
@ -503,8 +542,10 @@ function ExceedQuantityCheck()
|
|||||||
}
|
}
|
||||||
function EditExceedQuantityCheck()
|
function EditExceedQuantityCheck()
|
||||||
{
|
{
|
||||||
|
// RequistQuantity
|
||||||
var EnterQuantity = $("#EditQuantity").val()== '' ? "0.00" : parseFloat($("#EditQuantity").val());
|
var EnterQuantity = $("#EditQuantity").val()== '' ? "0.00" : parseFloat($("#EditQuantity").val());
|
||||||
var ReqQuantity = parseFloat(RequistQuantity);
|
var ReqQuantity = parseFloat(RequistQuantity);
|
||||||
|
//swal(ReqQuantity);
|
||||||
//if(EnterQuantity != ReqQuantity)
|
//if(EnterQuantity != ReqQuantity)
|
||||||
//{
|
//{
|
||||||
// swal('Your exceeding the Quantity from the Requisition Quantity:'+ RequistQuantity +'.Please adjust the Quantity to proceed further.');
|
// swal('Your exceeding the Quantity from the Requisition Quantity:'+ RequistQuantity +'.Please adjust the Quantity to proceed further.');
|
||||||
@ -739,6 +780,7 @@ $(document).ready(function () {
|
|||||||
<label>Supplier<span class="badge" style="color:red;text-align:right;background-color: #ecf0f5;">*</span></label>
|
<label>Supplier<span class="badge" style="color:red;text-align:right;background-color: #ecf0f5;">*</span></label>
|
||||||
<?php
|
<?php
|
||||||
$options = array("0"=>'Select Supplier');
|
$options = array("0"=>'Select Supplier');
|
||||||
|
//print_r( $options);
|
||||||
|
|
||||||
if(!empty($Suplist))
|
if(!empty($Suplist))
|
||||||
{
|
{
|
||||||
@ -748,6 +790,8 @@ $(document).ready(function () {
|
|||||||
$options[$SID->SupplierID] = $SID->SupplierID.' '.' - '.' '.$SID->SupplierName;
|
$options[$SID->SupplierID] = $SID->SupplierID.' '.' - '.' '.$SID->SupplierName;
|
||||||
|
|
||||||
endforeach;
|
endforeach;
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
echo form_dropdown('drpSupplier', $options,set_value('drpSupplier',$SupId ),'id="drpSupplier"' ,'required="true"' ,'class="form-control select2');
|
echo form_dropdown('drpSupplier', $options,set_value('drpSupplier',$SupId ),'id="drpSupplier"' ,'required="true"' ,'class="form-control select2');
|
||||||
@ -755,6 +799,11 @@ $(document).ready(function () {
|
|||||||
?> <input type="hidden" name="b4supplier" id="b4supplier" value="<?php echo $SupId;?>">
|
?> <input type="hidden" name="b4supplier" id="b4supplier" value="<?php echo $SupId;?>">
|
||||||
|
|
||||||
<input type="hidden" name="newsup" id="changeSup">
|
<input type="hidden" name="newsup" id="changeSup">
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<div class="col-md-12"><br/>
|
<div class="col-md-12"><br/>
|
||||||
<label>Address</label>
|
<label>Address</label>
|
||||||
@ -1086,7 +1135,13 @@ $(document).ready(function () {
|
|||||||
<option value=<?php echo $opt1;?>><?php echo $opt1;?></option>
|
<option value=<?php echo $opt1;?>><?php echo $opt1;?></option>
|
||||||
<option value=<?php echo $opt2;?>><?php echo $opt2;?></option>
|
<option value=<?php echo $opt2;?>><?php echo $opt2;?></option>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div><!--End new fields 1 sep-->
|
</div><!--End new fields 1 sep-->
|
||||||
|
|
||||||
@ -2152,7 +2207,7 @@ $(document).ready(function () {
|
|||||||
|
|
||||||
|
|
||||||
<div class="col-md-2">
|
<div class="col-md-2">
|
||||||
<label>CGST <?php echo "($INRSYM)"?></label>
|
<label>SGST <?php echo "($INRSYM)"?></label>
|
||||||
<?php
|
<?php
|
||||||
$data = array('name' => 'txtTotSgst','value' => set_value('txtTotSgst',number_format($TotalSgst, 2, '.', '')),'id'=>'txtTotSgst', 'class' => 'form-control num' ,'readonly' => 'true');
|
$data = array('name' => 'txtTotSgst','value' => set_value('txtTotSgst',number_format($TotalSgst, 2, '.', '')),'id'=>'txtTotSgst', 'class' => 'form-control num' ,'readonly' => 'true');
|
||||||
echo form_input($data);
|
echo form_input($data);
|
||||||
@ -2213,20 +2268,33 @@ $(document).ready(function () {
|
|||||||
<div class="col-md-12" id="splpodiv">
|
<div class="col-md-12" id="splpodiv">
|
||||||
<div class="col-md-12"><label>Special po Table List</label>
|
<div class="col-md-12"><label>Special po Table List</label>
|
||||||
<table id="table2" class="table table-hover table-bordered" style="background-color:#fff;font-size:12px;" >
|
<table id="table2" class="table table-hover table-bordered" style="background-color:#fff;font-size:12px;" >
|
||||||
|
|
||||||
<div class="col-md-12">
|
<div class="col-md-12">
|
||||||
|
|
||||||
|
|
||||||
<div class="col-md-offset-10 col-md-8" >
|
<div class="col-md-offset-10 col-md-8" >
|
||||||
<input type="button" class="btn btn-primary" id ="addmorebutton" value=" ADD FILES..">
|
<input type="button" class="btn btn-primary" id ="addmorebutton" value=" ADD FILES..">
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
<div id="newdiv"></div>
|
<div id="newdiv"></div>
|
||||||
<input type="hidden" name="hidecounter" id="hidecounter" value="0" />
|
<input type="hidden" name="hidecounter" id="hidecounter" value="0" />
|
||||||
<input type="hidden" name="hideconstant" id="hideconstant" value="0" />
|
<input type="hidden" name="hideconstant" id="hideconstant" value="0" />
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<thead style="background-color:#ddf">
|
<thead style="background-color:#ddf">
|
||||||
<tr>
|
<tr>
|
||||||
<th>Bill No </th>
|
<th>Bill No </th>
|
||||||
<th>File</th>
|
<!-- <th>Materials</th> -->
|
||||||
<th>Action</th>
|
<!-- <th>Delivery Challan No</th> -->
|
||||||
|
<!-- <th>Delivery Challan Date</th>
|
||||||
|
<th>Vehicle No</th>
|
||||||
|
<th>Courier No</th> -->
|
||||||
|
<!-- <th>Quantity</th> -->
|
||||||
|
<th>File</th>
|
||||||
|
|
||||||
|
<th>Action</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
|
|
||||||
@ -2241,7 +2309,12 @@ $(document).ready(function () {
|
|||||||
<tr id="lastvalue">
|
<tr id="lastvalue">
|
||||||
<td><?php echo $gd->BillNo ?></td>
|
<td><?php echo $gd->BillNo ?></td>
|
||||||
<input type="hidden" id="billnos<?= $row?>" value="<?= $gd->BillNo?>">
|
<input type="hidden" id="billnos<?= $row?>" value="<?= $gd->BillNo?>">
|
||||||
<input type="hidden" id="file<?=$row?>" value="<?=$gd->FilePath?>">
|
|
||||||
|
|
||||||
|
|
||||||
|
<input type="hidden" id="file<?=$row?>" value="<?=$gd->FilePath?>">
|
||||||
|
|
||||||
|
|
||||||
<td><?php echo (!empty($gd->FilePath))?$gd->FilePath:"No File"; ?></td>
|
<td><?php echo (!empty($gd->FilePath))?$gd->FilePath:"No File"; ?></td>
|
||||||
<td><span onclick="openmodel(<?=$row?>);"><i class="fa fa-pencil" data-toggle="tooltip" title="Click here to Edit the Revenue SplPO details"></i></span>
|
<td><span onclick="openmodel(<?=$row?>);"><i class="fa fa-pencil" data-toggle="tooltip" title="Click here to Edit the Revenue SplPO details"></i></span>
|
||||||
<?php if(!empty($gd->FilePath)) { ?>
|
<?php if(!empty($gd->FilePath)) { ?>
|
||||||
@ -2259,25 +2332,29 @@ $(document).ready(function () {
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<?php if(!empty($update)){?>
|
<?php if(!empty($update)){?>
|
||||||
<div class="col-md-12" id="editpodiv">
|
<div class="col-md-12" id="editpodiv">
|
||||||
<div class="col-md-12"><label>Editable POScreen</label>
|
<div class="col-md-12"><label>Editable POScreen</label>
|
||||||
<table id="edittable" class="table table-hover table-bordered" style="background-color:#fff;font-size:12px;" >
|
<table id="edittable" class="table table-hover table-bordered" style="background-color:#fff;font-size:12px;" >
|
||||||
<thead style="background-color:#ddf">
|
<thead style="background-color:#ddf">
|
||||||
<tr>
|
<tr>
|
||||||
<th>Sno</th>
|
<th>Sno</th>
|
||||||
<th>PONO</th>
|
<th>PONO</th>
|
||||||
<th>LineItemNo</th>
|
<!-- <th>Material</th> -->
|
||||||
|
<!-- <th>Date</th> -->
|
||||||
|
<th>LineItemNo</th>
|
||||||
<th>Entity</th>
|
<th>Entity</th>
|
||||||
<th>OldValue</th>
|
<th>OldValue</th>
|
||||||
<th>NewValue</th>
|
<th>NewValue</th>
|
||||||
<th>UpdatedBy</th>
|
<th>UpdatedBy</th>
|
||||||
<th>UpdateOn</th>
|
<th>UpdateOn</th>
|
||||||
|
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
|
|
||||||
|
|
||||||
<tbody>
|
<tbody>
|
||||||
<?php
|
<?php
|
||||||
if(!empty($getlogpodtl))
|
if(!empty($getlogpodtl))
|
||||||
{
|
{
|
||||||
@ -2315,8 +2392,8 @@ $(document).ready(function () {
|
|||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
</tbody>
|
</tbody>
|
||||||
<?php } else {}?>
|
<?php } else {}?>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@ -2325,12 +2402,19 @@ $(document).ready(function () {
|
|||||||
<!-- Service Special PO Modal Starts Here -->
|
<!-- Service Special PO Modal Starts Here -->
|
||||||
<div id="EditServiceSplPOModel" class="modal fade" data-backdrop-limit="1" role="dialog" aria-labelledby="myModalLabel" >
|
<div id="EditServiceSplPOModel" class="modal fade" data-backdrop-limit="1" role="dialog" aria-labelledby="myModalLabel" >
|
||||||
<div class="modal-dialog">
|
<div class="modal-dialog">
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<div class="modal-content" style="width:950px;">
|
<div class="modal-content" style="width:950px;">
|
||||||
<div class="modal-header">
|
<div class="modal-header">
|
||||||
<h4 class="modal-title">Update Bill <!-- <?php echo $getdata[0]->BillNo ?> --> <span id="bill"><span> Details</h4>
|
<h4 class="modal-title">Update Bill <!-- <?php echo $getdata[0]->BillNo ?> --> <span id="bill"><span> Details</h4>
|
||||||
</div>
|
</div>
|
||||||
<form class="tagForm" id="tag-form" method="post" enctype="multipart/form-data" >
|
<form class="tagForm" id="tag-form" method="post" enctype="multipart/form-data" >
|
||||||
<div class="modal-body" style="padding:0px;">
|
<div class="modal-body" style="padding:0px;">
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<div class="col-md-12">
|
<div class="col-md-12">
|
||||||
<div class="col-md-5">
|
<div class="col-md-5">
|
||||||
|
|
||||||
@ -2341,6 +2425,8 @@ $(document).ready(function () {
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<input type="hidden" name="hideoldfile" id="hideoldfile" class="form-control" readonly>
|
<input type="hidden" name="hideoldfile" id="hideoldfile" class="form-control" readonly>
|
||||||
<input type="hidden" name="hidebillno" id="hidebillno" class="form-control" readonly>
|
<input type="hidden" name="hidebillno" id="hidebillno" class="form-control" readonly>
|
||||||
</div><!-- /.modal body -->
|
</div><!-- /.modal body -->
|
||||||
@ -2361,6 +2447,13 @@ $(document).ready(function () {
|
|||||||
</div><!-- /.modal dialog -->
|
</div><!-- /.modal dialog -->
|
||||||
</div><!-- /#filemodal -->
|
</div><!-- /#filemodal -->
|
||||||
<!-- Revenue Special PO Modal Ends Here -->
|
<!-- Revenue Special PO Modal Ends Here -->
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<div class="col-md-12">
|
<div class="col-md-12">
|
||||||
|
|
||||||
@ -2369,6 +2462,7 @@ $(document).ready(function () {
|
|||||||
<input type="hidden" name="txtStatus" id="txtStatus" />
|
<input type="hidden" name="txtStatus" id="txtStatus" />
|
||||||
<input type="hidden" name="txtRowCount" id="txtRowCount" value="<?php echo $index;?>">
|
<input type="hidden" name="txtRowCount" id="txtRowCount" value="<?php echo $index;?>">
|
||||||
<input type="hidden" name="txtDeletedRow" id="txtDeletedRow" />
|
<input type="hidden" name="txtDeletedRow" id="txtDeletedRow" />
|
||||||
|
|
||||||
<input type="hidden" name="Budget" id="Budget" value="<?php echo $BudgetType; ?>" />
|
<input type="hidden" name="Budget" id="Budget" value="<?php echo $BudgetType; ?>" />
|
||||||
|
|
||||||
|
|
||||||
@ -2422,7 +2516,12 @@ $(document).ready(function () {
|
|||||||
<td align="left"><%=ActualQuantity%></td>
|
<td align="left"><%=ActualQuantity%></td>
|
||||||
<td align="left"><%=ReceivedQuantity%></td>
|
<td align="left"><%=ReceivedQuantity%></td>
|
||||||
<td align="left"><%=PendingQuantity%></td>
|
<td align="left"><%=PendingQuantity%></td>
|
||||||
<td><a data-target='#EDITSERVICE' data-id="<%=index%>" data-userid="<%=index%>" data-toggle="modal" href="#EDITSERVICE"><i class="fa fa-pencil" data-toggle="tooltip" title="Click here to view/Edit the <%=ReqNo%> Requisition details"></i> </a> <a href='#' onclick = "DeleteRow(<%=index%>)" class="link" data-id="<%=index%>" data-userid="<%=index%>" id="Del" ><span class="glyphicon glyphicon-trash"></span></a></td>
|
|
||||||
|
<td>
|
||||||
|
<a data-target='#EDITSERVICE' data-id="<%=index%>" data-userid="<%=index%>" data-toggle="modal" href="#EDITSERVICE"><i class="fa fa-pencil" data-toggle="tooltip" title="Click here to view/Edit the <%=ReqNo%> Requisition details"></i> </a> <a href='#' onclick = "DeleteRow(<%=index%>)" class="link" data-id="<%=index%>" data-userid="<%=index%>" id="Del" ><span class="glyphicon glyphicon-trash"></span></a>
|
||||||
|
|
||||||
|
|
||||||
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
@ -2436,6 +2535,7 @@ var userid = '';
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$("#BudgetType").change(function(){
|
$("#BudgetType").change(function(){
|
||||||
|
|
||||||
var aa = $("#BudgetType option:selected").text();
|
var aa = $("#BudgetType option:selected").text();
|
||||||
@ -2445,14 +2545,19 @@ $("#BudgetType").change(function(){
|
|||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$('#EditotherDescription').hide();
|
$('#EditotherDescription').hide();
|
||||||
$('#otherdescription').hide()
|
$('#otherdescription').hide()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$('.AddService').click(function(){
|
$('.AddService').click(function(){
|
||||||
|
|
||||||
tinyMCE.triggerSave();
|
tinyMCE.triggerSave();
|
||||||
if(validateServiceTax())
|
if(validateServiceTax())
|
||||||
{
|
{
|
||||||
|
// swal('inside Addservice');
|
||||||
var temp = parseInt(index) + 1;
|
var temp = parseInt(index) + 1;
|
||||||
var Reqnumber = $('#ReqNo').val();
|
var Reqnumber = $('#ReqNo').val();
|
||||||
var departmentName = $('#deptName').val();
|
var departmentName = $('#deptName').val();
|
||||||
@ -2484,11 +2589,13 @@ $('.AddService').click(function(){
|
|||||||
var ServiceDescription = $('#txtSpcialInstruction').val();
|
var ServiceDescription = $('#txtSpcialInstruction').val();
|
||||||
var OtherAmt = $('#OtherAllowances').val();
|
var OtherAmt = $('#OtherAllowances').val();
|
||||||
var TotalOrderValue = $("#TotalOrderValue ").val();
|
var TotalOrderValue = $("#TotalOrderValue ").val();
|
||||||
|
|
||||||
|
|
||||||
var basicval = $("#txtBasicValue").val();
|
var basicval = $("#txtBasicValue").val();
|
||||||
|
|
||||||
var otherdesc= $('#OtheritemDescription').val();
|
var otherdesc= $('#OtheritemDescription').val();
|
||||||
|
|
||||||
|
|
||||||
var TotalTaxValue = calculateTaxValue();
|
var TotalTaxValue = calculateTaxValue();
|
||||||
|
|
||||||
$('#MaterialCode option[value='+materialCode+']').remove();
|
$('#MaterialCode option[value='+materialCode+']').remove();
|
||||||
@ -2501,13 +2608,17 @@ $('.AddService').click(function(){
|
|||||||
|
|
||||||
});
|
});
|
||||||
populateValueMainFormForServiceTax();
|
populateValueMainFormForServiceTax();
|
||||||
|
|
||||||
|
|
||||||
index = parseInt(index)+1;
|
index = parseInt(index)+1;
|
||||||
|
|
||||||
var template = jQuery("#ServiceList").html();
|
var template = jQuery("#ServiceList").html();
|
||||||
|
|
||||||
|
|
||||||
$('#ServiceAppend').append(_.template(template,{index:temp,ReqNo:Reqnumber,MaterialCode:materialCode,MaterialName:ServiceDescription,Quantity:quantity,UOM:uom,Rate:itemRate,BasicAmount:basicval,Taxvalue:TotalTaxValue,TotalValue:TotalOrderValue,ActualQuantity:quantity,ReceivedQuantity:0,PendingQuantity:quantity}));
|
$('#ServiceAppend').append(_.template(template,{index:temp,ReqNo:Reqnumber,MaterialCode:materialCode,MaterialName:ServiceDescription,Quantity:quantity,UOM:uom,Rate:itemRate,BasicAmount:basicval,Taxvalue:TotalTaxValue,TotalValue:TotalOrderValue,ActualQuantity:quantity,ReceivedQuantity:0,PendingQuantity:quantity}));
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
var theForm = $(".ServicePO");
|
var theForm = $(".ServicePO");
|
||||||
|
|
||||||
addHidden(theForm,"Reqnumber"+temp,Reqnumber );
|
addHidden(theForm,"Reqnumber"+temp,Reqnumber );
|
||||||
@ -2532,6 +2643,7 @@ $('.AddService').click(function(){
|
|||||||
addHidden(theForm,"OtherAmt"+temp,OtherAmt);
|
addHidden(theForm,"OtherAmt"+temp,OtherAmt);
|
||||||
addHidden(theForm,"TotalOrderValue"+temp,TotalOrderValue);
|
addHidden(theForm,"TotalOrderValue"+temp,TotalOrderValue);
|
||||||
addHidden(theForm,"LineItemNo"+temp,'');
|
addHidden(theForm,"LineItemNo"+temp,'');
|
||||||
|
|
||||||
addHidden(theForm,"OtherServiceDescription"+temp,otherdesc);
|
addHidden(theForm,"OtherServiceDescription"+temp,otherdesc);
|
||||||
|
|
||||||
$('#txtRowCount').val(temp);
|
$('#txtRowCount').val(temp);
|
||||||
@ -2668,6 +2780,7 @@ function populateValueMainFormForEditServiceTax()
|
|||||||
{
|
{
|
||||||
|
|
||||||
var rows = document.getElementById('ServiceTable').rows.length;
|
var rows = document.getElementById('ServiceTable').rows.length;
|
||||||
|
// swal(rows);
|
||||||
var editrow = parseFloat(rows)-1;
|
var editrow = parseFloat(rows)-1;
|
||||||
var TotCgst = 0;
|
var TotCgst = 0;
|
||||||
var TotSgst = 0;
|
var TotSgst = 0;
|
||||||
@ -2679,11 +2792,14 @@ function populateValueMainFormForEditServiceTax()
|
|||||||
do {
|
do {
|
||||||
i += 1;
|
i += 1;
|
||||||
var tr= document.getElementById(i);
|
var tr= document.getElementById(i);
|
||||||
|
//swal(tr);
|
||||||
if(tr != null)
|
if(tr != null)
|
||||||
{
|
{
|
||||||
cells = tr.getElementsByTagName('td');
|
cells = tr.getElementsByTagName('td');
|
||||||
|
|
||||||
|
|
||||||
var rowid = cells[0].innerHTML;
|
var rowid = cells[0].innerHTML;
|
||||||
|
|
||||||
var AfterCgst = $('#AfterCgst'+rowid).val() == '' ? '0.00' : $('#AfterCgst'+rowid).val();
|
var AfterCgst = $('#AfterCgst'+rowid).val() == '' ? '0.00' : $('#AfterCgst'+rowid).val();
|
||||||
var AfterSgst = $('#AfterSgst'+rowid).val() == '' ? '0.00' : $('#AfterSgst'+rowid).val();
|
var AfterSgst = $('#AfterSgst'+rowid).val() == '' ? '0.00' : $('#AfterSgst'+rowid).val();
|
||||||
var AfterIgst = $('#AfterIgst'+rowid).val() == '' ? '0.00' : $('#AfterIgst'+rowid).val();
|
var AfterIgst = $('#AfterIgst'+rowid).val() == '' ? '0.00' : $('#AfterIgst'+rowid).val();
|
||||||
@ -2721,6 +2837,8 @@ function calculateEditTaxValue()
|
|||||||
var Cgst = parseFloat($('#EditAfterCgst').val());
|
var Cgst = parseFloat($('#EditAfterCgst').val());
|
||||||
var Sgst = parseFloat($('#EditAfterSgst').val());
|
var Sgst = parseFloat($('#EditAfterSgst').val());
|
||||||
var Igst = parseFloat($('#EditAfterIgst').val());
|
var Igst = parseFloat($('#EditAfterIgst').val());
|
||||||
|
|
||||||
|
|
||||||
var TottaxAmt = Cgst + Sgst + Igst;
|
var TottaxAmt = Cgst + Sgst + Igst;
|
||||||
return parseFloat(TottaxAmt).toFixed(2);
|
return parseFloat(TottaxAmt).toFixed(2);
|
||||||
}
|
}
|
||||||
@ -2750,6 +2868,7 @@ function clearServiceModalFields()
|
|||||||
$("#TotalOrderValue ").val('');
|
$("#TotalOrderValue ").val('');
|
||||||
$("#Frequency").val('');
|
$("#Frequency").val('');
|
||||||
tinyMCE.get('txtSpcialInstruction').setContent('');
|
tinyMCE.get('txtSpcialInstruction').setContent('');
|
||||||
|
|
||||||
$('#OtheritemDescription').val('');
|
$('#OtheritemDescription').val('');
|
||||||
}
|
}
|
||||||
var DeletedMaterialCode='';
|
var DeletedMaterialCode='';
|
||||||
@ -2892,6 +3011,7 @@ function populateValueMainFormForDeleteItem(rowid)
|
|||||||
var ItemRate = $('#itemRate'+rowid).val() == '' ? '0.00' : $('#itemRate'+rowid).val();
|
var ItemRate = $('#itemRate'+rowid).val() == '' ? '0.00' : $('#itemRate'+rowid).val();
|
||||||
var FrequencyValue = $('#FrequencyValue'+rowid).val() == '' ? '1.00' : $('#FrequencyValue'+rowid).val();
|
var FrequencyValue = $('#FrequencyValue'+rowid).val() == '' ? '1.00' : $('#FrequencyValue'+rowid).val();
|
||||||
var BasicVal = parseFloat(Quantity) * parseFloat(ItemRate) * parseFloat(FrequencyValue);
|
var BasicVal = parseFloat(Quantity) * parseFloat(ItemRate) * parseFloat(FrequencyValue);
|
||||||
|
//swal(TotalVal);
|
||||||
|
|
||||||
TotCgst = parseFloat(TotCgst) - parseFloat(AfterCgst);
|
TotCgst = parseFloat(TotCgst) - parseFloat(AfterCgst);
|
||||||
TotSgst = parseFloat(TotSgst) - parseFloat(AfterSgst);
|
TotSgst = parseFloat(TotSgst) - parseFloat(AfterSgst);
|
||||||
@ -3035,7 +3155,7 @@ function validateServiceTax()
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
//
|
||||||
</script>
|
</script>
|
||||||
<script>
|
<script>
|
||||||
|
|
||||||
@ -3054,6 +3174,7 @@ else if(status == '2')
|
|||||||
{
|
{
|
||||||
stat = '<?php echo PO_AWAITING_RELEASE; ?>';
|
stat = '<?php echo PO_AWAITING_RELEASE; ?>';
|
||||||
}
|
}
|
||||||
|
|
||||||
else if(status == '3')
|
else if(status == '3')
|
||||||
{
|
{
|
||||||
stat = '<?php echo SPECIAL_PO; ?>';
|
stat = '<?php echo SPECIAL_PO; ?>';
|
||||||
@ -3377,11 +3498,14 @@ $("#EDITSERVICE").on("shown.bs.modal", function(e) {
|
|||||||
$('#EditIgst').val($('#Igst'+userid).val());
|
$('#EditIgst').val($('#Igst'+userid).val());
|
||||||
$('#EditAfterCgst').val($('#AfterCgst'+userid).val());
|
$('#EditAfterCgst').val($('#AfterCgst'+userid).val());
|
||||||
$('#EditAfterSgst').val($('#AfterSgst'+userid).val());
|
$('#EditAfterSgst').val($('#AfterSgst'+userid).val());
|
||||||
$('#EditAfterIgst').val($('#AfterIgst'+userid).val());
|
$('#EditAfterIgst').val($('#AfterIgst'+userid).val());
|
||||||
|
|
||||||
$('#EditOtheritemDescription').val($('#OtherServiceDescription'+userid).val());
|
$('#EditOtheritemDescription').val($('#OtherServiceDescription'+userid).val());
|
||||||
|
|
||||||
var res= $('#OtherServiceDescription'+userid).val();
|
var res= $('#OtherServiceDescription'+userid).val();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if(res=='')
|
if(res=='')
|
||||||
{
|
{
|
||||||
$('#EditotherDescription').hide();
|
$('#EditotherDescription').hide();
|
||||||
@ -3390,6 +3514,9 @@ $("#EDITSERVICE").on("shown.bs.modal", function(e) {
|
|||||||
{
|
{
|
||||||
$('#EditotherDescription').show();
|
$('#EditotherDescription').show();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if($('#FrequencyValue'+userid).val()==1){
|
if($('#FrequencyValue'+userid).val()==1){
|
||||||
$('#EditFrequency').val($('#Frequency'+userid).val());
|
$('#EditFrequency').val($('#Frequency'+userid).val());
|
||||||
$("#EditFrequencyNo").val(1);
|
$("#EditFrequencyNo").val(1);
|
||||||
@ -3494,6 +3621,8 @@ $("#VIEWSERVICE").on("shown.bs.modal", function(e) {
|
|||||||
{
|
{
|
||||||
$('#ViewotherDescription').show();
|
$('#ViewotherDescription').show();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if($('#FrequencyValue'+userid).val()==1){
|
if($('#FrequencyValue'+userid).val()==1){
|
||||||
$('#ViewFrequency').val($('#Frequency'+userid).val());
|
$('#ViewFrequency').val($('#Frequency'+userid).val());
|
||||||
$("#ViewFrequencyNo").val(1);
|
$("#ViewFrequencyNo").val(1);
|
||||||
@ -3659,7 +3788,7 @@ function fileupload(counter)
|
|||||||
|
|
||||||
var PONO =$('#txtPONO').val();
|
var PONO =$('#txtPONO').val();
|
||||||
// var igr =$('#hiddenigrno').val();
|
// var igr =$('#hiddenigrno').val();
|
||||||
|
//swal(igr);
|
||||||
|
|
||||||
formData.append('file',file);
|
formData.append('file',file);
|
||||||
formData.append('PONO',PONO);
|
formData.append('PONO',PONO);
|
||||||
@ -3701,6 +3830,7 @@ $("#addmorebutton").click(function(){
|
|||||||
|
|
||||||
var bill = <?php echo json_encode($getdata)?>;
|
var bill = <?php echo json_encode($getdata)?>;
|
||||||
if(bill.length>=5){
|
if(bill.length>=5){
|
||||||
|
|
||||||
swal("You have to upload five files only");//this allows only 5 files;
|
swal("You have to upload five files only");//this allows only 5 files;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -3708,7 +3838,7 @@ else{
|
|||||||
var div = document.createElement('div');
|
var div = document.createElement('div');
|
||||||
div.id = "divid";
|
div.id = "divid";
|
||||||
div.className="row";
|
div.className="row";
|
||||||
|
//swal(counter);
|
||||||
div.innerHTML='<div class="col-md-12">'+
|
div.innerHTML='<div class="col-md-12">'+
|
||||||
|
|
||||||
'<div class="col-md-3">'+
|
'<div class="col-md-3">'+
|
||||||
@ -3746,10 +3876,18 @@ div.innerHTML='<div class="col-md-12">'+
|
|||||||
|
|
||||||
function addRow()
|
function addRow()
|
||||||
{
|
{
|
||||||
|
//swal();
|
||||||
|
|
||||||
|
//var filec= $('#images'+counter).val();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
var file = $('#images'+counter).val();
|
var file = $('#images'+counter).val();
|
||||||
|
//swal("fgh"+file);
|
||||||
|
// return false;
|
||||||
|
|
||||||
if (file == '')
|
if (file == '')
|
||||||
|
|
||||||
{
|
{
|
||||||
swal('File not found');
|
swal('File not found');
|
||||||
|
|
||||||
@ -3757,6 +3895,7 @@ var file = $('#images'+counter).val();
|
|||||||
else{
|
else{
|
||||||
fileupload(counter);
|
fileupload(counter);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function Copyfilename(id)
|
function Copyfilename(id)
|
||||||
@ -3767,11 +3906,13 @@ function Copyfilename(id)
|
|||||||
var number = id.replace(/[^0-9]+/ig,"");
|
var number = id.replace(/[^0-9]+/ig,"");
|
||||||
|
|
||||||
if(size > 2100000){
|
if(size > 2100000){
|
||||||
|
//swal(id);
|
||||||
swal('Sorry Your File is Large To 2MB');
|
swal('Sorry Your File is Large To 2MB');
|
||||||
removeRow(id);
|
removeRow(id);
|
||||||
|
//$('input[name = browseFiles'+number+']').val(' ');
|
||||||
}else {
|
}else {
|
||||||
var name = $('input[name='+id+']')[0].files[0].name;
|
var name = $('input[name='+id+']')[0].files[0].name;
|
||||||
|
//swal(name);
|
||||||
$("#maint_filename"+number).val(name);
|
$("#maint_filename"+number).val(name);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
380
application/views/Report_monthly_gst.php
Normal file
380
application/views/Report_monthly_gst.php
Normal file
@ -0,0 +1,380 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<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;
|
||||||
|
}
|
||||||
|
th, td { white-space: nowrap; }
|
||||||
|
.dataTable > thead > tr > th[class*="sort"]:after{
|
||||||
|
content: "" !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
table.dataTable thead > tr > th.sorting_asc,
|
||||||
|
table.dataTable thead > tr > th.sorting_desc,
|
||||||
|
table.dataTable thead > tr > th.sorting,
|
||||||
|
table.dataTable thead > tr > td.sorting_asc,
|
||||||
|
table.dataTable thead > tr > td.sorting_desc,
|
||||||
|
table.dataTable thead > tr > td.sorting {
|
||||||
|
padding-right: inherit;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
</style>
|
||||||
|
<div class="content-wrapper">
|
||||||
|
<section class="content">
|
||||||
|
<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>Report - Monthly GST</b>
|
||||||
|
<br><br>
|
||||||
|
<?php
|
||||||
|
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="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-3">
|
||||||
|
<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-3">
|
||||||
|
<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">
|
||||||
|
<label for="month">
|
||||||
|
<?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"><br><br>
|
||||||
|
<input type="submit" class="btn btn-success" name="btn_submit" style="margin-top: -14px;margin-bottom: 28px;"
|
||||||
|
value="View Report">
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<div class="box-body">
|
||||||
|
<div class = "table-responsive">
|
||||||
|
<center><table class="table table-bordered" id="cc" width="70%" style="font-size:12px !important;">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th style="text-align:center">Name</th>
|
||||||
|
<th style="text-align:center">Sales (<i class="fa fa-rupee " ></i>)</th>
|
||||||
|
<th style="text-align:center">Purchase (<i class="fa fa-rupee " ></i>)</th>
|
||||||
|
<th style="text-align:center">Net (<i class="fa fa-rupee "></i>)</th>
|
||||||
|
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
<?php
|
||||||
|
$m=$this->input->post('month');
|
||||||
|
$frm=$this->input->post('from_date');
|
||||||
|
$t=$this->input->post('to_date');
|
||||||
|
$ab=$this->input->post('financialyear');
|
||||||
|
if(!empty($monthly_gst_purchase) and !empty($monthly_gst_sales)){ ?>
|
||||||
|
|
||||||
|
<tr>
|
||||||
|
<td style="text-align:center"><span>SGST</span></td>
|
||||||
|
<td style="text-align:right"><span><?php
|
||||||
|
echo round($monthly_gst_sales[0]->sgst,2);?></span></td>
|
||||||
|
<td style="text-align:right"><span><?php
|
||||||
|
echo round($monthly_gst_purchase[0]->sgst,2);?></span></td>
|
||||||
|
<td style="text-align:right"><span><?php
|
||||||
|
$sgst_net = $monthly_gst_sales[0]->sgst - $monthly_gst_purchase[0]->sgst;
|
||||||
|
echo round($sgst_net,2);?></span></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td style="text-align:center"><span>CGST</span></td>
|
||||||
|
<td style="text-align:right"><span><?php
|
||||||
|
echo round($monthly_gst_sales[0]->cgst,2);?></span></td>
|
||||||
|
<td style="text-align:right"><span><?php
|
||||||
|
echo round($monthly_gst_purchase[0]->cgst,2);?></span></td>
|
||||||
|
<td style="text-align:right"><span><?php
|
||||||
|
$cgst_net = $monthly_gst_sales[0]->cgst - $monthly_gst_purchase[0]->cgst;
|
||||||
|
echo round($cgst_net,2);?></span></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td style="text-align:center"><span>IGST</span></td>
|
||||||
|
<td style="text-align:right"><span><?php
|
||||||
|
echo round($monthly_gst_sales[0]->igst,2);?></span></td>
|
||||||
|
<td style="text-align:right"><span><?php
|
||||||
|
echo round($monthly_gst_purchase[0]->igst,2);?></span></td>
|
||||||
|
<td style="text-align:right"><span><?php
|
||||||
|
$igst_net = $monthly_gst_sales[0]->igst - $monthly_gst_purchase[0]->igst;
|
||||||
|
echo round($igst_net,2);?></span></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td style="text-align:center"><span>Total GST</span></td>
|
||||||
|
<td style="text-align:right"><span><?php
|
||||||
|
echo round($monthly_gst_sales[0]->total,2);?></span></td>
|
||||||
|
<td style="text-align:right"><span><?php
|
||||||
|
echo round($monthly_gst_purchase[0]->total,2);?></span></td>
|
||||||
|
<td style="text-align:right"><span><?php
|
||||||
|
$total_net = $monthly_gst_sales[0]->total - $monthly_gst_purchase[0]->total;
|
||||||
|
echo round($total_net,2);?></span></td>
|
||||||
|
</tr>
|
||||||
|
<?php } ?>
|
||||||
|
</tbody>
|
||||||
|
<tfoot width="100%">
|
||||||
|
<!--<tr>
|
||||||
|
<td style="text-align:center;"><strong>Total</strong></td>
|
||||||
|
|
||||||
|
<td class="amount" style="text-align:right">
|
||||||
|
<strong>
|
||||||
|
// <?php
|
||||||
|
// {
|
||||||
|
// echo number_format($tot_pac,2,'.','');
|
||||||
|
|
||||||
|
// }
|
||||||
|
|
||||||
|
// ?>
|
||||||
|
</strong></td>
|
||||||
|
<td class="amount" style="text-align:right">
|
||||||
|
<strong>
|
||||||
|
// <?php
|
||||||
|
// {
|
||||||
|
// echo number_format($tot_inc,2,'.','');
|
||||||
|
|
||||||
|
// }
|
||||||
|
|
||||||
|
// ?>
|
||||||
|
</strong></td>
|
||||||
|
<td class="amount" style="text-align:right">
|
||||||
|
<strong>
|
||||||
|
// <?php
|
||||||
|
// {
|
||||||
|
// echo number_format($tot_tot,2,'.','');
|
||||||
|
|
||||||
|
// }
|
||||||
|
|
||||||
|
// ?>
|
||||||
|
</strong></td>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</tr>-->
|
||||||
|
|
||||||
|
</tfoot>
|
||||||
|
|
||||||
|
</table></center>
|
||||||
|
<div class="col-md-2" style="float: right;">
|
||||||
|
<form>
|
||||||
|
<a href="<?= base_url() ?>report/monthly_gst_table?m=<?php echo $m;?>&frm=<?php echo $frm;?>&t=<?php echo $t;?>&financialyear=<?php echo $ab;?>"><input style="width: 100px; padding: 10px; cursor: pointer; box-shadow: 6px 6px 5px; #999; -webkit-box-shadow: 6px 6px 5px #999; -moz-box-shadow: 6px 6px 5px #999; font-weight: bold; color: #000; border-radius: 10px; border: 1px solid #999; font-size: 100%;" type="button" value="View details"/></a>
|
||||||
|
</form>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</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 src="https://cdn.datatables.net/plug-ins/1.10.16/sorting/datetime-moment.js"></script>
|
||||||
|
<script>
|
||||||
|
|
||||||
|
|
||||||
|
// Bootstrap datepicker
|
||||||
|
// Set up your table
|
||||||
|
$(document).ready(function() {
|
||||||
|
$.fn.dataTable.moment( 'DD-MM-YYYY' );
|
||||||
|
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>>",
|
||||||
|
"paging": false,
|
||||||
|
"lengthChange": false,
|
||||||
|
"searching": false,
|
||||||
|
"ordering": false,
|
||||||
|
"info": false,
|
||||||
|
buttons: [
|
||||||
|
|
||||||
|
{
|
||||||
|
extend: 'excelHtml5',
|
||||||
|
footer: 'true',
|
||||||
|
//messageTop: 'Report Monthly GST',
|
||||||
|
title: $('h3').text(),
|
||||||
|
exportOptions: {
|
||||||
|
columns: ':visible'
|
||||||
|
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
'colvis'
|
||||||
|
]
|
||||||
|
} );
|
||||||
|
} );
|
||||||
|
$('#mySelect').on('change',function(){
|
||||||
|
|
||||||
|
table
|
||||||
|
.column(4)
|
||||||
|
.search(this.value)
|
||||||
|
.draw();
|
||||||
|
});
|
||||||
|
|
||||||
|
$( 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('');
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
</script>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
618
application/views/Report_monthly_gst_table.php
Normal file
618
application/views/Report_monthly_gst_table.php
Normal file
@ -0,0 +1,618 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<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">
|
||||||
|
<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>Monthly GST Summary Report</b><br><br>
|
||||||
|
<div>
|
||||||
|
<br>
|
||||||
|
<label><input type="radio" name="colorRadio" id="value" onclick="toggleTables('2')" value="tab" checked> Sales</label>
|
||||||
|
<label><input type="radio" name="colorRadio" id="qty" onclick="toggleTables('1')" value="ta"> Purchase</label>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</p></h3></center>
|
||||||
|
</div>
|
||||||
|
<!-- /.box-header -->
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<div class="box-body">
|
||||||
|
<div class="box-body" style="display:block" id="a">
|
||||||
|
<table class="table table-bordered table-hover" id="cc" >
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th style="text-align:center">Date</th>
|
||||||
|
<th style="text-align:center">Document Number</th>
|
||||||
|
<th style="text-align:center">Document Type</th>
|
||||||
|
<th style="text-align:center">HSN CODE</th>
|
||||||
|
<th style="text-align:center">Value (₹)</th>
|
||||||
|
<th style="text-align:center">Others (₹)</th>
|
||||||
|
<th style="text-align:center">SGST (₹)</th>
|
||||||
|
<th style="text-align:center">CGST (₹)</th>
|
||||||
|
<th style="text-align:center">IGST (₹)</th>
|
||||||
|
<th style="text-align:center">Total (₹)</th>
|
||||||
|
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
<?php
|
||||||
|
$tot_val = 0;
|
||||||
|
$tot_oth = 0;
|
||||||
|
$tot_sgst = 0;
|
||||||
|
$tot_cgst = 0;
|
||||||
|
$tot_igst = 0;
|
||||||
|
$tot_tot = 0;
|
||||||
|
?>
|
||||||
|
|
||||||
|
<?php
|
||||||
|
|
||||||
|
if(!empty($monthly_gst_sales)){
|
||||||
|
foreach($monthly_gst_sales as $rel)
|
||||||
|
{
|
||||||
|
?>
|
||||||
|
<tr>
|
||||||
|
<td style="text-align:center"><span><?php echo $rel->date;?></span></td>
|
||||||
|
<td style="text-align:center"><span><?php echo $rel->doc_no;?></span></td>
|
||||||
|
<td style="text-align:center"><span><?php echo $rel->doc_type;?></span></td>
|
||||||
|
<td style="text-align:center"><span><?php echo $rel->hsn_code;?></span></td>
|
||||||
|
<td style="text-align:right"><span><?php
|
||||||
|
$tot_val= $tot_val + round($rel->value,2);
|
||||||
|
echo round($rel->value,2);
|
||||||
|
?></span></td>
|
||||||
|
<td></td>
|
||||||
|
<td style="text-align:right"><span><?php
|
||||||
|
$tot_sgst= $tot_sgst + round($rel->sgst,2);
|
||||||
|
echo round($rel->sgst,2);
|
||||||
|
?></span></td>
|
||||||
|
<td style="text-align:right"><span><?php
|
||||||
|
$tot_cgst= $tot_cgst + round($rel->cgst,2);
|
||||||
|
echo round($rel->cgst,2);
|
||||||
|
?></span></td>
|
||||||
|
<td style="text-align:right"><span><?php
|
||||||
|
$tot_igst= $tot_igst + round($rel->igst,2);
|
||||||
|
echo round($rel->igst,2);
|
||||||
|
?></span></td>
|
||||||
|
<td style="text-align:right"><span><?php
|
||||||
|
$tot_tot= $tot_tot + round($rel->total,2);
|
||||||
|
echo round($rel->total,2);
|
||||||
|
?></span></td>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</tr>
|
||||||
|
<?php
|
||||||
|
}
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
</tbody>
|
||||||
|
<tfoot width="100%">
|
||||||
|
<tr>
|
||||||
|
<td style="text-align:center;"><strong>Total</strong></td>
|
||||||
|
<td><strong> </strong></td>
|
||||||
|
<td><strong> </strong></td>
|
||||||
|
<td><strong> </strong></td>
|
||||||
|
<td class="amount" style="text-align:right">
|
||||||
|
<strong>
|
||||||
|
<?php
|
||||||
|
{
|
||||||
|
echo number_format($tot_val,2,'.','');
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
?>
|
||||||
|
</strong></td>
|
||||||
|
<td class="amount" style="text-align:right">
|
||||||
|
<strong>
|
||||||
|
<?php
|
||||||
|
{
|
||||||
|
echo number_format($tot_oth,2,'.','');
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
?>
|
||||||
|
</strong></td>
|
||||||
|
<td class="amount" style="text-align:right">
|
||||||
|
<strong>
|
||||||
|
<?php
|
||||||
|
{
|
||||||
|
echo number_format($tot_sgst,2,'.','');
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
?>
|
||||||
|
</strong></td>
|
||||||
|
<td class="amount" style="text-align:right">
|
||||||
|
<strong>
|
||||||
|
<?php
|
||||||
|
{
|
||||||
|
echo number_format($tot_cgst,2,'.','');
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
?>
|
||||||
|
</strong></td>
|
||||||
|
<td class="amount" style="text-align:right">
|
||||||
|
<strong>
|
||||||
|
<?php
|
||||||
|
{
|
||||||
|
echo number_format($tot_igst,2,'.','');
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
?>
|
||||||
|
</strong></td>
|
||||||
|
<td class="amount" style="text-align:right">
|
||||||
|
<strong>
|
||||||
|
<?php
|
||||||
|
{
|
||||||
|
echo number_format($tot_tot,2,'.','');
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
?>
|
||||||
|
</strong></td>
|
||||||
|
|
||||||
|
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
</tfoot>
|
||||||
|
|
||||||
|
</table>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<!-- second table -->
|
||||||
|
<div class="box-body" style="display:none" id="b">
|
||||||
|
<table class="table table-bordered table-hover" id="cc1" >
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th style="text-align:center">Date</th>
|
||||||
|
<th style="text-align:center">Document Number</th>
|
||||||
|
<th style="text-align:center">Document Type</th>
|
||||||
|
<th style="text-align:center">HSN CODE</th>
|
||||||
|
<th style="text-align:center">Value (₹)</th>
|
||||||
|
<th style="text-align:center">Others (₹)</th>
|
||||||
|
<th style="text-align:center">SGST (₹)</th>
|
||||||
|
<th style="text-align:center">CGST (₹)</th>
|
||||||
|
<th style="text-align:center">IGST (₹)</th>
|
||||||
|
<th style="text-align:center">Total (₹)</th>
|
||||||
|
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
<?php
|
||||||
|
$tot_val = 0;
|
||||||
|
$tot_oth = 0;
|
||||||
|
$tot_sgst = 0;
|
||||||
|
$tot_cgst = 0;
|
||||||
|
$tot_igst = 0;
|
||||||
|
$tot_tot = 0;
|
||||||
|
if(!empty($monthly_gst_purchase)){
|
||||||
|
foreach($monthly_gst_purchase as $rel)
|
||||||
|
{
|
||||||
|
?>
|
||||||
|
<tr>
|
||||||
|
<td style="text-align:center"><span><?php echo $rel->date;?></span></td>
|
||||||
|
<td style="text-align:center"><span><?php echo $rel->doc_no;?></span></td>
|
||||||
|
<td style="text-align:center"><span><?php echo $rel->doc_type;?></span></td>
|
||||||
|
<td style="text-align:center"><span><?php echo $rel->hsn_code;?></span></td>
|
||||||
|
<td style="text-align:right"><span><?php
|
||||||
|
$tot_val= $tot_val + round($rel->value,2);
|
||||||
|
echo $rel->value;
|
||||||
|
?></span></td>
|
||||||
|
<td style="text-align:right"><span><?php
|
||||||
|
$tot_oth= $tot_oth + round($rel->others,2);
|
||||||
|
echo $rel->others;
|
||||||
|
?></span></td>
|
||||||
|
<td style="text-align:right"><span><?php
|
||||||
|
$tot_sgst= $tot_sgst + round($rel->sgst,2);
|
||||||
|
echo $rel->sgst;
|
||||||
|
?></span></td>
|
||||||
|
<td style="text-align:right"><span><?php
|
||||||
|
$tot_cgst= $tot_cgst + round($rel->cgst,2);
|
||||||
|
echo $rel->cgst;
|
||||||
|
?></span></td>
|
||||||
|
<td style="text-align:right"><span><?php
|
||||||
|
$tot_igst= $tot_igst + round($rel->igst,2);
|
||||||
|
echo $rel->igst;
|
||||||
|
?></span></td>
|
||||||
|
<td style="text-align:right"><span><?php
|
||||||
|
$tot_tot= $tot_tot + round($rel->total,2);
|
||||||
|
echo $rel->total;
|
||||||
|
?></span></td>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</tr>
|
||||||
|
<?php
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
?>
|
||||||
|
|
||||||
|
</tbody>
|
||||||
|
<tfoot width="100%">
|
||||||
|
<tr>
|
||||||
|
<td style="text-align:center;"><strong>Total</strong></td>
|
||||||
|
<td><strong> </strong></td>
|
||||||
|
<td><strong> </strong></td>
|
||||||
|
<td><strong> </strong></td>
|
||||||
|
<td class="amount" style="text-align:right">
|
||||||
|
<strong>
|
||||||
|
<?php
|
||||||
|
{
|
||||||
|
echo number_format($tot_val,2,'.','');
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
?>
|
||||||
|
</strong></td>
|
||||||
|
<td class="amount" style="text-align:right">
|
||||||
|
<strong>
|
||||||
|
<?php
|
||||||
|
{
|
||||||
|
echo number_format($tot_oth,2,'.','');
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
?>
|
||||||
|
</strong></td>
|
||||||
|
<td class="amount" style="text-align:right">
|
||||||
|
<strong>
|
||||||
|
<?php
|
||||||
|
{
|
||||||
|
echo number_format($tot_sgst,2,'.','');
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
?>
|
||||||
|
</strong></td>
|
||||||
|
<td class="amount" style="text-align:right">
|
||||||
|
<strong>
|
||||||
|
<?php
|
||||||
|
{
|
||||||
|
echo number_format($tot_cgst,2,'.','');
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
?>
|
||||||
|
</strong></td>
|
||||||
|
<td class="amount" style="text-align:right">
|
||||||
|
<strong>
|
||||||
|
<?php
|
||||||
|
{
|
||||||
|
echo number_format($tot_igst,2,'.','');
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
?>
|
||||||
|
</strong></td>
|
||||||
|
<td class="amount" style="text-align:right">
|
||||||
|
<strong>
|
||||||
|
<?php
|
||||||
|
{
|
||||||
|
echo number_format($tot_tot,2,'.','');
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
?>
|
||||||
|
</strong></td>
|
||||||
|
|
||||||
|
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
</tfoot>
|
||||||
|
|
||||||
|
</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 src="https://cdn.datatables.net/plug-ins/1.10.16/sorting/datetime-moment.js"></script>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
|
||||||
|
|
||||||
|
// Bootstrap datepicker
|
||||||
|
// Set up your table
|
||||||
|
$(document).ready(function() {
|
||||||
|
$.fn.dataTable.moment( 'DD-MM-YYYY' );
|
||||||
|
table = $('#cc').DataTable( {
|
||||||
|
"language": {
|
||||||
|
"emptyTable":"<center> Data Not Found ! </center>"
|
||||||
|
},
|
||||||
|
|
||||||
|
"aaSorting": [[ 0, "desc" ]],
|
||||||
|
"autoWidth": false,
|
||||||
|
orderCellsTop: true,
|
||||||
|
"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',
|
||||||
|
title: $('h3').text(),
|
||||||
|
exportOptions: {
|
||||||
|
columns: ':visible'
|
||||||
|
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
'colvis'
|
||||||
|
],
|
||||||
|
"footerCallback": function ( row, data, start, end, display ) {
|
||||||
|
var api = this.api(), data;
|
||||||
|
|
||||||
|
// Remove the formatting to get integer data for summation
|
||||||
|
var intVal = function ( i ) {
|
||||||
|
return typeof i === 'string' ?
|
||||||
|
parseFloat(i.replace(/[^0.00-9.00]+/g,"")*1) :
|
||||||
|
typeof i === 'number' ?
|
||||||
|
parseFloat(i) : 0;
|
||||||
|
};
|
||||||
|
|
||||||
|
TotalVALUE = api
|
||||||
|
.column( 4, { search:'applied' } )
|
||||||
|
.data()
|
||||||
|
.reduce( function (a, b) {
|
||||||
|
return intVal(a) + intVal(b);
|
||||||
|
}, 0 );
|
||||||
|
|
||||||
|
$( api.column( 4 ).footer() ).html( TotalVALUE.toFixed(2).bold() );
|
||||||
|
|
||||||
|
TotalOTHERS = api
|
||||||
|
.column( 5, { search:'applied' } )
|
||||||
|
.data()
|
||||||
|
.reduce( function (a, b) {
|
||||||
|
return intVal(a) + intVal(b);
|
||||||
|
}, 0 );
|
||||||
|
|
||||||
|
$( api.column( 5 ).footer() ).html( TotalOTHERS.toFixed(2).bold() );
|
||||||
|
|
||||||
|
TotalSGST = api
|
||||||
|
.column( 6, { search:'applied' } )
|
||||||
|
.data()
|
||||||
|
.reduce( function (a, b) {
|
||||||
|
return intVal(a) + intVal(b);
|
||||||
|
}, 0 );
|
||||||
|
|
||||||
|
$( api.column( 6 ).footer() ).html( TotalSGST.toFixed(2).bold() );
|
||||||
|
|
||||||
|
TotalCGST = api
|
||||||
|
.column( 7, { search:'applied' } )
|
||||||
|
.data()
|
||||||
|
.reduce( function (a, b) {
|
||||||
|
return intVal(a) + intVal(b);
|
||||||
|
}, 0 );
|
||||||
|
|
||||||
|
$( api.column( 7 ).footer() ).html( TotalCGST.toFixed(2).bold() );
|
||||||
|
|
||||||
|
TotalIGST = api
|
||||||
|
.column( 8, { search:'applied' } )
|
||||||
|
.data()
|
||||||
|
.reduce( function (a, b) {
|
||||||
|
return intVal(a) + intVal(b);
|
||||||
|
}, 0 );
|
||||||
|
|
||||||
|
$( api.column( 8 ).footer() ).html( TotalIGST.toFixed(2).bold() );
|
||||||
|
|
||||||
|
FinalTotal = api
|
||||||
|
.column( 9, { search:'applied' } )
|
||||||
|
.data()
|
||||||
|
.reduce( function (a, b) {
|
||||||
|
return intVal(a) + intVal(b);
|
||||||
|
}, 0 );
|
||||||
|
|
||||||
|
$( api.column( 9 ).footer() ).html( FinalTotal.toFixed(2).bold() );
|
||||||
|
|
||||||
|
}
|
||||||
|
} );
|
||||||
|
} );
|
||||||
|
//second table
|
||||||
|
$(document).ready(function() {
|
||||||
|
$.fn.dataTable.moment( 'DD-MM-YYYY' );
|
||||||
|
table = $('#cc1').DataTable( {
|
||||||
|
"language": {
|
||||||
|
"emptyTable":"<center> Data Not Found ! </center>"
|
||||||
|
},
|
||||||
|
"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',
|
||||||
|
title: $('h3').text(),
|
||||||
|
exportOptions: {
|
||||||
|
columns: ':visible'
|
||||||
|
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
'colvis'
|
||||||
|
],
|
||||||
|
"footerCallback": function ( row, data, start, end, display ) {
|
||||||
|
var api = this.api(), data;
|
||||||
|
|
||||||
|
// Remove the formatting to get integer data for summation
|
||||||
|
var intVal = function ( i ) {
|
||||||
|
return typeof i === 'string' ?
|
||||||
|
parseFloat(i.replace(/[^0.00-9.00]+/g,"")*1) :
|
||||||
|
typeof i === 'number' ?
|
||||||
|
parseFloat(i) : 0;
|
||||||
|
};
|
||||||
|
|
||||||
|
TotalVALUE = api
|
||||||
|
.column( 4, { search:'applied' } )
|
||||||
|
.data()
|
||||||
|
.reduce( function (a, b) {
|
||||||
|
return intVal(a) + intVal(b);
|
||||||
|
}, 0 );
|
||||||
|
|
||||||
|
$( api.column( 4 ).footer() ).html( TotalVALUE.toFixed(2).bold() );
|
||||||
|
|
||||||
|
TotalOTHERS = api
|
||||||
|
.column( 5, { search:'applied' } )
|
||||||
|
.data()
|
||||||
|
.reduce( function (a, b) {
|
||||||
|
return intVal(a) + intVal(b);
|
||||||
|
}, 0 );
|
||||||
|
|
||||||
|
$( api.column( 5 ).footer() ).html( TotalOTHERS.toFixed(2).bold() );
|
||||||
|
|
||||||
|
TotalSGST = api
|
||||||
|
.column( 6, { search:'applied' } )
|
||||||
|
.data()
|
||||||
|
.reduce( function (a, b) {
|
||||||
|
return intVal(a) + intVal(b);
|
||||||
|
}, 0 );
|
||||||
|
|
||||||
|
$( api.column( 6 ).footer() ).html( TotalSGST.toFixed(2).bold() );
|
||||||
|
|
||||||
|
TotalCGST = api
|
||||||
|
.column( 7, { search:'applied' } )
|
||||||
|
.data()
|
||||||
|
.reduce( function (a, b) {
|
||||||
|
return intVal(a) + intVal(b);
|
||||||
|
}, 0 );
|
||||||
|
|
||||||
|
$( api.column( 7 ).footer() ).html( TotalCGST.toFixed(2).bold() );
|
||||||
|
|
||||||
|
TotalIGST = api
|
||||||
|
.column( 8, { search:'applied' } )
|
||||||
|
.data()
|
||||||
|
.reduce( function (a, b) {
|
||||||
|
return intVal(a) + intVal(b);
|
||||||
|
}, 0 );
|
||||||
|
|
||||||
|
$( api.column( 8 ).footer() ).html( TotalIGST.toFixed(2).bold() );
|
||||||
|
|
||||||
|
FinalTotal = api
|
||||||
|
.column( 9, { search:'applied' } )
|
||||||
|
.data()
|
||||||
|
.reduce( function (a, b) {
|
||||||
|
return intVal(a) + intVal(b);
|
||||||
|
}, 0 );
|
||||||
|
|
||||||
|
$( api.column( 9 ).footer() ).html( FinalTotal.toFixed(2).bold() );
|
||||||
|
|
||||||
|
}
|
||||||
|
} );
|
||||||
|
} );
|
||||||
|
|
||||||
|
|
||||||
|
$( 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();
|
||||||
|
});
|
||||||
|
function toggleTables(which)
|
||||||
|
{
|
||||||
|
|
||||||
|
if(which == "2") {
|
||||||
|
document.getElementById('a').style.display = "block";
|
||||||
|
document.getElementById('b').style.display = "none";
|
||||||
|
|
||||||
|
}
|
||||||
|
if(which == "1") {
|
||||||
|
document.getElementById('b').style.display = "block";
|
||||||
|
document.getElementById('a').style.display = "none";
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -397,6 +397,7 @@ table.dataTable thead > tr > td.sorting {
|
|||||||
<td class="amount" style="text-align:right"><strong><?php echo number_format($tot_pac,2,'.',''); ?></strong></td>
|
<td class="amount" style="text-align:right"><strong><?php echo number_format($tot_pac,2,'.',''); ?></strong></td>
|
||||||
|
|
||||||
<td class="amount" style="text-align:right"><strong><?php echo number_format($tot_tot,2,'.',''); ?></strong></td>
|
<td class="amount" style="text-align:right"><strong><?php echo number_format($tot_tot,2,'.',''); ?></strong></td>
|
||||||
|
<td><strong> </strong></td>
|
||||||
|
|
||||||
</tr>
|
</tr>
|
||||||
</tfoot>
|
</tfoot>
|
||||||
|
|||||||
@ -66,9 +66,9 @@ $tvt=0.00;
|
|||||||
{
|
{
|
||||||
$opening_balances = $ttl->opening_amt;
|
$opening_balances = $ttl->opening_amt;
|
||||||
}}
|
}}
|
||||||
$open = $yesterdaytotal[0]->opening_amt;
|
// $open = $yesterdaytotal[0]->opening_amt;
|
||||||
echo $open;
|
// echo $open;
|
||||||
echo $yesterdaytotal[0]->opening_amt;
|
// echo $yesterdaytotal[0]->opening_amt;
|
||||||
?>
|
?>
|
||||||
<tr>
|
<tr>
|
||||||
<td style="text-align:left;"><strong>Yesterday Balances (opening balances)</strong></td>
|
<td style="text-align:left;"><strong>Yesterday Balances (opening balances)</strong></td>
|
||||||
|
|||||||
@ -16,7 +16,6 @@ $IsActive = '';
|
|||||||
$openstock='';
|
$openstock='';
|
||||||
$date='';
|
$date='';
|
||||||
$reorder='';
|
$reorder='';
|
||||||
$total='0.00';
|
|
||||||
|
|
||||||
if(!empty($materialDetails))
|
if(!empty($materialDetails))
|
||||||
{
|
{
|
||||||
@ -24,7 +23,6 @@ if(!empty($materialDetails))
|
|||||||
{
|
{
|
||||||
$MaterialCode = $MD->MaterialCode;
|
$MaterialCode = $MD->MaterialCode;
|
||||||
$MaterialName = $MD->MaterialName;
|
$MaterialName = $MD->MaterialName;
|
||||||
|
|
||||||
$MaterialType = $MD->MaterialType;
|
$MaterialType = $MD->MaterialType;
|
||||||
$MaterialCategory = $MD->Category;
|
$MaterialCategory = $MD->Category;
|
||||||
$UOM = $MD->UOM;
|
$UOM = $MD->UOM;
|
||||||
@ -35,9 +33,10 @@ if(!empty($materialDetails))
|
|||||||
$conversionfactorUOM = $MD->ConversionFactorUOM;
|
$conversionfactorUOM = $MD->ConversionFactorUOM;
|
||||||
$RMCode = $MD->RMCode;
|
$RMCode = $MD->RMCode;
|
||||||
$HSNcode = $MD->HSNCODE;
|
$HSNcode = $MD->HSNCODE;
|
||||||
$swal=$MD->stock;
|
$openstock=$MD->stock;
|
||||||
$date=$MD->stockdate;
|
$openstockdate=new DateTime($MD->stockdate);
|
||||||
$reorder=$MD->reorder;
|
$date = $openstockdate->format('d-m-Y');
|
||||||
|
$reorder=$MD->reorder;
|
||||||
$chk = $MD->IsActive;
|
$chk = $MD->IsActive;
|
||||||
|
|
||||||
if($chk == 1)
|
if($chk == 1)
|
||||||
@ -56,23 +55,19 @@ if(!empty($currentstock))
|
|||||||
|
|
||||||
$currentstock =$currentstock[0]['remainingqty'];
|
$currentstock =$currentstock[0]['remainingqty'];
|
||||||
|
|
||||||
$x = $swal;
|
$x = $openstock;
|
||||||
$y = $currentstock;
|
$y = $currentstock;
|
||||||
$total= $x + $y;
|
$total= $x + $y;
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
?>
|
|
||||||
|
|
||||||
<?php
|
|
||||||
|
|
||||||
if( $total <= $reorder){
|
if( $total <= $reorder){
|
||||||
|
|
||||||
echo '<script type="text/javascript">alert("Current Stock Low ");</script>';
|
echo '<script type="text/javascript">alert("Current Stock Low ");</script>';
|
||||||
|
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
<script>
|
<script>
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -104,19 +104,29 @@ $otherPayment = $Req->PaymentOtherDescription;
|
|||||||
$insurenceno = $Req->InsuranceNumber;
|
$insurenceno = $Req->InsuranceNumber;
|
||||||
$BudgetType = $Req->BudgetType;
|
$BudgetType = $Req->BudgetType;
|
||||||
$IGRNO =$Req->IGRNO;
|
$IGRNO =$Req->IGRNO;
|
||||||
|
// echo $insurenceno;
|
||||||
|
// echo $otherPayment;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
//echo $BudgetType;
|
||||||
if(!empty($RequistionDetails))
|
if(!empty($RequistionDetails))
|
||||||
{
|
{
|
||||||
foreach ($RequistionDetails as $ReqDet)
|
foreach ($RequistionDetails as $ReqDet)
|
||||||
{
|
{
|
||||||
$Reqonn=new DateTime($ReqDet->ReqDate);
|
$Reqonn=new DateTime($ReqDet->ReqDate);
|
||||||
$Reqon=$Reqonn->format('d-m-Y');
|
$Reqon=$Reqonn->format('d-m-Y');
|
||||||
|
|
||||||
|
// $Pdt = new DateTime($Req->PODate);
|
||||||
|
// $PODate = $Pdt->format('Y-m-d');
|
||||||
$Requestedby=$ReqDet->Requestedby;
|
$Requestedby=$ReqDet->Requestedby;
|
||||||
$RequesterName=$ReqDet->FirstName;
|
$RequesterName=$ReqDet->FirstName;
|
||||||
|
//$Status=$ReqDet->Status;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// foreach ($POSTATUS as $PST )
|
||||||
|
// {
|
||||||
|
// $POStatus=$PST->StatusName;
|
||||||
|
// }
|
||||||
if(!empty($getlogpodtl ))
|
if(!empty($getlogpodtl ))
|
||||||
{
|
{
|
||||||
foreach ($getlogpodtl as $values )
|
foreach ($getlogpodtl as $values )
|
||||||
@ -190,20 +200,41 @@ var DelOpt = '<?php echo $DeliverOption; ?>';
|
|||||||
var SchName = <?php echo json_encode($DeliverSchedule); ?>;
|
var SchName = <?php echo json_encode($DeliverSchedule); ?>;
|
||||||
var DelDt = '<?php echo $Deliverydt; ?>';
|
var DelDt = '<?php echo $Deliverydt; ?>';
|
||||||
var insurancestatus = '<?php echo $insurencestatus;?>';
|
var insurancestatus = '<?php echo $insurencestatus;?>';
|
||||||
|
//swal(insurancestatus)
|
||||||
var budgettype='<?php echo $BudgetType;?>';
|
var budgettype='<?php echo $BudgetType;?>';
|
||||||
|
// if(budgettype == 'CAPITAL')
|
||||||
|
// {
|
||||||
|
// swal('capital')
|
||||||
|
// document.getElementById('BudgetType').text = 2;
|
||||||
|
// document.getElementById('BudgetType').value = 'player';
|
||||||
|
// $('[name=BudgetType]').val(budgettype);
|
||||||
|
//}
|
||||||
|
//else
|
||||||
|
//{
|
||||||
|
// swal('revenue')
|
||||||
|
//document.getElementById('BudgetType').text = 1;
|
||||||
|
// document.getElementById('BudgetType').value = 'player';
|
||||||
|
//}
|
||||||
|
|
||||||
|
//swal(budgettype);
|
||||||
var insuranceno = '<?php echo $insurenceno;?>';
|
var insuranceno = '<?php echo $insurenceno;?>';
|
||||||
var statuscheck='<?php echo $PONOStatus;?>';
|
var statuscheck='<?php echo $PONOStatus;?>';
|
||||||
$(document).ready(function () {
|
$(document).ready(function () {
|
||||||
if(statuscheck=="<?php echo SPECIAL_PO;?>")
|
if(statuscheck=="<?php echo SPECIAL_PO;?>")
|
||||||
{
|
{
|
||||||
$('#splpodiv').show();
|
$('#splpodiv').show();
|
||||||
|
// var js_array =<?php echo json_encode($billfile);?>;
|
||||||
|
|
||||||
|
// if(js_array.length === 0) {
|
||||||
|
// $('#table3').hide();
|
||||||
|
// }
|
||||||
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$('#splpodiv').hide();
|
$('#splpodiv').hide();
|
||||||
}
|
}
|
||||||
|
/*****************************/
|
||||||
var update = '<?php echo json_encode($update)?>';
|
var update = '<?php echo json_encode($update)?>';
|
||||||
if(update !='null')
|
if(update !='null')
|
||||||
{
|
{
|
||||||
@ -213,7 +244,7 @@ else
|
|||||||
{
|
{
|
||||||
$('#editpodiv').hide();
|
$('#editpodiv').hide();
|
||||||
}
|
}
|
||||||
|
/*****************************/
|
||||||
$('#PoTypeOptions').attr("style", "pointer-events: none;");
|
$('#PoTypeOptions').attr("style", "pointer-events: none;");
|
||||||
if(DelOpt=="0"){
|
if(DelOpt=="0"){
|
||||||
$('#Deliverydtdiv').show();
|
$('#Deliverydtdiv').show();
|
||||||
@ -236,6 +267,8 @@ else{
|
|||||||
$('#otheroptiondiv').hide();
|
$('#otheroptiondiv').hide();
|
||||||
$('#Otherpayment').val('');
|
$('#Otherpayment').val('');
|
||||||
}
|
}
|
||||||
|
// var insurancestatus = <?php echo $insurencestatus;?>;
|
||||||
|
// var insuranceno = <?php echo $insurenceno;?>;
|
||||||
if(insurancestatus == 1)
|
if(insurancestatus == 1)
|
||||||
{
|
{
|
||||||
|
|
||||||
@ -297,7 +330,7 @@ dateFormat: 'dd-mm-yy',changeMonth: false, changeYear: false
|
|||||||
|
|
||||||
$('#drpSupplier').change(function() {
|
$('#drpSupplier').change(function() {
|
||||||
var cd = $("#drpSupplier option:selected").text();
|
var cd = $("#drpSupplier option:selected").text();
|
||||||
|
//swal(cd);
|
||||||
$("#changeSup").val(cd);
|
$("#changeSup").val(cd);
|
||||||
|
|
||||||
var id = $('#drpSupplier').val();
|
var id = $('#drpSupplier').val();
|
||||||
@ -1576,7 +1609,7 @@ else if( $('#txtFreight').val() != "0" && $('#txtFreight').val() != '')
|
|||||||
var FreightValue = parseFloat($('#txtFreight').val());
|
var FreightValue = parseFloat($('#txtFreight').val());
|
||||||
var UOM = parseFloat($('#UOM').val());
|
var UOM = parseFloat($('#UOM').val());
|
||||||
var Quantity = parseFloat($('#Quantity').val());
|
var Quantity = parseFloat($('#Quantity').val());
|
||||||
|
//swal(FreightType);
|
||||||
var AfterFreight = 0.0;
|
var AfterFreight = 0.0;
|
||||||
|
|
||||||
if(FreightType == PercentageType)
|
if(FreightType == PercentageType)
|
||||||
@ -1672,7 +1705,7 @@ else if( $('#txtEditFreight').val() != "0" && $('#txtEditFreight').val() != '
|
|||||||
var FreightValue = parseFloat($('#txtEditFreight').val());
|
var FreightValue = parseFloat($('#txtEditFreight').val());
|
||||||
var UOM = parseFloat($('#EditUOM').val());
|
var UOM = parseFloat($('#EditUOM').val());
|
||||||
var Quantity = parseFloat($('#EditQuantity').val());
|
var Quantity = parseFloat($('#EditQuantity').val());
|
||||||
|
//swal(FreightType);
|
||||||
var AfterFreight = 0.0;
|
var AfterFreight = 0.0;
|
||||||
// if(FreightType == PercentageType)
|
// if(FreightType == PercentageType)
|
||||||
// {
|
// {
|
||||||
@ -1742,7 +1775,7 @@ calculateEditTotalValue();
|
|||||||
}else if(isEdit == '2')// for view model freight calculation
|
}else if(isEdit == '2')// for view model freight calculation
|
||||||
{
|
{
|
||||||
|
|
||||||
|
//swal("view Frieght");
|
||||||
if($('#ViewMaterialCode').val() == "0")
|
if($('#ViewMaterialCode').val() == "0")
|
||||||
{
|
{
|
||||||
// swal('Please Select the Material Code');
|
// swal('Please Select the Material Code');
|
||||||
@ -1770,6 +1803,7 @@ else if( $('#txtViewFreight').val() != "0" && $('#txtViewFreight').val() != '')
|
|||||||
var FreightValue = parseFloat($('#txtViewFreight').val());
|
var FreightValue = parseFloat($('#txtViewFreight').val());
|
||||||
var UOM = parseFloat($('#ViewUOM').val());
|
var UOM = parseFloat($('#ViewUOM').val());
|
||||||
var Quantity = parseFloat($('#ViewQuantity').val());
|
var Quantity = parseFloat($('#ViewQuantity').val());
|
||||||
|
//swal(FreightType);
|
||||||
var AfterFreight = 0.0;
|
var AfterFreight = 0.0;
|
||||||
// if(FreightType == PercentageType)
|
// if(FreightType == PercentageType)
|
||||||
// {
|
// {
|
||||||
@ -1839,13 +1873,13 @@ basicvalue = $('#txtViewBasicValue').val();
|
|||||||
cgst= $('#ViewCGST').val();
|
cgst= $('#ViewCGST').val();
|
||||||
sgst= $('#ViewSGST').val();
|
sgst= $('#ViewSGST').val();
|
||||||
igst= $('#ViewIGST').val();
|
igst= $('#ViewIGST').val();
|
||||||
|
//swal(igst);
|
||||||
afterdiscount= $('#txtViewAfterDiscount').val();
|
afterdiscount= $('#txtViewAfterDiscount').val();
|
||||||
|
//swal(afterdiscount);
|
||||||
packaging12= $('#txtViewAfterPackaging').val();
|
packaging12= $('#txtViewAfterPackaging').val();
|
||||||
|
//swal( packaging12);
|
||||||
freight12= $('#txtViewAfterFreight').val();//ViewAfterCGST
|
freight12= $('#txtViewAfterFreight').val();//ViewAfterCGST
|
||||||
|
//swal(freight12);
|
||||||
calculateCgstTax(basicvalue,cgst,afterdiscount,packaging12,freight12);
|
calculateCgstTax(basicvalue,cgst,afterdiscount,packaging12,freight12);
|
||||||
calculateSgstTax(basicvalue,sgst,afterdiscount,packaging12,freight12);
|
calculateSgstTax(basicvalue,sgst,afterdiscount,packaging12,freight12);
|
||||||
calculateIgstTax(basicvalue,igst,afterdiscount,packaging12,freight12)
|
calculateIgstTax(basicvalue,igst,afterdiscount,packaging12,freight12)
|
||||||
@ -1882,7 +1916,7 @@ function SetVatorCST()
|
|||||||
{
|
{
|
||||||
StateTaxCheck = $("input:radio[name='Range']:checked").val();
|
StateTaxCheck = $("input:radio[name='Range']:checked").val();
|
||||||
$('#txtPoRange').val(StateTaxCheck) ;
|
$('#txtPoRange').val(StateTaxCheck) ;
|
||||||
|
//swal('Radio clicke:'+StateTaxCheck);
|
||||||
if(StateTaxCheck == "0")
|
if(StateTaxCheck == "0")
|
||||||
{
|
{
|
||||||
// style="display:none;"
|
// style="display:none;"
|
||||||
@ -2020,7 +2054,7 @@ CSTCalculation = '';
|
|||||||
}
|
}
|
||||||
|
|
||||||
function Editchange(){
|
function Editchange(){
|
||||||
|
//swal('hi');
|
||||||
//ExceedEditQuantityCheck();
|
//ExceedEditQuantityCheck();
|
||||||
if($('#EditQuantity').val() != '' && $('#EditRate').val() != '')
|
if($('#EditQuantity').val() != '' && $('#EditRate').val() != '')
|
||||||
{
|
{
|
||||||
@ -2153,7 +2187,7 @@ var Discount = $('#txtEditAfterDiscount').val() == '' ? '0.00' : $('#txtEditAfte
|
|||||||
var totvalue = parseFloat(AfterCgst)+ parseFloat(AfterSgst) + parseFloat(AfterIgst);
|
var totvalue = parseFloat(AfterCgst)+ parseFloat(AfterSgst) + parseFloat(AfterIgst);
|
||||||
|
|
||||||
var tot = parseFloat(totvalue).toFixed(2);
|
var tot = parseFloat(totvalue).toFixed(2);
|
||||||
|
//swal('tot:'+tot);
|
||||||
return tot;
|
return tot;
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
@ -2180,7 +2214,6 @@ return tot;
|
|||||||
<div style="border:2px solid #333">
|
<div style="border:2px solid #333">
|
||||||
<div id="content"></div>
|
<div id="content"></div>
|
||||||
<div>
|
<div>
|
||||||
<!-- <center><b><h2>Siddharth Industries - Edit Revenue Purchase Order - <?php echo $PONO;?></h2></b></center></div> -->
|
|
||||||
<center><b><h2><?php echo $pageTitle . '-' . $PONO;?></h2></b></center></div>
|
<center><b><h2><?php echo $pageTitle . '-' . $PONO;?></h2></b></center></div>
|
||||||
<div class="container-fluid">
|
<div class="container-fluid">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
@ -4090,9 +4123,19 @@ return tot;
|
|||||||
<td><?php echo $gd->BillNo ?></td>
|
<td><?php echo $gd->BillNo ?></td>
|
||||||
|
|
||||||
<td ><?php echo (!empty($gd->FilePath))?$gd->FilePath:"No File"; ?></td>
|
<td ><?php echo (!empty($gd->FilePath))?$gd->FilePath:"No File"; ?></td>
|
||||||
|
<!-- <input type="hidden" id="hiddenigrno" value="<?php $gd->IGRNO?>"> -->
|
||||||
<input type="hidden" id="billnos<?=$index?>" value="<?= $gd->BillNo?>">
|
<input type="hidden" id="billnos<?=$index?>" value="<?= $gd->BillNo?>">
|
||||||
<input type="hidden" id="file<?=$index?>" name ='file' value="<?=$gd->FilePath?>">
|
<input type="hidden" id="file<?=$index?>" name ='file' value="<?=$gd->FilePath?>">
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<td><span onclick="openbillmodel(<?php echo $index ?>);"><i class="fa fa-pencil" data-toggle="tooltip" title="Click here to Edit the Revenue SplPO details"></i></span>
|
<td><span onclick="openbillmodel(<?php echo $index ?>);"><i class="fa fa-pencil" data-toggle="tooltip" title="Click here to Edit the Revenue SplPO details"></i></span>
|
||||||
<?php if(!empty($gd->FilePath)) { ?>
|
<?php if(!empty($gd->FilePath)) { ?>
|
||||||
<a target="_blank" href="<?php echo base_url().'uploads/BillFiles/'?><?php echo $gd->FilePath ?>"><i class="fa fa-download" ></i></a>
|
<a target="_blank" href="<?php echo base_url().'uploads/BillFiles/'?><?php echo $gd->FilePath ?>"><i class="fa fa-download" ></i></a>
|
||||||
@ -4143,6 +4186,8 @@ return tot;
|
|||||||
|
|
||||||
<td><?php echo $inde; ?></td>
|
<td><?php echo $inde; ?></td>
|
||||||
<td><?php echo $oldpo->PONO ?></td>
|
<td><?php echo $oldpo->PONO ?></td>
|
||||||
|
|
||||||
|
|
||||||
<td><?php echo $oldpo->LineItemNo;?></td>
|
<td><?php echo $oldpo->LineItemNo;?></td>
|
||||||
<td><?php echo $oldpo->Entity?></td>
|
<td><?php echo $oldpo->Entity?></td>
|
||||||
<?php if($oldpo->Entity =='PO DateChanged'){
|
<?php if($oldpo->Entity =='PO DateChanged'){
|
||||||
@ -4369,11 +4414,11 @@ return tot;
|
|||||||
}
|
}
|
||||||
function openbillmodel(i){
|
function openbillmodel(i){
|
||||||
|
|
||||||
|
//swal(i);
|
||||||
var file = $("#file"+i).val();
|
var file = $("#file"+i).val();
|
||||||
|
//swal(file);
|
||||||
var Billno = $("#billnos"+i).val();
|
var Billno = $("#billnos"+i).val();
|
||||||
|
//swal(Billno);
|
||||||
|
|
||||||
$("#hideoldfile").val(file);
|
$("#hideoldfile").val(file);
|
||||||
$("#hidebillno").val(Billno);
|
$("#hidebillno").val(Billno);
|
||||||
@ -4401,7 +4446,7 @@ return tot;
|
|||||||
var quantity = parseFloat($("#Quantity").val()).toFixed(2);
|
var quantity = parseFloat($("#Quantity").val()).toFixed(2);
|
||||||
var itemRate = parseFloat($("#Rate").val()).toFixed(2);
|
var itemRate = parseFloat($("#Rate").val()).toFixed(2);
|
||||||
var PER = $("#AddPer").val();
|
var PER = $("#AddPer").val();
|
||||||
|
//swal(PER);
|
||||||
if(PER == '')
|
if(PER == '')
|
||||||
{
|
{
|
||||||
PER = $("#UOM").val();
|
PER = $("#UOM").val();
|
||||||
@ -4430,7 +4475,7 @@ return tot;
|
|||||||
var Insval = $("#txtInsurance").val();
|
var Insval = $("#txtInsurance").val();
|
||||||
var TotalOrderValue = $("#txtTotalOrderValue").val();
|
var TotalOrderValue = $("#txtTotalOrderValue").val();
|
||||||
var service_description = $("#Add_Service_Description").val();
|
var service_description = $("#Add_Service_Description").val();
|
||||||
|
//swal(service_description);
|
||||||
var TotalTaxValue = calculateTaxValue();
|
var TotalTaxValue = calculateTaxValue();
|
||||||
|
|
||||||
|
|
||||||
@ -4501,7 +4546,7 @@ return tot;
|
|||||||
tinyMCE.triggerSave();
|
tinyMCE.triggerSave();
|
||||||
if(validateEditRevenueTax() && validateEditExceedLimit() && ExceedEditQuantityCheck())
|
if(validateEditRevenueTax() && validateEditExceedLimit() && ExceedEditQuantityCheck())
|
||||||
{
|
{
|
||||||
|
//swal('inside Add');
|
||||||
var CostCode = $("#EditCostCenter").val();
|
var CostCode = $("#EditCostCenter").val();
|
||||||
var AvilBudget = $('#EditAvlBudAmt').val();
|
var AvilBudget = $('#EditAvlBudAmt').val();
|
||||||
var editMaterialCode = $("#EditMaterialCode").val();
|
var editMaterialCode = $("#EditMaterialCode").val();
|
||||||
@ -4603,7 +4648,7 @@ return tot;
|
|||||||
|
|
||||||
});
|
});
|
||||||
$('.ViewRevenue').click(function(){
|
$('.ViewRevenue').click(function(){
|
||||||
|
//swal("Working");
|
||||||
|
|
||||||
|
|
||||||
var FreightType = $("#drpViewFreight").val();
|
var FreightType = $("#drpViewFreight").val();
|
||||||
@ -4611,10 +4656,10 @@ return tot;
|
|||||||
var AfterFreightVal = $("#txtViewAfterFreight").val();
|
var AfterFreightVal = $("#txtViewAfterFreight").val();
|
||||||
var NoOfTrip = $("#ViewNOOfTrips").val();
|
var NoOfTrip = $("#ViewNOOfTrips").val();
|
||||||
var Cgst = $("#ViewAfterCGST").val();
|
var Cgst = $("#ViewAfterCGST").val();
|
||||||
|
//swal(Cgst);
|
||||||
var Sgst = $("#ViewAfterSGST").val();
|
var Sgst = $("#ViewAfterSGST").val();
|
||||||
var Igst = $("#ViewAfterIGST").val();
|
var Igst = $("#ViewAfterIGST").val();
|
||||||
|
// swal(Igst);
|
||||||
if(FreightType != 'PER TRIP'){
|
if(FreightType != 'PER TRIP'){
|
||||||
NoOfTrip=0;
|
NoOfTrip=0;
|
||||||
}
|
}
|
||||||
@ -4622,7 +4667,7 @@ return tot;
|
|||||||
|
|
||||||
var TotalOrderValue = $("#txtViewTotalOrderValue").val();
|
var TotalOrderValue = $("#txtViewTotalOrderValue").val();
|
||||||
|
|
||||||
|
//swal(FreightType+'-'+FreightVal+'-'+AfterFreightVal+'-'+NoOfTrip+'-'+TotalOrderValue);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -4697,9 +4742,9 @@ return tot;
|
|||||||
{
|
{
|
||||||
|
|
||||||
var rows = document.getElementById('revenueTax').rows.length;
|
var rows = document.getElementById('revenueTax').rows.length;
|
||||||
|
//swal(rows);
|
||||||
var editrow = parseFloat(rows)-1;
|
var editrow = parseFloat(rows)-1;
|
||||||
|
//swal(editrow);
|
||||||
var totBasicAmt = 0;
|
var totBasicAmt = 0;
|
||||||
var totDiscountAmt = 0;
|
var totDiscountAmt = 0;
|
||||||
var totPackagingAmt = 0;
|
var totPackagingAmt = 0;
|
||||||
@ -4713,16 +4758,16 @@ return tot;
|
|||||||
do {
|
do {
|
||||||
i += 1;
|
i += 1;
|
||||||
|
|
||||||
|
// swal(i);
|
||||||
var tr= document.getElementById(i);
|
var tr= document.getElementById(i);
|
||||||
|
//swal(tr);
|
||||||
if(tr != null)
|
if(tr != null)
|
||||||
{
|
{
|
||||||
cells = tr.getElementsByTagName('td');
|
cells = tr.getElementsByTagName('td');
|
||||||
|
|
||||||
|
|
||||||
var rowid = cells[0].innerHTML;
|
var rowid = cells[0].innerHTML;
|
||||||
|
// swal(rowid);
|
||||||
var Packaging = $('#AfterPackVal'+rowid).val() == '' ? '0.00' : $('#AfterPackVal'+rowid).val();
|
var Packaging = $('#AfterPackVal'+rowid).val() == '' ? '0.00' : $('#AfterPackVal'+rowid).val();
|
||||||
var Cgst = $('#RevenueAfterCgst'+rowid).val() == '' ? '0.00' : $('#RevenueAfterCgst'+rowid).val();
|
var Cgst = $('#RevenueAfterCgst'+rowid).val() == '' ? '0.00' : $('#RevenueAfterCgst'+rowid).val();
|
||||||
var Sgst = $('#RevenueAfterSgst'+rowid).val() == '' ? '0.00' : $('#RevenueAfterSgst'+rowid).val();
|
var Sgst = $('#RevenueAfterSgst'+rowid).val() == '' ? '0.00' : $('#RevenueAfterSgst'+rowid).val();
|
||||||
@ -4732,7 +4777,8 @@ return tot;
|
|||||||
var Discount =$('#AfterDisVal'+rowid).val() == '' ? '0.00' : $('#AfterDisVal'+rowid).val();
|
var Discount =$('#AfterDisVal'+rowid).val() == '' ? '0.00' : $('#AfterDisVal'+rowid).val();
|
||||||
var BasicVal = $('#basicval'+rowid).val() == '' ? '0.00' : $('#basicval'+rowid).val();
|
var BasicVal = $('#basicval'+rowid).val() == '' ? '0.00' : $('#basicval'+rowid).val();
|
||||||
var TotalVal =$('#TotalOrderValue'+rowid).val() == '' ? '0.00' : $('#TotalOrderValue'+rowid).val();
|
var TotalVal =$('#TotalOrderValue'+rowid).val() == '' ? '0.00' : $('#TotalOrderValue'+rowid).val();
|
||||||
|
//swal(TotalVal);
|
||||||
|
|
||||||
|
|
||||||
totBasicAmt = parseFloat(totBasicAmt ) + parseFloat(BasicVal);
|
totBasicAmt = parseFloat(totBasicAmt ) + parseFloat(BasicVal);
|
||||||
totDiscountAmt = parseFloat(totDiscountAmt ) + parseFloat(Discount);
|
totDiscountAmt = parseFloat(totDiscountAmt ) + parseFloat(Discount);
|
||||||
@ -4831,25 +4877,25 @@ return tot;
|
|||||||
function calculateCgstTax(varBasicValue,Cgst,discount,pack,freight)
|
function calculateCgstTax(varBasicValue,Cgst,discount,pack,freight)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
//swal("Working");
|
||||||
var discount1 = discount;
|
var discount1 = discount;
|
||||||
|
//swal('dis'+discount1);
|
||||||
var basicValue1 = parseFloat(varBasicValue-discount1);
|
var basicValue1 = parseFloat(varBasicValue-discount1);
|
||||||
|
//swal('basicValue1'+basicValue1);
|
||||||
var packaging = parseFloat(pack);
|
var packaging = parseFloat(pack);
|
||||||
|
//swal('packaging'+packaging);
|
||||||
var freight1 = parseFloat(freight);
|
var freight1 = parseFloat(freight);
|
||||||
|
//swal('freight1'+freight1);
|
||||||
var packfreight =parseFloat(packaging)+parseFloat(freight1);
|
var packfreight =parseFloat(packaging)+parseFloat(freight1);
|
||||||
|
//swal('packfreight'+packfreight);
|
||||||
var basicValue =parseFloat(basicValue1+packfreight)
|
var basicValue =parseFloat(basicValue1+packfreight)
|
||||||
var Cgst = parseFloat(Cgst);
|
var Cgst = parseFloat(Cgst);
|
||||||
|
//swal(basicValue+'-'+Cgst);
|
||||||
var ServiceTaxValue = 0.0;
|
var ServiceTaxValue = 0.0;
|
||||||
|
|
||||||
ServiceTaxValue = <?php echo SERVICETAX_CGST; ?>;//((Cgst/100) * basicValue)
|
ServiceTaxValue = <?php echo SERVICETAX_CGST; ?>;//((Cgst/100) * basicValue)
|
||||||
var TAXval = parseFloat(ServiceTaxValue).toFixed(2);
|
var TAXval = parseFloat(ServiceTaxValue).toFixed(2);
|
||||||
|
//swal('FInal' + TAXval);
|
||||||
|
|
||||||
$('#ViewAfterCGST').val(TAXval);
|
$('#ViewAfterCGST').val(TAXval);
|
||||||
$('#ViewAfterSGST').val(TAXval);
|
$('#ViewAfterSGST').val(TAXval);
|
||||||
@ -4860,7 +4906,7 @@ return tot;
|
|||||||
var discount1 = discount;
|
var discount1 = discount;
|
||||||
var basicValue1 = parseFloat(varBasicValue-discount1);
|
var basicValue1 = parseFloat(varBasicValue-discount1);
|
||||||
var packaging = parseFloat(pack);
|
var packaging = parseFloat(pack);
|
||||||
|
//swal('f'+packaging);
|
||||||
var freight1 = parseFloat(freight);
|
var freight1 = parseFloat(freight);
|
||||||
|
|
||||||
var packfreight =parseFloat(packaging)+parseFloat(freight1);
|
var packfreight =parseFloat(packaging)+parseFloat(freight1);
|
||||||
@ -4880,9 +4926,9 @@ return tot;
|
|||||||
var packfreight=parseFloat(packaging)+parseFloat(freight);
|
var packfreight=parseFloat(packaging)+parseFloat(freight);
|
||||||
var basicValue1 = parseFloat(varBasicValue-discount);
|
var basicValue1 = parseFloat(varBasicValue-discount);
|
||||||
var basicValue =parseFloat(basicValue1+packfreight)
|
var basicValue =parseFloat(basicValue1+packfreight)
|
||||||
|
//swal(basicValue);
|
||||||
var Igst = parseFloat(Igst);
|
var Igst = parseFloat(Igst);
|
||||||
|
//swal(Igst);
|
||||||
var ServiceTaxValue = 0.0;
|
var ServiceTaxValue = 0.0;
|
||||||
|
|
||||||
ServiceTaxValue = <?php echo SERVICETAX_IGST; ?>;
|
ServiceTaxValue = <?php echo SERVICETAX_IGST; ?>;
|
||||||
@ -4909,7 +4955,7 @@ return tot;
|
|||||||
success:function(data) {
|
success:function(data) {
|
||||||
if(data)
|
if(data)
|
||||||
{
|
{
|
||||||
|
//swal(data);
|
||||||
avalbudAmt = parseFloat(data);
|
avalbudAmt = parseFloat(data);
|
||||||
// if(basicAmountRate > avalbudAmt || totalAmount > avalbudAmt)
|
// if(basicAmountRate > avalbudAmt || totalAmount > avalbudAmt)
|
||||||
// {
|
// {
|
||||||
@ -4936,7 +4982,7 @@ return tot;
|
|||||||
{
|
{
|
||||||
var id = [];
|
var id = [];
|
||||||
var DelRows = $('#txtDeletedRow').val();
|
var DelRows = $('#txtDeletedRow').val();
|
||||||
|
//swalMaterialListrowid);
|
||||||
var tr = document.getElementById(rowid);
|
var tr = document.getElementById(rowid);
|
||||||
// var cellval = tr.cells;
|
// var cellval = tr.cells;
|
||||||
var MaterialCode = $('#materialCode'+rowid).val();
|
var MaterialCode = $('#materialCode'+rowid).val();
|
||||||
@ -5052,7 +5098,7 @@ return tot;
|
|||||||
var Discount =$('#AfterDisVal'+rowid).val() == '' ? '0.00' : $('#AfterDisVal'+rowid).val();
|
var Discount =$('#AfterDisVal'+rowid).val() == '' ? '0.00' : $('#AfterDisVal'+rowid).val();
|
||||||
var BasicVal = $('#basicval'+rowid).val() == '' ? '0.00' : $('#basicval'+rowid).val();
|
var BasicVal = $('#basicval'+rowid).val() == '' ? '0.00' : $('#basicval'+rowid).val();
|
||||||
var TotalVal =$('#TotalOrderValue'+rowid).val() == '' ? '0.00' : $('#TotalOrderValue'+rowid).val();
|
var TotalVal =$('#TotalOrderValue'+rowid).val() == '' ? '0.00' : $('#TotalOrderValue'+rowid).val();
|
||||||
|
//swal(TotalVal);
|
||||||
var Cgst = $('#RevenueAfterCgst'+rowid).val() == '' ? '0.00' : $('#RevenueAfterCgst'+rowid).val();
|
var Cgst = $('#RevenueAfterCgst'+rowid).val() == '' ? '0.00' : $('#RevenueAfterCgst'+rowid).val();
|
||||||
var Sgst =$('#RevenueAfterSgst'+rowid).val() == '' ? '0.00' : $('#RevenueAfterSgst'+rowid).val();
|
var Sgst =$('#RevenueAfterSgst'+rowid).val() == '' ? '0.00' : $('#RevenueAfterSgst'+rowid).val();
|
||||||
var Igst = $('#RevenueAfterIgst'+rowid).val() == '' ? '0.00' : $('#RevenueAfterIgst'+rowid).val();
|
var Igst = $('#RevenueAfterIgst'+rowid).val() == '' ? '0.00' : $('#RevenueAfterIgst'+rowid).val();
|
||||||
@ -5103,7 +5149,8 @@ return tot;
|
|||||||
var AvlBudAmt = '<?php echo number_format($AvlAmount+$totBasicAmt-$totDiscountAmt, 2, '.', '') ?>';
|
var AvlBudAmt = '<?php echo number_format($AvlAmount+$totBasicAmt-$totDiscountAmt, 2, '.', '') ?>';
|
||||||
var txtTotalbasicamount = $('#txtTotBasicAmount').val();
|
var txtTotalbasicamount = $('#txtTotBasicAmount').val();
|
||||||
var totaldiscount = $('#txtTotalDiscount').val();
|
var totaldiscount = $('#txtTotalDiscount').val();
|
||||||
|
//swal(txtTotalbasicamount+'-'+totaldiscount);
|
||||||
|
//swal(txtTotalbasicamount-totaldiscount);
|
||||||
if(validate())
|
if(validate())
|
||||||
{
|
{
|
||||||
if(document.getElementById('revenueTax').rows.length < 2)
|
if(document.getElementById('revenueTax').rows.length < 2)
|
||||||
@ -5288,6 +5335,7 @@ return tot;
|
|||||||
var totvalue = parseFloat(AfterCgst)+ parseFloat(AfterSgst) + parseFloat(AfterIgst) ;
|
var totvalue = parseFloat(AfterCgst)+ parseFloat(AfterSgst) + parseFloat(AfterIgst) ;
|
||||||
|
|
||||||
var tot = parseFloat(totvalue).toFixed(2);
|
var tot = parseFloat(totvalue).toFixed(2);
|
||||||
|
//swal('tot:'+tot);
|
||||||
return tot;
|
return tot;
|
||||||
}
|
}
|
||||||
//If others is the payment terms to display mandatory field
|
//If others is the payment terms to display mandatory field
|
||||||
@ -5387,7 +5435,7 @@ return tot;
|
|||||||
AvlBudAmt = '<?php echo number_format($AvlAmount+$totBasicAmt-$totDiscountAmt, 2, '.', '') ?>';
|
AvlBudAmt = '<?php echo number_format($AvlAmount+$totBasicAmt-$totDiscountAmt, 2, '.', '') ?>';
|
||||||
userid = $(e.relatedTarget).data('userid');
|
userid = $(e.relatedTarget).data('userid');
|
||||||
$('#isEdit').val(1);
|
$('#isEdit').val(1);
|
||||||
|
//swal(userid);
|
||||||
var tr= document.getElementById(userid);
|
var tr= document.getElementById(userid);
|
||||||
var cellval = tr.cells;
|
var cellval = tr.cells;
|
||||||
var id= $('#Reqnumber'+userid).val();
|
var id= $('#Reqnumber'+userid).val();
|
||||||
@ -5503,7 +5551,7 @@ return tot;
|
|||||||
AvlBudAmt = '<?php echo number_format($AvlAmount+$totBasicAmt-$totDiscountAmt, 2, '.', '') ?>';
|
AvlBudAmt = '<?php echo number_format($AvlAmount+$totBasicAmt-$totDiscountAmt, 2, '.', '') ?>';
|
||||||
userid = $(e.relatedTarget).data('userid');
|
userid = $(e.relatedTarget).data('userid');
|
||||||
$('#isEdit').val(1);
|
$('#isEdit').val(1);
|
||||||
|
//swal(userid);
|
||||||
var tr= document.getElementById(userid);
|
var tr= document.getElementById(userid);
|
||||||
var cellval = tr.cells;
|
var cellval = tr.cells;
|
||||||
var id= $('#Reqnumber'+userid).val();
|
var id= $('#Reqnumber'+userid).val();
|
||||||
@ -5512,6 +5560,7 @@ return tot;
|
|||||||
$('#ViewdeptName').val($('#departmentName'+userid).val());
|
$('#ViewdeptName').val($('#departmentName'+userid).val());
|
||||||
$("#ViewCostCenter").val($('#costCode'+userid).val());
|
$("#ViewCostCenter").val($('#costCode'+userid).val());
|
||||||
$('#ViewAvlBudAmt').val(AvlBudAmt);
|
$('#ViewAvlBudAmt').val(AvlBudAmt);
|
||||||
|
//
|
||||||
|
|
||||||
$('#ViewItemName').val($('#materialName'+userid).val());
|
$('#ViewItemName').val($('#materialName'+userid).val());
|
||||||
$('#ViewUOM').val($('#uom'+userid).val());
|
$('#ViewUOM').val($('#uom'+userid).val());
|
||||||
@ -5569,7 +5618,7 @@ return tot;
|
|||||||
<script>
|
<script>
|
||||||
$('#insurancestatus').change(function(){
|
$('#insurancestatus').change(function(){
|
||||||
var ans=$("#insurancestatus").val();
|
var ans=$("#insurancestatus").val();
|
||||||
|
//swal(ans);
|
||||||
if(ans == 0){
|
if(ans == 0){
|
||||||
$("#insurancenodiv").hide();
|
$("#insurancenodiv").hide();
|
||||||
//$("#insuranceno").val("");
|
//$("#insuranceno").val("");
|
||||||
@ -5587,6 +5636,8 @@ return tot;
|
|||||||
var param1 = $('#hidebillno').val();
|
var param1 = $('#hidebillno').val();
|
||||||
var param2 = $('#hideoldfile').val();
|
var param2 = $('#hideoldfile').val();
|
||||||
|
|
||||||
|
// var filename = $("#billimag").val();
|
||||||
|
// filename = filename.split('\\');
|
||||||
formData.append('file',file);
|
formData.append('file',file);
|
||||||
formData.append('param1',param1);
|
formData.append('param1',param1);
|
||||||
formData.append('param2',param2);
|
formData.append('param2',param2);
|
||||||
@ -5661,10 +5712,12 @@ return tot;
|
|||||||
{
|
{
|
||||||
var formData = new FormData();
|
var formData = new FormData();
|
||||||
var file = $("#images"+counter).prop('files')[0];
|
var file = $("#images"+counter).prop('files')[0];
|
||||||
|
// console.log(file);
|
||||||
|
|
||||||
var PONO =$('#txtPONO').val();
|
var PONO =$('#txtPONO').val();
|
||||||
var igr =$('#hiddenIGRNO').val();
|
var igr =$('#hiddenIGRNO').val();
|
||||||
|
|
||||||
|
|
||||||
formData.append('file',file);
|
formData.append('file',file);
|
||||||
formData.append('PONO',PONO);
|
formData.append('PONO',PONO);
|
||||||
formData.append('count',counter);
|
formData.append('count',counter);
|
||||||
@ -5722,6 +5775,7 @@ return tot;
|
|||||||
|
|
||||||
|
|
||||||
var bill = <?php echo json_encode($billfile)?>;
|
var bill = <?php echo json_encode($billfile)?>;
|
||||||
|
//swal(bill.length);
|
||||||
if(bill.length>=5){
|
if(bill.length>=5){
|
||||||
|
|
||||||
swal("You have to upload five files only");//this allows only 5 files;
|
swal("You have to upload five files only");//this allows only 5 files;
|
||||||
@ -5734,7 +5788,7 @@ else{
|
|||||||
var div = document.createElement('div');
|
var div = document.createElement('div');
|
||||||
div.id = "divid";
|
div.id = "divid";
|
||||||
div.className="row";
|
div.className="row";
|
||||||
|
//swal(counter);
|
||||||
div.innerHTML='<div class="col-md-12">'+
|
div.innerHTML='<div class="col-md-12">'+
|
||||||
// '<div class="col-md-3">'+
|
// '<div class="col-md-3">'+
|
||||||
// '<label>File Name</label>'+
|
// '<label>File Name</label>'+
|
||||||
@ -5792,13 +5846,13 @@ else{
|
|||||||
|
|
||||||
var number = id.replace(/[^0-9]+/ig,"");
|
var number = id.replace(/[^0-9]+/ig,"");
|
||||||
if(size > 2100000){
|
if(size > 2100000){
|
||||||
|
//swal(id);
|
||||||
swal('Sorry Your File is Large To 2MB');
|
swal('Sorry Your File is Large To 2MB');
|
||||||
removeRow(id);
|
removeRow(id);
|
||||||
//$('input[name = browseFiles'+number+']').val(' ');
|
//$('input[name = browseFiles'+number+']').val(' ');
|
||||||
}else {
|
}else {
|
||||||
var name = $('input[name='+id+']')[0].files[0].name;
|
var name = $('input[name='+id+']')[0].files[0].name;
|
||||||
|
//swal(name);
|
||||||
$("#maint_filename"+number).val(name);
|
$("#maint_filename"+number).val(name);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -71,9 +71,12 @@
|
|||||||
<h4><span class="fa fa-inr"> Cashbook </span></h4>
|
<h4><span class="fa fa-inr"> Cashbook </span></h4>
|
||||||
<a href="<?php echo base_url(); ?>cashbookreport" target="_blank" ><p class="uk-text uk-margin-remove">Cashbook Reports</p></a>
|
<a href="<?php echo base_url(); ?>cashbookreport" target="_blank" ><p class="uk-text uk-margin-remove">Cashbook Reports</p></a>
|
||||||
<a href="<?php echo base_url(); ?>cashbookcumulativereport" target="_blank" ><p class="uk-text uk-margin-remove">Cashbook Cumulative Reports</p></a>
|
<a href="<?php echo base_url(); ?>cashbookcumulativereport" target="_blank" ><p class="uk-text uk-margin-remove">Cashbook Cumulative Reports</p></a>
|
||||||
<a href="<?php echo base_url(); ?>cashbookcumulativemonthreport" target="_blank" ><p class="uk-text uk-margin-remove">Cashbook Cumulative Month Reports</p></a>
|
<a href="<?php echo base_url(); ?>cashbookcumulativemonthreport" target="_blank" ><p class="uk-text uk-margin-remove">Cashbook Cumulative Month Reports</p></a>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
<div class="col-xs-3">
|
||||||
|
<h4><span class="fa fa-money "> GST Reports </span></h4>
|
||||||
|
<a href="<?php echo base_url(); ?>Report_monthly_gst" target="_blank" > Monthly GST Summary Report <p class="uk-text uk-margin-remove"></p></a>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
@ -39,7 +39,7 @@ class CI_Upload {
|
|||||||
public $file_size = "";
|
public $file_size = "";
|
||||||
public $file_ext = "";
|
public $file_ext = "";
|
||||||
public $upload_path = "";
|
public $upload_path = "";
|
||||||
public $overwrite = FALSE;
|
public $overwrite = TRUE;
|
||||||
public $encrypt_name = FALSE;
|
public $encrypt_name = FALSE;
|
||||||
public $is_image = FALSE;
|
public $is_image = FALSE;
|
||||||
public $image_width = '';
|
public $image_width = '';
|
||||||
@ -93,7 +93,7 @@ class CI_Upload {
|
|||||||
'file_size' => "",
|
'file_size' => "",
|
||||||
'file_ext' => "",
|
'file_ext' => "",
|
||||||
'upload_path' => "",
|
'upload_path' => "",
|
||||||
'overwrite' => FALSE,
|
'overwrite' => TRUE,
|
||||||
'encrypt_name' => FALSE,
|
'encrypt_name' => FALSE,
|
||||||
'is_image' => FALSE,
|
'is_image' => FALSE,
|
||||||
'image_width' => '',
|
'image_width' => '',
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user