IMPORT DELETE OPTION
This commit is contained in:
parent
d7784099c8
commit
08054795a0
@ -1451,6 +1451,8 @@ public function mririmportpoprint($PONO)
|
||||
function DeletePODetails()
|
||||
{
|
||||
|
||||
//echo "vffv";
|
||||
//die();
|
||||
$ReqList= $this->input->post('id');
|
||||
$LineItemNo = '';
|
||||
$ReqNo ='';
|
||||
@ -1463,8 +1465,8 @@ public function mririmportpoprint($PONO)
|
||||
$MaterialCode = $ReqList[2];
|
||||
$POType = $ReqList[3];
|
||||
}
|
||||
// print_r($ReqList);
|
||||
|
||||
print_r($ReqList);
|
||||
// die();
|
||||
|
||||
If($POType == REVENUE)
|
||||
{
|
||||
@ -1481,7 +1483,7 @@ public function mririmportpoprint($PONO)
|
||||
else If($POType == CAPITAL)
|
||||
{
|
||||
$this->purchaseorder_model->DeletePOImportTax($LineItemNo);
|
||||
$this->purchaseorder_model->DeletePOServiceTax($LineItemNo);
|
||||
$this->purchaseorder_model->DeletePOServiceTax($LineItemNo);
|
||||
}
|
||||
$this->purchaseorder_model->DeletePOLineItem($LineItemNo , $ReqNo,$MaterialCode);
|
||||
echo "Successfully Deleted the Line item".$LineItemNo;
|
||||
|
||||
@ -4810,41 +4810,163 @@ TotalOrdervalue=parseFloat(TotalOrdervalue)+parseFloat(Totalvalue);
|
||||
|
||||
|
||||
|
||||
// function DeleteRow(rowid)
|
||||
// { //alert('Delete');
|
||||
// var DelRows = $('#txtDeletedRow').val();
|
||||
// var answer = confirm(" Do you want to delete the Item from the List?")
|
||||
// if (answer)
|
||||
// {
|
||||
// //alert('Confirm');
|
||||
// var td = document.getElementById(rowid);
|
||||
// td.parentNode.removeChild(td);
|
||||
|
||||
// var removeItem = $('#materialCode'+rowid).val();
|
||||
|
||||
|
||||
|
||||
// SelectedMaterialCode.splice( SelectedMaterialCode.indexOf('removeItem'), 1 );
|
||||
// $.each(SelectedMaterialList.Mat, function(i, el){
|
||||
|
||||
// if (this.materialCode == removeItem){//Type = '';
|
||||
// SelectedMaterialList.Mat.splice(i, 1);
|
||||
// }
|
||||
// });
|
||||
// // alert(SelectedMaterialCode);
|
||||
// if(DelRows != '')
|
||||
// {
|
||||
// DelRows = DelRows + ":" + rowid;
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// DelRows= "0" + ":" + rowid;
|
||||
// }
|
||||
// $('#txtDeletedRow').val(DelRows);
|
||||
// populateValueMainFormForDeleteItem(rowid);
|
||||
// }
|
||||
|
||||
// }
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
var DeletedMaterialCode='';
|
||||
var DeletedMaterialName='';
|
||||
function DeleteRow(rowid)
|
||||
{ //alert('Delete');
|
||||
var DelRows = $('#txtDeletedRow').val();
|
||||
var answer = confirm(" Do you want to delete the Item from the List?")
|
||||
if (answer)
|
||||
{
|
||||
//alert('Confirm');
|
||||
var td = document.getElementById(rowid);
|
||||
td.parentNode.removeChild(td);
|
||||
{
|
||||
|
||||
var id = [];
|
||||
var DelRows = $('#txtDeletedRow').val();
|
||||
|
||||
var tr = document.getElementById(rowid);
|
||||
|
||||
var MaterialCode = $('#materialCode'+rowid).val();
|
||||
var LineItemNo =$('#LineItemNo'+rowid).val();
|
||||
var ReqNo =$('#Reqnumber'+rowid).val();
|
||||
var POType ='<?php echo IMPORT ?>';
|
||||
id[0]= LineItemNo;
|
||||
id[1]= ReqNo;
|
||||
id[2]= MaterialCode;
|
||||
id[3]= POType;
|
||||
|
||||
|
||||
var answer = confirm(" Do you want to delete the Item from the List?")
|
||||
if (answer)
|
||||
{
|
||||
populateValueMainFormForDeleteItem(rowid);
|
||||
tr.parentNode.removeChild(tr);
|
||||
|
||||
var removeItem = $('#materialCode'+rowid).val();
|
||||
|
||||
|
||||
|
||||
SelectedMaterialCode.splice( SelectedMaterialCode.indexOf('removeItem'), 1 );
|
||||
$.each(SelectedMaterialList.Mat, function(i, el){
|
||||
|
||||
if (this.materialCode == removeItem){//Type = '';
|
||||
SelectedMaterialList.Mat.splice(i, 1);
|
||||
var removeItem = $('#materialCode'+rowid).val();
|
||||
|
||||
var materialCode = $('#materialCode'+rowid).val();
|
||||
|
||||
|
||||
var removeItem = $('#materialCode'+rowid).val();
|
||||
var Material = <?php echo json_encode($MaterialList, JSON_PRETTY_PRINT) ?>;
|
||||
for(i=0;i<Material.length;i++)
|
||||
{
|
||||
$.each(Material[i], function (index, value) {
|
||||
|
||||
|
||||
if (value.MaterialCode==materialCode) {
|
||||
|
||||
|
||||
// $("#MaterialCode").append( $('<option></option>').val(value.MaterialCode).html(value.MaterialCode + "-" + value.MaterialName) );
|
||||
DeletedMaterialCode = $('#materialCode'+rowid).val();
|
||||
DeletedMaterialName = $('#materialName'+rowid).val();
|
||||
}
|
||||
});
|
||||
// alert(SelectedMaterialCode);
|
||||
if(DelRows != '')
|
||||
{
|
||||
DelRows = DelRows + ":" + rowid;
|
||||
}
|
||||
else
|
||||
{
|
||||
DelRows= "0" + ":" + rowid;
|
||||
}
|
||||
$('#txtDeletedRow').val(DelRows);
|
||||
populateValueMainFormForDeleteItem(rowid);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
SelectedMaterialCode.splice( SelectedMaterialCode.indexOf('removeItem'), 1 );
|
||||
var x = <?php echo json_encode($POItem, JSON_PRETTY_PRINT) ?>;
|
||||
|
||||
var result = '0';
|
||||
$.each(x, function(idx, obj) {
|
||||
|
||||
if(obj.LineItemNo === LineItemNo)
|
||||
{
|
||||
result = '1';
|
||||
return false;
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
// alert(result);
|
||||
if(result == '0')
|
||||
{
|
||||
var DelRows = $('#txtDeletedRow').val();
|
||||
//tr.parentNode.removeChild(tr);
|
||||
if(DelRows != '')
|
||||
{
|
||||
DelRows = DelRows + ":" + rowid;
|
||||
}
|
||||
else
|
||||
{
|
||||
DelRows= "0" + ":" + rowid;
|
||||
}
|
||||
$('#txtDeletedRow').val(DelRows);
|
||||
}
|
||||
// To delete the value from Tables
|
||||
else if(result == '1')
|
||||
{
|
||||
var DelRows = $('#txtDeletedRow').val();
|
||||
//tr.parentNode.removeChild(tr);
|
||||
if(DelRows != '')
|
||||
{
|
||||
DelRows = DelRows + ":" + rowid;
|
||||
}
|
||||
else
|
||||
{
|
||||
DelRows= "0" + ":" + rowid;
|
||||
}
|
||||
$('#txtDeletedRow').val(DelRows);
|
||||
|
||||
$.ajax({
|
||||
data:{id:id},
|
||||
type:"POST",
|
||||
url:"<?php echo base_url() ?>purchaseorder/DeletePODetails",
|
||||
success:function(data) {
|
||||
if(data)
|
||||
{
|
||||
$('#content').loader('hide');
|
||||
alert(data);
|
||||
}
|
||||
else
|
||||
{
|
||||
alert("Error");
|
||||
}
|
||||
|
||||
}});
|
||||
}
|
||||
|
||||
// populateValueMainFormForDeleteItem(rowid);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -4874,7 +4996,7 @@ var AfterExcisedutyTax=$('#AfterExciseDuty'+rowid).val()==''?'0.00':$('#AfterExc
|
||||
var AfterExcisedutyEDcess=$('#AfterExciseDutyEdCess'+rowid).val()==''?'0.00':$('#AfterExciseDutyEdCess'+rowid).val();
|
||||
var AfterExciseDutySH=$('#AfterExciseDutySHCess'+rowid).val()==''?'0.00':$('#AfterExciseDutySHCess'+rowid).val();
|
||||
var AfterAdditionalExciseduty=$('#AfterAddlExciseDuty'+rowid).val()==''?'0.00':$('#AfterAddlExciseDuty'+rowid).val();
|
||||
var AfterCustomEDcess=$('#AfterCustomEdCess'+rowid).val()==''?'0.00':$('#AfterCustomEdCess'+rowid).val();
|
||||
var AfterCustomEDcess=$('#AfterCustomEDcess'+rowid).val()==''?'0.00':$('#AfterCustomEDcess'+rowid).val();
|
||||
var AfterCustomSHcess=$('#AfterCustomSHCess'+rowid).val()==''?'0.00':$('#AfterCustomSHCess'+rowid).val();
|
||||
var AdditionalExciseduty=$('#AfterAddlExciseDuty'+rowid).val()==''?'0.00':$('#AfterAddlExciseDuty'+rowid).val();
|
||||
var Grossdutypayable=$('#Grossdutypayable'+rowid).val()==''?'0.00':$('#Grossdutypayable'+rowid).val();
|
||||
@ -4912,6 +5034,7 @@ TotalOrderValue=parseFloat(TotalOrderValue)-parseFloat(totalExp);
|
||||
$('#txttotalavlmodvat').val(parseFloat(TotalAvlmodvat).toFixed(2));
|
||||
$('#txttotalgrossexpense').val(parseFloat(TotalGrossExpense).toFixed(2));
|
||||
$('#txtToatlOrder').val(parseFloat(TotalOrderValue).toFixed(2));
|
||||
$('#txttot').val(parseFloat(TotalOrderValue).toFixed(2));
|
||||
|
||||
|
||||
|
||||
|
||||
@ -432,7 +432,7 @@ function vaildateBeforeOpenModal()
|
||||
|
||||
<?php
|
||||
|
||||
|
||||
$optionsPay = array("0"=>'Select Payment method');
|
||||
|
||||
if(!empty($Payment))
|
||||
{
|
||||
@ -2188,7 +2188,7 @@ function Ratechange(){
|
||||
var txtEditQuantity=parseFloat($('#EditQuantity').val());
|
||||
var txtEditUnitPrice=parseFloat($('#EditRate').val());
|
||||
var EditTot=txtEditQuantity*txtEditUnitPrice;
|
||||
console.log(EditTot);
|
||||
// console.log(EditTot);
|
||||
$('#EdittxtBasicValue').val(EditTot);
|
||||
var EditBasicINR=EditTot*txtexchangerate;
|
||||
$('#AfterBasicPriceTax').val(txtINR);
|
||||
@ -3067,11 +3067,11 @@ function CalculateCtable()
|
||||
}
|
||||
quantity=parseFloat($('#Quantity').val());
|
||||
basicprice=parseFloat($('#txtBasicValue').val());
|
||||
console.log(basicprice);
|
||||
// console.log(basicprice);
|
||||
$('#TotalExp').val((basicprice).toFixed(2));
|
||||
|
||||
var a=$('#TotalExp').val();
|
||||
console.log(a);
|
||||
//console.log(a);
|
||||
total=<?php echo CALCULATE_TOTAL;?>;
|
||||
// if(isNaN(total))
|
||||
// {
|
||||
@ -3101,7 +3101,7 @@ function EditCalculateCtable()
|
||||
var total=0;
|
||||
var basicamt=0;
|
||||
basicamt=parseFloat($('#EdittxtBasicValue').val());
|
||||
console.log(basicamt);
|
||||
//console.log(basicamt);
|
||||
quantity=parseFloat($('#EditPurQuantity').val());
|
||||
txtbasicinrprice=parseFloat($('#EditAfterBasicPriceTax').val());
|
||||
//txtpurchaserate=txtbasicinrprice/txtCtablequantity;
|
||||
@ -3469,7 +3469,7 @@ $("#editimportpomodel").on("shown.bs.modal", function(e) {
|
||||
$('#EditItemName').val($('#materialName'+userid).val());
|
||||
$('#EditUOM').val($('#uom'+userid).val());
|
||||
var uom=parseFloat($('#uom'+userid).val());
|
||||
console.log(uom);
|
||||
//console.log(uom);
|
||||
$('#EditQuantity').val($('#quantity'+userid).val());
|
||||
//RequistQuantity = $('#quantity'+userid).val();
|
||||
$('#EditRate').val($('#itemRate'+userid).val());
|
||||
@ -3691,7 +3691,7 @@ function populateValueMainFormForEditImportTax()
|
||||
var rowid = cells[0].innerHTML;
|
||||
|
||||
var AfterLandingCharge= $('#AfterLandingChargee'+rowid).val() == '' ? '0.00' : $('#AfterLandingChargee'+rowid).val();
|
||||
console.log(AfterLandingCharge);
|
||||
//console.log(AfterLandingCharge);
|
||||
var AfterHighseas=$('#AfterHighseass'+rowid).val()==''?'0.00':$('#AfterHighseass'+rowid).val();
|
||||
var AfterCustomduty=$('#AfterCustomduty'+rowid).val()==''?'0.00':$('#AfterCustomduty'+rowid).val();
|
||||
var AfterExcisedutyTax=$('#AfterExcisedutyTax'+rowid).val()==''?'0.00':$('#AfterExcisedutyTax'+rowid).val();
|
||||
@ -3807,7 +3807,7 @@ function populateValueMainFormForDeleteItem(rowid)
|
||||
var TotalAvlmodvat=$('#txttotalavlmodvat').val();
|
||||
var TotalGrossExpense=$('#txttotalgrossexpense').val();
|
||||
var TotalOrderValue=$('#txtToatlOrder').val();
|
||||
console.log(TotalLanding);
|
||||
//console.log(TotalLanding);
|
||||
var AfterLandingCharge= $('#AfterLandingChargee'+rowid).val() == '' ? '0.00' : $('#AfterLandingChargee'+rowid).val();
|
||||
//console.log(AfterLandingCharge);
|
||||
var AfterHighseas=$('#AfterHighseass'+rowid).val()==''?'0.00':$('#AfterHighseass'+rowid).val();
|
||||
|
||||
Loading…
Reference in New Issue
Block a user