amendment pdf

This commit is contained in:
venbatechnologies@gmail.com 2017-07-21 12:26:18 +05:30
parent 9afccb3c1a
commit 92f7b30aa6
3 changed files with 256 additions and 120 deletions

View File

@ -819,14 +819,18 @@ function UpdateAmendServicePurchaseOrder()
//die();
if($PaymentTerms!=$beforePaymentTerms)
{
$MAD=$MAD."Amended Payment Terms:". $beforePaymentTerms ."</br>";
//$MAD=$MAD."Amended Payment Terms:". $beforePaymentTerms ."</br>";
$MAD.="Amended Payment Terms&nbsp;&nbsp;" . $beforePaymentTerms."<br>";
}
//$Payableat=$this->input->post('PayableAT');
$Palaceoforigin=$this->input->post('PlaceOforigin');
$beforePalaceoforigin=$this->input->post('beforePlaceOforigin');
if($Palaceoforigin!=$beforePalaceoforigin)
{
$MAD=$MAD."Amended Place of Origin:". $beforePalaceoforigin ."</br>";
//$MAD=$MAD."Amended Place of Origin:". $beforePalaceoforigin ."</br>";
$MAD.=$MAD."Amended Place of Origin:&nbsp;&nbsp;" . $beforePalaceoforigin."<br>";
}
//echo $MAD;
//die();
@ -873,10 +877,7 @@ function UpdateAmendServicePurchaseOrder()
$MaterialCode = $this->input->post('materialCode'.$i);
$Quantity = $this->input->post('quantity'.$i);
$beforeQuantity=$this->input->post('beforequantity'.$i);
if(($Quantity-$beforeQuantity)!=0)
{
$CAD="Amended Quantity :".$beforeQuantity ."</br>";
}
$Reqnumber = $this->input->post('Reqnumber'.$i);
$itemRate = $this->input->post('itemRate'.$i);
@ -886,10 +887,7 @@ function UpdateAmendServicePurchaseOrder()
$Productprice = $this->input->post('ProductPrice'.$i);
$LandingCharge = $this->input->post('LandingCharge'.$i);
$beforeLandingCharge = $this->input->post('beforeLandingCharge'.$i);
if(($LandingCharge-$beforeLandingCharge)!=0)
{
$CAD=$CAD."Amended Landing :".$beforeLandingCharge ."</br>";
}
// echo $LandingCharge;
// echo $beforeLandingCharge;
// die();
@ -897,125 +895,61 @@ function UpdateAmendServicePurchaseOrder()
$AfterLandingCharge = $this->input->post('AfterLandingCharge'.$i);
$HighSeas = $this->input->post('HighSeasSalesCharge'.$i);
$beforeHighSeas=$this->input->post('beforeHighSeasSalesCharge'.$i);
if(($HighSeas-$beforeHighSeas)!=0)
{
$CAD=$CAD."Amended Highsesas :".$beforeHighSeas ."</br>";
}
$AfterHighSeas = $this->input->post('AfterHighSeasSalesCharge'.$i);
$CustomDuty = $this->input->post('CustomDuty'.$i);
$beforeCustomDuty=$this->input->post('beforeCustomDuty'.$i);
if(($CustomDuty-$beforeCustomDuty)!=0)
{
$CAD=$CAD."Amended CustomDuty :".$beforeCustomDuty ."</br>";
}
$AfterCustomDuty = $this->input->post('AfterCustomDuty'.$i);
$ExciseDuty = $this->input->post('ExciseDuty'.$i);
$beforeExciseDuty=$this->input->post('beforeExciseDuty'.$i);
if(($ExciseDuty-$beforeExciseDuty)!=0)
{
$CAD=$CAD."Amended ExciseDuty :".$beforeExciseDuty ."</br>";
}
$AfterExciseDuty = $this->input->post('AfterExciseDuty'.$i);
$ExciseDutyEd = $this->input->post('ExciseDutyEdCess'.$i);
$beforeExciseDutyEd=$this->input->post('beforeExciseDutyEdCess'.$i);
if($ExciseDutyEd-$beforeExciseDutyEd)
{
$CAD=$CAD."Amended ExciseDutyEd :".$beforeExciseDutyEd ."</br>";
}
$AfterExciseDutyEd = $this->input->post('AfterExciseDutyEdCess'.$i);
$ExciseDutySH = $this->input->post('ExciseDutySHCess'.$i);
$beforeExciseDutySH=$this->input->post('beforeExciseDutySHCess'.$i);
if($ExciseDutySH-$beforeExciseDutySH)
{
$CAD=$CAD."Amended ExciseDutySH :".$beforeExciseDutySH ."</br>";
}
$AfterExciseDutySH = $this->input->post('AfterExciseDutySHCess'.$i);
$CustomEd= $this->input->post('CustomEdCess'.$i);
$beforeCustomEd=$this->input->post('beforeCustomEdCess'.$i);
if($CustomEd-$beforeCustomEd)
{
$CAD=$CAD."Amended CustomEd :".$beforeCustomEd ."</br>";
}
$AfterCustomEd= $this->input->post('AfterCustomEdCess'.$i);
$CustomSH = $this->input->post('CustomSHCess'.$i);
$beforeCustomSH=$this->input->post('beforeCustomSHCess'.$i);
if($CustomSH-$beforeCustomSH)
{
$CAD=$CAD."Amended CustomSH :".$beforeCustomSH ."</br>";
}
$AfterCustomSH = $this->input->post('AfterCustomSHCess'.$i);
$AddAdtional = $this->input->post('AddlExciseDuty'.$i);
$beforeAddAdtional=$this->input->post('beforeAddlExciseDuty'.$i);
if($AddAdtional-$beforeAddAdtional)
{
$CAD=$CAD."Amended Additional Excise duty :".$beforeAddAdtional ."</br>";
}
$AfterAddAdtional = $this->input->post('AfterAddlExciseDuty'.$i);
$Grossdutypayable = $this->input->post('Grossdutypayable'.$i);
$beforeGrossdutypayable = $this->input->post('beforeGrossdutypayable'.$i);
// if($Grossdutypayable-$beforeGrossdutypayable)
// {
// $CAD="Amended Grossdutypayable:".$beforeGrossdutypayable ."</br>";
// }
$AvailableModvat = $this->input->post('AvailableModvat'.$i);
$beforeAvailableModvat = $this->input->post('beforeAvailableModvat'.$i);
// if($AvailableModvat-$beforeAvailableModvat)
// {
// $CAD="Amended Available Modvat:".$beforeAvailableModvat ."</br>";
// }
$Grossexpensesduetocustomduty = $this->input->post('Grossexpensesduetocustomduty'.$i);
$beforeGrossexpensesduetocustomduty = $this->input->post('Grossexpensesduetocustomduty'.$i);
//if($Grossexpensesduetocustomduty-$beforeGrossexpensesduetocustomduty)
// {
// $CAD="Amended GrosssExpense:".$beforeGrossexpensesduetocustomduty ."</br>";
// }
$purchaseratePerKG = $this->input->post('purchaseratePerKG'.$i);
$beforepurchaseratePerKG = $this->input->post('beforepurchaseratePerKG'.$i);
// if($purchaseratePerKG-$beforepurchaseratePerKG)
// {
// $CAD="Amended Purchsae Rate/UOM:".$beforepurchaseratePerKG ."</br>";
// }
$CustomDutyExpensesPerKG = $this->input->post('CustomDutyExpensesPerKG'.$i);
$beforeCustomDutyExpensesPerKG = $this->input->post('beforeCustomDutyExpensesPerKG'.$i);
//if($CustomDutyExpensesPerKG-$beforeCustomDutyExpensesPerKG)
// {
// $CAD="Amended CustomDutyExpense/UOM".$beforeCustomDutyExpensesPerKG ."</br>";
// }
$RMCIncludingCustomersPerKG = $this->input->post('RMCIncludingCustomersPerKG'.$i);
$beforeRMCIncludingCustomersPerKG = $this->input->post('RMCIncludingCustomersPerKG'.$i);
// if($RMCIncludingCustomersPerKG-$beforeRMCIncludingCustomersPerKG )
@ -1023,10 +957,7 @@ function UpdateAmendServicePurchaseOrder()
// $CAD="Amended RMC Including Customs".$beforeRMCIncludingCustomersPerKG ."</br>";
// }
$QuantityKG = $this->input->post('QuantityKG'.$i);
$QuantityKG = $this->input->post('QuantityKG'.$i);
@ -1034,8 +965,109 @@ function UpdateAmendServicePurchaseOrder()
$CostCenter = $this->input->post('costCode'.$i);
$Totalvalueitem=$this->input->post('txtTotalorderValue');
$RecQtyvalue=0;
$rowspanvalue=0;
$LineItemNo = '';
if(($Quantity-$beforeQuantity)!=0)
{
$rowspanvalue++;
//$CAD="Amended Quantity :".$beforeQuantity ."</br>";
$CAD=$CAD."<tr><td>Amended Quantity : ".$beforeQuantity ."</td><td>Current Qty:".$Quantity."</td></tr>";
}
if(($LandingCharge-$beforeLandingCharge)!=0)
{
//$CAD=$CAD."Amended Landing :".$beforeLandingCharge ."</br>";
$rowspanvalue++;
$CAD=$CAD."<tr><td>Amended Landing percentage : ".$beforeLandingCharge ."</td><td>Current Landing Percentage:".$LandingCharge."</td></tr>";
}
if(($HighSeas-$beforeHighSeas)!=0)
{
$rowspanvalue++;
//$CAD=$CAD."Amended Highsesas :".$beforeHighSeas ."</br>";
$CAD=$CAD."<tr><td>Amended Highsesas : ".$beforeHighSeas ."</td><td>Current Highsesas:".$HighSeas."</td></tr>";
}
if(($CustomDuty-$beforeCustomDuty)!=0)
{
//$CAD=$CAD."Amended CustomDuty :".$beforeCustomDuty ."</br>";
$rowspanvalue++;
$CAD=$CAD."<tr><td>Amended CustomDuty : ".$beforeCustomDuty ."</td><td>Current CustomDuty:".$CustomDuty."</td></tr>";
}
if(($ExciseDuty-$beforeExciseDuty)!=0)
{
$rowspanvalue++;
//$CAD=$CAD."Amended ExciseDuty :".$beforeExciseDuty ."</br>";
$CAD=$CAD."<tr><td>Amended ExciseDuty : ".$beforeExciseDuty ."</td><td>Current ExciseDuty:".$ExciseDuty."</td></tr>";
}
if($ExciseDutyEd-$beforeExciseDutyEd)
{
$rowspanvalue++;
//$CAD=$CAD."Amended ExciseDutyEd :".$beforeExciseDutyEd ."</br>";
$CAD=$CAD."<tr><td>Amended ExciseDutyEd : ".$beforeExciseDutyEd ."</td><td>Current ExciseDutyEd:".$ExciseDutyEd."</td></tr>";
}
if($ExciseDutySH-$beforeExciseDutySH)
{
$rowspanvalue++;
//$CAD=$CAD."Amended ExciseDutySH :".$beforeExciseDutySH ."</br>";
$CAD=$CAD."<tr><td>Amended ExciseDutySH : ".$beforeExciseDutySH ."</td><td>Current ExciseDutySH:".$ExciseDutySH."</td></tr>";
}
if($CustomEd-$beforeCustomEd)
{
$rowspanvalue++;
//$CAD=$CAD."Amended CustomEd :".$beforeCustomEd ."</br>";
$CAD=$CAD."<tr><td>Amended CustomEd : ".$beforeCustomEd ."</td><td>Current CustomEd:".$CustomEd."</td></tr>";
}
if($CustomSH-$beforeCustomSH)
{
$rowspanvalue++;
//$CAD=$CAD."Amended CustomSH :".$beforeCustomSH ."</br>";
$CAD=$CAD."<tr><td>Amended CustomSH : ".$beforeCustomSH ."</td><td>Current CustomSH:".$CustomSH."</td></tr>";
}
if($AddAdtional-$beforeAddAdtional)
{
//$CAD=$CAD."Amended Additional Excise duty :".$beforeAddAdtional ."</br>";
$rowspanvalue++;
$CAD=$CAD."<tr><td>Amended Additional Excise duty: ".$beforeAddAdtional ."</td><td>Current Additional Excise duty:".$AddAdtional."</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,'AmendedDetails'=>$CAD);
//print_r($POLineItemList);
@ -1088,6 +1120,121 @@ function CreateAmendPOPrint()
}
}
public function importpoprint($PONO)
{
//$this->load->view('includes/pdfheader');
// Load the pdf page with multiviews
$Requester='';
$Depcode='';
$Currencycode='';
$data['CompanyDetails'] = $this->purchaseorder_model->getCompanyInformation();
$data['POItem'] = $this->purchaseorder_model->GetImportPurchaseOrderDetailsForPDF($PONO);
//print_r($data['POItem']);
//die();
$data['releasedetails'] = $this->purchaseorder_model->GetReleasedDetails($PONO);
//print_r( $data['releasedetails']);
foreach ($data['POItem'] as $Reqdby)
{
$Requester=$Reqdby->Requestedby;
}
foreach ($data['POItem'] as $CURTYPE)
{
$Currencycode=$CURTYPE->CurrencyType;
}
$data['Requestername']=$this->purchaseorder_model->GerRequesterName($Requester);
foreach ($data['Requestername'] as $ReqDep)
{
$Depcode=$ReqDep->Departmentcode;
}
$data['DEPCODE']=$this->purchaseorder_model->GerRequesterDep($Depcode);
//print_r($data['Requestername']);
$data['Currencytype']=$this->purchaseorder_model->GerCurrencyCodeName($Currencycode);
$ProductPrice='';
$TotalOrderValue = '';
foreach ($data['POItem'] as $PO )
{
$TotalOrderValue=$PO->TotalOrderValue;
}
//$totalAmt=sprintf("%.2f", $ProductPrice);
//$data['TotalAmountInWords']= $this->convertNumber($totalAmt);
//print_r($data['TotalAmountInWords']);
//$this->load->View("importpopdf", $data);
$CurrencyType='';
if(!empty($data['POItem'])){
$CurrencyType=$data['POItem'][0]->CurrencyType;
}
//echo $CurrencyType;
if($CurrencyType=='')
{
$data['CurrencySymbol']=$this->purchaseorder_model->GerCurrencyCodeName('INR');
}
else
{
$data['CurrencySymbol']=$this->purchaseorder_model->GerCurrencyCodeName($CurrencyType);
}
// $TotalOrderValue=$data['POItem'][0]->$TotalOrderValue;
//print_r($data['POItem'][0]);
$totalAmt=sprintf("%.2f", $TotalOrderValue);
$data['TotalAmountInWords']= $this->convertNumber($totalAmt);
$SymbolCurrency = '';
$SymbolCurrencyName ='';
$PaiseVal = '';
if(!empty($data['CurrencySymbol']) >0)
{
$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);
$this->load->View("Amendedimportpopdf", $data);
// Add header to pdf
//s $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->set_paper(array(0, 0, 841.89, 1190.55), 'landscape');
///$this->dompdf->load_html($php);
///$this->dompdf->render();
///$data['Attachment'] = FALSE;
///$this->dompdf->stream("ImportPOReport.pdf",$data,$php);
}
public function revenuepoprint($PONO)

View File

@ -607,7 +607,7 @@ function GetImportPurchaseOrderDetailsForPDF($PONO = '')
$subQuery='SELECT distinct LineItem.LineItemNo,LineItem.ReqNo,Mat.MaterialCode,Mat.MaterialName,Import_DispatchDetails,
Mat.UOM,Quantity,ReqMas.Requestedby,Rate,ROUND((RMCIncludingCustomersPerKG*Quantity),2)as Taxamount ,
ProductPrice,Tax.*,LineItem.CostCenterCode , POMaster.*,sup.SupplierName,sup.Address
ProductPrice,Tax.*,LineItem.CostCenterCode , POMaster.*,sup.SupplierName,sup.Address,LineItem.AmendedDetails as LineAmend
FROM T_PurchaseOrder_LineItem LineItem
join T_Requestion_Master ReqMas on ReqMas.ReqNo=LineItem.ReqNo
join T_MaterialMaster Mat on Mat.MaterialCode = LineItem.MaterialCode
@ -784,7 +784,7 @@ function GetCurrencytype()
// To update Parent PO as Amended PO
function updateAmendPOMaster($PONO,$PODetail)
{
echo $PONO."from model";
//echo $PONO."from model";
$this->db->where('PONO', $PONO);

View File

@ -29,7 +29,7 @@
}
}
$TotalOrderValue1='';
if(!empty($POItem))
{
@ -49,6 +49,7 @@
$ServiceDescription =$PO->ServiceDescription;
$CostCenterCode=$PO->CostCenterCode;
//$ReqBy=$PO->Requestedby;
$TotalOrderValue1=$PO->TotalOrderValue;
$PaymentTerms = $PO->PaymentTerms;
$PaymentDays=$PO->PaymentDays;
@ -180,7 +181,7 @@
<th>UOM</p>
<th>Rate per unit in <?php echo "$CurrencyCode ($CurrencyName)"?></th>
<th>Basic Price in <?php echo "$CurrencyCode ($CurrencyName)"?></th>
<th>Total Amount in <?php echo "$CurrencyCode ($CurrencyName)"?></th>
<!-- <th>Total Amount in <?php echo "$CurrencyCode ($CurrencyName)"?></th> -->
</tr>
@ -225,7 +226,10 @@
<td align="right"><?php echo $record->Rate ; ?></td>
<td align="right"><?php $BasicValue=($record->Quantity*$record->Rate);
echo number_format($BasicValue,2) ; ?></td>
<td align="right"><?php echo $record->TotalOrderValue; ?></td>
<!-- <td align="right"><?php echo $record->TotalOrderValue; ?></td> -->
<!-- <td align="right"><?php $TotalOrderValue=($record->Quantity*$record->Rate);
echo number_format($BasicValue,2) ; ?></td> -->
</tr>
@ -263,52 +267,37 @@
<table style="border-collapse: collapse;font-size:12px;" cellpadding="0" cellspacing="0" border="1" width="100%">
<tbody>
<tr>
<td style="text-align: center;" colspan="4">
<td style="text-align: center;" colspan="3">
<p>Amended Details</p>
</td>
</tr>
<tr>
<td colspan="4">
<td colspan="3">
<?php
if(!empty($POItem))
{
foreach($POItem as $v)
{
echo "<b>" . $v->AmendedDetails . "</b>";
//echo "<b>" . $v->AmendedDetails . "</b>";
break;
}
}?>
</td>
</tr>
<tr>
<td style="text-align: center;"><strong>Item Description</strong></td>
<td style="text-align: center;"><strong>previous Details</strong></td>
<!-- <td style="text-align: center;" colspan="2">Current Details</td> -->
</tr>
<?php
if(!empty($POItem))
{
$index=0;
foreach($POItem as $record)
{
$index = $index + 1;
//echo $record->MaterialName ;
?>
<tr>
<td style="text-align: center;"><?php echo $index ;echo $record->MaterialName ; ?></td>
<td ><?php echo $record->AmendedDetails ?></td>
<!-- <td ><?php echo $record->AmendedDetails ?></td> -->
<td style="text-align: center;" rowspan="2"><strong>Previous Details</strong></td><td style="text-align: center;" rowspan="2" ><strong>Current Details</strong></td>
</tr>
<?php
}
<?php if(!empty($POItem))
{
foreach($POItem as $record)
{
echo $record->LineAmend ;
}
} ?>
</tbody>
</table>
@ -349,7 +338,7 @@
<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;" ><strong>Total Amount In <?php echo "$CurrencyCode ($CurrencyName)" ;?> <?php echo "$TotalOrderValue";?> </strong></td>
<td style="text-align: center;" ><strong>Total Amount In <?php echo "$CurrencyCode ($CurrencyName)" ;?> <?php echo "$TotalOrderValue1";?> </strong></td>
</tr>
<tr>