[Vtigercrm-commits] [vtiger-commits] r9991 - in /vtigercrm/branches/5.0.3: include/fpdf/templates/body.php modules/Invoice/CreatePDF.php modules/PurchaseOrder/CreatePDF.php modules/Quotes/CreatePDF.php modules/SalesOrder/CreateSOPDF.php
vtigercrm-commits at vtiger.fosslabs.com
vtigercrm-commits at vtiger.fosslabs.com
Wed Dec 20 07:40:00 EST 2006
Author: richie
Date: Wed Dec 20 05:39:46 2006
New Revision: 9991
Log:
* Modified to show the final disocunt amount instead of percentage in pdf file and some alignments, Fixes #2760
Modified:
vtigercrm/branches/5.0.3/include/fpdf/templates/body.php
vtigercrm/branches/5.0.3/modules/Invoice/CreatePDF.php
vtigercrm/branches/5.0.3/modules/PurchaseOrder/CreatePDF.php
vtigercrm/branches/5.0.3/modules/Quotes/CreatePDF.php
vtigercrm/branches/5.0.3/modules/SalesOrder/CreateSOPDF.php
Modified: vtigercrm/branches/5.0.3/include/fpdf/templates/body.php
==============================================================================
--- vtigercrm/branches/5.0.3/include/fpdf/templates/body.php (original)
+++ vtigercrm/branches/5.0.3/include/fpdf/templates/body.php Wed Dec 20 05:39:46 2006
@@ -82,28 +82,33 @@
if($focus->column_fields["hdnTaxType"] != "individual") {
$lineData=array("105",$bottom+37,"94");
$pdf->drawLine($lineData);
- $data= $app_strings['LBL_NET_TOTAL'].": ".$price_subtotal."";
+ $data= $app_strings['LBL_NET_TOTAL'].": ".$price_subtotal."";
$pdf->SetXY( 105 , 168 );
$pdf->SetFont( "Helvetica", "", 10);
$pdf->MultiCell(110, 4, $data);
$lineData=array("105",$bottom+43,"94");
$pdf->drawLine($lineData);
- $data= $app_strings['LBL_DISCOUNT'].": ".$price_discount."";
+
+ //For alignment
+ if($final_price_discount_percent != '')
+ $data= $app_strings['LBL_DISCOUNT'].": $final_price_discount_percent ".$price_discount."";
+ else
+ $data= $app_strings['LBL_DISCOUNT'].": ".$price_discount."";
$pdf->SetXY( 105 , 174 );
$pdf->SetFont( "Helvetica", "", 10);
$pdf->MultiCell(110, 4, $data);
$lineData=array("105",$bottom+49,"94");
$pdf->drawLine($lineData);
- $data= $app_strings['LBL_TAX'].": ($group_total_tax_percent %) ".$price_salestax."";
+ $data= $app_strings['LBL_TAX'].": ($group_total_tax_percent %) ".$price_salestax."";
$pdf->SetXY( 105 , 180 );
$pdf->SetFont( "Helvetica", "", 10);
$pdf->MultiCell(110, 4, $data);
$lineData=array("105",$bottom+55,"94");
$pdf->drawLine($lineData);
- $data = $app_strings['LBL_SHIPPING_AND_HANDLING_CHARGES'].": ".$price_shipping;
+ $data = $app_strings['LBL_SHIPPING_AND_HANDLING_CHARGES'].": ".$price_shipping;
$pdf->SetXY( 105 , 186 );
$pdf->SetFont( "Helvetica", "", 10);
$pdf->MultiCell(110, 4, $data);
@@ -111,21 +116,27 @@
} else {
$lineData=array("105",$bottom+43,"94");
$pdf->drawLine($lineData);
- $data= $app_strings['LBL_NET_TOTAL'].": ".$price_subtotal."";
+ $data= $app_strings['LBL_NET_TOTAL'].": ".$price_subtotal."";
$pdf->SetXY( 105 , 174 );
$pdf->SetFont( "Helvetica", "", 10);
$pdf->MultiCell(110, 4, $data);
$lineData=array("105",$bottom+49,"94");
$pdf->drawLine($lineData);
- $data= $app_strings['LBL_DISCOUNT'].": ".$price_discount."";
+
+ //For alignment
+ if($final_price_discount_percent != '')
+ $data= $app_strings['LBL_DISCOUNT'].": $final_price_discount_percent ".$price_discount."";
+ else
+ $data= $app_strings['LBL_DISCOUNT'].": ".$price_discount."";
+
$pdf->SetXY( 105 , 180 );
$pdf->SetFont( "Helvetica", "", 10);
$pdf->MultiCell(110, 4, $data);
$lineData=array("105",$bottom+55,"94");
$pdf->drawLine($lineData);
- $data = $app_strings['LBL_SHIPPING_AND_HANDLING_CHARGES'].": ".$price_shipping;
+ $data = $app_strings['LBL_SHIPPING_AND_HANDLING_CHARGES'].": ".$price_shipping;
$pdf->SetXY( 105 , 186 );
$pdf->SetFont( "Helvetica", "", 10);
$pdf->MultiCell(110, 4, $data);
@@ -133,21 +144,21 @@
$lineData=array("105",$bottom+61,"94");
$pdf->drawLine($lineData);
-$data = $app_strings['LBL_TAX_FOR_SHIPPING_AND_HANDLING'].": ($sh_tax_percent %) ".$price_shipping_tax;
+$data = $app_strings['LBL_TAX_FOR_SHIPPING_AND_HANDLING'].": ($sh_tax_percent %) ".$price_shipping_tax;
$pdf->SetXY( 105 , 192 );
$pdf->SetFont( "Helvetica", "", 10);
$pdf->MultiCell(110, 4, $data);
$lineData=array("105",$bottom+67,"94");
$pdf->drawLine($lineData);
-$data = $app_strings['LBL_ADJUSTMENT'].": ".$price_adjustment;
+$data = $app_strings['LBL_ADJUSTMENT'].": ".$price_adjustment;
$pdf->SetXY( 105 , 198 );
$pdf->SetFont( "Helvetica", "", 10);
$pdf->MultiCell(110, 4, $data);
$lineData=array("105",$bottom+73,"94");
$pdf->drawLine($lineData);
-$data = $app_strings['LBL_GRAND_TOTAL'].":(in $currency_symbol) ".$price_total;
+$data = $app_strings['LBL_GRAND_TOTAL'].":(in $currency_symbol) ".$price_total;
$pdf->SetXY( 105 , 204 );
$pdf->SetFont( "Helvetica", "", 10);
$pdf->MultiCell(110, 4, $data);
Modified: vtigercrm/branches/5.0.3/modules/Invoice/CreatePDF.php
==============================================================================
--- vtigercrm/branches/5.0.3/modules/Invoice/CreatePDF.php (original)
+++ vtigercrm/branches/5.0.3/modules/Invoice/CreatePDF.php Wed Dec 20 05:39:46 2006
@@ -96,7 +96,11 @@
if($discount_amount != "")
$price_discount = number_format($discount_amount,2,'.',',');
else if($discount_percent != "")
- $price_discount = $discount_percent."%";
+{
+ //This will be displayed near Discount label - used in include/fpdf/templates/body.php
+ $final_price_discount_percent = "(".number_format($discount_percent,2,'.',',')." %)";
+ $price_discount = number_format((($discount_percent*$focus->column_fields["hdnSubTotal"])/100),2,'.',',');
+}
else
$price_discount = "0.00";
Modified: vtigercrm/branches/5.0.3/modules/PurchaseOrder/CreatePDF.php
==============================================================================
--- vtigercrm/branches/5.0.3/modules/PurchaseOrder/CreatePDF.php (original)
+++ vtigercrm/branches/5.0.3/modules/PurchaseOrder/CreatePDF.php Wed Dec 20 05:39:46 2006
@@ -95,7 +95,11 @@
if($discount_amount != "")
$price_discount = number_format($discount_amount,2,'.',',');
else if($discount_percent != "")
- $price_discount = $discount_percent."%";
+{
+ //This will be displayed near Discount label - used in include/fpdf/templates/body.php
+ $final_price_discount_percent = "(".number_format($discount_percent,2,'.',',')." %)";
+ $price_discount = number_format((($discount_percent*$focus->column_fields["hdnSubTotal"])/100),2,'.',',');
+}
else
$price_discount = "0.00";
Modified: vtigercrm/branches/5.0.3/modules/Quotes/CreatePDF.php
==============================================================================
--- vtigercrm/branches/5.0.3/modules/Quotes/CreatePDF.php (original)
+++ vtigercrm/branches/5.0.3/modules/Quotes/CreatePDF.php Wed Dec 20 05:39:46 2006
@@ -96,7 +96,11 @@
if($discount_amount != "")
$price_discount = number_format($discount_amount,2,'.',',');
else if($discount_percent != "")
- $price_discount = $discount_percent."%";
+{
+ //This will be displayed near Discount label - used in include/fpdf/templates/body.php
+ $final_price_discount_percent = "(".number_format($discount_percent,2,'.',',')." %)";
+ $price_discount = number_format((($discount_percent*$focus->column_fields["hdnSubTotal"])/100),2,'.',',');
+}
else
$price_discount = "0.00";
Modified: vtigercrm/branches/5.0.3/modules/SalesOrder/CreateSOPDF.php
==============================================================================
--- vtigercrm/branches/5.0.3/modules/SalesOrder/CreateSOPDF.php (original)
+++ vtigercrm/branches/5.0.3/modules/SalesOrder/CreateSOPDF.php Wed Dec 20 05:39:46 2006
@@ -94,7 +94,11 @@
if($discount_amount != "")
$price_discount = number_format($discount_amount,2,'.',',');
else if($discount_percent != "")
- $price_discount = $discount_percent."%";
+{
+ //This will be displayed near Discount label - used in include/fpdf/templates/body.php
+ $final_price_discount_percent = "(".number_format($discount_percent,2,'.',',')." %)";
+ $price_discount = number_format((($discount_percent*$focus->column_fields["hdnSubTotal"])/100),2,'.',',');
+}
else
$price_discount = "0.00";
More information about the vtigercrm-commits
mailing list