EVOLUTION-NINJA
Edit File: Outsource_model.php
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); class Outsource_model extends CI_Model { public function __construct() { parent::__construct(); } public function insert($table,$data) { $this->db->insert($table,$data); } public function fetch_where_data($table) { $this->db->select("*"); $this->db->from($table); $query = $this->db->get(); return $query->result(); } public function fetch_where_subgrid_data_total_val($table,$where) { $this->db->select_sum("issue_stock"); $this->db->from($table); $this->db->where($where); $query = $this->db->get(); return $query->row(); } public function fetch_where_subgrid_qty_total_datas_po($table,$where) { $this->db->select('sum(stock_qty) as stock_wt'); $this->db->from($table); $this->db->where($where); $query = $this->db->get(); return $query->row(); } public function get_des_data_fetch($table,$where) { $this->db->select('*'); $this->db->order_by('id','DESC'); $this->db->from($table); $this->db->where($where); $query=$this->db->get(); return $query->result(); } public function get_des_data_fetch1() { $this->db->select('create_yarntwisting_work_order.*,sum(work_order_twisting.twisting_net_weight) as net,sum(work_order_twisting.tare_weight) as tare, sum(create_materialissue_work_order.issued_net_weight) as net1'); $this->db->order_by('create_yarntwisting_work_order.id','DESC'); $this->db->from('create_yarntwisting_work_order'); $this->db->join('work_order_twisting','work_order_twisting.yarn_id=create_yarntwisting_work_order.id'); $this->db->join('create_materialissue_work_order','create_materialissue_work_order.work_order=create_yarntwisting_work_order.work_order'); $this->db->where('create_yarntwisting_work_order.status',0); $this->db->group_by('create_yarntwisting_work_order.work_order'); $query=$this->db->get(); $result= $query->result(); $latest = array(); foreach($result as $value) { $data['id']=$value->id; $data['work_order_no']=$value->work_order_no; $data['vendor_name']=$value->vendor_name; $ys=$value->yarn_specification; $din=$value->yarn_denier; $name=$value->yarn_name; $data['yarn_name']=$name . $din . $ys; $data['quty_kgs']=$value->quty_kgs; $data['net']=$value->net; $net1 = $value->quty_kgs; $net = $value->net; $data['variance']=$net-$net1; $varience=$net-$net1; if($net1==0){ $data['variencess'] =0.00; }else{ $data['variencess'] = ($varience/ $net1)*100 ; } $data['tare']=$value->tare; $data['rate_inr']=$value->rate_inr; $data['quantity_approval']=$value->quantity_approval; array_push($latest, $data); } return $latest; } public function get_des_data_fetch2() { $this->db->select('create_yarntwisting_work_order.*,sum(work_order_twisting.twisting_net_weight) as net,sum(work_order_twisting.tare_weight) as tare, sum(create_materialissue_work_order.issued_net_weight) as net1'); $this->db->order_by('create_yarntwisting_work_order.id','DESC'); $this->db->from('create_yarntwisting_work_order'); $this->db->join('work_order_twisting','work_order_twisting.yarn_id=create_yarntwisting_work_order.id'); $this->db->join('create_materialissue_work_order','create_materialissue_work_order.work_order=create_yarntwisting_work_order.work_order'); $this->db->where('create_yarntwisting_work_order.status',0); $this->db->group_by('create_yarntwisting_work_order.work_order'); $query=$this->db->get(); $result= $query->result(); $latest = array(); foreach($result as $value) { $data['id']=$value->id; $data['work_order_no']=$value->work_order_no; $data['vendor_name']=$value->vendor_name; $data['date']=$value->date; $data['delivery_date']=$value->delivery_date; $data['quty_kgs']=$value->quty_kgs; $ys=$value->yarn_specification; $din=$value->yarn_denier; $name=$value->yarn_name; $data['yarn_name']=$name . $din . $ys; $data['net']=$value->net; $net1 = $value->quty_kgs; $net = $value->net; $data['variance']=$net-$net1; $data['quantity_approval']=$value->quantity_approval; array_push($latest, $data); } return $latest; } public function fetch_where_subgrid_group_by_data($table,$where) { $this->db->select("*"); $this->db->group_by('ssl_shade','size','article','osl_no'); $this->db->from($table); $this->db->where($where); $query = $this->db->get(); return $query->result(); } public function fetch_wo_numers($oslvalue) { $query = $this->db->query("SELECT * FROM workorder_dyeing WHERE work_order_no LIKE '%" . 'WO' . "%'"); return $query->result(); } public function fetch_where_subgrid_result_rec_mtr_data($table,$where) { $this->db->select_sum("received_mtrs"); $this->db->from($table); $this->db->where($where); // $this->db->where('warp_qua !=',""); $query = $this->db->get(); return $query->row(); } public function fetch_where_net_goods_total($table,$where) { $this->db->select_sum('issue_net_wt'); //$this->db->select('quantity'); $this->db->from($table); $this->db->where($where); $query = $this->db->get(); return $query->row(); } public function fetch_where_rem_goods_total($table,$where) { $this->db->select_sum('rements'); //$this->db->select('quantity'); $this->db->from($table); $this->db->where($where); $query = $this->db->get(); return $query->row(); } public function fetch_where_subgrid_qty_total_data($table,$where) { $this->db->select('sum(stock_wt) as stock_wt'); $this->db->from($table); $this->db->where($where); $query = $this->db->get(); return $query->row(); } public function fetch_where_subgrid_gross_total_data($table,$where) { $this->db->select('sum(gross_wt) as gross_wt'); $this->db->from($table); $this->db->where($where); $query = $this->db->get(); return $query->row(); } public function fetch_where_subgrid_net_total_data($table,$where) { $this->db->select('sum(net_wt) as net_wt'); $this->db->from($table); $this->db->where($where); $query = $this->db->get(); return $query->row(); } public function fetch_where_subgrid_result_rec_wei_data($table,$where) { $this->db->select_sum("received_weight"); $this->db->from($table); $this->db->where($where); // $this->db->where('warp_qua !=',""); $query = $this->db->get(); return $query->row(); } public function fetch_where_subgrid_sum_dat($where,$where1) { $this->db->select_sum('rec_qua'); $this->db->from('finishing_embroidry'); $this->db->where('finishing_embroidry.work_order_num',$where); $this->db->where('finishing_embroidry.work_order',$where1); $this->db->where('finishing_embroidry.status',1); $this->db->join('finishing_embroidry_stock', 'finishing_embroidry_stock.fin_emb_id = finishing_embroidry.id'); $query = $this->db->get(); return $query->row(); } public function fetch_where_subgrid_data_issue_no($table,$where) { $this->db->select("*"); $this->db->group_by("issue_no"); $this->db->from($table); $this->db->where($where); $query = $this->db->get(); return $query->result(); } public function finishing_emb_data3($table,$where) { $this->db->select('*'); $this->db->from('finishing_embroidry'); $this->db->join('finishing_embroidry_stock', 'finishing_embroidry_stock.fin_emb_id = finishing_embroidry.id'); $this->db->where('finishing_embroidry.work_order_num', $where); $query=$this->db->get(); return $query->result(); } public function fetch_where_wt_goods_total($table,$where) { $this->db->select_sum('dyed_weight'); //$this->db->select('quantity'); $this->db->from($table); $this->db->where($where); $query = $this->db->get(); return $query->row(); } public function finishing_emb_data($table,$where) { $this->db->select('*'); $this->db->from('finishing_embroidry'); $this->db->join('finishing_embroidry_stock', 'finishing_embroidry_stock.fin_emb_id = finishing_embroidry.id'); $this->db->where('finishing_embroidry_stock.fin_emb_id', $where); $query=$this->db->get(); return $query->result(); } public function complted_getweaving_data($table,$where) { $this->db->select('*'); $this->db->from($table); $this->db->where($where); //$this->db->where('fabric_details','Not Yet'); //$this->db->or_where('fabric_details','Partly'); // $this->db->where('fabric_details !=', 'Completed'); $query=$this->db->get(); return $query->result(); } public function complted_getweaving_datass($table,$where) { $this->db->select('*'); $this->db->from($table); $this->db->where($where); //$this->db->where('fabric_details','Not Yet'); //$this->db->or_where('fabric_details','Partly'); //$this->db->where('warp_pland_mtr !=', '0'); // $this->db->or_where('weft_pland_mtr !=', '0'); $wherecond = "( ( ( warp_pland_mtr ='0' AND weft_pland_mtr >'0') OR ( warp_pland_mtr >'0' AND weft_pland_mtr ='0') OR ( warp_pland_mtr >'0' AND weft_pland_mtr >'0') ) )"; $this->db->where($wherecond); $query=$this->db->get(); return $query->result(); } public function fetch_where_subgrid_data223($where) { $this->db->select('*'); $this->db->from('finishing_embroidry'); $this->db->where('finishing_embroidry.id',$where); $this->db->join('finishing_embroidry_stock', 'finishing_embroidry_stock.fin_emb_id = finishing_embroidry.id'); $query = $this->db->get(); return $query->row(); } public function get_data($table,$where) { $this->db->select('*'); $this->db->from($table); $this->db->where($where); $query=$this->db->get(); return $query->result(); } public function max_select_maximum_id($table) { $this->db->select_max('id'); $this->db->from($table); $query = $this->db->get(); return $query->row(); } public function get_purchase_data($table,$where) { $this->db->select('*'); $this->db->group_by('po_no','indent_no','vendor_name','g_date','currency','confirm','approved_by','remark'); $this->db->order_by('po_id'); $this->db->from($table); $this->db->where($where); $query=$this->db->get(); return $query->result(); } public function get_data1($table,$where) { $this->db->select('*'); $this->db->group_by('sl_indent_no'); $this->db->from($table); $this->db->where($where); $query=$this->db->get(); return $query->result(); } public function Get($keyword) { $this->db->distinct(); $this->db->select('product'); $this->db->order_by('id', 'DESC'); $this->db->like("product", $keyword); $this->db->from('indent_product'); $query= $this->db->get(); return $query->result(); } public function get_customerdata($table,$where) { $this->db->select("*"); $this->db->from($table); $this->db->where($where); $query = $this->db->get(); return $query->row(); } public function getsuborder1($id) { $this->db->select('*'); $this->db->from('indent_add_indent'); //$this->db->join('sub_order_shades', 'sub_order_shades.subOrderID = sub_orders.subCode'); $this->db->where('sl_indent_no', $id); $this->db->where('confirm', 'No'); $query = $this->db->get(); return $query->result(); } public function get_where_data($table,$where) { $this->db->select("*"); $this->db->from($table); $this->db->where($where); $query = $this->db->get(); $arr=array(); foreach($query->result() as $row) { $arr[]=$row; } $json=json_encode($arr); return $json; } public function Getsearch($keyword) { $this->db->distinct(); $this->db->select('product'); //$this->db->order_by('customer_name', 'DESC'); $this->db->like("product", $keyword); $this->db->from('indent_product'); $query= $this->db->get(); return $query->result(); } public function Getsearch_pono($keyword) { $this->db->distinct(); $this->db->select('po_no'); //$this->db->order_by('customer_name', 'DESC'); $this->db->like("po_no", $keyword); $this->db->from('indent_po'); $this->db->where('confirm', 'Yes'); $this->db->where('product_type', 'Fabrics'); $query= $this->db->get(); return $query->result(); } public function yarn_raw_Getsearch_pono($keyword,$status) { $this->db->distinct(); $this->db->select('po_no'); $this->db->like("po_no", $keyword); $this->db->from('indent_po'); $this->db->or_where_in('product_type', $status); $query= $this->db->get(); return $query->result(); } public function cs_received_Getsearch_pono($keyword,$status) { $this->db->distinct(); $this->db->select('po_no'); $this->db->like("po_no", $keyword); $this->db->from('indent_po'); $this->db->or_where_in('product_type', $status); $query= $this->db->get(); return $query->result(); } public function Get_search($keyword) { $this->db->distinct(); $this->db->select('name'); //$this->db->order_by('customer_name', 'DESC'); $this->db->like("name", $keyword); $this->db->from('indent_vendor_master'); $query= $this->db->get(); return $query->result(); } public function max_select_indent_no($table) { $this->db->select_max('sl_indent_no'); $this->db->from($table); $query = $this->db->get(); return $query->row(); } public function max_select_indent_no_id($table) { $this->db->select_max('id'); $this->db->from($table); $query = $this->db->get(); return $query->row(); } public function update_data($where,$table,$data) { $this->db->where($where); $this->db->update($table,$data); } public function delete_product_vendor($where){ $this->db->where($where); $this->db->delete('indent_product'); return; } public function delete_vendor($table,$where){ $this->db->where($where); $this->db->delete($table); return; } public function max_select_purchase_no($table) { $this->db->select_max('po_id'); $this->db->from($table); $query = $this->db->get(); return $query->row(); } public function max_select_goods($table) { $this->db->select_max('invoice_no_id'); $this->db->from($table); $query = $this->db->get(); return $query->row(); } public function Getsearch_auto($keyword,$where) { $this->db->distinct(); $this->db->select('indent_no'); $this->db->like("indent_no", $keyword); $this->db->from('indent_add_indent'); $this->db->where($where); $query= $this->db->get(); return $query->result(); } public function Getsearch_vendorname_auto($keyword) { $this->db->distinct(); $this->db->select('name'); $this->db->like("name", $keyword); $this->db->from('indent_vendor_master'); $query= $this->db->get(); return $query->result(); } public function Getsearch_shade_auto($keyword) { $this->db->distinct(); $this->db->select('color'); $this->db->like('color', $keyword); $this->db->from('color_master'); $query= $this->db->get(); return $query->result(); } public function update_new($data,$where) { $this->db->where($where); $this->db->update('indent_add_indent',$data); } public function update_confirm_purchase($data,$where) { $this->db->where($where); $this->db->update('indent_purchase_order',$data); } public function get_where_dataa($table,$where) { $this->db->select('*'); $this->db->from($table); $this->db->where($where); $query=$this->db->get(); return $query->result(); } public function getsuborder($id) { $this->db->select('*'); $this->db->from('indent_add_indent'); //$this->db->join('sub_order_shades', 'sub_order_shades.subOrderID = sub_orders.subCode'); $this->db->where('sl_indent_no', $id); $query = $this->db->get(); return $query->result(); } public function getproduct_details($po_id) { $this->db->select('*'); $this->db->from('indent_po'); $this->db->join('indent_product', 'indent_product.product = indent_po.product_name'); $this->db->where('indent_po.po_id', $po_id); //$this->db->where('indent_product.product','indent_po.product_name'); //$this->db->where('indent_product.product_type','indent_po.product_type'); $query = $this->db->get(); return $query->result(); } public function getpurchaseorder($id) { $this->db->select('*'); $this->db->from('indent_purchase_order'); //$this->db->join('sub_order_shades', 'sub_order_shades.subOrderID = sub_orders.subCode'); $this->db->where('sl_no', $id); $query = $this->db->get(); return $query->result(); } public function fetch_where_subgrid_data($table,$where) { $this->db->select("*"); $this->db->from($table); $this->db->where($where); $query = $this->db->get(); return $query->row(); } public function fetch_where_subgrid_data1($table,$where) { $this->db->select("*"); $this->db->from($table); $this->db->where($where); $query = $this->db->get(); return $query->result(); } public function fetch_where_subgrid_data_desc($table,$where) { $this->db->select("*"); $this->db->from($table); $this->db->where($where); $this->db->order_by('package_packing.id','ASC'); $query = $this->db->get(); return $query->result(); } public function fetch_where_subgrid_data1_update($table,$where) { $this->db->select("*"); $this->db->from($table); $this->db->where($where); $query = $this->db->get(); $result = $query->result(); // $this->db->select("issue_loom.*,weaving_panel_planning_order.shade"); // $this->db->from('issue_loom'); // //$this->db->join('indent_po', 'indent_po.id = indent_yarn_goods_details.po_list_id'); // $this->db->join('weaving_panel_planning_order', 'weaving_panel_planning_order.id = issue_loom.weaving_panel_id'); // $this->db->where('issue_loom.weaving_panel_id',$i); // $query = $this->db->get(); // $result= $query->result(); $array = array(); foreach($result as $val) { $table_id=$val->yarn_ids; // echo $table_id; $arr = preg_match_all('/([0-9]+|[a-zA-Z]+)/',$table_id,$matches); $first_input_field = $matches[0]; $second_input_field = $matches[1]; if($second_input_field[0] == 'd'){ $this->db->select("indent_yarn_goods_details.*,indent_po.purpose,indent_po.product_type"); $this->db->from('indent_yarn_goods_details'); $this->db->join('indent_po', 'indent_po.id = indent_yarn_goods_details.po_list_id'); $this->db->where('indent_yarn_goods_details.id',$second_input_field[1],'indent_yarn_goods_details.lot',$val->yarn_lot,'indent_yarn_goods_details.bale',$val->yarn_bale,'indent_yarn_goods_details.yarndenier',$val->yarn_den,'indent_yarn_goods_details.yarnspecification',$val->yarn_spec,'indent_yarn_goods_details.yarnname',$val->yarn_name); $this->db->where('indent_po.product_type', 'Yarn - Dyed'); $query1 = $this->db->get(); $result1 = $query1->result(); if(count($result1) == 1){ foreach($result1 as $val1) { $data['purpose'] = $val1->purpose; } } else{ $this->db->select("indent_yarn_goods_details.*,indent_po.purpose,indent_po.product_type"); $this->db->from('indent_yarn_goods_details'); $this->db->join('indent_po', 'indent_po.id = indent_yarn_goods_details.po_list_id'); $this->db->where('indent_yarn_goods_details.po_list_id',$second_input_field[1],'indent_yarn_goods_details.lot',$val->yarn_lot,'indent_yarn_goods_details.bale',$val->yarn_bale,'indent_yarn_goods_details.yarndenier',$val->yarn_den,'indent_yarn_goods_details.yarnspecification',$val->yarn_spec,'indent_yarn_goods_details.yarnname',$val->yarn_name); $this->db->where('indent_po.product_type', 'Yarn - Dyed'); $query1 = $this->db->get(); $result1 = $query1->result(); foreach($result1 as $val1) { $data['purpose'] = $val1->purpose; } } } else if($second_input_field[0] == 'r'){ $this->db->select("indent_yarn_goods_details.*,indent_po.purpose,indent_po.product_type"); $this->db->from('indent_yarn_goods_details'); $this->db->join('indent_po', 'indent_po.id = indent_yarn_goods_details.po_list_id'); $this->db->where('indent_yarn_goods_details.id',$second_input_field[1],''); $this->db->where('indent_po.product_type', 'Yarn - Raw'); $query1 = $this->db->get(); $result1 = $query1->result(); foreach($result1 as $val1) { $data['purpose'] = $val1->purpose; } } else if($second_input_field[0] == 't'){ $this->db->select("delivery_yarn_twisting.purpose"); $this->db->from('delivery_yarn_twisting'); $this->db->where('delivery_yarn_twisting.id',$second_input_field[1],''); //$this->db->where('indent_po.product_type', 'Yarn - Raw'); $query1 = $this->db->get(); $result1 = $query1->result(); foreach($result1 as $val1) { $data['purpose'] = $val1->purpose; } } else if($second_input_field[0] == 's'){ $this->db->select("work_order_dyeing.osl_no"); $this->db->from('work_order_dyeing'); $this->db->where('work_order_dyeing.id',$second_input_field[1],''); //$this->db->where('indent_po.product_type', 'Yarn - Raw'); $query1 = $this->db->get(); $result1 = $query1->result(); foreach($result1 as $val1) { $data['purpose'] = $val1->osl_no; } } else{ $data['purpose'] = 'Purpose'; } $data['id'] = $val->id; $data['yarn_name'] = $val->yarn_name; $data['yarn_den'] = $val->yarn_den; $data['yarn_spec'] = $val->yarn_spec; $data['ssl_shade_w'] = $val->ssl_shade_w; $data['dtl_shade'] = $val->dtl_shade; $data['shade'] = $val->yarn_ssl_shade; $data['color_code'] = $val->color_code; $data['yarn_lot'] = $val->yarn_lot; $data['yarn_bale'] = $val->yarn_bale; $data['stock_net_wt'] = $val->stock_net_wt; $data['issue_net_wt'] = $val->issue_net_wt; $data['rements'] = $val->rements; $data['balanced_stock_wt'] = $val->balanced_stock_wt; $data['issued_date'] = $val->issued_date; $data['remarks'] = $val->remarks; $data['add_stock_status'] = $val->add_stock_status; $data['add_stock_val'] = $val->add_stock_val; $data['add_stock_date'] = $val->add_stock_date; $data['re_process'] = $val->re_process; $data['approved_by'] = $val->approved_by; $yarn=$val->yarn_ids; if($yarn[0]=='r') { $data['yarn_type'] = 'Raw Yarn'; } else if($yarn[0]=='t') { $data['yarn_type'] = 'Twisted Yarn'; } else if($yarn[0]=='d') { $data['yarn_type'] = 'Dyed Yarn'; } else if($yarn[0]=='s') { $data['yarn_type'] = 'Swan-Dyed Yarn'; } else if($yarn[0]=='rem') { $data['yarn_type'] ='Remnant'; } else { $data['yarn_type'] = ''; } array_push($array,$data); } return $array; } public function fetch_where_subgrid_data_madeups_packing($table,$where) { $this->db->select("*"); $this->db->from($table); $this->db->where($where); $query = $this->db->get(); return $query->result(); } public function marking_list_data($table,$where) { $this->db->select("madeups_packing.*,MAX(madeups_packing.box_id)as max_box,madeups_box_packing.box_dimension"); $this->db->from('madeups_packing'); $this->db->join('madeups_box_packing','madeups_packing.box_id=madeups_box_packing.box_id','left'); //$this->db->join('madeups_invoice_packing','madeups_packing.id=madeups_invoice_packing.pack_des_id','left'); $this->db->where($where); $this->db->group_by('madeups_packing.id'); $this->db->order_by('madeups_packing.box_id'); $query = $this->db->get(); //print_r($this->db->last_query()); //die(); return $query->result(); } public function fetch_where_subgrid_data1_order($data1,$financ_year) { $this->db->select("madeups_invoice_packing.*,madeups_packing.orderNo,madeups_packing.ssl_shade,madeups_packing.skuno,madeups_packing.id made_id"); $this->db->from('madeups_invoice_packing'); $this->db->join('madeups_packing','madeups_invoice_packing.pack_des_id=madeups_packing.id'); $this->db->where('madeups_invoice_packing.invoice',$data1); $this->db->where('madeups_invoice_packing.status',0); $this->db->where('madeups_invoice_packing.financ_year',$financ_year); $query = $this->db->get(); return $query->result(); } public function fetch_where_subgrid_data1_order_fabric($data1,$financ_year) { $this->db->select("invoice_packing.*,packing_list_data.orderNo,packing_list_data.ssl_shade,packing_list_data.skuno"); $this->db->from('invoice_packing'); $this->db->join('packing_list_data','invoice_packing.pack_id=packing_list_data.id'); $this->db->where('invoice_packing.invoice',$data1); $this->db->where('invoice_packing.status',0); $this->db->where('invoice_packing.financ_year',$financ_year); $query = $this->db->get(); return $query->result(); } public function fetch_where_subgrid_data1_fabric_order($data1,$financ_year) { $this->db->select("invoice_packing.*,package_packing.customer_name"); $this->db->from('invoice_packing'); $this->db->join('package_packing','invoice_packing.packing_ref_id=package_packing.id'); $this->db->where('invoice_packing.invoice',$data1); $this->db->where('invoice_packing.status',0); $this->db->where('invoice_packing.financ_year',$financ_year); $query = $this->db->get(); return $query->result(); } public function fetch_where_subgrid_data1s($data1) { $this->db->distinct(); $this->db->select("*,workorder_dyeing_material.warp_color as color"); $this->db->from('workorder_dyeing'); $this->db->join('workorder_dyeing_material','workorder_dyeing.issue_no=workorder_dyeing_material.issue_no'); $this->db->where('workorder_dyeing.work_order',$data1); $this->db->where('workorder_dyeing.status',0); $this->db->where('workorder_dyeing_material.status',0); $this->db->group_by('workorder_dyeing.issue_no'); $query = $this->db->get(); return $query->result(); } public function fetch_where_subgrid_ordered_data1($table,$where) { $this->db->select("*"); $this->db->order_by('box_id'); $this->db->from($table); $this->db->where($where); $query = $this->db->get(); return $query->result(); } public function fetch_where_subgrid_work_order($table,$where) { $this->db->select('material_yarnname as name,sum(issued_gross_Weight) as gross,sum(issued_net_weight) as net'); $this->db->from($table); $this->db->where($where); $this->db->group_by('material_yarnname'); $query = $this->db->get(); return $query->result(); } public function update_confirm_indent($data,$where) { $this->db->where($where); $this->db->update('indent_add_indent',$data); } public function fetch_where_subgrid_data2($where,$id1) { $this->db->select('indent_purchase_order.rate_inr,indent_purchase_order.value_inr,indent_add_indent.add_product,indent_add_indent.quantity,indent_add_indent.indent_no'); $this->db->from('indent_add_indent'); $this->db->where('indent_add_indent.sl_indent_no', $where); $this->db->where('indent_purchase_order.id', $id1); $this->db->join('indent_purchase_order', 'indent_purchase_order.sl_indent_no = indent_add_indent.sl_indent_no'); $query = $this->db->get(); return $query->result(); } public function getproducts($type) { $query = $this->db->query('SELECT DISTINCT(product) FROM indent_product where product_type="' . $type .'"'); return $query->result(); } public function getunit($type) { $query = $this->db->query('SELECT * FROM indent_product where product="' . $type .'"'); return $query->row(); } public function get_wish_list_data($ids) { $this->db->select('*'); $this->db->from('indent_add_indent'); $this->db->where('id', $ids); $query=$this->db->get(); return $query->row(); } public function get_data_fetch($table,$where) { $this->db->select('*'); $this->db->from($table); $this->db->where($where); $query=$this->db->get(); return $query->result(); } public function update_po_list_confirm_purchase($table,$data,$where) { $this->db->where($where); $this->db->update($table,$data); } public function update_fetch_data($val) { $this->db->select('*'); $this->db->from('indent_po'); $this->db->where('id', $val); $query=$this->db->get(); return $query->row(); } public function fetch_where_ot_charges_subgrid_data($table,$where) { $this->db->select("*"); $this->db->from($table); $this->db->where($where); $this->db->where('department !=', ' '); $query = $this->db->get(); return $query->result(); } public function fetch_where_quantity_total($table,$where) { $this->db->select_sum('rec_goods'); //$this->db->select('quantity'); $this->db->from($table); $this->db->where($where); $query = $this->db->get(); return $query->row(); } public function history_data_fetch($table) { $this->db->select('*'); $this->db->from($table); $this->db->where('department !=', ' '); $query=$this->db->get(); return $query->result(); } public function fetch_where_cs_quantity_total($table,$where) { $this->db->select_sum('gross_weight'); //$this->db->select('quantity'); $this->db->from($table); $this->db->where($where); $query = $this->db->get(); return $query->row(); } public function getgoods_data($table,$where) { $this->db->select('*'); $this->db->from($table); $this->db->where($where); $this->db->where('department !=', ' '); $query=$this->db->get(); return $query->result(); } public function get_wish_list_dataa($ids) { $this->db->select('*'); $this->db->from('indent_add_indent'); $this->db->join('indent_product', 'indent_product.product = indent_add_indent.add_product'); $this->db->where('indent_add_indent.id', $ids); $query = $this->db->get(); return $query->row(); } public function fetch_where_consum_spares_quantity_total($table,$where) { $this->db->select_sum('received_quality'); //$this->db->select('quantity'); $this->db->from($table); $this->db->where($where); $query = $this->db->get(); return $query->row(); } public function fetch_where_row_data($table,$where) { $this->db->select('*'); //$this->db->select('quantity'); $this->db->from($table); $this->db->where($where); $query = $this->db->get(); return $query->row(); } public function display_warp_yarnqty_data() { // $this->db->select('*'); // $this->db->from('import_yarn'); // $this->db->join('yarn_stage', 'yarn_stage.yarnID = import_yarn.id'); // $this->db->where('yarnType', 'Warp'); // $query=$this->db->get(); // return $query->result(); $this->db->select('*'); $this->db->from('import_yarn'); $this->db->where('yarnType', 'Warp'); $query=$this->db->get(); return $query->result(); } public function display_weft_yarnqty_data() { // $this->db->select('*'); // $this->db->from('import_yarn'); // $this->db->join('yarn_stage', 'yarn_stage.yarnID = import_yarn.id'); // $this->db->where('yarnType', 'Weft'); // $query=$this->db->get(); // return $query->result(); $this->db->select('*'); $this->db->from('import_yarn'); $this->db->where('yarnType', 'Weft'); $query=$this->db->get(); return $query->result(); } public function display_yarnqty_data($where) { $this->db->select('yarn_secondary.direction as sd,yarn_secondary.count as sc,yarn_primary.direction as pd,yarn_primary.count as pc,import_yarn.*'); $this->db->from('import_yarn'); // $this->db->join('yarn_stage', 'yarn_stage.yarnID = import_yarn.id'); $this->db->join('yarn_primary', 'yarn_primary.yarnID = import_yarn.id'); $this->db->join('yarn_secondary', 'yarn_secondary.yarnID = import_yarn.id'); $this->db->where('import_yarn.id', $where); $query=$this->db->get(); return $query->row(); } public function display_yarnqty_data11($where) { $this->db->select('yarn_primary.direction as pd,yarn_primary.count as pc,import_yarn.*'); $this->db->from('import_yarn'); // $this->db->join('yarn_stage', 'yarn_stage.yarnID = import_yarn.id'); $this->db->join('yarn_primary', 'yarn_primary.yarnID = import_yarn.id'); $this->db->where('import_yarn.id', $where); $query=$this->db->get(); return $query->row(); } public function display_yarnqty_data111($where) { $this->db->select('yarn_secondary.direction as sd,yarn_secondary.count as sc,import_yarn.*'); $this->db->from('import_yarn'); // $this->db->join('yarn_stage', 'yarn_stage.yarnID = import_yarn.id'); $this->db->join('yarn_secondary', 'yarn_secondary.yarnID = import_yarn.id'); $this->db->where('import_yarn.id', $where); $query=$this->db->get(); return $query->row(); } public function display_weaving_data($where) { $this->db->select('*'); $this->db->from('work_order_dyeing'); $this->db->where('id', $where); $query=$this->db->get(); return $query->row(); } public function display_yarn_data() { $this->db->select('*'); $this->db->from('indent_po'); $this->db->join('indent_yarn_goods_details', 'indent_po.id = indent_yarn_goods_details.po_list_id'); //$this->db->where('indent_po.product_type', 'Yarn - Twisted'); $query=$this->db->get(); return $query->result(); } public function max_select_workorer_id($table) { $this->db->select_max('work_order'); $this->db->from($table); $query = $this->db->get(); return $query->row(); } public function select_max_vendor_id() { $this->db->select('import_fileno'); $this->db->order_by('id',"desc"); $this->db->limit(1); $query = $this->db->get('outsource_vendor_master'); return $query->row(); } public function display_yarn_twisting_data1() { $this->db->select('*'); $this->db->from('indent_po'); $this->db->join('indent_yarn_goods_details', 'indent_po.id = indent_yarn_goods_details.po_list_id'); $this->db->where('indent_po.product_type', 'Yarn - Twisted'); $this->db->where('indent_yarn_goods_details.issue_net_Weight >', '0'); $this->db->where('indent_yarn_goods_details.yarn_status', '0'); $query=$this->db->get(); return $query->result(); } public function display_yarn_stock_twisting_data1() { $this->db->select('*'); $this->db->from('indent_po'); $this->db->join('indent_yarn_goods_details', 'indent_po.id = indent_yarn_goods_details.po_list_id'); $this->db->join('workorder_yarn_details','workorder_yarn_details.yarn_details = indent_yarn_goods_details.yarnname'); $this->db->where('indent_po.product_type', 'Yarn - Twisted'); $this->db->where('indent_yarn_goods_details.yarn_status', 'Not Completed'); $query=$this->db->get(); return $query->result(); } public function display_yarn_raw_data1() { $this->db->select('*'); $this->db->from('indent_po'); $this->db->join('indent_yarn_goods_details', 'indent_po.id = indent_yarn_goods_details.po_list_id'); //$this->db->join('workorder_yarn_details','workorder_yarn_details.yarn_details = indent_yarn_goods_details.yarnname'); $this->db->where('indent_po.product_type', 'Yarn - Raw'); $this->db->where('indent_yarn_goods_details.issue_net_weight >', 0); $this->db->where('indent_yarn_goods_details.yarn_status', '0'); $query=$this->db->get(); return $query->result(); } public function display_yarn_stock_raw_data1() { $this->db->select('*'); $this->db->from('indent_po'); // $this->db->join('workorder_yarn_details','workorder_yarn_details.yarn_details = indent_yarn_goods_details.yarnname'); $this->db->join('indent_yarn_goods_details', 'indent_po.id = indent_yarn_goods_details.po_list_id'); $this->db->join('workorder_yarn_details','indent_yarn_goods_details.yarnname = workorder_yarn_details.yarn_details'); $this->db->where('indent_po.product_type', 'Yarn - Raw'); $this->db->where('indent_yarn_goods_details.yarn_status','0'); $query=$this->db->get(); return $query->result(); } public function display_yarn_twisting_data() { $this->db->select('*'); $this->db->from('indent_po'); $this->db->join('indent_yarn_goods_details', 'indent_po.id = indent_yarn_goods_details.po_list_id'); $this->db->where('indent_po.product_type', 'Yarn - Twisted'); $query=$this->db->get(); return $query->result(); } public function display_yarn_twisting1_data() { $this->db->select('*'); $this->db->from('indent_po'); $this->db->join('indent_yarn_goods_details', 'indent_po.id = indent_yarn_goods_details.po_list_id'); $this->db->where('indent_po.product_type', 'Yarn - Twisted'); $this->db->where('indent_yarn_goods_details.issue_gross_weight !=', '0'); //$this->db->where('indent_yarn_goods_details.issue_net_weight !=' ,'0'); $query=$this->db->get(); return $query->result(); } public function display_yarn_twisting11_data($v) { $this->db->distinct(); $this->db->select('*'); $this->db->from('indent_po'); $this->db->join('indent_yarn_goods_details', 'indent_po.id = indent_yarn_goods_details.po_list_id'); $this->db->where('indent_po.product_type', 'Yarn - Twisted'); $this->db->where('indent_yarn_goods_details.issue_gross_weight !=', '0'); $this->db->where('indent_yarn_goods_details.issue_net_weight >' ,'0'); $this->db->like('indent_yarn_goods_details.yarnname' ,$v); $query=$this->db->get(); return $query->result(); } public function display_yarn_twisting111_data() { $this->db->distinct(); $this->db->select('*'); $this->db->from('indent_po'); $this->db->join('indent_yarn_goods_details', 'indent_po.id = indent_yarn_goods_details.po_list_id'); $this->db->where('indent_po.product_type', 'Yarn - Twisted'); $this->db->where('indent_yarn_goods_details.issue_gross_weight !=', '0'); $this->db->where('indent_yarn_goods_details.issue_net_weight >' ,'0'); //$this->db->like('indent_yarn_goods_details.yarnname' ,$v); $query=$this->db->get(); return $query->result(); } public function display_yarn_raw_data() { $this->db->select('*'); $this->db->from('indent_po'); $this->db->join('indent_yarn_goods_details', 'indent_po.id = indent_yarn_goods_details.po_list_id'); $this->db->where('indent_po.product_type', 'Yarn - Raw'); $query=$this->db->get(); return $query->result(); } public function display_yarn_raw1_data() { $this->db->select('*'); $this->db->from('indent_po'); $this->db->join('indent_yarn_goods_details', 'indent_po.id = indent_yarn_goods_details.po_list_id'); $this->db->where('indent_po.product_type', 'Yarn - Raw'); $this->db->where('indent_yarn_goods_details.issue_gross_weight !=' ,'0'); //$this->db->where('indent_yarn_goods_details.issue_net_weight !=', '0'); $query=$this->db->get(); return $query->result(); } public function display_yarn_raw11_data($v) { $this->db->select('*'); $this->db->from('indent_po'); $this->db->join('indent_yarn_goods_details', 'indent_po.id = indent_yarn_goods_details.po_list_id'); $this->db->where('indent_po.product_type', 'Yarn - Raw'); $this->db->where('indent_yarn_goods_details.issue_gross_weight !=' ,'0'); $this->db->where('indent_yarn_goods_details.issue_net_weight >' ,'0'); $this->db->like('indent_yarn_goods_details.yarnname' ,$v); $query=$this->db->get(); return $query->result(); } public function display_yarn_raw111_data() { $this->db->select('*'); $this->db->from('indent_po'); $this->db->join('indent_yarn_goods_details', 'indent_po.id = indent_yarn_goods_details.po_list_id'); $this->db->where('indent_po.product_type', 'Yarn - Raw'); $this->db->where('indent_yarn_goods_details.issue_gross_weight !=' ,'0'); $this->db->where('indent_yarn_goods_details.issue_net_weight >' ,'0'); // $this->db->like('indent_yarn_goods_details.yarnname' ,$v); $query=$this->db->get(); return $query->result(); } public function display_yarn_dyed_data() { $this->db->select('*'); $this->db->from('indent_po'); $this->db->join('indent_yarn_goods_details', 'indent_po.id = indent_yarn_goods_details.po_list_id'); $this->db->where('indent_po.product_type', 'Yarn - Dyed'); $query=$this->db->get(); return $query->result(); } public function display_yarn_dyed1_data() { $this->db->select('*'); $this->db->from('indent_po'); $this->db->join('indent_yarn_goods_details', 'indent_po.id = indent_yarn_goods_details.po_list_id'); $this->db->where('indent_po.product_type', 'Yarn - Dyed'); $this->db->where('indent_yarn_goods_details.issue_gross_weight !=', '0'); //$this->db->where('indent_yarn_goods_details.issue_net_weight !=', '0'); $query=$this->db->get(); // $query=$this->db->get(); return $query->result(); } public function display_yarn_dyed11_data($v) { $this->db->select('*'); $this->db->from('indent_po'); $this->db->join('indent_yarn_goods_details', 'indent_po.id = indent_yarn_goods_details.po_list_id'); $this->db->where('indent_po.product_type', 'Yarn - Dyed'); $this->db->where('indent_yarn_goods_details.issue_gross_weight !=', '0'); $this->db->where('indent_yarn_goods_details.issue_net_weight >' ,'0'); $this->db->like('indent_yarn_goods_details.yarnname' ,$v); $query=$this->db->get(); // $query=$this->db->get(); return $query->result(); } public function display_yarn_dyed111_data() { $this->db->select('*'); $this->db->from('indent_po'); $this->db->join('indent_yarn_goods_details', 'indent_po.id = indent_yarn_goods_details.po_list_id'); $this->db->where('indent_po.product_type', 'Yarn - Dyed'); $this->db->where('indent_yarn_goods_details.issue_gross_weight !=', '0'); $this->db->where('indent_yarn_goods_details.issue_net_weight >' ,'0'); //$this->db->like('indent_yarn_goods_details.yarnname' ,$v); $query=$this->db->get(); // $query=$this->db->get(); return $query->result(); } // public function get_planned_order_detailsrow($subNumber) // { // $this->db->select('so.id,so.articleNo,sos.ourShade, // we.Weft_Quality,we.Weft_Specification,we.Weft_Denier,we.Kora_Wt as weftWt,wa.Warp_Quality,wa.Warp_Specification,wa.Warp_Denier,wa.Kora_Wt as warpWt, // smwa.warpCode,smwe.weftCode'); // $this->db->from('sub_orders so'); // $this->db->where('so.orderID', $subNumber); // $this->db->join('sub_order_shades sos', 'sos.subOrderID = so.id'); // $this->db->join('sm_warp smwa', 'smwa.shadeID = sos.shadeID'); // $this->db->join('sm_weft smwe', 'smwe.shadeID = sos.shadeID'); // $this->db->join('article_master am', 'so.articleNo = am.articleNo'); // $this->db->join('warp_data wa', 'wa.article_id = am.articleID'); // $this->db->join('weft_data we', 'we.article_id = am.articleID'); // $query=$this->db->get(); // return $query->result(); // } public function get_planned_warp_order_detailsrow($subNumber) { //$this->db->distinct('smwa.warpCode'); $this->db->select('so.id, wa.Warp_Quality,wa.Warp_Specification,wa.Warp_Denier,wa.Kora_Wt as warpWt,am.articleNo,sm.shadeName,sm.shadeID '); $this->db->from('planned_order po'); $this->db->where('o.id', $subNumber); //$this->db->where('po.sslShade', $shade); $this->db->where('sos.planningStatus','planned'); $this->db->join('sub_order_shades sos', 'sos.shadeID = po.subNo'); $this->db->join('sub_orders so', 'so.id = sos.subOrderID'); $this->db->join('orders o', 'o.id = so.orderID'); $this->db->join('article_master am', 'so.articleNo = am.articleNo'); $this->db->join('shade_master sm', 'po.sslShade = sm.shadeID'); $this->db->join('warp_data wa', 'wa.article_id = am.articleID'); $query=$this->db->get(); return $query->result(); } public function get_planned_weft_order_detailsrow($subNumber) { //$this->db->distinct('smwe.weftCode'); $this->db->select('so.id, we.Weft_Quality,we.Weft_Specification,we.Weft_Denier,we.Kora_Wt as weftWt,am.articleNo,sm.shadeName,sm.shadeID '); $this->db->from('planned_order po'); $this->db->where('o.id', $subNumber); //$this->db->where('po.sslShade', $shade); $this->db->where('sos.planningStatus','planned'); $this->db->join('sub_order_shades sos', 'sos.shadeID = po.subNo'); $this->db->join('sub_orders so', 'so.id = sos.subOrderID'); $this->db->join('orders o', 'o.id = so.orderID'); $this->db->join('article_master am', 'so.articleNo = am.articleNo'); $this->db->join('shade_master sm', 'po.sslShade = sm.shadeID'); $this->db->join('weft_data we', 'we.article_id = am.articleID'); $query=$this->db->get(); return $query->result(); } public function get_planned_weft_detailsrow($subNumber) { $this->db->select('so.id,so.articleNo,sos.ourShade,'); $this->db->from('sub_orders so'); $this->db->where('so.orderID', $subNumber); $this->db->join('sub_order_shades sos', 'sos.subOrderID = so.id'); $this->db->join('planned_order po', 'po.subNo = sos.shadeID'); $query=$this->db->get(); return $query->row(); } public function Get_search_oslNo($keyword) { $this->db->distinct(); $this->db->select('oslNo'); //$this->db->order_by('customer_name', 'DESC'); $this->db->like("oslNo", $keyword); $this->db->from('orders'); $query= $this->db->get(); return $query->result(); } public function get_wish_list_data_oslno($ids) { $this->db->distinct('orders.oslNo'); $this->db->select('orders.oslNo'); // $this->db->where('sub_orders.article_type', 'inhouse'); $this->db->where('sub_orders.id', $ids); $this->db->order_by('oslNo', "asc"); $this->db->from('orders'); $this->db->join('sub_orders', 'sub_orders.orderID = orders.id'); $query = $this->db->get(); return $query->row(); } public function get_wish_list_data_oslnum($ids) { $this->db->distinct('orders.oslNo'); $this->db->select('orders.oslNo'); $this->db->where('sub_orders.article_type','inhouse'); $this->db->where('sub_orders.id', $ids); $this->db->order_by('oslNo', "desc"); $this->db->from('orders'); $this->db->join('sub_orders', 'sub_orders.orderID = orders.id'); $query = $this->db->get(); return $query->row(); } public function get_wish_list_data_oslnumber($ids) { $this->db->distinct('orders.oslNo'); $this->db->select('orders.oslNo'); $this->db->where('sub_orders.article_type','inhouse'); $this->db->where('sub_orders.id', $ids); $this->db->order_by('orders.oslNo', "asc"); $this->db->from('orders'); $this->db->join('sub_orders', 'sub_orders.orderID = orders.id'); $query = $this->db->get(); return $query->row(); } public function get_data_fetch_id($table,$where) { $query=$this->db->query('SELECT distinct(subOrderID) FROM sub_order_shades WHERE planningStatus="Planned"'); return $query->result(); } public function yarn_raw_Getsearch_wono($keyword,$status) { // $this->db->distinct(); $this->db->select('*'); $this->db->like("work_order_no", $keyword); $this->db->from('create_materialissue_work_order'); // $this->db->where('confirm','Yes'); // $this->db->or_where_in('product_type', $status); // $this->db->where('confirm','Yes'); $query= $this->db->get(); return $query->result(); } public function deying_yarn_raw_Getsearch_wono($keyword,$status) { $this->db->distinct(); $this->db->select('work_order_no'); $this->db->like("work_order_no", $keyword); $this->db->from('workorder_dyeing_material'); //$this->db->where('confirm','Yes'); //$this->db->or_where_in('product_type', $status); //$this->db->where('confirm','Yes'); $query= $this->db->get(); return $query->result(); } public function deying_fetch_recived_data() { $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='employee_details'; $where=array('id'=>$emp_row); $data['emp_details']=$this->vendor_model->get_customerdata($table,$where); $po_no1 = $_REQUEST['po_no1']; print_r($po_no1); die(); $table='workorder_dyeing_material'; $where=array('work_order_no'=>$po_no1); $data['wo_no']=$this->outsource_model->get_customerdata($table,$where); print_r($data); die(); $table=' workorder_dyeing'; $where=array('work_order_no'=>$po_no1); $data['shade']=$this->outsource_model->get_customerdata($table,$where); $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['recieved_by']=$id['username']; echo json_encode($data); } //////////////////////////////////////////////////////////////////////////////////////////////// public function get_work_order_data($table, $where) { $this->db->select('*'); $this->db->where($where); $this->db->group_by('work_order_no'); $this->db->order_by('id', 'desc'); $this->db->from($table); $query = $this->db->get(); return $query->result(); } public function get_work_order_data1($table,$where) { $this->db->select('create_materialissue_work_order.*,sum(create_materialissue_work_order.issued_net_weight) as net,create_yarntwisting_work_order.yarn_name, create_yarntwisting_work_order.yarn_denier,create_yarntwisting_work_order.yarn_specification,create_yarntwisting_work_order.value_inr, create_yarntwisting_work_order.rate_inr,create_yarntwisting_work_order.quantity_approval,create_yarntwisting_work_order.yarn_stage'); $this->db->group_by('create_materialissue_work_order.work_order_no'); $this->db->order_by('create_materialissue_work_order.id','desc'); // $this->db->order_by('work_order_no'); $this->db->from($table); $this->db->join('create_yarntwisting_work_order','create_materialissue_work_order.work_order=create_yarntwisting_work_order.work_order'); $this->db->where($where); $query=$this->db->get(); $result= $query->result(); $latest = array(); foreach($result as $value) { $data['id']=$value->id; $data['work_order_no']=$value->work_order_no; $data['vendor_name']=$value->vendor_name; $ys=$value->yarn_specification; $din=$value->yarn_denier; $name=$value->yarn_name; $data['yarn_name']=$name . $din . $ys; $data['yarn_stage']=$value->yarn_stage; $data['date']=$value->date; $data['delivery_date']=$value->delivery_date; $data['net']=$value->net; $data['rate_inr']=$value->rate_inr; $data['value_inr']=$value->value_inr; $data['quantity_approval']=$value->quantity_approval; $data['process_type']=$value->process_type; array_push($latest, $data); } return $latest; } public function get_work_order_weaving_data($table,$where) { $this->db->select('*'); $this->db->group_by('work_order_num','vendor','date','comment'); $this->db->order_by('id','desc'); // $this->db->order_by('work_order_no'); $this->db->from($table); $this->db->where($where); $query=$this->db->get(); return $query->result(); } public function get_work_order_grid_data($table,$where) { /* $this->db->select('*'); //$this->db->group_by('work_order_no','vendor_name','date','delivery_date'); // $this->db->order_by('work_order_no'); $this->db->from($table); $this->db->where($where); $query=$this->db->get(); return $query->result();*/ $this->db->select('A.*,B.work_order_no'); $this->db->from('work_order_dyeing A'); $this->db->join('workorder_dyeing B', 'A.dyed_id=B.id','left'); $this->db->where('A.status', 'COMPLETED'); $this->db->where('A.yarn_status', '0'); $this->db->where('A.rec_dyed_qua', '0'); $query = $this->db->get(); return $query->result(); } public function get_work_order_grid_data_delivery($table,$where) { $this->db->select('*'); //$this->db->group_by('work_order_no','vendor_name','date','delivery_date'); // $this->db->order_by('work_order_no'); $this->db->from($table); $this->db->where($where); $query=$this->db->get(); return $query->result(); /*$this->db->select('A.*'); $this->db->from('work_order_dyeing A'); //$this->db->join('workorder_dyeing B', 'A.dyed_id=B.id','left'); $this->db->where('A.status', 'COMPLETED'); $this->db->where('A.yarn_status', '0'); $this->db->where('A.rec_dyed_qua', '0'); $query = $this->db->get(); return $query->result();*/ } public function get_work_order_grid_issue_data($table,$where) { $this->db->select('*'); //$this->db->group_by('work_order_no','vendor_name','date','delivery_date'); // $this->db->order_by('work_order_no'); $this->db->from($table); $this->db->where($where); $this->db->where('rec_dyed_qua >','0.00'); $query=$this->db->get(); return $query->result(); } public function get_data_where_fetch($table,$where) { $this->db->select('*'); $this->db->group_by('work_order_no','vendor_name','date','delivery_date'); $this->db->from($table); $this->db->where($where); $query=$this->db->get(); return $query->result(); } public function fetch_where_gross_quantity_total($table,$where) { $this->db->select_sum('gross_weight'); //$this->db->select('quantity'); $this->db->from($table); $this->db->where($where); $query = $this->db->get(); return $query->row(); } public function get_plannedwarpwt($subNo){ $this->db->select('pow.*'); $this->db->from('po_warp pow'); $this->db->join('planned_order po', 'po.id=pow.planningOrderID'); $this->db->join('sub_order_shades sos', 'sos.shadeID = po.subNo'); $this->db->where('sos.planningStatus','planned'); $this->db->where('po.oslNo', $subNo); $query = $this->db->get(); //echo $this->db->last_query();exit; $result = $query->result_array(); return $result; } public function get_planned_weft_wt($subNo){ $this->db->select('pow.*'); $this->db->from('po_weft pow'); $this->db->join('planned_order po', 'po.id=pow.planningOrderID'); $this->db->join('sub_order_shades sos', 'sos.shadeID = po.subNo'); $this->db->where('sos.planningStatus','planned'); $this->db->where('po.oslNo', $subNo); $query = $this->db->get(); $result = $query->result_array(); return $result; } public function display_yarn_raw_modal_data($where) { $this->db->select('*'); $this->db->from('indent_po'); $this->db->join('indent_yarn_goods_details', 'indent_po.id = indent_yarn_goods_details.po_list_id'); $this->db->where('indent_po.product_type', 'Yarn - Raw'); $this->db->where('indent_yarn_goods_details.yarnname', $where); $query=$this->db->get(); return $query->result(); } public function display_yarn_raw_modal_data1($where) { $this->db->select('*'); $this->db->from('indent_po'); $this->db->join('indent_yarn_goods_details', 'indent_po.id = indent_yarn_goods_details.po_list_id'); $this->db->where('indent_po.product_type', 'Yarn - Raw'); $this->db->where('indent_yarn_goods_details.yarnname', $where); $this->db->where('indent_yarn_goods_details.issue_net_weight !=', '0'); $query=$this->db->get(); return $query->result(); } public function display_yarn_dyed_modal_data($where) { $this->db->select('*'); $this->db->from('indent_po'); $this->db->join('indent_yarn_goods_details', 'indent_po.id = indent_yarn_goods_details.po_list_id'); $this->db->where('indent_po.product_type', 'Yarn - Dyed'); $this->db->where('indent_yarn_goods_details.yarnname', $where); // $this->db->where('indent_yarn_goods_details.issue_net_weight !=', '0'); $query=$this->db->get(); return $query->result(); } public function display_yarn_dyed_modal_data1($where) { $this->db->select('*'); $this->db->from('indent_po'); $this->db->join('indent_yarn_goods_details', 'indent_po.id = indent_yarn_goods_details.po_list_id'); $this->db->where('indent_po.product_type', 'Yarn - Dyed'); $this->db->where('indent_yarn_goods_details.yarnname', $where); $this->db->where('indent_yarn_goods_details.issue_net_weight !=', '0'); $query=$this->db->get(); return $query->result(); } public function display_yarn_twisting_modal_data($where) { $this->db->select('*'); $this->db->from('indent_po'); $this->db->join('indent_yarn_goods_details', 'indent_po.id = indent_yarn_goods_details.po_list_id'); $this->db->where('indent_po.product_type', 'Yarn - Twisted'); $this->db->where('indent_yarn_goods_details.yarnname', $where); $query=$this->db->get(); return $query->result(); } public function display_yarn_twisting_yarn_material_modal_data($where) { $this->db->select('*'); $this->db->from('indent_po'); $this->db->join('indent_yarn_goods_details', 'indent_po.id = indent_yarn_goods_details.po_list_id'); $this->db->where('indent_po.product_type', 'Yarn - Twisted'); $this->db->where('indent_yarn_goods_details.yarnname', $where); //$this->db->where('indent_yarn_goods_details.issue_net_weight !=', '0'); $query=$this->db->get(); return $query->result(); } public function display_yarn_twisting_yarn_material_modal_data1($where) { $this->db->select('*'); $this->db->from('indent_po'); $this->db->join('indent_yarn_goods_details', 'indent_po.id = indent_yarn_goods_details.po_list_id'); $this->db->where('indent_po.product_type', 'Yarn - Twisted'); $this->db->where('indent_yarn_goods_details.yarnname', $where); $this->db->where('indent_yarn_goods_details.issue_net_weight !=', '0'); $query=$this->db->get(); return $query->result(); } public function fetch_where_subgrid_deying_work_order($table,$where) { $this->db->select('yarn_details as name,sum(issue_net_weight) as net'); $this->db->from($table); $this->db->where($where); $this->db->group_by('yarn_details'); $query = $this->db->get(); return $query->result(); } public function fetch_where_subgrid_result_data($table,$where) { $this->db->select("*"); $this->db->from($table); $this->db->where($where); // $this->db->where('warp_qua !=',""); $query = $this->db->get(); return $query->result(); } public function update_osl_data($data,$where) { $this->db->where($where); $this->db->update('osl_warp_details',$data); } public function update_osl_weft_data($data,$where) { $this->db->where($where); $this->db->update('osl_weft_details',$data); } public function max_select_weaving_id($table) { $this->db->select_max('work_order'); $this->db->from($table); $query = $this->db->get(); return $query->row(); } public function get_work_dyeing_order_data($table,$where) { $this->db->select('*'); //$this->db->group_by('work_order_no','vendor_name','date','delivery_date'); $this->db->order_by('osl_no','desc'); $this->db->from($table); $this->db->where($where); $this->db->order_by('osl_no'); $query=$this->db->get(); return $query->result(); } public function get_work_dyeing_order_datas($table,$where) { $this->db->select('*'); //$this->db->group_by('work_order_no','vendor_name','date','delivery_date'); $this->db->order_by('osl_no','desc'); $this->db->from($table); $this->db->where($where); $wherecond = "( ( ( warp_pland_mtr ='0' AND weft_pland_mtr >'0') OR ( warp_pland_mtr >'0' AND weft_pland_mtr ='0') OR ( warp_pland_mtr >'0' AND weft_pland_mtr >'0') ) )"; $this->db->where($wherecond); $this->db->order_by('osl_no'); $query=$this->db->get(); return $query->result(); } public function get_work_yarn_twisting_order_data($table,$where) { $this->db->select('*'); //$this->db->group_by('work_order_no','vendor_name','date','delivery_date'); // $this->db->order_by('work_order_no'); $this->db->from($table); $this->db->where($where); /// $this->db->order_by('osl_no'); $query=$this->db->get(); return $query->result(); } public function get_work_pending_order_data($table) { $this->db->select('*'); $this->db->order_by('osl_no','desc'); $this->db->from($table); //$this->db->where($where); $this->db ->where('status','Waiting for Warp & Weft'); $this->db ->or_where('status','Warp Received & Weft Pending'); $this->db ->or_where('status','Weft Received & Warp Pending'); $this->db ->or_where('status','Waiting for Yarn'); $this->db ->or_where('status','Received Yarn'); $this->db ->or_where('status','Select'); // Waiting for Warp & Weft $this->db->order_by('osl_no'); $query=$this->db->get(); return $query->result(); } public function get_work_fabric_order_data($table) { $this->db->select('*'); $this->db->from($table); //$this->db->where($where); // $this->db ->where('status','Waiting for Yarn'); // $this->db ->or_where('status','Received Yarn'); $this->db->order_by('delivery_date','desc'); $query=$this->db->get(); return $query->result(); } public function get_work_fabric_order_datas($table) { $this->db->select('*'); $this->db->from($table); $wherecond = "( ( ( warp_pland_mtr ='0' AND weft_pland_mtr >'0') OR ( warp_pland_mtr >'0' AND weft_pland_mtr ='0') OR ( warp_pland_mtr >'0' AND weft_pland_mtr >'0') ) )"; $this->db->where($wherecond); $this->db->order_by('delivery_date','desc'); $query=$this->db->get(); return $query->result(); } public function get_work_pending_order_data1($table,$where) { $this->db->select('*'); $this->db->from($table); $this->db->where($where); $this->db ->where('status','Waiting for Warp & Weft'); $this->db ->or_where('status','Warp Received & Weft Pending'); $this->db ->or_where('status','Weft Received & Warp Pending'); $this->db->group_by('sos_id'); $query=$this->db->get(); return $query->result(); } public function get_work_pending_order_data2($table,$where) { $this->db->select('*'); $this->db->from($table); $this->db->where($where); $this->db ->where('status','Completed'); $this->db->group_by('sos_id'); $query=$this->db->get(); return $query->result(); } public function get_work_pending_order_data3($table,$where) { $this->db->select('*'); $this->db->from($table); $this->db->where($where); $this->db ->where('status','Winding & Warping '); $this->db ->or_where('status','Weaving'); $this->db->group_by('sos_id'); $query=$this->db->get(); return $query->result(); } public function get_work_inprocess_order_data($table) { $this->db->select('*'); $this->db->order_by('osl_no','desc'); $this->db->from($table); $this->db ->where('status','Winding & Warping '); $this->db ->or_where('status','Weaving'); $this->db->order_by('osl_no'); $query=$this->db->get(); return $query->result(); } public function get_work_inprocess_order_datas($table) { $this->db->select('*'); $this->db->order_by('osl_no','desc'); $this->db->from($table); $wherecond = "( ( ( warp_pland_mtr ='0' AND weft_pland_mtr >'0') OR ( warp_pland_mtr >'0' AND weft_pland_mtr ='0') OR ( warp_pland_mtr >'0' AND weft_pland_mtr >'0') ) )"; $whereconds = "( ( ( status ='Winding & Warping') OR ( status ='Weaving') ) )"; $this->db->where($wherecond); $this->db->where($whereconds); //$this->db ->where('status','Winding & Warping '); //$this->db ->or_where('status','Weaving'); $this->db->order_by('osl_no'); $query=$this->db->get(); return $query->result(); } public function get_weaving_order_data($table) { $this->db->select('*'); $this->db->from($table); $query=$this->db->get(); return $query->result(); } public function get_unplanned_orders() { $this->db->select('o.id,o.orderType as osl_type,o.oslNo,so.articleNo,so.width,so.unit as planned_unit,so.design,so.id as ssid,sos.shadeID as sos_id,so.quality,sos.ourShade,sos.planned_by,sos.quantity,am.finishedWeight,am.reedWidth,am.reed,we.PPC,po.pieceLength,po.plannedDate,po.weaving_factory,po.warpPlandMtr,po.weftPlandMtr,o.partyRef,o.deliveryDate,o.orderMode,so.subOrderType,po.selWidth,po.sslShade,po.orderType,sos.buyerShade,po.units,po.weavingDate,po.subNo'); $this->db->distinct('sos.shadeID as sos_id'); $this->db->from('orders o'); $this->db->where('so.orderConfirm', 'Yes'); $this->db->where('sos.planningStatus', 'planned'); $this->db->where('so.article_type', 'inhouse'); $this->db->join('sub_orders so', 'so.orderID = o.id'); $this->db->join('sub_order_shades sos', 'sos.subOrderID = so.id'); $this->db->join('planned_order po', 'po.subNo = sos.shadeID'); $this->db->join('article_master am', 'am.articleNo = so.articleNo'); $this->db->join('weft_data we', 'we.article_id = am.articleID'); //$this->db->order_by("o.id", "desc"); //$this->db->group_by('oslNo'); $query = $this->db->get(); return $query->result(); } public function get_in_house_shadeNo($orderID, $status) { $this->db->select('o.id,o.oslNo,so.articleNo,so.width,so.design,so.quality,sos.ourShade,sos.quantity,am.finishedWeight,am.reedWidth,am.reed,we.PPC,po.pieceLength'); $this->db->from('orders o'); $this->db->where(' so.article_type', 'inhouse'); $this->db->where('so.orderID', $orderID); $this->db->where('so.orderConfirm', 'Yes'); $this->db->where('sos.planningStatus', $status); $this->db->join('sub_orders so', 'so.orderID = o.id'); $this->db->join('sub_order_shades sos', 'sos.subOrderID = so.id'); $this->db->join('planned_order po', 'po.subNo = sos.shadeID'); $this->db->join('article_master am', 'am.articleNo = so.articleNo'); $this->db->join('weft_data we', 'we.article_id = am.articleID'); $query = $this->db->get(); return $query->result(); } public function Getsearch_oslno($keyword) { $this->db->distinct(); $this->db->select('osl_no'); //$this->db->order_by('customer_name', 'DESC'); $this->db->like("osl_no", $keyword); $this->db->from('weaving_panel_planning_order'); // $this->db->where('status', 'Completed'); $this->db->order_by('osl_no'); $query= $this->db->get(); return $query->result(); } public function getweaving_data($table,$where) { $this->db->select('*'); $this->db->from($table); $this->db->where($where); //$this->db->where('fabric_details','Not Yet'); //$this->db->or_where('fabric_details','Partly'); $this->db->where('fabric_details !=', 'Completed'); $query=$this->db->get(); return $query->result(); } public function fetch_weave_quantity_total($table,$where) { $this->db->select_sum('received_mtrs'); //$this->db->select('quantity'); $this->db->from($table); $this->db->where($where); $query = $this->db->get(); return $query->row(); } public function max_select_embroidry_id($table) { $this->db->select_max('work_order_num'); $this->db->from($table); $this->db->order_by('id',"desc"); $this->db->limit(1); $query = $this->db->get(); return $query->row(); } ///$this->db->order_by('work_order_num','asc'); public function get_work_order_fabric_embroidry_data($table,$where) { $this->db->select('*'); $this->db->group_by('work_order','vendor_name','sys_date','finishing_type','comment','created_by'); // $this->db->order_by('work_order_no'); $this->db->from($table); $this->db->where($where); $query=$this->db->get(); return $query->result(); } public function get_work_order_fabric_order_embroidry_data($table,$where) { $this->db->select('*'); $this->db->group_by('work_order','vendor_name','sys_date','finishing_type','comment','created_by'); $this->db->order_by('id','desc'); $this->db->from($table); $this->db->where($where); $query=$this->db->get(); return $query->result(); } public function Getsearch_embroidery_pono($keyword) { $this->db->distinct(); $this->db->select('work_order'); //$this->db->order_by('customer_name', 'DESC'); $this->db->like("work_order", $keyword); $this->db->from('finishing_embroidry'); $this->db->where('status', 1); //$this->db->where('product_type', 'Fabrics'); $query= $this->db->get(); return $query->result(); } public function get_embroidery_data($table,$where) { $this->db->select('*,(delivery_yarn_twisting.issue_net_weight * delivery_yarn_twisting.updated_unit) as val'); $this->db->from($table); $this->db->where($where); $query=$this->db->get(); return $query->result(); } public function get_embroidery_data_sum($table,$where,$year) { $this->db->select('sum(delivery_yarn_twisting.issue_net_weight) as qty,sum(delivery_yarn_twisting.issue_net_weight * delivery_yarn_twisting.updated_unit) as val'); $this->db->from($table); $this->db->where($where); if($year != 'all') $this->db->like('delivery_yarn_twisting.rec_date',$year); $query=$this->db->get(); return $query->result(); } public function get_embroidery_data1($table,$where) { $this->db->select('*'); $this->db->from($table); $this->db->where($where); $query=$this->db->get(); return $query->result(); } public function get_embroidery_datass($table,$where) { $this->db->select('*'); $this->db->from($table); $this->db->where($where); $this->db->where('issue_net_weight >', 0); $query=$this->db->get(); return $query->result(); } public function get_embroidery_issue_data($table,$where) { $this->db->select('*'); $this->db->from($table); $this->db->where($where); $this->db->where('issue_net_weight >', '0.00'); $query=$this->db->get(); return $query->result(); } public function count_num_rows($table,$where) { $this->db->select('id'); $this->db->from($table); $this->db->where($where); $query = $this->db->get(); return $query->num_rows(); } public function history_desc_dyeing_grid_data() { $this->db->select('workorder_dyeing.work_order_no,workorder_dyeing.date,workorder_dyeing.vendor as d,workorder_dyeing.issue_no as issueNo,work_order_dyeing.*,workorder_dyeing_material.complite_status as issue_s,workorder_dyeing.dyed_wt as dyed_wt,workorder_dyeing_material.lot,workorder_dyeing_material.bale,workorder_dyeing_material.issue_stock,workorder_dyeing.article,workorder_dyeing_material.ourshade,workorder_dyeing.osl_no as oslNo,workorder_dyeing.yarn_details as yarnDetails,workorder_dyeing_material.date,workorder_dyeing_material.delivery_date'); $this->db->from('workorder_dyeing '); $this->db->join('work_order_dyeing ', 'workorder_dyeing.id= work_order_dyeing.dyed_id','left'); $this->db->join('workorder_dyeing_material', 'workorder_dyeing_material.issue_no= workorder_dyeing.issue_no'); $this->db->where('workorder_dyeing.status','0'); $this->db->order_by('workorder_dyeing.work_order','DESC'); $this->db->group_by('workorder_dyeing.id'); //$this->db->where('workorder_dyeing.dyeing_status','1'); $query=$this->db->get(); return $query->result(); } public function get_work_order_fabric_embroidry_data2($table, $where) { $this->db->select('work_order, vendor_name, sys_date, finishing_type, comment, created_by, id,width_completed_status'); $this->db->group_by(array('work_order', 'vendor_name', 'sys_date', 'finishing_type', 'comment', 'created_by')); $this->db->order_by('id', 'desc'); $this->db->from($table); $this->db->where($where); $query = $this->db->get(); return $query->result(); } public function fetch_where_subgrid_data22($where) { $this->db->select('*'); $this->db->from('finishing_embroidry'); $this->db->where('finishing_embroidry.id',$where); $this->db->join('finishing_embroidry_stock', 'finishing_embroidry_stock.fin_emb_id = finishing_embroidry.id'); $query = $this->db->get(); return $query->result(); } public function fetch_where_subgrid_data2_2($where,$where1) { $this->db->select('*'); $this->db->from('finishing_embroidry'); $this->db->where('finishing_embroidry.work_order_num',$where); $this->db->where('finishing_embroidry.work_order',$where1); $this->db->where('finishing_embroidry.status',1); $this->db->join('finishing_embroidry_stock', 'finishing_embroidry_stock.fin_emb_id = finishing_embroidry.id'); $query = $this->db->get(); return $query->result(); } public function fetch_edit_data_update4($where) { $this->db->select_sum('rec_width'); $this -> db ->from ('finishing_embroidry_stock'); $this->db->where($where); $query=$this->db->get(); return $query->row(); } public function fetch_edit_data_update44($where) { $this->db->select_sum('rec_qua'); $this -> db ->from ('finishing_embroidry_stock'); $this->db->where($where); $query=$this->db->get(); return $query->row(); } public function max_select_dyeing_maximum_id($table,$where) { $this->db->select_max('id'); // $this->db->where('reference','D'); //$this->db->order_by('id','desc'); //$this->db->limit(1); $this->db->from($table); $this->db->where($where); $query = $this->db->get(); return $query->row(); } public function max_select_redyeing_maximum_id($table,$where) { $this->db->select_max('id'); // $this->db->where('reference','D'); //$this->db->order_by('id','desc'); //$this->db->limit(1); $this->db->from($table); $this->db->where($where); $query = $this->db->get(); return $query->row(); } public function select_upload_id() { $this->db->select('id'); $this->db->order_by('id',"desc"); $this->db->limit(1); $query = $this->db->get('fabric_inspection_details'); return $query->row(); } public function select_twisting_upload_id() { $this->db->select('id'); $this->db->order_by('id',"desc"); $this->db->limit(1); $query = $this->db->get('indent_po'); return $query->row(); } public function max_select_upload_id($table) { $this->db->select_max('piece_no'); $this->db->from($table); $query = $this->db->get(); return $query->row(); } public function display_yarn_twisting_grid_data() { $this->db->distinct(); $this->db->select('*'); $this->db->from('indent_po'); $this->db->join('indent_yarn_goods_details', 'indent_po.id = indent_yarn_goods_details.po_list_id'); $this->db->where('indent_po.product_type', 'Yarn - Twisted'); $this->db->where('indent_yarn_goods_details.issue_gross_weight !=', '0'); $this->db->where('indent_yarn_goods_details.issue_net_weight >' ,'0'); //$this->db->like('indent_yarn_goods_details.yarnname' ,$v); $query=$this->db->get(); return $query->result(); } public function display_yarn_twisting_grid_datass($where) { $this->db->distinct(); $this->db->select('*'); $this->db->from('indent_po'); $this->db->join('indent_yarn_goods_details', 'indent_po.id = indent_yarn_goods_details.po_list_id'); $this->db->where('indent_po.product_type', 'Yarn - Twisted'); $this->db->where('indent_yarn_goods_details.issue_gross_weight !=', '0'); $this->db->where('indent_yarn_goods_details.issue_net_weight >' ,'0'); $this->db->where('indent_yarn_goods_details.consumed_at',$where); $query=$this->db->get(); return $query->result(); } public function display_yarn_twisting_grid_details_data($where) { $this->db->distinct(); $this->db->select('*'); $this->db->from('indent_po'); $this->db->join('indent_yarn_goods_details', 'indent_po.id = indent_yarn_goods_details.po_list_id'); $this->db->where('indent_po.product_type', 'Yarn - Twisted'); $this->db->where('indent_yarn_goods_details.issue_gross_weight !=', '0'); $this->db->where('indent_yarn_goods_details.issue_net_weight >' ,'0'); $this->db->where('indent_yarn_goods_details.consumed_at',$where); $query=$this->db->get(); return $query->result(); } public function display_yarn_raw_grid_data() { $this->db->select('*'); $this->db->from('indent_po'); $this->db->join('indent_yarn_goods_details', 'indent_po.id = indent_yarn_goods_details.po_list_id'); $this->db->where('indent_po.product_type', 'Yarn - Raw'); $this->db->where('indent_yarn_goods_details.issue_gross_weight !=' ,'0'); $this->db->where('indent_yarn_goods_details.issue_net_weight >' ,'0'); // $this->db->like('indent_yarn_goods_details.yarnname' ,$v); $query=$this->db->get(); return $query->result(); } public function display_yarn_raw_grid_issue_data() { $this->db->select('*'); $this->db->from('indent_po'); $this->db->join('indent_yarn_goods_details', 'indent_po.id = indent_yarn_goods_details.po_list_id'); $this->db->where('indent_po.product_type', 'Yarn - Raw'); //$this->db->where('indent_yarn_goods_details.consumed_at' ,'NANDI'); $this->db->where('indent_yarn_goods_details.issue_gross_weight !=' ,'0'); $this->db->where('indent_yarn_goods_details.issue_net_weight >' ,'0.00'); // $this->db->like('indent_yarn_goods_details.yarnname' ,$v); $query=$this->db->get(); return $query->result(); } public function display_yarn_raw_grid_issue_nandi_data() { $this->db->select('*'); $this->db->from('indent_po'); $this->db->join('indent_yarn_goods_details', 'indent_po.id = indent_yarn_goods_details.po_list_id'); $this->db->where('indent_po.product_type', 'Yarn - Raw'); $this->db->where('indent_yarn_goods_details.consumed_at' ,'NANDI'); $this->db->where('indent_yarn_goods_details.issue_gross_weight !=' ,'0'); $this->db->where('indent_yarn_goods_details.issue_net_weight >' ,'0.00'); // $this->db->like('indent_yarn_goods_details.yarnname' ,$v); $query=$this->db->get(); return $query->result(); } public function display_yarn_raw_grid_where_data($where) { $this->db->select('*'); $this->db->from('indent_po'); $this->db->join('indent_yarn_goods_details', 'indent_po.id = indent_yarn_goods_details.po_list_id'); $this->db->where('indent_po.product_type', 'Yarn - Raw'); $this->db->where('indent_yarn_goods_details.issue_gross_weight !=' ,'0'); $this->db->where('indent_yarn_goods_details.consumed_at',$where); $this->db->where('indent_yarn_goods_details.issue_net_weight >' ,'0'); // $this->db->like('indent_yarn_goods_details.yarnname' ,$v); $query=$this->db->get(); return $query->result(); } public function display_yarn_dyed_grid_data() { $this->db->select('*'); $this->db->from('indent_po'); $this->db->join('indent_yarn_goods_details', 'indent_po.id = indent_yarn_goods_details.po_list_id'); $this->db->where('indent_po.product_type', 'Yarn - Dyed'); $this->db->where('indent_yarn_goods_details.issue_gross_weight !=', '0'); $this->db->where('indent_yarn_goods_details.issue_net_weight >' ,'0'); // $this->db->like('indent_yarn_goods_details.yarnname' ,$v); $query=$this->db->get(); // $query=$this->db->get(); return $query->result(); } public function display_yarn_dyed_grid_detailed_data() { $this->db->select('indent_yarn_goods_details.id,indent_yarn_goods_details.ssl_shade,indent_add_indent.shades,indent_po.purpose,indent_add_indent.color_code,indent_yarn_goods_details.yarnname,indent_yarn_goods_details.yarndenier,indent_yarn_goods_details.yarnspecification,indent_yarn_goods_details.lot,indent_yarn_goods_details.bale,indent_yarn_goods_details.issue_gross_weight,indent_yarn_goods_details.issue_net_weight,indent_yarn_goods_details.consumed_at,indent_yarn_goods_details.rec_date'); $this->db->from('indent_po'); $this->db->join('indent_yarn_goods_details', 'indent_po.id = indent_yarn_goods_details.po_list_id'); $this->db->join('indent_add_indent', 'indent_po.indent_id = indent_add_indent.id'); $this->db->where('indent_po.product_type', 'Yarn - Dyed'); $this->db->where('indent_yarn_goods_details.issue_gross_weight !=', '0'); $this->db->where('indent_yarn_goods_details.issue_net_weight >' ,'0'); // $this->db->like('indent_yarn_goods_details.yarnname' ,$v); $query=$this->db->get(); // $query=$this->db->get(); return $query->result(); } public function display_yarn_dyed_grid_details_data($where) { $this->db->select('indent_yarn_goods_details.id,indent_po.shades,indent_po.purpose,indent_add_indent.color_code,indent_yarn_goods_details.yarnname,indent_yarn_goods_details.yarndenier,indent_yarn_goods_details.yarnspecification,indent_yarn_goods_details.lot,indent_yarn_goods_details.bale,indent_yarn_goods_details.issue_gross_weight,indent_yarn_goods_details.issue_net_weight,indent_yarn_goods_details.consumed_at,indent_yarn_goods_details.rec_date'); $this->db->from('indent_po'); $this->db->join('indent_yarn_goods_details', 'indent_po.id = indent_yarn_goods_details.po_list_id'); $this->db->join('indent_add_indent', 'indent_po.indent_id = indent_add_indent.id'); $this->db->where('indent_po.product_type', 'Yarn - Dyed'); $this->db->where('indent_yarn_goods_details.issue_gross_weight !=', '0'); $this->db->where('indent_yarn_goods_details.issue_net_weight >' ,'0'); $this->db->where('indent_yarn_goods_details.consumed_at',$where); $query=$this->db->get(); // $query=$this->db->get(); return $query->result(); } public function display_yarn_dyed_data1() { $this->db->select('*'); $this->db->from('indent_po'); $this->db->join('indent_yarn_goods_details', 'indent_po.id = indent_yarn_goods_details.po_list_id'); $this->db->where('indent_po.product_type', 'Yarn - Dyed'); $this->db->where('indent_yarn_goods_details.yarn_status', '0'); $query=$this->db->get(); return $query->result(); } public function display_yarn_dyed_data1_details() { $this->db->select('indent_yarn_goods_details.id,indent_po.shades,indent_po.purpose,indent_add_indent.color_code,indent_yarn_goods_details.yarnname,indent_yarn_goods_details.yarndenier,indent_yarn_goods_details.yarnspecification,indent_yarn_goods_details.lot,indent_yarn_goods_details.bale,indent_yarn_goods_details.issue_gross_weight,indent_yarn_goods_details.net_weight,indent_yarn_goods_details.issue_net_weight,indent_yarn_goods_details.consumed_at,indent_yarn_goods_details.rec_date'); $this->db->from('indent_po'); $this->db->join('indent_yarn_goods_details', 'indent_po.id = indent_yarn_goods_details.po_list_id'); $this->db->join('indent_add_indent', 'indent_po.indent_id = indent_add_indent.id'); //$this->db->join('indent_yarn_goods_details', 'indent_po.id = indent_yarn_goods_details.po_list_id'); $this->db->where('indent_po.product_type', 'Yarn - Dyed'); $this->db->where('indent_yarn_goods_details.yarn_status', '0'); $query=$this->db->get(); return $query->result(); } public function display_yarn_dyed_grid_issue_data() { $this->db->select('*'); $this->db->from('indent_po'); $this->db->join('indent_yarn_goods_details', 'indent_po.id = indent_yarn_goods_details.po_list_id'); $this->db->where('indent_po.product_type', 'Yarn - Dyed'); $this->db->where('indent_yarn_goods_details.issue_gross_weight !=', '0'); $this->db->where('indent_yarn_goods_details.issue_net_weight >' ,'0.00'); // $this->db->like('indent_yarn_goods_details.yarnname' ,$v); $query=$this->db->get(); // $query=$this->db->get(); return $query->result(); } public function display_yarn_dyed_grid_issue_nandi_data() { $this->db->select('indent_yarn_goods_details.id,indent_yarn_goods_details.ssl_shade,indent_add_indent.shades,indent_po.purpose,indent_add_indent.color_code,indent_yarn_goods_details.yarnname,indent_yarn_goods_details.yarndenier,indent_yarn_goods_details.yarnspecification,indent_yarn_goods_details.lot,indent_yarn_goods_details.bale,indent_yarn_goods_details.issue_gross_weight,indent_yarn_goods_details.issue_net_weight,indent_yarn_goods_details.consumed_at,indent_yarn_goods_details.rec_date'); $this->db->from('indent_po'); $this->db->join('indent_yarn_goods_details', 'indent_po.id = indent_yarn_goods_details.po_list_id'); $this->db->join('indent_add_indent', 'indent_po.indent_id = indent_add_indent.id'); $this->db->where('indent_po.product_type', 'Yarn - Dyed'); $this->db->where('indent_yarn_goods_details.consumed_at', 'NANDI'); $this->db->where('indent_yarn_goods_details.issue_gross_weight !=', '0'); $this->db->where('indent_yarn_goods_details.issue_net_weight >' ,'0.00'); // $this->db->like('indent_yarn_goods_details.yarnname' ,$v); $query=$this->db->get(); // $query=$this->db->get(); return $query->result(); } public function fetch_where_subgrid_work_preview_order($table,$where) { $this->db->select('sum(tare_weight) as tare,sum(gross_weight) as gross,sum(twisting_net_weight) as net'); $this->db->from($table); $this->db->where($where); //$this->db->group_by('material_yarnname'); $query = $this->db->get(); return $query->result(); } public function fetch_osl_data($tabel) { $this->db->distinct(); $this->db->select('osl_no'); $this->db->order_by('osl_no', 'asc'); $this->db->from($tabel); $query= $this->db->get(); return $query->result(); } public function get_work_pending_order_loom_data($table) { $this->db->select('*'); $this->db->from($table); // $this->db->group_by('osl_no'); // $this->db->group_by('article'); $this->db->order_by('osl_no'); $query=$this->db->get(); return $query->result(); } public function display_yarn_twisting_delivery_grid_data() { //$this->db->distinct(); $this->db->select('create_yarntwisting_work_order.yarn_name,create_yarntwisting_work_order.yarn_denier,create_yarntwisting_work_order.yarn_specification,work_order_twisting.lot,work_order_twisting.bale,work_order_twisting.gross_weight,work_order_twisting.net_weight,work_order_twisting.location,work_order_twisting.rec_date'); $this->db->from('create_yarntwisting_work_order'); $this->db->join('work_order_twisting', 'create_yarntwisting_work_order.id = work_order_twisting.yarn_id'); $this->db->where('create_yarntwisting_work_order.quantity_approval', 'Completed'); $query=$this->db->get(); return $query->result(); } public function get_work_pending_order_issue_loom_data($table) { $this->db->select('*'); $this->db->from($table); $this->db->where('confirm', 'No'); $this->db->order_by('id',"desc"); $wherecond = "( ( ( warp_pland_mtr ='0' AND weft_pland_mtr >'0') OR ( warp_pland_mtr >'0' AND weft_pland_mtr ='0') OR ( warp_pland_mtr >'0' AND weft_pland_mtr >'0') ) )"; $this->db->where($wherecond); $query=$this->db->get(); return $query->result(); } public function get_work_pending_order_completed_issue_loom_data($table) { $this->db->select('*'); $this->db->from($table); $this->db->where('confirm', 'Yes'); $this->db->order_by('id',"desc"); $query=$this->db->get(); return $query->result(); } public function fetch_edit_data_width_update4($where) { $this->db->select_sum('rec_width'); $this -> db ->from ('finishing_embroidry_stock'); $this->db->where($where); $query=$this->db->get(); return $query->row(); } public function fetch_edit_data_issue_update44($where) { $this->db->select_sum('rec_qua'); $this -> db ->from ('finishing_embroidry_stock'); $this->db->where($where); $query=$this->db->get(); return $query->row(); } public function display_yarn_twisting_grid_detailed_data() { $this->db->distinct(); $this->db->select('indent_po.shades,indent_po.po_no,indent_po.unit,indent_po.updated_unit,indent_po.id as id1,indent_po.purpose,indent_yarn_goods_details.id,indent_yarn_goods_details.issue_gross_weight,indent_yarn_goods_details.issue_net_weight,indent_yarn_goods_details.consumed_at,indent_yarn_goods_details.lot,indent_yarn_goods_details.bale,indent_yarn_goods_details.rec_date,indent_yarn_goods_details.yarnname,indent_yarn_goods_details.yarndenier,indent_yarn_goods_details.yarnspecification'); $this->db->from('indent_po'); $this->db->join('indent_yarn_goods_details', 'indent_po.id = indent_yarn_goods_details.po_list_id'); $this->db->where('indent_po.product_type', 'Yarn - Twisted'); $this->db->where('indent_yarn_goods_details.issue_gross_weight !=', '0'); $this->db->where('indent_yarn_goods_details.issue_net_weight >' ,'0'); //$this->db->like('indent_yarn_goods_details.yarnname' ,$v); $query=$this->db->get(); return $query->result(); } public function display_yarn_twisting_delivery_grid_detailed_data() { //$this->db->distinct(); $this->db->select('work_order_twisting.id,work_order_twisting.updated_unit,create_yarntwisting_work_order.id as id1,create_yarntwisting_work_order.yarn_name,create_yarntwisting_work_order.yarn_denier,create_yarntwisting_work_order.yarn_specification,work_order_twisting.lot,work_order_twisting.bale,work_order_twisting.gross_weight,work_order_twisting.net_weight,work_order_twisting.location,work_order_twisting.rec_date'); $this->db->from('create_yarntwisting_work_order'); $this->db->join('work_order_twisting', 'create_yarntwisting_work_order.id = work_order_twisting.yarn_id'); $this->db->where('create_yarntwisting_work_order.quantity_approval', 'Completed'); $this->db->or_where('create_yarntwisting_work_order.quantity_approval', 'Partly'); $this->db->where('work_order_twisting.gross_weight !=', '0'); $this->db->where('work_order_twisting.net_weight >' ,'0'); $query=$this->db->get(); return $query->result(); } public function get_unplanned_issue_looms() { $this->db->select('o.id,o.oslNo,so.articleNo,so.width,so.design,so.id as ssid,sos.shadeID as sos_id,so.quality,sos.ourShade,sos.planned_by,sos.quantity,am.finishedWeight,am.reedWidth,am.reed,we.PPC, we.Weft_Quality,we.Weft_Denier,we.Weft_Specification,po.pieceLength,po.plannedDate,po.weaving_factory,po.warpPlandMtr,po.weftPlandMtr,o.partyRef,o.deliveryDate,o.orderMode,po.selWidth,po.sslShade,po.orderType,po.buyerShade,po.width,po.units,po.weavingDate,pow.weftWt,smw.weftCode,smw.weftColor,wa.Warp_Quality,wa.Warp_Denier,wa.Warp_Specification,smwa.warpCode,smwa.warpColor,powa.warpWt'); $this->db->distinct('sos.shadeID as sos_id'); $this->db->from('orders o'); $this->db->where('so.orderConfirm', 'Yes'); $this->db->where('sos.planningStatus', 'planned'); $this->db->where('so.article_type', 'inhouse'); $this->db->join('sub_orders so', 'so.orderID = o.id'); $this->db->join('sub_order_shades sos', 'sos.subOrderID = so.id'); $this->db->join('planned_order po', 'po.subNo = sos.shadeID'); $this->db->join('po_weft pow','po.id= pow.planningOrderID'); $this->db->join('po_warp powa','po.id= powa.planningOrderID'); $this->db->join('article_master am', 'am.articleNo = so.articleNo'); $this->db->join('weft_data we', 'we.article_id = am.articleID'); $this->db->join('sm_weft smw','po.sslShade = smw.shadeID'); $this->db->join('warp_data wa', 'wa.article_id = am.articleID'); $this->db->join('sm_warp smwa','po.sslShade = smwa.shadeID'); //$this->db->order_by("o.id", "desc"); //$this->db->group_by('oslNo'); $query = $this->db->get(); return $query->result(); } public function get_unplanned_issue_looms_osl($osl_no,$subNo) { $this->db->select('o.id,o.oslNo,so.articleNo,so.width,so.design,so.id as ssid,sos.shadeID as sos_id,so.quality,sos.ourShade,sos.planned_by,sos.quantity,am.finishedWeight,am.reedWidth,am.reed,we.PPC, we.Weft_Quality,we.Weft_Denier,we.Weft_Specification,po.pieceLength,po.plannedDate,po.weaving_factory,po.warpPlandMtr,po.weftPlandMtr,o.partyRef,o.deliveryDate,o.orderMode,po.selWidth,po.sslShade,po.orderType,po.buyerShade,po.width,po.units,po.weavingDate,pow.weftWt,smw.weftCode,smw.weftColor,wa.Warp_Quality,wa.Warp_Denier,wa.Warp_Specification,smwa.warpCode,smwa.warpColor,powa.warpWt'); $this->db->distinct('sos.shadeID as sos_id'); $this->db->from('orders o'); $this->db->where('o.oslNo', $osl_no); $this->db->where('po.subNo', $subNo); $this->db->where('so.orderConfirm', 'Yes'); $this->db->where('sos.planningStatus', 'planned'); $this->db->where('so.article_type', 'inhouse'); $this->db->join('sub_orders so', 'so.orderID = o.id'); $this->db->join('sub_order_shades sos', 'sos.subOrderID = so.id'); $this->db->join('planned_order po', 'po.subNo = sos.shadeID'); $this->db->join('po_weft pow','po.id= pow.planningOrderID'); $this->db->join('po_warp powa','po.id= powa.planningOrderID'); $this->db->join('article_master am', 'am.articleNo = so.articleNo'); $this->db->join('weft_data we', 'we.article_id = am.articleID'); $this->db->join('sm_weft smw','po.sslShade = smw.shadeID'); $this->db->join('warp_data wa', 'wa.article_id = am.articleID'); $this->db->join('sm_warp smwa','po.sslShade = smwa.shadeID'); //$this->db->order_by("o.id", "desc"); //$this->db->group_by('oslNo'); $query = $this->db->get(); return $query->result(); } public function display_yarn_twisting_loca_data($v) { $this->db->distinct(); $this->db->select('*'); $this->db->from('indent_po'); $this->db->join('indent_yarn_goods_details', 'indent_po.id = indent_yarn_goods_details.po_list_id'); $this->db->where('indent_po.product_type', 'Yarn - Twisted'); $this->db->where('indent_yarn_goods_details.issue_gross_weight !=' ,'0'); $this->db->where('indent_yarn_goods_details.issue_net_weight >' ,'0'); $this->db->like('indent_yarn_goods_details.consumed_at' ,$v); $query=$this->db->get(); // print_r($query->result()); // die(); return $query->result(); } public function display_yarn_raw_loca_data($v) { $this->db->select('*'); $this->db->from('indent_po'); $this->db->join('indent_yarn_goods_details', 'indent_po.id = indent_yarn_goods_details.po_list_id'); $this->db->where('indent_po.product_type', 'Yarn - Raw'); $this->db->where('indent_yarn_goods_details.issue_gross_weight !=' ,'0'); $this->db->where('indent_yarn_goods_details.issue_net_weight >' ,'0'); $this->db->like('indent_yarn_goods_details.consumed_at' ,$v); // $this->db->like('indent_yarn_goods_details.yarnname' ,$v); $query=$this->db->get(); return $query->result(); } public function display_yarn_dyed_grid_loca_detailed_data($v) { $this->db->select('indent_yarn_goods_details.id,indent_po.shades,indent_po.purpose,indent_add_indent.color_code,indent_yarn_goods_details.yarnname,indent_yarn_goods_details.yarndenier,indent_yarn_goods_details.yarnspecification,indent_yarn_goods_details.lot,indent_yarn_goods_details.bale,indent_yarn_goods_details.issue_gross_weight,indent_yarn_goods_details.issue_net_weight,indent_yarn_goods_details.consumed_at,indent_yarn_goods_details.rec_date'); $this->db->from('indent_po'); $this->db->join('indent_yarn_goods_details', 'indent_po.id = indent_yarn_goods_details.po_list_id'); $this->db->join('indent_add_indent', 'indent_po.indent_id = indent_add_indent.id'); $this->db->where('indent_po.product_type', 'Yarn - Dyed'); $this->db->where('indent_yarn_goods_details.issue_gross_weight !=', '0'); $this->db->where('indent_yarn_goods_details.issue_net_weight >' ,'0'); $this->db->like('indent_yarn_goods_details.consumed_at' ,$v); $query=$this->db->get(); // $query=$this->db->get(); return $query->result(); } public function display_yarn_twisting_loca_data1($location) { $this->db->select('*'); $this->db->from('indent_po'); $this->db->join('indent_yarn_goods_details', 'indent_po.id = indent_yarn_goods_details.po_list_id'); $this->db->where('indent_po.product_type', 'Yarn - Twisted'); $this->db->where('indent_yarn_goods_details.yarn_status', '0'); $this->db->where('indent_yarn_goods_details.consumed_at', $location); $query=$this->db->get(); return $query->result(); } public function display_yarn_raw_loca_data1($location) { $this->db->select('*'); $this->db->from('indent_po'); $this->db->join('indent_yarn_goods_details', 'indent_po.id = indent_yarn_goods_details.po_list_id'); //$this->db->join('workorder_yarn_details','workorder_yarn_details.yarn_details = indent_yarn_goods_details.yarnname'); $this->db->where('indent_po.product_type', 'Yarn - Raw'); $this->db->where('indent_yarn_goods_details.yarn_status', '0'); $this->db->where('indent_yarn_goods_details.consumed_at', $location); $query=$this->db->get(); return $query->result(); } public function display_yarn_dyed_data_loca_details($location) { $this->db->select('indent_yarn_goods_details.id,indent_po.shades,indent_po.purpose,indent_add_indent.color_code,indent_yarn_goods_details.yarnname,indent_yarn_goods_details.yarndenier,indent_yarn_goods_details.yarnspecification,indent_yarn_goods_details.lot,indent_yarn_goods_details.bale,indent_yarn_goods_details.issue_gross_weight,indent_yarn_goods_details.net_weight,indent_yarn_goods_details.issue_net_weight,indent_yarn_goods_details.consumed_at,indent_yarn_goods_details.rec_date'); $this->db->from('indent_po'); $this->db->join('indent_yarn_goods_details', 'indent_po.id = indent_yarn_goods_details.po_list_id'); $this->db->join('indent_add_indent', 'indent_po.indent_id = indent_add_indent.id'); $this->db->where('indent_yarn_goods_details.consumed_at', $location); $this->db->where('indent_po.product_type', 'Yarn - Dyed'); $this->db->where('indent_yarn_goods_details.yarn_status', '0'); $query=$this->db->get(); return $query->result(); } public function display_yarn_twisting_yarn_material_modal_loc_data1($where,$l) { $this->db->select('*'); $this->db->from('indent_po'); $this->db->join('indent_yarn_goods_details', 'indent_po.id = indent_yarn_goods_details.po_list_id'); $this->db->where('indent_po.product_type', 'Yarn - Twisted'); $this->db->where('indent_yarn_goods_details.yarnname', $where); $this->db->where('indent_yarn_goods_details.issue_net_weight !=', '0'); $this->db->where('indent_yarn_goods_details.consumed_at', $l); $query=$this->db->get(); return $query->result(); } public function display_yarn_raw_modal_loc_data1($where,$l) { $this->db->select('*'); $this->db->from('indent_po'); $this->db->join('indent_yarn_goods_details', 'indent_po.id = indent_yarn_goods_details.po_list_id'); $this->db->where('indent_po.product_type', 'Yarn - Raw'); $this->db->where('indent_yarn_goods_details.yarnname', $where); $this->db->where('indent_yarn_goods_details.issue_net_weight !=', '0'); $this->db->where('indent_yarn_goods_details.consumed_at', $l); $query=$this->db->get(); return $query->result(); } public function display_yarn_dyed_modal_loc_data1($where,$l) { $this->db->select('*'); $this->db->from('indent_po'); $this->db->join('indent_yarn_goods_details', 'indent_po.id = indent_yarn_goods_details.po_list_id'); $this->db->where('indent_po.product_type', 'Yarn - Dyed'); $this->db->where('indent_yarn_goods_details.yarnname', $where); $this->db->where('indent_yarn_goods_details.issue_net_weight !=', '0'); $this->db->where('indent_yarn_goods_details.consumed_at', $l); $query=$this->db->get(); return $query->result(); } public function issue_display_yarn_raw_grid_issue_nandi_data($v) { $this->db->select('*'); $this->db->from('indent_po'); $this->db->join('indent_yarn_goods_details', 'indent_po.id = indent_yarn_goods_details.po_list_id'); //$this->db->join('indent_add_indent', 'indent_po.indent_id = indent_add_indent.id'); $this->db->where('indent_po.product_type', 'Yarn - Raw'); $this->db->where('indent_yarn_goods_details.consumed_at' ,'NANDI'); $this->db->where('indent_yarn_goods_details.issue_gross_weight !=' ,'0'); $this->db->where('indent_yarn_goods_details.issue_net_weight >' ,'0.00'); $this->db->where('indent_yarn_goods_details.id' ,$v); $query=$this->db->get(); return $query->row(); } public function issue_display_yarn_dyed_grid_issue_d_data($v) { $this->db->select('*'); $this->db->from('indent_po'); $this->db->join('indent_yarn_goods_details', 'indent_po.id = indent_yarn_goods_details.po_list_id'); $this->db->join('indent_add_indent', 'indent_po.indent_id = indent_add_indent.id'); $this->db->where('indent_po.product_type', 'Yarn - Dyed'); $this->db->where('indent_yarn_goods_details.consumed_at', 'NANDI'); $this->db->where('indent_yarn_goods_details.issue_gross_weight !=', '0'); $this->db->where('indent_yarn_goods_details.issue_net_weight >' ,'0.00'); $this->db->where('indent_yarn_goods_details.id' ,$v); $query=$this->db->get(); //return $query->row(); //return $this->db->last_query(); return $query->row(); } public function display_yarn_like_twisting_yarn_material_modal_data1($where) { $this->db->select('*'); $this->db->from('indent_po'); $this->db->like('indent_yarn_goods_details.yarnname', $where); //$this->db->where('indent_yarn_goods_details.yarnspecification', $y2); //$this->db->where('indent_yarn_goods_details.yarndenier', $y1); $this->db->join('indent_yarn_goods_details', 'indent_po.id = indent_yarn_goods_details.po_list_id'); $this->db->where('indent_po.product_type', 'Yarn - Twisted'); // $this->db->where('indent_yarn_goods_details.yarnname', $where); $this->db->where('indent_yarn_goods_details.issue_net_weight !=', '0'); $query=$this->db->get(); return $query->result(); } public function display_yarn_twisting_stock_yarn_material_modal_data1($where) { $this->db->select('*'); $this->db->from('delivery_yarn_twisting'); $this->db->like('delivery_yarn_twisting.yarnname', $where); $query=$this->db->get(); return $query->result(); } public function display_yarn_twisting_stock_yarn_material_modal_loc_data1($where,$loc) { $this->db->select('*'); $this->db->from('delivery_yarn_twisting'); //$this->db->join('indent_yarn_goods_details', 'indent_po.id = indent_yarn_goods_details.po_list_id'); //$this->db->where('indent_po.product_type', 'Yarn - Twisted'); //$this->db->where('indent_yarn_goods_details.yarnname', $where); $this->db->like('delivery_yarn_twisting.yarnname', $where); $this->db->where('delivery_yarn_twisting.consumed_at', $loc); $query=$this->db->get(); return $query->result(); } public function display_yarn_twisting_stock_yarn_material_modal_outdata1() { $this->db->select('*'); $this->db->from('delivery_yarn_twisting'); //$this->db->like('delivery_yarn_twisting.yarnname', $where); $query=$this->db->get(); return $query->result(); } public function display_yarn_raw_modal_outdata1() { $this->db->select('*'); $this->db->from('indent_po'); $this->db->join('indent_yarn_goods_details', 'indent_po.id = indent_yarn_goods_details.po_list_id'); $this->db->where('indent_po.product_type', 'Yarn - Raw'); //$this->db->where('indent_yarn_goods_details.yarnname', $where); $this->db->where('indent_yarn_goods_details.issue_net_weight !=', '0'); $query=$this->db->get(); return $query->result(); } public function display_yarn_dyed_modal_outdata1() { $this->db->select('*'); $this->db->from('indent_po'); $this->db->join('indent_yarn_goods_details', 'indent_po.id = indent_yarn_goods_details.po_list_id'); $this->db->where('indent_po.product_type', 'Yarn - Dyed'); //$this->db->where('indent_yarn_goods_details.yarnname', $where); $this->db->where('indent_yarn_goods_details.issue_net_weight !=', '0'); $query=$this->db->get(); return $query->result(); } public function display_yarn_twisting_stock_yarn_material_modal_outsourcedata1($l) { $this->db->select('*'); $this->db->from('delivery_yarn_twisting'); //$this->db->like('delivery_yarn_twisting.yarnname', $where); $this->db->where('delivery_yarn_twisting.consumed_at', $l); $query=$this->db->get(); return $query->result(); } public function display_yarn_raw_modal_outsourcedata1($l) { $this->db->select('*'); $this->db->from('indent_po'); $this->db->join('indent_yarn_goods_details', 'indent_po.id = indent_yarn_goods_details.po_list_id'); $this->db->where('indent_po.product_type', 'Yarn - Raw'); //$this->db->where('indent_yarn_goods_details.yarnname', $where); $this->db->where('indent_yarn_goods_details.consumed_at', $l); $this->db->where('indent_yarn_goods_details.issue_net_weight !=', '0'); $query=$this->db->get(); return $query->result(); } public function display_yarn_dyed_modal_outsourcedata1($l) { $this->db->select('*'); $this->db->from('indent_po'); $this->db->join('indent_yarn_goods_details', 'indent_po.id = indent_yarn_goods_details.po_list_id'); $this->db->where('indent_po.product_type', 'Yarn - Dyed'); //$this->db->where('indent_yarn_goods_details.yarnname', $where); $this->db->where('indent_yarn_goods_details.consumed_at', $l); $this->db->where('indent_yarn_goods_details.issue_net_weight !=', '0'); $query=$this->db->get(); return $query->result(); } public function history_dyeing_grid_data() { $this->db->select('workorder_dyeing.work_order_no,workorder_dyeing.vendor as d,work_order_dyeing.*'); $this->db->group_by('work_order_dyeing.issue_no'); $this->db->from('workorder_dyeing'); $this->db->join('work_order_dyeing', 'work_order_dyeing.work_order= workorder_dyeing.work_order'); $this->db->where('workorder_dyeing.status','0'); $this->db->where('workorder_dyeing.dyeing_status','1'); $query=$this->db->get(); return $query->result(); } public function invoice_sum_fetch_where_quantity_total($table,$where) { $this->db->select_sum('values_es'); //$this->db->select('quantity'); $this->db->from($table); $this->db->where($where); $query = $this->db->get(); return $query->row(); } public function markting_desc_fetch_data($currency,$contract_type,$article,$width,$design,$shades,$po_no) { $this->db->select('sub_orders.description'); // $this->db->select('*'); $this->db->from('orders'); // $this->db->where('sub_orders.orderId', $subOrderID); // $this->db->where('status',0); // $this->db->where('sub_order_shades.add_suborder',0); $this->db->join('packing_list_data', 'packing_list_data.osl_no = orders.oslNo'); $this->db->join('invoice_packing', 'invoice_packing.pack_id = packing_list_data.id'); $this->db->join('sub_orders', 'orders.id = sub_orders.orderID'); $this->db->join('sub_order_shades', 'sub_orders.id = sub_order_shades.subOrderId'); $this->db->where('orders.currency',$currency); $this->db->where('sub_orders.contractType',$contract_type); // $this->db->where('sub_orders.articleNo',$article); // $this->db->where('sub_orders.design',$design); // $this->db->where('sub_orders.width',$width); //$this->db->where('sub_order_shades.buyerShade',$shades); $query = $this->db->get(); return $query->row(); } public function display_yarn_raw_stock_grid_data($v) { $this->db->select('*'); $this->db->from('indent_po'); $this->db->join('indent_yarn_goods_details', 'indent_po.id = indent_yarn_goods_details.po_list_id'); $this->db->where('indent_po.product_type', 'Yarn - Raw'); $this->db->where('indent_yarn_goods_details.issue_gross_weight !=' ,'0'); $this->db->where('indent_yarn_goods_details.issue_net_weight >' ,'0'); $this->db->like('indent_yarn_goods_details.consumed_at' ,$v); $query=$this->db->get(); return $query->result(); } public function display_yarn_stock_dyed_grid_detailed_data($location) { $this->db->select('indent_yarn_goods_details.id,indent_yarn_goods_details.ssl_shade,indent_add_indent.shades,indent_po.purpose,indent_add_indent.color_code,indent_yarn_goods_details.yarnname,indent_yarn_goods_details.yarndenier,indent_yarn_goods_details.yarnspecification,indent_yarn_goods_details.lot,indent_yarn_goods_details.bale,indent_yarn_goods_details.issue_gross_weight,indent_yarn_goods_details.issue_net_weight,indent_yarn_goods_details.consumed_at,indent_yarn_goods_details.rec_date'); $this->db->from('indent_po'); $this->db->join('indent_yarn_goods_details', 'indent_po.id = indent_yarn_goods_details.po_list_id'); $this->db->join('indent_add_indent', 'indent_po.indent_id = indent_add_indent.id'); $this->db->where('indent_po.product_type', 'Yarn - Dyed'); $this->db->where('indent_yarn_goods_details.issue_gross_weight !=', '0'); $this->db->where('indent_yarn_goods_details.issue_net_weight >' ,'0'); $this->db->like('indent_yarn_goods_details.consumed_at' ,$v); $query=$this->db->get(); // $query=$this->db->get(); return $query->result(); } public function display_yarn_raw_id_stock_grid_data($v) { $this->db->select('*'); $this->db->from('indent_po'); $this->db->join('indent_yarn_goods_details', 'indent_po.id = indent_yarn_goods_details.po_list_id'); // $this->db->where('indent_yarn_goods_details.issue_gross_weight !=' ,'0'); // $this->db->where('indent_yarn_goods_details.issue_net_weight >' ,'0'); $this->db->like('indent_yarn_goods_details.id' ,$v); $query=$this->db->get(); return $query->row(); } public function display_yarn_selected_dyed_grid_detailed_data($v) { $this->db->select('indent_yarn_goods_details.id,indent_yarn_goods_details.ssl_shade,indent_add_indent.shades,indent_po.purpose,indent_add_indent.color_code,indent_yarn_goods_details.yarnname,indent_yarn_goods_details.yarndenier,indent_yarn_goods_details.yarnspecification,indent_yarn_goods_details.lot,indent_yarn_goods_details.bale,indent_yarn_goods_details.issue_gross_weight,indent_yarn_goods_details.issue_net_weight,indent_yarn_goods_details.consumed_at,indent_yarn_goods_details.rec_date'); $this->db->from('indent_po'); $this->db->join('indent_yarn_goods_details', 'indent_po.id = indent_yarn_goods_details.po_list_id'); $this->db->join('indent_add_indent', 'indent_po.indent_id = indent_add_indent.id'); $this->db->where('indent_po.product_type', 'Yarn - Dyed'); $this->db->where('indent_yarn_goods_details.issue_gross_weight !=', '0'); $this->db->where('indent_yarn_goods_details.issue_net_weight >' ,'0'); $this->db->where('indent_yarn_goods_details.id' ,$v); $query=$this->db->get(); // $query=$this->db->get(); return $query->row(); } public function fetch_where_subgrid_result_red_data($table,$where) { $this->db->select("*"); $this->db->from('osl_weft_details'); // $this->db->group_by('osl_weft_details.subNo','osl_weft_details.weft_qua','osl_weft_details.weft_den','osl_weft_details.weft_spec','osl_weft_details.weft_kora','osl_weft_details.weft_hank','osl_weft_details.weft_color','osl_weft_details.weft_code','osl_weft_details.oslNo','osl_weft_details.articleNo','osl_weft_details.ourshade','osl_weft_details.ssl_shade','osl_weft_details.location','osl_weft_details.type','osl_weft_details.status'); //$this->db->join('planned_order', 'osl_weft_details.subNo = planned_order.subNo'); //$this->db->where('osl_weft_details.status',0); $this->db->where('osl_weft_details.weft_qua !=',''); //$this->db->where('osl_weft_details.ssl_shade !=',''); //$where=array('status'=>0,'weft_qua !=' =>"",'ssl_shade !=' =>""); $query = $this->db->get(); return $query->result(); } public function fetch_where_subgrid_result_red_data_new($table,$where) { $this->db->select("*"); $this->db->from('osl_weft_details'); $this->db->where('osl_weft_details.weft_qua !=',''); $this->db->like('osl_weft_details.oslNo','2024'); $query = $this->db->get(); return $query->result(); } public function fetch_where_subgrid_result_ref_data($table,$where) { $this->db->select("*"); $this->db->from('osl_warp_details'); //$this->db->group_by('osl_warp_details.subNo','osl_warp_details.warp_qua','osl_warp_details.warp_den','osl_warp_details.warp_spec','osl_warp_details.warp_kora','osl_warp_details.warp_hank','osl_warp_details.warp_color','osl_warp_details.warp_code','osl_warp_details.oslNo','osl_warp_details.articleNo','osl_warp_details.ourshade','osl_warp_details.ssl_shade','osl_warp_details.location','osl_warp_details.type','osl_warp_details.status'); //$this->db->join('planned_order', 'osl_warp_details.subNo = planned_order.subNo'); //$this->db->where('osl_warp_details.status',0); $this->db->where('osl_warp_details.warp_qua !=',''); //$this->db->where('osl_warp_details.ssl_shade !=',''); //$where=array('status'=>0,'weft_qua !=' =>"",'ssl_shade !=' =>""); $query = $this->db->get(); return $query->result(); } public function fetch_where_subgrid_result_ref_data_new($table,$where) { $this->db->select("*"); $this->db->from('osl_warp_details'); $this->db->where('osl_warp_details.warp_qua !=',''); $this->db->like('osl_warp_details.oslNo','2024'); $query = $this->db->get(); return $query->result(); } public function fetch_where_subgrid_data_osl_group_issue_no($table,$where) { $this->db->select("*"); $this->db->group_by("oslNo"); $this->db->from($table); // $this->db->where($where); $query = $this->db->get(); return $query->result(); } public function display_yarn_raw_grid_data_group() { $this->db->select('*,(indent_po.updated_unit*indent_yarn_goods_details.issue_net_weight) as val'); $this->db->from('indent_po'); $this->db->join('indent_yarn_goods_details', 'indent_po.id = indent_yarn_goods_details.po_list_id'); $this->db->where('indent_po.product_type', 'Yarn - Raw'); //$this->db->where('indent_yarn_goods_details.issue_gross_weight !=' ,'0'); $this->db->where('indent_yarn_goods_details.issue_net_weight >' ,'0'); $this->db->where('indent_yarn_goods_details.reject_status !=' ,'REJECTED'); // $this->db->like('indent_yarn_goods_details.yarnname' ,$v); $query=$this->db->get(); return $query->result(); } public function display_yarn_raw_grid_data_group_sum($year) { $this->db->select('sum(indent_yarn_goods_details.issue_net_weight) as qty,sum(indent_po.updated_unit*indent_yarn_goods_details.issue_net_weight) as val'); $this->db->from('indent_po'); $this->db->join('indent_yarn_goods_details', 'indent_po.id = indent_yarn_goods_details.po_list_id'); $this->db->where('indent_po.product_type', 'Yarn - Raw'); if($year != 'all') $this->db->like('indent_yarn_goods_details.rec_date',$year); //$this->db->where('indent_yarn_goods_details.issue_gross_weight !=' ,'0'); $this->db->where('indent_yarn_goods_details.issue_net_weight >' ,'0'); $this->db->where('indent_yarn_goods_details.reject_status !=' ,'REJECTED'); // $this->db->like('indent_yarn_goods_details.yarnname' ,$v); $query=$this->db->get(); return $query->result(); } public function display_fabric_embroidryinspection_sum($year) { //$this->db->distinct(); $this->db->select('sum(fabric_inspection.updated_unit * fabric_inspection.balanced_mtrs) as val,sum(fabric_inspection.balanced_mtrs) as qty'); $this->db->order_by('fabric_inspection_details.id'); $this->db->from('fabric_inspection_details'); $this->db->join('fabric_inspection', 'fabric_inspection.goods_id = fabric_inspection_details.id'); $this->db->join('indent_po', 'indent_po.id = fabric_inspection_details.po_list_id','left'); if($year != 'all') $this->db->like('fabric_inspection_details.received_date',$year); $this->db->where('fabric_inspection_details.status','0'); $this->db->where('fabric_inspection_details.consumed_at !=','0'); $this->db->where('fabric_inspection.balanced_mtrs !=','0.00'); $this->db->where('fabric_inspection.balanced_mtrs !=',''); $this->db->where('fabric_inspection.balanced_mtrs >', 0); $query=$this->db->get(); return $query->result(); } public function display_yarn_dyed_grid_detailed_data_group() { $this->db->select('indent_po.po_no,indent_po.unit,indent_yarn_goods_details.id,indent_yarn_goods_details.ssl_shade,indent_add_indent.shades, indent_po.purpose,indent_add_indent.color_code,indent_yarn_goods_details.yarnname,indent_yarn_goods_details.yarndenier, indent_yarn_goods_details.yarnspecification,indent_yarn_goods_details.lot,indent_yarn_goods_details.bale,indent_yarn_goods_details.issue_gross_weight, indent_yarn_goods_details.issue_net_weight,indent_yarn_goods_details.consumed_at,indent_yarn_goods_details.rec_date, indent_yarn_goods_details.updated_date,(indent_po.updated_unit*indent_yarn_goods_details.issue_net_weight) as val,indent_po.updated_unit'); $this->db->from('indent_po'); $this->db->join('indent_yarn_goods_details', 'indent_po.id = indent_yarn_goods_details.po_list_id'); $this->db->join('indent_add_indent', 'indent_po.indent_id = indent_add_indent.id'); $this->db->where('indent_po.product_type', 'Yarn - Dyed'); //$this->db->where('indent_yarn_goods_details.issue_gross_weight !=', '0'); $this->db->where('indent_yarn_goods_details.issue_net_weight >' ,'0'); // $this->db->like('indent_yarn_goods_details.yarnname' ,$v); $query=$this->db->get(); // $query=$this->db->get(); return $query->result(); } public function display_yarn_dyed_grid_detailed_data_group_sum($year) { $this->db->select('sum(indent_po.updated_unit*indent_yarn_goods_details.issue_net_weight) as val,sum(indent_yarn_goods_details.issue_net_weight) as qty'); $this->db->from('indent_po'); $this->db->join('indent_yarn_goods_details', 'indent_po.id = indent_yarn_goods_details.po_list_id'); $this->db->join('indent_add_indent', 'indent_po.indent_id = indent_add_indent.id'); $this->db->where('indent_po.product_type', 'Yarn - Dyed'); if($year != 'all') $this->db->like('indent_yarn_goods_details.rec_date',$year); //$this->db->where('indent_yarn_goods_details.issue_gross_weight !=', '0'); $this->db->where('indent_yarn_goods_details.issue_net_weight >' ,'0'); // $this->db->like('indent_yarn_goods_details.yarnname' ,$v); $query=$this->db->get(); // $query=$this->db->get(); return $query->result(); } public function display_swan_reports_loc_grid_embroidryinspections_data_sum($year) { $select = "select sum(work_order_dyeing.updated_unit*work_order_dyeing.rec_dyed_qua) as val,sum(work_order_dyeing.rec_dyed_qua) as qty"; $from = " from work_order_dyeing JOIN workorder_dyeing on work_order_dyeing.dyed_id = workorder_dyeing.id"; $where = " where "; $where .= " work_order_dyeing.status = 'COMPLETED'"; $where .= " and work_order_dyeing.yarn_status = '0'"; $where .= " and work_order_dyeing.rec_dyed_qua > '0'"; $sql = ''; if($year == 'all'){ $sql = $select.$from.$where; } else{ $where .= "and work_order_dyeing.rec_date LIKE '%".$year."%'"; $sql = $select.$from.$where; } $result = $this->db->query($sql); return $result->result(); } public function max_select_remnants_id($table) { $this->db->select_max('remnants_id'); $this->db->from($table); $query = $this->db->get(); return $query->row(); } public function history_rements_desc_dyeing_grid_data() { $this->db->select('issue_loom.*, remnants.id,remnants.rements_stock,remnants.rements_approval_by,remnants.rements_approved_date,remnants.bag,remnants.remnants_location'); // $this->db->order_by('work_order_dyeing.id','DESC'); //$this->db->group_by('work_order_dyeing.issue_no'); $this->db->from('remnants'); $this->db->join('issue_loom', 'issue_loom.id= remnants.issue_loom_id'); //$this->db->join('work_order_dyeing', 'work_order_dyeing.issue_no= workorder_dyeing.issue_no'); //$this->db->where('workorder_dyeing.status','0'); //$this->db->where('workorder_dyeing.dyeing_status','1'); $this->db->where('remnants.rements_stock >',0); $this->db->where('remnants.reject_status !=','REJECTED'); $query=$this->db->get(); return $query->result(); } public function history_rements_order_desc_dyeing_grid_data($where) { $this->db->select('issue_loom.*, remnants.id,remnants.rements_stock,remnants.rements_approval_by,remnants.rements_approved_date,remnants.bag,remnants.remnants_location'); // $this->db->order_by('work_order_dyeing.id','DESC'); //$this->db->group_by('work_order_dyeing.issue_no'); $this->db->from('remnants'); $this->db->join('issue_loom', 'issue_loom.id= remnants.issue_loom_id'); //$this->db->join('work_order_dyeing', 'work_order_dyeing.issue_no= workorder_dyeing.issue_no'); $this->db->where('remnants.remnants_location',$where); //$this->db->where('workorder_dyeing.dyeing_status','1'); $query=$this->db->get(); return $query->result(); } public function history_rements_orders_desc_dyeing_grid_data($where) { $this->db->select('issue_loom.*, remnants.id,remnants.rements_stock,remnants.rements_approval_by,remnants.rements_approved_date,remnants.bag,remnants.remnants_location'); // $this->db->order_by('work_order_dyeing.id','DESC'); //$this->db->group_by('work_order_dyeing.issue_no'); $this->db->from('remnants'); $this->db->join('issue_loom', 'issue_loom.id= remnants.issue_loom_id'); //$this->db->join('work_order_dyeing', 'work_order_dyeing.issue_no= workorder_dyeing.issue_no'); $this->db->where('remnants.id',$where); //$this->db->where('workorder_dyeing.dyeing_status','1'); $query=$this->db->get(); return $query->result(); } public function fetch_where_remnants_val_subgrid_data1($table,$where) { $this->db->select("*"); $this->db->group_by("remnants_val"); $this->db->from($table); $this->db->where($where); $query = $this->db->get(); return $query->result(); } public function history_rements_rows_desc_dyeing_grid_data($where) { $this->db->select('issue_loom.*, remnants.id,remnants.rements_stock,remnants.rements_approval_by,remnants.rements_approved_date,remnants.bag,remnants.remnants_location'); // $this->db->order_by('work_order_dyeing.id','DESC'); //$this->db->group_by('work_order_dyeing.issue_no'); $this->db->from('remnants'); $this->db->join('issue_loom', 'issue_loom.id= remnants.issue_loom_id'); //$this->db->join('work_order_dyeing', 'work_order_dyeing.issue_no= workorder_dyeing.issue_no'); $this->db->where('remnants.id',$where); //$this->db->where('workorder_dyeing.dyeing_status','1'); $query=$this->db->get(); return $query->row(); } ////////////////////// 11-10-2018 ///////////////////////////////////// public function history_rements_desc_weaving_grid_data() { $this->db->select('create_weaving_work_order.*,create_weaving_work_order.yarn_quality as yarn_name,create_weaving_work_order.yarn_denier as yarn_den,create_weaving_work_order.yarn_specification as yarn_spec,remnants.id,remnants.rements_stock,remnants.rements_approval_by,remnants.rements_approved_date,remnants.bag,remnants.remnants_location,create_weaving_work_order.issue_no as yarn_lot,create_weaving_work_order.yarn_bales as yarn_bale'); $this->db->from('remnants'); $this->db->join('create_weaving_work_order', 'create_weaving_work_order.id= remnants.issue_loom_id'); $this->db->where('remnants.rements_stock >',0); $this->db->where('remnants.reject_status !=','REJECTED'); $query=$this->db->get(); return $query->result(); } ///////////////////////////////// 22-11-2018 /////////////////////// public function get_work_raw_yarn_order_grid_data($where) { $this->db->select('*'); $this->db->from('indent_po'); $this->db->join('indent_yarn_goods_details', 'indent_po.id = indent_yarn_goods_details.po_list_id'); $this->db->where('indent_yarn_goods_details.id', $where); $query=$this->db->get(); return $query->row(); } public function get_work_order_swan_grid_data($table,$where) { $this->db->select('*'); //$this->db->group_by('work_order_no','vendor_name','date','delivery_date'); // $this->db->order_by('work_order_no'); $this->db->from($table); $this->db->where($where); $query=$this->db->get(); return $query->row(); } public function get_embroidery_twisting_data($table,$where) { $this->db->select('*'); $this->db->from($table); $this->db->where($where); // $this->db->where('department !=', ' '); $query=$this->db->get(); return $query->row(); } public function display_yarn_dyed_grid_stock_detailed_data_group($where) { $this->db->select('indent_yarn_goods_details.id,indent_yarn_goods_details.ssl_shade,indent_add_indent.shades,indent_po.purpose,indent_add_indent.color_code,indent_yarn_goods_details.yarnname,indent_yarn_goods_details.yarndenier,indent_yarn_goods_details.yarnspecification,indent_yarn_goods_details.lot,indent_yarn_goods_details.bale,indent_yarn_goods_details.issue_gross_weight,indent_yarn_goods_details.issue_net_weight,indent_yarn_goods_details.consumed_at,indent_yarn_goods_details.rec_date,indent_po.po_no'); $this->db->from('indent_po'); $this->db->join('indent_yarn_goods_details', 'indent_po.id = indent_yarn_goods_details.po_list_id'); $this->db->join('indent_add_indent', 'indent_po.indent_id = indent_add_indent.id'); $this->db->where('indent_yarn_goods_details.id', $where); $query=$this->db->get(); return $query->row(); } ////////////////////// public function history_rements_desc_dyeing_grid_data_val($val) { $this->db->select('issue_loom.*, remnants.id,remnants.rements_stock,remnants.rements_approval_by,remnants.rements_approved_date,remnants.bag,remnants.remnants_location'); $this->db->from('remnants'); $this->db->join('issue_loom', 'issue_loom.id= remnants.issue_loom_id'); $this->db->where('remnants.id',$val); $query=$this->db->get(); return $query->row(); } public function history_rements_desc_weaving_grid_data_val($val) { $this->db->select('create_weaving_work_order.*,create_weaving_work_order.yarn_quality as yarn_name,create_weaving_work_order.yarn_denier as yarn_den,create_weaving_work_order.yarn_specification as yarn_spec,remnants.id,remnants.rements_stock,remnants.rements_approval_by,remnants.rements_approved_date,remnants.bag,remnants.remnants_location,create_weaving_work_order.issue_no as yarn_lot,create_weaving_work_order.yarn_bales as yarn_bale'); $this->db->from('remnants'); $this->db->join('create_weaving_work_order', 'create_weaving_work_order.id= remnants.issue_loom_id'); $this->db->where('remnants.id',$val); $query=$this->db->get(); return $query->row(); } //////////////////// 26-11-2018 //////////////////////////// public function get_stock_position_work_order_twisting_res($val) { //$this->db->distinct(); $this->db->select('create_yarntwisting_work_order.work_order_no as po_no'); $this->db->from('create_yarntwisting_work_order'); $this->db->join('work_order_twisting', 'create_yarntwisting_work_order.id = work_order_twisting.yarn_id'); $this->db->where('create_yarntwisting_work_order.quantity_approval', 'Completed'); $this->db->where('work_order_twisting.id' ,$val); $query=$this->db->get(); return $query->row(); } public function get_stock_position_yarn_data($val) { $this->db->select('indent_po.po_no as po_no'); $this->db->from('indent_po'); $this->db->join('indent_yarn_goods_details', 'indent_po.id = indent_yarn_goods_details.po_list_id'); $this->db->where('indent_yarn_goods_details.id', $val); $query=$this->db->get(); return $query->row(); } public function fetch_where_subgrid_sum_issue_dat($where,$where1) { $this->db->select_sum('issue_qua'); $this->db->from('finishing_embroidry'); $this->db->where('finishing_embroidry.work_order_num',$where); $this->db->where('finishing_embroidry.work_order',$where1); $this->db->where('finishing_embroidry.status',1); $this->db->join('finishing_embroidry_stock', 'finishing_embroidry_stock.fin_emb_id = finishing_embroidry.id'); $query = $this->db->get(); return $query->row(); } public function fetch_where_subgrid_variance_sum_dat($where,$where1) { $this->db->select_sum('variance_mtrs'); $this->db->from('finishing_embroidry'); $this->db->where('finishing_embroidry.work_order_num',$where); $this->db->where('finishing_embroidry.work_order',$where1); $this->db->where('finishing_embroidry.status',1); $this->db->join('finishing_embroidry_stock', 'finishing_embroidry_stock.fin_emb_id = finishing_embroidry.id'); $query = $this->db->get(); return $query->row(); } public function get_work_fabric_history_order_data($table) { $this->db->select('weaving_panel_planning_order.*,orders.fileNo,sub_orders.unit,orders.orderNo,weaving_panel_planning_order.status as prod'); $this->db->from('weaving_panel_planning_order'); $this->db->join('orders', 'orders.id= weaving_panel_planning_order.order_id'); $this->db->join('sub_orders', 'orders.id= sub_orders.orderID'); $wherecond = "( ( ( warp_pland_mtr ='0' AND weft_pland_mtr >'0') OR ( warp_pland_mtr >'0' AND weft_pland_mtr ='0') OR ( warp_pland_mtr >'0' AND weft_pland_mtr >'0') ) )"; $this->db->where($wherecond); $this->db->order_by('weaving_panel_planning_order.delivery_date','desc'); $this->db->group_by(array('weaving_panel_planning_order.id')); $query=$this->db->get(); return $query->result(); } public function history_rements_desc_order_dyeing_grid_data($id) { $this->db->select('issue_loom.*, remnants.id,remnants.rements_stock,remnants.rements_approval_by,remnants.rements_approved_date,remnants.bag,remnants.remnants_location'); $this->db->from('remnants'); $this->db->join('issue_loom', 'issue_loom.id= remnants.issue_loom_id'); $this->db->where('remnants.id',$id); $query=$this->db->get(); return $query->row(); } public function history_rements_desc_order_weaving_grid_data($id) { $this->db->select('create_weaving_work_order.*,create_weaving_work_order.yarn_quality as yarn_name,create_weaving_work_order.yarn_denier as yarn_den,create_weaving_work_order.yarn_specification as yarn_spec,remnants.id,remnants.rements_stock,remnants.rements_approval_by,remnants.rements_approved_date,remnants.bag,remnants.remnants_location,create_weaving_work_order.issue_no as yarn_lot,create_weaving_work_order.yarn_bales as yarn_bale'); $this->db->from('remnants'); $this->db->join('create_weaving_work_order', 'create_weaving_work_order.id= remnants.issue_loom_id'); $this->db->where('remnants.id',$id); $query=$this->db->get(); return $query->row(); } public function get_orderno($id) { $this->db->select('orders.*'); $this->db->from('orders'); $this->db->join('weaving_panel_planning_order', 'weaving_panel_planning_order.order_id= orders.id'); $this->db->where('weaving_panel_planning_order.id',$id); $query=$this->db->get(); return $query->row(); } public function get_weavingdetails($id) { $this->db->select('orders.fileNo,orders.orderNo,weaving_panel_planning_order.*'); $this->db->from('orders'); $this->db->join('weaving_panel_planning_order', 'weaving_panel_planning_order.order_id= orders.id'); $this->db->where('weaving_panel_planning_order.id',$id); $query=$this->db->get(); return $query->row(); } public function getd($where){ $this->db->select('po_list_id'); $this->db->from('indent_yarn_goods_details'); $this->db->where($where); $query=$this->db->get(); $q=$query->row(); return $q->po_list_id; } public function getii($where){ $this->db->select('indent_id'); $this->db->from('indent_po'); $this->db->where('id',$where); $query=$this->db->get(); $q=$query->row(); return $q->indent_id; } public function display_yarn_raw_grid_data_selected($where) { $this->db->select('*,(indent_po.updated_unit*indent_yarn_goods_details.issue_net_weight) as val,indent_po.id as po_id,indent_yarn_goods_details.id as goods_id'); $this->db->from('indent_po'); $this->db->join('indent_yarn_goods_details', 'indent_po.id = indent_yarn_goods_details.po_list_id'); $this->db->where('indent_yarn_goods_details.id',$where); $query=$this->db->get(); return $query->result(); } public function display_yarn_dyed_grid_detailed_data_group_selected($where) { $this->db->select('indent_po.po_no,indent_po.unit,indent_yarn_goods_details.id,indent_yarn_goods_details.ssl_shade,indent_add_indent.shades, indent_po.purpose,indent_add_indent.color_code,indent_yarn_goods_details.yarnname,indent_yarn_goods_details.yarndenier, indent_yarn_goods_details.yarnspecification,indent_yarn_goods_details.lot,indent_yarn_goods_details.bale,indent_yarn_goods_details.issue_gross_weight, indent_yarn_goods_details.issue_net_weight,indent_yarn_goods_details.consumed_at,indent_yarn_goods_details.rec_date, indent_yarn_goods_details.updated_date,(indent_po.updated_unit*indent_yarn_goods_details.issue_net_weight) as val,indent_po.updated_unit,,indent_po.id as po_id,indent_yarn_goods_details.id as goods_id'); $this->db->from('indent_po'); $this->db->join('indent_yarn_goods_details', 'indent_po.id = indent_yarn_goods_details.po_list_id'); $this->db->join('indent_add_indent', 'indent_po.indent_id = indent_add_indent.id'); $this->db->where('indent_yarn_goods_details.id',$where); $query=$this->db->get(); return $query->result(); } public function display_swan_reports_loc_grid_embroidryinspections_data_selected($where) { $this->db->select('*,(work_order_dyeing.updated_unit*work_order_dyeing.rec_dyed_qua) as val,work_order_dyeing.id as po_id,work_order_dyeing.id as goods_id'); $this->db->from('work_order_dyeing'); $this->db->where('work_order_dyeing.id',$where); $query=$this->db->get(); //print_r($this->db->last_query()); //die(); return $query->result(); } public function display_fabric_embroidryinspection($where) { //$this->db->distinct(); $this->db->select('fabric_inspection.id as po_id,fabric_inspection_details.id as goods_id,(fabric_inspection.updated_unit * fabric_inspection.balanced_mtrs) as val,indent_po.unit,fabric_inspection_details.splited_piece_no,fabric_inspection_details.received_date,fabric_inspection_details.id,fabric_inspection_details.vendor_name,fabric_inspection_details.consumed_at,fabric_inspection_details.piece_no,fabric_inspection_details.po_no,fabric_inspection_details.product_name,fabric_inspection_details.width,fabric_inspection_details.shades,fabric_inspection_details.rec_goods,fabric_inspection_details.rec_weight,fabric_inspection.inspected_mtrs,fabric_inspection.updated_unit,fabric_inspection.rejected_mtrs,fabric_inspection.ssl_pc_no,fabric_inspection.quantity,fabric_inspection_details.bal_goods,fabric_inspection_details.remainning_quantity,fabric_inspection_details.available_quantity,fabric_inspection.variance_mtrs,fabric_inspection.balanced_mtrs,fabric_inspection_details.design,fabric_inspection_details.customer_id'); $this->db->order_by('fabric_inspection_details.id'); $this->db->from('fabric_inspection_details'); $this->db->join('fabric_inspection', 'fabric_inspection.goods_id = fabric_inspection_details.id'); $this->db->join('indent_po', 'indent_po.id = fabric_inspection_details.po_list_id','left'); $this->db->where('fabric_inspection_details.id',$where); $query=$this->db->get(); return $query->result(); } public function get_embroidery_data_selected($where) { $this->db->select('*,(delivery_yarn_twisting.issue_net_weight * delivery_yarn_twisting.updated_unit) as val'); $this->db->from('delivery_yarn_twisting'); $this->db->where('delivery_yarn_twisting.id',$where); $query=$this->db->get(); return $query->result(); } } ?>