Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- defined('BASEPATH') OR exit('No direct script access allowed');
- require_once APPPATH .'/../vendor/autoload.php';
- class Jurnal_report extends CI_Controller
- {
- function __construct() {
- parent::__construct();
- $this->load->model('reports_model');
- $this->load->model('workorder_model');
- $this->load->model('warehouse_model');
- $this->load->model('log_model');
- $this->load->model('Warehouses_products_model');
- $this->load->model('Sales_model');
- $this->load->model('sales_return_model');
- $this->load->model('Customer_model');
- $this->load->model('Supplier_model');
- $this->load->model('Accountcategory_model');
- $this->load->model('Expense_model');
- $this->load->model('Expense_category_model');
- $this->load->model('purchase_model');
- $this->load->model('quotation_model');
- }
- public function sales_list(){
- $data['data'] = $this->Sales_model->getSales2()->get()->result();
- $data['url_pdf'] = base_url('jurnal_report/sales_list_pdf');
- // echo '<pre>' . var_export($data, true) . '</pre>';
- // die;
- $this->load->view('jurnal_report/sales_list',$data);
- }
- public function sales_list_pdf(){
- ob_start();
- $html = ob_get_clean();
- $html = utf8_encode($html);
- $data['data'] = $this->Sales_model->getSales2()->get()->result();
- // echo '<pre>' . var_export($data, true) . '</pre>';
- // die;
- $html = $this->load->view('jurnal_report/sales_list_pdf',$data, true);
- $mpdf = new \Mpdf\Mpdf();
- $mpdf->allow_charset_conversion = true;
- $mpdf->charset_in = 'UTF-8';
- $mpdf->WriteHTML($html);
- $mpdf->Output('pdf', 'I');
- }
- public function sales_customer(){
- $data['customer'] = $this->Customer_model->getCustomerSales();
- $data['awal'] = date('Y-m-d');
- $data['akhir'] = date('Y-m-d');
- $data['is_filter'] = 0;
- $data['url_pdf'] = base_url('jurnal_report/sales_customer_pdf');
- // echo '<pre>' . var_export($data, true) . '</pre>';
- // die;
- $this->load->view('jurnal_report/sales_customer',$data);
- }
- public function sales_customer_filter(){
- $data['customer'] = $this->Customer_model->getCustomerSales();
- $data['awal'] = $this->input->post('awal');
- $data['akhir'] = $this->input->post('akhir');
- $data['is_filter'] = 1;
- $data['url_pdf'] = base_url('jurnal_report/sales_customer_pdf_filter/'.$data['awal'].'/'.$data[
- 'akhir']);
- // echo '<pre>' . var_export($data, true) . '</pre>';
- // die;
- $this->load->view('jurnal_report/sales_customer',$data);
- }
- public function sales_customer_pdf(){
- ob_start();
- $html = ob_get_clean();
- $html = utf8_encode($html);
- $data['customer'] = $this->Customer_model->getCustomerSales();
- $data['awal'] = date('Y-m-d');
- $data['akhir'] = date('Y-m-d');
- $data['is_filter'] = 0;
- // echo '<pre>' . var_export($data, true) . '</pre>';
- // die;
- $html = $this->load->view('jurnal_report/sales_customer_pdf',$data, true);
- $mpdf = new \Mpdf\Mpdf();
- $mpdf->allow_charset_conversion = true;
- $mpdf->charset_in = 'UTF-8';
- $mpdf->WriteHTML($html);
- $mpdf->Output('pdf', 'I');
- }
- public function sales_customer_pdf_filter($awal, $akhir){
- ob_start();
- $html = ob_get_clean();
- $html = utf8_encode($html);
- $data['customer'] = $this->Customer_model->getCustomerSales();
- $data['awal'] = date('Y-m-d',strtotime($awal));
- $data['akhir'] = date('Y-m-d',strtotime($akhir));
- $data['is_filter'] = 1;
- // echo '<pre>' . var_export($data, true) . '</pre>';
- // die;
- $html = $this->load->view('jurnal_report/sales_customer_pdf',$data, true);
- $mpdf = new \Mpdf\Mpdf();
- $mpdf->allow_charset_conversion = true;
- $mpdf->charset_in = 'UTF-8';
- $mpdf->WriteHTML($html);
- $mpdf->Output('pdf', 'I');
- }
- public function sales_by_products(){
- $data['data'] = $this->Sales_model->getSalesByProduct();
- $data['awal'] = date('Y-m-d');
- $data['akhir'] = date('Y-m-d');
- $data['is_filter'] = 0;
- $data['url_pdf'] = base_url('jurnal_report/sales_by_products_pdf');
- $data['product'] = $this->Sales_model->getProducts2();
- // echo '<pre>' . var_export($data, true) . '</pre>';
- // die;
- $this->load->view('jurnal_report/sales_by_products',$data);
- }
- public function sales_by_products_filter(){
- $data['awal'] = $this->input->post('awal');
- $data['akhir'] = $this->input->post('akhir');
- $data['data'] = $this->Sales_model->getSalesByProduct_filter($data['awal'], $data['akhir']);
- $data['is_filter'] = 1;
- $data['url_pdf'] = base_url('jurnal_report/sales_by_products_pdf_filter/'.$data['awal'].'/'.$data['akhir']);
- $data['product'] = $this->Sales_model->getProducts2();
- $this->load->view('jurnal_report/sales_by_products',$data);
- }
- public function sales_by_products_pdf(){
- ob_start();
- $html = ob_get_clean();
- $html = utf8_encode($html);
- $data['data'] = $this->Sales_model->getSalesByProduct();
- $data['awal'] = date('Y-m-d');
- $data['akhir'] = date('Y-m-d');
- $data['is_filter'] = 0;
- $data['product'] = $this->Sales_model->getProducts2();
- // echo '<pre>' . var_export($data, true) . '</pre>';
- // die;
- $html = $this->load->view('jurnal_report/sales_by_products_pdf',$data, true);
- $mpdf = new \Mpdf\Mpdf();
- $mpdf->allow_charset_conversion = true;
- $mpdf->charset_in = 'UTF-8';
- $mpdf->WriteHTML($html);
- $mpdf->Output('pdf', 'I');
- }
- public function sales_by_products_pdf_filter($awal,$akhir){
- ob_start();
- $html = ob_get_clean();
- $html = utf8_encode($html);
- $data['awal'] = date('Y-m-d',strtotime($awal));
- $data['akhir'] = date('Y-m-d',strtotime($akhir));
- $data['data'] = $this->Sales_model->getSalesByProduct_filter($data['awal'], $data['akhir']);
- $data['is_filter'] = 1;
- $data['product'] = $this->Sales_model->getProducts2();
- $html = $this->load->view('jurnal_report/sales_by_products_pdf',$data, true);
- $mpdf = new \Mpdf\Mpdf();
- $mpdf->allow_charset_conversion = true;
- $mpdf->charset_in = 'UTF-8';
- $mpdf->WriteHTML($html);
- $mpdf->Output('pdf', 'I');
- }
- public function customer_balance(){
- $data['data'] = $this->Customer_model->get_sales_customer();
- $data['awal'] = date('Y-m-d');
- $data['akhir'] = date('Y-m-d');
- $data['is_filter'] = 0;
- $data['url_pdf'] = base_url('jurnal_report/customer_balance_pdf');
- // echo '<pre>' . var_export($data, true) . '</pre>';
- // die;
- $this->load->view('jurnal_report/customer_balance',$data);
- }
- public function customer_balance_filter(){
- $data['awal'] = date('Y-m-d',strtotime($this->input->post('awal')));
- $data['akhir'] = date('Y-m-d',strtotime($this->input->post('akhir')));
- $data['data'] = $this->Customer_model->get_sales_customer_filter($awal,$akhir);
- $data['is_filter'] = 1;
- // echo '<pre>' . var_export($data, true) . '</pre>';
- // die;
- $this->load->view('jurnal_report/customer_balance',$data);
- }
- public function customer_balance_pdf(){
- ob_start();
- $html = ob_get_clean();
- $html = utf8_encode($html);
- $data['data'] = $this->Customer_model->get_sales_customer();
- $data['awal'] = date('Y-m-d');
- $data['akhir'] = date('Y-m-d');
- $data['is_filter'] = 0;
- // echo '<pre>' . var_export($data, true) . '</pre>';
- // die;
- $html = $this->load->view('jurnal_report/customer_balance_pdf',$data, true);
- $mpdf = new \Mpdf\Mpdf();
- $mpdf->allow_charset_conversion = true;
- $mpdf->charset_in = 'UTF-8';
- $mpdf->WriteHTML($html);
- $mpdf->Output('pdf', 'I');
- }
- public function sales_by_product_report()
- {
- $product_id = $this->input->post('product');
- $start_date = $this->input->post('start_date');
- $end_date = $this->input->post('end_date');
- if($this->input->post('submit') == "Submit"){
- $data = $this->Sales_model->getSalesByProduct($product_id,$start_date,$end_date);
- $data['product'] = $this->Sales_model->getProducts2();
- $this->load->view('jurnal_report/sales_by_products',$data);
- }
- }
- public function purchase_list(){
- $filter = null;
- if(isset($_GET['filter'])) {
- if ($_GET['filter'] != null) {
- $filter = $_GET['filter'];
- }
- }
- // get all purchase record and display list
- $data['data'] = $this->reports_model->getPurchase($filter);
- $data['awal'] = date('Y-m-d');
- $data['akhir'] = date('Y-m-d');
- $data['url_pdf'] = base_url('jurnal_report/purchase_list_pdf');
- $data['is_filter'] = 0;
- $this->load->view('jurnal_report/purchase_list',$data);
- }
- public function purchase_list_filter(){
- $filter = null;
- if(isset($_GET['filter'])) {
- if ($_GET['filter'] != null) {
- $filter = $_GET['filter'];
- }
- }
- // get all purchase record and display list
- $data['awal'] = date('Y-m-d',strtotime($this->input->post('awal')));
- $data['akhir'] = date('Y-m-d',strtotime($this->input->post('akhir')));
- $data['url_pdf'] = base_url('jurnal_report/purchase_list_filter_pdf/'.$data['awal'].'/'.$data['akhir']);
- $data['data'] = $this->reports_model->getPurchase_filter($data['awal'],$data['akhir']);
- $data['is_filter'] = 1;
- $this->load->view('jurnal_report/purchase_list',$data);
- }
- public function purchase_list_pdf(){
- ob_start();
- $html = ob_get_clean();
- $html = utf8_encode($html);
- $filter = null;
- if(isset($_GET['filter'])) {
- if ($_GET['filter'] != null) {
- $filter = $_GET['filter'];
- }
- }
- // get all purchase record and display list
- $data['data'] = $this->reports_model->getPurchase($filter);
- $data['awal'] = date('Y-m-d');
- $data['akhir'] = date('Y-m-d');
- $data['is_filter'] = 0;
- $html = $this->load->view('jurnal_report/purchase_list_pdf',$data, true);
- $mpdf = new \Mpdf\Mpdf();
- $mpdf->allow_charset_conversion = true;
- $mpdf->charset_in = 'UTF-8';
- $mpdf->WriteHTML($html);
- $mpdf->Output('pdf', 'I');
- }
- public function purchase_list_filter_pdf($awal, $akhir){
- ob_start();
- $html = ob_get_clean();
- $html = utf8_encode($html);
- $filter = null;
- if(isset($_GET['filter'])) {
- if ($_GET['filter'] != null) {
- $filter = $_GET['filter'];
- }
- }
- // get all purchase record and display list
- $data['awal'] = date('Y-m-d',strtotime($awal));
- $data['akhir'] = date('Y-m-d',strtotime($akhir));
- $data['data'] = $this->reports_model->getPurchase_filter($data['awal'],$data['akhir']);
- $data['is_filter'] = 1;
- $html = $this->load->view('jurnal_report/purchase_list_pdf',$data, true);
- $mpdf = new \Mpdf\Mpdf();
- $mpdf->allow_charset_conversion = true;
- $mpdf->charset_in = 'UTF-8';
- $mpdf->WriteHTML($html);
- $mpdf->Output('pdf', 'I');
- }
- public function purchase_by_vendor(){
- $data['data'] = $this->Supplier_model->purchase_by_vendor();
- $data['vendor'] = $this->Supplier_model->purchase_by_vendor();
- $data['awal'] = date('Y-m-d');
- $data['akhir'] = date('Y-m-d');
- $data['url_pdf'] = base_url('jurnal_report/purchase_by_vendor_pdf');
- $data['is_filter'] = 0;
- // echo '<pre>' . var_export($data, true) . '</pre>';
- // die;
- $this->load->view('jurnal_report/purchase_by_vendor',$data);
- }
- public function purchase_by_vendor_filter(){
- $data['vendor'] = $this->Supplier_model->purchase_by_vendor();
- $supp = $this->input->post('vendor');
- $data['awal'] = date('Y-m-d',strtotime($this->input->post('awal')));
- $data['akhir'] = date('Y-m-d',strtotime($this->input->post('akhir')));
- $data['url_pdf'] = base_url('jurnal_report/purchase_by_vendor_pdf_filter/'.$data['awal'].'/'.$data['akhir'].'/'.$supp);
- $data['data'] = $this->Supplier_model->purchase_by_vendor_filter($data['awal'],$data['akhir'], $supp);
- $data['is_filter'] = 1;
- // echo '<pre>' . var_export($data, true) . '</pre>';
- // die;
- $this->load->view('jurnal_report/purchase_by_vendor',$data);
- }
- public function purchase_by_vendor_pdf() {
- ob_start();
- $html = ob_get_clean();
- $html = utf8_encode($html);
- $data['data'] = $this->Supplier_model->purchase_by_vendor();
- $data['vendor'] = $this->Supplier_model->purchase_by_vendor();
- $data['awal'] = date('Y-m-d');
- $data['akhir'] = date('Y-m-d');
- $data['is_filter'] = 0;
- $html = $this->load->view('jurnal_report/purchase_by_vendor_pdf', $data, true);
- $mpdf = new \Mpdf\Mpdf();
- $mpdf->allow_charset_conversion = true;
- $mpdf->charset_in = 'UTF-8';
- $mpdf->WriteHTML($html);
- $mpdf->Output('pdf', 'I');
- }
- public function purchase_by_vendor_pdf_filter($awal, $akhir) {
- ob_start();
- $html = ob_get_clean();
- $html = utf8_encode($html);
- // $data['vendor'] = $this->Supplier_model->purchase_by_vendor();
- // $supp = $this->input->post('vendor');
- $data['awal'] = date('Y-m-d',strtotime($awal));
- $data['akhir'] = date('Y-m-d',strtotime($akhir));
- $data['data'] = $this->purchase_model->getPurchaseBySupplier_filterPDF($data['awal'],$data['akhir']);
- $data['is_filter'] = 1;
- $html = $this->load->view('jurnal_report/purchase_by_vendor_pdf', $data, true);
- $mpdf = new \Mpdf\Mpdf();
- $mpdf->allow_charset_conversion = true;
- $mpdf->charset_in = 'UTF-8';
- $mpdf->WriteHTML($html);
- $mpdf->Output('pdf', 'I');
- }
- public function purchase_by_product(){
- $data['data'] = $this->Supplier_model->purchase_by_product();
- $data['awal'] = date('Y-m-d');
- $data['akhir'] = date('Y-m-d');
- $data['is_filter'] = 0;
- $data['url_pdf'] = base_url('jurnal_report/purchase_by_product_pdf');
- // echo '<pre>' . var_export($data, true) . '</pre>';
- // die;
- $this->load->view('jurnal_report/purchase_by_product',$data);
- }
- public function purchase_by_product_filter(){
- $data['awal'] = date('Y-m-d',strtotime($this->input->post('awal')));
- $data['akhir'] = date('Y-m-d',strtotime($this->input->post('akhir')));
- $data['data'] = $this->Supplier_model->purchase_by_product_filter($data['awal'],$data['akhir']);
- $data['is_filter'] = 1;
- $data['url_pdf'] = base_url('jurnal_report/purchase_by_product_pdf_filter/'.$data['awal'].'/'.$data['akhir']);
- // echo '<pre>' . var_export($data, true) . '</pre>';
- // die;
- $this->load->view('jurnal_report/purchase_by_product',$data);
- }
- public function purchase_by_product_pdf(){
- ob_start();
- $html = ob_get_clean();
- $html = utf8_encode($html);
- $data['data'] = $this->Supplier_model->purchase_by_product();
- $data['awal'] = date('Y-m-d');
- $data['akhir'] = date('Y-m-d');
- $data['is_filter'] = 0;
- // echo '<pre>' . var_export($data, true) . '</pre>';
- // die;
- $html = $this->load->view('jurnal_report/purchase_by_product_pdf', $data, true);
- $mpdf = new \Mpdf\Mpdf();
- $mpdf->allow_charset_conversion = true;
- $mpdf->charset_in = 'UTF-8';
- $mpdf->WriteHTML($html);
- $mpdf->Output('pdf', 'I');
- }
- public function purchase_by_product_pdf_filter($awal, $akhir){
- ob_start();
- $html = ob_get_clean();
- $html = utf8_encode($html);
- $data['awal'] = date('Y-m-d',strtotime($awal));
- $data['akhir'] = date('Y-m-d',strtotime($akhir));
- $data['data'] = $this->Supplier_model->purchase_by_product_filter($data['awal'],$data['akhir']);
- $data['is_filter'] = 1;
- // echo '<pre>' . var_export($data, true) . '</pre>';
- // die;
- $html = $this->load->view('jurnal_report/purchase_by_product_pdf', $data, true);
- $mpdf = new \Mpdf\Mpdf();
- $mpdf->allow_charset_conversion = true;
- $mpdf->charset_in = 'UTF-8';
- $mpdf->WriteHTML($html);
- $mpdf->Output('pdf', 'I');
- }
- public function warehouse_balance(){
- // $data = $this->db->select()
- // ->from('purchases p')
- // ->join('expense e','e.reference_no = p.purchase_id','left')
- // ->where('p.total - e.amount != ',0)
- // ->get()->result();
- $data['data'] = $this->db->query("SELECT p.reference_no,p.date,p.total - e.amount as hasil,p.total as nominal_po,e.amount,sp.supplier_name from purchases p inner join expense e on e.reference_no = p.purchase_id left join suppliers sp on sp.supplier_id=p.supplier_id where p.total - e.amount != 0")->result();
- $data['awal'] = date('Y-m-d');
- $data['akhir'] = date('Y-m-d');
- // echo '<pre>' . var_export($data, true) . '</pre>';
- // die;
- $this->load->view('jurnal_report/warehouse_balance',$data);
- }
- public function inventory_summary() {
- //get all product details to display list
- // $id_produk = $this->input
- $data['data'] = $this->reports_model->getProducts2();
- $data['produk'] = $this->reports_model->getProducts2();
- $data['is_filter'] = 0;
- $data['url_pdf'] = base_url('jurnal_report/inventory_summary_pdf');
- for ($i=0; $i < count($data['data']) ; $i++) {
- if ($data['data'][$i]->product_grouping != NULL) {
- $arlist = json_encode(unserialize($data['data'][$i]->list));
- $arlist = json_decode($arlist);
- $max = array();
- for ($ilist = 0; $ilist < count($arlist); $ilist++) {
- $qtyp = $this->db->select('quantity')->from('products')->where('product_id', $arlist[$ilist]->pl)->get()->result()[0]->quantity;
- @$count = ($qtyp / intval($arlist[$ilist]->ql));
- array_push($max, $count);
- }
- $min = min($max);
- $data['data'][$i]->quantity = intval($min);
- }
- }
- $this->load->view('jurnal_report/inventory_summary', $data);
- }
- public function inventory_summary_filter() {
- //get all product details to display list
- $id_produk = $this->input->post('produk');
- $data['data'] = $this->reports_model->getProducts2_filter($id_produk);
- $data['produk'] = $this->reports_model->getProducts2();
- $data['is_filter'] = 1;
- $data['url_pdf'] = base_url('jurnal_report/inventory_summary_pdf_filter/'.$id_produk);
- for ($i=0; $i < count($data['data']) ; $i++) {
- if ($data['data'][$i]->product_grouping != NULL) {
- $arlist = json_encode(unserialize($data['data'][$i]->list));
- $arlist = json_decode($arlist);
- $max = array();
- for ($ilist = 0; $ilist < count($arlist); $ilist++) {
- $qtyp = $this->db->select('quantity')->from('products')->where('product_id', $arlist[$ilist]->pl)->get()->result()[0]->quantity;
- @$count = ($qtyp / intval($arlist[$ilist]->ql));
- array_push($max, $count);
- }
- $min = min($max);
- $data['data'][$i]->quantity = intval($min);
- }
- }
- $this->load->view('jurnal_report/inventory_summary', $data);
- }
- public function inventory_summary_pdf() {
- ob_start();
- $html = ob_get_clean();
- $html = utf8_encode($html);
- //get all product details to display list
- // $id_produk = $this->input
- $data['data'] = $this->reports_model->getProducts2();
- $data['produk'] = $this->reports_model->getProducts2();
- $data['is_filter'] = 0;
- for ($i=0; $i < count($data['data']) ; $i++) {
- if ($data['data'][$i]->product_grouping != NULL) {
- $arlist = json_encode(unserialize($data['data'][$i]->list));
- $arlist = json_decode($arlist);
- $max = array();
- for ($ilist = 0; $ilist < count($arlist); $ilist++) {
- $qtyp = $this->db->select('quantity')->from('products')->where('product_id', $arlist[$ilist]->pl)->get()->result()[0]->quantity;
- @$count = ($qtyp / intval($arlist[$ilist]->ql));
- array_push($max, $count);
- }
- $min = min($max);
- $data['data'][$i]->quantity = intval($min);
- }
- }
- $html = $this->load->view('jurnal_report/inventory_summary_pdf', $data, true);
- $mpdf = new \Mpdf\Mpdf();
- $mpdf->allow_charset_conversion = true;
- $mpdf->charset_in = 'UTF-8';
- $mpdf->WriteHTML($html);
- $mpdf->Output('pdf', 'I');
- }
- public function inventory_summary_pdf_filter($produk) {
- ob_start();
- $html = ob_get_clean();
- $html = utf8_encode($html);
- //get all product details to display list
- $id_produk = $produk;
- $data['data'] = $this->reports_model->getProducts2_filter($id_produk);
- $data['produk'] = $this->reports_model->getProducts2();
- $data['is_filter'] = 1;
- for ($i=0; $i < count($data['data']) ; $i++) {
- if ($data['data'][$i]->product_grouping != NULL) {
- $arlist = json_encode(unserialize($data['data'][$i]->list));
- $arlist = json_decode($arlist);
- $max = array();
- for ($ilist = 0; $ilist < count($arlist); $ilist++) {
- $qtyp = $this->db->select('quantity')->from('products')->where('product_id', $arlist[$ilist]->pl)->get()->result()[0]->quantity;
- @$count = ($qtyp / intval($arlist[$ilist]->ql));
- array_push($max, $count);
- }
- $min = min($max);
- $data['data'][$i]->quantity = intval($min);
- }
- }
- $html = $this->load->view('jurnal_report/inventory_summary_pdf', $data, true);
- $mpdf = new \Mpdf\Mpdf();
- $mpdf->allow_charset_conversion = true;
- $mpdf->charset_in = 'UTF-8';
- $mpdf->WriteHTML($html);
- $mpdf->Output('pdf', 'I');
- }
- public function warehouse_stock_qty()
- {
- //get all product details to display list
- $data['data'] = $this->warehouse_model->getProducts();
- // print_r(var_dump($this->db->last_query()));
- $data['category'] = $this->reports_model->getCategory();
- $data['url_pdf'] = base_url('jurnal_report/warehouse_stock_qty_pdf');
- $this->load->view('jurnal_report/warehouse_stock_qty',$data);
- }
- public function warehouse_stock_qty_pdf()
- {
- ob_start();
- $html = ob_get_clean();
- $html = utf8_encode($html);
- //get all product details to display list
- $data['data'] = $this->warehouse_model->getProducts();
- // print_r(var_dump($this->db->last_query()));
- $data['category'] = $this->reports_model->getCategory();
- $html = $this->load->view('jurnal_report/warehouse_stock_qty_pdf', $data, true);
- $mpdf = new \Mpdf\Mpdf();
- $mpdf->allow_charset_conversion = true;
- $mpdf->charset_in = 'UTF-8';
- $mpdf->WriteHTML($html);
- $mpdf->Output('pdf', 'I');
- }
- public function aged_payable(){
- $data['data'] = $this->db->select('s.supplier_name,sum(p.total) as total,pt.due_date')
- ->from('suppliers s')
- ->join('purchases p','p.supplier_id = s.supplier_id')
- ->join('purchase_termin pt','pt.purchase_id = p.purchase_id','left')
- ->group_by('p.supplier_id')
- ->get()->result();
- $data['awal'] = date('Y-m-d');
- $data['akhir'] = date('Y-m-d');
- $data['is_filter'] = 0;
- $data['url_pdf'] = base_url('jurnal_report/aged_payable_pdf');
- // echo '<pre>' . var_export($data, true) . '</pre>';
- // die;
- $this->load->view('jurnal_report/aged_payable',$data);
- }
- public function aged_payable_pdf(){
- ob_start();
- $html = ob_get_clean();
- $html = utf8_encode($html);
- $data['data'] = $this->Accountcategory_model->getAccountCategory();
- $data['awal'] = date('Y-m-d');
- $data['akhir'] = date('Y-m-d');
- $data['is_filter'] = 0;
- // echo '<pre>' . var_export($data, true) . '</pre>';
- // die;
- $html = $this->load->view('jurnal_report/aged_payable_pdf', $data, true);
- $mpdf = new \Mpdf\Mpdf();
- $mpdf->allow_charset_conversion = true;
- $mpdf->charset_in = 'UTF-8';
- $mpdf->WriteHTML($html);
- $mpdf->Output('pdf', 'I');
- }
- public function expense_list()
- {
- $data['expense'] = $this->Expense_model->getExpense();
- $data['awal'] = date('Y-m-d');
- $data['akhir'] = date('Y-m-d');
- $data['is_filter'] = 0;
- $data['url_pdf'] = base_url('jurnal_report/expense_list_pdf');
- // echo "<pre>";
- // print_r($data);
- // exit();
- $this->load->view('jurnal_report/expense_list',$data);
- }
- public function expense_list_filter()
- {
- $data['awal'] = $this->input->post('awal');
- $data['akhir'] = $this->input->post('akhir');
- $data['expense'] = $this->Expense_model->getExpense_filter($data['awal'], $data['akhir']);
- $data['is_filter'] = 1;
- $data['url_pdf'] = base_url('jurnal_report/expense_list_pdf_filter/'.$data['awal'].'/'.$data['akhir']);
- // echo "<pre>";
- // print_r($data);
- // exit();
- $this->load->view('jurnal_report/expense_list',$data);
- }
- public function expense_list_pdf(){
- ob_start();
- $html = ob_get_clean();
- $html = utf8_encode($html);
- $data['expense'] = $this->Expense_model->getExpense();
- $data['awal'] = date('Y-m-d');
- $data['akhir'] = date('Y-m-d');
- $data['is_filter'] = 0;
- // echo "<pre>";
- // print_r($data);
- // exit();
- $html = $this->load->view('jurnal_report/expense_list_pdf',$data, true);
- $mpdf = new \Mpdf\Mpdf();
- $mpdf->allow_charset_conversion = true;
- $mpdf->charset_in = 'UTF-8';
- $mpdf->WriteHTML($html);
- $mpdf->Output('pdf', 'I');
- }
- public function expense_list_pdf_filter($awal, $akhir)
- {
- ob_start();
- $html = ob_get_clean();
- $html = utf8_encode($html);
- $data['awal'] = date('Y-m-d',strtotime($awal));
- $data['akhir'] = date('Y-m-d',strtotime($akhir));
- $data['expense'] = $this->Expense_model->getExpense_filter($data['awal'], $data['akhir']);
- $data['is_filter'] = 1;
- // echo "<pre>";
- // print_r($data);
- // exit();
- $html = $this->load->view('jurnal_report/expense_list_pdf',$data, true);
- $mpdf = new \Mpdf\Mpdf();
- $mpdf->allow_charset_conversion = true;
- $mpdf->charset_in = 'UTF-8';
- $mpdf->WriteHTML($html);
- $mpdf->Output('pdf', 'I');
- }
- public function expense_details(){
- $data['expense'] = $this->Expense_category_model->getExpenseCategory();
- $data['awal'] = date('Y-m-d');
- $data['akhir'] = date('Y-m-d');
- $data['is_filter'] = 0;
- $data['url_pdf'] = base_url('jurnal_report/expense_details_pdf');
- // echo '<pre>' . var_export($data, true) . '</pre>';
- // die;
- $this->load->view('jurnal_report/expense_details',$data);
- }
- public function expense_details_filter(){
- $data['expense'] = $this->Expense_category_model->getExpenseCategory();
- $data['awal'] = $this->input->post('awal');
- $data['akhir'] = $this->input->post('akhir');
- $data['is_filter'] = 1;
- $data['url_pdf'] = base_url('jurnal_report/expense_details_pdf_filter/'.$data['awal'].'/'.$data['akhir']);
- // echo '<pre>' . var_export($data, true) . '</pre>';
- // die;
- $this->load->view('jurnal_report/expense_details',$data);
- }
- public function expense_details_pdf(){
- ob_start();
- $html = ob_get_clean();
- $html = utf8_encode($html);
- $data['expense'] = $this->Expense_category_model->getExpenseCategory();
- $data['awal'] = date('Y-m-d');
- $data['akhir'] = date('Y-m-d');
- $data['is_filter'] = 0;
- // echo '<pre>' . var_export($data, true) . '</pre>';
- // die;
- $html = $this->load->view('jurnal_report/expense_details_pdf',$data, true);
- $mpdf = new \Mpdf\Mpdf();
- $mpdf->allow_charset_conversion = true;
- $mpdf->charset_in = 'UTF-8';
- $mpdf->WriteHTML($html);
- $mpdf->Output('pdf', 'I');
- }
- public function expense_details_pdf_filter($awal, $akhir){
- ob_start();
- $html = ob_get_clean();
- $html = utf8_encode($html);
- $data['expense'] = $this->Expense_category_model->getExpenseCategory();
- $data['awal'] = date('Y-m-d',strtotime($awal));
- $data['akhir'] = date('Y-m-d',strtotime($akhir));
- $data['is_filter'] = 1;
- // echo '<pre>' . var_export($data, true) . '</pre>';
- // die;
- $html = $this->load->view('jurnal_report/expense_details_pdf',$data, true);
- $mpdf = new \Mpdf\Mpdf();
- $mpdf->allow_charset_conversion = true;
- $mpdf->charset_in = 'UTF-8';
- $mpdf->WriteHTML($html);
- $mpdf->Output('pdf', 'I');
- }
- public function inventory_valuation(){
- $data['stock_in'] = $this->db->select('sum(ii.qty) as total_qty,sum(p.price) as total_price')
- ->from('inventory_items ii')
- ->join('products p','p.product_id=ii.product_id','left')
- ->get()->result();
- $data['stock_out'] = $this->db->select('sum(si.quantity) as total_qty,sum(si.price) as total_price')
- ->from('sales_items si')
- ->get()->result();
- $data['saldo_awal'] = $this->db->select('sum(wp.quantity) as total_qty,sum(p.price) as total_price')
- ->from('warehouses_products wp')
- ->join('products p','p.product_id = wp.product_id','left')
- ->get()
- ->result();
- $data['awal'] = date('Y-m-d');
- $data['akhir'] = date('Y-m-d');
- $data['url_pdf'] = base_url('jurnal_report/inventory_valuation_pdf');
- // $data['expense'] = $this->Expense_category_model->getExpenseCategory();
- // $data['awal'] = $this->input->post('awal');
- // $data['akhir'] = $this->input->post('akhir');
- // $data['is_filter'] = 0;
- // echo '<pre>' . var_export($stock_out, true) . '</pre>';
- // die;
- $this->load->view('jurnal_report/inventory_valuation',$data);
- }
- public function inventory_valuation_pdf(){
- ob_start();
- $html = ob_get_clean();
- $html = utf8_encode($html);
- $data['stock_in'] = $this->db->select('sum(ii.qty) as total_qty,sum(p.price) as total_price')
- ->from('inventory_items ii')
- ->join('products p','p.product_id=ii.product_id','left')
- ->get()->result();
- $data['stock_out'] = $this->db->select('sum(si.quantity) as total_qty,sum(si.price) as total_price')
- ->from('sales_items si')
- ->get()->result();
- $data['saldo_awal'] = $this->db->select('sum(wp.quantity) as total_qty,sum(p.price) as total_price')
- ->from('warehouses_products wp')
- ->join('products p','p.product_id = wp.product_id','left')
- ->get()
- ->result();
- $data['awal'] = date('Y-m-d');
- $data['akhir'] = date('Y-m-d');
- // $data['expense'] = $this->Expense_category_model->getExpenseCategory();
- // $data['awal'] = $this->input->post('awal');
- // $data['akhir'] = $this->input->post('akhir');
- // $data['is_filter'] = 0;
- // echo '<pre>' . var_export($stock_out, true) . '</pre>';
- // die;
- $html = $this->load->view('jurnal_report/inventory_valuation_pdf',$data, true);
- $mpdf = new \Mpdf\Mpdf();
- $mpdf->allow_charset_conversion = true;
- $mpdf->charset_in = 'UTF-8';
- $mpdf->WriteHTML($html);
- $mpdf->Output('pdf', 'I');
- }
- public function warehouse_item_valuation(){
- $data['warehouse'] = $this->db->get('warehouse')->result();
- $data['stock_in'] = $this->db->select('sum(ii.qty) as total_qty,sum(p.price) as total_price')
- ->from('inventory_items ii')
- ->join('products p','p.product_id=ii.product_id','left')
- ->get()->result();
- $data['stock_out'] = $this->db->select('sum(si.quantity) as total_qty,sum(si.price) as total_price')
- ->from('sales_items si')
- ->get()->result();
- $data['saldo_awal'] = $this->db->select('sum(wp.quantity) as total_qty,sum(p.price) as total_price')
- ->from('warehouses_products wp')
- ->join('products p','p.product_id = wp.product_id','left')
- ->get()
- ->result();
- $data['awal'] = date('Y-m-d');
- $data['akhir'] = date('Y-m-d');
- $data['url_pdf'] = base_url('jurnal_report/warehouse_item_valuation_pdf');
- // $data['expense'] = $this->Expense_category_model->getExpenseCategory();
- // $data['awal'] = $this->input->post('awal');
- // $data['akhir'] = $this->input->post('akhir');
- // $data['is_filter'] = 0;
- // echo '<pre>' . var_export($stock_out, true) . '</pre>';
- // die;
- $this->load->view('jurnal_report/warehouse_item_valuation',$data);
- }
- public function warehouse_item_valuation_pdf(){
- ob_start();
- $html = ob_get_clean();
- $html = utf8_encode($html);
- $data['warehouse'] = $this->db->get('warehouse')->result();
- $data['stock_in'] = $this->db->select('sum(ii.qty) as total_qty,sum(p.price) as total_price')
- ->from('inventory_items ii')
- ->join('products p','p.product_id=ii.product_id','left')
- ->get()->result();
- $data['stock_out'] = $this->db->select('sum(si.quantity) as total_qty,sum(si.price) as total_price')
- ->from('sales_items si')
- ->get()->result();
- $data['saldo_awal'] = $this->db->select('sum(wp.quantity) as total_qty,sum(p.price) as total_price')
- ->from('warehouses_products wp')
- ->join('products p','p.product_id = wp.product_id','left')
- ->get()
- ->result();
- $data['awal'] = date('Y-m-d');
- $data['akhir'] = date('Y-m-d');
- $data['url_pdf'] = base_url('jurnal_report/warehouse_item_valuation_pdf');
- // $data['expense'] = $this->Expense_category_model->getExpenseCategory();
- // $data['awal'] = $this->input->post('awal');
- // $data['akhir'] = $this->input->post('akhir');
- // $data['is_filter'] = 0;
- // echo '<pre>' . var_export($stock_out, true) . '</pre>';
- // die;
- $html = $this->load->view('jurnal_report/warehouse_item_valuation_pdf',$data, true);
- $mpdf = new \Mpdf\Mpdf();
- $mpdf->allow_charset_conversion = true;
- $mpdf->charset_in = 'UTF-8';
- $mpdf->WriteHTML($html);
- $mpdf->Output('pdf', 'I');
- }
- public function inventory_details(){
- $data['awal'] = date('Y-m-d');
- $data['akhir'] = date('Y-m-d');
- $data['url_pdf'] = base_url('jurnal_report/inventory_details_pdf');
- $data['data'] = $this->db->get('stock_out')->result();
- $this->load->view('jurnal_report/inventory_details',$data);
- }
- public function inventory_details_pdf(){
- ob_start();
- $html = ob_get_clean();
- $html = utf8_encode($html);
- $data['awal'] = date('Y-m-d');
- $data['akhir'] = date('Y-m-d');
- $data['data'] = $this->db->get('stock_out')->result();
- $html = $this->load->view('jurnal_report/inventory_details_pdf',$data, true);
- $mpdf = new \Mpdf\Mpdf();
- $mpdf->allow_charset_conversion = true;
- $mpdf->charset_in = 'UTF-8';
- $mpdf->WriteHTML($html);
- $mpdf->Output('pdf', 'I');
- }
- public function purchase_delivery(){
- $data['supplier'] = $this->Supplier_model->getSuppliers();
- $data['awal'] = date('Y-m-d');
- $data['akhir'] = date('Y-m-d');
- $data['is_filter'] = 0;
- $data['url_pdf'] = base_url('jurnal_report/purchase_delivery_pdf');
- $this->load->view('jurnal_report/purchase_delivery', $data);
- }
- public function purchase_delivery_filter(){
- $data['supplier'] = $this->Supplier_model->getSuppliers();
- $data['awal'] = $this->input->post('awal');
- $data['akhir'] = $this->input->post('akhir');
- $data['is_filter'] = 1;
- $this->load->view('jurnal_report/purchase_delivery', $data);
- }
- public function purchase_delivery_pdf(){
- ob_start();
- $html = ob_get_clean();
- $html = utf8_encode($html);
- $data['supplier'] = $this->Supplier_model->getSuppliers();
- $data['awal'] = date('Y-m-d');
- $data['akhir'] = date('Y-m-d');
- $data['is_filter'] = 0;
- $html = $this->load->view('jurnal_report/purchase_delivery_pdf',$data, true);
- $mpdf = new \Mpdf\Mpdf();
- $mpdf->allow_charset_conversion = true;
- $mpdf->charset_in = 'UTF-8';
- $mpdf->WriteHTML($html);
- $mpdf->Output('pdf', 'I');
- }
- public function sales_delivery(){
- $data['customer'] = $this->Customer_model->getCustomers();
- $data['url_pdf'] = base_url('jurnal_report/sales_delivery_pdf');
- $this->load->view('jurnal_report/sales_delivery', $data);
- }
- public function sales_delivery_pdf(){
- ob_start();
- $html = ob_get_clean();
- $html = utf8_encode($html);
- $data['customer'] = $this->Customer_model->getCustomers();
- $html = $this->load->view('jurnal_report/sales_delivery_pdf',$data, true);
- $mpdf = new \Mpdf\Mpdf();
- $mpdf->allow_charset_conversion = true;
- $mpdf->charset_in = 'UTF-8';
- $mpdf->WriteHTML($html);
- $mpdf->Output('pdf', 'I');
- }
- public function purchase_completion(){
- $filter = null;
- if(isset($_GET['filter'])) {
- if ($_GET['filter'] != null) {
- $filter = $_GET['filter'];
- }
- }
- // get all purchase record and display list
- $data['data'] = $this->purchase_model->getPurchaseCompletion($filter);
- $data['awal'] = date('Y-m-d');
- $data['akhir'] = date('Y-m-d');
- $data['is_filter'] = 0;
- $data['url_pdf'] = base_url('jurnal_report/purchase_completion_pdf');
- // print_r(var_dump($this->db->last_query()));
- $this->load->view('jurnal_report/purchase_completion',$data);
- }
- public function purchase_completion_filter(){
- $filter = null;
- if(isset($_GET['filter'])) {
- if ($_GET['filter'] != null) {
- $filter = $_GET['filter'];
- }
- }
- // get all purchase record and display list
- $data['awal'] = $this->input->post('awal');
- $data['akhir'] = $this->input->post('akhir');
- $data['data'] = $this->purchase_model->getPurchaseCompletion($filter);
- $data['is_filter'] = 1;
- // print_r(var_dump($this->db->last_query()));
- $this->load->view('jurnal_report/purchase_completion',$data);
- }
- public function purchase_completion_pdf(){
- ob_start();
- $html = ob_get_clean();
- $html = utf8_encode($html);
- $filter = null;
- if(isset($_GET['filter'])) {
- if ($_GET['filter'] != null) {
- $filter = $_GET['filter'];
- }
- }
- // get all purchase record and display list
- $data['data'] = $this->purchase_model->getPurchaseCompletion($filter);
- $data['awal'] = date('Y-m-d');
- $data['akhir'] = date('Y-m-d');
- $data['is_filter'] = 0;
- // print_r(var_dump($this->db->last_query()));
- $html = $this->load->view('jurnal_report/purchase_completion_pdf',$data, true);
- $mpdf = new \Mpdf\Mpdf();
- $mpdf->allow_charset_conversion = true;
- $mpdf->charset_in = 'UTF-8';
- $mpdf->WriteHTML($html);
- $mpdf->Output('pdf', 'I');
- }
- public function sales_completion() {
- // get all sales to display list
- $filter = null;
- if(isset($_GET['filter'])) {
- if ($_GET['filter'] != null) {
- $filter = $_GET['filter'];
- }
- }
- $data['quotation'] = $this->quotation_model->getQuotation();
- $data['data'] = $this->Sales_model->getSales($filter);
- $data['url_pdf'] = base_url('jurnal_report/sales_completion_pdf');
- // print_r(var_dump($this->db->last_query()));
- $this->load->view('jurnal_report/sales_completion', $data);
- }
- public function sales_completion_pdf() {
- ob_start();
- $html = ob_get_clean();
- $html = utf8_encode($html);
- // get all sales to display list
- $filter = null;
- if(isset($_GET['filter'])) {
- if ($_GET['filter'] != null) {
- $filter = $_GET['filter'];
- }
- }
- $data['quotation'] = $this->quotation_model->getQuotation();
- $data['data'] = $this->Sales_model->getSales($filter);
- // print_r(var_dump($this->db->last_query()));
- $html = $this->load->view('jurnal_report/sales_completion_pdf',$data, true);
- $mpdf = new \Mpdf\Mpdf();
- $mpdf->allow_charset_conversion = true;
- $mpdf->charset_in = 'UTF-8';
- $mpdf->WriteHTML($html);
- $mpdf->Output('pdf', 'I');
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement