PAYROLL ISSUE and CASHBOOK

This commit is contained in:
velz2020 2017-11-17 15:56:07 +05:30
parent db7a275089
commit d0415a3ffd
14 changed files with 1603 additions and 102 deletions

View File

@ -200,6 +200,10 @@ $route['EditMRIR'] = "MRIRcontroller/editmaterialinspectionreport";
$route['ViewMRIR'] = "MRIRcontroller/viewmaterialinspectionreport";
$route['Viewigr'] = "MRIRcontroller/viewinwardgateregister";
$route['Distribution'] = "MRIRcontroller/viewmMaterialDistributionList";
$route['ViewIncomeExpense'] = "cashbook/incomeExpenseList";
$route['addNewIncomeExpense'] = "cashbook/addNewIncomeExpenseLoad";
$route['addIncomeExpense'] = "cashbook/addIncomeExpense";
//<-------------Store page----------------->
$route['Stock'] = "storestatus/storeavailability";
$route['UpdatePOStatus'] = "servicepurchaseorder/UpdateServicePOStatus";

View File

@ -0,0 +1,364 @@
<?php if(!defined('BASEPATH')) exit('No direct script access allowed');
require APPPATH . '/libraries/BaseController.php';
require APPPATH . '/third_party/mpdf/mpdf.php';
/**
* Class : cash Book Controller (cash Book)
* User Class to control all user related operations.
* @author : Gandhimathi
* @version : 1.1
* @since : 13 Nov 2017
*/
class cashbook extends BaseController
{
/**
* This is default constructor of the class
*/
public function __construct()
{
parent::__construct();
$this->load->model('cashbook_model');
$this->isLoggedIn();
$this->load->helper(array('form','url'));
$this->load->library('upload');
}
function incomeExpenseList()
{
$aid = $this->uri->segment(3);
$str = $this->uri->segment(4);
if(!empty($aid)){
if(!empty($str))
{
//echo "PDF";
$data['company'] = $this->cashbook_model->getCompany();
$data['data'] = $this->cashbook_model->getIncomeExpenseList($aid);
//$pic1 = $data['company'][0]->ProfilePic;
//echo $pic1;
//$pic = base_url().'uploads/images'.$pic1;
//echo $pic;
//die();
$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
{
$data['data'] = $this->cashbook_model->getIncomeExpenseList($aid);
//print_r($data['dropdownvalues']);die();
$this->global['pageTitle'] = 'Siddharth : Cash Book: View Income Expense ';
$this->loadViews("viewIndIncomeExpense", $this->global, $data , NULL);
}
}else{
$data['list'] = $this->cashbook_model->getIncomeExpenseList();
$this->global['pageTitle'] = 'Siddharth : Cash Book: Listing';
$this->loadViews("income_expense_list", $this->global, $data , NULL);
}
}
function addNewIncomeExpenseLoad()
{
$data['dropdownvalues'] = $this->cashbook_model->getAccounTypes();
//print_r($data['dropdownvalues']);die();
$this->global['pageTitle'] = 'Siddharth : Cash Book: Add New Income Expense ';
$this->loadViews("addnewIncomeExpense", $this->global, $data , NULL);
}
function addIncomeExpense()
{
//echo "welcome";
//die();
$accounttype = $this->input->post('myradio');
if($accounttype == 1)
{
$accounttype = 'INCOME';
}
else
{
$accounttype = 'EXPENSE';
}
$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');
$gsttoggle = $this->input->post('gsttoggle');
$invoiceno = null;
$merchantname = null;
$mergstno = null;
$hsn = null;
$beforegst = null;
$sgst = null;
$cgst = null;
$igst = null;
if(!empty($gsttoggle))
{
$invoiceno = $this->input->post('Invoiceno');
$merchantname = $this->input->post('merchant');
$mergstno = $this->input->post('Merchantgst');
$hsn = $this->input->post('hsn');
$beforegst = $this->input->post('valuebeforegST');
$sgst = $this->input->post('SGST');
$cgst = $this->input->post('CGST');
$igst = $this->input->post('IGST');
}
$totalamount = $this->input->post('totalamount');
$description = $this->input->post('description');
if(empty($description)){$description = 'NA';}
$document = null;
$fs = 0;
if(!empty($_FILES['myfile']['name']))
{
//echo "FILE AVAILABLE";
$config['file_name'] = $_FILES['myfile']['name'];
$config['upload_path'] = 'uploads/cashbook/';
$path = $config['upload_path'];
//$filename = $config['file_name'];
$document = $path.$filename;
//echo $document;
$fs = $this->uploadFile();
$document = $path.$fs;
}
$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);
$res = $this->cashbook_model->saveIncomeExpense($addincomexpense);
if( $res == 1 ){
echo "<script>alert('Saved Successfully!');window.location.href='ViewIncomeExpense';</script>";
}
}
function uploadFile()
{
//echo "INSIDE UPLOAFD";
//$this->load->library('upload')
$pathinfo = pathinfo($_FILES['myfile']['name']);
$config['upload_path'] = 'uploads/cashbook/';
$config['allowed_types'] = 'png|jpg|jpeg';
$config['file_name'] = $_FILES['myfile']['name'];
// $config['overwrite'] = true;
//Load upload library and initialize configuration
$this->load->library('upload',$config);
$this->upload->initialize($config);
if($this->upload->do_upload('myfile'))
{
$uploadData = $this->upload->data();
$uploadfilename = $uploadData['file_name'];
return $uploadfilename;
}
else
{
$error = array('error' => $this->upload->display_errors());
$uploadfilename = '';
print_r($error);
return 0;
}
}
function viewIE()
{
$aid = $this->uri->segment(3);
$data['data'] = $this->cashbook_model->getAccounutInfo();
//print_r($data['dropdownvalues']);die();
$this->global['pageTitle'] = 'Siddharth : Cash Book: View Income Expense ';
$this->loadViews("viewIndIncomeExpense", $this->global, $data , NULL);
}
public function index()
{
$this->global['pageTitle'] = 'Siddharth : Cashbook Details';
$this->loadViews("cashbooklisting", $this->global, NULL , NULL);
}
public function cashbookList()
{
$this->load->model('cashbook_model');
$data['cashbook'] = $this->cashbook_model->Selectcash();
$this->global['pageTitle'] = 'Siddharth : Cashbook Listing';
$this->loadViews("cashbooklisting", $this->global, $data, NULL);
}
public function cashbookdtl()
{
$id = $this->input->post('id');
$tablevalue = json_decode($id,true);
//print_r($tablevalue);
foreach($tablevalue as $tv)
{
if(!empty($tv['AccountCodeType'])){
$acc_type = $tv['AccountCodeType'];
$acc_code = $tv['AccountCode'];
$acc_name = $tv['AccountName'];
$acc_desc = $tv['Description'];
$acc_state = $tv['Status'];
if(strtoupper($acc_state) == 'YES')
{
$acc_status = 1;
}
else{
$acc_status = 0;
}
$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);
//print_r($cashbookdatas);
$result = $this->cashbook_model->Cashbook($cashbookdatas);
}
}
//redirect('cashbook/cashbookList','refresh');
echo "Successfully Saved!";
}
public function convertNumber($amt){
//echo $amt;die();
$ShowPaise='0';
$totalAmt=explode(".",$amt);
$number = $totalAmt[0];
$no = $number;
if(!empty($totalAmt[1]) && $totalAmt[1]!=0){
$point = $totalAmt[1];
$ShowPaise='1';
}
else{
$point=0;
$ShowPaise='0';
}
$hundred = null;
$digits_1 = strlen($no);
$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',
'13' => 'thirteen', '14' => 'fourteen',
'15' => 'fifteen', '16' => 'sixteen', '17' => 'seventeen',
'18' => 'eighteen', '19' =>'nineteen', '20' => 'twenty',
'30' => 'thirty', '40' => 'forty', '50' => 'fifty',
'60' => 'sixty', '70' => 'seventy',
'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',
'3' => 'thirty', '4' => 'fourty',
'5' => 'fifty', '6' => 'sixty', '7' => 'seventy',
'8' => 'eighty', '9' =>'ninty');
$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');
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;
//print_r($plural);
$hundred = ($counter == 1 && $str[0]) ? ' and ' : null;
//print_r($hundred);
$str [] = ($number < 21) ? $words[$number] .
" " . $digits[$counter] . $plural . " " . $hundred
:
$words[floor($number / 10) * 10]
. " " . $words[$number % 10] . " "
. $digits[$counter] . $plural . " " . $hundred;
} else $str[] = null;
}
$str = array_reverse($str);
$result = implode('', $str);
if($point>=1 && $point<=10)
{
$points = ($point) ?
" " . $words[$point] : " ";
}
else if($point>=11 && $point<=20)
{
$points = ($point) ?
" " . $words12[$point] : " ";
}
else
{
$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;
}
}
?>

View File

@ -47,6 +47,7 @@ class monthlypay extends BaseController
function deletePublicHoliday()
{
$d = $this->input->post('param1');
$res = $this->monthlypay_model->deleteHoliday($d);
if($res == 1){
echo "Deleted Successfully..!";
@ -62,6 +63,7 @@ class monthlypay extends BaseController
foreach($phpdata as $d)
{
if(!empty($d->Holiday_Name)){
$hname = $d->Holiday_Name;
$hdate = date_format(date_create($d->Date),'Y-m-d');
@ -79,7 +81,7 @@ class monthlypay extends BaseController
$count = $this->monthlypay_model->saveHolidays($tostore,'u');
$total = $total + $count;
}
}
}
echo $total . "-Holiday(s) Saved Successfully..!";
@ -88,6 +90,7 @@ class monthlypay extends BaseController
function attendanceLoad()
{
$month['month'] = '';
$monthdays = 0;
$begin = 0;
@ -117,6 +120,8 @@ class monthlypay extends BaseController
$begin = new DateTime($year.'-'.$month.'-01');
$end = new DateTime($year.'-'.$month.'-'.$monthdays);
}
$sundayarray =array();
while ($begin <= $end)
{

View File

@ -420,24 +420,14 @@ function phpAlert($msg) {
if(empty($this->input->post('finyear')))
{
echo "DEFAULT LOAD";
//echo "DEFAULT LOAD";
$year = date("Y");
$month = date("m");
$currentyear = '';
$nxtyear = '';
$source = $this->input->post('source');
$data['selsource'] = 'Company';
// if($month >= 4)
// {
// $currentyear = $year;
// $nxtyear = ($year+1);
// }
// else
// {
// $currentyear =($year-1);
// $nxtyear = $year;
// }
}
else
@ -445,7 +435,7 @@ function phpAlert($msg) {
if(!empty($this->input->post('finyear')))
{
echo "FIN YEAR WITH SOURCE";
//echo "FIN YEAR WITH SOURCE";
$source = $this->input->post('source');
$data['selsource'] =$source;
$finyear = $this->input->post('finyear');
@ -1035,8 +1025,8 @@ function getEmployee()
{
$loanRecovered = strtoupper($loanRecovered);
}
$Incentive =$sheet->getCell('H'.$x)->getValue();
$Other_Deductions =$sheet->getCell('I'.$x)->getValue();
$Incentive =$sheet->getCell('G'.$x)->getValue();
$Other_Deductions =$sheet->getCell('H'.$x)->getValue();
if( $EmpId != '')
{

View File

@ -0,0 +1,104 @@
<?php if(!defined('BASEPATH')) exit('No direct script access allowed');
class cashbook_model extends CI_Model
{
function getAccounTypes()
{
$this->db->where('status',1);
$r = $this->db->get('t_accountcode');
return $r->result();
}
function saveIncomeExpense($data)
{
$this->db->insert('t_income_expense',$data);
$r = $this->db->affected_rows();
return $r;
}
function getIncomeExpenseList($i="")
{
$this->db->select('t_accountcode.name,T_Employee_Details.FirstName,T_Employee_Details.LastName,t_income_expense.*');
$this->db->from('t_income_expense');
$this->db->join('t_accountcode','t_income_expense.account_code=t_accountcode.code');
$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))
{
$this->db->where('t_income_expense.id',$i);
}
$r = $this->db->get();
return $r->result();
}
function getCompany()
{
$r = $this->db->get('T_Company_Details');
return $r->result();
}
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();
}
function Selectcash()
{
$this->db->select('*');
$this->db->from('t_accountcode');
$query = $this->db->get();
$result = $query->result();
return $result;
}
function Cashbook($cashbookdatas)
{
$code=$cashbookdatas['code'];
$type=$cashbookdatas['type'];
$count=0;
$this->db->select('count(*) as count');
$this->db->from('t_accountcode');
$this->db->where('type',$type);
$this->db->where('code',$code);
$isExits = $this->db->get();
$res = $isExits->result_array();
if(!empty($res))
{
$count = $res[0]['count'];
}
if($count == 0 )//for cashbook_insert
{
$cbi = $this->db->insert('t_accountcode', $cashbookdatas);
return $cbi;
}
elseif($count == 1)//for cashbook_update
{
$this->db->where('code',$code);
$cbu = $this->db->update('t_accountcode',$cashbookdatas);
return $cbu;
}
}
}
?>

View File

@ -113,7 +113,7 @@ class monthlypay_model extends CI_Model
function deleteHoliday($d)
{
//echo "from Model" . $d;
$d = date_format(date_create($d),'Y-m-d');
$this->db->where('H_date',$d);
$this->db->delete('T_Public_Holidays');
return $this->db->affected_rows();

View File

@ -0,0 +1,468 @@
<?php //print_r($dropdownvalues);?>
<script>
$(function() {
var t = [];
var ex = [];
var inc = [];
t= <?php echo json_encode($dropdownvalues)?>;
$.each(t,function(i,item){
if(item.type == 'INCOME')
{
$("#accode").append( $('<option></option>').val(item.code).html(item.name));
}
});
$('#gst').click(function(){
$('#gstarea').toggle();
});
$('#towhom').text('Received From:');
$("#Date").datepicker({
//minDate : new Date(year-SIAStartYear,1,1),
maxDate :'now',
dateFormat: 'dd-mm-yy',changeMonth: true, changeYear: true,
});
});
function readURL(input) {
if (input.files && input.files[0]) {
var reader = new FileReader();
reader.onload = function (e) {
$('#slip')
.attr('src', e.target.result)
.width(100)
.height(100);
//alert(e.target.result);
};
reader.readAsDataURL(input.files[0]);
$('#slip').val(input.files[0]['name']);
}
}
function isNumberKey(evt)
{
var charCode = (evt.which) ? evt.which : evt.keyCode;
if (charCode != 46 && charCode > 31
&& (charCode < 48 || charCode > 57))
return false;
return true;
}
function loadAccountType(id)
{
//alert('called'+id);
var id=id;
var t = [];
var ex = [];
var inc = [];
t= <?php echo json_encode($dropdownvalues)?>;
if(id == 'myradio1')
{
// alert('INCOME clicked');
$('#accode').find('option').remove().end().append('<option value="-1">Select Account Name</option>').val('Select Account Code');
$.each(t,function(i,item){
if(item.type == 'INCOME')
{
$("#accode").append( $('<option></option>').val(item.code).html(item.name));
}
});
}
if(id == 'myradio2')
{
//alert('expense clicked');
$('#accode').find('option').remove().end().append('<option value="-1">Select Account Name</option>').val('Select Account Code');
$.each(t,function(i,item){
if(item.type == 'EXPENSE')
{
$("#accode").append( $('<option></option>').val(item.code).html(item.name));
}
});
}
//alert('final alert');
}
</script>
<div class="content-wrapper" style="min-height: 537px;">
<!-- Content Header (Page header) -->
<section class="content-header">
<h1>
<center>Siddharth Industries - Add New Income and Expense</center>
</h1>
</section>
<section class="content">
<div style="text-align:right;">
<a href="<?php base_url() ?>ViewIncomeExpense" class="btn btn-primary" value="Back"/>Back</a>
</div>
<br>
<div class="row">
<!-- left column -->
<div class="col-md-12">
<!-- general form elements -->
<div class="box box-primary">
<!-- form start -->
<form role="form" id="addIncomeExpense" action="<?php echo base_url() ?>addIncomeExpense" enctype="multipart/form-data" method="post">
<div class="box-body">
<div class="row">
<div class="col-md-12">
<div class="col-md-3">
<div class="form-group">
<b><span for="Accountcode">Select Accounut type:</span> </b> </br></br>
<input type="radio" onclick = loadAccountType(this.id); id="myradio1" name="myradio" value="1" checked>Income &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<input type="radio" onclick = loadAccountType(this.id); id="myradio2" name="myradio" value="2" >Expense
</div>
</div>
<div class="col-md-3">
<div class="form-group"><b>
<span for="PONO">Accounut Name Select:</span> </b><span style="color:red">*</span> </br></br>
<select class="form-control required " required id="accode" required name="accode">
<option value="-1">Account Name Select</option>
</select>
</div>
</div>
<div class="col-md-3">
<div class="form-group">
<b>
<span for="PODescription">Date:</span></b><span style="color:red">*</span></br></br>
<input type="text" class="form-control required" id="Date" name="Date">
</div>
</div>
<div class="col-md-3">
<div class="form-group">
<b>
<span for="towhome" id="towhom">AAA</span></b><span style="color:red">*</span></br></br>
<input type="text" class="form-control required" id="towhome" name="towhome">
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-md-12">
<div class="col-md-3">
<input type="checkbox" id="gst" name="gsttoggle"> GST
</div>
</div>
</div>
<div class="row" id="gstarea" style="border:1px dashed; margin-left:0px;margin-right:0px;display:none;">
<div class="col-md-12">
<div class="col-md-3">
<div class="form-group">
<b><span for="Invoiceno">Invoice No:</span></b>
<input type="text" class="form-control required" id="Invoiceno" name="Invoiceno">
</div>
</div>
<div class="col-md-3">
<div class="form-group">
<b><span for="Merchant">Merchant Name:</span></b>
<input type="text" class="form-control required" id="merchant" name="merchant">
</div>
</div>
<div class="col-md-3">
<div class="form-group">
<b>
<span for="Merchantgst">Merchant GST No:</span></b>
<input id="merchantgst" name="Merchantgst" class="form-control">
</div>
</div>
<div class="col-md-3">
<div class="form-group">
<b>
<span for="HSN/SAC Code">HSN/SAC Code:</span></b>
<input id="hsn" name="hsn" 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>
<input id="valuebeforegST" name="valuebeforegST" style="text-align:right;" class="form-control" onkeypress="return isNumberKey(event)">
</div>
</div>
<div class="col-md-3">
<div class="form-group">
<b>
<span for="SGST">SGST:</span>
</b>
<input type="text" class="form-control" style="text-align:right;" onchange="GSTvalue(this.id)" id="SGST" name="SGST" onkeypress="return isNumberKey(event)">
</div>
</div>
<div class="col-md-3">
<div class="form-group">
<b>
<span for="CGST">CGST:</span>
</b>
<input type="text" class="form-control" id="CGST" style="text-align:right;" name="CGST" onkeypress="return isNumberKey(event)">
</div>
</div>
<div class="col-md-3">
<div class="form-group">
<b>
<span for="IGST">IGST:</span></b>
<input type="text" class="form-control required" style="text-align:right;" onkeypress="return isNumberKey(event)" onchange = GSTvalue(this.id) id="IGST" name="IGST">
</div>
</div>
</div>
</div> <!-- /End of GST Area -->
<div class="row">
<div class="col-md-12">
<div class="col-md-4">
<b><span for="Total">Total Amount:</span></b><span style="color:red">*</span>
<input type="text" class="form-control" id="totalamount" name="totalamount" onkeypress="return isNumberKey(event)" style="text-align:right;" >
</div>
</div>
</div>
<div class="row">
<div class="col-md-12">
<div class="col-md-4">
<b><span for="Description">Description:</span></b>
<textarea class="form-control" id="description" name="description" >
</textarea>
</div>
<div class="col-md-4">
<b><span for="Description">File Upload:</span></b>
<img id="slip" alt="your image" style="width: 139px;"/><br/>
<input type='file' input accept=".JPG,.PNG" onchange="readURL(this);" id="file" name="myfile" accept="image/*"/>
</div>
</div>
</div>
<!-- /.box-body -->
<div class="box-footer" style="text-align:right">
<input type="button" onclick="validate();"class="btn btn-primary" value="Submit" />
<input type="reset" class="btn btn-primary" value="Reset" />
</div>
</div>
</form>
</div>
<div class="col-md-4">
<?php
$this->load->helper('form');
$error = $this->session->flashdata('error');
if($error)
{
?>
<div class="alert alert-danger alert-dismissable">
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
<?php echo $this->session->flashdata('error'); ?>
</div>
<?php } ?>
<?php
$success = $this->session->flashdata('success');
if($success)
{
?>
<div class="alert alert-success alert-dismissable">
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
<?php echo $this->session->flashdata('success'); ?>
</div>
<?php } ?>
<div class="row">
<div class="col-md-12">
<?php echo validation_errors('<div class="alert alert-danger alert-dismissable">', ' <button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button></div>'); ?>
</div>
</div>
</div>
</div>
</div>
</section>
</div>
<script>
function validate()
{
var accode = $('#accode').val();
var date = $('#Date').val();
var towhome = $('#towhome').val();
var gstcheck = document.getElementById("gst").checked;
var Invoiceno = $('#Invoiceno').val();
var merchant = $('#merchant').val();
var mergst = $('#merchantgst').val();
var beforegst = $('#valuebeforegST').val();
var sgst = $('#SGST').val();
var cgst = $('#CGST').val();
var igst = $('#IGST').val();
var total = $('#totalamount').val();
var errorflag = 0;
if(accode < 0)
{
errorflag++;
}
if(date == '')
{
errorflag++;
}
if(total == '')
{
errorflag++;
}
if(towhome == '')
{
errorflag++;
}
if(gstcheck == true)
{
if((merchant == '') || (mergst == '') || (Invoiceno == '') || (beforegst == '') || (sgst == '') || (cgst == '') || (igst == ''))
{
errorflag++;
}
else
{
// calculation part
}
}
// alert(errorflag);
if(errorflag != 0)
{
alert("Please Provide All Details..!");
return false;
}
$('#addIncomeExpense').submit();
}
function GSTvalue(id)
{
var sgst = $('#SGST').val();
var cgst = $('#CGST').val();
var igst = $('#IGST').val();
var beforegst = $('#valuebeforegST').val();
$('#valuebeforegST').val((parseFloat(beforegst).toFixed(2)));
if(id == 'SGST')
{
$('#CGST').val(parseFloat(sgst).toFixed(2));
$('#SGST').val(parseFloat(sgst).toFixed(2));
$('#IGST').val('0.00');
calculateTotal();
}
if(id == 'IGST')
{
$('#CGST').val('0.00');
$('#SGST').val('0.00');
$('#IGST').val(parseFloat(igst).toFixed(2));
calculateTotal();
}
}
function calculateTotal()
{
var sgst = $('#SGST').val();
var cgst = $('#CGST').val();
var igst = $('#IGST').val();
var beforegst = $('#valuebeforegST').val();
var total = parseFloat(sgst)+parseFloat(cgst)+parseFloat(igst)+parseFloat(beforegst);
$('#totalamount').val((total.toFixed(2)));
}
$('#myradio1').click(function(){
$('#towhom').text('Received From:');
});
$('#myradio2').click(function(){
$('#towhom').text('Paid To:');
});
</script>

View File

@ -18,7 +18,7 @@ $datefordropdown = date_create($datefordropdown);
$datefordropdown = date_format($datefordropdown,'M-Y');
//echo $datefordropdown;
$attendance = array_merge($attendance,$emppay);
// echo count($attendance) ."<br>";
$currentday = date('d');
// print_r($attendance);
// echo "<br>------------------------------<br>";
@ -207,6 +207,7 @@ $attendance = array_merge($attendance,$emppay);
</div>
</div>
</div><!-- /.box-header -->
@ -322,6 +323,13 @@ $attendance = array_merge($attendance,$emppay);
$flag =0;
$flag2 = 0;
$todayflag = 0;
if($col == $currentday)
{
$todayflag = 1;
}
foreach($sundayarray as $in) //For Find out Sundays($ind) from $monthdays array
{
if($in == $col)
@ -348,11 +356,12 @@ $attendance = array_merge($attendance,$emppay);
?>
<th <?php if($flag == 1){ ?> title = "Sunday" <?php }else if($flag2 == 1){ ?> title = <?php echo $title; }?> class="celda_encabezado_general"<?php if($flag == 1 or $flag2 == 1){echo "style='background: #f39c12 ;'";}?> ><?php if($flag == 1 or $flag2 == 1){echo "<font style='color:#ff0000;'>".$col . "W<font>";}else{echo $col."W";}?></th>
<th <?php if($flag == 1){ ?> title = "Sunday" <?php } else if($flag2 == 1){ ?> title = <?php echo $title; }?> class="celda_encabezado_general" <?php if($flag == 1 or $flag2 == 1){echo "style='background: #f39c12 ;'";}?>><?php if($flag == 1 or $flag2 == 1){echo "<font style='color:#ff0000;'>".$col . "OT<font>";}else{echo $col."OT";}?></th>
<th <?php if($flag == 1){ ?> title = "Sunday" <?php }else if($flag2 == 1){ ?> title = <?php echo $title; }?> class="celda_encabezado_general"<?php if($flag == 1 or $flag2 == 1){echo "style='background: #f39c12 ;'";}else if($todayflag == 1){ echo "style='background: #dd99ff ;'"; } ?> ><?php if($flag == 1 or $flag2 == 1){echo "<font style='color:#ff0000;'>".$col . "W<font>";}else{echo $col."W";}?></th>
<th <?php if($flag == 1){ ?> title = "Sunday" <?php } else if($flag2 == 1){ ?> title = <?php echo $title; }?> class="celda_encabezado_general" <?php if($flag == 1 or $flag2 == 1){echo "style='background: #f39c12 ;'";}else if($todayflag == 1){ echo "style='background: #dd99ff ;'"; }?>><?php if($flag == 1 or $flag2 == 1){echo "<font style='color:#ff0000;'>".$col . "OT<font>";}else{echo $col."OT";}?></th>
<?php
$flag =0;
$flag2 =0;
$todayflag = 0;
}?>
<th class="celda_encabezado_general" >Total Hrs</th>
<th class="celda_encabezado_general" >OT Hrs</th>
@ -375,6 +384,13 @@ $attendance = array_merge($attendance,$emppay);
<?php for ($col =1; $col <= $monthdays;$col++){
$flag =0;
if($col == $currentday)
{
$todayflag = 1;
}
foreach($sundayarray as $in)
{
if($in == $col)
@ -402,11 +418,12 @@ $attendance = array_merge($attendance,$emppay);
$OT = 'OT'.$col;
?>
<td <?php if($flag == 1){ ?> title = "Sunday" <?php }else if($flag2 == 1 ){ ?> title = <?php echo $title; } ?> class="celda_normal" onkeyup="myFunction(this.parentNode.id,this.id,this.textContent);" id ="<?php if($flag == 1 or $flag2 == 1) {echo $row.$col.'WS';}else{echo $row.$col.'W';}?>" <?php if($flag == 1 or $flag2 == 1){echo "style='background: #f9cd86 ;'";}?> contenteditable = "true"><?php if(!empty($a->$WH)){echo $a->$WH;}else{echo "0";}?></td>
<td <?php if($flag == 1){ ?> title = "Sunday" <?php }else if($flag2 == 1 ){ ?> title = <?php echo $title; } ?> class="celda_normal" onkeyup="myFunction(this.parentNode.id,this.id,this.textContent);" id ="<?php if($flag == 1 or $flag2 == 1) {echo $row.$col.'OTS';}else{echo $row.$col.'OT';}?>" <?php if($flag == 1 or $flag2 == 1){echo "style='background: #f9cd86 ;'";}?> contenteditable = "true"><?php if(!empty($a->$OT)){echo $a->$OT;}else{echo "0";}?></td>
<td <?php if($flag == 1){ ?> title = "Sunday" <?php }else if($flag2 == 1 ){ ?> title = <?php echo $title; } ?> class="celda_normal" onkeyup="myFunction(this.parentNode.id,this.id,this.textContent);" id ="<?php if($flag == 1 or $flag2 == 1) {echo $row.$col.'WS';}else{echo $row.$col.'W';}?>" <?php if($flag == 1 or $flag2 == 1){echo "style='background: #f9cd86 ;'";} else if($todayflag == 1){ echo "style='background: #f7e6ff ;'"; }?> contenteditable = "true"><?php if(!empty($a->$WH)){echo $a->$WH;}else{echo "0";}?></td>
<td <?php if($flag == 1){ ?> title = "Sunday" <?php }else if($flag2 == 1 ){ ?> title = <?php echo $title; } ?> class="celda_normal" onkeyup="myFunction(this.parentNode.id,this.id,this.textContent);" id ="<?php if($flag == 1 or $flag2 == 1) {echo $row.$col.'OTS';}else{echo $row.$col.'OT';}?>" <?php if($flag == 1 or $flag2 == 1){echo "style='background: #f9cd86 ;'";}else if($todayflag == 1){ echo "style='background: #f7e6ff ;'"; }?> contenteditable = "true"><?php if(!empty($a->$OT)){echo $a->$OT;}else{echo "0";}?></td>
<?php $flag =0;
$flag2 =0;
$flag2 =0;
$todayflag = 0;
}?>
<td class="celda_normal" id="<?php echo $row.'TH';?>"><?php if(!empty($a->Total_WHrs)){echo $a->Total_WHrs;}else{echo "0.00";}?></td>
<td class="celda_normal" id="<?php echo $row.'OTH';?>"><?php if(!empty($a->Total_OTHrs)){echo $a->Total_OTHrs;}else{echo "0.00";}?></td>
@ -568,22 +585,16 @@ function myFunction(p,i,v)
}
if(id == 'W' && v > 8){ // checking working hrs vallue is more than 8, if it is set as OT Hrs more than 8
if(len == 3)
{
nxtid = i.substr(1,1)
}
else if(len == 4)
{
nxtid = i.substr(1,2)
}
var j='#'+i;
var nextid = $(j).closest('td').next('td');
nxtid = nextid[0].attributes[2].value;
//console.log(nextid[0].attributes[2].value);
nxtvalue = v-8;
curvalue = 8;
nxtid = p+nxtid+'OT';
curid = i;
document.getElementById(i).innerHTML = parseFloat(curvalue)
document.getElementById(nxtid).innerHTML = parseFloat(nxtvalue)
@ -629,74 +640,33 @@ function myFunction(p,i,v)
}
if((index != 0) && (index !=1) && (index != 2))// && (index > totaldays))
{
//alert(value.id+"-"+value.textContent);
var str = value.id;
var str1 = str.substr(-1);
var str2 = str.substr(-2);
var str3 = str.substr(-3);
if(str1 == 'W')
{
var current = value.textContent == '' ? 0:parseFloat(value.textContent);
totalworkingHrs += current;
if(current == 0){paidleave++;}
}
else
{
var current = value.textContent == '' ? 0:parseFloat(value.textContent);
totalOTHrs = totalOTHrs+current;
var str = value.id;
var temp = str.length;
var res = '';
switch(temp)
{
case 3:
var current = value.textContent == '' ? 0:parseFloat(value.textContent);
totalworkingHrs += current;
if(current == 0){paidleave++;}
break;
case 4: res = str.substr(-2);
if(res == 'OT' )
{
var current = value.textContent == '' ? 0:parseFloat(value.textContent);
totalOTHrs = totalOTHrs+current;
}
else if(res == 'WS')
{
var current = value.textContent == '' ? 0:parseFloat(value.textContent);
totalOTHrs = totalOTHrs+current;
}else
{
var current = value.textContent == '' ? 0:parseFloat(value.textContent);
totalworkingHrs += current;
if(current == 0){paidleave++;}
}
break;
case 5: res = str.substr(-3);
if(res == 'OTS' )
{
var current = value.textContent == '' ? 0:parseFloat(value.textContent);
totalOTHrs = totalOTHrs+current
}
else
{
res = str.substr(-2);
if(res == 'WS')
{
var current = value.textContent == '' ? 0:parseFloat(value.textContent);
totalOTHrs = totalOTHrs+current
}
else if(res == 'OT')
{
var current = value.textContent == '' ? 0:parseFloat(value.textContent);
totalOTHrs = totalOTHrs+current;
}
}
break;
case 6: res = str.substr(-3);
if(res == 'OTS' )
{
var current = value.textContent == '' ? 0:parseFloat(value.textContent);
totalOTHrs = totalOTHrs+current;
}
break;
default://alert('Nothing');
}
}
}
}
}
});
// break;
});
if(paidleave == 1 )
@ -715,7 +685,7 @@ function myFunction(p,i,v)
document.getElementById(totalothrsid).innerHTML = parseFloat(totalOTHrs).toFixed(2);// == ''?0:parseFloat(totalOTHrs));
document.getElementById(paidleaveid).innerHTML = parseFloat(paidleave).toFixed(2);
document.getElementById(daysworkedid).innerHTML = parseFloat((totalworkingHrs/8)+sundays+publicholidays).toFixed(2);
document.getElementById(absentid).innerHTML = parseFloat(absent).toFixed(2);
document.getElementById(absentid).innerHTML = parseFloat(absent).toFixed(2);
}

View File

@ -0,0 +1,208 @@
<script src="<?php echo base_url()?>assets/lightswitch/lightswitch/lib/jquery.tabletojson.js"></script>
<script src="<?php echo base_url()?>assets/lightswitch/lightswitch/lib/jquery.tabletojson.min.js"></script>
<div class="content-wrapper">
<section class="content" id="loadingcontent">
<div>
<CENTER><h3>Siddharth Industries - Cashbook Listing</h3></CENTER>
</div>
<div class="box">
<div class="box-header">
<!-- <CENTER><h1 class="box-title">Siddharth Industries Cashbook Listing</h1></CENTER> -->
</div>
<form role="form" id="cashbookform" action="<?php echo base_url()?>" method="post" enctype="multipart/form-data">
<div class="container-fluid">
<div class="row">
<div class="col-xs-12 col-md-12">
<legend>Cash book / Account details</legend>
<div class="col-md-12">
<div class="col-md-3"><span>Account Type :</span>&nbsp;&nbsp;<span style="color:#ff6347;">*</span><br>
<input type="radio" name="accounttype" id="accounttype" value="INCOME" checked> Income<br>
<input type="radio" name="accounttype" id="accounttype" value="EXPENSE"> Expense<br>
</div><p style="color:red"></p>
<div class="col-md-3 pad"><span>Account Code :</span>&nbsp;&nbsp;<span style="color:#ff6347;">*</span>
<input type="text" name="accountcode" id="accountcode" class="form-control" requried placeholder="Account Code" title="Account Code is requried">
</div><p style="color:red"></p>
<div class="col-md-3 pad"><span>Account Name :</span>&nbsp;&nbsp;<sapn style="color:#ff6347;">*</span>
<input type="text" name="accountname" id="accountname" class="form-control" placeholder="Account Name" title="Account Name is requried" class="tooltip" onfocus="theFocus(this);" onblur="theBlur(this);">
</div><p style="color:red"></p>
<div class="col-md-3 pad"><span>Description :</span>
<input type="email" name="description" id="description" class="form-control" placeholder="Account Description">
</div>
<input type="hidden" id="accountstate" name="accountstate" class="form-control" value="Yes" >
</div><br>
<div class="row" style="align:right;">
<div class="col-md-offset-10 col-md-1 ">
<input type="button" value="Add" id="Add" class="btn btn-primary"> </div>
<div class=" col-md-1">
<input type="button" value="Save" onclick="saveAll();" class="btn btn-primary"> </div>
</div>
</div>
</div>
<legend>Cash book / Account Tables</legend>
<div class="row">
<div class="col-xs-12">
<table id="cashbooktable" class="table table-hover table-bordered" style="background-color:#fff;font-size:12px;" >
<thead style="background-color:#ddf">
<tr>
<th>AccountCodeType</th>
<th>AccountCode</th>
<th>AccountName</th>
<th>Description</th>
<th>Status</th>
</tr>
</thead>
<tbody id="databaseAppend">
<?php
if(!empty($cashbook))
{
foreach($cashbook as $cb){
?>
<tr>
<td><?php echo $cb->type ?></td>
<td><?php echo $cb->code ?></td>
<td contenteditable='true'><?php echo $cb->name ?></a></td>
<td contenteditable='true'><?php echo $cb->description?></a>
<td contenteditable='true'><?php if($cb->status == 1 )
{
echo 'Yes';
//echo strtoupper('Yes');
}
else
{
echo 'No';
//echo strtoupper('No');
}
?></td></tr>
<?php
}
}
?> </tbody>
</table>
</div>
</div>
</div>
</div>
</form>
</div>
</section>
</div>
<script type="text/html" id="addList">
<tr id="<%=index%>">
<td align="left"><%=AccountCodeType%></td>
<td align="left"><%=AccountCode%></td>
<td align="left" contenteditable="true"><%=AccountName%></td>
<td align="left" contenteditable="true"><%=Description%></td>
<td align="left" contenteditable="true"><%=Status%></td>
</tr>
</script>
<script>
var index = '1';
$('#Add').click(function(){
var temp = index;
var Acctype = $("#accounttype:checked").val() ;
var Acccode = $('#accountcode').val();
var Accname = $('#accountname').val();
var Accdesc = $('#description').val();
var Status = $('#accountstate').val();
//if(Acctype != '' || Accname != '' || Acccode != '' )
if(Accname != '' || Acccode != '')
{
//var radioValue = $("input[name='accounttype']:checked").val();
if (Acccode == ''){
$('#accountcode').focus();
alert('Account code is requried');
//$("#accountcode").attr('title', 'account code is requried');
return false;
}
else if (Accname == ''){
$('#accountname').focus();
alert('Account Name is requried');
return false;
}//valid if closed
else{
var template = jQuery("#addList").html();
index = parseInt(index)+1;
//$('table tr.odd').remove();//class="dataTables_empty"
//$('.odd').remove();//
$('#databaseAppend').append(_.template(template,{index:temp,AccountCodeType:Acctype,AccountCode:Acccode,AccountName:Accname,Description:Accdesc,Status:Status}));
}//nearest else closed
}// nearest if closed
//$('input[name="accounttype"]').attr('checked', false);
$('#accountcode').val('');
$('#accountname').val('');
$('#description').val('');
});//add click function closed
</script>
<script type="text/javascript">
$(function () {
$('#cashbooktable').DataTable({
"paging": true,
"lengthChange": true,
"searching": true,
"ordering": true,
"info": true,
"autoWidth": true
});
});
function saveAll()
{
// alert("dssj");
$('#loadingcontent').loader('show');
var tablevalue = $('#cashbooktable').tableToJSON(); // Convert the table into a javascript object
var value = JSON.stringify(tablevalue);
$.ajax({
data:{id:value},
type:"POST",
url:"<?php echo base_url() ?>cashbook/cashbookdtl",
success:function(data){
$('#loadingcontent').loader('hide');
alert(data);
window.location.href="addNewIncomeExpenseLoad";
}//success function closed
});//ajax function closed
}
</script>

View File

@ -0,0 +1,91 @@
<?php
$label ='Received From ';
if(($data[0]->type) == 'EXPENSE')
{
$label ='Paid To ';
}
$pic = base_url().'uploads/images/'.$company[0]->ProfilePic;
?>
<br><br><br><br>
<table width="100%" style="font-size:13px;">
<tbody>
<tr style="height: 57px;">
<td style="width: 89px; height: 57px;"><img src='<?php echo $pic;?>' ></td>
<td style="width: 89px; height: 57px;" colspan="5">
<h1><?php echo $company[0]->CompanyName;?></h1><br /><?php echo $company[0]->Address;?><br />Mobile <?php echo $company[0]->AlternateContactNumber;?> <br> E-mail <?php echo $company[0]->EmailAddress;?></a><br>GSTIN : <?php echo $company[0]->GSTNO;?>
</td>
</tr>
<hr>
<tr style="height: 25px;">
<td style="width: 89px; height: 25px; text-align: center;" colspan="6"><h3>CASH VOUCHER</h3></td>
</tr>
<tr style="height: 26px;">
<td style="width: 100px; height: 26px;">&nbsp;Voucher Number </td>
<td style="width: 89px; height: 26px;" colspan="3"><?php echo $data[0]->id;?></td>
<hr>
<td style="width: 90px; height: 197px;text-align: center;" colspan="2" rowspan="5"><p> <h1>Rs <?php echo $data[0]->total;?></h1></p>Amount &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td>
</tr>
<tr style="height: 26px;">
<td style="width: 100px; height: 26px;">&nbsp;Date </td>
<td style="width: 89px; height: 26px;" colspan="3"><?php echo $data[0]->date;?></td>
<hr>
</tr>
<tr style="height: 26px;">
<td style="width: 100px; height: 26px;">&nbsp;<?php echo $label;?></td>
<td style="width: 89px; height: 26px;" colspan="3"><?php echo $data[0]->towhom;?></td>
<hr>
</tr>
<tr style="height: 46px;">
<td style="width: 100px; height: 46px;">&nbsp;Amount (In Words)</td>
<td style="width: 89px; height: 46px;" colspan="3"><b><?php echo $amtinwords;?></b></td>
</tr>
<tr style="height: 73px;">
<td style="width: 89px; height: 73px;">
<p>&nbsp;Remarks </p>
</td>
<td style="width: 89px; height: 73px;" colspan="3"><?php echo $data[0]->description;?></td>
</tr>
<tr style="height: 26px;">
<td style="width: 89px; height: 26px;">&nbsp;</td>
<td style="width: 89px; height: 26px;">&nbsp;</td>
<td style="width: 89px; height: 26px;">&nbsp;</td>
<td style="width: 90px; height: 26px;">&nbsp;</td>
<td style="width: 90px; height: 26px;">Prepared By &nbsp;</td>
<td style="width: 90px; height: 26px;"><?php echo $data[0]->FirstName.'&nbsp;'.$data[0]->LastName;?></td>
<hr>
</tr>
<tr style="height: 26px;">
<td style="width: 89px; height: 26px;">Checked By </td>
<td style="width: 89px; height: 26px;">&nbsp;</td>
<hr>
</tr>
<tr style="height: 26px;">
<td style="width: 89px; height: 26px;">Verified By</td>
<td style="width: 89px; height: 26px;">&nbsp;</td>
<hr>
</tr>
<tr style="height: 90px;">
<td style="width: 89px; height: 90px;" colspan="3">
<p>&nbsp;</p>
<p>&nbsp;</p>
<p style="text-align: center;">&nbsp;Authorized Signature</p>
</td>
<td style="width: 90px; height: 90px;" colspan="3">
<p>&nbsp; &nbsp;</p>
<p>&nbsp;</p>
<p style="text-align: center;">Receiver's Signature</p>
</td>
</tr>
<tr style="height: 26px;">
<td style="width: 89px; height: 26px; text-align: center;" colspan="6">Note : Above Rs.750/- With Revenue Stamp &amp; Signature &nbsp; &nbsp; &nbsp;</td>
</tr>
</tbody>
</table>

View File

@ -592,6 +592,24 @@ $(function() {
</li>
</ul>
</li>
<li class="treeview">
<span id="menu" data-toggle="dropdown" ><i class="fa fa-money"></i> Cash Book <span class="caret"></span></span>
<ul class="dropdown-menu" role="menu" aria-labelledby="menu3">
<li class="treeview">
<a href="<?php echo base_url(); ?>cashbook/CashbookList">
<i class="fa fa-vcard"></i> <span>Account Master</span>
</a>
</li>
<li class="treeview">
<a href="<?php echo base_url(); ?>ViewIncomeExpense">
<i class="fa fa-credit-card"></i>
<span>Income and Expense</span>
</a>
</li>
</ul>
</li>

View File

@ -0,0 +1,84 @@
<CENTER><strong><h3 class="box-title">Siddharth Industries - Income & Expense List</h3></strong></CENTER>
<div class="content-wrapper">
<section class="content">
<div class="box">
<div class="box-header">
<div align="right" style="padding-right:10px">
<a href="addNewIncomeExpense" class="btn btn-primary" align="right"style="padding-right:10px" >Add New</a>
</div>
</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>Amount</th>
<th>Details</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 style="text-align:right;"><?php echo $l->total;?></td> <td><?php echo $l->description;?></td></tr>
<?php
}
}
?>
</tbody>
</table>
<br>
</div>
</div>
</div>
</div> </section>
</div>
<script>
$(function () {
$('#inexlist').DataTable({
"paging": true,
"lengthChange": true,
"searching": true,
"aaSorting": [[ 0, "desc" ]],
"ordering": true,
"info": true,
"autoWidth": true
});
});
</script>

View File

@ -144,7 +144,7 @@ $('html').bind('keypress', function(e)
<script type="text/javascript">
$(function () {
$('#phday0s').DataTable({
$('#phdays').DataTable({
"paging": true,
"lengthChange": true,
"searching": true,
@ -196,7 +196,7 @@ function DeleteRow(rowid)
$('#Add').click(function(){
var index = $('#phdays tr').length;
//alert(index);
var temp = index;
var H_name = $('#hname').val();
var H_date = $('#hdate').val();

View File

@ -0,0 +1,195 @@
<?php //print_r($data);
$extype= '';
$exname = '';
$flag = 0;
$invoiceno = '';
$document = '';
$label = '';
if(!empty($data))
{
$extype = $data[0]->type;//['type'];
$exname = $data[0]->name;//['name'];
$invoiceno = $data[0]->invoice_no;
$document =$data[0]->document;
if(!empty($invoiceno))
{
$flag = 1;
}
if($document == null)
{
$document = 'uploads/cashbook/noimage.png';
}
if($extype == 'INCOME')
{
$label = 'Received From:';
}
else
{
$label = 'Paid To:';
}
$final = base_url().$document;
//echo $final;
}
?>
<div class="content-wrapper">
<section class="content">
<div class="box">
<div class="box-header">
<div align="right" style="padding-right:10px">
<a href="<?php echo base_url()?>cashbook/incomeExpenseList/<?php echo $data[0]->id.'/pdf'?>" target="_blank" class="btn btn-primary" align="right"style="padding-right:10px" >Print</a>
</div>
</div>
<div class="box-body">
<div style="left-margin:10px;">
<legend><b><?php echo $extype."&nbsp;&nbsp;-&nbsp;&nbsp;".$exname;?><b><legend>
</div>
<div class="col-md-12">
<div class="col-md-7">
<!-- <div class="col-md-12">
<div class="col-md-6">
<b>Date</b>
</div>
<div class="col-md-6">
:
</div>
</div>
<div class="col-md-12">
<div class="col-md-6">
Invoice No
</div>
<div class="col-md-6">
:
</div>
</div>
<div class="col-md-12">
<div class="col-md-6">
Merchant Name
</div>
<div class="col-md-6">
:
</div>
</div>
<div class="col-md-12">
<div class="col-md-6">
Merchant GST No
</div>
<div class="col-md-6">
:
</div>
</div>
<div class="col-md-12">
<div class="col-md-6">
HSN/SAC Code
</div>
<div class="col-md-6">
:
</div>
</div>
<div class="col-md-12">
<div class="col-md-6">
Value before GST
</div>
<div class="col-md-6">
:
</div>
</div>
<div class="col-md-12">
<div class="col-md-6">
SGST
</div>
<div class="col-md-6">
:
</div>
</div>
<div class="col-md-12">
<div class="col-md-6">
CGST
</div>
<div class="col-md-6">
:
</div>
</div>
<div class="col-md-12">
<div class="col-md-6">
IGST
</div>
<div class="col-md-6">
:
</div>
</div>
<div class="col-md-12">
<div class="col-md-6">
Total Amount
</div>
<div class="col-md-6">
:
</div>
</div>
<div class="col-md-12">
<div class="col-md-6">
Description
</div>
<div class="col-md-6">
:
</div>
</div> -->
<table id="viewIS">
<thead></thead>
<tbody>
<tr> <td style="text-align:right;"><h4>Date</h4></td> <td>&nbsp;&nbsp;&nbsp;&nbsp;</td><td style="text-align:right;"><?php if(!empty($data[0]->date)){echo $data[0]->date;}?></td></tr>
<tr> <td style="text-align:right;"><h4><?php echo $label;?></h4></td> <td>&nbsp;&nbsp;&nbsp;&nbsp;</td><td style="text-align:right;"><?php if(!empty($data[0]->towhom)){echo $data[0]->towhom;}?></td></tr>
<?php if($flag == 1){?>
<tr> <td style="text-align:right;"><h4>Invoice No</h4></td><td>&nbsp;&nbsp;&nbsp;&nbsp;</td> <td style="text-align:right;"><?php if(!empty($data[0]->invoice_no)){echo $data[0]->invoice_no;}?></td></tr>
<tr> <td style="text-align:right;"><h4>Merchant Name</h4></td><td>&nbsp;&nbsp;&nbsp;&nbsp;</td> <td style="text-align:right;"><?php if(!empty($data[0]->merchant)){echo $data[0]->merchant;}?></td></tr>
<tr> <td style="text-align:right;"><h4>Merchant GST No</h4></td> <td>&nbsp;&nbsp;&nbsp;&nbsp;</td><td style="text-align:right;"><?php if(!empty($data[0]->merchant_gst)){echo $data[0]->merchant_gst;}?></td></tr>
<tr> <td style="text-align:right;"><h4>HSN/SAC No</h4></td><td>&nbsp;&nbsp;&nbsp;&nbsp;</td> <td style="text-align:right;"><?php if(!empty($data[0]->HSN)){echo $data[0]->HSN;}?></td></tr>
<tr> <td style="text-align:right;"><h4>Value Before GST</h4></td> <td>&nbsp;&nbsp;&nbsp;&nbsp;</td><td style="text-align:right;"><?php if(!empty($data[0]->value_before_gst)){echo $data[0]->value_before_gst;}?></td></tr>
<tr> <td style="text-align:right;"><h4>SGST</h4></td> <td>&nbsp;&nbsp;&nbsp;&nbsp;</td><td style="text-align:right;"><?php if(!empty($data[0]->sgst)){echo $data[0]->sgst;}?></td></tr>
<tr> <td style="text-align:right;"><h4>CGST</h4></td><td>&nbsp;&nbsp;&nbsp;&nbsp;</td> <td style="text-align:right;"><?php if(!empty($data[0]->cgst)){echo $data[0]->cgst;}?></td></tr>
<tr> <td style="text-align:right;"><h4>IGST</h4></td><td>&nbsp;&nbsp;&nbsp;&nbsp;</td> <td style="text-align:right;"><?php if(!empty($data[0]->igst)){echo $data[0]->igst;}?></td></tr>
<?php }?>
<tr> <td style="text-align:right;"><h4>Total Amount</h4></td><td>&nbsp;&nbsp;&nbsp;&nbsp;</td> <td style="text-align:right;"><?php if(!empty($data[0]->total)){echo $data[0]->total;}?></td></tr>
<tr> <td style="text-align:right;"><h4>Description</h4></td> <td>&nbsp;&nbsp;&nbsp;&nbsp;</td><td style="text-align:right;"><?php if(!empty($data[0]->description)){echo $data[0]->description;}?></td></tr>
</tbody>
</table>
</div>
<div class="col-md-5" style="border:0px solid;">
<img id="receipt" src="<?php echo $final ?>" alt="No Receipt Available" style="width: 400px;height:400px;"/><br/>
</div>
</div>
</div>
</div>
</div> </section>
</div>
<script>
$(function () {
$('#inexlist').DataTable({
"paging": true,
"lengthChange": true,
"searching": true,
"aaSorting": [[ 0, "desc" ]],
"ordering": true,
"info": true,
"autoWidth": true
});
});
</script>