+ +
diff --git a/application/config/routes.php b/application/config/routes.php
index ad3bfe77..cf9d9df0 100644
--- a/application/config/routes.php
+++ b/application/config/routes.php
@@ -210,7 +210,7 @@ $route['ServicePOBilling'] = "servicepurchaseorder/viewServicePOReportForBilling
//<------------Cash book Routes-------------------->
$route['ViewIncomeExpense'] = "cashbook/incomeExpenseList";
-$route['addNewIncomeExpense'] = "cashbook/addNewIncomeExpenseLoad";
+//$route['addNewIncomeExpense'] = "cashbook/addNewIncomeExpenseLoad";
$route['addIncomeExpense'] = "cashbook/addIncomeExpense";
// permission slip//
diff --git a/application/controllers/cashbook.php b/application/controllers/cashbook.php
index a7ee166a..bf61f154 100755
--- a/application/controllers/cashbook.php
+++ b/application/controllers/cashbook.php
@@ -32,46 +32,46 @@ class cashbook extends BaseController
$aid = $this->uri->segment(3);
$str = $this->uri->segment(4);
- if(!empty($aid)){
+ if(!empty($aid)){
- if(!empty($str))
- {
-
- $data['company'] = $this->cashbook_model->getCompany();
-
- $data['data'] = $this->cashbook_model->getIncomeExpenseList($aid);
- $totalamt = $data['data'][0]->total;
- $data['amtinwords'] = $this->convertNumber($totalamt);
- $mpdf=new mPDF('utf-8','A4-P',7, 10,10, 10, 3, 0, 0, 0);
- $mpdf->SetHTMLHeader($HtmlHeading);
- $html = $this->load->view('cashbookpdf',$data,true);
- $mpdf->SetDisplayMode('fullpage');
- $mpdf->setFooter($HTMLFooter . "Page {PAGENO} of {nb}");
- $mpdf->list_indent_first_level = 1;
- $mpdf->setAutoTopMargin = 'stretch';
- $mpdf->setAutoBottomMargin = 'stretch';
- $mpdf->WriteHTML($html);
- $filename = "cashbook.pdf";
- $mpdf->Output($filename,I);
+ if(!empty($str))
+ {
+
+ $data['company'] = $this->cashbook_model->getCompany();
+ $data['data'] = $this->cashbook_model->getIncomeExpenseList($aid);
+ $data['PaymentDetails'] = $this->cashbook_model->viewpaymentdetails($aid);
+ $totalamt = $data['data'][0]->total;
+ $data['amtinwords'] = $this->convertNumber($totalamt);
+ $mpdf=new mPDF('utf-8','A4-P',7, 10,10, 10, 3, 0, 0, 0);
+ $mpdf->SetHTMLHeader($HtmlHeading);
+ $html = $this->load->view('cashbookpdf',$data,true);
+ $mpdf->SetDisplayMode('fullpage');
+ $mpdf->setFooter($HTMLFooter . "Page {PAGENO} of {nb}");
+ $mpdf->list_indent_first_level = 1;
+ $mpdf->setAutoTopMargin = 'stretch';
+ $mpdf->setAutoBottomMargin = 'stretch';
+ $mpdf->WriteHTML($html);
+ $filename = "cashbook.pdf";
+ $mpdf->Output($filename,I);
}
- else
- {
+ else
+ {
$data['data'] = $this->cashbook_model->getIncomeExpenseList($aid);
+ $data['PaymentDetails'] = $this->cashbook_model->viewpaymentdetails($aid);
$this->global['pageTitle'] = 'Resico : Cash Book: View Income Expense ';
$this->loadViews("viewIndIncomeExpense", $this->global, $data , NULL);
-
- }
-
+
}
- else
- {
- $data['list'] = $this->cashbook_model->getIncomeExpenseList();
- $this->global['pageTitle'] = 'Resico : Cash Book: Listing';
+
+ }
+ else{
+ //$data['list'] = $this->cashbook_model->getIncomeExpenseList();
+ $data['list'] = $this->cashbook_model->getreceiptpaymentlist();
+ $this->global['pageTitle'] = 'Resico : Cash Book: Listing';
$this->loadViews("income_expense_list", $this->global, $data , NULL);
- }
-
-
+ }
+
}
/**
@@ -88,17 +88,18 @@ class cashbook extends BaseController
/**
* To store added incomeexpense datas
*/
- function addIncomeExpense()
+ //function addIncomeExpense()
+ function addReceipt()
{
$accounttype = $this->input->post('myradio');
- if($accounttype == 1)
- {
+ //if($accounttype == 1)
+ //{
$accounttype = 'RECEIPT';
- }
- else
- {
- $accounttype = 'PAYMENT';
- }
+ //}
+ //else
+ //{
+ //$accounttype = 'PAYMENT';
+ //}
$accountcode = $this->input->post('accode');
$date = $this->input->post('Date');
$date = date_create($date);//,'Y-m-d');
@@ -114,6 +115,7 @@ class cashbook extends BaseController
$sgst = null;
$cgst = null;
$igst = null;
+ $subdescription = null;
if(!empty($gsttoggle))
{
$invoiceno = $this->input->post('Invoiceno');
@@ -135,7 +137,7 @@ class cashbook extends BaseController
$fs = 0;
if(!empty($_FILES['myfile']['name']))
{
-
+
$config['file_name'] = $_FILES['myfile']['name'];
$config['upload_path'] = 'uploads/cashbook/';
$path = $config['upload_path'];
@@ -145,13 +147,165 @@ class cashbook extends BaseController
}
$created_by = $this->session->userdata('userId');
- $addincomexpense = array('type'=>$accounttype,'account_code'=>$accountcode,'date'=>$date,'towhom'=>$towhome,'invoice_no'=>$invoiceno,'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);
+ $addincomexpense = array('type'=>$accounttype,'account_code'=>$accountcode,'date'=>$date,'towhom'=>$towhome,'invoice_no'=>$invoiceno,'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,'subdescription'=>$subdescription);
$res = $this->cashbook_model->saveIncomeExpense($addincomexpense);
- if( $res == 1 ){
- echo "";
+ if( $res >= 1 ){
+ echo "";
}
}
+
+ /**
+ * To store added Cashbook's Payment datas
+ */
+ function addPayment()
+ {
+ $count = $this->input->post('hidecounter');
+ $constantcount = $this->input->post('hideconstant');
+
+ $accounttype = 'PAYMENT';
+ $date = $this->input->post('PaymentDate');
+ $date = date_create($date);//,'Y-m-d');
+ $date = date_format($date,'Y-m-d');
+ $paidto = $this->input->post('PaymentPaidto');
+ $vouchercode = $this->input->post('Paymentvouchercode');
+ //echo $count.$consantcount;
+ //$gsttoggle = $this->input->post('gsttoggle');
+ //$invoiceno = null;
+ $merchantname = null;
+ $mergstno = null;
+ $hsn = null;
+ $beforegst = null;
+ $sgst = null;
+ $cgst = null;
+ $igst = null;
+
+ $merchantname = $this->input->post('Paymentmerchant');
+ $mergstno = $this->input->post('PaymentMerchantgst');
+ $hsn = $this->input->post('Paymenthsn');
+ $beforegst = $this->input->post('PaymentvaluebeforegST');
+ $sgst = $this->input->post('PaymentSGST');
+ $cgst = $this->input->post('PaymentCGST');
+ $igst = $this->input->post('PaymentIGST');
+
+
+ $totalamount = $this->input->post('Paymenttotalamount');
+ $description = $this->input->post('Paymentdescription');
+
+
+ if(empty($description)){$description = 'NA';}
+
+ $document = null;
+
+ $fs = 0;
+
+ if(!empty($_FILES['myfile']['name']))
+ {
+
+ $config['file_name'] = $_FILES['myfile']['name'];
+ $config['upload_path'] = 'uploads/cashbook/';
+ $path = $config['upload_path'];
+ $document = $path.$filename;
+ $fs = $this->uploadFile();
+ $document = $path.$fs;
+
+ }
+ $created_by = $this->session->userdata('userId');
+
+
+ if($count == 1)
+ {
+
+ $array = $this->input->post('mydata1');
+ if(!empty($array)){
+ $array[] = $this->input->post($varname);
+ $index = 0;
+ foreach($array as $key=>$value){
+ $index++;
+ if($index == 1){
+ $Paymentaccode = $value;
+ }
+ if($index == 2){
+ $subdescription = $value;
+ }
+ }}
+
+ $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);
+
+ }
+ else
+ {
+
+ $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);
+ $res = $this->cashbook_model->saveIncomeExpense($addPayments);
+
+ $Paymentaccode = '';
+ $subdescription = '';
+ $Paymentamount = '';
+
+
+ for($i=1;$i<=$constantcount;$i++){
+
+ $varname = 'mydata'.$i;
+ //alert($varname);
+ $temp = $this->input->post($varname);
+ if(!empty($temp)){
+ $g[] = $this->input->post($varname);
+ //echo "sd";
+ //print_r($g);
+ //die();
+ }
+ else{}
+ }
+
+ foreach($g as $arr){
+ // $Paymentaccode = $arr->Paymentaccode;
+ // $subdescription = $arr->subdescription;
+ // $Paymentamount = $arr->Paymentamount;
+
+ $index = 0;
+ foreach($arr as $key=>$value){
+ $index++;
+ // echo "*************";
+ // echo $key;
+ // echo $value;
+ // echo "*************";
+ if($index == 1){
+ $Paymentaccode = $value;
+ }
+ if($index == 2){
+ $subdescription = $value;
+ }
+ if($index == 3){
+ $Paymentamount = $value;
+
+ }
+
+ }
+ //insert;
+ $addPaymentDetails = array('Payment_id'=>$res,'Account_code'=>$Paymentaccode,'Account_description'=>$subdescription,'Amount'=>$Paymentamount);
+ //print_r($addPaymentschild);
+
+ //$child = $this->cashbook_model->paymentdetails($addPaymentschild);
+ $child = $this->cashbook_model->addpaymentdetails($addPaymentDetails);
+ //addupdatepaymentdetails($addPaymentschild,$res);
+ //echo $child;
+ //echo $paymentcode;
+ }
+
+ }//new else
+ if( $res >= 1 ){
+ echo "";
+ }
+
+ }
+
+
/**
* To store Cashbook revalant file and images
@@ -163,10 +317,10 @@ class cashbook extends BaseController
$config['upload_path'] = 'uploads/cashbook/';
$config['allowed_types'] = 'png|jpg|jpeg';
$config['file_name'] = $_FILES['myfile']['name'];
-
- $this->load->library('upload',$config);
- $this->upload->initialize($config);
+ //Load upload library and initialize configuration
+ $this->load->library('upload',$config);
+ $this->upload->initialize($config);
if($this->upload->do_upload('myfile'))
{
@@ -249,51 +403,327 @@ class cashbook extends BaseController
$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);
- $result = $this->cashbook_model->Cashbook($cashbookdatas);
+ $result = $this->cashbook_model->Cashbook($cashbookdatas);
}
}
echo "Successfully Saved!";
- }
+ }
/**
* For edit cashbook screen
*/
- public function editcashbook()
- {
-
- $this->load->model('cashbook_model');
- $this->loadViews("editincomeexpenses", $this->global, NULL);
+ public function editcashbook($sid)
+ {
+
+ if($sid == '')
+ {
+ $cash = $_GET['sid'];
+ }
+ else
+ {
+ $cash = $sid;
+ }
+
+
+ $this->load->model('cashbook_model');
+ /** this array for single entry both recepit and payment datas*/
+ $data['RecepitPayment'] = $this->cashbook_model->viewdepartment($cash);
+ /** this array for paymentmaster mutilpe datas */
+ $data['PaymentMultiple'] = $this->cashbook_model->viewpaymentmaster($cash);
+ /** this array for paymentchild datas */
+ $data['PaymentDetails'] = $this->cashbook_model->viewpaymentdetails($cash);
+ /** this array for dropdown value(account name)*/
+ $data['dropdownvalues'] = $this->cashbook_model->getAccounTypes();
+ $this->global['pageTitle'] = 'Resico : Edit Cashbook';
+ $this->loadViews("editincomeexpenses", $this->global,$data, NULL);
+
}
+ public function deletefile()
+ {
+ $cashfile = $this->input->post('id');
+ $cashid = $this->input->post('ide');
+ $filedata= $this->cashbook_model->deletefile($cashid);
+ echo $filedata;
+ }
+ function Removepaymentdetails(){
+
+ $id = $this->input->post('id');
+ $deletedata = $this->cashbook_model->deletepaymentdetails($id);
+ echo $deletedata;
+ }
+ function updateReceipt()
+ {
+ $id1=$this->input->post('id1');
+ // $myradio1= $this->input->post('myradio');
+ // $option='';
+ // if($myradio1==1)
+ // {
+ $option=RECEIPT;
+ // }
+ // else
+ // {
+ // $option=PAYMENT;
+ // }
+
+ $ans1 = $this->input->post('ans');
+ $Date1 = $this->input->post('Date');
+
+ $date = date_create($Date1);//,'Y-m-d');
+ $date = date_format($date,'Y-m-d');
+ $accountcode1 = $this->input->post('accode');
+
+ $towhome1 = $this->input->post('towhome');
+ $Invoiceno1 = $this->input->post('Invoiceno');
+ $merchant1 = $this->input->post('merchant');
+ $Merchantgst1 = $this->input->post('Merchantgst');
+ $hsn1 = $this->input->post('hsn');
+ $valuebeforegST1 = $this->input->post('valuebeforegST');
+ $SGST1 = $this->input->post('SGST');
+ $CGST1 = $this->input->post('CGST');
+ $IGST1 = $this->input->post('IGST');
+ $totalamount1 = $this->input->post('totalamount');
+ $description1 = $this->input->post('description');
+ $deleteflag = $this->input->post('deleteflag');
+ $oldfile = $this->input->post('oldfile');
+ $document =null;
+
+
+ $fs = 0;
+ if(!empty($_FILES['myfile']['name']))
+ {
+
+ $config['file_name'] = $_FILES['myfile']['name'];
+ $config['upload_path'] = 'uploads/cashbook/';
+ $path = $config['upload_path'];
+ $fs = $this->uploadFile();
+ $document = $path.$fs;
+
+
+ }
+ else
+ {
+ if($deleteflag == 0)
+ {
+ $document = $oldfile;
+ }
+ else if($deleteflag == 1)
+ {
+ $document = null;
+ }
+ }
+ $updateaccount = array('type'=>$option,'account_code'=>$accountcode1,'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);
+
+ $res = $this->cashbook_model->updatedepartment($updateaccount,$id1);
+
+
+ echo "";
+
+ }
+
+
+ function updatePayment()
+ {
+ $id1=$this->input->post('id1');
+ $count = $this->input->post('hidecounter');//hide value
+ $constantcount = $this->input->post('hideconstant');//hide value
+ $option=PAYMENT;
+ $ans1 = $this->input->post('ans');
+ $Date1 = $this->input->post('PaymentDate');
+ $date = date_create($Date1);//,'Y-m-d');
+ $date = date_format($date,'Y-m-d');
+
+ $towhome1 = $this->input->post('PaymentPaidto');
+ $Invoiceno1 = $this->input->post('Paymentvouchercode');
+ $merchant1 = $this->input->post('Paymentmerchant');
+ $Merchantgst1 = $this->input->post('PaymentMerchantgst');
+ $hsn1 = $this->input->post('Paymenthsn');
+ $valuebeforegST1 = $this->input->post('PaymentvaluebeforegST');
+ $SGST1 = $this->input->post('PaymentSGST');
+ $CGST1 = $this->input->post('PaymentCGST');
+ $IGST1 = $this->input->post('PaymentIGST');
+ $totalamount1 = $this->input->post('Paymenttotalamount');
+ $description1 = $this->input->post('Paymentdescription');
+ $deleteflag = $this->input->post('deleteflag');
+ $oldfile = $this->input->post('oldfile');
+ $document =null;
+
+
+ $fs = 0;
+ if(!empty($_FILES['myfile']['name']))
+ {
+
+ $config['file_name'] = $_FILES['myfile']['name'];
+ $config['upload_path'] = 'uploads/cashbook/';
+ $path = $config['upload_path'];
+ $fs = $this->uploadFile();
+ $document = $path.$fs;
+
+
+ }
+ else
+ {
+ if($deleteflag == 0)
+ {
+ $document = $oldfile;
+ }
+ else if($deleteflag == 1)
+ {
+ $document = null;
+ }
+ }
+
+ if($count == 1)
+ {
+
+ $array = $this->input->post('mydata1');
+ if(!empty($array)){
+ $array[] = $this->input->post($varname);
+ $index = 0;
+ foreach($array as $key=>$value){
+ $index++;
+ if($index == 1){
+ $Paymentaccode = $value;
+ }
+ if($index == 2){
+ $subdescription = $value;
+ }
+ }}
+
+
+ $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);
+ $res = $this->cashbook_model->updatepaymentmaster($UpdatePayment,$id1);
+
+
+ }
+ else
+ {
+
+ $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);
+ $res = $this->cashbook_model->updatepaymentmaster($UpdatePayment,$id1);
+
+ for($i=1;$i<=$constantcount;$i++){
+
+ $varname = 'mydata'.$i;
+ $temp = $this->input->post($varname);
+ if(!empty($temp)){
+ $g[] = $this->input->post($varname);
+ }
+ else{}
+
+ }
+
+ //print_r($g); echo "
****************************";
+
+ foreach($g as $arr){
+
+ $insert = count($arr);
+ //echo $insert;
+
+ if($insert == 3){
+
+ //print_r($arr); echo "
*********THREE insert************";
+ $index = 0;
+ foreach($arr as $key=>$value){
+ $index++;
+ // echo "*************";
+ // echo $key;
+ // echo $value;
+ // echo "*************";
+
+ if($index == 1){
+ $Payment_accode = $value;
+ }
+ if($index == 2){
+ $sub_description = $value;
+ }
+ if($index == 3){
+ $Payment_amount = $value;
+ }
+
+
+ }
+ if($Payment_accode != -1)
+ {
+
+ $addPaymentsdetails = array('Payment_id'=>$id1,'Account_code'=>$Payment_accode,'Account_description'=>$sub_description,'Amount'=>$Payment_amount);
+
+
+ $child = $this->cashbook_model->addpaymentdetails($addPaymentsdetails);
+
+ }
+
+ }
+ else if($insert == 4){
+ // print_r($arr); echo "
*********FOUR update************";
+ $index = 0;
+ foreach($arr as $key=>$value){
+ $index++;
+
+ if($index == 1){
+ $Paymentaccode = $value;
+ }
+ if($index == 2){
+ $subdescription = $value;
+ }
+ if($index == 3){
+ $Paymentamount = $value;
+ }
+ if($index == 4){
+ $hidekey = $value;
+ }
+
+ }
+
+ $UpdatePaymentsdetails = array('Payment_id'=>$id1,'Account_code'=>$Paymentaccode,'Account_description'=>$subdescription,'Amount'=>$Paymentamount);
+
+ $child = $this->cashbook_model->updatepaymentdetails($UpdatePaymentsdetails,$hidekey);
+
+
+
+ }
+
+ }
+
+ }
+
+ echo "";
+
+ }
+
/**
* To covert number into words
*/
public function convertNumber($amt){
-
+
$ShowPaise='0';
$totalAmt=explode(".",$amt);
$number = $totalAmt[0];
- $no = $number;
+ $no = $number;
if(!empty($totalAmt[1]) && $totalAmt[1]!=0){
-
$point = $totalAmt[1];
$ShowPaise='1';
}
- else{
-
+ else{
$point=0;
- $ShowPaise='0';
+ $ShowPaise='0';
}
- $hundred = null;
- $digits_1 = strlen($no);
+ $hundred = null;
+ $digits_1 = strlen($no);
- $i = 0;
- $str = array();
- $words = array('0' => '', '1' => 'One', '2' => 'Two',
+ $i = 0;
+ $str = array();
+ $words = array('0' => '', '1' => 'One', '2' => 'Two',
'3' => 'three', '4' => 'Four', '5' => 'Five', '6' => 'Six',
'7' => 'seven', '8' => 'eight', '9' => 'nine',
'10' => 'ten', '11' => 'eleven', '12' => 'twelve',
@@ -305,39 +735,36 @@ class cashbook extends BaseController
'80' => 'eighty', '90' => 'ninety','06'=>'Zero Six','01'=>'Zero One','02'=>'Zero Two'
,'03'=>'Zero Three','04'=>'Zero Four','05'=>'Zero Five','07'=>'Zero Seven','08'=>'Zero Eight','09'=>'Zero Nine');
- $words1 = array('2' => 'twenty',
+ $words1 = array('2' => 'twenty',
'3' => 'thirty', '4' => 'fourty',
'5' => 'fifty', '6' => 'sixty', '7' => 'seventy',
'8' => 'eighty', '9' =>'ninety');
- $words12 = array('11' => 'eleven',
+ $words12 = array('11' => 'eleven',
'12' => 'twelve', '13' => 'thirteen', '14' => 'fourteen',
'15' => 'fifteen', '16' => 'sixteen', '17' => 'seventeen',
'18' => 'eighteen', '19' =>'nineteen', '20' => 'twenty',);
- $digits = array('', 'hundred', 'thousand', 'lakh', 'crore');
+ $digits = array('', 'hundred', 'thousand', 'lakh', 'crore');
- while ($i < $digits_1) {
-
- $divider = ($i == 2) ? 10 : 100;
- $number = floor($no % $divider);
- $no = floor($no / $divider);
- $i += ($divider == 10) ? 1 : 2;
-
- if ($number) {
- $plural = (($counter = count($str)) && $number > 1) ? 's' : null;
- $hundred = ($counter == 1 && $str[0]) ? ' and ' : null;
- $str [] = ($number < 21) ?
- $words[$number] . " " . $digits[$counter] . $plural . " " . $hundred:
- $words[floor($number / 10) * 10]. " " . $words[$number % 10] . " ". $digits[$counter] . $plural . " " . $hundred;
- }
- else $str[] = null;
-
+ while ($i < $digits_1) {
+ $divider = ($i == 2) ? 10 : 100;
+ $number = floor($no % $divider);
+ $no = floor($no / $divider);
+ $i += ($divider == 10) ? 1 : 2;
+ if ($number) {
+ $plural = (($counter = count($str)) && $number > 1) ? 's' : null;
+ $hundred = ($counter == 1 && $str[0]) ? ' and ' : null;
+ $str [] = ($number < 21) ?
+ $words[$number] . " " . $digits[$counter] . $plural . " " . $hundred:
+ $words[floor($number / 10) * 10]. " " . $words[$number % 10] . " ". $digits[$counter] . $plural . " " . $hundred;
}
-
- $str = array_reverse($str);
- $result = implode('', $str);
- if($point>=1 && $point<=10)
+ else $str[] = null;
+
+ }
+ $str = array_reverse($str);
+ $result = implode('', $str);
+ if($point>=1 && $point<=10)
{
$points = ($point) ? " " . $words[$point] : " ";
}
@@ -350,18 +777,30 @@ class cashbook extends BaseController
$points = ($point) ? " " . $words1[$point / 10] . " " . $words[$point = $point % 10] : '';
}
- if($ShowPaise=='0'){
-
- $amountInWords = "Rupees " . $result." Only";
- }
- else{
-
- $amountInWords = "Rupees " . $result ." Paise ". $points." Only";
- }
-
-
- return $amountInWords;
+ if($ShowPaise=='0'){
+ $amountInWords = "Rupees " . $result." Only";
}
+ else{
+
+ $amountInWords = "Rupees " . $result ." Paise ". $points." Only";
+ }
+
+ return $amountInWords;
+ }
+
+ /**
+ *To get Payment Datas form ajax
+ */
+ function ViewPaymentDetails()
+ {
+
+ $paymentid= $this->input->post('id');
+ $data = $this->cashbook_model->viewpaymentdetails($paymentid);
+ echo json_encode($data);
+
+ }
+
+
}
?>
\ No newline at end of file
diff --git a/application/controllers/payslip.php b/application/controllers/payslip.php
index 0b9aef0f..a84f41e2 100755
--- a/application/controllers/payslip.php
+++ b/application/controllers/payslip.php
@@ -66,6 +66,9 @@ class payslip extends BaseController
{
$bank = $this->input->post('bank');
$payon = $this->input->post('month');
+ $chequeno = $this->input->post('chequeno');
+ $chequedate = date("Y-m-d", strtotime($this->input->post('chequedate')));
+ $createdby = $this->session->userdata ( 'userId' );
$monthsoptions = array("01" => "Jan", "02" => "Feb","03" => "Mar","04" => "Apr","05" => "May","06" => "June","07"=> "July","08"=> "Aug","09" => "Sep","10"=> "Oct","11" => "Nov","12"=>"Dec");
$m = substr($payon,0,2);
$y = substr($payon,3);
@@ -76,7 +79,14 @@ class payslip extends BaseController
$filename = '';
if($this->input->post('Bank_Report'))
{
- $data['result'] = $this->payroll_model->getReportforBank($bank,$payon);
+
+ $data['result'] = $this->payroll_model->getReportforBank($bank,$payon);
+ if($chequeno != '' && $chequedate != '')
+ {
+ $empcount=count($data['result']);
+ $cheque = array('ChequeNO'=>$chequeno, 'ChequeDate'=>$chequedate, 'BankName'=>$bank, 'Monthyear'=>$payon, 'Empcount'=>$empcount, 'CreatedBy'=>$createdby);
+ $data['insertcheque'] = $this->payroll_model->ChequeDetails($cheque);
+ }
$totamtwords = '';
$totalamt=0.00;
if(!empty($data['result'])){
@@ -87,12 +97,13 @@ class payslip extends BaseController
}
$totamtwords = $this->convertNumber($totalamt);
$data['bankdetails']=$this->payroll_model->getBankInfo($bank);
-
+ $data['chequedetails']=$this->payroll_model->getChequeInfo($bank,$payon);
$data['Totalamount']=$totalamt;
$data['Totalamtwords']=$totamtwords;
$data['PayMonth']=$month;
$filename = 'Bank Report for'.$payon ;
$HTML = $this->load->view("bankreportprint",$data,true);
+
}
if($this->input->post('PF_Report'))
{
@@ -1162,6 +1173,19 @@ class payslip extends BaseController
return $amountInWords;
}
+ function ValidationCheque(){
+
+ $bank = $this->input->post("id1");
+ $payon = $this->input->post("id2");
+
+ $result = $this->payroll_model->getChequeInfo($bank,$payon);
+
+ $count = count($result);
+
+ echo $count;
+
+}
+
}
?>
\ No newline at end of file
diff --git a/application/controllers/report.php b/application/controllers/report.php
index 81ff5b37..c915d0fb 100755
--- a/application/controllers/report.php
+++ b/application/controllers/report.php
@@ -1004,40 +1004,35 @@ class report extends BaseController
}
- public function cashbook()
- {
-
- $this->global['pageTitle'] = 'Cashbook - Cashbook Reports - ';
-
- $data['gettoptotal1'] = $this->dahsboard_Model->gettoptotal();
- $data['getTotalServicePoCount'] = $this->dahsboard_Model->getTotalServicePoCount();
- $data['getTotalimportPoCount'] = $this->dahsboard_Model->getTotalimportPoCount();
- $data['getTotalcapitalPoCount'] = $this->dahsboard_Model->getTotalcapitalPoCount();
- $data['getTotalrevenuePoCount'] = $this->dahsboard_Model->getTotalrevenuePoCount();
- $data['cashbook']=$this->dahsboard_Model->cashbook();
-
- $income="RECEIPT";
- $expense="PAYMENT";
- $data['monthlywiseincome']=$this->dahsboard_Model->monthwise_data($income);
- $data['monthlywiseexpense']=$this->dahsboard_Model->monthwise_data($expense);
- $data['todayincome']=$this->dahsboard_Model->today_data($income);
- $data['todayexpense']=$this->dahsboard_Model->today_data($expense);
- $data['yearincome']=$this->dahsboard_Model->yearwise_data($income);
- $data['yearexpense']=$this->dahsboard_Model->yearwise_data($expense);
- $data['gettoptotal1'] = $this->dahsboard_Model->gettoptotal();
- $data['Indiancurrency']=$this->dahsboard_Model->INRSymbol();
- //print_r($data['gettoptotal1']);
- // $data['monthlywiseincome']=$this->dahsboard_Model->monthwise_data_income();
- // $data['monthlywiseexpense']=$this->dahsboard_Model->monthwise_data_expense();
- // $data['todayincome']=$this->dahsboard_Model->today_data_income();
- // $data['todayexpense']=$this->dahsboard_Model->today_data_expense();
+ public function cashbook()
+ {
+
+ $this->global['pageTitle'] = 'Cashbook - Cashbook Reports - ';
+
+ $data['gettoptotal1'] = $this->dahsboard_Model->gettoptotal();
+ $data['getTotalServicePoCount'] = $this->dahsboard_Model->getTotalServicePoCount();
+ $data['getTotalimportPoCount'] = $this->dahsboard_Model->getTotalimportPoCount();
+ $data['getTotalcapitalPoCount'] = $this->dahsboard_Model->getTotalcapitalPoCount();
+ $data['getTotalrevenuePoCount'] = $this->dahsboard_Model->getTotalrevenuePoCount();
+ $data['cashbook']=$this->dahsboard_Model->cashbook();
+
+ $income="RECEIPT";
+ $expense="PAYMENT";
+ $data['monthlywiseincome']=$this->dahsboard_Model->monthwise_data($income);
+ $data['monthlywiseexpense']=$this->dahsboard_Model->monthwise_data($expense);
+ $data['todayincome']=$this->dahsboard_Model->today_data($income);
+ $data['todayexpense']=$this->dahsboard_Model->today_data($expense);
+ $data['yearincome']=$this->dahsboard_Model->yearwise_data($income);
+ $data['yearexpense']=$this->dahsboard_Model->yearwise_data($expense);
+ $data['gettoptotal1'] = $this->dahsboard_Model->gettoptotal();
+ $data['tdy']=$this->dahsboard_Model->today();
+ $data['Indiancurrency']=$this->dahsboard_Model->INRSymbol();
+
+ $this->loadviews("reportcashbook",$this->global,$data, NULL);
- $this->loadviews("reportcashbook",$this->global,$data, NULL);
-
- }
-
- public function monthexpenses()
+ }
+ public function monthexpenses()
{
$this->global['pageTitle'] = 'Cashbook - monthly expenses Reports - ';
@@ -1045,12 +1040,13 @@ class report extends BaseController
$data['monthlyreport']=$this->dahsboard_Model->monthexpensereport();
-
+ // $data['monthlyincreport']=$this->dahsboard_Model->monthincomereport();
$data['Indiancurrency']=$this->dahsboard_Model->INRSymbol();
-
+
$this->loadviews("cashbookmonthlyexpenses",$this->global,$data, NULL);
-
+
+
}
public function yearexpenses()
@@ -1058,59 +1054,94 @@ class report extends BaseController
$this->global['pageTitle'] = 'Cashbook - yearly expenses Reports - ';
-
-
- $data['yearlyreport']=$this->dahsboard_Model->yearexpensereport();
+ $fyear = $this->input->post('financialyear');
+
+ $fa=substr( $fyear,0,-5);
+ $aa=substr( $fyear,5,5);
+ //echo $fyear;
+ //$data['yearlyincreport']=$this->dahsboard_Model->yearincomereport();
+ $data['yearlyreport']=$this->dahsboard_Model->yearexpensereport($fa,$aa);
+ $data['financialyear']=$this->dahsboard_Model->cashbookfinyear();
+ //print_r($data['finyear']);
$data['Indiancurrency']=$this->dahsboard_Model->INRSymbol();
-
+
$this->loadviews("cashbookyearlyexpenses",$this->global,$data, NULL);
+
}
public function cashbookdepartment()
{
+ $this->global['pageTitle'] = 'Cashbook - department - ';
$sid=$_GET['sid'];
+
$d=$_GET['d'];
- $this->global['pageTitle'] = 'Cashbook - department - ';
- $data['departmentwise']=$this->dahsboard_Model->departmentwise($sid,$d);
+ $c=$_GET['c'];
+ if ($c=='PAYMENT')
+ {
+
+ $data['departmentwise']=$this->dahsboard_Model->departmentwise($sid,$d,$c);
$data['Indiancurrency']=$this->dahsboard_Model->INRSymbol();
-
- $this->loadviews("cashbookmonthlydep",$this->global,$data, NULL);
+ $this->loadviews("cashbookmonthlydep",$this->global,$data, NULL);
}
- //for cashbook menu link//
- public function cashbookmonthmenu()
+ else{
+ $data['departmentwise']=$this->dahsboard_Model->departmentwise($sid,$d,$c);
+ $data['Indiancurrency']=$this->dahsboard_Model->INRSymbol();
+ $this->loadviews("cashbookmonthlyexp",$this->global,$data, NULL);
+ }
+ }
+ public function cashbookdepartmentexp()
{
-
- $this->global['pageTitle'] = 'Cashbook monthly ';
- $data['yearmonthwise']=$this->dahsboard_Model->yearmonthwise();
+ $sid=$_GET['sid'];
+ $d=$_GET['d'];
+ $c=$_GET['c'];
+ $this->global['pageTitle'] = 'Cashbook - department - ';
+ $data['departmentwise']=$this->dahsboard_Model->departmentwise($sid,$d,$c);
$data['Indiancurrency']=$this->dahsboard_Model->INRSymbol();
//print_r($data['departmentwise']);
- $this->loadviews("cashbookyearmonthwise",$this->global,$data, NULL);
+ $this->loadviews("cashbookmonthlyexp",$this->global,$data, NULL);
}
+ //for cashbook menu link//
+ // public function cashbookmonthmenu()
+ // {
+
+ // $this->global['pageTitle'] = 'Cashbook monthly ';
+ // $data['yearmonthwise']=$this->dahsboard_Model->yearmonthwise();
+ // $data['Indiancurrency']=$this->dahsboard_Model->INRSymbol();
+ // //print_r($data['departmentwise']);
+ // $this->loadviews("cashbookyearmonthwise",$this->global,$data, NULL);
+ // }
public function yearmonthwise()
{
$sid=$_GET['sid'];
$this->global['pageTitle'] = 'Cashbook - yearmonthwise - ';
$data['yearmonthwise']=$this->dahsboard_Model->yearmonthwise($sid);
$data['Indiancurrency']=$this->dahsboard_Model->INRSymbol();
- //print_r($data['departmentwise']);
+
$this->loadviews("cashbookyearmonthwise",$this->global,$data, NULL);
}
-public function Viewtoday()
+
+ //this function used to today menu option//
+ public function Viewtoday()
{
$this->global['pageTitle'] = 'Cashbook - viewtoday ';
$data['tdy']=$this->dahsboard_Model->today();
$data['Indiancurrency']=$this->dahsboard_Model->INRSymbol();
$this->loadviews("cashbooktoday",$this->global,$data, NULL);
}
-
public function depmenu()
{
- $this->global['pageTitle'] = 'Cashbook - viewtoday ';
- $data['depmenu']=$this->dahsboard_Model->departmentmenu();
+ $this->global['pageTitle'] = 'Cashbook - AllReport ';
+ $fdate = $this->input->post('from_date');
+ $tdate = $this->input->post('to_date');
+ $finyear = $this->input->post('financialyear');
+ $fa=substr( $finyear,0,-5);
+ $aa=substr( $finyear,5,5);
+ $data['depmenu']=$this->dahsboard_Model->departmentmenu($fdate,$tdate,$fa,$aa);
+ $data['financialyear']=$this->dahsboard_Model->cashbookfinyear();
$data['Indiancurrency']=$this->dahsboard_Model->INRSymbol();
- $this->loadviews("cashbookdepmenu",$this->global,$data, NULL);
+ $this->loadviews("cashbookall",$this->global,$data, NULL);
}
public function cashbookmenudepartment()
{
@@ -1119,10 +1150,7 @@ public function Viewtoday()
$this->global['pageTitle'] = 'Cashbook - department - ';
$data['menudepartmentwise']=$this->dahsboard_Model->menudepartmentwise($sid);
$data['Indiancurrency']=$this->dahsboard_Model->INRSymbol();
- //print_r($data['departmentwise']);
$this->loadviews("cashbookdepday",$this->global,$data, NULL);
}
-
}
?>
-
diff --git a/application/models/cashbook_model.php b/application/models/cashbook_model.php
index 68e829f4..5d3e0119 100755
--- a/application/models/cashbook_model.php
+++ b/application/models/cashbook_model.php
@@ -2,10 +2,7 @@
class cashbook_model extends CI_Model
{
- /**
- * To get Account Type
- * @return array $r->result() : result of the query (returns active account code)
- */
+
function getAccounTypes()
{
$this->db->where('status',1);
@@ -13,24 +10,20 @@ class cashbook_model extends CI_Model
return $r->result();
}
-
/**
- * To get Account status
- * @param number $data : This will have all the income and expense information.
- * @return array $r : This will return how many value are inserted (return as number/count)
- */
- function saveIncomeExpense($data)
+ * To Save Recepit and Payment datas
+ * array $data - Recepit/Payment array datas
+ * return $last_id - last inserted id
+ */
+ function saveIncomeExpense($data)
{
$this->db->insert('t_income_expense',$data);
- $r = $this->db->affected_rows();
- return $r;
+ //$r = $this->db->affected_rows();
+ //return $r;
+ $last_id = $this->db->insert_id();
+ return $last_id;
}
- /**
- * To get Income and expense List
- * @param number $i : Optional : This is incomeandexpense's id
- * @return array $r->result() : result of the query (returns account information)
- */
function getIncomeExpenseList($i="")
{
$this->db->select('t_accountcode.name,T_Employee_Details.FirstName,T_Employee_Details.LastName,t_income_expense.*');
@@ -39,43 +32,66 @@ class cashbook_model extends CI_Model
$this->db->join('tbl_users','t_income_expense.Created_By=tbl_users.userId');
$this->db->join('T_Employee_Details','tbl_users.EmpID=T_Employee_Details.EmpID');
- if(!empty($i))
+ if(!empty($i))
{
$this->db->where('t_income_expense.id',$i);
}
- $r = $this->db->get();
- return $r->result();
+ $r = $this->db->get();
+ return $r->result();
}
-
- /**
- * To get Company details
- * @return array $r->result() : result of the query (returns company information)
+// 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
+ * string $aid - Recepit/Payment id
+ * return $query->result() - Recepit/Payment datas based on id
*/
+ function getreceiptpaymentlist($aid = '')
+ {
+ $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`
+ group by t_income_expense.id";
+ $query = $this->db->query($sql);
+ return $query->result();
+ }
+
+
+
function getCompany()
{
$r = $this->db->get('T_Company_Details');
- return $r->result();
+ return $r->result();
+
}
- /**
- * To get Account Information
- * @param number $i
- * @return array $r->result() : result of the query (returns account name and incomeandexpense information)
- */
function getAccounutInfo($i)
{
$this->db->select('t_accountcode.name,t_income_expense.*');
$this->db->from('t_income_expense');
$this->db->join('t_accountcode','t_income_expense.account_code=t_accountcode.code');
+ //$this->db->where('t_income_expense.id')
$r = $this->db->get();
return $r->result();
}
- /**
- * To get Account Information
- * @return array $result : result of the query (returns account information)
- */
function Selectcash()
{
$this->db->select('*');
@@ -85,14 +101,170 @@ class cashbook_model extends CI_Model
return $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 deletefile($cashid)
+ {
+ $sql="UPDATE t_income_expense SET document = NULL
+ WHERE id = ?";
+ $query = $this->db->query($sql,array($cashid));
+ //print_r($this->db->last_query());
+ //echo $sql;
+ $r = $this->db->affected_rows();
+ return $r;
+ }
+
+
+ function updatedepartment($updateaccount,$id1)
+ {
+ $this->db->where('id', $id1);
+ $this->db->update('t_income_expense',$updateaccount);
+ $r = $this->db->affected_rows();
+ return $r;
+
+ }
+
+ /**
+ * To Update Payment Master datas
+ * array $updateaccount - Payment Master datas
+ * string $id1 - Payment's id
+ * return $ar - it return how many rows will affected
+ */
+ function updatepaymentmaster($updateaccount,$id1)
+ {
+ $this->db->where('id', $id1);
+ $this->db->update('t_income_expense',$updateaccount);
+ //$ar = $this->db->affected_rows();
+ //return $ar;
+ $last_id = $this->db->insert_id();
+ return $last_id;
+
+ }
+
/**
- * To store cashbook Information (its insertion and updation operation)
- * @param array $cashbookdatas : this will have all cashbook details
- * @var number $res : gets count
- * @return array $cbi : result of the query (for insertion)
- * @return array $cbu : result of the query (for updation)
+ * To Get Payment Master for edit
+ * string $sid - Payment id
+ * return $query->result() - Payment datas based on id return as an array
*/
+ function viewpaymentmaster($sid='')
+ {
+ $sql="SELECT ie.*,ac.name,date_format(ie.date,'%d-%m-%Y')as date
+ FROM T_Paymentdetails pd
+ JOIN t_income_expense ie ON ie.id = pd.Payment_id
+ JOIN t_accountcode ac ON ac.code = pd.account_code
+ WHERE ie.id = ?
+ group by pd.Payment_id";
+ $query = $this->db->query($sql,array($sid));
+ return $query->result();
+ }
+
+ /**
+ * To Get Payment lineitem Details for list (list dialog box)
+ * string $paymentid - Payment id
+ * return $result - Payment lineitem datas based on id return as an array
+ */
+ function viewpaymentdetails($paymentid)
+ {
+ $sql="SELECT ac.name,pd.*,ie.*
+ FROM T_Paymentdetails pd
+ JOIN t_income_expense ie ON ie.id = pd.Payment_id
+ JOIN t_accountcode ac ON ac.code = pd.account_code
+ WHERE pd.Payment_id = ".$paymentid ;
+ $query = $this->db->query($sql);
+ $result = $query->result();
+ return $result;
+ }
+
+
+
+ /**
+ * To Add and Update Payment Lineitem datas
+ * array $PaymentDetails - Payment lineitem datas
+ * return $i - To insert Payment datas based on id if new data means
+ * return $u - To update Payment datas based on id if already have means
+ */
+ function addpaymentdetails($addPaymentDetails){
+ $this->db->insert('T_Paymentdetails',$addPaymentDetails);
+ $r = $this->db->affected_rows();
+ return $r;
+ // $this->db->set($addPaymentDetails);
+ // $this->db->insert($this->db->dbprefix . 'T_Paymentdetails');
+ }
+
+
+ function updatepaymentdetails($UpdatePaymentsdetails,$hidekey){
+
+ $this->db->where('ID', $hidekey);
+ $this->db->update('T_Paymentdetails',$UpdatePaymentsdetails);
+ $ar = $this->db->affected_rows();
+ return $ar;
+
+
+ }
+ //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;
+ // }
+
+ // }
+
+
+ /**
+ * To Delete Payment Lineitem datas
+ * string $acc - Payment's accountcode
+ * string $id - Payment's id
+ * return $ar - It returns how many rows will affetected
+ */
+ function deletepaymentdetails($id){
+ $sql = "DELETE FROM T_Paymentdetails WHERE ID =".$id;
+ $query = $this->db->query($sql);
+ $ar = $this->db->affected_rows();
+ return $ar;
+ }
+
+
function Cashbook($cashbookdatas)
{
$code=$cashbookdatas['code'];
diff --git a/application/models/dahsboard_model.php b/application/models/dahsboard_model.php
index c45e185e..fc9225c6 100755
--- a/application/models/dahsboard_model.php
+++ b/application/models/dahsboard_model.php
@@ -1,8 +1,7 @@
-
\ No newline at end of file
+?>
+
diff --git a/application/models/payroll_model.php b/application/models/payroll_model.php
index 607e2547..22da7e9e 100755
--- a/application/models/payroll_model.php
+++ b/application/models/payroll_model.php
@@ -440,6 +440,25 @@ class Payroll_model extends CI_Model
//print_r($query->result());die();
return $query->result();
- }
+ }
+
+ function ChequeDetails($cheque){
+ $this->db->insert('T_ChequeDetails', $cheque);
+ }
+
+ function getChequeInfo($bank,$payon)
+ {
+
+ $sql = "SELECT Cheque.*
+ FROM T_ChequeDetails Cheque
+ WHERE Cheque.BankName = ?
+ AND Cheque.MonthYear = ? ";
+
+ $query = $this->db->query($sql,array($bank,$payon));
+ //$query_count = $query->num_rows();
+
+ //return $query_count;
+ return $query->result();
+ }
}
?>
\ No newline at end of file
diff --git a/application/views/addnewIncomeExpense.php b/application/views/addnewIncomeExpense.php
index 6fc14a5d..5af6c133 100755
--- a/application/views/addnewIncomeExpense.php
+++ b/application/views/addnewIncomeExpense.php
@@ -1,5 +1,365 @@
+
+
+
Dear Sir,
Sub: Salary transfer of respective SB a/c through Account Transfer.
-Please find herewith enclosed a Cheque bearing No: _________________ dated ________________ for /- () Kindly transfer the same to the respective account holders mentioned below
+Please find herewith enclosed a Cheque bearing No: dated for /- () Kindly transfer the same to the respective account holders mentioned below
| Paid To | -Paid Type | -Amount | - - -
|---|---|---|
| name?> | -type?> | -total,2,'.','');?> | - - - - - -
Month Report()
| Account Name | +Type | + +Receipt | +Payment | + + + + + +
|---|---|---|---|
| name?> | +type?> | + + + +income,2,'.',''); + echo number_format($mr->income,2,'.','');?> | +expense,2,'.',''); + echo number_format($mr->expense,2,'.','');?> | + + + + + + + +
| Total | ++ + + | + + + | ++ + + | + + + + + + +
| Date | - - -Paid To | -Paid Type | -Amount | - - -
|---|---|---|---|
| date?> | - -name ?> | - -type?> | -total,2,'.','');?> | - - - - -
| Date | + + +Paid To | +Paid Type | +Amount | + + +
|---|---|---|---|
| date?> | + +name ?> | + +type?> | +total,2,'.','');?> | + + + + +
| Account Name | +Account Description | +Account Amount |
| name; ?> | +Account_description; ?> | +Amount; ?> | +
Remarks
@@ -54,10 +85,10 @@ $pic = base_url().'uploads/images/'.$company[0]->ProfilePic;| Date | - -Paid To | -Paid Type | -Amount | -Description | - -
|---|---|---|---|---|
| date?> | - -name ?> | - -type?> | -total,2,'.','');?> | -description?> | - - - -
Today Report
| Month | - -Paid Type | -Amount | - - - - -
|---|---|---|
| month?> | - -type?> | -total,2,'.','');?> | - - - - -
YEAR REPORTS()
| Month | + +Receipt | +Payment | + + + + +|
|---|---|---|---|
| month?> | + +inc,2,'.',''); + echo number_format($yr->inc,2,'.','');?> | +exp,2,'.',''); + echo number_format($yr->exp,2,'.','');?> | + + + + + +|
| Total | + ++ + + | ++ + + | + ++ + + + + |
| Account Name | - - -Paid Type | -Amount | - - - - -
|---|---|---|
| name?> | - -type?> | -total,2,'.','');?> | - - - - -
Month Report()
| Account Name | + + +Paid Type | + +Receipt | +Payment | + + + + +
|---|---|---|---|
| name?> | + +type?> | + + + +income,2,'.',''); + echo number_format($ym->income,2,'.','');?> | +expense,2,'.',''); + echo number_format($ym->expense,2,'.','');?> | + + + + +
| Total | ++ + + | + + + | ++ + + | +
- - - -
| Account Name | -Type | -Received From | -Paid To | -Receipt | -Payment | -Description | - - -|
|---|---|---|---|---|---|---|---|
| date?> | -name?> | -type?> | -receiptname?> | -paymentname?> | -income,2,'.',''); - echo number_format($cash->income,2,'.','');?> | -expense,2,'.',''); - echo number_format($cash->expense,2,'.','');?> | -description?> | - -
| Total | -- | - | - | - | - - - | -- - - | - -- - |
Day Wise Report
Date : | date)){echo date_format(date_create($data[0]->date),'d-m-Y');}?> | +Merchant Name : | merchant)){echo $data[0]->merchant;}?> | +||||||||||||||
| towhom)){echo $data[0]->towhom;}?> | + +Merchant GST No : | merchant_gst)){echo $data[0]->merchant_gst;}?> | +|||||||||||||||
Invoice No : | invoice_no)){echo $data[0]->invoice_no;}?> | +HSN/SAC No : | HSN)){echo $data[0]->HSN;}?> | +||||||||||||||
Value Before GST : | value_before_gst)){echo $data[0]->value_before_gst;}?> | ++ | |||||||||||||||
SGST : | sgst)){echo $data[0]->sgst;}?> | ++ | |||||||||||||||
CGST : | cgst)){echo $data[0]->cgst;}?> | ++ | |||||||||||||||
IGST : | igst)){echo $data[0]->igst;}?> | ++ | |||||||||||||||
+
| |||||||||||||||||
Total Amount | total)){echo $data[0]->total;}?> | ||||||||||||||||
Description : | description)){echo $data[0]->description;}?> | ||||||||||||||||
Date | : date)){echo date_format(date_create($data[0]->date),'d-m-Y');}?> | |
| :towhom)){echo $data[0]->towhom;}?> | ||
Date : | date)){echo date_format(date_create($data[0]->date),'d-m-Y');}?> | |
| towhom)){echo $data[0]->towhom;}?> | ||
Invoice No | : invoice_no)){echo $data[0]->invoice_no;}?> | |
Merchant Name | : merchant)){echo $data[0]->merchant;}?> | |
Merchant GST No | : merchant_gst)){echo $data[0]->merchant_gst;}?> | |
HSN/SAC No | : HSN)){echo $data[0]->HSN;}?> | |
Value Before GST | : value_before_gst)){echo $data[0]->value_before_gst;}?> | |
SGST | : sgst)){echo $data[0]->sgst;}?> | |
CGST | : cgst)){echo $data[0]->cgst;}?> | |
IGST | : igst)){echo $data[0]->igst;}?> | |
Total Amount | : total)){echo number_format($data[0]->total,2,'.','');}?> | |
Description | : description)){echo $data[0]->description;}?> | |
Invoice No : | invoice_no)){echo $data[0]->invoice_no;}?> | |
Merchant Name : | merchant)){echo $data[0]->merchant;}?> | |
Merchant GST No : | merchant_gst)){echo $data[0]->merchant_gst;}?> | |
HSN/SAC No : | HSN)){echo $data[0]->HSN;}?> | |
Value Before GST : | value_before_gst)){echo $data[0]->value_before_gst;}?> | |
SGST : | sgst)){echo $data[0]->sgst;}?> | |
CGST : | cgst)){echo $data[0]->cgst;}?> | |
IGST : | igst)){echo $data[0]->igst;}?> | |
Total Amount : | total)){echo $data[0]->total;}?> | |
Description : | description)){echo $data[0]->description;}?> |