bankstatement
This commit is contained in:
parent
7ce38fd82f
commit
67f838d52d
3
.vscode/settings.json
vendored
Normal file
3
.vscode/settings.json
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
{
|
||||
"git.ignoreLimitWarning": true
|
||||
}
|
||||
@ -249,6 +249,7 @@ $route['ServicePOBilling'] = "servicepurchaseorder/viewServicePOReportForBilling
|
||||
$route['ViewIncomeExpense'] = "cashbook/incomeExpenseList";
|
||||
//$route['addNewIncomeExpense'] = "cashbook/addNewIncomeExpenseLoad";
|
||||
$route['addIncomeExpense'] = "cashbook/addIncomeExpense";
|
||||
$route['AdvanceList']="cashbook/AdvanceList";
|
||||
|
||||
/**-----------Application Bank book Routes------------------**/
|
||||
|
||||
@ -258,7 +259,7 @@ $route['Bankingstatement']= "cashbook/bankdata";
|
||||
$route['Debitstatement']= "cashbook/bankdebitdata";
|
||||
$route['Cashstatement']= "cashbook/cashreceipt";
|
||||
$route['BankingFile']= "cashbook/bankfileupload";
|
||||
$route['Filelist']="cashbook/filelist";
|
||||
//$route['Filelist']="cashbook/filelist";
|
||||
//$route['Bankingrecord']= "cashbook/bankdata";
|
||||
$route['Bankamountpaid']= "cashbook/amountpaid";
|
||||
$route['Bankamountreceived']= "cashbook/amountreceived";
|
||||
|
||||
522
application/controllers/cashbook.php
Executable file → Normal file
522
application/controllers/cashbook.php
Executable file → Normal file
@ -10,7 +10,7 @@ require APPPATH . '/third_party/mpdf/mpdf.php';
|
||||
* @since : 27 November 2017
|
||||
*/
|
||||
class cashbook extends BaseController
|
||||
{
|
||||
{
|
||||
/**
|
||||
* default constructor of the class
|
||||
*/
|
||||
@ -189,6 +189,7 @@ class cashbook extends BaseController
|
||||
function addNewIncomeExpenseLoad()
|
||||
{
|
||||
$data['dropdownvalues'] = $this->cashbook_model->getAccounTypes();
|
||||
$data['getsupplier'] = $this->cashbook_model->getsupplier();
|
||||
//$this->global['pageTitle'] = 'Resico : Cash Book: Add New Income Expense ';
|
||||
$this->global['pageTitle'] = $this->CompanyName.': Cash Book: Add New Income Expense ';
|
||||
$this->loadViews("addnewIncomeExpense", $this->global, $data , NULL);
|
||||
@ -312,7 +313,7 @@ class cashbook extends BaseController
|
||||
$balance=$sheet->getCell('H'.$x)->getValue();
|
||||
|
||||
// $IsActive=0;
|
||||
$filedataupload= array('reportdate'=>$Date1,'valuedate'=>$Date2,'chequeNo'=>$cod,'Narration'=>$narration,'Cod'=> $chqno,'Debit'=>$debit,'Credit'=>$credit,'Balance'=>$balance,'Bankname'=>$bank);
|
||||
$filedataupload= array('reportdate'=>$Date1,'valuedate'=>$Date2,'chequeNo'=>$cod,'Narration'=>$narration,'Cod'=> $chqno,'Debit'=>$debit,'Credit'=>$credit,'cbalancetocleared'=>$credit,'Balance'=>$balance,'Bankname'=>$bank);
|
||||
|
||||
|
||||
|
||||
@ -339,54 +340,34 @@ class cashbook extends BaseController
|
||||
//function addIncomeExpense()
|
||||
function addReceipt()
|
||||
{
|
||||
$bankdate = $this->input->post('bankdate');
|
||||
|
||||
$bankid = $this->input->post('bakid');
|
||||
$remaindebitamount=$this->input->post('remaindebitamount');
|
||||
$remaincreditamount=$this->input->post('remaincreditamount');
|
||||
$amount = $this->input->post('bankamount');
|
||||
$amounttype = $this->input->post('type');
|
||||
//$amount = $this->input->post('bankamount');//need to ask
|
||||
$bankamounttype = $this->input->post('type');
|
||||
$totalbankamount = $this->input->post('totalbankamount');
|
||||
$alreadypaid=$this->input->post('alreadydebitpaid');
|
||||
$directamount = $this->input->post('totalamount');
|
||||
$debitamount=$this->input->post('debitamount');
|
||||
//$debitamount=$this->input->post('debitamount');// need to ask
|
||||
$alreadycreditpaid=$this->input->post('alreadycreditpaid');
|
||||
$bankorcash=$this->input->post('borc');
|
||||
$total=$directamount+$alreadypaid;
|
||||
$ctotal=$directamount+$alreadycreditpaid;
|
||||
$updateBalancetocleared= $remaindebitamount-$directamount;
|
||||
$updatecbalancetocleared= $remaincreditamount-$directamount;
|
||||
if($amounttype==CREDIT)
|
||||
{
|
||||
echo "ad";
|
||||
$type=RECEIPT;
|
||||
$bankamounttype=CREDIT;
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "ad2";
|
||||
$type=PAYMENT;
|
||||
$bankamounttype=DEBIT;
|
||||
}
|
||||
|
||||
|
||||
|
||||
$accounttype = $this->input->post('myradio');
|
||||
//if($accounttype == 1)
|
||||
//{
|
||||
$accounttype = 'RECEIPT';
|
||||
//}
|
||||
//else
|
||||
//{
|
||||
//$accounttype = 'PAYMENT';
|
||||
//}
|
||||
$accountcode = $this->input->post('accode');
|
||||
$date = $this->input->post('Date');
|
||||
$date = date_create($date);//,'Y-m-d');
|
||||
$date = date_format($date,'Y-m-d');
|
||||
$towhome = $this->input->post('towhome');
|
||||
$supplier = $this->input->post('supplier');
|
||||
$accounttype = 'RECEIPT';
|
||||
$accountcode = $this->input->post('accode');
|
||||
$date = $this->input->post('Date');
|
||||
$date = date_create($date);//,'Y-m-d');
|
||||
$date = date_format($date,'Y-m-d');
|
||||
$towhome = $this->input->post('towhome');
|
||||
$supplier = $this->input->post('supplier');
|
||||
|
||||
$gsttoggle = $this->input->post('gsttoggle');
|
||||
$invoiceno = null;
|
||||
$gsttoggle = $this->input->post('gsttoggle');
|
||||
$invoiceno = null;
|
||||
$merchantname = null;
|
||||
$mergstno = null;
|
||||
$hsn = null;
|
||||
@ -407,9 +388,9 @@ class cashbook extends BaseController
|
||||
$igst = $this->input->post('IGST');
|
||||
}
|
||||
|
||||
//$totalamount = $this->input->post('totalamount');
|
||||
$cashbookamount=$this->input->post('totalamount1');
|
||||
$totalamount=$directamount+$cashbookamount;
|
||||
$totalamount = $this->input->post('totalamount');
|
||||
// $cashbookamount=$this->input->post('totalamount1');
|
||||
// $totalamount=$directamount+$cashbookamount;
|
||||
|
||||
$description = $this->input->post('description');
|
||||
if(empty($description)){$description = 'NA';}
|
||||
@ -427,13 +408,13 @@ class cashbook extends BaseController
|
||||
$document = $path.$fs;
|
||||
|
||||
}
|
||||
if($bankorcash==Bank)
|
||||
if($bankorcash=='Bank')
|
||||
{
|
||||
$option=Bank;
|
||||
$option='Bank';
|
||||
}
|
||||
else
|
||||
{
|
||||
$option=Cash;
|
||||
$option='Cash';
|
||||
}
|
||||
$balance=$totalbankamount-$totalamount;
|
||||
$IsActive=1;
|
||||
@ -459,44 +440,52 @@ class cashbook extends BaseController
|
||||
{
|
||||
$statu='OPEN';
|
||||
}
|
||||
$debitbalance=$totalbankamount-$total;
|
||||
if($debitbalance==0)
|
||||
// $debitbalance=$totalbankamount-$total;
|
||||
// if($debitbalance==0)
|
||||
|
||||
{
|
||||
$statu1='CLOSE';
|
||||
}
|
||||
else
|
||||
{
|
||||
$statu1='OPEN';
|
||||
}
|
||||
$isactive=1;
|
||||
//$clearbalance=$totalbankamount-
|
||||
if($amounttype=='CREDIT')
|
||||
{
|
||||
$cashbookstatus1= array('cclearbalance'=>$ctotal,'cbalancetocleared'=>$updatecbalancetocleared,'cstatus'=>$statu,'IsActive'=>$isactive);
|
||||
// {
|
||||
// $statu1='CLOSE';
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// $statu1='OPEN';
|
||||
// }
|
||||
// $isactive=1;
|
||||
// //$clearbalance=$totalbankamount-
|
||||
// if($amounttype=='CREDIT')
|
||||
// {
|
||||
$cashbookstatus1= array('cclearbalance'=>$ctotal,'cbalancetocleared'=>$updatecbalancetocleared,'cstatus'=>$statu);
|
||||
//print_r($cashbookstatus1);
|
||||
//die();
|
||||
$res1 = $this->cashbook_model->cashcreditupdate($cashbookstatus1,$bankid);
|
||||
}
|
||||
else
|
||||
{
|
||||
$cashbookstatus = array('Clearbalance'=>$total,'Balancetocleared'=>$updateBalancetocleared,'Status'=>$statu1,'IsActive'=>$isactive);
|
||||
$res23 = $this->cashbook_model->cashbankupdate($cashbookstatus,$bankid);
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// $cashbookstatus = array('Clearbalance'=>$total,'Balancetocleared'=>$updateBalancetocleared,'Status'=>$statu1);
|
||||
// $res23 = $this->cashbook_model->cashbankupdate($cashbookstatus,$bankid);
|
||||
|
||||
}
|
||||
// }
|
||||
|
||||
|
||||
|
||||
$res = $this->cashbook_model->saveIncomeExpense($addincomexpense);
|
||||
if( $res == 1 ){
|
||||
//echo "<script>alert('Saved Successfully!');window.location.href='ViewIncomeExpense';</script>";
|
||||
echo "<script>alert('Saved Successfully!');</script>";
|
||||
|
||||
if($amounttype == ' ')//Redirct To Listing Screen
|
||||
if( $res >= 1 ){
|
||||
|
||||
|
||||
if($bankorcash=='Bank')//Redirct To Bank Report Screen
|
||||
{
|
||||
redirect('ViewIncomeExpense','refresh');
|
||||
|
||||
|
||||
echo "<script>alert('Saved Successfully!');
|
||||
window.location.href='bankdata';</script>";
|
||||
|
||||
}
|
||||
else if($amounttype != ' ')//Redirct To Bank Report Screen
|
||||
else
|
||||
{
|
||||
redirect('Bankingstatement','refresh');
|
||||
|
||||
//Redirct To Listing Screen
|
||||
echo "<script>alert('Saved Successfully!');
|
||||
window.location.href='incomeExpenseList';</script>";
|
||||
}
|
||||
}
|
||||
|
||||
@ -514,6 +503,34 @@ class cashbook extends BaseController
|
||||
*/
|
||||
function addPayment()
|
||||
{
|
||||
|
||||
|
||||
$bankid = $this->input->post('hideBankID');
|
||||
$remaindebitamount=$this->input->post('hideRemainDebitAmount');
|
||||
//$remaincreditamount=$this->input->post('remaincreditamount');
|
||||
//$amount = $this->input->post('bankamount');//need to ask
|
||||
$amounttype = $this->input->post('hideBAtype');
|
||||
$totalbankamount = $this->input->post('hideTotalBankAmount');
|
||||
$alreadypaid=$this->input->post('hideAlreadyDebitPaid');
|
||||
$directamount = $this->input->post('Paymenttotalamount');
|
||||
//$debitamount=$this->input->post('debitamount');// need to ask
|
||||
//$alreadycreditpaid=$this->input->post('alreadycreditpaid');
|
||||
$bankorcash=$this->input->post('hideborc');
|
||||
$total=$directamount+$alreadypaid;
|
||||
//$ctotal=$directamount+$alreadycreditpaid;
|
||||
$updateBalancetocleared= $remaindebitamount-$directamount;
|
||||
//$updatecbalancetocleared= $remaincreditamount-$directamount;
|
||||
// if($amounttype==CREDIT)
|
||||
// {
|
||||
// $type=RECEIPT;
|
||||
// $bankamounttype=CREDIT;
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
$type=PAYMENT;
|
||||
$bankamounttype=DEBIT;
|
||||
// }
|
||||
|
||||
$count = $this->input->post('hidecounter');
|
||||
$constantcount = $this->input->post('hideconstant');
|
||||
|
||||
@ -522,36 +539,11 @@ class cashbook extends BaseController
|
||||
$date = date_create($date);//,'Y-m-d');
|
||||
$date = date_format($date,'Y-m-d');
|
||||
$paidto = $this->input->post('PaymentPaidto');
|
||||
$supplier = $this->input->post('supplier');
|
||||
$supplier = $this->input->post('Paymentsupplier');
|
||||
$vouchercode = $this->input->post('Paymentvouchercode');
|
||||
|
||||
$bankdate = $this->input->post('bankdate');
|
||||
$bankid = $this->input->post('bakid');
|
||||
$remaindebitamount=$this->input->post('remaindebitamount');
|
||||
$remaincreditamount=$this->input->post('remaincreditamount');
|
||||
$amount = $this->input->post('bankamount');
|
||||
$amounttype = $this->input->post('type');
|
||||
$totalbankamount = $this->input->post('totalbankamount');
|
||||
$alreadypaid=$this->input->post('alreadydebitpaid');
|
||||
$directamount = $this->input->post('totalamount');
|
||||
$debitamount=$this->input->post('debitamount');
|
||||
$alreadycreditpaid=$this->input->post('alreadycreditpaid');
|
||||
$bankorcash=$this->input->post('borc');
|
||||
$total=$directamount+$alreadypaid;
|
||||
$ctotal=$directamount+$alreadycreditpaid;
|
||||
$updateBalancetocleared= $remaindebitamount-$directamount;
|
||||
$updatecbalancetocleared= $remaincreditamount-$directamount;
|
||||
if($amounttype==CREDIT)
|
||||
{
|
||||
$type=RECEIPT;
|
||||
$bankamounttype=CREDIT;
|
||||
}
|
||||
else
|
||||
{
|
||||
$type=PAYMENT;
|
||||
$bankamounttype=DEBIT;
|
||||
}
|
||||
|
||||
|
||||
|
||||
//echo $count.$consantcount;
|
||||
//$gsttoggle = $this->input->post('gsttoggle');
|
||||
@ -572,8 +564,8 @@ class cashbook extends BaseController
|
||||
$cgst = $this->input->post('PaymentCGST');
|
||||
$igst = $this->input->post('PaymentIGST');
|
||||
|
||||
$cashbookamount=$this->input->post('totalamount1');
|
||||
$totalamount=$directamount+$cashbookamount;
|
||||
// $cashbookamount=$this->input->post('totalamount1');
|
||||
// $totalamount=$directamount+$cashbookamount; where its comes from
|
||||
//$totalamount = $this->input->post('Paymenttotalamount');
|
||||
$description = $this->input->post('Paymentdescription');
|
||||
|
||||
@ -615,8 +607,64 @@ class cashbook extends BaseController
|
||||
}
|
||||
}}
|
||||
|
||||
$addPayments = array('type'=>$accounttype,'account_code'=>$Paymentaccode,'date'=>$date,'towhom'=>$paidto,'invoice_no'=>$vouchercode,'merchant'=>$merchantname,'merchant_gst'=>$mergstno,'HSN'=>$hsn ,'value_before_gst'=>$beforegst,'sgst'=>$sgst,'cgst'=>$cgst,'igst'=>$igst,'total'=>$totalamount,'description'=>$description,'document'=>$document,'Created_By'=>$created_by,'paymentsubdesc'=>$subdescription);
|
||||
$res = $this->cashbook_model->saveIncomeExpense($addPayments);
|
||||
|
||||
if($bankorcash=='Bank')
|
||||
{ $option='Bank'; }
|
||||
else { $option='Cash'; }
|
||||
$balance=$totalbankamount-$totalamount;
|
||||
$IsActive=1;
|
||||
|
||||
$addPayments = array('type'=>$accounttype,'account_code'=>$Paymentaccode,'date'=>$date,'towhom'=>$paidto,'Supplier_id'=>$supplier,'invoice_no'=>$vouchercode,'merchant'=>$merchantname,'merchant_gst'=>$mergstno,'HSN'=>$hsn ,'value_before_gst'=>$beforegst,'sgst'=>$sgst,'cgst'=>$cgst,'igst'=>$igst,'total'=>$directamount,'description'=>$description,'document'=>$document,'Created_By'=>$created_by,'paymentsubdesc'=>$subdescription,'cashtype'=>$option,'bankid'=>$bankid,'totalbankamount'=>$totalbankamount,'balance'=>$balance,'gststatus'=>(!empty($gsttoggle)?'1':'0'),'amounttype'=>$amounttype,'IsActive'=>$IsActive);
|
||||
$res = $this->cashbook_model->saveIncomeExpense($addPayments);
|
||||
|
||||
if($balance=='0')
|
||||
{
|
||||
$stat='CLOSE';
|
||||
}
|
||||
else
|
||||
{
|
||||
$stat='OPEN';
|
||||
}
|
||||
// $creditbalance=$totalbankamount-$ctotal;
|
||||
// //echo $creditbalance;
|
||||
// //die();
|
||||
// if($creditbalance==0)
|
||||
// {
|
||||
// $statu='CLOSE';
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// $statu='OPEN';
|
||||
// }
|
||||
$debitbalance=$totalbankamount-$total;
|
||||
if($debitbalance==0)
|
||||
|
||||
{
|
||||
$statu1='CLOSE';
|
||||
}
|
||||
else
|
||||
{
|
||||
$statu1='OPEN';
|
||||
}
|
||||
$isactive=1;
|
||||
|
||||
// if($amounttype=='CREDIT')
|
||||
// {
|
||||
// $cashbookstatus1= array('cclearbalance'=>$ctotal,'cbalancetocleared'=>$updatecbalancetocleared,'cstatus'=>$statu);
|
||||
//print_r($cashbookstatus1);
|
||||
//die();
|
||||
// $res1 = $this->cashbook_model->cashcreditupdate($cashbookstatus1,$bankid);
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
$cashbookstatus = array('Clearbalance'=>$total,'Balancetocleared'=>$updateBalancetocleared,'Status'=>$statu1);
|
||||
$res23 = $this->cashbook_model->cashbankupdate($cashbookstatus,$bankid);
|
||||
|
||||
// }
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
else
|
||||
@ -624,8 +672,63 @@ class cashbook extends BaseController
|
||||
|
||||
$accountcode = '999';
|
||||
$subdescription = 'Multiple';
|
||||
$addPayments = array('type'=>$accounttype,'account_code'=>$accountcode,'date'=>$date,'towhom'=>$paidto,'invoice_no'=>$vouchercode,'merchant'=>$merchantname,'merchant_gst'=>$mergstno,'HSN'=>$hsn ,'value_before_gst'=>$beforegst,'sgst'=>$sgst,'cgst'=>$cgst,'igst'=>$igst,'total'=>$totalamount,'description'=>$description,'document'=>$document,'Created_By'=>$created_by,'paymentsubdesc'=>$subdescription);
|
||||
|
||||
if($bankorcash=='Bank')
|
||||
{ $option='Bank'; }
|
||||
else { $option='Cash'; }
|
||||
$balance=$totalbankamount-$totalamount;
|
||||
$IsActive=1;
|
||||
|
||||
$addPayments = array('type'=>$accounttype,'account_code'=>$accountcode,'date'=>$date,'towhom'=>$paidto,'Supplier_id'=>$supplier,'invoice_no'=>$vouchercode,'merchant'=>$merchantname,'merchant_gst'=>$mergstno,'HSN'=>$hsn ,'value_before_gst'=>$beforegst,'sgst'=>$sgst,'cgst'=>$cgst,'igst'=>$igst,'total'=>$directamount,'description'=>$description,'document'=>$document,'Created_By'=>$created_by,'paymentsubdesc'=>$subdescription,'cashtype'=>$option,'bankid'=>$bankid,'totalbankamount'=>$totalbankamount,'balance'=>$balance,'gststatus'=>(!empty($gsttoggle)?'1':'0'),'amounttype'=>$amounttype,'IsActive'=>$IsActive);
|
||||
$res = $this->cashbook_model->saveIncomeExpense($addPayments);
|
||||
|
||||
if($balance=='0')
|
||||
{
|
||||
$stat='CLOSE';
|
||||
}
|
||||
else
|
||||
{
|
||||
$stat='OPEN';
|
||||
}
|
||||
// $creditbalance=$totalbankamount-$ctotal;
|
||||
// //echo $creditbalance;
|
||||
// //die();
|
||||
// if($creditbalance==0)
|
||||
// {
|
||||
// $statu='CLOSE';
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// $statu='OPEN';
|
||||
// }
|
||||
$debitbalance=$totalbankamount-$total;
|
||||
if($debitbalance==0)
|
||||
|
||||
{
|
||||
$statu1='CLOSE';
|
||||
}
|
||||
else
|
||||
{
|
||||
$statu1='OPEN';
|
||||
}
|
||||
$isactive=1;
|
||||
|
||||
// if($amounttype=='CREDIT')
|
||||
// {
|
||||
// $cashbookstatus1= array('cclearbalance'=>$ctotal,'cbalancetocleared'=>$updatecbalancetocleared,'cstatus'=>$statu);
|
||||
//print_r($cashbookstatus1);
|
||||
//die();
|
||||
// $res1 = $this->cashbook_model->cashcreditupdate($cashbookstatus1,$bankid);
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
$cashbookstatus = array('Clearbalance'=>$total,'Balancetocleared'=>$updateBalancetocleared,'Status'=>$statu1);
|
||||
$res23 = $this->cashbook_model->cashbankupdate($cashbookstatus,$bankid);
|
||||
|
||||
// }
|
||||
|
||||
|
||||
|
||||
|
||||
$Paymentaccode = '';
|
||||
$subdescription = '';
|
||||
@ -682,10 +785,30 @@ class cashbook extends BaseController
|
||||
}
|
||||
|
||||
}//new else
|
||||
if( $res >= 1 ){
|
||||
echo "<script>alert('Saved Successfully!');
|
||||
window.location.href='incomeExpenseList';</script>";
|
||||
// if( $res >= 1 ){
|
||||
// echo "<script>alert('Saved Successfully!');
|
||||
// window.location.href='incomeExpenseList';</script>";
|
||||
// }
|
||||
if( $res >= 1 ){
|
||||
|
||||
|
||||
if($bankorcash=='Bank')//Redirct To Bank Report Screen
|
||||
{
|
||||
|
||||
|
||||
echo "<script>alert('Saved Successfully!');
|
||||
window.location.href='bankdata';</script>";
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
//Redirct To Listing Screen
|
||||
echo "<script>alert('Saved Successfully!');
|
||||
window.location.href='incomeExpenseList';</script>";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -865,7 +988,7 @@ class cashbook extends BaseController
|
||||
|
||||
$data['data'] = $this->cashbook_model->getAdvanceList($aid);
|
||||
//print_r($data['dropdownvalues']);die();
|
||||
$this->global['pageTitle'] = 'Siddharth : Cash Book: View Income Expense ';
|
||||
$this->global['pageTitle'] = $this->CompanyName.' : Cash Book: View Income Expense ';
|
||||
$this->loadViews("viewIndIncomeExpense", $this->global, $data , NULL);
|
||||
|
||||
}
|
||||
@ -875,7 +998,7 @@ class cashbook extends BaseController
|
||||
// $this->global['pageTitle'] = 'Siddharth : Cash Book: Listing';
|
||||
|
||||
// $this->loadViews("income_expense_list", $this->global, $data , NULL);
|
||||
$this->global['pageTitle'] = 'Siddharth : Cash Book: Listing';
|
||||
$this->global['pageTitle'] = $this->CompanyName.' : Cash Book: Advance List';
|
||||
|
||||
if ($this->input->post('btn_submit')) {
|
||||
|
||||
@ -938,8 +1061,10 @@ class cashbook extends BaseController
|
||||
$dt = new DateTime('now', new DateTimeZone('Asia/Kolkata'));
|
||||
$acc_createddt = $dt->format('Y-m-d H:i:s');
|
||||
|
||||
//$cashbookdatas = array('type'=>$acc_type,'code'=>$acc_code,'name'=>$acc_name,'description'=>$acc_desc,'status'=>$acc_status,'created_on'=>$acc_createddt);
|
||||
$cashbookdatas = array('type'=>$acc_type,'code'=>$acc_code,'name'=>$acc_name,'accountname'=>$acc_pname,'categories'=>$acc_categories,'description'=>$acc_desc,'status'=>$acc_status,'created_on'=>$acc_createddt);
|
||||
$cashbookdatas = array('type'=>$acc_type,'code'=>$acc_code,'name'=>$acc_name,'description'=>$acc_desc,'status'=>$acc_status,'created_on'=>$acc_createddt);
|
||||
/** accountname and category fields aree not available so that comment */
|
||||
//$cashbookdatas = array('type'=>$acc_type,'code'=>$acc_code,'name'=>$acc_name,'accountname'=>$acc_pname,'categories'=>$acc_categories,'description'=>$acc_desc,'status'=>$acc_status,'created_on'=>$acc_createddt);
|
||||
|
||||
$result = $this->cashbook_model->Cashbook($cashbookdatas);
|
||||
}
|
||||
}
|
||||
@ -947,7 +1072,6 @@ class cashbook extends BaseController
|
||||
echo "Successfully Saved!";
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* For edit cashbook screen
|
||||
*/
|
||||
@ -1101,7 +1225,7 @@ class cashbook extends BaseController
|
||||
else
|
||||
{
|
||||
$updatedepit=$poamnt+$cashamnt;
|
||||
$cashbookstatus = array('Clearbalance'=>$updatedepit,'Status'=>$status,'IsActive'=>$isactive);
|
||||
$cashbookstatus = array('Clearbalance'=>$updatedepit,'Status'=>$status);
|
||||
// print_r($cashbookstatus);
|
||||
//die();
|
||||
$res = $this->cashbook_model->cashbankupdate($cashbookstatus,$bankid);
|
||||
@ -1110,8 +1234,12 @@ class cashbook extends BaseController
|
||||
|
||||
|
||||
//if( $res == 1 ){
|
||||
echo "<script>alert('Saved Successfully!');window.location.href='ViewIncomeExpense';</script>";
|
||||
//}
|
||||
// echo "<script>alert('Saved Successfully!');window.location.href='ViewIncomeExpense';</script>";
|
||||
//}
|
||||
|
||||
echo "<script>alert('Saved Successfully!');
|
||||
window.location.href='incomeExpenseList';
|
||||
</script>";
|
||||
}
|
||||
|
||||
|
||||
@ -1128,7 +1256,7 @@ class cashbook extends BaseController
|
||||
$date = date_format($date,'Y-m-d');
|
||||
|
||||
$towhome1 = $this->input->post('PaymentPaidto');
|
||||
$supplier = $this->input->post('supplier');
|
||||
$supplier = $this->input->post('Paymentsupplier');
|
||||
$Invoiceno1 = $this->input->post('Paymentvouchercode');
|
||||
$merchant1 = $this->input->post('Paymentmerchant');
|
||||
$Merchantgst1 = $this->input->post('PaymentMerchantgst');
|
||||
@ -1141,6 +1269,11 @@ class cashbook extends BaseController
|
||||
$description1 = $this->input->post('Paymentdescription');
|
||||
$deleteflag = $this->input->post('deleteflag');
|
||||
$oldfile = $this->input->post('oldfile');
|
||||
$amounttype = $this->input->post('amounttype');
|
||||
$bankid=$this->input->post('bankid');
|
||||
$normalid=$this->input->post('normalid');
|
||||
$bankamount=$this->input->post('bankamount');
|
||||
$gsttoggle = $this->input->post('gsttoggle');
|
||||
$document =null;
|
||||
|
||||
|
||||
@ -1186,9 +1319,53 @@ class cashbook extends BaseController
|
||||
}}
|
||||
|
||||
|
||||
$UpdatePayment = array('type'=>$option,'account_code'=>$Paymentaccode,'date'=>$date,'towhom'=>$towhome1,'invoice_no'=>$Invoiceno1,'merchant'=>$merchant1,'merchant_gst'=>$Merchantgst1,'HSN'=>$hsn1,'value_before_gst'=>$valuebeforegST1,'sgst'=>$SGST1,'cgst'=>$CGST1,'igst'=>$IGST1,'total'=>$totalamount1,'description'=>$description1,'document'=>$document,'paymentsubdesc'=>$subdescription);
|
||||
$UpdatePayment = array('type'=>$option,'account_code'=>$Paymentaccode,'date'=>$date,'towhom'=>$towhome1,'Supplier_id'=>$supplier,'invoice_no'=>$Invoiceno1,'merchant'=>$merchant1,'merchant_gst'=>$Merchantgst1,'HSN'=>$hsn1,'value_before_gst'=>$valuebeforegST1,'sgst'=>$SGST1,'cgst'=>$CGST1,'igst'=>$IGST1,'total'=>$totalamount1,'description'=>$description1,'document'=>$document,'paymentsubdesc'=>$subdescription,'gststatus'=>(!empty($gsttoggle)?'1':'0'),'description'=>$description1,'document'=>$document);
|
||||
$res = $this->cashbook_model->updatepaymentmaster($UpdatePayment,$id1);
|
||||
|
||||
$cashbookamount=$this->cashbook_model->cashbookamount($bankid);
|
||||
$invoiceamount=$this->cashbook_model->invoiceamonut($bankid);
|
||||
$poamount=$this->cashbook_model->poamonut($bankid);
|
||||
foreach($invoiceamount as $ia)
|
||||
{
|
||||
$invam=$ia->amountreceived;
|
||||
}
|
||||
foreach($poamount as $pa)
|
||||
{
|
||||
$poamnt=$pa->amountpaid;
|
||||
}
|
||||
foreach($cashbookamount as $ca)
|
||||
{
|
||||
$cashamnt=$ca->total;
|
||||
}
|
||||
if($bankamount==$cashamnt)
|
||||
{
|
||||
$status='CLOSE';
|
||||
}
|
||||
else
|
||||
{
|
||||
$status='OPEN';
|
||||
}
|
||||
//print_r($invoiceamount);
|
||||
if($amounttype=='CREDIT')
|
||||
{
|
||||
$updatecredit=$invam+$cashamnt;
|
||||
$isactive=0;
|
||||
$cashbookstatus1= array('cclearbalance'=>$updatecredit,'cstatus'=>$status,'IsActive'=>$isactive);
|
||||
//print_r($cashbookstatus1);
|
||||
//die();
|
||||
|
||||
$res1 = $this->cashbook_model->cashcreditupdate($cashbookstatus1,$bankid);
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
$updatedepit=$poamnt+$cashamnt;
|
||||
$cashbookstatus = array('Clearbalance'=>$updatedepit,'Status'=>$status);
|
||||
// print_r($cashbookstatus);
|
||||
//die();
|
||||
$res = $this->cashbook_model->cashbankupdate($cashbookstatus,$bankid);
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
else
|
||||
@ -1196,8 +1373,54 @@ class cashbook extends BaseController
|
||||
|
||||
$accountcode = '999';
|
||||
$subdescription0 = 'Multiple';
|
||||
$UpdatePayment = array('type'=>$option,'account_code'=>$accountcode,'date'=>$date,'towhom'=>$towhome1,'invoice_no'=>$Invoiceno1,'merchant'=>$merchant1,'merchant_gst'=>$Merchantgst1,'HSN'=>$hsn1,'value_before_gst'=>$valuebeforegST1,'sgst'=>$SGST1,'cgst'=>$CGST1,'igst'=>$IGST1,'total'=>$totalamount1,'description'=>$description1,'document'=>$document,'paymentsubdesc'=>$subdescription0);
|
||||
$UpdatePayment = array('type'=>$option,'account_code'=>$accountcode,'date'=>$date,'towhom'=>$towhome1,'Supplier_id'=>$supplier,'invoice_no'=>$Invoiceno1,'merchant'=>$merchant1,'merchant_gst'=>$Merchantgst1,'HSN'=>$hsn1,'value_before_gst'=>$valuebeforegST1,'sgst'=>$SGST1,'cgst'=>$CGST1,'igst'=>$IGST1,'total'=>$totalamount1,'description'=>$description1,'document'=>$document,'paymentsubdesc'=>$subdescription0,'gststatus'=>(!empty($gsttoggle)?'1':'0'),'description'=>$description1,'document'=>$document);
|
||||
$res = $this->cashbook_model->updatepaymentmaster($UpdatePayment,$id1);
|
||||
|
||||
$cashbookamount=$this->cashbook_model->cashbookamount($bankid);
|
||||
$invoiceamount=$this->cashbook_model->invoiceamonut($bankid);
|
||||
$poamount=$this->cashbook_model->poamonut($bankid);
|
||||
foreach($invoiceamount as $ia)
|
||||
{
|
||||
$invam=$ia->amountreceived;
|
||||
}
|
||||
foreach($poamount as $pa)
|
||||
{
|
||||
$poamnt=$pa->amountpaid;
|
||||
}
|
||||
foreach($cashbookamount as $ca)
|
||||
{
|
||||
$cashamnt=$ca->total;
|
||||
}
|
||||
if($bankamount==$cashamnt)
|
||||
{
|
||||
$status='CLOSE';
|
||||
}
|
||||
else
|
||||
{
|
||||
$status='OPEN';
|
||||
}
|
||||
//print_r($invoiceamount);
|
||||
if($amounttype=='CREDIT')
|
||||
{
|
||||
$updatecredit=$invam+$cashamnt;
|
||||
$isactive=0;
|
||||
$cashbookstatus1= array('cclearbalance'=>$updatecredit,'cstatus'=>$status,'IsActive'=>$isactive);
|
||||
//print_r($cashbookstatus1);
|
||||
//die();
|
||||
|
||||
$res1 = $this->cashbook_model->cashcreditupdate($cashbookstatus1,$bankid);
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
$updatedepit=$poamnt+$cashamnt;
|
||||
$cashbookstatus = array('Clearbalance'=>$updatedepit,'Status'=>$status);
|
||||
// print_r($cashbookstatus);
|
||||
//die();
|
||||
$res = $this->cashbook_model->cashbankupdate($cashbookstatus,$bankid);
|
||||
|
||||
}
|
||||
|
||||
|
||||
for($i=1;$i<=$constantcount;$i++){
|
||||
|
||||
@ -1287,7 +1510,7 @@ class cashbook extends BaseController
|
||||
echo "<script>alert('Saved Successfully!');
|
||||
window.location.href='incomeExpenseList';
|
||||
</script>";
|
||||
|
||||
;
|
||||
}
|
||||
|
||||
public function bankdata()
|
||||
@ -1311,6 +1534,8 @@ class cashbook extends BaseController
|
||||
$this->loadViews("bankstatement", $this->global, $data,NULL);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
public function bankdebitdata()
|
||||
{
|
||||
@ -1346,18 +1571,32 @@ class cashbook extends BaseController
|
||||
$this->loadViews("bankinvoice", $this->global,$data,NULL);
|
||||
|
||||
}
|
||||
public function filelist()
|
||||
{
|
||||
$pono= $this->input->post('pono');
|
||||
$data = $this->cashbook_model->debitimage($pono);
|
||||
echo json_encode($data);
|
||||
|
||||
function IGRFilelist()
|
||||
{
|
||||
$igrno= $this->input->post('igrno');
|
||||
$pono =$this->input->post('pono');
|
||||
$igrsingle = $this->cashbook_model->igrmastersingle($igrno,$pono);
|
||||
$igrmultiple =$this->cashbook_model->igrmastermultiple($igrno,$pono);
|
||||
$data = array_merge($igrsingle,$igrmultiple);
|
||||
echo json_encode($data);
|
||||
|
||||
|
||||
}
|
||||
public function filelist()
|
||||
|
||||
{
|
||||
$igrno= $this->input->post('igrno');
|
||||
$pono =$this->input->post('pono');
|
||||
$data = $this->cashbook_model->debitimage($igrno,$pono);
|
||||
|
||||
echo json_encode($data);
|
||||
|
||||
}
|
||||
|
||||
public function mappingpo()
|
||||
{
|
||||
$this->global['pageTitle'] = $this->CompanyName.' : Bank Report - Debited Settlements';
|
||||
$SupplierName = $this->input->post('SupplierName');
|
||||
$SupplierName = $this->input->post('SupplierName');
|
||||
$fdate = $this->input->post('from_date');
|
||||
$tdate = $this->input->post('to_date');
|
||||
$bankid= $_GET['d'];
|
||||
@ -1427,7 +1666,7 @@ class cashbook extends BaseController
|
||||
|
||||
|
||||
// $this->global['pageTitle'] = 'Siddharth : mappingcredit';
|
||||
$this->global['pageTitle'] = 'Siddharth : Bank Report - Credited Details ';
|
||||
$this->global['pageTitle'] = $this->CompanyName.' : Bank Report - Credited Details ';
|
||||
$SupplierName = $this->input->post('SupplierName');
|
||||
$fdate = $this->input->post('from_date');
|
||||
$tdate = $this->input->post('to_date');
|
||||
@ -1436,10 +1675,11 @@ class cashbook extends BaseController
|
||||
$this->loadViews("bankinvoisettle", $this->global,$data,NULL);
|
||||
|
||||
}
|
||||
|
||||
public function receipt()
|
||||
|
||||
public function receipt()
|
||||
{
|
||||
$this->global['pageTitle'] = $this->CompanyName.' : Bank Report - Store Debited Details';
|
||||
|
||||
$check = $this->input->post('check');
|
||||
$rw = $this->input->post('rw');
|
||||
$date = $this->input->post('podate');
|
||||
@ -1495,7 +1735,7 @@ class cashbook extends BaseController
|
||||
}
|
||||
$earlypaid = 0;
|
||||
//echo $earlypaid;
|
||||
$earlypaid = $this->cashbook_model->getearlyamount($pono);
|
||||
$earlypaid = $this->cashbook_model->getearlyamount($igrlineitem);
|
||||
if(empty($earlypaid))
|
||||
{
|
||||
$ePay=0;
|
||||
@ -1520,7 +1760,7 @@ class cashbook extends BaseController
|
||||
$podata = array('Podate'=>$date,'PONO'=>$pono,'IGRNO'=>$igrno,'Suppliername'=>$sname,'Totalpoamount'=>$tot,'Amountpaid'=>$amtpaid,'Balancetopay'=>$balancetopay,'mid'=>$bankid,'IGRLineItemNo'=>$igrlineitem);
|
||||
//die();
|
||||
|
||||
$result3 = $this->cashbook_model->getpono($pono);
|
||||
$result3 = $this->cashbook_model->getpono($igrlineitem);
|
||||
|
||||
$resultn = $this->cashbook_model->mappingpo($podata1);
|
||||
if(count($result3)<=0)
|
||||
@ -1532,7 +1772,7 @@ class cashbook extends BaseController
|
||||
else
|
||||
{
|
||||
//echo "update";
|
||||
$result3 = $this->cashbook_model->poupdate($podata,$pono);
|
||||
$result3 = $this->cashbook_model->poupdate($podata,$igrlineitem);
|
||||
|
||||
}
|
||||
if($rw == $rowcount)
|
||||
@ -1558,7 +1798,7 @@ class cashbook extends BaseController
|
||||
public function invoiceamount1()
|
||||
{
|
||||
//$this->global['pageTitle'] = 'Siddharth : Cashbook Listing';
|
||||
$this->global['pageTitle'] = 'Siddharth : Bank Report - Store Credited Details';
|
||||
$this->global['pageTitle'] = $this->CompanyName.' : Bank Report - Store Credited Details';
|
||||
$check = $this->input->post('check');
|
||||
$rw = $this->input->post('rw');
|
||||
|
||||
@ -1598,7 +1838,8 @@ class cashbook extends BaseController
|
||||
}
|
||||
else
|
||||
{
|
||||
$clearedblnce=-$totalpaidamount-(-$arec);
|
||||
//$clearedblnce=-$totalpaidamount-(-$arec);
|
||||
$clearedblnce=$totalpaidamount+$arec;
|
||||
}
|
||||
$balancetoreceived =($bankcreditamount-$totalpaidamount);
|
||||
$check =1;
|
||||
@ -1617,6 +1858,7 @@ class cashbook extends BaseController
|
||||
|
||||
$active=1;
|
||||
$bankdata = array('cclearbalance'=>$clearedblnce,'cbalancetocleared'=>$balancetoreceived,'cstatus'=>$status);
|
||||
|
||||
if($check == 1)
|
||||
{
|
||||
$res = $this->cashbook_model->bankcreditupdate($bankdata,$bankid);
|
||||
@ -1683,7 +1925,7 @@ class cashbook extends BaseController
|
||||
{
|
||||
|
||||
//$this->global['pageTitle'] = 'Siddharth : amountpaid';
|
||||
$this->global['pageTitle'] = 'Siddharth : Bank Report - Amount Payment Details';
|
||||
$this->global['pageTitle'] = $this->CompanyName.' : Bank Report - Amount Payment Details';
|
||||
if ($this->input->post('btn_submit'))
|
||||
{
|
||||
$SupplierName = $this->input->post('SupplierName');
|
||||
@ -1702,7 +1944,7 @@ class cashbook extends BaseController
|
||||
|
||||
// $this->load->model('cashbook_model');
|
||||
//$this->global['pageTitle'] = 'Siddharth : Cashbook Listing';
|
||||
$this->global['pageTitle'] = 'Siddharth : Bank Report - Received Amount Details';
|
||||
$this->global['pageTitle'] = $this->CompanyName.' : Bank Report - Received Amount Details';
|
||||
if ($this->input->post('btn_submit'))
|
||||
{
|
||||
$Customer = $this->input->post('Customer');
|
||||
@ -1809,6 +2051,7 @@ class cashbook extends BaseController
|
||||
|
||||
$result= $this->cashbook_model->IgrDetailsStatusUpdate($igrno,$BankStatus);
|
||||
$result1= $this->cashbook_model->deletemapping($Bankid,$updateamount,$updatebalancetoclear);
|
||||
|
||||
//for update mapping amount in t_bankmappingpo table//
|
||||
$balancetopay=$_GET['balancetopay'];
|
||||
$totalbalancetopay=$Amount + $balancetopay;
|
||||
@ -1818,6 +2061,7 @@ class cashbook extends BaseController
|
||||
//for update mapping amount inT_Bankporeport table//
|
||||
$result3= $this->cashbook_model->updateBankporeportpo($igrno,$totalbalancetopay,$updatebankpoamount,$Bankid);
|
||||
|
||||
|
||||
if(count($result2)>0)
|
||||
{
|
||||
redirect('Bankingstatement','refresh');
|
||||
@ -1827,7 +2071,7 @@ class cashbook extends BaseController
|
||||
public function deletemappingiv()
|
||||
{
|
||||
|
||||
$this->global['pageTitle'] = 'Siddharth : Bank Report - Delete Mapping Invoice';
|
||||
$this->global['pageTitle'] = $this->CompanyName.' : Bank Report - Delete Mapping Invoice';
|
||||
$credit= $this->input->post('credit');
|
||||
$invoiceno = $this->input->post('invoiceno');
|
||||
$bankid = $this->input->post('bankid');
|
||||
@ -1840,11 +2084,13 @@ class cashbook extends BaseController
|
||||
$updatebalancetoclear=$amountreceived+$bankingbalclear;
|
||||
if($amountreceived<0)
|
||||
{
|
||||
$updateclearbalance=$bankingclear+$amountreceived;
|
||||
//$updateclearbalance=$bankingclear+$amountreceived;
|
||||
$updateclearbalance=$bankingclear-($amountreceived);//450-(-250)
|
||||
}
|
||||
else
|
||||
{
|
||||
$updateclearbalance=$bankingclear-$amountreceived;
|
||||
$updateclearbalance=$bankingclear-$amountreceived;//450-650
|
||||
//$updateclearbalance=$bankingclear-$amountreceived;
|
||||
}
|
||||
|
||||
//update Isactive field in T_Bankreport //////
|
||||
|
||||
@ -1301,7 +1301,7 @@ $prefile =array();
|
||||
{
|
||||
$RevenueTaxList = array('LineItemNo'=>$LineItemNo, 'DiscountType'=>$DiscountType,'DiscountValue'=>$DiscountValue,'AfterDiscount'=>$AfterDiscount,'PackagingType'=>$PackagingType,'PackagingValue'=>$PackagingValue,'PackagingCalulatedOn'=>$PackagingOption,'AfterPackagingValue'=>$AfterPackagingValue,'FreightType'=>$FreightType, 'FreightValue'=>$FreightValue,'AfterFreightValue'=>$AfterFreightValue,'ExciseDuty'=>$ExciseValue,'ExciseDutyCalulatedOn'=>$ExciseOption,'AfterExciseDuty'=>$AfterExciseValue,'Vat'=>$VatValue,'AfterVAT'=>$AfterVatValue,'VatCalulatedOn'=>$VatOption, 'CST'=>$CSTValue,'AfterCST'=>$AfterCSTValue,'CSTCalulatedOn'=>$CSTOption,'GST'=>$GSTValue,'AfterGST'=>$AfterGSTValue,'OtherTaxes'=>$OtherTaxValue,'AfterOtherTaxes'=>$AfterOtherTaxValue,'Insurance'=>$InsuranceValue,'TotalValue'=>$TotalOrderValue, 'CreatedBy'=>$updatedBy,'CreatedDate'=>$updateddt);
|
||||
|
||||
$RevenueList = $this->purchaseorder_model->addRevenueTax($RevenueTaxList);
|
||||
$RevenueList = $this->purchaseorder_model->addRevenueTax($RevenueTaxList);
|
||||
|
||||
}
|
||||
else
|
||||
|
||||
@ -11,7 +11,7 @@ require APPPATH . '/libraries/BaseController.php';
|
||||
*/
|
||||
class inwardgateregister extends BaseController
|
||||
{
|
||||
/**
|
||||
/**
|
||||
* default constructor of the class
|
||||
*/
|
||||
public function __construct()
|
||||
@ -524,8 +524,12 @@ $prefile =array();
|
||||
{
|
||||
|
||||
$IGRNO= $this->input->post('id');
|
||||
//echo $IGRNO;
|
||||
|
||||
$data = $this->inwardgateregister_model->viewigr($IGRNO);
|
||||
echo json_encode($data);
|
||||
|
||||
// print_r($data);
|
||||
echo json_encode($data);
|
||||
|
||||
}
|
||||
|
||||
@ -537,6 +541,8 @@ $prefile =array();
|
||||
$igrfile = $this->inwardgateregister_model->viewIGRFile($IGRNO);
|
||||
$billfile = $this->inwardgateregister_model->ViewIGRfile1($IGRNO);
|
||||
$data = array_merge($igrfile,$billfile);
|
||||
|
||||
//print_r($data);
|
||||
echo json_encode($data);
|
||||
|
||||
}
|
||||
|
||||
@ -1381,13 +1381,13 @@ class purchaseorder extends BaseController
|
||||
//$PONO = $_GET['PO'];
|
||||
$PoStatus='';
|
||||
$data['AmendmentPDF'] = $this->purchaseorder_model->amendpdf($PONO);
|
||||
$data['CompanyDetails'] = $this->purchaseorder_model->getCompanyInformationforPDF();
|
||||
$data['GetPoFormat'] = $this->purchaseorder_model->GetPoFormat($PONO);
|
||||
$data['CompanyDetails'] = $this->purchaseorder_model->getCompanyInformationforPDF();
|
||||
$data['GetPoFormat'] = $this->purchaseorder_model->GetPoFormat($PONO);
|
||||
$data['POItem'] = $this->purchaseorder_model->GetRevenuePurchaseOrderDetailsForPDF($PONO);
|
||||
$data['releasedetails'] = $this->purchaseorder_model->GetReleasedDetails($PONO);
|
||||
$data['CurrencySymbol']=$this->purchaseorder_model->GerCurrencyCodeName('INR');
|
||||
$data['reveuetax']=$this->purchaseorder_model->getRevenueTaxinforforpdf($PONO);
|
||||
$data['AmendmentPDF'] = $this->purchaseorder_model->amendpdf($PONO);
|
||||
$data['AmendmentPDF'] = $this->purchaseorder_model->amendpdf($PONO);
|
||||
$Currencycode='';
|
||||
|
||||
$TotalOrderValue=$data['POItem'][0]->TotalOrderValue;
|
||||
|
||||
@ -41,21 +41,7 @@ class cashbook_model extends CI_Model
|
||||
$r = $this->db->get();
|
||||
return $r->result();
|
||||
}
|
||||
// function getIncomeExpenseList($i="",$type)
|
||||
// {
|
||||
// $sql="SELECT `t_accountcode`.`name`, `T_Employee_Details`.`FirstName`,
|
||||
// `T_Employee_Details`.`LastName`, `t_income_expense`.*
|
||||
// FROM (`t_income_expense`)
|
||||
// JOIN `t_accountcode` ON `t_income_expense`.`account_code`=`t_accountcode`.`code` or `t_income_expense`.`account_code` = '999'
|
||||
// JOIN `tbl_users` ON `t_income_expense`.`Created_By`=`tbl_users`.`userId`
|
||||
// JOIN `T_Employee_Details` ON `tbl_users`.`EmpID`=`T_Employee_Details`.`EmpID`
|
||||
// WHERE `t_income_expense`.`id` = ".$i."
|
||||
// and t_income_expense.type = '".$type."'
|
||||
// group by t_income_expense.id";
|
||||
// $query = $this->db->query($sql);
|
||||
// $result = $query->result();
|
||||
// return $result;
|
||||
// }
|
||||
|
||||
|
||||
/**
|
||||
* To Get Recepit and Payment datas for list
|
||||
@ -69,9 +55,9 @@ class cashbook_model extends CI_Model
|
||||
JOIN `t_accountcode` ON `t_income_expense`.`account_code`=`t_accountcode`.`code` or `t_income_expense`.`account_code` = '999'
|
||||
JOIN `tbl_users` ON `t_income_expense`.`Created_By`=`tbl_users`.`userId`
|
||||
JOIN `T_Employee_Details` ON `tbl_users`.`EmpID`=`T_Employee_Details`.`EmpID`
|
||||
group by t_income_expense.id";
|
||||
group by t_income_expense.id";
|
||||
$query = $this->db->query($sql);
|
||||
return $query->result();
|
||||
return $query->result();
|
||||
}
|
||||
function getIncomeExpense($firstyear,$secondyear,$frmdt,$todt)
|
||||
{
|
||||
@ -82,6 +68,7 @@ class cashbook_model extends CI_Model
|
||||
$this->db->join('T_Employee_Details','tbl_users.EmpID=T_Employee_Details.EmpID','left');
|
||||
$this->db->where('t_income_expense.IsActive',1);
|
||||
$this->db->where('t_income_expense.account_code !=','ADV001');
|
||||
$this->db->where('t_income_expense.account_code !=','0013');
|
||||
if ($firstyear and $secondyear != '')
|
||||
{
|
||||
$finyear = "t_income_expense.date >= '".$firstyear."-04-01' and t_income_expense.date <= '".$secondyear."-03-31'";
|
||||
@ -108,8 +95,8 @@ class cashbook_model extends CI_Model
|
||||
$this->db->join('tbl_users','t_income_expense.Created_By=tbl_users.userId','left');
|
||||
$this->db->join('T_Employee_Details','tbl_users.EmpID=T_Employee_Details.EmpID','left');
|
||||
$this->db->where('t_income_expense.IsActive',1);
|
||||
$this->db->where('t_income_expense.account_code','ADV001');
|
||||
//$this->db->where('t_income_expense.account_code','0013');
|
||||
$this->db->where('t_income_expense.account_code','ADV001');
|
||||
$this->db->or_where('t_income_expense.account_code','0013');
|
||||
$this->db->order_by("date","desc");
|
||||
if(!empty($i))
|
||||
{
|
||||
@ -129,33 +116,36 @@ class cashbook_model extends CI_Model
|
||||
$this->db->join('T_Employee_Details','tbl_users.EmpID=T_Employee_Details.EmpID','left');
|
||||
$this->db->where('t_income_expense.IsActive',1);
|
||||
$this->db->where('t_income_expense.account_code','ADV001');
|
||||
if ($firstyear and $secondyear != ''){
|
||||
$finyear = "t_income_expense.date >= '".$firstyear."-04-01' and t_income_expense.date <= '".$secondyear."-03-31'";
|
||||
$this->db->where($finyear);
|
||||
$this->db->or_where('t_income_expense.account_code','0013');
|
||||
if ($firstyear and $secondyear != '')
|
||||
{
|
||||
$finyear = "t_income_expense.date >= '".$firstyear."-04-01' and t_income_expense.date <= '".$secondyear."-03-31'";
|
||||
$this->db->where($finyear);
|
||||
}
|
||||
if ($frmdt and $todt != ''){
|
||||
$fromdate= date("Y-m-d",strtotime($frmdt));
|
||||
$todate=date("Y-m-d",strtotime($todt));
|
||||
$date = "date(t_income_expense.date) >= '".$fromdate."'
|
||||
and date(t_income_expense.date) <= '".$todate."'";
|
||||
$this->db->where($date);
|
||||
if ($frmdt and $todt != '')
|
||||
{
|
||||
$fromdate= date("Y-m-d",strtotime($frmdt));
|
||||
$todate=date("Y-m-d",strtotime($todt));
|
||||
$date = "date(t_income_expense.date) >= '".$fromdate."'
|
||||
and date(t_income_expense.date) <= '".$todate."'";
|
||||
$this->db->where($date);
|
||||
}
|
||||
$this->db->order_by("date","desc");
|
||||
$r = $this->db->get();
|
||||
return $r->result();
|
||||
}
|
||||
|
||||
function finyear(){
|
||||
function finyear()
|
||||
{
|
||||
|
||||
|
||||
$sql="SELECT
|
||||
CASE WHEN MONTH(date)>=4 THEN
|
||||
concat(YEAR(date), '-',YEAR(date)+1)
|
||||
ELSE concat(YEAR(date)-1,'-', YEAR(date)) END AS financial_year
|
||||
FROM t_income_expense
|
||||
GROUP BY financial_year";
|
||||
$query = $this->db->query($sql);
|
||||
return $query->result();
|
||||
$sql="SELECT
|
||||
CASE WHEN MONTH(date)>=4 THEN
|
||||
concat(YEAR(date), '-',YEAR(date)+1)
|
||||
ELSE concat(YEAR(date)-1,'-', YEAR(date)) END AS financial_year
|
||||
FROM t_income_expense
|
||||
GROUP BY financial_year";
|
||||
$query = $this->db->query($sql);
|
||||
return $query->result();
|
||||
|
||||
}
|
||||
|
||||
@ -208,16 +198,7 @@ class cashbook_model extends CI_Model
|
||||
return $r->result();
|
||||
}
|
||||
|
||||
// function viewdepartment($sid='')
|
||||
// {
|
||||
// $sql="SELECT ie.*,ac.name,date_format(ie.date,'%d-%m-%Y')as date FROM t_income_expense ie
|
||||
// JOIN t_accountcode ac on ac.code=ie.account_code
|
||||
// WHERE ie.id = ?";
|
||||
// $query = $this->db->query($sql,array($sid));
|
||||
// //print_r($this->db->last_query());
|
||||
// //echo $sql;
|
||||
// return $query->result();
|
||||
// }
|
||||
|
||||
|
||||
function viewdepartment($sid='')
|
||||
{
|
||||
@ -244,18 +225,6 @@ class cashbook_model extends CI_Model
|
||||
return $r;
|
||||
}
|
||||
|
||||
// function deletefile($cashid,$cashfile)
|
||||
// {
|
||||
|
||||
// $sql="UPDATE t_income_expense SET document = NULL
|
||||
// WHERE id = ?";
|
||||
// $query = $this->db->query($sql,array($cashid));
|
||||
// unlink("uploads/cashbook/".$cashfile);//this deletes the file on particular folder too
|
||||
// //print_r($this->db->last_query());
|
||||
// //echo $sql;
|
||||
// $r = $this->db->affected_rows();
|
||||
// return $r;
|
||||
// }
|
||||
|
||||
|
||||
function updatedepartment($updateaccount,$id1)
|
||||
@ -345,42 +314,7 @@ class cashbook_model extends CI_Model
|
||||
|
||||
|
||||
}
|
||||
//function addupdatepaymentdetails($PaymentDetails,$hidekey=''){
|
||||
|
||||
// $paymentid = $PaymentDetails['Payment_id'];
|
||||
// //$key = $PaymentDetails['ID'];
|
||||
|
||||
// $count=0;
|
||||
|
||||
// $this->db->select('count(*) as count');
|
||||
// $this->db->from('T_Paymentdetails');
|
||||
// $this->db->where('Payment_id',$paymentid);
|
||||
// $this->db->where('ID',$hidekey);
|
||||
|
||||
// $isExits = $this->db->get();
|
||||
// $res = $isExits->result_array();
|
||||
|
||||
|
||||
// if(!empty($res))
|
||||
// {
|
||||
// $count = $res[0]['count'];
|
||||
// }
|
||||
|
||||
// if($count == 0 )//for insert
|
||||
// {
|
||||
// $i = $this->db->insert('T_Paymentdetails',$PaymentDetails);
|
||||
// return $i;
|
||||
// }
|
||||
|
||||
// elseif($count == 1)//for update
|
||||
// {
|
||||
// $this->db->where('Payment_id', $paymentid);
|
||||
// $this->db->where('ID', $hidekey);
|
||||
// $u = $this->db->update('T_Paymentdetails',$PaymentDetails);
|
||||
// return $u;
|
||||
// }
|
||||
|
||||
// }
|
||||
|
||||
|
||||
/**
|
||||
@ -416,30 +350,32 @@ class cashbook_model extends CI_Model
|
||||
function getbalancedetails()
|
||||
{
|
||||
|
||||
|
||||
$subquery="SELECT openingbalance,closingbalance FROM T_bankbalance WHERE balance_keyid in (SELECT MAX(balance_keyid) FROM T_bankbalance)";
|
||||
$query = $this->db->query($subquery);
|
||||
return $query->result();
|
||||
|
||||
}
|
||||
|
||||
function cleareddebitbalance(){
|
||||
function cleareddebitbalance()
|
||||
{
|
||||
|
||||
$sql = "SELECT SUM(Balancetocleared) as debit FROM T_bankreport where Clearbalance >'0'";
|
||||
|
||||
$query = $this->db->query($sql);
|
||||
return $query->result();
|
||||
|
||||
}
|
||||
function clearedcreditbalance()
|
||||
{
|
||||
|
||||
}
|
||||
function clearedcreditbalance(){
|
||||
$sql = "SELECT SUM(cbalancetocleared) as credit FROM T_bankreport where cclearbalance >'0'";
|
||||
|
||||
$sql = "SELECT SUM(cbalancetocleared) as credit FROM T_bankreport where cclearbalance >'0'";
|
||||
|
||||
$query = $this->db->query($sql);
|
||||
return $query->result();
|
||||
$query = $this->db->query($sql);
|
||||
return $query->result();
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
function bankfile($FileDetails)
|
||||
{
|
||||
@ -458,53 +394,47 @@ class cashbook_model extends CI_Model
|
||||
$this->db->where('Balance',$filedataupload['Balance']);
|
||||
|
||||
$query = $this->db->get();
|
||||
if ($query->num_rows() > 0){
|
||||
return true;
|
||||
|
||||
if ($query->num_rows() > 0)
|
||||
{
|
||||
return true;
|
||||
|
||||
}
|
||||
else{
|
||||
$this->db->insert('T_bankreport', $filedataupload);
|
||||
$r = $this->db->affected_rows();
|
||||
//print_r($this->db->last_query());
|
||||
return $r;
|
||||
}
|
||||
}
|
||||
else{
|
||||
$this->db->insert('T_bankreport', $filedataupload);
|
||||
$r = $this->db->affected_rows();
|
||||
//print_r($this->db->last_query());
|
||||
return $r;
|
||||
}
|
||||
}
|
||||
|
||||
function balance($balance){
|
||||
function balance($balance)
|
||||
{
|
||||
|
||||
|
||||
$this ->db->insert('T_bankbalance',$balance);
|
||||
}
|
||||
}
|
||||
|
||||
function report_finyear()
|
||||
{
|
||||
$sql="SELECT
|
||||
CASE WHEN MONTH(reportdate)>=4 THEN
|
||||
concat(YEAR(reportdate), '-',YEAR(reportdate)+1)
|
||||
ELSE concat(YEAR(reportdate)-1,'-', YEAR(reportdate)) END AS financial_year
|
||||
FROM T_bankreport
|
||||
GROUP BY financial_year";
|
||||
$query = $this->db->query($sql);
|
||||
return $query->result();
|
||||
}
|
||||
|
||||
function report_finyear(){
|
||||
|
||||
|
||||
$sql="SELECT
|
||||
CASE WHEN MONTH(reportdate)>=4 THEN
|
||||
concat(YEAR(reportdate), '-',YEAR(reportdate)+1)
|
||||
ELSE concat(YEAR(reportdate)-1,'-', YEAR(reportdate)) END AS financial_year
|
||||
FROM T_bankreport
|
||||
GROUP BY financial_year";
|
||||
$query = $this->db->query($sql);
|
||||
return $query->result();
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
function bankstatement($fdate,$tdate,$fa,$aa){
|
||||
|
||||
|
||||
|
||||
$sql="SELECT *,date_format(reportdate,'%d-%m-%Y')as date,tie.total,date_format(valuedate,'%d-%m-%Y')as valuedate from T_bankreport as br left join t_income_expense as tie on tie.bankid=br.ID where br.reportdate !=0 ";
|
||||
|
||||
|
||||
if ($fa and $aa != ''){
|
||||
function bankstatement($fdate,$tdate,$fa,$aa)
|
||||
{
|
||||
$sql="SELECT *,date_format(reportdate,'%d-%m-%Y')as date,tie.total,date_format(valuedate,'%d-%m-%Y')as valuedate from T_bankreport as br left join t_income_expense as tie on tie.bankid=br.ID where br.reportdate !=0 ";
|
||||
if ($fa and $aa != '')
|
||||
{
|
||||
|
||||
$sql.=" and (reportdate >= '".$fa."-04-01' and reportdate<= '".$aa."-03-31')";
|
||||
|
||||
}
|
||||
}
|
||||
if ($fdate and $tdate != '')
|
||||
{
|
||||
|
||||
@ -513,12 +443,12 @@ function bankstatement($fdate,$tdate,$fa,$aa){
|
||||
|
||||
$sql.= " and date(reportdate) >= '".$fdate."'
|
||||
and date(reportdate) <= '".$tdate."'";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
$sql.=" group by(br.ID) ";
|
||||
$sql.=" group by(br.ID) ";
|
||||
$sql.=" ORDER BY br.ID+0 DESC ";
|
||||
|
||||
|
||||
@ -531,11 +461,9 @@ function bankstatement($fdate,$tdate,$fa,$aa){
|
||||
function debitbankstatemet($Supplierid,$fdate,$tdate)
|
||||
{
|
||||
$status='ST057';
|
||||
//echo $tdate;
|
||||
//die();
|
||||
//$Supplierid;
|
||||
$this->db->distinct();
|
||||
$this->db->select('igr.PONO,igrli.IGRItemNo,igr.IGRNO,supp.SupplierName,igrli.CreatedDate,BR.Balancetopay,BR.Amountpaid,pom.Status,igrli.QuantityAsPerInvoice ,poli.Rate,(igrli.QuantityAsPerInvoice * poli.Rate) as total');
|
||||
|
||||
$this->db->distinct();
|
||||
$this->db->select('igr.PONO,igrli.IGRItemNo,igr.IGRNO,supp.SupplierName,igrli.CreatedDate,BR.Balancetopay,BR.Amountpaid,pom.Status,igrli.QuantityAsPerInvoice ,poli.Rate,(igrli.QuantityAsPerInvoice * poli.Rate) as total');
|
||||
$this->db->from ('T_IGR_Details igrli');
|
||||
$this->db->join('T_IGR_Master igr','igrli.IGRNO = igr.IGRNO','left');
|
||||
$this->db->join('T_PurchaseOrder_LineItem poli','igr.PONO= poli.PONO and igrli.MaterialCode=poli.MaterialCode');
|
||||
@ -588,7 +516,7 @@ function debitbankstatemet($Supplierid,$fdate,$tdate)
|
||||
|
||||
}
|
||||
|
||||
function receiptdata()
|
||||
function receiptdata()
|
||||
{
|
||||
|
||||
$this->db->distinct();
|
||||
@ -599,7 +527,7 @@ function receiptdata()
|
||||
return $query->result();
|
||||
|
||||
}
|
||||
function paymentdata()
|
||||
function paymentdata()
|
||||
{
|
||||
|
||||
$this->db->distinct();
|
||||
@ -612,49 +540,37 @@ function receiptdata()
|
||||
|
||||
}
|
||||
|
||||
function debitpolist($bankid)
|
||||
{
|
||||
$this->db->select('bp.id,bp.mid,igrm.MaterialRcvdDate,bp.PONO,bp.Suppliername,bp.Totalpoamount,br.Debit,
|
||||
bp.Balancetopay,bp.Amountpaid,bp.IGRNO,bp.IGRLineItemNo,igrm.file,bu.FilePath');
|
||||
$this->db->from ('T_Bankmappingpo bp');
|
||||
$this->db->join ('T_IGR_Master igrm','bp.IGRNO = igrm.IGRNO','left');
|
||||
$this->db->join ('T_PurchaseOrder_BillUpload bu','bu.PONO = bp.PONO','left');
|
||||
$this->db->join ('T_bankreport br','br.ID=bp.mid');
|
||||
$this->db->where('bp.IsActive',1);
|
||||
$this->db->where('bp.mid',$bankid);
|
||||
// $this->db->where('igrde.BankStatus !=','ST072');
|
||||
$this->db->group_by('bp.id');
|
||||
$query = $this->db->get();
|
||||
return $query->result();
|
||||
|
||||
}
|
||||
|
||||
//function for image
|
||||
|
||||
function debitimage($pono)
|
||||
|
||||
function debitimage($igrno,$pono)
|
||||
{
|
||||
$this->db->select('bp.PONO,bp.mid,bu.FilePath,bu.BillNo,bu.IGRNO');
|
||||
$this->db->from ('T_Bankmappingpo bp');
|
||||
$this->db->join ('T_PurchaseOrder_BillUpload bu','bp.PONO = bu.PONO','left');
|
||||
$this->db->where('bp.PONO',$pono);
|
||||
$this->db->group_by('bu.BillNo');
|
||||
$query = $this->db->get();
|
||||
return $query->result();
|
||||
|
||||
$this->db->select('*');
|
||||
$this->db->from ('T_PurchaseOrder_BillUpload');
|
||||
$this->db->where('IGRNO != "" ');
|
||||
$this->db->where('IGRNO',$igrno);
|
||||
$this->db->or_where('PONO',$pono);
|
||||
$query = $this->db->get();
|
||||
$result = $query->result();
|
||||
// print_r($result);die;
|
||||
return $result;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
function debitpolistfilter($SupplierName,$fdate,$tdate)
|
||||
{
|
||||
$this->db->select('bm.id,bm.mid,igrm.MaterialRcvdDate,bm.PONO,bm.Suppliername,bm.Totalpoamount,
|
||||
bm.Balancetopay,bm.Amountpaid,bm.IGRNO,igrm.file,bm.IGRLineItemNo,br.Clearbalance,br.Balancetocleared,bu.FilePath,bu.BillNo');
|
||||
bm.Balancetopay,bm.Amountpaid,bm.IGRNO,igrm.file,bm.IGRLineItemNo,br.Clearbalance,br.Balancetocleared,bu.FilePath,bu.BillNo,inward.FilePath as Fpath');
|
||||
$this->db->from ('T_Bankmappingpo bm');
|
||||
$this->db->join ('T_IGR_Master igrm','igrm.IGRNO = bm.IGRNO');
|
||||
//$this->db->join ('T_IGR_Details igrde','igrde.IGRNO=igrm.IGRNO');
|
||||
$this->db->join ('T_SupplierDetailsN sd','sd.SupplierName = bm.Suppliername');
|
||||
$this->db->join ('T_bankreport br','br.ID=bm.mid');
|
||||
$this->db->join ('T_PurchaseOrder_BillUpload bu','bm.PONO=bu.PONO','left');
|
||||
$this->db->join('T_Inwardgateregister_fileupload inward','inward.IGRNO =igrm.IGRNO','left');
|
||||
$this->db->join ('T_PurchaseOrder_BillUpload bu','bm.PONO=bu.PONO','left');
|
||||
if($fdate!='' && $tdate!='')
|
||||
{
|
||||
$this->db->where('bm.Podate BETWEEN "'. date('Y-m-d', strtotime($fdate)). '" and "'. date('Y-m-d', strtotime($tdate)).'"');
|
||||
@ -670,7 +586,58 @@ function debitpolist($bankid)
|
||||
return $query->result();
|
||||
|
||||
}
|
||||
|
||||
function igrmastersingle($igrno,$pono)
|
||||
{
|
||||
$this->db->distinct();
|
||||
$this->db->select('IGRNO,file,PONO as pono');
|
||||
$this->db->from('T_IGR_Master');
|
||||
if(!empty($igrno) && !empty($pono)){
|
||||
$this->db->where('PONO',$pono);
|
||||
$this->db->where('IGRNO',$igrno);
|
||||
}else if(!empty($pono)){
|
||||
$this->db->where('PONO',$pono);
|
||||
$this->db->where('IGRNO != ""');
|
||||
}else{
|
||||
$this->db->where('IGRNO',$IGRNO);
|
||||
}
|
||||
|
||||
$query = $this->db->get();
|
||||
return $query->result();
|
||||
}
|
||||
function igrmastermultiple($igrno,$pono)
|
||||
{
|
||||
$this->db->distinct();
|
||||
$this->db->select('BillNo,IGRNO,FilePath,PONO,Remarks');
|
||||
$this->db->from('T_Inwardgateregister_fileupload');
|
||||
if(!empty($igrno) && !empty($pono)){
|
||||
$this->db->where('PONO',$pono);
|
||||
$this->db->where('IGRNO',$igrno);
|
||||
}else if(!empty($pono)){
|
||||
$this->db->where('PONO',$pono);
|
||||
$this->db->where('IGRNO != ""');
|
||||
}else{
|
||||
$this->db->where('IGRNO',$IGRNO);
|
||||
}
|
||||
$query = $this->db->get();
|
||||
return $query->result();
|
||||
|
||||
}
|
||||
function debitpolist($bankid)
|
||||
{
|
||||
$this->db->select('bp.id,bp.mid,igrm.MaterialRcvdDate,bp.PONO,bp.Suppliername,bp.Totalpoamount,br.Debit,bp.Balancetopay,bp.Amountpaid,bp.IGRNO,bp.IGRLineItemNo,igrm.file,bu.FilePath,inward.FilePath as Fpath');
|
||||
$this->db->from ('T_Bankmappingpo bp');
|
||||
$this->db->join ('T_IGR_Master igrm','bp.IGRNO = igrm.IGRNO','left');
|
||||
$this->db->join ('T_PurchaseOrder_BillUpload bu','bu.PONO = bp.PONO','left');
|
||||
$this->db->join('T_Inwardgateregister_fileupload inward','inward.IGRNO =igrm.IGRNO','left');
|
||||
$this->db->join ('T_bankreport br','br.ID=bp.mid');
|
||||
$this->db->where('bp.IsActive',1);
|
||||
$this->db->where('bp.mid',$bankid);
|
||||
// $this->db->where('igrde.BankStatus !=','ST072');
|
||||
$this->db->group_by('bp.id');
|
||||
$query = $this->db->get();
|
||||
return $query->result();
|
||||
|
||||
}
|
||||
function creditinvoicelist($bankid)
|
||||
{
|
||||
$this->db->select('bm.indate,bm.invoiceno,bm.customername,bm.totinvoiceamount,bm.bankid,
|
||||
@ -854,12 +821,7 @@ function debitpolist($bankid)
|
||||
$r = $this->db->affected_rows();
|
||||
return $r;
|
||||
}
|
||||
// function invicedata($invoicedata)
|
||||
// {
|
||||
// $this->db->insert('T_Bankinvoicereport',$invoicedata);
|
||||
// $r = $this->db->affected_rows();
|
||||
// return $r;
|
||||
// }
|
||||
|
||||
function mappingpo($podata)
|
||||
{
|
||||
$this->db->insert('T_Bankmappingpo',$podata);
|
||||
@ -876,11 +838,11 @@ function debitpolist($bankid)
|
||||
}
|
||||
|
||||
|
||||
public function getpono($pono)
|
||||
public function getpono($igrlineitem)
|
||||
{
|
||||
$this->db->select('PONO');
|
||||
$this->db->select('IGRLineItemNo');
|
||||
$this->db->from('T_Bankporeport');
|
||||
$this->db->where('PONO ',$pono);
|
||||
$this->db->where('IGRLineItemNo ',$igrlineitem);
|
||||
$query = $this->db->get();
|
||||
// print_r( $this->db->last_query());
|
||||
return $query->result();
|
||||
@ -934,15 +896,15 @@ function debitpolist($bankid)
|
||||
$this->db->where('ID',$bankid);
|
||||
$this->db->update('T_bankreport',$bankcreditdata);
|
||||
|
||||
print_r($this->db->last_query());
|
||||
//return TRUE;
|
||||
//print_r($this->db->last_query());
|
||||
return TRUE;
|
||||
|
||||
}
|
||||
public function getearlyamount($pono)
|
||||
public function getearlyamount($igrlineitem)
|
||||
{
|
||||
$this->db->select('Amountpaid');
|
||||
$this->db->from('T_Bankporeport');
|
||||
$this->db->where('PONO ',$pono);
|
||||
$this->db->where('IGRLineItemNo ',$igrlineitem);
|
||||
$query = $this->db->get();
|
||||
// print_r( $this->db->last_query());
|
||||
return $query->result();
|
||||
@ -979,10 +941,10 @@ function debitpolist($bankid)
|
||||
|
||||
}
|
||||
|
||||
public function poupdate($podata,$pono)
|
||||
public function poupdate($podata,$igrlineitem)
|
||||
{
|
||||
|
||||
$this->db->where('PONO',$pono);
|
||||
$this->db->where('IGRLineItemNo',$igrlineitem);
|
||||
$this->db->update('T_Bankporeport',$podata);
|
||||
|
||||
return TRUE;
|
||||
@ -1033,7 +995,7 @@ function debitpolist($bankid)
|
||||
return $r;
|
||||
|
||||
}
|
||||
function Cashbook($cashbookdatas)
|
||||
function Cashbook($cashbookdatas)
|
||||
{
|
||||
$code=$cashbookdatas['code'];
|
||||
$type=$cashbookdatas['type'];
|
||||
|
||||
@ -10,7 +10,7 @@ class inwardgateregister_model extends CI_Model
|
||||
|
||||
function updatefile($bill,$Picture,$oldfile)
|
||||
{
|
||||
|
||||
|
||||
// if($oldfile != ''){
|
||||
// //unlink("uploads/BillFiles/".$oldfile);//this deletes the file on particular folder too
|
||||
// }
|
||||
@ -288,22 +288,41 @@ class inwardgateregister_model extends CI_Model
|
||||
* @param number $IGRNO : This is IGRNO
|
||||
* @return array $result : result of the query (returns igr details)
|
||||
*/
|
||||
function viewigr($IGRNO)
|
||||
// function viewigr($IGRNO)
|
||||
// {
|
||||
// $this->db->distinct();
|
||||
// $this->db->select('igr.IGRNO,igr.*,igrd.*,MM.MaterialName,MM.UOM,sup.Address,sup.SupplierName,POM.ServiceDescription,POL.Quantity');
|
||||
// $this->db->from('T_IGR_Master igr');
|
||||
// $this->db->join('T_IGR_Details igrd','igrd.IGRNO = igr.IGRNO');
|
||||
// $this->db->join('T_PurchaseOrder_Master POM','igr.PONO = POM.PONO');
|
||||
// $this->db->join('T_PurchaseOrder_LineItem POL','igr.PONO = POL.PONO and POL.MaterialCode=igrd.MaterialCode ');
|
||||
// $this->db->join('T_SupplierDetailsN sup', 'sup.SupplierID = POM.SupplierID');
|
||||
// $this->db->join('T_MaterialMaster MM', 'MM.MaterialCode = igrd.MaterialCode');
|
||||
// $this->db->where('igrd.IGRItemNo',$IGRNO);//here not a igr no , igrlineitem no
|
||||
// //$this->db->where('igr.IGRNO',$IGRNO);//this where igno old flow
|
||||
|
||||
|
||||
// $query = $this->db->get();
|
||||
|
||||
// $result = $query->result();
|
||||
// return $result;
|
||||
// }
|
||||
function viewigr($IGRNO)
|
||||
{
|
||||
$this->db->distinct();
|
||||
$this->db->select('igr.IGRNO,igr.*,igrd.*,MM.MaterialName,MM.UOM,sup.Address,sup.SupplierName,POM.ServiceDescription,POL.Quantity');
|
||||
$this->db->select('igr.IGRNO,igr.*,igrd.*,MM.MaterialName,MM.UOM,sup.Address,sup.SupplierName,POM.ServiceDescription,POL.Quantity');
|
||||
$this->db->from('T_IGR_Master igr');
|
||||
$this->db->join('T_IGR_Details igrd','igrd.IGRNO = igr.IGRNO');
|
||||
$this->db->join('T_PurchaseOrder_Master POM','igr.PONO = POM.PONO');
|
||||
$this->db->join('T_PurchaseOrder_LineItem POL','igr.PONO = POL.PONO and POL.MaterialCode=igrd.MaterialCode ');
|
||||
$this->db->join('T_SupplierDetailsN sup', 'sup.SupplierID = POM.SupplierID');
|
||||
$this->db->join('T_MaterialMaster MM', 'MM.MaterialCode = igrd.MaterialCode');
|
||||
$this->db->where('igrd.IGRItemNo',$IGRNO);//here not a igr no , igrlineitem no
|
||||
//$this->db->where('igr.IGRNO',$IGRNO);//this where igno old flow
|
||||
$this->db->where('igr.IGRNO',$IGRNO);
|
||||
|
||||
|
||||
$query = $this->db->get();
|
||||
|
||||
// print_r( $this->db->last_query());
|
||||
$result = $query->result();
|
||||
return $result;
|
||||
}
|
||||
|
||||
316
application/views/Advancelist.php
Normal file
316
application/views/Advancelist.php
Normal file
@ -0,0 +1,316 @@
|
||||
<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;
|
||||
}
|
||||
.btn-success {
|
||||
border: 2px solid #5d0411 !important;}
|
||||
</style>
|
||||
|
||||
<?php
|
||||
//print_r($list);
|
||||
// ?>
|
||||
<!-- <CENTER><strong><h3 class="box-title">Siddharth Industries - Receipt and Payment List</h3></strong></CENTER> -->
|
||||
<div class="content-wrapper">
|
||||
|
||||
|
||||
<section class="content">
|
||||
|
||||
<div class="box">
|
||||
|
||||
<div class="box-header">
|
||||
|
||||
<CENTER><strong><h3 class="box-title"><?php echo $pageTitle;?></h3></strong></CENTER>
|
||||
|
||||
<div align="right" style="padding-right:10px">
|
||||
<a href="addIncomeExpense" class="btn btn-primary" align="right"style="padding-right:10px" >Add New</a>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="box-body">
|
||||
<!-- <form role="form" id="Datewisecashbookreport" action="<?php echo base_url() ?>Datewisecashbookreport" enctype="multipart/form-data" method="post"> -->
|
||||
<form method="post" action="<?php echo base_url($this->uri->uri_string()); ?>">
|
||||
|
||||
<div class="row">
|
||||
|
||||
|
||||
<div class="col-md-12">
|
||||
|
||||
<div class="col-md-3">
|
||||
<b><label for="From Date">From Date:</label></b>
|
||||
<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">
|
||||
<b><label for="To Date">To Date:</label></b>
|
||||
<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-3">
|
||||
|
||||
<b><label for="year">Year:</label></b>
|
||||
|
||||
<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 class="col-md-3">
|
||||
<div style="padding-right:10px;padding-top: 20px;" align="right">
|
||||
|
||||
|
||||
<input type="submit" class="btn btn-success" name="btn_submit" value="View Report">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</form>
|
||||
</div>
|
||||
|
||||
|
||||
<table id="inexlist" class="table table-bordered table-hover" style="background-color:#fff;font-size:12px;">
|
||||
<div align="right" style="padding-right:10px">
|
||||
<div id="content" > </div>
|
||||
<div class="modal fade" role="dialog">
|
||||
|
||||
<thead style="background-color:#ddf">
|
||||
<tr>
|
||||
<th>Account Type</th>
|
||||
<th>DATE</th>
|
||||
<th>Account Name</th>
|
||||
<th>Cash Type</th>
|
||||
<th>Amount</th>
|
||||
<th>Details</th>
|
||||
<th>Action</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody id="inexlistbody">
|
||||
|
||||
<?php if(!empty($list))
|
||||
{
|
||||
$base = base_url();
|
||||
foreach($list as $l)
|
||||
{
|
||||
?>
|
||||
|
||||
<tr>
|
||||
<td><?php echo '<a href="'.$base.'cashbook/incomeExpenseList/'.$l->id.'">'.$l->type.'</a>';?></td>
|
||||
<td style="text-align:right;"><?php echo date_format(date_create($l->date),'d-m-Y');?></td>
|
||||
<td><?php echo $l->name;?></td>
|
||||
<td><?php echo $l->cashtype;?></td>
|
||||
<td style="text-align:right;"><?php echo $l->total;?></td>
|
||||
<td><?php echo $l->description;?></td>
|
||||
<td>
|
||||
<a href="<?php echo base_url(); ?>cashbook/editcashbook?sid=<?php echo $l->id;?>"><i class="fa fa-pencil" data-toggle="tooltip" data-placement="left" title=" Click here to view/Edit the <?php echo $l->type; ?> Details "></i> </a>
|
||||
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<?php
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
|
||||
</tbody>
|
||||
|
||||
</table>
|
||||
|
||||
|
||||
|
||||
<br>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</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 = $('#inexlist').DataTable( {
|
||||
|
||||
"aaSorting": [[ 1, "desc" ]],
|
||||
"autoWidth": false,
|
||||
//"columnDefs" : [{"targets":1, "type":"date-eu"}],
|
||||
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-2'i><'col-md-10'p>>",
|
||||
buttons: [
|
||||
|
||||
// {
|
||||
// extend: 'excelHtml5',
|
||||
// footer: 'true',
|
||||
// messageTop: 'Cashbook Report',
|
||||
// title: $('h3').text(),
|
||||
// exportOptions: {
|
||||
// columns: ':visible'
|
||||
|
||||
// }
|
||||
// },
|
||||
|
||||
// 'colvis'
|
||||
]
|
||||
|
||||
} );
|
||||
} );
|
||||
|
||||
|
||||
// jQuery.extend( jQuery.fn.dataTableExt.oSort, {
|
||||
// "date-uk-pre": function ( a ) {
|
||||
// var ukDatea = a.split('-');
|
||||
// return (ukDatea[2] + ukDatea[1] + ukDatea[0]) * 1;
|
||||
// },
|
||||
|
||||
// "date-uk-asc": function ( a, b ) {
|
||||
// return ((a < b) ? -1 : ((a > b) ? 1 : 0));
|
||||
// },
|
||||
|
||||
// "date-uk-desc": function ( a, b ) {
|
||||
// return ((a < b) ? 1 : ((a > b) ? -1 : 0));
|
||||
// }
|
||||
// } );
|
||||
|
||||
// $('#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 ) );
|
||||
});
|
||||
|
||||
} );
|
||||
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<!-- <script src="https://cdn.datatables.net/plug-ins/1.10.11/sorting/date-eu.js"></script>
|
||||
<script>
|
||||
|
||||
$(function () {
|
||||
|
||||
|
||||
// $('#inexlist').DataTable({
|
||||
// "paging": true,
|
||||
// "lengthChange": true,
|
||||
// "searching": true,
|
||||
// "aaSorting": [[ 0, "desc" ]],
|
||||
// "ordering": true,
|
||||
//
|
||||
// "info": true,
|
||||
// "autoWidth": true
|
||||
|
||||
// });
|
||||
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 ) );
|
||||
});
|
||||
});
|
||||
</script>
|
||||
-->
|
||||
121
application/views/addnewIncomeExpense.php
Executable file → Normal file
121
application/views/addnewIncomeExpense.php
Executable file → Normal file
@ -1,4 +1,4 @@
|
||||
|
||||
<script type="text/javascript" src="<?php echo base_url();?>assets/Autocomplete/jquery.autocomplete.js"></script>
|
||||
<?php //print_r($dropdownvalues);?>
|
||||
<style>
|
||||
|
||||
@ -38,8 +38,13 @@
|
||||
/* border: 1px solid #ccc; */
|
||||
/* border-top: none; */
|
||||
}
|
||||
.autocomplete-suggestion{
|
||||
cursor:pointer;
|
||||
background-color:skyblue;
|
||||
/* background-color: darkgrey; */
|
||||
outline: 1px solid slategrey;
|
||||
}
|
||||
</style>
|
||||
|
||||
<div class="content-wrapper" style="min-height: 537px;">
|
||||
<!-- Content Header (Page header) -->
|
||||
<section class="content-header">
|
||||
@ -247,6 +252,19 @@
|
||||
<input type="text" class="form-control required" id="PaymentPaidto" name="PaymentPaidto" required>
|
||||
</div></div>
|
||||
|
||||
<div class="col-md-3"><div class="form-group">
|
||||
<b><span for="Suppliername">Select Supplier:</span> </b><span style="color:red">*</span></br></br>
|
||||
<select class="form-control select2 required" id="Paymentsupplier" name="Paymentsupplier">
|
||||
<option value="-1">Select Supplier</option>
|
||||
</select>
|
||||
</div></div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<div class="col-md-12">
|
||||
|
||||
<div class="col-md-3"><div class="form-group">
|
||||
<b><span for="PaymentMerchant">Merchant Name:</span></b></br></br>
|
||||
<input type="text" class="form-control required" id="Paymentmerchant" name="Paymentmerchant">
|
||||
@ -256,11 +274,6 @@
|
||||
<b><span for="PaymentMerchantgst">Merchant GST No:</span></b></br></br>
|
||||
<input id="Paymentmerchantgst" name="PaymentMerchantgst" class="form-control">
|
||||
</div></div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<div class="col-md-12">
|
||||
|
||||
<div class="col-md-3"><div class="form-group">
|
||||
<b><span for="Paymentvoucher">Voucher Code</span></b><span style="color:red">*</span></br></br>
|
||||
@ -271,6 +284,10 @@
|
||||
<b><span for="HSN/SAC Code">HSN/SAC Code:</span></b></br></br>
|
||||
<input id="Paymenthsn" name="Paymenthsn" class="form-control" >
|
||||
</div></div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="col-md-12">
|
||||
|
||||
<div class="col-md-3"><div class="form-group">
|
||||
<b><span for="ValuebeforeGST">Value before GST(₹):</span></b><!--<span style="color:red">*</span>--></br></br>
|
||||
@ -281,12 +298,8 @@
|
||||
<b><span for="SGST">SGST(₹):</span></b></br></br>
|
||||
<input type="text" class="form-control" style="text-align:right;" onchange="PaymentGSTvalue(this.id);" id="PaymentSGST" name="PaymentSGST" onkeypress="return isNumberKey(event)">
|
||||
</div> </div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div class="col-md-12">
|
||||
<div class="col-md-3"><div class="form-group">
|
||||
<div class="col-md-3"><div class="form-group">
|
||||
<b><span for="CGST">CGST(₹):</span></b></br></br>
|
||||
<input type="text" class="form-control" id="PaymentCGST" style="text-align:right;" name="PaymentCGST" onkeypress="return isNumberKey(event)" onchange="PaymentGSTvalue(this.id);">
|
||||
</div></div>
|
||||
@ -413,7 +426,7 @@ $('#Recepitaccode').append(options);
|
||||
|
||||
supp = <?php echo json_encode($getsupplier)?>;
|
||||
$.each(supp,function(s,supp){
|
||||
$("#supplier").append( $('<option></option>').val(supp.SupplierID).html(supp.SupplierID+' - '+supp.SupplierName));
|
||||
$("#supplier,#Paymentsupplier").append( $('<option></option>').val(supp.SupplierID).html(supp.SupplierID+' - '+supp.SupplierName));
|
||||
});
|
||||
|
||||
|
||||
@ -438,6 +451,88 @@ $("#PaymentDate").datepicker({
|
||||
|
||||
});
|
||||
|
||||
|
||||
$(document).ready(function()
|
||||
{
|
||||
|
||||
$("#supplier,#Paymentsupplier").select2();
|
||||
|
||||
/**** autocomplete ****/
|
||||
$('#merchant').autocomplete({
|
||||
|
||||
onSearchStart: function (query) {
|
||||
$('#merchant').autocomplete("option", "minLength", 0);
|
||||
},
|
||||
|
||||
serviceUrl: "<?php echo base_url();?>cashbook/autocomplete",
|
||||
onSelect: function (suggestion) {
|
||||
|
||||
var data = suggestion.SupplierName;
|
||||
var selectedvalue = $('input[name=merchant]').val();
|
||||
if(selectedvalue != ' ' )
|
||||
{
|
||||
|
||||
$.ajax({
|
||||
data:{id:selectedvalue},
|
||||
type:"POST",
|
||||
url:"<?php echo base_url();?>cashbook/getSupplierDtls",
|
||||
success:function(data) {
|
||||
var supplier_gstno = '';
|
||||
if(data != '')
|
||||
{
|
||||
|
||||
data = JSON.parse(data);
|
||||
$.each(data,function(i,arr){
|
||||
supplier_gstno = arr.GSTNO;
|
||||
});
|
||||
$("#merchantgst").val(supplier_gstno);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
/**** receipt autocomplete ends here ********/
|
||||
|
||||
|
||||
$('#Paymentmerchant').autocomplete({
|
||||
|
||||
onSearchStart: function (query) {
|
||||
$('#Paymentmerchant').autocomplete("option", "minLength", 0);
|
||||
},
|
||||
|
||||
serviceUrl: "<?php echo base_url();?>cashbook/autocomplete",
|
||||
onSelect: function (suggestion) {
|
||||
|
||||
var data = suggestion.SupplierName;
|
||||
var selectedvalue = $('input[name=Paymentmerchant]').val();
|
||||
if(selectedvalue != ' ' )
|
||||
{
|
||||
|
||||
$.ajax({
|
||||
data:{id:selectedvalue},
|
||||
type:"POST",
|
||||
url:"<?php echo base_url();?>cashbook/getSupplierDtls",
|
||||
success:function(data) {
|
||||
var supplier_gstno = '';
|
||||
if(data != '')
|
||||
{
|
||||
|
||||
data = JSON.parse(data);
|
||||
$.each(data,function(i,arr){
|
||||
supplier_gstno = arr.GSTNO;
|
||||
});
|
||||
$("#Paymentmerchantgst").val(supplier_gstno);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
/**** payment autocomplete ends here ********/
|
||||
|
||||
});
|
||||
function readURL(input,id) {
|
||||
|
||||
//alert(id);
|
||||
|
||||
@ -96,7 +96,7 @@ if(!empty($amountpaid))
|
||||
|
||||
|
||||
<form method="post" action="<?php echo base_url($this->uri->uri_string()); ?>">
|
||||
<center><h3 class="box-title"><p style="color:#3c8dbc"><b>Bank Debit Amount Paid Reports</b></p></h3></center>
|
||||
<center><h3 class="box-title"><p style="color:#5d0411"><b>Bank Debit Amount Paid Reports</b></p></h3></center>
|
||||
<div class="box-body">
|
||||
|
||||
<div class="row">
|
||||
@ -203,19 +203,32 @@ if(!empty($amountpaid))
|
||||
<td align="left" id="btp<?php echo $i ?>"><span><?php echo $ap->Totalpoamount-$ap->Amountpaid?></span></td>
|
||||
<td align="left" id="ap<?php echo $i ?>"><span><?php echo $ap->Amountpaid?></span></td>
|
||||
<?php
|
||||
if($ap->file=='')
|
||||
{
|
||||
?>
|
||||
<td>N/A</td>
|
||||
<?php
|
||||
}
|
||||
else
|
||||
if($ap->file !='')
|
||||
{
|
||||
?>
|
||||
<td> <a target="_blank" href="<?php echo base_url().''.$ap->file ?>" data-toggle="tooltip" data-placement="left" title="Attachment Available for Download/View"><button class="btn btn-info btn-sm">Download</button></a> </td>
|
||||
<?php
|
||||
|
||||
|
||||
<td> <a data-toggle="tooltip"><i class="fa fa-download" data-toggle="tooltip" title="<?php echo $record->pono; ?> -Attachment Available for Download/View" onclick="igrno(<?php echo $i ?>)"></i></a> </td>
|
||||
<?php
|
||||
}
|
||||
|
||||
else if($ap->Fpath !='')
|
||||
{
|
||||
|
||||
|
||||
?>
|
||||
|
||||
<td> <a data-toggle="tooltip"><i class="fa fa-download" data-toggle="tooltip" title="<?php echo $record->pono; ?> -Attachment Available for Download/View" onclick="igrno(<?php echo $i ?>)"></i></a> </td>
|
||||
|
||||
|
||||
<?php
|
||||
} else
|
||||
{ ?>
|
||||
<td>N/A</td>
|
||||
|
||||
|
||||
|
||||
<?php }
|
||||
if($ap->FilePath=='')
|
||||
{
|
||||
?>
|
||||
@ -322,14 +335,15 @@ $.ajax(
|
||||
}
|
||||
function pono(i)
|
||||
{
|
||||
var igrno=$('#igrno'+i).text();
|
||||
var pono=$('#pono'+i).text();
|
||||
$("#Fileshow").modal('show');
|
||||
$.ajax(
|
||||
|
||||
{
|
||||
data:{pono:pono},
|
||||
data:{igrno:igrno,pono:pono},
|
||||
type:"POST",
|
||||
url:"<?php echo base_url() ?>Filelist",
|
||||
url:"<?php echo base_url() ?>cashbook/filelist",
|
||||
success:function(data)
|
||||
{
|
||||
|
||||
@ -418,6 +432,82 @@ $( function() {
|
||||
return date;
|
||||
}
|
||||
} );
|
||||
function igrno(i)
|
||||
{
|
||||
var igrno=$('#igrno'+i).text();
|
||||
var pono =$('#pono'+i).text();
|
||||
$("#Fileshow").modal('show');
|
||||
$.ajax(
|
||||
|
||||
{
|
||||
data:{igrno:igrno,pono:pono},
|
||||
type:"POST",
|
||||
url:"<?php echo base_url() ?>cashbook/IGRFilelist",
|
||||
success:function(data)
|
||||
{
|
||||
|
||||
|
||||
var trHTML = '';
|
||||
var FilePath ='';
|
||||
var Filename = '';
|
||||
var PONO ='';
|
||||
var BillNO ='';
|
||||
i=0;
|
||||
$.each($.parseJSON(data),function (i, item) {
|
||||
|
||||
if(item.file == null)
|
||||
{
|
||||
// if(item.Remarks ==null)
|
||||
// {
|
||||
//alert()
|
||||
PONO =item.PONO;
|
||||
BillNO =item.BillNo;
|
||||
Filename =item.FilePath;
|
||||
FilePath = "<?php echo base_url()?>uploads/Igrfiles/"+item.FilePath;
|
||||
// }
|
||||
// else{
|
||||
// Filename ="BillDetails";
|
||||
// PONO =item.PONO;
|
||||
// BillNO =item.BillNo;
|
||||
// FilePath = item.FilePath;
|
||||
// }
|
||||
|
||||
}else{
|
||||
Filename = item.file;
|
||||
PONO =item.pono;
|
||||
BillNO = '-';
|
||||
|
||||
FilePath =item.file;
|
||||
}
|
||||
|
||||
|
||||
if(Filename != null)
|
||||
{
|
||||
i=i+1;
|
||||
i=i-1;
|
||||
trHTML += '<tr id='+i+'>' +
|
||||
'<td align="right">' + i + '</td>' +
|
||||
'<td id="billno'+i+'">' + BillNO+ '</td>' +
|
||||
'<td>' + PONO+ '</td>' +
|
||||
|
||||
'<td id="file'+i+'"><a target="_blank" href = '+FilePath+'>'+ Filename +'</a></td>' +
|
||||
|
||||
// '<td name="filepathname" id="filepathname" onclick="openbillmodel('+i+');"><i class="fa fa-pencil"></i></td>' +
|
||||
'</tr>';
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
});
|
||||
|
||||
$("#tbleAppend1").empty();
|
||||
$('#Inwardgateregistertable1 > tbody').append(trHTML);
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
|
||||
@ -65,7 +65,7 @@ foreach($financialyear as $item)
|
||||
|
||||
|
||||
<form method="post" action="<?php echo base_url($this->uri->uri_string()); ?>">
|
||||
<center><h3 class="box-title"><p style="color:#3c8dbc"><b>Bank Credit Amount Received Report</b></p></h3></center>
|
||||
<center><h3 class="box-title"><p style="color:#5d0411"><b>Bank Credit Amount Received Report</b></p></h3></center>
|
||||
<div class="box-body">
|
||||
|
||||
<div class="row">
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -83,17 +83,7 @@ foreach($financialyear as $item)
|
||||
|
||||
|
||||
|
||||
<!-- <div style=" ;margin-left:0%;margin-top: -55px;"> -->
|
||||
<!-- <p style="margin-left:25px;" id="bid" value="">Payment ID: </p> -->
|
||||
<!--<p style="margin-left:25px;" id="debit1amount" value="">Total Amount: </p>-->
|
||||
<!-- <p style="margin-left:25px;">Payment Mode: Bank</p>
|
||||
<p style="margin-left:25px;" id="bamount" </p>
|
||||
<p style="margin-left:25px;" id="bdate" value="">Payment Amount Date: </p> -->
|
||||
|
||||
|
||||
<!-- </div> -->
|
||||
<!-- </div> -->
|
||||
|
||||
|
||||
<div class="col-md-3">
|
||||
<label for="from_date">
|
||||
<?php echo 'From Date'; ?>
|
||||
@ -229,39 +219,27 @@ foreach($financialyear as $item)
|
||||
</div>
|
||||
</div><!-- /.box -->
|
||||
</div><!-- /.col -->
|
||||
<div class="row">
|
||||
<div class="row">
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-12" id="date1"></div>
|
||||
<div class="col-md-12" id="HideDateDiv"></div>
|
||||
|
||||
<div class="col-md-12" id="purchaseono"></div>
|
||||
<div class="col-md-12" id="HidePONODiv"></div>
|
||||
|
||||
<div class="col-md-12" id="HideIGRDiv"></div>
|
||||
<div class="col-md-12" id="HideIGRDiv"></div>
|
||||
|
||||
<div class="col-md-12" id="hideigrline"></div>
|
||||
<div class="col-md-12" id="HideIGRLineItem"></div>
|
||||
|
||||
<div class="col-md-12" id="supname"></div>
|
||||
<div class="col-md-12" id="HideSuppDiv"></div>
|
||||
|
||||
<div class="col-md-12" id="aa1"></div>
|
||||
|
||||
<!--<div class="col-md-12" id="aa2"></div>-->
|
||||
<div class="col-md-12" id="HideTtlPoAmtDiv"></div>
|
||||
|
||||
<div class="col-md-12" id="ttamnt"></div>
|
||||
|
||||
<div class="col-md-12" id="totala"></div>
|
||||
<!--<input type="text" name="qw1" id="qw1">-->
|
||||
|
||||
|
||||
|
||||
<input type="hidden" name="Recid" id="Recid" value="">
|
||||
<!-- <input type="hidden" name="bankid" id="bankid" value="">-->
|
||||
<input type="hidden" name="bankamount" id="bankamount" value="">
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="col-md-12" id="HideAmtPaidDiv"></div>
|
||||
|
||||
|
||||
<input type="hidden" name="Recid" id="Recid" value="" readonly>
|
||||
|
||||
<input type="hidden" name="bankamount" id="bankamount" value="" readonly>
|
||||
|
||||
</div>
|
||||
</section>
|
||||
@ -295,356 +273,302 @@ foreach($financialyear as $item)
|
||||
var i;
|
||||
$.each(res1, function( index, value )
|
||||
{
|
||||
var res2 = value.split('-');
|
||||
|
||||
var bid=res2[0];
|
||||
var bam=res2[1];
|
||||
//alert(bid);
|
||||
//alert(bam);
|
||||
$('#bankid').val(bid);
|
||||
document.getElementById("bid").innerHTML='Payment ID:' +bid;
|
||||
});
|
||||
|
||||
//alert(res2);
|
||||
//alert(res[1]);
|
||||
//var text = $('#debitamount').text();
|
||||
|
||||
|
||||
//alert($data['cash']);
|
||||
// $('#debitamount').val('10');
|
||||
table = $('#req').DataTable( {
|
||||
var res2 = value.split('-');
|
||||
var bid=res2[0];
|
||||
var bam=res2[1];
|
||||
|
||||
$('#bankid').val(bid);
|
||||
document.getElementById("bid").innerHTML=bid;
|
||||
});/** foreach closed */
|
||||
$.fn.dataTable.moment( 'DD-MM-YYYY' );
|
||||
table = $('#req').DataTable( {
|
||||
"dom": "<'row'<'col-md-6'l><'col-md-6'Bf>>" +
|
||||
"<'row'<'col-md-6'><'col-md-6'>>" +
|
||||
"<'row'<'col-md-12't>><'row'<'col-md-4'i><'col-md-8'p>>",
|
||||
buttons: [
|
||||
|
||||
{
|
||||
"<'row'<'col-md-6'><'col-md-6'>>" +
|
||||
"<'row'<'col-md-12't>><'row'<'col-md-4'i><'col-md-8'p>>",
|
||||
buttons: [
|
||||
{
|
||||
extend: 'excelHtml5',
|
||||
footer: 'true',
|
||||
messageTop: $('h3').text(),
|
||||
title: 'cashbook Overall Report',
|
||||
exportOptions: {
|
||||
columns: ':visible'
|
||||
|
||||
columns: ':visible'
|
||||
}
|
||||
},
|
||||
|
||||
'colvis'
|
||||
]
|
||||
} );
|
||||
} );
|
||||
} );/** datatable closed */
|
||||
} );/** ready closed */
|
||||
|
||||
var temppo=[]; // temppo - This array for PO with its value.
|
||||
var tempTotal = []; // tempTotal - This array for get value from "temppo" to calculate grandtotal
|
||||
var intex = 1;
|
||||
var row = 0;
|
||||
|
||||
//alert(pono+'array');
|
||||
var temppo=[];
|
||||
var tot=0;
|
||||
var tot1=0;
|
||||
var intex=1;
|
||||
var row=0;
|
||||
var j=1;
|
||||
var addvalue=0;
|
||||
var tott=0;
|
||||
var total=0;
|
||||
function GetPayment(i)
|
||||
{
|
||||
//alert('check');
|
||||
var value=i;
|
||||
|
||||
var bankdebitamount=$('#debitamount').val();
|
||||
var totalvalue=$('#addvalue').val();
|
||||
var balanceamount=bankdebitamount-totalvalue;
|
||||
|
||||
var x = document.getElementById('checkboxcheckbox'+i).checked;
|
||||
var x = document.getElementById('checkboxcheckbox'+i).checked;
|
||||
|
||||
var amount= parseFloat( $('#invoicepaymet'+i).val() == '' ? '0.00' : $('#invoicepaymet'+i).val())
|
||||
//alert(amount+'inv');
|
||||
var negative=0;
|
||||
if(amount<0)
|
||||
{
|
||||
var amount= parseFloat( $('#invoicepaymet'+i).val() == '' ? '0.00' : $('#invoicepaymet'+i).val())
|
||||
|
||||
var negative=0;
|
||||
if(amount<0)
|
||||
{
|
||||
negative=1;
|
||||
alert('Invalid Amount');
|
||||
// $('#invoicepaymet'+i).val('');
|
||||
|
||||
}
|
||||
temp=intex;
|
||||
//alert(temp+'temp');success
|
||||
}
|
||||
|
||||
temp=intex;
|
||||
|
||||
if(x==true)
|
||||
{
|
||||
//alert(x);
|
||||
var bankdebitamount=$('#debitamount').val();
|
||||
var totalvalue=$('#addvalue').val();
|
||||
var balanceamount=bankdebitamount-totalvalue;
|
||||
|
||||
if(bankdebitamount==totalvalue)
|
||||
{
|
||||
//alert('you have remaining'+balanceamount);
|
||||
//alert('your amount is equal to debit amount');
|
||||
$(".checkboxcheckbox").prop("disabled", true);
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
//document.getElementById('checkboxcheckbox'+i).checked = false;
|
||||
('your checkbox is disabled beacause already mapped amount')
|
||||
}
|
||||
|
||||
row= parseInt(row)+1;
|
||||
row = parseInt(row)+1;
|
||||
$('#Rowid').val(row);
|
||||
var date= document.getElementById ( "date"+i ).innerText;
|
||||
var pono =document.getElementById ( "pono"+i ).innerText;
|
||||
var poamount =document.getElementById ( "qw"+i ).innerText;
|
||||
var igrno =document.getElementById ( "igrno"+i ).innerText;
|
||||
var date= document.getElementById ( "date"+i ).innerText;//value taken from table, col name : date
|
||||
var pono =document.getElementById ( "pono"+i ).innerText;//value taken from table, col name : purchase order no
|
||||
var igrno =document.getElementById ( "igrno"+i ).innerText;
|
||||
var igrlineitem=document.getElementById ( "igrlineitem"+i ).innerText;
|
||||
var tta= $('#totala').val();
|
||||
var tempid = "debited"+value;
|
||||
//var credit=parseFloat(document.getElementById(tempid).innerText);
|
||||
var t ="totala"+value;
|
||||
var poamount1 =$(t).val();
|
||||
//alert(poamount1+'amt');
|
||||
var ponovalue = igrlineitem+','+poamount;
|
||||
temppo.push(ponovalue);
|
||||
console.log(temppo);
|
||||
|
||||
|
||||
//console.log(temppo);
|
||||
var supname =document.getElementById ("sn"+i ).innerText;
|
||||
var totalordervalue =document.getElementById ("tov"+i ).innerText;
|
||||
var invoicepayment =document.getElementById ( "qw"+i ).innerText;
|
||||
$('#invoicepaymet'+i).val(invoicepayment);
|
||||
var RowCount= $('#Rowid').val();
|
||||
var supname =document.getElementById ("sn"+i ).innerText;//value taken from table col name : suppliername
|
||||
var totalordervalue =document.getElementById ("tov"+i ).innerText;//value taken from table col name : total po amount
|
||||
var invoicepayment =document.getElementById ( "qw"+i ).innerText;//value taken from table col name : Balance to pay
|
||||
$('#invoicepaymet'+i).val(invoicepayment);//to copy the value from 'balance to pay' to 'amount paid'
|
||||
|
||||
|
||||
$('<input>').attr({
|
||||
type:'hidden',
|
||||
name:'date1'+j,
|
||||
id:'date1'+j,
|
||||
name:'hidedate'+i,
|
||||
id:'hidedate'+i,
|
||||
value:date
|
||||
}).appendTo('#date1');
|
||||
}).appendTo('#HideDateDiv');
|
||||
|
||||
$('<input>').attr({
|
||||
type:'hidden',
|
||||
name:'purchaseono'+j,
|
||||
id:'purchaseono'+j,
|
||||
name:'hidepono'+i,
|
||||
id:'hidepono'+i,
|
||||
value:pono
|
||||
}).appendTo('#purchaseono');
|
||||
}).appendTo('#HidePONODiv');
|
||||
|
||||
$('<input>').attr({
|
||||
type:'hidden',
|
||||
name:'hideigrno'+j,
|
||||
id:'hideigrno'+j,
|
||||
name:'hideigrno'+i,
|
||||
id:'hideigrno'+i,
|
||||
value:igrno
|
||||
}).appendTo('#HideIGRDiv');
|
||||
|
||||
$('<input>').attr({
|
||||
type:'hidden',
|
||||
name:'hideigrline'+j,
|
||||
id:'hideigrline'+j,
|
||||
name:'hideigrline'+i,
|
||||
id:'hideigrline'+i,
|
||||
value:igrlineitem
|
||||
}).appendTo('#hideigrline');
|
||||
}).appendTo('#HideIGRLineItem');
|
||||
|
||||
$('<input>').attr({
|
||||
type:'hidden',
|
||||
name:'supname'+j,
|
||||
id:'supname'+j,
|
||||
name:'hidesupname'+i,
|
||||
id:'hidesupname'+i,
|
||||
value:supname
|
||||
}).appendTo('#supname');
|
||||
}).appendTo('#HideSuppDiv');
|
||||
|
||||
$('<input>').attr({
|
||||
type:'hidden',
|
||||
name:'totala'+j,
|
||||
id:'totala'+j,
|
||||
value:invoicepayment
|
||||
}).appendTo('#totala');
|
||||
|
||||
|
||||
$('<input>').attr({
|
||||
type:'hidden',
|
||||
name:'ttamnt'+j,
|
||||
id:'ttamnt'+j,
|
||||
name:'hidettlPoamt'+i,
|
||||
id:'hidettlPoamt'+i,
|
||||
value:totalordervalue
|
||||
}).appendTo('#ttamnt');
|
||||
}).appendTo('#HideTtlPoAmtDiv');
|
||||
|
||||
|
||||
intex = parseInt(intex)+1;
|
||||
j=parseInt(j)+1;
|
||||
//alert(j+'j');
|
||||
var to=0;
|
||||
for(t=1;t<j;t++)
|
||||
{
|
||||
var total=0;
|
||||
$.each(temppo, function( index, value )
|
||||
{
|
||||
var res2 = value.split(',');
|
||||
|
||||
var pono=res2[0];
|
||||
//alert(pono+'pono');
|
||||
var bam=res2[1];
|
||||
//alert(bam+'bam');
|
||||
total=parseFloat(bam)+parseFloat(total);
|
||||
$('#addvalue').val(parseFloat(total).toFixed(2));
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
$('<input>').attr({
|
||||
type:'hidden',
|
||||
name:'hideamtpaid'+i,
|
||||
id:'hideamtpaid'+i,
|
||||
value:invoicepayment
|
||||
}).appendTo('#HideAmtPaidDiv');
|
||||
|
||||
|
||||
|
||||
var poamount = $('#hideamtpaid'+i).val();
|
||||
var ponovalue = i+','+igrlineitem+','+poamount;
|
||||
temppo.push(ponovalue);
|
||||
//console.log(temppo);
|
||||
|
||||
calculategrandtotal();
|
||||
|
||||
|
||||
// GetAmount(i);
|
||||
intex = parseInt(intex)+1;
|
||||
|
||||
var bankdebitamount=$('#debitamount').val();
|
||||
var totalvalue=$('#addvalue').val();
|
||||
//var balanceamount=bankdebitamount-totalvalue;
|
||||
// alert(bankdebitamount);
|
||||
// alert(totalvalue);
|
||||
|
||||
// if(parseFloat(totalvalue)>=parseFloat(bankdebitamount))
|
||||
// {
|
||||
// alert('your checkbox is disabled beacause already mapped amount');
|
||||
// $(".checkboxcheckbox").prop("disabled", true);
|
||||
// }
|
||||
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
|
||||
//alert(i)
|
||||
var rr= $('#Rowid').val();
|
||||
var ro= parseInt(rr)-1;
|
||||
|
||||
var rr = $('#Rowid').val();
|
||||
row = parseInt(rr)-1;
|
||||
|
||||
var Payment= parseFloat( $('#invoicepaymet'+i).val() == '' ? '0.00' : $('#invoicepaymet'+i).val());
|
||||
var Payment = parseFloat( $('#invoicepaymet'+i).val() == '' ? '0.00' : $('#invoicepaymet'+i).val());
|
||||
|
||||
var Inid = document.getElementById ('igrlineitem'+i ).innerText
|
||||
var ponovalue = Inid+','+Payment;
|
||||
var ponovalue = i+','+Inid+','+Payment;
|
||||
|
||||
$.each(temppo,function(i,val){
|
||||
|
||||
var a = temppo.indexOf(ponovalue);
|
||||
//console.log(a);
|
||||
if(a!=-1)
|
||||
{
|
||||
var b = tempTotal.indexOf(Payment);
|
||||
//console.log(a);
|
||||
if(a != -1){
|
||||
//sconsole.log('if');
|
||||
temppo.splice(a,1);
|
||||
console.log(temppo);
|
||||
//console.log(temppo);
|
||||
}
|
||||
//alert(Inid)
|
||||
for(s=1;s<=j;s++)
|
||||
{
|
||||
// alert(j+'else');
|
||||
var ch= $('#hideigrline'+s).val();
|
||||
if(Inid==ch)
|
||||
{
|
||||
|
||||
var w=s;
|
||||
//alert(w+'w');
|
||||
delamount= $('#totala'+w).val();
|
||||
//break;
|
||||
}
|
||||
if(b!=-1)
|
||||
{
|
||||
tempTotal.splice(ponovalue,1);
|
||||
//console.log(tempTotal);
|
||||
}
|
||||
});
|
||||
|
||||
calculategrandtotal();
|
||||
|
||||
}
|
||||
|
||||
// //alert(w);
|
||||
var tote= $('#addvalue').val();
|
||||
var afterdeltot= parseFloat(tote)- parseFloat(delamount);
|
||||
tot=parseFloat(tot)- parseFloat(Payment);
|
||||
$('#invoicepaymet'+i).val('');
|
||||
$('#addvalue').val(parseFloat(afterdeltot).toFixed(2));
|
||||
|
||||
|
||||
|
||||
//alert(ro);
|
||||
|
||||
$('#Rowid').val(ro);
|
||||
//$('#addvalue').val('');
|
||||
//$('#invoicepaymet'+i).val('');
|
||||
$('#Rowid').val(row);
|
||||
|
||||
$('#invoicepaymet'+i).val('');
|
||||
$('#hidedate'+i).val('');
|
||||
$('#hidepono'+i).val('');
|
||||
$('#hideigrno'+i).val('');
|
||||
$('#hideigrline'+i).val('');
|
||||
$('#date1'+i).val('');
|
||||
$('#purchaseono'+i).val('');
|
||||
$('#supname'+i).val('');
|
||||
$('#ttamnt'+i).val('');
|
||||
$('#totala'+i).val('');
|
||||
//$('#aa'+i).val('');
|
||||
$('#hidesupname'+i).val('');
|
||||
$('#hidettlPoamt'+i).val('');
|
||||
$('#hideamtpaid'+i).val('');
|
||||
|
||||
//$('#invoicepaymet'+i).remove();
|
||||
$('#hidedate'+i).remove();
|
||||
$('#hidepono'+i).remove();
|
||||
$('#hideigrno'+i).remove();
|
||||
$('#hideigrline'+i).remove();
|
||||
$('#hidesupname'+i).remove();
|
||||
$('#hidettlPoamt'+i).remove();
|
||||
$('#hideamtpaid'+i).remove();
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function GetAmount(i)
|
||||
function GetAmount(i)
|
||||
{
|
||||
//alert('text');
|
||||
var amount= parseFloat( $('#invoicepaymet'+i).val() == '' ? '0.00' : $('#invoicepaymet'+i).val())
|
||||
|
||||
//alert("onchnage function getamount"+i);
|
||||
var amount = parseFloat( $('#invoicepaymet'+i).val() == '' ? '0.00' : $('#invoicepaymet'+i).val())
|
||||
|
||||
var negative=0;
|
||||
if(amount<0)
|
||||
{
|
||||
negative=1;
|
||||
alert("Invalid Amount")
|
||||
$('#invoicepaymet'+i).val('');
|
||||
alert("Invalid Amount")
|
||||
$('#invoicepaymet'+i).val('');
|
||||
}
|
||||
var x = document.getElementById('checkboxcheckbox'+i).checked;
|
||||
|
||||
var x = document.getElementById('checkboxcheckbox'+i).checked;
|
||||
|
||||
|
||||
if(x==true )
|
||||
{
|
||||
//alert(x);
|
||||
|
||||
var date= document.getElementById ( "date"+i ).innerText;
|
||||
var pono =document.getElementById ( "pono"+i ).innerText;
|
||||
var igr =document.getElementById ( "igrno"+i ).innerText;
|
||||
var igrlineitem=document.getElementById ( "igrlineitem"+i ).innerText;
|
||||
|
||||
var supname =document.getElementById ("sn"+i ).innerText;
|
||||
var totalordervalue =document.getElementById ("tov"+i ).innerText;
|
||||
var balancetopay=document.getElementById ( "qw"+i ).innerText;
|
||||
var balancetopay =document.getElementById ( "qw"+i ).innerText;
|
||||
|
||||
for(k=1;k<=j-1;k++)
|
||||
for(k=1;k<=i;k++)
|
||||
{
|
||||
//alert(k)
|
||||
var idcheck=$('#hideigrline'+k).val();
|
||||
// alert(idcheck)
|
||||
//alert(k);
|
||||
var idcheck=$('#igrlineitem'+k).val();
|
||||
|
||||
if(igrlineitem==idcheck)
|
||||
if(igrlineitem == idcheck)
|
||||
{
|
||||
var cid=k;
|
||||
//alert(cid+'if');
|
||||
//die();
|
||||
break;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
if(amount<=totalordervalue)
|
||||
if(amount<=balancetopay)//amount paid value is less than or equal to total amount paid value means
|
||||
{
|
||||
//alert(cid+'cid');
|
||||
$('#date1').val(date);
|
||||
$('#hideigrline'+cid).val(igrlineitem);
|
||||
$('#supname'+cid).val(supname);
|
||||
$('#ttamnt'+cid).val(totalordervalue);
|
||||
$('#totala'+cid).val(amount);
|
||||
|
||||
$('#hidedate'+cid).val(date);
|
||||
$('#hidepono'+cid).val(pono);
|
||||
$('#hidesupname'+cid).val(supname);
|
||||
$('#hidettlPoamt'+cid).val(totalordervalue);
|
||||
$('#hideamtpaid'+cid).val(amount);
|
||||
$('#hideigrno'+cid).val(igr);
|
||||
$('#hideigrline'+cid).val(igrlineitem);
|
||||
|
||||
var totalvalue=$('#addvalue').val();
|
||||
var bid=$('#bankid').val();
|
||||
//$('#inv_total'+cid).val(invoicepayment);
|
||||
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
else
|
||||
{
|
||||
alert('You are exceeding the payment get!!');
|
||||
$('#invoicepaymet'+i).val(amount)
|
||||
location.reload();
|
||||
// location.reload();
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
var tot11=0
|
||||
for(l=1;l<j;l++)
|
||||
{
|
||||
var Payingamount=parseFloat( $('#totala'+l).val() == '' ? '0.00' : $('#totala'+l).val());
|
||||
tot11= parseFloat(tot11)+parseFloat(Payingamount);
|
||||
|
||||
$('#addvalue').val(parseFloat(tot11).toFixed(2));
|
||||
}
|
||||
$.each(temppo, function( index, value )
|
||||
{
|
||||
var res2 = value.split(',');
|
||||
if(res2[1] == igrlineitem){
|
||||
|
||||
temppo[index] = i+','+igrlineitem+','+amount;
|
||||
}
|
||||
|
||||
});
|
||||
calculategrandtotal()
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
// else
|
||||
// {
|
||||
// //document.getElementById('checkboxcheckbox'+i).checked = false;
|
||||
// $('#invoicepaymet'+i).val('');
|
||||
// $('#addvalue').val('');
|
||||
// }
|
||||
}
|
||||
|
||||
function Save()
|
||||
{
|
||||
|
||||
|
||||
function calculategrandtotal(){
|
||||
|
||||
$.each(temppo, function( index, value )
|
||||
{
|
||||
var res2 = value.split(',');
|
||||
tempTotal[index]=parseFloat(res2[2]);
|
||||
});
|
||||
|
||||
var sum = 0;
|
||||
|
||||
for (var i = 0; i < tempTotal.length; i++) {
|
||||
sum += tempTotal[i] << 0;
|
||||
}
|
||||
$('#addvalue').val(parseFloat(sum).toFixed(2));
|
||||
// console.log(tempTotal);
|
||||
}
|
||||
function Save()
|
||||
{
|
||||
|
||||
$('#content').loader('show');
|
||||
var rowCount= $('#Rowid').val();
|
||||
@ -652,66 +576,84 @@ function Save()
|
||||
var rw= 0;
|
||||
for(i=1;i<=rowCount;i++)
|
||||
{
|
||||
//alert(i);
|
||||
rw= parseFloat(rw)+1;
|
||||
check = parseFloat(check)+1;
|
||||
var bankdebitamount=$('#debitamount').val();
|
||||
var arrval = temppo[i-1];
|
||||
var number = arrval.split(',');
|
||||
number = number[0];
|
||||
|
||||
rw= parseFloat(rw)+1;
|
||||
|
||||
check = parseFloat(check)+1;
|
||||
var bankdebitamount=$('#debitamount').val();
|
||||
|
||||
var bid =$('#bankid').val();
|
||||
|
||||
|
||||
var date =$('#hidedate'+number).val();
|
||||
|
||||
var bid=$('#bankid').val();
|
||||
var date =$('#date1'+i).val();
|
||||
var pono =$('#purchaseono'+i).val();
|
||||
var igrno =$('#hideigrno'+i).val();
|
||||
var pono =$('#hidepono'+number).val();
|
||||
|
||||
var igrlineitem =$('#hideigrline'+i).val();
|
||||
var suppliername=$('#supname'+i).val();
|
||||
//alert(suppliername);
|
||||
var totalordervalue=$('#ttamnt'+i).val();
|
||||
var amountpaid=$('#totala'+i).val();
|
||||
//alert(amountpaid+'qw1');
|
||||
var invoicepaymet=$('#invoicepaymet'+i).text();
|
||||
// alert(invoicepaymet);
|
||||
var igrno =$('#hideigrno'+number).val();
|
||||
|
||||
|
||||
var igrlineitem =$('#hideigrline'+number).val();
|
||||
|
||||
|
||||
var suppliername=$('#hidesupname'+number).val();
|
||||
|
||||
|
||||
var totalordervalue=$('#hidettlPoamt'+number).val();
|
||||
|
||||
|
||||
var amountpaid=$('#hideamtpaid'+number).val();
|
||||
|
||||
|
||||
var invoicepaymet=$('#invoicepaymet'+number).val();
|
||||
|
||||
|
||||
|
||||
var totalvalue=$('#addvalue').val();
|
||||
//alert(totalvalue);
|
||||
if(totalvalue!=0)
|
||||
{
|
||||
|
||||
|
||||
var payment = parseFloat(amountpaid);
|
||||
|
||||
|
||||
var balnceamount=bankdebitamount-totalvalue;
|
||||
|
||||
|
||||
|
||||
if(parseFloat(bankdebitamount)>=parseFloat(totalvalue))
|
||||
{
|
||||
//alert(date+'date');
|
||||
//die();
|
||||
//alert('you have remainining'+balnceamount);
|
||||
$.ajax(
|
||||
{
|
||||
data:{podate:date,pono:pono,igrno:igrno,igrlineitem:igrlineitem,sname:suppliername,tot:totalordervalue,aa:amountpaid,ip:invoicepaymet,rc:rowCount,tpv:totalvalue,bda:bankdebitamount,bi:bid,check:check,rw:rw},
|
||||
type:"POST",
|
||||
url:"<?php echo base_url() ?>cashbook/receipt",
|
||||
success:function(data)
|
||||
{
|
||||
if(data)
|
||||
{
|
||||
window.location.href ="Bankingstatement";
|
||||
//location.reload();
|
||||
|
||||
$.ajax(
|
||||
{
|
||||
data:{podate:date,pono:pono,igrno:igrno,igrlineitem:igrlineitem,sname:suppliername,tot:totalordervalue,aa:invoicepaymet,rc:rowCount,tpv:totalvalue,bda:bankdebitamount,bi:bid,check:check,rw:rw},
|
||||
type:"POST",
|
||||
url:"<?php echo base_url() ?>cashbook/receipt",
|
||||
success:function(data)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
});
|
||||
if(data)
|
||||
{
|
||||
//$('#content').loader('hide');
|
||||
//alert(data);
|
||||
window.location.href ="Bankingstatement";
|
||||
//location.reload();
|
||||
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
else{
|
||||
|
||||
alert('You are payment exceeding');
|
||||
alert('Your payment exceeding ');
|
||||
location.reload();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function isNumberKey(evt)
|
||||
{
|
||||
|
||||
@ -279,31 +279,36 @@
|
||||
<!--<a target="_blank" href="<?php echo base_url().'uploads/BillFiles/'?><?php echo $rel->file ?>"-->
|
||||
<td align="left" id="sn<?php echo $i ?>"><span><?php echo $ap->Suppliername?></span></td>
|
||||
<td align="left" id="tov<?php echo $i ?>"><span><?php echo $ap->Totalpoamount?></span></td>
|
||||
<td align="left" id="aa<?php echo $i ?>"><span><?php echo $ap->Totalpoamount-$ap->Amountpaid?></span></td>
|
||||
<td align="left" id="aa<?php echo $i ?>"><span><?php echo $ap->Balancetopay?></span></td>
|
||||
<td align="left" id="aa<?php echo $i ?>"><span><?php echo $ap->Amountpaid?></span></td>
|
||||
<?php
|
||||
if($ap->file=='')
|
||||
{
|
||||
?>
|
||||
<td>No File</td>
|
||||
<?php
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
|
||||
|
||||
?>
|
||||
|
||||
<td><a target="_blank" href="<?php echo base_url().''.$ap->file ?>" data-toggle="tooltip" data-placement="left" title="Attachment Available for Download/View"><button class="btn btn-info btn-sm">Download</button></a> </td>
|
||||
|
||||
|
||||
<?php
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
<?php
|
||||
if($ap->file !='')
|
||||
{
|
||||
?>
|
||||
|
||||
|
||||
<td> <a data-toggle="tooltip"><i class="fa fa-download" data-toggle="tooltip" title="<?php echo $record->pono; ?> -Attachment Available for Download/View" onclick="igrno(<?php echo $i ?>)"></i></a> </td>
|
||||
<?php
|
||||
}
|
||||
|
||||
else if($ap->Fpath !='')
|
||||
{
|
||||
|
||||
|
||||
?>
|
||||
|
||||
<td> <a data-toggle="tooltip"><i class="fa fa-download" data-toggle="tooltip" title="<?php echo $record->pono; ?> -Attachment Available for Download/View" onclick="igrno(<?php echo $i ?>)"></i></a> </td>
|
||||
|
||||
|
||||
<?php
|
||||
} else
|
||||
{ ?>
|
||||
<td>N/A</td>
|
||||
|
||||
|
||||
|
||||
<?php }
|
||||
|
||||
if($ap->FilePath=='')
|
||||
{
|
||||
?>
|
||||
@ -317,7 +322,7 @@
|
||||
|
||||
?>
|
||||
<td>
|
||||
<a data-toggle="tooltip" ><i class="fa fa-download" data-toggle="tooltip" title="<?php echo $record->pono; ?> - Click here to Delete details" onclick="pono(<?php echo $i ?>)"></i> </a>
|
||||
<a data-toggle="tooltip" ><i class="fa fa-download" data-toggle="tooltip" title="<?php echo $record->pono; ?> - Attachment Available for Download/view" onclick="pono(<?php echo $i ?>)"></i> </a>
|
||||
</td>
|
||||
|
||||
<!--<td> <button type="button" class="btn btn-info btn-sm" data-toggle="modal" data-target="#myModal">Download</button></td>-->
|
||||
@ -473,14 +478,15 @@
|
||||
|
||||
function pono(i)
|
||||
{
|
||||
var igrno=$('#igrno'+i).text();
|
||||
var pono=$('#pono'+i).text();
|
||||
$("#Fileshow").modal('show');
|
||||
$.ajax(
|
||||
|
||||
{
|
||||
data:{pono:pono},
|
||||
data:{igrno:igrno,pono:pono},
|
||||
type:"POST",
|
||||
url:"<?php echo base_url() ?>Filelist",
|
||||
url:"<?php echo base_url() ?>cashbook/filelist",
|
||||
success:function(data)
|
||||
{
|
||||
|
||||
@ -531,6 +537,81 @@ function pono(i)
|
||||
]
|
||||
} );
|
||||
} );
|
||||
|
||||
function igrno(i)
|
||||
{
|
||||
var igrno=$('#igrno'+i).text();
|
||||
var pono =$('#pono'+i).text();
|
||||
$("#Fileshow").modal('show');
|
||||
$.ajax(
|
||||
|
||||
{
|
||||
data:{igrno:igrno,pono:pono},
|
||||
type:"POST",
|
||||
url:"<?php echo base_url() ?>cashbook/IGRFilelist",
|
||||
success:function(data)
|
||||
{
|
||||
|
||||
|
||||
var trHTML = '';
|
||||
var FilePath ='';
|
||||
var Filename = '';
|
||||
var PONO ='';
|
||||
var BillNO ='';
|
||||
|
||||
$.each($.parseJSON(data),function (i, item) {
|
||||
|
||||
if(item.file == null)
|
||||
{
|
||||
// if(item.Remarks ==null)
|
||||
// {
|
||||
//alert()
|
||||
PONO =item.PONO;
|
||||
BillNO =item.BillNo;
|
||||
Filename =item.FilePath;
|
||||
FilePath = "<?php echo base_url()?>uploads/Igrfiles/"+item.FilePath;
|
||||
// }else{
|
||||
// Filename ="BillDetails";
|
||||
// PONO =item.PONO;
|
||||
// BillNO =item.BillNo;
|
||||
// FilePath = item.FilePath;
|
||||
// }
|
||||
|
||||
}else{
|
||||
Filename = item.file;
|
||||
PONO =item.pono;
|
||||
BillNO = '-';
|
||||
|
||||
FilePath =item.file;
|
||||
}
|
||||
|
||||
|
||||
if(Filename != null)
|
||||
{
|
||||
i=i+1;
|
||||
i=i-1;
|
||||
trHTML += '<tr id='+i+'>' +
|
||||
'<td align="right">' + i + '</td>' +
|
||||
'<td id="billno'+i+'">' + BillNO+ '</td>' +
|
||||
'<td>' + PONO+ '</td>' +
|
||||
|
||||
'<td id="file'+i+'"><a target="_blank" href = '+FilePath+'>'+ Filename +'</a></td>' +
|
||||
|
||||
// '<td name="filepathname" id="filepathname" onclick="openbillmodel('+i+');"><i class="fa fa-pencil"></i></td>' +
|
||||
'</tr>';
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
});
|
||||
|
||||
$("#tbleAppend1").empty();
|
||||
$('#Inwardgateregistertable1 > tbody').append(trHTML);
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
169
application/views/editincomeexpenses.php
Executable file → Normal file
169
application/views/editincomeexpenses.php
Executable file → Normal file
@ -29,8 +29,17 @@ if(!empty($RecepitPayment))
|
||||
{
|
||||
$document =$rd->document;
|
||||
$final = base_url().$document;
|
||||
$bankamount=$rd->totalbankamount;
|
||||
$bankid=$rd->ID;
|
||||
$normalid=$rd->id;
|
||||
$accountcode1=$rd->account_code;
|
||||
$id=$rd->id;
|
||||
$amounttype=$rd->amounttype;
|
||||
$alreadypaid=$rd->Clearbalance;
|
||||
$alreadyreceived=$rd->cclearbalance;
|
||||
//echo $alreadypaid;
|
||||
//echo $alreadyreceived;
|
||||
$typeofmap=$rd->cashtype;
|
||||
$type1=$rd->type;
|
||||
$viewdep=$rd->total;
|
||||
$dropdown=$rd->name;
|
||||
@ -116,6 +125,21 @@ if(!empty($PaymentMultiple))
|
||||
<form role="form" id="updateReceipt" action="<?php echo base_url() ?>cashbook/updateReceipt" enctype="multipart/form-data" method="post">
|
||||
|
||||
<div class="box-body">
|
||||
|
||||
<div id="detail">
|
||||
<div class="row">
|
||||
<div class="col-md-4 col-md-offset-8" style="padding-left: 109px;">
|
||||
<div style=" border: 2px solid black;margin-left:0%;margin-top: -5px;font-size:14px;background-color:#ccc;">
|
||||
<!-- <p style="margin-left:62px;padding-top:30px;">Payment ID: <b><?php echo $bankid;?></b></p> -->
|
||||
<center><b><p id="bankid">Payment ID: <b><?php echo $bankid;?><b></p></b></center>
|
||||
<p style="margin-left:20px;">Total Amount: <b><?php echo $bankamount; ?></b>Rs</p>
|
||||
<p style="margin-left:20px;">Payment Mode: <b>Bank</b></p>
|
||||
<p style="margin-left:20px;" id="rembalance">Remaining Balance: <b><?php echo $balancetoupdate; ?></b>Rs</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<!-- <div class="col-md-3">
|
||||
@ -140,7 +164,15 @@ if(!empty($PaymentMultiple))
|
||||
<div class="col-md-3"><div class="form-group"><b>
|
||||
<span for="towhome" id="towhom">Recevied From</span></b><span style="color:red">*</span></br></br>
|
||||
<input type="text" class="form-control required" id="towhome" name="towhome" value="<?php echo $towhom1; ?>">
|
||||
</div></div>
|
||||
</div></div>
|
||||
|
||||
<div class="col-md-3"><div class="form-group">
|
||||
<b><span for="Suppliername">Select Supplier:</span> </b><span style="color:red">*</span></br></br>
|
||||
<select class="form-control select2 required" id="supplier" name="supplier">
|
||||
<option value="-1">Select Supplier</option>
|
||||
</select>
|
||||
</div></div>
|
||||
|
||||
</div><!-- row -->
|
||||
</div><!-- 12-md-->
|
||||
<div class="row">
|
||||
@ -260,6 +292,20 @@ if(!empty($PaymentMultiple))
|
||||
</div>-->
|
||||
<form role="form" id="updatePayment" action="<?php echo base_url() ?>cashbook/updatePayment" enctype="multipart/form-data" method="post">
|
||||
<div class="box-body">
|
||||
<div id="detail">
|
||||
<div class="row">
|
||||
<div class="col-md-4 col-md-offset-8" style="padding-left: 109px;">
|
||||
<div style=" border: 2px solid black;margin-left:0%;margin-top: -5px;font-size:14px;background-color:#ccc;">
|
||||
<!-- <p style="margin-left:62px;padding-top:30px;">Payment ID: <b><?php echo $bankid;?></b></p> -->
|
||||
<center><b><p id="bankid">Payment ID: <b><?php echo $bankid;?><b></p></b></center>
|
||||
<p style="margin-left:20px;">Total Amount: <b><?php echo $bankamount; ?></b>Rs</p>
|
||||
<p style="margin-left:20px;">Payment Mode: <b>Bank</b></p>
|
||||
<p style="margin-left:20px;" id="rembalance">Remaining Balance: <b><?php echo $balancetoupdate; ?></b>Rs</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
|
||||
@ -272,6 +318,17 @@ if(!empty($PaymentMultiple))
|
||||
<b><span for="PaymentPaidto">Paid To:</span></b><span style="color:red">*</span></br></br>
|
||||
<input type="text" class="form-control required" id="PaymentPaidto" name="PaymentPaidto" value="<?php echo $towhom1; ?>">
|
||||
</div></div>
|
||||
|
||||
<div class="col-md-3"><div class="form-group">
|
||||
<b><span for="Suppliername">Select Supplier:</span> </b><span style="color:red">*</span></br></br>
|
||||
<select class="form-control select2" id="Paymentsupplier" name="Paymentsupplier">
|
||||
<option value="-1">Select Supplier</option>
|
||||
</select>
|
||||
</div></div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="col-md-12">
|
||||
|
||||
<div class="col-md-3"><div class="form-group">
|
||||
<b><span for="PaymentMerchant">Merchant Name:</span></b></br></br>
|
||||
@ -283,10 +340,7 @@ if(!empty($PaymentMultiple))
|
||||
<input id="Paymentmerchantgst" name="PaymentMerchantgst" class="form-control" value="<?php echo $MerchantGST1 ; ?>">
|
||||
</div></div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<div class="col-md-12">
|
||||
<div class="col-md-3"><div class="form-group">
|
||||
<b><span for="Paymentvoucher">Voucher Code:</span></b><span style="color:red">*</span></br></br>
|
||||
<input id="Paymentvouchercode" name="Paymentvouchercode" value="<?php echo $invoiceno1; ?>" class="form-control" required onkeypress="return isNumberKey(event)" >
|
||||
@ -297,6 +351,12 @@ if(!empty($PaymentMultiple))
|
||||
<input id="Paymenthsn" name="Paymenthsn" class="form-control" value="<?php echo $HSNSAC1; ?>">
|
||||
</div></div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div class="col-md-12">
|
||||
|
||||
<div class="col-md-3"><div class="form-group">
|
||||
<b><span for="ValuebeforeGST">Value before GST(₹):</span></b><!--<span style="color:red">*</span>--></br></br>
|
||||
<input id="PaymentvaluebeforegST" name="PaymentvaluebeforegST" style="text-align:right;" class="form-control" onkeypress="return isNumberKey(event)" value="<?php echo $valuebeforegst1; ?>" readonly>
|
||||
@ -306,11 +366,7 @@ if(!empty($PaymentMultiple))
|
||||
<b><span for="SGST">SGST(₹):</span><span style="color:red">*</span></b></br></br>
|
||||
<input type="text" class="form-control" style="text-align:right;" onchange="PaymentGSTvalue(this.id)" id="PaymentSGST" name="PaymentSGST" onkeypress="return isNumberKey(event)" value="<?php echo $SGST1; ?>">
|
||||
</div> </div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div class="col-md-12">
|
||||
<div class="col-md-3"><div class="form-group">
|
||||
<b><span for="CGST">CGST(₹):</span><span style="color:red">*</span></b></br></br>
|
||||
<input type="text" class="form-control" id="PaymentCGST" style="text-align:right;" name="PaymentCGST" onkeypress="return isNumberKey(event)" onchange="PaymentGSTvalue(this.id)" value="<?php echo $CGST1; ?>">
|
||||
@ -488,7 +544,18 @@ if(!empty($PaymentMultiple))
|
||||
//var drop=$("input[type=radio][name='range']:checked").val()
|
||||
|
||||
$(document).ready(function(){
|
||||
$("#supplier").select2();
|
||||
var typeofmap = "<?php echo $typeofmap;?>";
|
||||
//alert(typeofmap+'tom');
|
||||
if(typeofmap=='Cash')
|
||||
|
||||
{
|
||||
$('#detail').hide();
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
$('#detail').show();
|
||||
}
|
||||
var type = "<?php echo $type1;?>";
|
||||
//alert(type);
|
||||
if(type == "RECEIPT")
|
||||
@ -503,6 +570,86 @@ $(document).ready(function(){
|
||||
$('#myradio2').attr('checked','true');
|
||||
$('#towhom').text('Paid To:');
|
||||
}
|
||||
|
||||
|
||||
$("#supplier,#Paymentsupplier").select2();
|
||||
|
||||
/**** autocomplete ****/
|
||||
$('#merchant').autocomplete({
|
||||
|
||||
onSearchStart: function (query) {
|
||||
$('#merchant').autocomplete("option", "minLength", 0);
|
||||
},
|
||||
|
||||
serviceUrl: "<?php echo base_url();?>cashbook/autocomplete",
|
||||
onSelect: function (suggestion) {
|
||||
|
||||
var data = suggestion.SupplierName;
|
||||
var selectedvalue = $('input[name=merchant]').val();
|
||||
if(selectedvalue != ' ' )
|
||||
{
|
||||
|
||||
$.ajax({
|
||||
data:{id:selectedvalue},
|
||||
type:"POST",
|
||||
url:"<?php echo base_url();?>cashbook/getSupplierDtls",
|
||||
success:function(data) {
|
||||
var supplier_gstno = '';
|
||||
if(data != '')
|
||||
{
|
||||
|
||||
data = JSON.parse(data);
|
||||
$.each(data,function(i,arr){
|
||||
supplier_gstno = arr.GSTNO;
|
||||
});
|
||||
$("#merchantgst").val(supplier_gstno);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
/**** receipt autocomplete ends here ********/
|
||||
|
||||
|
||||
$('#Paymentmerchant').autocomplete({
|
||||
|
||||
onSearchStart: function (query) {
|
||||
$('#Paymentmerchant').autocomplete("option", "minLength", 0);
|
||||
},
|
||||
|
||||
serviceUrl: "<?php echo base_url();?>cashbook/autocomplete",
|
||||
onSelect: function (suggestion) {
|
||||
|
||||
var data = suggestion.SupplierName;
|
||||
var selectedvalue = $('input[name=Paymentmerchant]').val();
|
||||
if(selectedvalue != ' ' )
|
||||
{
|
||||
|
||||
$.ajax({
|
||||
data:{id:selectedvalue},
|
||||
type:"POST",
|
||||
url:"<?php echo base_url();?>cashbook/getSupplierDtls",
|
||||
success:function(data) {
|
||||
var supplier_gstno = '';
|
||||
if(data != '')
|
||||
{
|
||||
|
||||
data = JSON.parse(data);
|
||||
$.each(data,function(i,arr){
|
||||
supplier_gstno = arr.GSTNO;
|
||||
});
|
||||
$("#Paymentmerchantgst").val(supplier_gstno);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
/**** payment autocomplete ends here ********/
|
||||
|
||||
|
||||
});
|
||||
|
||||
|
||||
@ -524,10 +671,12 @@ $(function() {
|
||||
|
||||
supp = <?php echo json_encode($getsupplier)?>;
|
||||
$.each(supp,function(s,supp){
|
||||
$("#supplier").append( $('<option></option>').val(supp.SupplierID).html(supp.SupplierID+' - '+supp.SupplierName));
|
||||
$("#supplier,#Paymentsupplier").append( $('<option></option>').val(supp.SupplierID).html(supp.SupplierID+' - '+supp.SupplierName));
|
||||
});
|
||||
|
||||
$('#supplier option[value="<?php echo $supplier?>"]').prop('selected', true);
|
||||
$('#Paymentsupplier option[value="<?php echo $supplier?>"]').prop('selected', true);
|
||||
|
||||
|
||||
|
||||
if('<?php echo $accountcode1 ?>' != '999'){
|
||||
|
||||
2
application/views/income_expense_list.php
Executable file → Normal file
2
application/views/income_expense_list.php
Executable file → Normal file
@ -90,6 +90,7 @@
|
||||
<th>Account Type</th>
|
||||
<th>DATE</th>
|
||||
<th>Account Name</th>
|
||||
<th>Cash Type</th>
|
||||
<th>Amount(₹)</th>
|
||||
<th>Details</th>
|
||||
<th>Action</th>
|
||||
@ -108,6 +109,7 @@
|
||||
<td><?php echo '<a href="'.$base.'cashbook/incomeExpenseList/'.$l->id.'">'.$l->type.'</a>';?></td>
|
||||
<td style="text-align:right;"><?php echo date_format(date_create($l->date),'d-m-Y');?></td>
|
||||
<td><?php if($l->type == 'PAYMENT' && $l->account_code == '999') { echo $l->description; } else {echo $l->name;}?></td>
|
||||
<td><?php echo $l->cashtype;?></td>
|
||||
<td style="text-align:right;"><?php echo $l->total;?></td>
|
||||
<td><?php echo $l->description;?></td>
|
||||
<td>
|
||||
|
||||
@ -80,24 +80,24 @@
|
||||
{ $index = 0;
|
||||
foreach($IGR as $record)
|
||||
{
|
||||
// print_r($record);
|
||||
//print_r($record);
|
||||
$index = $index +1;
|
||||
|
||||
?>
|
||||
<tr id="<?php echo $index ?>" >
|
||||
<!-- <td style="text-align: center;"><?php echo $index?></td> -->
|
||||
<td><a data-toggle="modal" data-target="#Igrshow" data-id="<%=index%>" data-userid="<?php echo $record->IGRNO.",".$record->IGRItemNo ?>" > <u><?php echo $record->IGRNO ?></u></a></td>
|
||||
<!-- <td><a data-toggle="modal" data-target="#Igrshow" data-id=""<%=index%>" data-userid="<?php echo $record->IGRNO ?>" > <u><?php echo $record->IGRNO ?></u></a></td>-->
|
||||
|
||||
<td><a data-toggle="modal" data-target="#Igrshow" data-id="<%=index%>" data-userid="<?php echo $record->IGRNO ?>" > <u><?php echo $record->IGRNO ?></u></a></td>
|
||||
|
||||
<td><?php echo $record->PONO ?></a></td>
|
||||
<td><?php echo $record->SupplierName ?></td>
|
||||
<td><?php echo $record->DeliveryChellanOrInvoiceNo ?></td>
|
||||
<td align="right"><?php
|
||||
$date = new DateTime($record->DeliveryChellanDate);
|
||||
echo $date->format('d-m-Y'); ?></td>
|
||||
<!-- <td><span data-toggle="tooltip" title="Quantity as per Invoice"><?php echo $record->Quantity ?></span></td> -->
|
||||
|
||||
<td><?php echo $record->MaterialName ?></td>
|
||||
<td><span data-toggle="tooltip" title="Quantity as per Received"><?php echo $record->QuantityAsPerInvoice ?></span></td>
|
||||
<!-- <td><span data-toggle="tooltip" title="Quantity as per Received"><?php echo $record->QuantityAsPerInvoice."/".$record->Quantity ?></span></td>-->
|
||||
|
||||
<td><?php echo $record->VehicleNo ?></td>
|
||||
<td><?php echo $record->CourierNo ?></td>
|
||||
<td>
|
||||
@ -468,49 +468,17 @@ function filecheck()
|
||||
}
|
||||
|
||||
$(document).ready(function() {
|
||||
// // buttons: [ {name: 'copy', extend: 'copy', exportOptions: {columns: ':gt(0)', orthogonal: 'export'}} ]
|
||||
// table = $('#Inwardgateregistertable').DataTable( {
|
||||
// "dom": "<'row'<'col-md-6'l><'col-md-6'Bf>>" +
|
||||
// "<'row'<'col-md-3'><'col-md-6'>>" +
|
||||
// "<'row'<'col-md-12't>><'row'<'col-md-4'i><'col-md-8'p>>",
|
||||
// "lengthMenu": [ 25, 50, 75, 100 ], buttons: {
|
||||
// extend: 'excelHtml5',
|
||||
// footer: 'true',
|
||||
// //messageTop: $('h3').text(),
|
||||
// title: $('h3').text(),
|
||||
// exportOptions: {
|
||||
// //columns: ':lt(13)', orthogonal: 'export'
|
||||
// columns: ':visible'}
|
||||
// },
|
||||
|
||||
// ]
|
||||
|
||||
// } );
|
||||
// } );
|
||||
// $(function () {
|
||||
// $('#Inwardgateregistertable').DataTable({
|
||||
// "paging": true,
|
||||
// "lengthChange": true,
|
||||
// "searching": true,
|
||||
// "ordering": true,
|
||||
// "info": true,
|
||||
// "autoWidth": true
|
||||
|
||||
// });
|
||||
// });
|
||||
$("#Fileshow").on("shown.bs.modal",function(e) {
|
||||
//var id = $(this).attr('id');
|
||||
|
||||
var id = $(e.relatedTarget).data('userid');
|
||||
//swal(id);
|
||||
|
||||
// SIA/2018-2019/10243.01
|
||||
// IGRNO0505
|
||||
|
||||
var igr = id.substring(0, 9);
|
||||
|
||||
// alert(igr);
|
||||
var po = id.substring(10, 33);
|
||||
|
||||
//alert(po);
|
||||
|
||||
$("#hiddenIGRNO").val(igr);
|
||||
$("#hiddenPONO").val(po);
|
||||
@ -538,14 +506,16 @@ $("#hiddenPONO").val(po);
|
||||
$.each(JSON.parse(file), function (i, item)
|
||||
{
|
||||
if(item.file == null)
|
||||
{ if(item.Remarks ==null)
|
||||
{
|
||||
{
|
||||
// if(item.Remarks ==null)
|
||||
// {
|
||||
//alert()
|
||||
PONO =item.PONO;
|
||||
BillNO =item.BillNo;
|
||||
Filename =item.FilePath;
|
||||
FilePath = "<?php echo base_url()?>uploads/Igrfiles/"+item.FilePath;
|
||||
// }else{
|
||||
//}
|
||||
// else{
|
||||
// Filename ="BillDetails";
|
||||
// PONO =item.PONO;
|
||||
// BillNO =item.BillNo;
|
||||
@ -573,7 +543,7 @@ $("#hiddenPONO").val(po);
|
||||
'</tr>';
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
});
|
||||
$("#tblefile").empty();
|
||||
|
||||
@ -593,6 +563,7 @@ $("#hiddenPONO").val(po);
|
||||
|
||||
|
||||
|
||||
|
||||
function openbillmodel(i){
|
||||
|
||||
// alert(i);
|
||||
@ -633,14 +604,16 @@ $("#hiddenPONO").val(po);
|
||||
});
|
||||
});
|
||||
</script>
|
||||
<script>
|
||||
|
||||
|
||||
|
||||
<script>
|
||||
|
||||
$("#Igrshow").on("shown.bs.modal", function(e) {
|
||||
//var igr = $(e.relatedTarget).data('userid');
|
||||
var igr_nos = $(e.relatedTarget).data('id');
|
||||
var igr = igr_nos.split(',');
|
||||
igr = igr[1];
|
||||
var igr = $(e.relatedTarget).data('userid');
|
||||
// alert(igr);
|
||||
|
||||
|
||||
//alert(igr_nos+igr);
|
||||
$('#content').loader('show');
|
||||
$.ajax({
|
||||
data:{id:igr},
|
||||
@ -652,12 +625,11 @@ $("#Igrshow").on("shown.bs.modal", function(e) {
|
||||
$('#content').loader('hide');
|
||||
var trHTML = '';
|
||||
$.each(JSON.parse(data), function (i, item) {
|
||||
//alert(igr + item.IGRNO);
|
||||
//if(igr == item.IGRNO)
|
||||
if(igr == item.IGRItemNo)
|
||||
if(igr == item.IGRNO)
|
||||
{
|
||||
|
||||
$("#IGRNO1").val(item.IGRNO);
|
||||
$("#IGRNO1").val(item.IGRNO);
|
||||
|
||||
$("#PONo").val(item.PONO);
|
||||
$("#Supplier").val(item.SupplierName);
|
||||
$("#Add1").val(item.Address);
|
||||
@ -697,8 +669,8 @@ $("#Igrshow").on("shown.bs.modal", function(e) {
|
||||
});
|
||||
});
|
||||
|
||||
</script>
|
||||
|
||||
</script>
|
||||
|
||||
<script>
|
||||
|
||||
@ -717,12 +689,13 @@ counter++;
|
||||
|
||||
var bil_count = +counter+ +file_count;
|
||||
|
||||
// alert(bil_count);
|
||||
// alert(file_count);
|
||||
if(bil_count>=6){
|
||||
//swal(bil_count);
|
||||
//swal(file_count);
|
||||
|
||||
if(bil_count>6){
|
||||
|
||||
swal("You have to upload five files only");//this allows only 5 files;
|
||||
$('#addmorebutton').hide();
|
||||
//$('#addmorebutton').hide();
|
||||
|
||||
return false;
|
||||
}
|
||||
@ -736,17 +709,12 @@ counter++;
|
||||
div.className="row";
|
||||
//alert(counter);
|
||||
div.innerHTML='<div class="col-md-12">'+
|
||||
// '<div class="col-md-3">'+
|
||||
// '<label>File Name</label>'+
|
||||
// '<input type="text" id="maint_filename'+counterConstant+'" name="filename'+counterConstant+'" class="form-control" onkeypress="return false;" readonly/>'+
|
||||
// '</div>'+
|
||||
|
||||
'<div class="col-md-3">'+
|
||||
'<label><br></label>'+
|
||||
'<input type="file" name="browseFiles" id="images'+counter+'" ><br>'+
|
||||
'</div>'+
|
||||
// '<div class="col-md-3">'
|
||||
// '<label><br><br></label>'+
|
||||
// '<button class="btn btn-danger remove remove_this" id="removebtn'+counterConstant+'" onclick="removeRow(this.id)"><i class="fa fa-trash"></i> Remove</button></div>'+
|
||||
|
||||
'<div class="col-md-2">'+
|
||||
'<label><br><br></label>'+
|
||||
'<button class="btn btn-primary" type ="button" id="addbtn" onclick="addRow()">ADD</button></div>'+
|
||||
@ -777,7 +745,7 @@ counter++;
|
||||
|
||||
if (file == '')
|
||||
{
|
||||
alert('File not found');
|
||||
swal('File not found');
|
||||
|
||||
}
|
||||
else {
|
||||
@ -785,29 +753,7 @@ counter++;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
// function Copyfilename(id)
|
||||
// {
|
||||
// var size = $('input[name='+id+']')[0].files[0].size;
|
||||
|
||||
// var number = id.replace(/[^0-9]+/ig,"");
|
||||
// if(size > 2100000){
|
||||
// //alert(id);
|
||||
// alert('Sorry Your File is Large To 2MB');
|
||||
// removeRow(id);
|
||||
// //$('input[name = browseFiles'+number+']').val(' ');
|
||||
// }else {
|
||||
// var name = $('input[name='+id+']')[0].files[0].name;
|
||||
// //alert(name);
|
||||
// $("#maint_filename"+number).val(name);
|
||||
// }
|
||||
// }
|
||||
|
||||
|
||||
|
||||
|
||||
function fileupload(counter)
|
||||
function fileupload(counter)
|
||||
{
|
||||
//alert(counter);
|
||||
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Loading…
Reference in New Issue
Block a user