This commit is contained in:
venbatechnologies@gmail.com 2018-11-14 14:52:29 +05:30
parent e3fd4d6af8
commit ff502f0919
4 changed files with 244 additions and 10 deletions

View File

@ -1316,9 +1316,6 @@ class batchcard extends BaseController
$data['rawsupplier'] = $this->batchcard_model->Rawsupplier();
$data['consusupplier'] = $this->batchcard_model->Consupplier();
$data['packsupplier'] = $this->batchcard_model->Pacsupplier();
//print_r($data['packagematerial']);die();
$this->global['pageTitle'] = 'Siddharth : Finished Product Batch Card';
@ -1944,9 +1941,6 @@ class batchcard extends BaseController
$packvalue = $this->input->post('packprice'.$i);
$packlineId = $this->input->post('packId'.$i);
//echo $packmaterial;echo $packsupplier;
$beforepacqty = $this->input->post('beforepackQty'.$i);
@ -2158,5 +2152,18 @@ class batchcard extends BaseController
}
function get_Product_Supplier()
{
$MaterialCode = $this->input->post('materialcode');
$type = $this->input->post('type');
$supplierlist = $this->batchcard_model->Get_Product_Supplier($MaterialCode,$type);
echo json_encode($supplierlist);
}
}
?>

View File

@ -1276,6 +1276,30 @@ where MaterialCode = ? and SupplierID=?';
return $query->result_array();
}
function Get_Product_Supplier($MaterialCode,$type)
{
//echo $MaterialCode;
$this->db->select('mas.SupplierID,sup.SupplierName,mmas.MaterialCode,mmas.MaterialName');
$this->db->from('T_PurchaseOrder_Master mas');
$this->db->join('T_SupplierDetailsN sup','sup.SupplierID=mas.SupplierID');
$this->db->join('T_PurchaseOrder_LineItem line','line.PONO=mas.PONO');
$this->db->join('T_MaterialMaster mmas','mmas.MaterialCode=line.MaterialCode');
$this->db->where('Category like',$type);
// $this->db->where('T_MaterialMaster.Category like','%Raw Material%');
$this->db->where('mmas.MaterialCode',$MaterialCode);
$this->db->group_by('SupplierID');
$supp = $this->db->get();
//print_r($this->db->last_query());die();
return $supp->result();
}
}
?>

View File

@ -2063,6 +2063,38 @@ $('#rawmaterialcode').change(function()
today = yyyy+'-'+mm+'-'+dd;
$.ajax({
data:{materialcode:materialcode,type:'Raw Material'},
type:"POST",
url:"<?php echo base_url() ?>batchcard/get_Product_Supplier",
success:function(data) {
if(data)
{
console.log(data)
var html = '';
$('#rawSupplier').find('option:not(:first)').remove();
$.each(JSON.parse(data), function (supDet, supobj)
{
$("#rawSupplier").append( $('<option></option>').val(supobj.SupplierID).html(supobj.SupplierID+' - '+supobj.SupplierName));
});
}
}
});
var type = "rawmaterial";
if(rawSupplier !=0)
@ -2108,9 +2140,8 @@ $('#rawmaterialcode').change(function()
$('#rawSupplier').change(function()
{
var rawSupplier = $('#rawSupplier').val();
var materialcode = $('#rawmaterialcode').val();
var rawSupplier = $('#rawSupplier').val();
var materialcode = $('#rawmaterialcode').val();
var date = new Date();
var dd = date.getDate();
@ -2193,6 +2224,45 @@ $('#consumaterialcode').change(function()
today = yyyy+'-'+mm+'-'+dd;
$.ajax({
data:{materialcode:materialcode,type:'Consumables'},
type:"POST",
url:"<?php echo base_url() ?>batchcard/get_Product_Supplier",
success:function(data) {
if(data)
{
console.log(data)
var html = '';
$('#consuSupplier').find('option:not(:first)').remove();
$.each(JSON.parse(data), function (supDet, supobj)
{
$("#consuSupplier").append( $('<option></option>').val(supobj.SupplierID).html(supobj.SupplierID+' - '+supobj.SupplierName));
});
}
}
});
var consusupplier = $('#consuSupplier').val();
var type = "consumables";
@ -2331,6 +2401,39 @@ $('#packumaterialcode').change(function()
today = yyyy+'-'+mm+'-'+dd;
$.ajax({
data:{materialcode:materialcode,type:'Packing material'},
type:"POST",
url:"<?php echo base_url() ?>batchcard/get_Product_Supplier",
success:function(data) {
if(data)
{
console.log(data)
var html = '';
$('#packSupplier').find('option:not(:first)').remove();
$.each(JSON.parse(data), function (supDet, supobj)
{
$("#packSupplier").append( $('<option></option>').val(supobj.SupplierID).html(supobj.SupplierID+' - '+supobj.SupplierName));
});
}
}
});
var packSupplier = $('#packSupplier').val();
var type = "packing";

View File

@ -1714,7 +1714,7 @@ $('.rootaddClick').click(function()
rootindex = parseInt(rootindex)+1;
var temp = rootindex
var template = jQuery("#consumable").html();
alert(rootindex)
// alert(rootindex)
$('#consuappend').append(_.template(template,{rootindex:temp,Material:consumaterialname,Supplier:rawsuppliername,Quantity:consuQty,Price:consuprice,consuBasicPrice:conbasicfix}));
var theForm = $(".final_product");
@ -2151,6 +2151,38 @@ $('#rawmaterialcode').change(function()
var materialcode = $('#rawmaterialcode').val();
$.ajax({
data:{materialcode:materialcode,type:'Raw Material'},
type:"POST",
url:"<?php echo base_url() ?>batchcard/get_Product_Supplier",
success:function(data) {
if(data)
{
console.log(data)
var html = '';
$('#rawSupplier').find('option:not(:first)').remove();
$.each(JSON.parse(data), function (supDet, supobj)
{
$("#rawSupplier").append( $('<option></option>').val(supobj.SupplierID).html(supobj.SupplierID+' - '+supobj.SupplierName));
});
}
}
});
var date = new Date();
var dd = date.getDate();
@ -2285,6 +2317,38 @@ $('#consumaterialcode').change(function()
var materialcode = $('#consumaterialcode').val();
$.ajax({
data:{materialcode:materialcode,type:'Consumables'},
type:"POST",
url:"<?php echo base_url() ?>batchcard/get_Product_Supplier",
success:function(data) {
if(data)
{
console.log(data)
var html = '';
$('#consuSupplier').find('option:not(:first)').remove();
$.each(JSON.parse(data), function (supDet, supobj)
{
$("#consuSupplier").append( $('<option></option>').val(supobj.SupplierID).html(supobj.SupplierID+' - '+supobj.SupplierName));
});
}
}
});
var date = new Date();
var dd = date.getDate();
@ -2426,6 +2490,42 @@ $('#packumaterialcode').change(function()
var materialcode = $('#packumaterialcode').val();
$.ajax({
data:{materialcode:materialcode,type:'Packing material'},
type:"POST",
url:"<?php echo base_url() ?>batchcard/get_Product_Supplier",
success:function(data) {
if(data)
{
console.log(data)
var html = '';
$('#packSupplier').find('option:not(:first)').remove();
$.each(JSON.parse(data), function (supDet, supobj)
{
$("#packSupplier").append( $('<option></option>').val(supobj.SupplierID).html(supobj.SupplierID+' - '+supobj.SupplierName));
});
}
}
});
var date = new Date();
var dd = date.getDate();