Esempio n. 1
0
 public function v005($id = null)
 {
     $grid['folder'] = "Stock";
     $grid['title'] = "Form itemprice / Brand Item";
     $grid['url_submit'] = App::urlFor("itemprice.s003");
     $data = null;
     if (!is_null($id)) {
         $data = ItemPriceList::find($id);
     }
     $grid['data'] = $data;
     $grid['url_price_list'] = APP::urlFor('pricelist.dataset');
     $grid['url_item'] = APP::urlFor('item.dataset');
     App::render('itemprice/form_itemprice', $grid);
 }
Esempio n. 2
0
 public function v005($id = null)
 {
     $grid['folder'] = "Stock";
     $grid['title'] = "Form batch / Brand Item";
     $grid['url_submit'] = App::urlFor("batch.s003");
     $data = null;
     if (!is_null($id)) {
         $data = Batch::find($id);
         $grid['is_read_only'] = true;
     }
     $grid['data'] = $data;
     $grid['url_price_list'] = APP::urlFor('pricelist.dataset');
     $grid['url_item'] = APP::urlFor('item.dataset');
     App::render('batch/form_batch', $grid);
 }
Esempio n. 3
0
 public function v005($id = null)
 {
     $grid['folder'] = "<a href=\"" . App::urlFor('item.index') . "\">Stock</a>";
     $grid['title'] = "Form Item";
     //    $grid['data']['item_kode'] = "ITEM-".ZiUtil::GetNowID();
     $grid['url_itemprice'] = App::urlFor("itemprice.filter");
     $grid['url_submit'] = App::urlFor("item.s003");
     $grid['url_item_uom'] = APP::urlFor('unitOM.dataset');
     $grid['url_item_grup'] = APP::urlFor('item.grupitem');
     $grid['url_principal'] = APP::urlFor('principal.dataset');
     $grid['url_gudang'] = APP::urlFor('warehouse.dataset');
     $data = null;
     if (!is_null($id)) {
         $data = Item::find($id);
     }
     $grid['data'] = $data;
     App::render('item/form_item', $grid);
 }
Esempio n. 4
0
 private function print_harian($params)
 {
     try {
         $condition = array();
         $data = array();
         if (!empty($params['a']) && !empty($params['z']) && !empty($params['cdate'])) {
             $col_date = $params['cdate'];
             $query = sprintf("%s BETWEEN '%s' and '%s' ", $params['cdate'], $params['a'], $params['z']);
             $condition['conditions'] = $query;
         }
         $ar_adapter = \ActiveRecord\ConnectionManager::get_connection($this->app->mode);
         $connection = $ar_adapter->connection;
         $stmt = $connection->prepare("select (stocks.get_stock_harian(:awal, :akhir)).*");
         $stmt->bindParam(':awal', $params['a']);
         $stmt->bindParam(':akhir', $params['z']);
         $stmt->execute();
         $stocks = $stmt->fetchAll(PDO::FETCH_CLASS);
         // print_r($stocks);
         $data["rows"] = $stocks;
         $data["title"] = $this->template_header;
         $data["posting_range"] = sprintf(" %s sampai %s", $params['a'], $params['z']);
         $data["params"] = sprintf("a=%s&z=%s&cdate=%s", $params['a'], $params['z'], "posting_date");
         $data["source_url"] = APP::urlFor('stok.export');
     } catch (Exception $e) {
         App::flash('error', $e);
     }
     APP::render('stock/print_laporan_harian', $data);
 }
Esempio n. 5
0
 public function list_penjualan()
 {
     $grid['folder'] = "Laporan";
     $grid['title'] = "Penjualan";
     $cols = array();
     // $cols[] = json_decode('{"field": "state", "checkbox": true}');
     $cols[] = json_decode('{ "label": "Nota", "name": "id", "key": true}');
     $cols[] = json_decode('{ "label": "Tanggal Posting", "name": "posting_date", "sortable": true}');
     $cols[] = json_decode('{ "label": "Jam Posting", "name": "posting_time", "sortable": true}');
     $cols[] = json_decode('{ "label": "Reg. no", "name": "pasien_reg_no", "sortable": true}');
     $cols[] = json_decode('{ "label": "Nama Pasien", "name": "pasien_nama", "sortable": true}');
     $cols[] = json_decode('{ "label": "Alamat Pasien", "name": "pasien_alamat"}');
     $cols[] = json_decode('{ "label": "Jenis Tagihan", "name": "price_list"}');
     $cols[] = json_decode('{ "label": "Kasir", "name": "kasir"}');
     $cols[] = json_decode('{ "label": "Total", "name": "amount",
   "align": "right",
   "formatter": "currency",
   "formatoptions": {
     "decimalSeparator": ".",
     "decimalPlaces": "2",
     "thousandsSeparator": ",",
     "prefix": "Rp. " }
   }');
     $cols[] = json_decode('{ "label": "Bayar", "name": "payment",
   "align": "right",
   "formatter": "currency",
   "formatoptions": {
     "decimalSeparator": ".",
     "decimalPlaces": "2",
     "thousandsSeparator": ",",
     "prefix": "Rp. " }
   }');
     $grid["cols"] = json_encode($cols);
     $grid['source_url'] = APP::urlFor('selling.dataset_penjualan');
     $grid['url_print'] = APP::urlFor('selling.print_invoice');
     $grid['url_harian'] = APP::urlFor('selling.print_invoice');
     $grid['url_cancel'] = APP::urlFor('selling.d011');
     $grid['method'] = "GET";
     $grid['gridtitle'] = "Penjualan";
     // untuk detail penjualan
     $grid['detail_grid_url'] = APP::urlFor('selling.detail_penjualan');
     $grid['detail_grid_title'] = "Invoice #-";
     $cols = array();
     // $cols[] = json_decode('{"field": "state", "checkbox": true}');
     $cols[] = json_decode('{ "label": "id", "name": "id", "key": true, "hidden": true}');
     $cols[] = json_decode('{ "label": "Kode Item", "name": "item_kode", "width": 100}');
     $cols[] = json_decode('{ "label": "Nama Item","name": "item_nama"}');
     $cols[] = json_decode('{ "label": "UOM", "name": "item_uom", "hidden": true}');
     $cols[] = json_decode('{ "label": "Dosis", "name": "dosis", "hidden": true}');
     $cols[] = json_decode('{ "label": "Batch no", "name": "batch_no", "hidden": true}');
     $cols[] = json_decode('{ "label": "Dari Gudang", "name": "warehouse", "hidden": true}');
     $cols[] = json_decode('{ "label": "Qty", "name": "actual_qty",
     "width": 75,
     "align": "left",
     "formatter": "integer",
     "formatoptions": { "thousandsSeparator": "," },
     "editable": true,
     "editrules": {
       "number": true,
       "minValue": 0,
       "maxValue": 10000,
       "required": true
     }
   }');
     $cols[] = json_decode('{ "label": "Harga Dasar", "name": "basic_rate", "hidden": true}');
     $cols[] = json_decode('{ "label": "Harga Jual", "name": "item_price",
   "width": 85,
   "align": "right",
   "formatter": "currency",
   "formatoptions": {
     "decimalSeparator": ".",
     "decimalPlaces": "2",
     "thousandsSeparator": ",",
     "prefix": "Rp. " },
     "editable": true,
     "editrules": {
       "number": true
     }
   }');
     $cols[] = json_decode('{ "label": "Total Harga", "name": "amount",
   "width": 85,
   "align": "right",
   "formatter": "currency",
   "formatoptions": {
     "decimalSeparator": ".",
     "decimalPlaces": "2",
     "thousandsSeparator": ",",
     "prefix": "Rp. "
   }
   }');
     $grid["detail_cols"] = json_encode($cols);
     APP::render('selling/report_view', $grid);
 }