diff --git a/application/controllers/purchaseorder.php b/application/controllers/purchaseorder.php
index 3ed40997..b7caf9c7 100755
--- a/application/controllers/purchaseorder.php
+++ b/application/controllers/purchaseorder.php
@@ -517,6 +517,7 @@ function edited(){
$data['getdata'] = $this->purchaseorder_model->getfunctionr($PONO);
+ $data['billfile'] = $this->purchaseorder_model->getbillfiesr($PONO);
$data['MaxPODate'] = $this->purchaseorder_model->getLastReleasedPODate();
$data['TaxType'] = $this->purchaseorder_model->getConfigValue('C006');
@@ -527,6 +528,7 @@ function edited(){
$data['POItem'] = $this->purchaseorder_model->GetServicePurchaseOrderDetails($PONO);
$data['getdata'] = $this->purchaseorder_model->getfunction($PONO);
+ //$data['billfile'] = $this->purchaseorder_model->getbillfiesr($pono);
//s print_r($data['getdata']);
$data['getlogpodtl']=$this->purchaseorder_model->getlogpodtl($PONO);
@@ -4275,8 +4277,12 @@ function addloadfile()
{
$pono= $this->input->post('PONO');
- $new_file_name =$_FILES['param1']['name'];
- //echo $new_file_name;
+
+ $igr= $this->input->post('igr');
+
+
+ $new_file_name =$_FILES['file']['name'];
+ //echo $new_file_name;die;
if(!empty($new_file_name))
{
$Picture = $this->adfile();
@@ -4286,7 +4292,7 @@ function addloadfile()
$Picture ='';
}
//echo $Picture;die;
-$filelist =array('PONO'=>$pono,'FilePath'=>$Picture);
+$filelist =array('PONO'=>$pono,'IGRNO'=>$igr,'FilePath'=>$Picture);
@@ -4303,18 +4309,26 @@ $filelist =array('PONO'=>$pono,'FilePath'=>$Picture);
function adfile()
{
$picture = '';
- if(!empty($_FILES['param1']['name']))
+ if(!empty($_FILES['file']['name']))
{
$config['upload_path'] = 'uploads/BillFiles/';
$config['allowed_types'] = 'docx|pdf|doc|png|jpg';
- $config['file_name'] = $_FILES['param1']['name'];
- // print_r($config) ;
+ $config['file_name'] = $_FILES['file']['name'];
+ // print_r($config);die;
//Load upload library and initialize configuration
$this->load->library('upload',$config);
$this->upload->initialize($config);
+ if($this->upload->do_upload('file'))
+ {
$uploadData = $this->upload->data();
$picture = $uploadData['file_name'];
+ }
+ else
+ {
+ $error = array('error' => $this->upload->display_errors());
+ $picture = '';
+ }
}
else
@@ -4325,26 +4339,21 @@ $filelist =array('PONO'=>$pono,'FilePath'=>$Picture);
return $picture ;
}
-function uploadfile()
- {
-
- //alert();
- $bill= $this->input->post('param1');
- $oldfile= $this->input->post('param2');
- $invno= $this->input->post('param3');
- $invdate= $this->input->post('param4');
- $VehicleNo= $this->input->post('param5');
- $CourierNo= $this->input->post('param6');
- $MaterialRcvdDate =$this->input->post('param7');
- // $oldfile = $this->input->post('param2');
- // $newfile = $this->input->post('param8');
- $newfile =$this->input->post('param8');
+ function splpodata()
+ {
+ $invno= $this->input->post('param1');
+ $invdate= $this->input->post('param2');
+ $VehicleNo= $this->input->post('param3');
+ $CourierNo= $this->input->post('param4');
+ $MaterialRcvdDate =$this->input->post('param5');
+ $PONO =$this->input->post('param6');
+ $IGRNO =$this->input->post('param7');
+$invdate = date('Y-m-d',strtotime($invdate));
- $invdate = date('Y-m-d',strtotime($invdate));
$MaterialRcvdDate =date('Y-m-d',strtotime($MaterialRcvdDate));
$CreatedBy = $this->session->userdata('userId');
@@ -4354,40 +4363,61 @@ function uploadfile()
$createddt = $dt->format('Y-m-d H:i:s');
- $billdetails = $this->purchaseorder_model->getigrno($bill);
-
-//print_r($billdetails);
- $PONO = $billdetails[0]['PONO'];
+// $billdetails = $this->purchaseorder_model->getigrno($bill);
+
+// //print_r($billdetails);
- $IGRNo = $billdetails[0]['IGRNO'];
+// $PONO = $billdetails[0]['PONO'];
+
+
+// $IGRNo = $billdetails[0]['IGRNO'];
- if(!empty($_FILES['param8']['name']))
+ $igrMaster = array('VehicleNo'=>$VehicleNo,'DeliveryChellanOrInvoiceNo'=>$invno,'DeliveryChellanDate'=>$invdate, 'MaterialRcvdDate'=>$MaterialRcvdDate,'CourierNo'=>$CourierNo,'UpdateBY'=>$CreatedBy,'UpdatedOn' =>$createddt);
+
+
+
+ $igrM = $this->purchaseorder_model->updateigrM($PONO,$IGRNO,$igrMaster);
+ if($igrM > 0){
+ echo "updated successfully!";
+ }
+ else{
+ echo " not updated successfully!";
+ }
+
+
+
+ }
+
+function uploadfile()
+ {
+
+ //alert();
+ $bill= $this->input->post('param1');
+
+ $oldfile = $this->input->post('param2');
+
+ $newfile =$this->input->post('file');
+
+
+
+ if(!empty($_FILES['file']['name']))
{
$Picture = $this->add();
}else{
- $Picture = $this->input->post('param2');
+ $Picture = $oldfile ;
}
//echo $Picture;die;
$uploadfile = $this->purchaseorder_model->updatefile($bill,$Picture,$oldfile);
- $igrMaster = array('VehicleNo'=>$VehicleNo,'DeliveryChellanOrInvoiceNo'=>$invno,'DeliveryChellanDate'=>$invdate, 'MaterialRcvdDate'=>$MaterialRcvdDate,'CourierNo'=>$CourierNo,'UpdateBY'=>$CreatedBy,'UpdatedOn' =>$createddt);
-
- // print_r($igrMaster);die;
- // uploadfile();
-
- $igrM = $this->purchaseorder_model->updateigrM($PONO,$IGRNo,$igrMaster);
-
- // $file =$this->purchaseorder_model->fileup($PONO,$IGRNo,$newfile)
-
// if($uploadfile > 0){
echo "updated successfully!";
// }
@@ -4399,16 +4429,16 @@ function uploadfile()
function add()
{
$picture = '';
- if(!empty($_FILES['param8']['name']))
+ if(!empty($_FILES['file']['name']))
{
$config['upload_path'] = 'uploads/BillFiles/';
$config['allowed_types'] = 'docx|pdf|doc|png|jpg';
- $config['file_name'] = $_FILES['param8']['name'];
- // print_r($config) ;
+ $config['file_name'] = $_FILES['file']['name'];
+ //print_r($config) ;die;
//Load upload library and initialize configuration
$this->load->library('upload',$config);
$this->upload->initialize($config);
- if($this->upload->do_upload('param8'))
+ if($this->upload->do_upload('file'))
{
$uploadData = $this->upload->data();
$picture = $uploadData['file_name'];
diff --git a/application/models/purchaseorder_model.php b/application/models/purchaseorder_model.php
index f74c1c69..02213059 100755
--- a/application/models/purchaseorder_model.php
+++ b/application/models/purchaseorder_model.php
@@ -204,7 +204,41 @@ function getfunctionr($pono)
$this->db->select('mstr.PONO,mstr.IGRNO,mstr.DeliveryChellanOrInvoiceNo,
mstr.DeliveryChellanDate,mstr.VehicleNo,mstr.MaterialRcvdDate,
-mstr.CourierNo,bill.BillNo,bill.FilePath,pom.Status,pom.POType');
+mstr.CourierNo,pom.Status,pom.POType'); //,bill.BillNo,bill.FilePath,
+
+ $this->db->from('T_IGR_Master mstr');
+ //$this->db->join('T_PurchaseOrder_BillUpload bill','bill.PONO = mstr.PONO','left');
+ $this->db->join('T_IGR_Details dtl','mstr.IGRNO = dtl.IGRNO','left');
+ // $this->db->join('T_MaterialMaster mm','mm.MaterialCode = bill.MaterialCode');
+ $this->db->join('T_PurchaseOrder_Master pom','pom.PONO = mstr.PONO');
+ $this->db->where('mstr.PONO',$pono);
+
+ $query = $this->db->get();
+
+ return $query->result();
+ }
+
+
+function getbillfiesr($pono)
+ {
+ $this->db->distinct();
+ // $this->db->select('bill.PONO,mstr.IGRNO,bill.BillNo,mstr.MaterialRcvdDate,bill.FilePath,mstr.DeliveryChellanOrInvoiceNo,mstr.DeliveryChellanDate,mstr.VehicleNo,mstr.CourierNo,dtl.QuantityAsPerInvoice,pom.POType');
+ // $this->db->from('T_PurchaseOrder_BillUpload bill');
+ // $this->db->join('T_IGR_Master mstr','bill.PONO = mstr.PONO','left');
+ // $this->db->join('T_IGR_Details dtl','mstr.IGRNO = dtl.IGRNO','left');
+ // // $this->db->join('T_MaterialMaster mm','mm.MaterialCode = bill.MaterialCode');
+ // $this->db->join('T_PurchaseOrder_Master pom','pom.PONO = bill.PONO');
+ // $this->db->where('bill.PONO',$pono);
+ // //$this->db->or_where('pom.status',SPECIAL_PO);
+ // $this->db->group_by('bill.BillNo');
+
+
+
+
+
+ $this->db->select('mstr.PONO,mstr.IGRNO,mstr.DeliveryChellanOrInvoiceNo,
+mstr.DeliveryChellanDate,mstr.VehicleNo,mstr.MaterialRcvdDate,
+mstr.CourierNo,bill.BillNo,bill.FilePath,pom.Status,pom.POType');
$this->db->from('T_IGR_Master mstr');
$this->db->join('T_PurchaseOrder_BillUpload bill','bill.PONO = mstr.PONO','left');
@@ -219,7 +253,6 @@ mstr.CourierNo,bill.BillNo,bill.FilePath,pom.Status,pom.POType');
}
-
function GetPODetailforBillingServicePO($PONO)
{
diff --git a/application/views/Report_attach_inward.php b/application/views/Report_attach_inward.php
index a3b7bcc8..14e95483 100755
--- a/application/views/Report_attach_inward.php
+++ b/application/views/Report_attach_inward.php
@@ -282,13 +282,13 @@ if(!empty($mms))
file)){ ?>
-
+
- ifile)) { ?>
- <
+
+ ifile)) { ?>
+
@@ -354,7 +354,7 @@ if(!empty($mms))
// Set up your table
$(document).ready(function() {
-$('.btn-sm').click(function() {
+$('.splpofile').click(function() {
var id = $(this).attr('id');
$("#Fileshow").modal("show");
$.ajax({
diff --git a/application/views/Report_purchase_inward.php b/application/views/Report_purchase_inward.php
index 146b512d..29132362 100755
--- a/application/views/Report_purchase_inward.php
+++ b/application/views/Report_purchase_inward.php
@@ -359,10 +359,15 @@ table.dataTable thead > tr > td.sorting {
|
file)){ ?>
-
+
ifile)) { ?>
-
+
+
+
+
+
+
|
@@ -520,7 +525,7 @@ table.dataTable thead > tr > td.sorting {
// Set up your table
$(document).ready(function() {
- $('.btn-sm').click(function() {
+ $('.splpofile').click(function() {
var id = $(this).attr('id');
$("#Fileshow").modal("show");
$.ajax({
diff --git a/application/views/editRevenuepurchaseorder.php b/application/views/editRevenuepurchaseorder.php
index d9c2619b..08499520 100644
--- a/application/views/editRevenuepurchaseorder.php
+++ b/application/views/editRevenuepurchaseorder.php
@@ -351,7 +351,7 @@ $(function() {
dateFormat: 'dd-mm-yy',changeMonth: false, changeYear: false
});
- $("#MaterialRcvdDate").datepicker({
+ $("#MaterialRcvdDate,#InvDate").datepicker({
//minDate : d,
//maxDate : 'now',
dateFormat: 'dd-mm-yy',changeMonth: false, changeYear: false
@@ -4169,14 +4169,12 @@ function calculateEditTaxValue()
-
+
-
-
-
+
@@ -4200,15 +4198,15 @@ function calculateEditTaxValue()
- | Bill No |
+
Delivery Challan No |
Delivery Challan Date |
MaterialReceived Date |
Vehicle No |
Courier No |
-
- File |
+
+
Action |
@@ -4224,9 +4222,7 @@ function calculateEditTaxValue()
-
- | BillNo ?> |
-
+
DeliveryChellanOrInvoiceNo?> |
DeliveryChellanDate);
echo $date->format('d-m-Y'); ?> |
@@ -4235,14 +4231,14 @@ function calculateEditTaxValue()
VehicleNo?> |
CourierNo?> |
-
-
- FilePath))?$gd->FilePath:"No File"; ?> |
+
+
+
@@ -4251,14 +4247,72 @@ function calculateEditTaxValue()
-
+
+
+ |
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ | Bill No |
+
+ File |
+
+ Action |
+
+
+
+ $gd)
+ {
+ $index = $row+1;
+ ?>
+
+
+
+ | BillNo ?> |
+
+
+ FilePath))?$gd->FilePath:"No File"; ?> |
+
+
+
+
+
+
+
+
+
+
+
+
FilePath)) { ?>
@@ -4272,6 +4326,16 @@ function calculateEditTaxValue()
|
+
+
+
+
+
+
+
+
+
+
@@ -4282,8 +4346,7 @@ function calculateEditTaxValue()
| Sno |
PONO |
-
-
+
LineItemNo |
Entity |
OldValue |
@@ -4299,7 +4362,7 @@ function calculateEditTaxValue()
PONO ?> |
-
+
LineItemNos;?> |
entity?> |
entity =='PO DateChanged'){
@@ -4374,15 +4430,13 @@ function calculateEditTaxValue()
Delivery Challan /Inv Date
-
+
'Date','value' => set_value('PODate',$date),'id'=>'PODate1', 'class' => 'form-control num' ,'required' => 'true','onkeypress'=>'');
+ $data = array('name' => 'InvDate','value' => set_value('InvDate',$date),'id'=>'InvDate', 'class' => 'form-control num' ,'required' => 'true','onkeypress'=>'');
echo form_input($data);
?>
@@ -4390,7 +4444,7 @@ function calculateEditTaxValue()
Material Received Date
'Date','value' => set_value('PODate',$mrcdate),'id'=>'MaterialRcvdDate', 'class' => 'form-control num' ,'required' => 'true','onkeypress'=>'');
+ $data = array('name' => 'MaterialRcvdDate','value' => set_value('MaterialRcvdDate',$mrcdate),'id'=>'MaterialRcvdDate', 'class' => 'form-control num' ,'required' => 'true','onkeypress'=>'');
echo form_input($data);
?>
@@ -4417,47 +4471,9 @@ function calculateEditTaxValue()
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
@@ -4485,7 +4499,57 @@ function calculateEditTaxValue()
-
+
+
+
+
+
+
+
+
@@ -4509,11 +4573,11 @@ function calculateEditTaxValue()
else if($PONOStatus == SPECIAL_PO) {?>
Submit
-
-
+
OK
@@ -4573,21 +4637,39 @@ $("#BudgetType").change(function(){
function openmodel(i){
- //alert(i);
- var file = $("#file"+i).val();
+
- var Billno = $("#billnos"+i).val();
var deliveryinvoiceno = $("#deliveryinvoiceno"+i).val();
var deliverydate = $("#deliverydate"+i).val();
+
var vehicleno = $("#vehicleno"+i).val();
var courierno = $("#courierno"+i).val();
- //alert(Billno +'-'+file +'-'+deliveryinvoiceno +'-'+deliverydate +'-'+vehicleno+'-'+courierno);
+ var MaterialRcvdDate = $("#MaterialRcvdDate"+i).val();
+
+
+
$("#EditRevenueSplPOModel").modal("show");
- $(".oldimage").text(file);
- $("#hideoldfile").val(file);
- $("#hidebillno").val(Billno);
+
+}
+
+
+
+
+function openbillmodel(i){
+
+ //alert(i);
+ var file = $("#file"+i).val();
+ //alert(file);
+ var Billno = $("#billnos"+i).val();
+ //alert(Billno);
+
+ $("#hideoldfile").val(file);
+ $("#hidebillno").val(Billno);
+ $("#billModel").modal("show");
+
+
$("#bill").text(Billno);
}
@@ -5848,40 +5930,21 @@ $("#Date").datepicker();
function splpoupdate(){
- var formData = new FormData();
-
- // var file = $("#images").prop('files')[0];
- // console.log(file);
- var param1 = $('#hidebillno').val();
- var param2 = $('#hideoldfile').val();
- // var filename = $("#imag").val();
- // filename = filename.split('\\');
-
- var param8 =$('#imag').prop('files')[0];
-
- // console.log(param8);
- var param3 =$('#ChallanInvNo').val();
- var param4 =$('#PODate1').val();
- //alert(param4);
- var param5 =$('#VehicleNo').val();
- var param6 =$('#CourierNo').val();
- var param7 =$('#MaterialRcvdDate').val();
+ var formData = new FormData();
+ var file = $("#billimag").prop('files')[0];
+ var param1 = $('#hidebillno').val();
+ var param2 = $('#hideoldfile').val();
+
+ // var filename = $("#billimag").val();
+ // filename = filename.split('\\');
-
- //formData.append('file',file);
- formData.append('param1',param1);
- formData.append('param2',param2);
-
- formData.append('param3',param3);
- formData.append('param4',param4);
- formData.append('param5',param5);
- formData.append('param6',param6);
- formData.append('param7',param7);
- formData.append('param8',param8);
-
+ formData.append('file',file);
+ formData.append('param1',param1);
+ formData.append('param2',param2);
+
$('.content').loader('show');
@@ -5896,6 +5959,59 @@ function splpoupdate(){
if(data){
alert(data);
$('.content').loader('hide');
+ // $('#spl').find('td').eq(5).text(filename[2]);
+ $('#billModel').modal('hide');
+ }
+
+ }
+ });
+
+}
+
+
+
+
+function splupdate(){
+
+
+ var formData = new FormData();
+
+
+
+ var param1 =$('#ChallanInvNo').val();
+ var param2 =$('#InvDate').val();
+ var param3 =$('#VehicleNo').val();
+ var param4 =$('#CourierNo').val();
+ var param5 =$('#MaterialRcvdDate').val();
+ var param6 =$('#txtPONO').val();
+ var param7 =$('#igrno').val();
+
+
+
+
+
+ formData.append('param1',param1);
+ formData.append('param2',param2);
+ formData.append('param3',param3);
+ formData.append('param4',param4);
+ formData.append('param5',param5);
+ formData.append('param6',param6);
+ formData.append('param7',param7);
+
+
+ $('.content').loader('show');
+ $.ajax({
+ data:formData,
+ type:"POST",
+ url:"purchaseorder/splpodata",
+ cache : false,
+ contentType : false,
+ processData : false,
+ success:function(data) {
+ if(data){
+ alert(data);
+ window.location.reload();
+ $('.content').loader('hide');
// $('#spl').find('td').eq(5).text(filename[2]);
$('#EditRevenueSplPOModel').modal('hide');
}
@@ -5905,20 +6021,24 @@ function splpoupdate(){
}
-function fileupload()
+function fileupload(counter)
{
var formData = new FormData();
- var file = $("#images").prop('files')[0];
- //console.log(file);
- var param1 =$('#images').prop('files')[0];
+ var file = $("#images"+counter).prop('files')[0];
+ // console.log(file);
+
var PONO =$('#txtPONO').val();
+ var igr =$('#hiddenigrno').val();
+ //alert(igr);
- formData.append('param1',param1);
+
+ formData.append('file',file);
formData.append('PONO',PONO);
-
+ formData.append('count',counter);
+ formData.append('igr',igr);
$('.content').loader('show');
$.ajax({
@@ -5931,9 +6051,10 @@ function fileupload()
success:function(data) {
if(data){
alert(data);
+ window.location.reload();
$('.content').loader('hide');
// $('#spl').find('td').eq(5).text(filename[2]);
- $('#EditRevenueSplPOModel').modal('hide');
+ $('#billModel').modal('hide');
}
}
@@ -5943,8 +6064,8 @@ function fileupload()
function filecheck()
{
-var sizef = document.getElementById('imag').files[0].size;
- var file = $('#imag').val();
+var sizef = document.getElementById('billimag').files[0].size;
+ var file = $('#billimag').val();
if(file!='' && sizef < 2100000)
{ // alert('Your file added successfully');
@@ -5952,7 +6073,7 @@ var sizef = document.getElementById('imag').files[0].size;
else
{
alert('Sorry Your File is Large To 2MB');
- $('#imag').val('');
+ $('#billimag').val('');
}
}
@@ -5976,13 +6097,14 @@ $("#addmorebutton").click(function(){
// }
// else{
- // counter++;
- // counterConstant++;
+ counter++;
+
var div = document.createElement('div');
div.id = "divid";
div.className="row";
+//alert(counter);
div.innerHTML='
'+
// '
'+
// '
'+
@@ -5990,7 +6112,7 @@ div.innerHTML='
'+
// '
'+
'
'+
''+
- '
'+
+ '
'+
'
'+
// '
'
// '
'+
@@ -6020,10 +6142,10 @@ var file = $('#images').val();
if (file=='')
{
alert('File not found');
- fileupload();
+
}
else{
- fileupload();
+ fileupload(counter);
}
}
diff --git a/application/views/includes/header.php b/application/views/includes/header.php
index eba89211..d3cc01ac 100755
--- a/application/views/includes/header.php
+++ b/application/views/includes/header.php
@@ -399,7 +399,24 @@ display: none;
+
+
+
+ Store Details
+
+
+
+
+
+
+
+
+ Store Details
+
+
+
+
+
diff --git a/uploads/BillFiles/AV-Travel-Logo.png b/uploads/BillFiles/AV-Travel-Logo.png
deleted file mode 100755
index 31375424..00000000
Binary files a/uploads/BillFiles/AV-Travel-Logo.png and /dev/null differ
diff --git a/uploads/Igrfiles/Screenshot_from_2018-04-24_14-32-24.png b/uploads/Igrfiles/Screenshot_from_2018-04-24_14-32-24.png
new file mode 100644
index 00000000..e4db4c61
Binary files /dev/null and b/uploads/Igrfiles/Screenshot_from_2018-04-24_14-32-24.png differ