diff --git a/application/controllers/batchcard.php b/application/controllers/batchcard.php index b04af021..815b4197 100755 --- a/application/controllers/batchcard.php +++ b/application/controllers/batchcard.php @@ -728,6 +728,7 @@ class batchcard extends BaseController $data['emplist'] = $this->batchcard_model->getEmplistforReport(); $data['MachineList'] = $this->batchcard_model->getmachine_codename(); + $data['supplist'] = $this->batchcard_model->getSupplierlist(); $data['MaintEdit'] = $this->batchcard_model->getmaint_dtl_MntID($MntID); $data['MaintFileEdit'] = $this->batchcard_model->getfiledetails($MntID); //print_r($data); @@ -740,8 +741,14 @@ class batchcard extends BaseController $type = $this->input->post('radiobtn'); //$maintenance_date = $this->input->post('maintenance_date'); $machinecode = $this->input->post('machine'); - if($type == '0'){ $maintenance_subtype = $this->input->post('maintenance_subtype');} - else{ $maintenance_subtype = NULL; } + if($type == '0'){ + $maintenance_subtype = $this->input->post('maintenance_subtype'); + if($maintenance_subtype == '1'){ + $supplier = $this->input->post('supplier'); + } + else{ $supplier = NULL; } + } + else{ $maintenance_subtype = NULL;$supplier = NULL; } //$maintenance_time= $this->input->post('maintenance_time'); $location = $this->input->post('location'); $maintenance_description = $this->input->post('maintenance_description'); @@ -759,7 +766,7 @@ class batchcard extends BaseController $approvedby = $this->input->post('approvedby'); $workdoneby = $this->input->post('workdoneby'); - $addmntbr = array('Type'=>$type,'Machine_Code'=>$machinecode,'Maint_Subtype'=>$maintenance_subtype, 'Maint_Location'=>$location, 'Maint_Description'=>$maintenance_description, 'Maint_Reason'=>$maintenance_reason, 'Maint_Time_from'=>$maintenance_time_from, 'Maint_Time_to'=>$maintenance_time_to, 'Maint_Total_hrs'=>$maintenance_total_hrs, 'Cost_Material'=>$cost_material, 'Cost_Labour'=>$cost_labour,'WorkDone_By'=>$workdoneby,'Approved_By'=>$approvedby,'CreatedBy'=>$createdby); + $addmntbr = array('Type'=>$type,'Machine_Code'=>$machinecode,'Maint_Subtype'=>$maintenance_subtype, 'Maint_Supplier'=>$supplier,'Maint_Location'=>$location, 'Maint_Description'=>$maintenance_description, 'Maint_Reason'=>$maintenance_reason, 'Maint_Time_from'=>$maintenance_time_from, 'Maint_Time_to'=>$maintenance_time_to, 'Maint_Total_hrs'=>$maintenance_total_hrs, 'Cost_Material'=>$cost_material, 'Cost_Labour'=>$cost_labour,'WorkDone_By'=>$workdoneby,'Approved_By'=>$approvedby,'CreatedBy'=>$createdby); //'Maint_Date'=>$maintenance_date,'Maint_Time'=>$maintenance_time, //print_r($addmntbr); //die(); @@ -828,8 +835,14 @@ class batchcard extends BaseController $type = $this->input->post('radiobtn'); $mntid = $this->input->post('mntid'); $machinecode = $this->input->post('machine'); - if($type == '0'){ $maintenance_subtype = $this->input->post('maintenance_subtype'); } - else{ $maintenance_subtype = NULL; } + if($type == '0'){ + $maintenance_subtype = $this->input->post('maintenance_subtype'); + if($maintenance_subtype == '1'){ + $supplier = $this->input->post('supplier'); + } + else{ $supplier = NULL; } + } + else{ $maintenance_subtype = NULL; $supplier = NULL; } // $maintenance_date = $this->input->post('maintenance_date'); // $maintenance_time= $this->input->post('maintenance_time'); $location = $this->input->post('location'); @@ -850,7 +863,7 @@ class batchcard extends BaseController // $date = new DateTime('now', new DateTimeZone('Asia/Kolkata')); // $updatedon = $date->format('d-m-Y H:i:s'); - $editmntbr = array('Type'=>$type,'Machine_Code'=>$machinecode,'Maint_Subtype'=>$maintenance_subtype, 'Maint_Location'=>$location, 'Maint_Description'=>$maintenance_description, 'Maint_Reason'=>$maintenance_reason, 'Maint_Time_from'=>$maintenance_time_from, 'Maint_Time_to'=>$maintenance_time_to, 'Maint_Total_hrs'=>$maintenance_total_hrs, 'Cost_Material'=>$cost_material, 'Cost_Labour'=>$cost_labour,'WorkDone_By'=>$workdoneby,'Approved_By'=>$approvedby,'UpdatedBy'=>$updatedby); + $editmntbr = array('Type'=>$type,'Machine_Code'=>$machinecode,'Maint_Subtype'=>$maintenance_subtype, 'Maint_Subtype'=>$maintenance_subtype,'Maint_Location'=>$location, 'Maint_Description'=>$maintenance_description, 'Maint_Reason'=>$maintenance_reason, 'Maint_Time_from'=>$maintenance_time_from, 'Maint_Time_to'=>$maintenance_time_to, 'Maint_Total_hrs'=>$maintenance_total_hrs, 'Cost_Material'=>$cost_material, 'Cost_Labour'=>$cost_labour,'WorkDone_By'=>$workdoneby,'Approved_By'=>$approvedby,'UpdatedBy'=>$updatedby); //'Maint_Date'=>$maintenance_date,'Maint_Time'=>$maintenance_time, //print_r($editmntbr); //die(); diff --git a/application/controllers/cashbook.php b/application/controllers/cashbook.php index ee88e2f2..2e72fd0f 100755 --- a/application/controllers/cashbook.php +++ b/application/controllers/cashbook.php @@ -157,7 +157,8 @@ class cashbook extends BaseController //$data['dropdownvalues'] = $this->cashbook_model->getAccounTypes(); //print_r($data['dropdownvalues']);die(); $data['bankdetails']=$this->employeedetails_model->getBankDetails(); - $this->global['pageTitle'] = 'Siddharth : Cash Book: Add New Income Expense '; + //$this->global['pageTitle'] = 'Siddharth : Cash Book: Add New Income Expense '; + $this->global['pageTitle'] = 'Siddharth : Bank Report - File Upload'; $this->loadViews("bankingfile", $this->global, $data , NULL); } function bankfileupload() @@ -766,7 +767,7 @@ class cashbook extends BaseController public function bankdata() { - + $this->global['pageTitle'] = 'Siddharth : Bank Statement'; if ($this->input->post('btn_submit')) { $this->global['pageTitle'] = 'Siddharth : bankstatement'; @@ -788,6 +789,7 @@ class cashbook extends BaseController } public function bankdebitdata() { + $this->global['pageTitle'] = 'Siddharth : Bank Debit Report'; if ($this->input->post('btn_submit')) { $Supplierid = $this->input->post('SupplierName'); @@ -805,6 +807,7 @@ class cashbook extends BaseController } public function bankinvoice() { + $this->global['pageTitle'] = 'Siddharth : Bank Invoice Report'; if ($this->input->post('btn_submit')) { $Customer = $this->input->post('Customer'); @@ -823,7 +826,8 @@ class cashbook extends BaseController { - $this->global['pageTitle'] = 'Siddharth : Cashbook Listing'; + // $this->global['pageTitle'] = 'Siddharth : Cashbook Listing'; + $this->global['pageTitle'] = 'Siddharth : Bank Report - Debited Settlements'; $SupplierName = $this->input->post('SupplierName'); $fdate = $this->input->post('from_date'); $tdate = $this->input->post('to_date'); @@ -840,7 +844,8 @@ class cashbook extends BaseController { - $this->global['pageTitle'] = 'Siddharth : Cashbook Listing'; + //$this->global['pageTitle'] = 'Siddharth : Cashbook Listing'; + $this->global['pageTitle'] = 'Siddharth : Bank Report - Credited Settlements'; $SupplierName = $this->input->post('SupplierName'); $fdate = $this->input->post('from_date'); $tdate = $this->input->post('to_date'); @@ -857,7 +862,8 @@ class cashbook extends BaseController { - $this->global['pageTitle'] = 'Siddharth : mappingdebit'; + // $this->global['pageTitle'] = 'Siddharth : mappingdebit'; + $this->global['pageTitle'] = 'Siddharth : Bank Report - Debited Details'; $SupplierName = $this->input->post('SupplierName'); $fdate = $this->input->post('from_date'); $tdate = $this->input->post('to_date'); @@ -870,7 +876,8 @@ class cashbook extends BaseController { - $this->global['pageTitle'] = 'Siddharth : mappingcredit'; + // $this->global['pageTitle'] = 'Siddharth : mappingcredit'; + $this->global['pageTitle'] = 'Siddharth : Bank Report - Credited Details '; $SupplierName = $this->input->post('SupplierName'); $fdate = $this->input->post('from_date'); $tdate = $this->input->post('to_date'); @@ -885,7 +892,8 @@ class cashbook extends BaseController // die(); $check = $this->input->post('check'); $rw = $this->input->post('rw'); - $this->global['pageTitle'] = 'Siddharth : Cashbook Listing'; + //$this->global['pageTitle'] = 'Siddharth : Cashbook Listing'; + $this->global['pageTitle'] = 'Siddharth : Bank Report - Store Debited Details'; $date = $this->input->post('podate'); $date = date_create($date);//,'Y-m-d'); $date = date_format($date,'Y-m-d'); @@ -959,12 +967,12 @@ class cashbook extends BaseController $podata1 = array('Podate'=>$date,'PONO'=>$pono,'Suppliername'=>$sname,'Totalpoamount'=>$tot,'Amountpaid'=>$ip,'Balancetopay'=>$balancetopay,'mid'=>$bankid); - print_r($podata1); + //print_r($podata1); //die(); $podata = array('Podate'=>$date,'PONO'=>$pono,'Suppliername'=>$sname,'Totalpoamount'=>$tot,'Amountpaid'=>$amtpaid,'Balancetopay'=>$balancetopay,'mid'=>$bankid); - $result3 = $this->cashbook_model->poupdate($pono); + $result3 = $this->cashbook_model->getpono($pono); $resultn = $this->cashbook_model->mappingpo($podata1); if(count($result3)<=0) @@ -976,7 +984,7 @@ class cashbook extends BaseController else { //echo "update"; - $result3 = $this->cashbook_model->poupdate1($podata,$pono); + $result3 = $this->cashbook_model->poupdate($podata,$pono); } if($rw == $rowcount) @@ -999,7 +1007,8 @@ class cashbook extends BaseController } public function invoiceamount1() { - $this->global['pageTitle'] = 'Siddharth : Cashbook Listing'; + //$this->global['pageTitle'] = 'Siddharth : Cashbook Listing'; + $this->global['pageTitle'] = 'Siddharth : Bank Report - Store Credited Details'; $check = $this->input->post('check'); $rw = $this->input->post('rw'); @@ -1119,7 +1128,8 @@ class cashbook extends BaseController - $this->global['pageTitle'] = 'Siddharth : amountpaid'; + //$this->global['pageTitle'] = 'Siddharth : amountpaid'; + $this->global['pageTitle'] = 'Siddharth : Bank Report - Amount Payment Details'; if ($this->input->post('btn_submit')) { $SupplierName = $this->input->post('SupplierName'); @@ -1131,7 +1141,7 @@ class cashbook extends BaseController $data['amountpaid'] = $this->cashbook_model->paided(); $data['supplier'] = $this->cashbook_model->getsupplier(); $this->loadViews("bankamountpaid", $this->global,$data, NULL); - + } public function amountreceived() @@ -1139,7 +1149,8 @@ class cashbook extends BaseController // $this->load->model('cashbook_model'); - $this->global['pageTitle'] = 'Siddharth : Cashbook Listing'; + //$this->global['pageTitle'] = 'Siddharth : Cashbook Listing'; + $this->global['pageTitle'] = 'Siddharth : Bank Report - Received Amount Details'; if ($this->input->post('btn_submit')) { $Customer = $this->input->post('Customer'); diff --git a/application/controllers/report.php b/application/controllers/report.php index 898111ca..f305990b 100755 --- a/application/controllers/report.php +++ b/application/controllers/report.php @@ -609,15 +609,15 @@ class report extends BaseController $data['cust']=$this->dahsboard_Model->customer_name(); $data['finyear']=$this->dahsboard_Model->report_finyear(); - if($this->DEPCode == MANAGEMENT) - { + // if($this->DEPCode == MANAGEMENT) + // { $this->loadviews("Report_attach_inward",$this->global,$data, NULL); - } + // } - else - { - $this->loadViews("access", $this->global, $data, NULL); - } + // else + // { + // $this->loadViews("access", $this->global, $data, NULL); + // } diff --git a/application/models/batchcard_model.php b/application/models/batchcard_model.php index c21bc292..ea8ea50a 100755 --- a/application/models/batchcard_model.php +++ b/application/models/batchcard_model.php @@ -17,6 +17,15 @@ class batchcard_model extends CI_Model } + function getSupplierlist(){ + + $this->db->select('SupplierName,SupplierID'); + $this->db->from('T_SupplierDetailsN'); + $supp = $this->db->get(); + return $supp->result(); + + } + function saveHourlyBatchInfo($datatostore) { $this->db->insert('T_hourly_batch_info',$datatostore); diff --git a/application/models/cashbook_model.php b/application/models/cashbook_model.php index e9757045..769d97cd 100755 --- a/application/models/cashbook_model.php +++ b/application/models/cashbook_model.php @@ -508,7 +508,7 @@ function debitpolist($bankid) } - public function poupdate($pono) + public function getpono($pono) { $this->db->select('PONO'); $this->db->from('T_Bankporeport'); @@ -612,7 +612,7 @@ function debitpolist($bankid) } - public function poupdate1($podata,$pono) + public function poupdate($podata,$pono) { $this->db->where('PONO', $pono); diff --git a/application/models/dahsboard_model.php b/application/models/dahsboard_model.php index f7ca0ba9..3ddfadc9 100755 --- a/application/models/dahsboard_model.php +++ b/application/models/dahsboard_model.php @@ -2613,51 +2613,41 @@ function daybeforetotal($yesterday){ $aa=$yr2; } - $sql = "SELECT sub.name as name,sub.tincyear, - sub.expensetotal as Finyeartotalexpense, - sub.incometotal as Finyeartotalincome, - IF(month = 'Jan', sub.expensetotal, 0) AS 'Janexp', - IF(month = 'Feb', sub.expensetotal, 0) AS 'Febexp', - IF(month = 'Mar', sub.expensetotal, 0) AS 'Marexp', - IF(month = 'Apr', sub.expensetotal, 0) AS 'Aprexp', - IF(month = 'May', sub.expensetotal, 0) AS 'Mayexp', - IF(month = 'Jun', sub.expensetotal, 0) AS 'Junexp', - IF(month = 'Jul', sub.expensetotal, 0) AS 'Julexp', - IF(month = 'Aug', sub.expensetotal, 0) AS 'Augexp', - IF(month = 'Sep', sub.expensetotal, 0) AS 'Sepexp', - IF(month = 'Oct', sub.expensetotal, 0) AS 'Octexp', - IF(month = 'Nov', sub.expensetotal, 0) AS 'Novexp', - IF(month = 'Dec', sub.expensetotal, 0) AS 'Decexp', - IF(month = 'Jan', sub.incometotal, 0) AS 'Janinc', - IF(month = 'Feb', sub.incometotal, 0) AS 'Febinc', - IF(month = 'Mar', sub.incometotal, 0) AS 'Marinc', - IF(month = 'Apr', sub.incometotal, 0) AS 'Aprinc', - IF(month = 'May', sub.incometotal, 0) AS 'Mayinc', - IF(month = 'Jun', sub.incometotal, 0) AS 'Juninc', - IF(month = 'Jul', sub.incometotal, 0) AS 'Julinc', - IF(month = 'Aug', sub.incometotal, 0) AS 'Auginc', - IF(month = 'Sep', sub.incometotal, 0) AS 'Sepinc', - IF(month = 'Oct', sub.incometotal, 0) AS 'Octinc', - IF(month = 'Nov', sub.incometotal, 0) AS 'Novinc', - IF(month = 'Dec', sub.incometotal, 0) AS 'Decinc' - FROM ( - select DATE_FORMAT(tinc1.date, '%b') AS month,year(tinc1.date) as tincyear,ac1.name, - ifnull(case - when tinc1.type = 'PAYMENT' - then sum(tinc1.total) - end,'0') as expensetotal, - ifnull(case - when tinc1.type = 'RECEIPT' - then sum(tinc1.total) - end, '0') as incometotal - FROM t_income_expense tinc1 - join t_accountcode ac1 on ac1.code = tinc1.account_code - WHERE (tinc1.date >='".$fa."-04-01' and tinc1.date <= '".$aa."-03-31')"; - if ($cname!= ''){ + $sql = "select tinc.account_code,ac.name, + SUM(IF(month(tinc.date) = 4, IF(tinc.type = 'PAYMENT', tinc.total, 0), 0)) AS AprilExpense, + SUM(IF(month(tinc.date) = 4, IF(tinc.type = 'RECEIPT', tinc.total, 0), 0)) AS AprilIncome, + SUM(IF(month(tinc.date) = 5, IF(tinc.type = 'PAYMENT', tinc.total, 0), 0)) AS MayExpense, + SUM(IF(month(tinc.date) = 5, IF(tinc.type = 'RECEIPT', tinc.total, 0), 0)) AS MayIncome, + SUM(IF(month(tinc.date) = 6, IF(tinc.type = 'PAYMENT', tinc.total, 0), 0)) AS JuneExpense, + SUM(IF(month(tinc.date) = 6, IF(tinc.type = 'RECEIPT', tinc.total, 0), 0)) AS JuneIncome, + SUM(IF(month(tinc.date) = 7, IF(tinc.type = 'PAYMENT', tinc.total, 0), 0)) AS JulyExpense, + SUM(IF(month(tinc.date) = 7, IF(tinc.type = 'RECEIPT', tinc.total, 0), 0)) AS JulyIncome, + SUM(IF(month(tinc.date) = 8, IF(tinc.type = 'PAYMENT', tinc.total, 0), 0)) AS AugustExpense, + SUM(IF(month(tinc.date) = 8, IF(tinc.type = 'RECEIPT', tinc.total, 0), 0)) AS AugustIncome, + SUM(IF(month(tinc.date) = 9, IF(tinc.type = 'PAYMENT', tinc.total, 0), 0)) AS SepExpense, + SUM(IF(month(tinc.date) = 9, IF(tinc.type = 'RECEIPT', tinc.total, 0), 0)) AS SepIncome, + SUM(IF(month(tinc.date) = 10, IF(tinc.type = 'PAYMENT', tinc.total, 0), 0)) AS OctExpense, + SUM(IF(month(tinc.date) = 10, IF(tinc.type = 'RECEIPT', tinc.total, 0), 0)) AS OctIncome, + SUM(IF(month(tinc.date) = 11, IF(tinc.type = 'PAYMENT', tinc.total, 0), 0)) AS NovExpense, + SUM(IF(month(tinc.date) = 11, IF(tinc.type = 'RECEIPT', tinc.total, 0), 0)) AS NovIncome, + SUM(IF(month(tinc.date) = 12, IF(tinc.type = 'PAYMENT', tinc.total, 0), 0)) AS DecExpense, + SUM(IF(month(tinc.date) = 12, IF(tinc.type = 'RECEIPT', tinc.total, 0), 0)) AS DecIncome, + SUM(IF(month(tinc.date) = 1, IF(tinc.type = 'PAYMENT', tinc.total, 0), 0)) AS JanExpense, + SUM(IF(month(tinc.date) = 1, IF(tinc.type = 'RECEIPT', tinc.total, 0), 0)) AS JanIncome, + SUM(IF(month(tinc.date) = 2, IF(tinc.type = 'PAYMENT', tinc.total, 0), 0)) AS FebExpense, + SUM(IF(month(tinc.date) = 2, IF(tinc.type = 'RECEIPT', tinc.total, 0), 0)) AS FebIncome, + SUM(IF(month(tinc.date) = 3, IF(tinc.type = 'PAYMENT', tinc.total, 0), 0)) AS MarExpense, + SUM(IF(month(tinc.date) = 3, IF(tinc.type = 'RECEIPT', tinc.total, 0), 0)) AS MarIncome, + SUM(IF(tinc.type = 'RECEIPT', tinc.total, 0)) AS receiptoverall, + SUM(IF(tinc.type = 'PAYMENT', tinc.total, 0)) AS paymentoverall, + SUM(tinc.total) as overalltotal + from t_income_expense tinc + join t_accountcode ac on ac.code = tinc.account_code + where (tinc.date >='".$fa."-04-01' and tinc.date <= '".$aa."-03-31')"; + if ($cname!= ''){ $sql.="and ac1.name = '".$cname."'"; - } - $sql.= "GROUP BY ac1.name ) as sub - GROUP BY name "; + } + $sql.= "tinc.account_code"; $query = $this->db->query($sql); return $query->result(); diff --git a/application/views/BatchcardMaintAdd.php b/application/views/BatchcardMaintAdd.php index 02462ddc..0101a027 100755 --- a/application/views/BatchcardMaintAdd.php +++ b/application/views/BatchcardMaintAdd.php @@ -59,6 +59,13 @@ External +
+