AMEND CAPITAL PO

This commit is contained in:
velz2020 2017-07-26 17:15:00 +05:30
parent bf2ff73220
commit 9c6f5ca3af
4 changed files with 607 additions and 97 deletions

View File

@ -653,9 +653,10 @@ function UpdateAmendServicePurchaseOrder()
{
//echo "WELCOME-";
$PONO =$this->input->post('txtPONO');
//echo $PONO."--";
$MAD='';
$POdt =$this->input->post('PODate');
$PODate = $this->getDateformat($POdt);
@ -664,9 +665,10 @@ function UpdateAmendServicePurchaseOrder()
$dt = $this->input->post('Deliverydt');
$POType = $this->input->post('POType');
$PoRange = $this->input->post('txtPoRange');
$PoRange = $this->input->post('capitalType');
$DeliveryOption = $this->input->post('DateRange');
$Deliverydt = '';
if($DeliveryOption==1){
$Deliverydt = '';
$DeliverySchedule = $this->input->post('Scheduleby');
@ -676,6 +678,28 @@ function UpdateAmendServicePurchaseOrder()
$DeliverySchedule = '';
}
$predispatch=$this->input->post('beforeDisins');
$curdispatch=$this->input->post('Dispatch');
$PaymentMethod = $this->input->post('PaymentMethod');
$prePaymentmethod=$this->input->post('beforePaymentmethod');
$DeliverySchedule = $this->input->post('Scheduleby');
$preDeliverySchedule = $this->input->post('beforeSchedule');
$PlaceOforigin = $this->input->post('PlaceOforigin');
if($PaymentMethod != $prePaymentmethod)
{
$MAD.="Amended Paymemnt Terms :&nbsp;&nbsp;" .$prePaymentmethod."<br>";
}
if($predispatch != $curdispatch)
{
$MAD.="Amended Dispatch Instruction :&nbsp;&nbsp;" .$predispatch."<br>";
}
if($DeliverySchedule != $preDeliverySchedule)
{
$MAD.="Amended Schedule :&nbsp;&nbsp;" .$preDeliverySchedule."<br>";
}
//echo "<br><br>" . $MAD;
$capitalType = $this->input->post('capitalType');
$currencytypeID = $this->input->post('currencytype');
if($capitalType=='1'){
@ -690,11 +714,11 @@ function UpdateAmendServicePurchaseOrder()
$ExchangeRateOn = $this->input->post('ExchangeRateOn');
$ExchangeRate=$this->input->post('ExchangeRt');
}
$PaymentMethod = $this->input->post('PaymentMethod');
$PayableAT = $this->input->post('PayableAT');
// $PayableAT = $this->input->post('PayableAT');
$PaymentDate=$this->input->post('PaymentDate');
//$PaymentDate=$this->input->post('PaymentDate');
$SpcialInstruction = $this->input->post('txtSpcialInstruction');
$TotalOrder = $this->input->post('CapitalToatlOrder');
$POStatus = $this->input->post('txtStatus');
@ -702,26 +726,28 @@ function UpdateAmendServicePurchaseOrder()
$CreateBy = $this->session->userdata ( 'userId' );
$RowCount = $this->input->post('txtRowCount');
//echo $RowCount;
$dt = new DateTime('now', new DateTimeZone('Asia/Kolkata'));
$createddt = $dt->format('Y-m-d H:i:s');
$updateddt = $dt->format('Y-m-d H:i:s');
$POMaster = array('ParentPO'=>$PONO,'SupplierID'=>$SupplierID, 'TotalOrderValue'=>$TotalOrder,'POType'=>$POType,'PODate'=>$PODate,'Status'=>$POStatus,'PORange'=>$PoRange,'ExchangeRate'=>$ExchangeRate,'ExchangeRateCalculatedon'=>$ExchangeRateOn,'PaymentTerms'=>$PaymentMethod,'PaymentDays'=>$PaymentDate,'PayableAt'=>$PayableAT,'ServiceDescription'=>$SpcialInstruction,'CreatedBy'=>$CreateBy,'DeliveryAddress'=>$DeliveryAddr,'DeliveryDate'=>$Deliverydt,'CreatedDate'=>$createddt,'DeliverySchedule'=>$DeliverySchedule,'DeliveryOption'=>$DeliveryOption,'CurrencyType'=>$currencytypeID);
$POMaster = array('ParentPO'=>$PONO,'SupplierID'=>$SupplierID, 'TotalOrderValue'=>$TotalOrder,'POType'=>$POType,'PODate'=>$PODate,'Status'=>PO_RELEASED,'CapitalRange'=>$PoRange,'ExchangeRate'=>$ExchangeRate,'ExchangeRateCalculatedon'=>$ExchangeRateOn,'PaymentTerms'=>$PaymentMethod,'ServiceDescription'=>$SpcialInstruction,'CreatedBy'=>$CreateBy,'DeliveryAddress'=>$DeliveryAddr,'DeliveryDate'=>$Deliverydt,'CreatedDate'=>$createddt,'DeliverySchedule'=>$DeliverySchedule,'DeliveryOption'=>$DeliveryOption,'CurrencyType'=>$currencytypeID,'AmendedDetails'=>$MAD,'Import_DispatchDetails'=>$curdispatch,'Import_PlaceofOrgin'=>$PlaceOforigin);
//print_r($POMaster);
$LastPO = $this->purchaseorder_model->addAmendPOMaster($POMaster,$CreateBy,$PONO);
foreach($LastPO as $PO):
foreach($LastPO as $PO):
$NewPO=$PO['PONO'];
endforeach;
//echo "NEW PO IS " . $NewPO."</br>";
//echo "";
$PODetail=array('Status'=>"ST030");//TO SET PARENT PO AS AMENDMENT STATUS
// echo "NEW PO IS " . $NewPO."</br>";
$PODetail=array('Status'=>PO_AMENDED);//TO SET PARENT PO AS AMENDMENT STATUS
//print_r($PODetail);
$APO=$this->purchaseorder_model->updateAmendPOMaster($PONO,$PODetail);
//echo $APO."Affected</br>";
$APO=$this->purchaseorder_model->updateAmendPOMaster($PONO,$PODetail);
// echo $APO."Affected</br>";
$LineItemStatus = REQITEM_NEW;
@ -732,10 +758,13 @@ function UpdateAmendServicePurchaseOrder()
for ($i = 1; $i <= $RowCount; $i++)
{
$MaterialCode = $this->input->post('materialCode'.$i);
$CAD='';
$MaterialCode = $this->input->post('materialCode'.$i);
$Quantity = $this->input->post('quantity'.$i);
$preQuantity = $this->input->post('beforequantity'.$i);
$Reqnumber = $this->input->post('Reqnumber'.$i);
$itemRate = $this->input->post('itemRate'.$i);
$preitemRate = $this->input->post('itemRate'.$i);
$itemRate = $this->input->post('rateInUs'.$i);
$Exchangerate = $this->input->post('echangeRate'.$i);
$BasicPriceinmton = $this->input->post('rateInUs'.$i);
@ -778,41 +807,89 @@ function UpdateAmendServicePurchaseOrder()
//echo $BasicPriceinmton;
$CostCenter = $this->input->post('CPCostCode'.$i);
$ServiceTax = $this->input->post('AfterServiceTax'.$i);
$EduCess = $this->input->post('AfterEduCess'.$i);
$SecHighTax = $this->input->post('AfterSecHighTax'.$i);
$KrishiTax = $this->input->post('AfterKrishiTax'.$i);
$SwachhTax = $this->input->post('AfterSwachhTax'.$i);
$TotalOrderValue = $this->input->post('TotalOrderValue'.$i);
$POLineItemNo = $this->input->post('LineItemNo'.$i);
$SGST = $this->input->post('SGST'.$i);
$preSGST = $this->input->post('beforeSGST'.$i);
$CGST = $this->input->post('CGST'.$i);
$preCGST = $this->input->post('beforeCGST'.$i);
$IGST = $this->input->post('IGST'.$i);
$preIGST = $this->input->post('beforeIGST'.$i);
$SGSTvalue=$this->input->post('afterSGST'.$i);
$preSGSTvalue=$this->input->post('beforeSGSTvalue'.$i);
$CGSTvalue=$this->input->post('afterCGST'.$i);
$preCGSTvalue=$this->input->post('beforeCGSTvalue'.$i);
$IGSTvalue=$this->input->post('afterIGST'.$i);
$preIGSTvalue=$this->input->post('beforeIGSTvalue'.$i);
$otherallowance=$this->input->post('otherallowance'.$i);
$preotherallowance=$this->input->post('beforeotherallowance'.$i);
$TotalServiceOrderValue = $this->input->post('totalservicevalue'.$i);
$POLineItemNo = $this->input->post('LineItemNo'.$i);
$rowspanvalue=0;
if($Quantity != $preQuantity)
{
$rowspanvalue++;
$CAD.="<tr><td>Amended Qty :&nbsp;" . $preQuantity ."</td><td>Current Qty :&nbsp;" . $Quantity . "</td></tr>";
}
if($itemRate != $preitemRate)
{
$rowspanvalue++;
$CAD.="<tr><td>Amended Rate :&nbsp;" . $preitemRate ."</td><td>Current Rate :&nbsp;" . $itemRate . "</td></tr>";
}
if(($SGST != $preSGST) && ($SGSTvalue != $preSGSTvalue))
{
$rowspanvalue+=2;
$CAD.="<tr><td>Amended SGST :&nbsp;" . $preSGST ."</td><td>Current SGST :&nbsp;" . $SGST . "</td></tr><tr><td>Amended SGST value :&nbsp;" . $preSGSTvalue ."</td><td>Current SGST value:&nbsp;" . $SGSTvalue . "</td></tr>";
}
if(($CGST != $preCGST) && ($CGSTvalue != $preCGSTvalue))
{
$rowspanvalue+=2;
$CAD.="<tr><td>Amended CGST :&nbsp;" . $preCGST ."</td><td>Current CGST :&nbsp;" . $CGST . "</td></tr><tr><td>Amended CGST value :&nbsp;" . $preCGSTvalue ."</td><td>Current CGST value:&nbsp;" . $CGSTvalue . "</td></tr>";
}
if(($IGST != $preIGST) && ($IGSTvalue != $preIGSTvalue))
{
$rowspanvalue+=2;
$CAD.="<tr><td>Amended IGST :&nbsp;" . $preIGST ."</td><td>Current IGST :&nbsp;" . $IGST . "</td></tr><tr><td>Amended IGST value :&nbsp;" . $preIGSTvalue ."</td><td>Current IGST value:&nbsp;" . $IGSTvalue . "</td></tr>";
}
if($otherallowance != $preotherallowance)
{
$rowspanvalue++;
$CAD.="<tr><td>Amended OtherAllowances :&nbsp;" . $preotherallowance ."</td><td>Current OtherAllowances :&nbsp;" . $otherallowance . "</td></tr>";
}
if($rowspanvalue>0)
{
$rowspanvalue++;
$CAD2='';
$CAD2=$CAD;
$CAD='';
$CAD="<tr><td rowspan=". $rowspanvalue .">".$MaterialCode."</td></tr>";
$CAD.=$CAD2;
}
$POLineItemList = array('PONO'=>$NewPO, 'ReqNo'=>$Reqnumber,'MaterialCode'=>$MaterialCode,'Quantity'=>$Quantity,'Rate'=>$itemRate,'Status'=>$LineItemStatus,'CreatedBy'=>$CreateBy,'CreatedDate'=>$createddt,'CostCenterCode'=>$CostCenter);
// print_r($POLineItemList);
$POLineItemList = array('PONO'=>$NewPO, 'ReqNo'=>$Reqnumber,'MaterialCode'=>$MaterialCode,'Quantity'=>$Quantity,'Rate'=>$itemRate,'Status'=>$LineItemStatus,'CreatedBy'=>$CreateBy,'CreatedDate'=>$createddt,'CostCenterCode'=>$CostCenter,'AmendedDetails'=>$CAD);
//print_r($POLineItemList);
$POLineItem = $this->purchaseorder_model->addPOLineItem($POLineItemList);
$LineItemNo = '';
// if(count($POLineItem)>0)
// {
foreach($POLineItem as $line):
$LineItemNo = $line['LineItemNo'];
endforeach;
//echo $LineItemNo;
//}
//echo $LineItemNo;
//echo $LineItemNo;
if(trim($POType) == CAPITAL )
{
$ServiceTaxList = array('LineItemNo'=>$LineItemNo, 'ServiceTax'=>$ServiceTax,'EducessTax'=>$EduCess,'SecHigherEducessTax'=>$SecHighTax,'KrishiKalyantax'=>$KrishiTax,'SwachhBharattax'=>$SwachhTax,'TotalValue'=>$TotalOrderValue, 'CreatedBy'=>$CreateBy,'CreatedDate'=>$createddt);
$ServiceTaxList = array('LineItemNo'=>$LineItemNo, 'CGST'=>$CGST,'After_CGST'=>$CGSTvalue,'SGST'=>$SGST,'After_SGST'=>$SGSTvalue,'IGST'=>$IGST,'After_IGST'=>$IGSTvalue, 'otherallowance'=>$otherallowance,'TotalValue'=>$TotalServiceOrderValue,'CreatedBy'=>$CreateBy,'CreatedDate'=>$createddt);
//print_r($ServiceTaxList);
$ServiceTax = $this->purchaseorder_model->addServiceTax($ServiceTaxList);
//echo "Service";
//print_r($ServiceTax);
$ImportTaxList = array('LineItemNo'=>$LineItemNo, 'BasicPriceInMTon'=>$BasicPriceinmton,'ProductPrice'=>$Productprice,'LandingCharge'=>$LandingCharge,'AfterLandingCharge'=>$AfterLandingCharge,'AfterHighSeasSalesCharge'=>$AfterHighSeas,'HighSeasSalesCharge'=>$HighSeas,'CustomDuty'=>$CustomDuty,'AfterCustomDuty'=>$AfterCustomDuty,'ExciseDuty'=>$ExciseDuty,'AfterExciseDuty'=>$AfterExciseDuty,'ExciseDutyEdCess'=>$ExciseDutyEd,'AfterExciseDutyEdCess'=>$AfterExciseDutyEd,'ExciseDutySHCess'=>$ExciseDutySH,'CustomEdCess'=>$CustomEd,'CustomSHCess'=>$CustomSH,'AddlExciseDuty'=>$AddAdtional,'CreatedBy'=>$CreateBy,'CreatedDate'=>$createddt,'AfterExciseDutySHCess'=>$AfterExciseDutySH,'AfterAddlExciseDuty'=>$AfterAddAdtional,'Grossdutypayable'=>$Grossdutypayable,'AvailableModvat'=>$AvailableModvat,'Grossexpensesduetocustomduty'=>$Grossexpensesduetocustomduty,'purchaseratePerKG'=>$purchaseratePerKG,'CustomDutyExpensesPerKG'=>$CustomDutyExpensesPerKG,'RMCIncludingCustomersPerKG'=>$RMCIncludingCustomersPerKG,'QuantityKG'=>$QuantityKG,'AfterCustomSHCess'=>$AfterCustomSH,'AfterCustomEdCess'=>$AfterCustomEd,'TotalValue'=>$Totalvalueitem);
//print_r($ImportTaxList);
//die();
@ -826,8 +903,7 @@ function UpdateAmendServicePurchaseOrder()
}
echo 'Purchase Order'.$PONO.'Amended Successfully! New PO Number Is: '.$NewPO ;
}
}
function EditAmendImportPO()
{
$MAD='';
@ -1429,6 +1505,78 @@ public function servicepoprint($PONO)
}
public function CapitalPoPrint($PONO)
{
// Load the pdf page with multiviews
$data['CompanyDetails'] = $this->purchaseorder_model->getCompanyInformation();
$data['POItem'] = $this->purchaseorder_model->GetCapitalAmendPurchaseOrderDetailsForprintPDF($PONO);
//print_r($data['POItem']);
$data['releasedetails'] = $this->purchaseorder_model->GetReleasedDetails($PONO);
$CurrencyType='';
if(!empty($data['POItem'])){
$CurrencyType=$data['POItem'][0]->CurrencyType;
}
if($CurrencyType=='' OR $CurrencyType=='0'){
$data['CurrencySymbol']=$this->purchaseorder_model->GerCurrencyCodeName('INR');
$TotalOrderValue=$data['POItem'][0]->TotalOrderValue;
echo $TotalOrderValue;
die();
$totalAmt=sprintf("%.2f", $TotalOrderValue);
$data['TotalAmountInWords']= $this->convertNumber($totalAmt);
}
else{
$data['CurrencySymbol']=$this->purchaseorder_model->GerCurrencyCodeName($CurrencyType);
$SymbolCurrency=$data['CurrencySymbol'][0]->FontCode2000;
$SymbolCurrencyName=$data['CurrencySymbol'][0]->Currency;
$PaiseVal=$data['CurrencySymbol'][0]->PaiseVal;
$TotalOrderValue=$data['POItem'][0]->TotalOrderValue;
$totalAmt=sprintf("%.2f", $TotalOrderValue);
// $data['TotalAmountInWords']= $this->convertNumberSymbol($totalAmt,$SymbolCurrency,$SymbolCurrencyName,$PaiseVal);
}
$data['RequistionDetails'] = $this->purchaseorder_model->GetPdfRequistionDetails($PONO);
$this->load->View("capitalamendpopdf", $data);
// Add header to pdf
//$this->load->view('includes/pdffooter');
// Get output html
$php = $this->output->get_output();
// Load library
$this->load->library('dompdf_gen');
// Convert to PDF
$this->dompdf->load_html($php);
$this->dompdf->render();
$data['Attachment'] = FALSE;
$this->dompdf->stream("CapitalPOReport.pdf",$data,$php);
}
public function convertNumber($number)

View File

@ -851,6 +851,32 @@ QuantityRejected,ROUND(ReceivedQuantity-QuantityRejected)as PendingQty,
}
function GetCapitalAmendPurchaseOrderDetailsForprintPDF($PONO = '')
{
//echo $PONO;
$subQuery ='SELECT distinct LineItem.PONO,LineItem.LineItemNo,SUP.SupplierName,SUP.Address,POMast.DeliveryAddress,POMast.DeliveryDate,POMast.PODate,POMast.DeliveryOption,POMast.ServiceDescription,POMast.PaymentTerms,POMast.Import_PlaceofOrgin,POMast.AmendedDetails,POMast.DeliverySchedule,Req.ReqNo,Mat.MaterialCode,Mat.MaterialName,LineItem.ServiceMaterialDescription,LineItem.ServiceFrequency,
Mat.UOM,Quantity,Rate,Req.Status,ROUND((ServiceTax.After_CGST + ServiceTax.After_SGST + ServiceTax.After_IGST + ServiceTax.otherallowance),2) as ServiceTaxamount
,ServiceTax.TotalValue,ServiceTax.CGST,ServiceTax.After_CGST,ServiceTax.SGST,ServiceTax.After_SGST,ServiceTax.IGST,ServiceTax.After_IGST,ServiceTax.otherallowance,
ROUND((RMCIncludingCustomersPerKG*Quantity),2)as Taxamount,LandingCharge,HighSeasSalesCharge,CustomDuty,ExciseDuty,ExciseDutyEdCess,CustomEdCess,POMast.ExchangeRate,POMast.ExchangeRateCalculatedon,POMast.TotalOrderValue as BasicValue,POMast.CapitalRange,AfterLandingCharge,AfterHighSeasSalesCharge,AfterCustomDuty,AfterExciseDuty,AfterExciseDutyEdCess,AddlExciseDuty,AfterAddlExciseDuty,Grossdutypayable,AvailableModvat,Grossexpensesduetocustomduty,purchaseratePerKG,CustomDutyExpensesPerKG,RMCIncludingCustomersPerKG,QuantityKG,BasicPriceInMTon,ProductPrice,CustomSHCess,AfterCustomSHCess,AfterExciseDutySHCess,ExciseDutySHCess,AfterCustomEdCess,ROUND((POMast.ExchangeRate*BasicPriceInMTon*Quantity),2) as BasicINRValue,Tax.TotalValue as ImportTotalValue,POMast.CurrencyType,
Req.CostCenterCode,Dept.DepartmentName FROM T_PurchaseOrder_LineItem LineItem
join T_PurchaseOrder_Master POMast on POMast.PONO = LineItem.PONO
join T_SupplierDetailsN SUP on SUP.SupplierID=POMast.SupplierID
join T_MaterialMaster Mat on Mat.MaterialCode = LineItem.MaterialCode
join T_Service_Tax ServiceTax on ServiceTax.LineItemNo = LineItem.LineItemNo
join T_Import_Tax Tax on Tax.LineItemNo = LineItem.LineItemNo
join T_Requestion_Master Req on Req.ReqNo = LineItem.ReqNo
join T_Employee_Details emp on Req.Requestedby = emp.EmpID
join T_DepartmentDetails Dept on emp.Departmentcode = Dept.DEPCode where LineItem.PONO =?';
$query = $this->db->query($subQuery,array($PONO));
//print_r ($query->result());
return $query->result();
}

View File

@ -0,0 +1,309 @@
<?php
$PONO = '';
$postatus ='';
$CompanyAddress = '';
$CompanyName = '';
$SuplierName = '';
$SuplierAddress = '';
$DeliveryAddress = '';
$Podt = '';
$DeliveryDate ='';
$postatus='';
$ServiceDescription = '';
$PaymentTerms = '';
$PaymentDays='';
$PayableAT='';
$DeliverySchedule='';
$Import_DispatchDetails='';
$Placeoforigin='';
$TotalAmountInWords='';
if(!empty($CompanyDetails))
{
foreach ($CompanyDetails as $CO)
{
$CompanyName = $CO->CompanyName;
$CompanyAddress = $CO->Address;
}
}
if(!empty($POItem))
{
foreach ($POItem as $PO)
{
$PONO = $PO->PONO;
$postatus= $PO->Status;
$SuplierName = $PO->SupplierName;
$SuplierAddress = $PO->Address;
$DeliveryAddress = $PO->DeliveryAddress;
$postatus= $PO->Status;
$dt = new DateTime($PO->PODate, new DateTimeZone('Asia/Kolkata'));
$Podt = $dt->format('d-m-Y');
if($PO->DeliveryOption=='1'){
$DeliveryDate = '';
$DeliverySchedule = $PO->DeliverySchedule;
$Import_DispatchDetails='';
}
else{
$dtDe = new DateTime($PO->DeliveryDate, new DateTimeZone('Asia/Kolkata'));
$DeliveryDate = $dtDe->format('d-m-Y');
$DeliverySchedule = '';
$Import_DispatchDetails=$PO->Import_DispatchDetails;
}
$ServiceDescription =$PO->ServiceDescription;
$PaymentTerms = $PO->PaymentTerms;
$Placeoforigin=$PO->Import_PlaceofOrgin;
}
}
$currencyName='INR';
$currencyCode ='';
if(!empty($CurrencySymbol))
{
foreach ($CurrencySymbol as $Curr)
{
$currencyCode = $Curr->FontCode2000;
//$currencyName = $currencyName;
}
}
?>
<style>
@page { margin: 280px 50px 30px 50px; }
.header { position: fixed; left: 0px; top: -280px; right: 0px; height: 550px;text-align: center; }
.footer { position: fixed; bottom: 0px; }
.pagenum:before { content: counter(page); }
</style>
<div class="footer">Page: <span class="pagenum"></span></div>
<div class="header">
<div style="text-align:right;">
<?php
if ($postatus == 'ST026')
{}
else
{
echo '<div><b>DRAFT</b> </div>';
}
?>
</div>
<center> <span style="font-size:24px;">PURCHASE ORDER - <a style="color:#515151">PO NO:<?php echo $PONO?> </a></span></center>
<table style="border-collapse: collapse;font-size:12px;" border="1" width="100%" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td colspan="2">
<p style="color:#3c8dbc;font-size:16px;"><strong><?php echo $CompanyName; ?></strong></p>
<p> <?php echo $CompanyAddress; ?></p>
</td>
<td align="right"><img width="100" height="100" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFAAAABQCAYAAACOEfKtAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAA11JREFUeNrsnT9IHEEYxWfFw8rgpUhlo5URi2gTbIUUSrq1ui4oRLRIY9JIKrGKTQrBgJLuuutEi4CtSSOpPIuATdIEcid2YpN9C3sc8c6bf7uZmX0P7k7ultm7337zzXxvZjGaiaIfQoiqoHTUHk6eniSPUbLQUmUoebojB23dDZGBmQiQAAmQAAmQIkACJEACpAiweA3bbvDV5mb6+iKOxfTc3MDjf15dicbBQfr3591d7wBGM1H0J3l9bNLI84UFsby6mkIzFWACJMCafJ9PJyfSx29vbHQuoqJaxl34zc5O+mVtwIPi5EIcXV52IjnoLvx+by/9wXkIF8aHbq0dgYi4vOB1Q7QV2c4BXM4Z3r+RGBTAR9VqmqhVBoZnIyOdx9taTXqQGJ+YUDqXFwBV4WGU69aXRkNsr69LtyEzHfIKIKJCVl9PT3u+/63P+6bnC64SuWm3jdsYn5xkKcdamCJAAiwjQJcHAC8ATs/OBg1Qy0y4ub6WPhb1cuPwUFycn9/77OPWlvXzeQGw2QPGQ9o/PhZrS0v3IPpooFrpwgChYniidq6fnTnvrBSaA3Uc3A/1uvPuSmEA0f0uFLsyBKcZDjaisvSj8DsFW6pbcHPQpV12WQoBCHhri4taEOGwhJAXjeeBgFebn1eyp0LKi1Ym0rCsXieRqLk06HVetFqJwHmWnRz3yotHzabT9n0hpRxGZ0SjjpGKCEQkxgUtWDlbCyMfIi/qTHMgrDf7srCem5mQDS5YQNKRD2vCuQLMhCVM3bwIiK4PLIUYqrp5EXPFeGWFALO8CEdGddId7NYOHWFQUa1cUO4Fty78/fZW6tFrjx7gqfqAT0PbmWAqVCwq+bDUOxMeyokh6L8B1J1kE2BgIkACJMDyAbSx56/cACV3CoyOjfX9rNSrcrI7E/qVYYCnYhKY3LXkJECVOdx+Us51m6Nwm7HVQyUCf4UGEJuFZPMgIhC+XlYfw21WWQ/GxXJ50q09iBS1MSjYW73ww3SXMVXOobsk4MU80GQZc5DQbl5tOzWRRpS8nJqy1tUAzWZ7ecvKDdfdggWfTV0GbdnA4JB1UdhbHjo0LesAS6YWa2GaCQRIgARIESABEiABUgRIgARYRoAVYtBWBfcL/xb8hwS6av8VYADVjF2M5sTWJAAAAABJRU5ErkJggg=="></td>
</tr>
<tr>
<td>
<p><strong>Vendor Address :</strong></p>
<p><?php echo $SuplierName; ?><br /><?php echo $SuplierAddress; ?></p>
</td>
<td colspan="2">
<p><strong>Delivery To :</strong></p>
<p><?php echo $DeliveryAddress; ?></p>
</td>
</tr>
<tr>
<td>PO DATE :<?php echo $Podt; ?></td>
<td colspan="2">DISPATCH / SCHEDULE BY :<?php echo $Import_DispatchDetails.$DeliverySchedule;?></td>
<td>PLACE OF ORIGIN:<?php echo $Placeoforigin; ?></td>
</tr>
</tbody>
</table>
</div>
<p>&nbsp;</p>
<table style="border-collapse: collapse;" border="1" width="100%" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td>Requistion Number</td>
<td>Requested By</td>
<td>Requested Department</td>
<td>Cost Center &nbsp;</td>
</tr>
<?php
if(!empty($RequistionDetails))
{
foreach($RequistionDetails as $ReqDetails)
{
?>
<tr>
<td><?php echo $ReqDetails['RequistionNo']; ?></td>
<td><?php echo $ReqDetails['RequestedName']; ?></td>
<td><?php echo $ReqDetails['RequestedDept']; ?></td>
<td><?php echo $ReqDetails['CostCenterCode']; ?></td>
</tr>
<?php
}
}
?>
</tbody>
</table>
<p>&nbsp;</p>
<table style="border-collapse: collapse;" border="1" width="100%" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<th>#</th>
<th>Item Name</th>
<th>Qty</th>
<th>UOM</p>
<?php if($currencyName!='INR'){ ?>
<th>Rate Per Unit in <?php echo "$currencyName"."("."$currencyCode".")"?></th>
<?php
} else{
?>
<th>Rate Per Unit in <?php echo "$currencyName";?></th><?php } ?>
<?php if($currencyName!='INR'){ ?>
<th>Total Amount in <?php echo "$currencyName"."("."$currencyCode".")"?></th>
<?php
} else{
?>
<th>Total Amount in <?php echo "$currencyName";?></th><?php } ?>
</tr>
<?php
if(!empty($POItem))
{
$index = 0;
$TotalAmount = 0;
$OrderValue = 0;
foreach($POItem as $record)
{
$index = $index + 1;
$OrderValue= $OrderValue + $record->Quantity*$record->Rate;
?>
<tr style="line-height: 1.5em;">
<td><?php echo $index ; ?></td>
<td><?php echo $record->MaterialName ; ?></td>
<td align="right"><?php echo $record->Quantity ; ?></td>
<td align="right"><?php echo $record->UOM ; ?></td>
<td align="right"><?php echo number_format(($record->Rate),2) ; ?></td>
<td align="right"><?php echo number_format(($record->Quantity * $record->Rate),2);?></td>
</tr>
<?php
}
}
?>
</tbody>
</table>
<p>&nbsp;</p>
<table style="border-collapse: collapse;" cellpadding="0" cellspacing="0" border="1" width="100%">
<tbody>
<tr>
<td style="text-align: center;" ><strong>Total Amount In Words</strong><br /><br /><em><?php echo $TotalAmountInWords." "."Only.";?></em></td>
<td style="text-align: center;" ><?php if($currencyName!='INR'){ ?>
Total Order Amount in <?php echo "$currencyName"."("."$currencyCode".")" ?><?php } else { ?><b>Total Order Amount in <?php echo "$currencyName"; ?><?php } ?> </b> <br/><?php if($currencyName!='INR'){ ?><?php echo number_format($OrderValue,2); } else {?> <?php echo number_format($OrderValue,2);}?></td>
</tr>
<tr>
<td>
<p><strong>Payment Terms</strong></p>
<p><?php echo $PaymentTerms;?></p>
</td>
<td style="text-align: center;">
<p><font size="1">Certified that the particulars given above are true and correct</font></p>
<p><?php echo $CompanyName; ?></p>
<p>&nbsp;</p>
<p>Authorized Signatory</p>
</td>
</tr>
</tbody>
</table>
<p>&nbsp;</p>
<p><strong>Special Instruction:</strong></p>
<p><?php echo $ServiceDescription;?></p>
<p>&nbsp;</p>
<?php
if(!empty($releasedetails)){
$releasedOn = '';
foreach($releasedetails as $detail){
$releasedOn= new DateTime($detail->ReleasedOn, new DateTimeZone('Asia/Kolkata'));
?>
<!-- <table width="100%">
<tbody>
<tr>
<td><b>Released By:</b></td>
<td style="text-align:right;"><b>Released On:</b></td>
</tr>
<tr>
<td><?php echo $detail->FirstName;?></td>
<td style="text-align:right;"><?php echo $releasedOn->format('d-m-Y');?></td>
</tr>
</tbody>
</table> -->
<p>&nbsp;</p>
<div align="Left"> <b>Released By : </b><?php echo $detail->FirstName;?></div>
<div align="Left"> <b>Released On : </b><?php echo $releasedOn->format('d-m-Y');?></div>
<?php
}
}
else {
?>
<?php } ?>

View File

@ -34,7 +34,8 @@
$MaxPoDate = '';
$AvlAmount = 0;
$currentCurrencyType='';
$exchangeRate = $ExchangeRate;
$exchangeRate='';
$exchangeRate = $ExchangeRate;
$ConfigValue='';
$TotalLanding=0;
@ -112,10 +113,12 @@ if(!empty($POMaster))
$PONO = $Req->PONO;
$scopeofwork = $Req->ServiceDescription;
$PayableAT=$Req->PayableAT;
$ExchangeRateOn=$Req->ExchangeRateCalculatedon;
$ExchangeRateOn1=new DateTime($Req->ExchangeRateCalculatedon);
$ExchangeRateOn=$ExchangeRateOn1->format('Y-m-d');
$PaymentDays=$Req->PaymentDays;
$PaymentTerms=$Req->PaymentTerms;
//echo $PaymentTerms;
$UpdatedOn=$Req->UpdatedOn;
$CapitalRange=$Req->CapitalRange;
$Import_DispatchDetails=$Req->Import_DispatchDetails;
@ -153,11 +156,14 @@ if(!empty($AvlBudAmt))
<script src="<?php echo base_url() ?>assets/tinymce/js/tinymce/tinymce.min.js"></script>
<script type="text/javascript">
tinymce.init({
selector: "textarea#txtSpcialInstruction",
plugins: "link image"
});
// tinymce.init({
// selector: "textarea#txtSpcialInstruction",
// menubar: false,
// statusbar: false,
// toolbar: false
// // plugins: "link image"
// });
var DelOpt = '<?php echo $DeliverOption; ?>';
var SchName = <?php echo json_encode($DeliverSchedule); ?>;
var DelDt = '<?php echo $Deliverydt; ?>';
@ -207,13 +213,15 @@ capitalType='Domestic';
document.getElementById('ExchangeRateOnDiv').style.display = 'block';
document.getElementById('ExchangeRateDiv').style.display = 'block';
document.getElementById('currencyTypeDiv').style.display = 'block';
document.getElementById('ExchangeRateModalDiv').style.display = 'block';
//document.getElementById('ExchangeRateModalDiv').style.display = 'block';
document.getElementById('ExchangeRateModalEditDiv').style.display = 'block';
document.getElementById('ExchangeRateModalViewDiv').style.display = 'block';
//document.getElementById('ExchangeRateModalViewDiv').style.display = 'block';
capitalType='International';
document.getElementById('currencyTypeDiv').style.display = 'block';
document.getElementById('ViewModalImportTaxHide').style.display = 'block';
}
//document.getElementById('ViewModalImportTaxHide').style.display = 'block';
}
}
</script>
@ -313,13 +321,12 @@ document.getElementById('currencyTypeDiv').style.display = 'block';
// $currentCurrencyType=$CurrencyDetail[0]->CurrencyCode;
$options1[$CurrencyDetail[0]->Currency_Code] = $CurrencyDetail[0]->Currency_Code.' '.' - '.' '.$CurrencyDetail[0]->Country_and_Currency;
foreach ($Currency as $Cur):
foreach ($Currency as $Cur)
if($CurrencyDetail[0]->Currency_Code!=$Cur->Currency_Code){
$options1[$Cur->Currency_Code] = $Cur->Currency_Code.' '.' - '.' '.$Cur->Country_and_Currency;
}
}
endforeach;
}
echo form_dropdown('currencytype', $options1,set_value('currencytype',$currentCurrencyType),'id="currencytype"','class="form-control select2"' , 'required="true"');
@ -407,16 +414,16 @@ document.getElementById('currencyTypeDiv').style.display = 'block';
<div class="col-md-12" id="Schedulediv" style="display:none;"><br/>
<label >Schedule :</label>
<input type="hidden" name="beforeSchedule" value="<?php echo $DeliverSchedule;?>">
<?php
$data = array('name' => 'Scheduleby','value' => set_value('Scheduleby'),'id'=>'Scheduleby', 'class' => 'form-control' ,'required' => 'true' ,'rows' => '3', 'cols' => '40');
$data = array('name' => 'Scheduleby','value' => set_value('Scheduleby',$DeliverSchedule),'id'=>'Scheduleby', 'class' => 'form-control' ,'required' => 'true' ,'rows' => '3', 'cols' => '40');
echo Form_textarea($data);
?>
</div>
<div class="col-md-12" id="Deliverydtdiv"><br/>
<label>Dispatch Instruction</label>
<input type="hidden" name="beforeDisins" value="<?php echo $Import_DispatchDetails;?>">
<?php
// $data = array('name' => 'Dispatch','value' => set_value('Dispatch',$Import_DispatchDetails),'id'=>'Dispatch', 'class' => 'form-control' ,'required' => 'true');
// echo form_input($data);
@ -449,7 +456,7 @@ document.getElementById('currencyTypeDiv').style.display = 'block';
<label id="CurrencySymbol">Exchange Rate </label>
<div class="form-group">
<?php
$data = array('name' => 'ExchangeRt','value' => set_value('ExchangeRt',$exchangeRate),'id'=>'ExchangeRt', 'class' => 'form-control' ,'onkeypress'=>'return isNumberKey(event);');
$data = array('name' => 'ExchangeRt','value' => set_value('ExchangeRt',$exchangeRate),'id'=>'ExchangeRt', 'class' => 'form-control' ,'onkeypress'=>'return isNumberKey(event);','style'=>'text-align:right');
echo form_input($data);
?>
</div>
@ -483,7 +490,7 @@ document.getElementById('currencyTypeDiv').style.display = 'block';
<div class="col-md-12">
<legend>Payment Details</legend>
<!-- Text input-->
<div class="col-md-3">
<div class="col-md-3"><input type="hidden" name="beforePaymentmethod" id="beforePaymentmethod" value="<?php echo $PaymentTerms ; ?>">
<span for="payablefrom">Payable Terms</span>
<?php
@ -493,6 +500,8 @@ document.getElementById('currencyTypeDiv').style.display = 'block';
if($PaymentTerms==$rl->PaymentTerms)
{
//echo $PaymentTerms."<br>";
//print_r($Payment);
$options6[$rl->PaymentTerms] = $rl->PaymentTerms;
}
@ -563,12 +572,12 @@ document.getElementById('currencyTypeDiv').style.display = 'block';
<td align="left"><?php echo $index ; ?></td>
<td><?php echo $record->ReqNo ?></td>
<td><?php echo $record->MaterialName?></td>
<td><?php echo $record->Quantity ?></td>
<td style="text-align:right"><?php echo $record->Quantity ?></td>
<td><?php echo $record->UOM ?></td>
<td><?php echo $record->Rate ?></td>
<td><?php echo $record->Rate * $record->Quantity ?></td>
<td><?php echo $record->ServiceTaxamount?></td>
<td><?php echo $record->Rate * $record->Quantity ?></td>
<td style="text-align:right"><?php echo $record->Rate ?></td>
<td style="text-align:right"><?php echo $record->Rate * $record->Quantity ?></td>
<td style="text-align:right"><?php echo $record->ServiceTaxamount?></td>
<td style="text-align:right"><?php echo $record->Rate * $record->Quantity ?></td>
<?php
$row=array("materialCode"=>$record->MaterialCode,"ReqNo"=>$record->ReqNo);
array_push($res_arr_values, $row);
@ -587,7 +596,9 @@ document.getElementById('currencyTypeDiv').style.display = 'block';
<input type="hidden" name="<?php echo 'uom'.$index ?>" id="<?php echo 'uom'.$index ?>" value="<?php echo $record->UOM ; ?>" />
<input type="hidden" name="<?php echo 'frequency'.$index ?>" id="<?php echo 'frequency'.$index ?>" value="<?php echo $record->ServiceFrequency ; ?>" />
<input type="hidden" name="<?php echo 'quantity'.$index ?>" id="<?php echo 'quantity'.$index ?>" value="<?php echo $record->Quantity ; ?>" />
<input type="hidden" name="<?php echo 'beforequantity'.$index ?>" id="<?php echo 'quantity'.$index ?>" value="<?php echo $record->Quantity ; ?>" />
<input type="hidden" name="<?php echo 'itemRate'.$index ?>" id="<?php echo 'itemRate'.$index ?>" value="<?php echo $record->Rate ; ?>" />
<input type="hidden" name="<?php echo 'beforeitemRate'.$index ?>" id="<?php echo 'itemRate'.$index ?>" value="<?php echo $record->Rate ; ?>" />
<?php if($CapitalRange=='1'){ ?>
<input type="hidden" name="<?php echo 'rateInUs'.$index ?>" id="<?php echo 'rateInUs'.$index ?>" value="<?php echo $record->Rate ; ?>" />
<?php } ?>
@ -641,12 +652,19 @@ document.getElementById('currencyTypeDiv').style.display = 'block';
<input type="hidden" name="<?php echo 'basicval'.$index ?>" id="<?php echo 'basicval'.$index ?>" value="<?php echo $record->Rate * $record->Quantity ; ?>" />
<input type="hidden" name="<?php echo 'SGST'.$index ?>" id="<?php echo 'SGST'.$index ?>" value="<?php echo $record->SGST ; ?>" />
<input type="hidden" name="<?php echo 'beforeSGST'.$index ?>" id="<?php echo 'beforeSGST'.$index ?>" value="<?php echo $record->SGST ; ?>" />
<input type="hidden" name="<?php echo 'afterSGST'.$index ?>" id="<?php echo 'afterSGST'.$index ?>" value="<?php echo $record->After_SGST ; ?>" />
<input type="hidden" name="<?php echo 'beforeSGSTvalue'.$index ?>" id="<?php echo 'beforeSGSTvalue'.$index ?>" value="<?php echo $record->After_SGST ; ?>" />
<input type="hidden" name="<?php echo 'CGST'.$index ?>" id="<?php echo 'CGST'.$index ?>" value="<?php echo $record->CGST ; ?>" />
<input type="hidden" name="<?php echo 'beforeCGST'.$index ?>" id="<?php echo 'beforeCGST'.$index ?>" value="<?php echo $record->CGST ; ?>" />
<input type="hidden" name="<?php echo 'afterCGST'.$index ?>" id="<?php echo 'afterCGST'.$index ?>" value="<?php echo $record->After_CGST ; ?>" />
<input type="hidden" name="<?php echo 'beforeCGSTvalue'.$index ?>" id="<?php echo 'beforeCGSTvalue'.$index ?>" value="<?php echo $record->After_CGST ; ?>" />
<input type="hidden" name="<?php echo 'IGST'.$index ?>" id="<?php echo 'IGST'.$index ?>" value="<?php echo $record->IGST ; ?>" />
<input type="hidden" name="<?php echo 'beforeIGST'.$index ?>" id="<?php echo 'beforeIGST'.$index ?>" value="<?php echo $record->IGST ; ?>" />
<input type="hidden" name="<?php echo 'afterIGST'.$index ?>" id="<?php echo 'afterIGST'.$index ?>" value="<?php echo $record->After_IGST ; ?>" />
<input type="hidden" name="<?php echo 'beforeIGSTvalue'.$index ?>" id="<?php echo 'aftebeforeIGSTvaluerIGST'.$index ?>" value="<?php echo $record->After_IGST ; ?>" />
<input type="hidden" name="<?php echo 'otherallowance'.$index ?>" id="<?php echo 'otherallowance'.$index ?>" value="<?php echo $record->otherallowance ; ?>" />
<input type="hidden" name="<?php echo 'beforeotherallowance'.$index ?>" id="<?php echo 'beforeotherallowance'.$index ?>" value="<?php echo $record->otherallowance ; ?>" />
<input type="hidden" name="<?php echo 'totalservicevalue'.$index ?>" id="<?php echo 'totalservicevalue'.$index ?>" value="<?php echo $record->TotalValue ; ?>" />
@ -665,7 +683,7 @@ document.getElementById('currencyTypeDiv').style.display = 'block';
</tr> <?php
$TotalSGST =$TotalSGST+$record->After_SGST;
$TotalSGST =$TotalSGST+$record->After_SGST;
$TotalCGST = $TotalCGST+$record->After_CGST;
$TotalIGST = $TotalIGST+$record->After_IGST;
$Totalotherallowances = $Totalotherallowances+$record->otherallowance;
@ -695,11 +713,21 @@ document.getElementById('currencyTypeDiv').style.display = 'block';
// $totorder=$totorder+$record->TotalOrderValue;
$totalCapitalOrder = $totalCapitalOrder+$record->BasicValue;
}
//echo $TotalSummary;
if($CapitalRange=='1'){
$totalCapitalOrder = $totalCapitalOrder+$TotalSummary;
}
else if($CapitalRange=='0')
{
$totalCapitalOrder = $totalCapitalOrder+$record->BasicValue;;
}
?> <input type="hidden" name="txtRowCount" id="txtRowCount" value="<?php echo $index;?>">
<input type="hidden" name="CapitalToatlOrder" id="CapitalToatlOrder" value="<?php echo $totalCapitalOrder;?>">
<input type="hidden" name="txtPONO" id="txtPONO" value="<?php echo $PONO; ?>"/>
@ -869,8 +897,8 @@ document.getElementById('currencyTypeDiv').style.display = 'block';
</div>
</div>
<div class="col-md-12">
<div class="col-md-12" style="border:1px solid #000;padding:0px;">
<div class="col-md-12" id="EDITCAPdi"><!--EDITCAPdiv -->
<div class="col-md-12" id="EDITCAPdiv" style="border:1px solid #000;padding:0px;">
<div class="col-md-12" id=""><!--EDITCAPdiv -->
<div class="col-md-6" align="right">
CGST In %
@ -898,7 +926,7 @@ document.getElementById('currencyTypeDiv').style.display = 'block';
</div>
</div>
<div class="col-md-12" id="EDITCAPdi"><!--EDITCAPdiv1 -->
<div class="col-md-12" id="EDITCAPdiv1"><!--EDITCAPdiv1 -->
<div class="col-md-6" align="right">
SGST In %
@ -927,7 +955,7 @@ document.getElementById('currencyTypeDiv').style.display = 'block';
</div>
<div class="col-md-12" id="EDITCAPdi"><!--EDITCAPdiv2 -->
<div class="col-md-12" id="EDITCAPdiv2"><!--EDITCAPdiv2 -->
<div class="col-md-6" align="right">
IGST In %
@ -955,7 +983,7 @@ document.getElementById('currencyTypeDiv').style.display = 'block';
</div>
</div>
<div class="col-md-12" id="EDITCAPdi"><!--EDITCAPdiv3 -->
<div class="col-md-12" id="EDITCAPdiv3"><!--EDITCAPdiv3 -->
<div class="col-md-5 col-md-offset-4" align="right">
<label>Other Allowances In INR</label>
</div>
@ -968,7 +996,7 @@ document.getElementById('currencyTypeDiv').style.display = 'block';
?>
</div>
</div>
<div class="col-md-12" id="EDITCAPdi"><!--EDITCAPdiv4 -->
<div class="col-md-12" id="EDITCAPdiv4"><!--EDITCAPdiv4 -->
<div class="col-md-5 col-md-offset-4" align="right">
<label>Total Order Value In INR</label>
</div>
@ -983,6 +1011,7 @@ document.getElementById('currencyTypeDiv').style.display = 'block';
</div>
</div>
</div>
</div>
<div class="col-md-12" style="padding:1%;" ></div>
<div class="col-md-12" style="border:1px solid #000;padding:0px;" id="EditModalImportTaxHide" style="display:none;">
<br/>
@ -1312,8 +1341,7 @@ document.getElementById('currencyTypeDiv').style.display = 'block';
</div>
</div>
</div>
@ -1338,7 +1366,7 @@ document.getElementById('currencyTypeDiv').style.display = 'block';
<br/>
</table>
<div class="col-md-12" style="border: 1px solid;" id="CAP" > <!--CAPdiv -->
<div class="col-md-12" style="border: 1px solid;" id="CAPdiv" >
<div class="col-md-3">
<label>CGST In INR</label>
<?php
@ -1560,7 +1588,7 @@ document.getElementById('currencyTypeDiv').style.display = 'block';
<a class="btn btn-primary Save" ID="Submit" onclick="Save(1)" >&nbsp;&nbsp;<span class="bold">Submit</span></a>
<a class="btn btn-primary Save" ID="Submit" onclick="Save()" >&nbsp;&nbsp;<span class="bold">Submit</span></a>
<input type="reset" class="btn btn-primary" value="Reset">
@ -1643,13 +1671,13 @@ var myArray = <?php echo json_encode($res_arr_values); ?>;
$('#ADDCAPdiv2').hide();
$('#ADDCAPdiv3').hide();
$('#EDITCAPdiv').hide();
$('#EDITCAPdiv1').hide();
$('#EDITCAPdiv2').hide();
$('#EDITCAPdiv3').hide();
$('#VIEWCAPdiv').hide();
$('#VIEWCAPdiv1').hide();
$('#VIEWCAPdiv2').hide();
$('#VIEWCAPdiv3').hide();
// $('#EDITCAPdiv1').hide();
// $('#EDITCAPdiv2').hide();
// $('#EDITCAPdiv3').hide();
// $('#VIEWCAPdiv').hide();
// $('#VIEWCAPdiv1').hide();
// $('#VIEWCAPdiv2').hide();
// $('#VIEWCAPdiv3').hide();
//$('#DOMdiv').hide();
}
@ -2575,7 +2603,7 @@ $('#PurQuantity').val('');
$('#EditCPUOM').val($('#uom'+userid).val());
$('#EditCPQuantity').val($('#quantity'+userid).val());
$('#EditCPRate').val($('#rateInUs'+userid).val());
$('#EditCPRate').val($('#rateInUs'+userid).val());
$('#EditCPTotalAmount').val($('#basicval'+userid).val());
@ -2728,20 +2756,15 @@ $("#EdittxtTotalOrderValue").val('');
}
function Save(status)
{ //alert('save function');
function Save()
{
//alert('save function');
if(status == '0')
{
stat = '<?php echo PO_DRAFT; ?>';
}
else
{
stat = '<?php echo PO_CREATED; ?>';
}
var splinstr = $('#txtSpcialInstruction').val();
//alert(splinstr);
var deladd = $('#DeliveryAddr').val();
var ExchangeRateOn = $('#Exchangerateon').val();
@ -2771,16 +2794,17 @@ $('#txtStatus').val(stat);
$('#content').loader('show');
//salert('ss');
//alert('before Ajax');
$.ajax({
data:$('.CapitalPO').serialize()+"&ExchangeRateOn="+ExchangeRateOn+"&PaymentMethod="+PaymentMethod+"&PayableAT="+PayableAT+"&PaymentDate="+PaymentDate,
type:"POST",
url:"<?php echo base_url() ?>purchaseorder/EditCapitalPurchaseOrder",
url:"<?php echo base_url() ?>amendmentpurchaseorder/EditAmendCapitalPurchaseOrder",
success:function(data) {
if(data)
{
alert(data);
$('#content').loader('hide');
$('#txtRowCount').val('');
@ -2789,7 +2813,7 @@ $('#txtStatus').val(stat);
$('#txtDeliveryAddress').val('');
clearAfterAddLineItemAdd();
//window.location ="purchaseorderListing";
window.location ="amendmentpurchaseorder";
}
else
@ -2847,13 +2871,16 @@ $('#txtStatus').val(stat);
//var txtExchangeRate = parseFloat( $('#EditExchangeRtModal').val());
var RatePerTon = parseFloat( $('#EditCPRate').val());
//var txtUnitPrice = parseFloat($('#Rate').val());
var txtExchangeRate='';
if(capitalType=='International'){
//var txtExchangeRate='';
if(capitalType=='International'){
alert('international');
txtExchangeRate = parseFloat( $('#EditExchangeRtModal').val());
var Tot = txtQuantity * RatePerTon;
}
else{
alert('Dometic');
var Tot = txtQuantity * RatePerTon;
txtExchangeRate = 1;
}