Siddharth Industries - Advance List
| Account Type | +DATE | +Account Name | +Cash Type | +Amount | +Details | +Action | +
|---|---|---|---|---|---|---|
| id.'">'.$l->type.'';?> | +date),'d-m-Y');?> | +name;?> | +cashtype;?> | +total;?> | +description;?> | ++ type; ?>." Details "> + + + | +
+
diff --git a/application/config/routes.php b/application/config/routes.php index 2b84208d..fd0f41c9 100755 --- a/application/config/routes.php +++ b/application/config/routes.php @@ -221,6 +221,7 @@ $route['Distribution'] = "MRIRcontroller/viewmMaterialDistributionList"; //<-------------Cashbook page-----------------> $route['ViewIncomeExpense'] = "cashbook/incomeExpenseList"; $route['EditIncomeExpense'] = "cashbook/editcashbook"; +$route['AdvanceList']="cashbook/AdvanceList"; $route['addNewIncomeExpense'] = "cashbook/addNewIncomeExpenseLoad"; $route['addIncomeExpense'] = "cashbook/addIncomeExpense"; $route['updateExpense'] = "cashbook/updateExpense"; diff --git a/application/controllers/cashbook.php b/application/controllers/cashbook.php index 3cfbb064..62c0b7a4 100755 --- a/application/controllers/cashbook.php +++ b/application/controllers/cashbook.php @@ -648,20 +648,87 @@ class cashbook extends BaseController //advance list public function AdvanceList() { - - - $this->load->model('cashbook_model'); - // $data['dropdownvalues1'] = $this->cashbook_model->getAccounTypes1(); - // print_r($data['dropdownvalues1']); - // die(); - $data['list'] = $this->cashbook_model->Selectadvance(); -// print_r($data); -// die(); - $this->global['pageTitle'] = 'Siddharth : Advance Listing'; - - $this->loadViews("Advancelisting", $this->global, $data, NULL); + + $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->getAdvanceList($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->getAdvanceList($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); + $this->global['pageTitle'] = 'Siddharth : Cash Book: Listing'; + + if ($this->input->post('btn_submit')) { + + $fromdt = $this->input->post('from_date'); + $todt = $this->input->post('to_date'); + $ab=$this->input->post('financialyear'); + + $fromyear=substr($ab,0,-5); + $toyear=substr($ab,5,5); + + + $data['finyear']=$this->cashbook_model->finyear(); + $data['list'] = $this->cashbook_model->getAdvance($fromyear,$toyear,$fromdt,$todt); + + } + else{ + + if (date('m') <= 3) { + $preyear = (date('Y')-1); + $currentyear = date('Y'); + } else { + $preyear = date('Y') ; + $currentyear = (date('Y') + 1); + } + + $data['list'] = $this->cashbook_model->getAdvance($preyear,$currentyear); + $data['finyear']=$this->cashbook_model->finyear(); + } + $this->loadViews("Advancelist", $this->global, $data , NULL); + } + + + } + + public function cashbookdtl() @@ -1305,10 +1372,11 @@ class cashbook extends BaseController } public function cashbanking() { + $this->global['pageTitle'] ='Siddharth :bankcashbook'; $data['dropdownvalues'] = $this->cashbook_model->getAccounTypes(); //$data['cashbanking'] = $this->cashbook_model->newcashbook(); $data['getsupplier'] = $this->cashbook_model->getsupplier(); - $this->global['pageTitle'] ='Siddharth :bankcashbook'; + $this->loadViews("bankcashnew", $this->global,$data,NULL); } diff --git a/application/controllers/emergencypurchaseorder.php b/application/controllers/emergencypurchaseorder.php index 744710f4..6dc40404 100644 --- a/application/controllers/emergencypurchaseorder.php +++ b/application/controllers/emergencypurchaseorder.php @@ -971,8 +971,8 @@ $RequestedBy = $this->input->post('drpDepartment'); $CreatedBy = $this->session->userdata('userId'); - - $igrDetails = array('IGRNO'=>$IGRNO,'MaterialCode'=>$MaterialCode,'QuantityAsPerInvoice'=>$QuantityAsPerInvoice,'Remarks'=>$Remarks,'IGRItemStatus'=>$IGRItemStatus,'CreatedBy'=>$CreatedBy,'CreatedDate'=>$createddt); + $bankstatus = NO_PAIDIGR; + $igrDetails = array('IGRNO'=>$IGRNO,'MaterialCode'=>$MaterialCode,'QuantityAsPerInvoice'=>$QuantityAsPerInvoice,'Remarks'=>$Remarks,'IGRItemStatus'=>$IGRItemStatus,'CreatedBy'=>$CreatedBy,'CreatedDate'=>$createddt,'BankStatus'=>$bankstatus); //print_r($igrDetails); diff --git a/application/models/cashbook_model.php b/application/models/cashbook_model.php index 7e0dba74..df2b1c04 100755 --- a/application/models/cashbook_model.php +++ b/application/models/cashbook_model.php @@ -47,6 +47,7 @@ class cashbook_model extends CI_Model $this->db->join('tbl_users','t_income_expense.Created_By=tbl_users.userId','left'); $this->db->join('T_Employee_Details','tbl_users.EmpID=T_Employee_Details.EmpID','left'); $this->db->where('t_income_expense.IsActive',1); + $this->db->where('t_income_expense.account_code !=','ADV001'); $this->db->order_by("date","desc"); if(!empty($i)) { @@ -56,6 +57,7 @@ class cashbook_model extends CI_Model $r = $this->db->get(); return $r->result(); } + function getIncomeExpense($firstyear,$secondyear,$frmdt,$todt) { $this->db->select('t_accountcode.name,cashtype,T_Employee_Details.FirstName,T_Employee_Details.LastName,t_income_expense.*'); @@ -64,6 +66,53 @@ class cashbook_model extends CI_Model $this->db->join('tbl_users','t_income_expense.Created_By=tbl_users.userId','left'); $this->db->join('T_Employee_Details','tbl_users.EmpID=T_Employee_Details.EmpID','left'); $this->db->where('t_income_expense.IsActive',1); + $this->db->where('t_income_expense.account_code !=','ADV001'); + if ($firstyear and $secondyear != '') + { + $finyear = "t_income_expense.date >= '".$firstyear."-04-01' and t_income_expense.date <= '".$secondyear."-03-31'"; + $this->db->where($finyear); + } + if ($frmdt and $todt != ''){ + $fromdate= date("Y-m-d",strtotime($frmdt)); + $todate=date("Y-m-d",strtotime($todt)); + $date = "date(t_income_expense.date) >= '".$fromdate."' + and date(t_income_expense.date) <= '".$todate."'"; + $this->db->where($date); + } + $this->db->order_by("date","desc"); + $r = $this->db->get(); + return $r->result(); + } + + function getAdvanceList($i="") + { + // echo $i; + $this->db->select('t_accountcode.name,cashtype,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','left'); + $this->db->join('tbl_users','t_income_expense.Created_By=tbl_users.userId','left'); + $this->db->join('T_Employee_Details','tbl_users.EmpID=T_Employee_Details.EmpID','left'); + $this->db->where('t_income_expense.IsActive',1); + $this->db->where('t_income_expense.account_code','ADV001'); + $this->db->order_by("date","desc"); + if(!empty($i)) + { + $this->db->where('t_income_expense.id',$i); + + } + $r = $this->db->get(); + return $r->result(); + } + + function getAdvance($firstyear,$secondyear,$frmdt,$todt) + { + $this->db->select('t_accountcode.name,cashtype,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','left'); + $this->db->join('tbl_users','t_income_expense.Created_By=tbl_users.userId','left'); + $this->db->join('T_Employee_Details','tbl_users.EmpID=T_Employee_Details.EmpID','left'); + $this->db->where('t_income_expense.IsActive',1); + $this->db->where('t_income_expense.account_code','ADV001'); if ($firstyear and $secondyear != ''){ $finyear = "t_income_expense.date >= '".$firstyear."-04-01' and t_income_expense.date <= '".$secondyear."-03-31'"; $this->db->where($finyear); diff --git a/application/views/Advancelist.php b/application/views/Advancelist.php new file mode 100644 index 00000000..5726522f --- /dev/null +++ b/application/views/Advancelist.php @@ -0,0 +1,314 @@ + + + + + + +
| Account Type | +DATE | +Account Name | +Cash Type | +Amount | +Details | +Action | +
|---|---|---|---|---|---|---|
| id.'">'.$l->type.'';?> | +date),'d-m-Y');?> | +name;?> | +cashtype;?> | +total;?> | +description;?> | ++ type; ?>." Details "> + + + | +