[ Index ] |
PHP Cross Reference of vtigercrm-6.1.0 |
[Summary view] [Print] [Text view]
1 <?php 2 // watermark based on status 3 // this is the postion of the watermark before the rotate 4 $waterMarkPositions=array("30","180"); 5 // this is the rotate amount (todo) 6 $waterMarkRotate=array("45","50","180"); 7 $pdf->watermark( $status, $waterMarkPositions, $waterMarkRotate ); 8 9 include ("libraries/tcpdf/pdfconfig.php"); 10 11 // blow a bubble around the table 12 $Bubble=array("10",$body_top,"170","$bottom"); 13 $pdf->tableWrapper($Bubble); 14 15 /* ************ Begin Table Setup ********************** */ 16 // Each of these arrays needs to have matching keys 17 // "key" => "Length" 18 // total of columns needs to be 190 in order to fit the table 19 // correctly 20 $prodTable=array("10","60"); 21 //added for value field allignment 22 //contains the x angle starting point of the value field 23 $space=array("4"=>"191","5"=>"189","6"=>"187","7"=>"186","8"=>"184","9"=>"182","10"=>"180","11"=>"179","12"=>"177","13"=>"175"); 24 //if taxtype is individual 25 if($focus->column_fields["hdnTaxType"] == "individual") 26 { 27 $colsAlign["Product Name"] = "L"; 28 $colsAlign["Description"] = "L"; 29 $colsAlign["Qty"] = "R"; 30 $colsAlign["Price"] = "R"; 31 $colsAlign["Discount"] = "R"; 32 $colsAlign["Tax"] = "R"; 33 $colsAlign["Total"] = "R"; 34 $cols["Product Code"] = "30"; 35 $cols["Product Name"] = "65"; 36 $cols["Qty"] = "13"; 37 $cols["Price"] = "22"; 38 $cols["Discount"] = "15"; 39 $cols["Tax"] = "20"; 40 $cols["Total"] = "25"; 41 } 42 else 43 { 44 //if taxtype is group 45 $colsAlign["Product Name"] = "L"; 46 $colsAlign["Description"] = "L"; 47 $colsAlign["Qty"] = "R"; 48 $colsAlign["Price"] = "R"; 49 $colsAlign["Discount"] = "R"; 50 $colsAlign["Total"] = "R"; 51 $cols["Product Code"] = "30"; 52 $cols["Product Name"] = "65"; 53 $cols["Qty"] = "15"; 54 $cols["Price"] = "30"; 55 $cols["Discount"] = "20"; 56 $cols["Total"] = "30"; 57 } 58 59 60 $pdf->addCols( $cols,$prodTable,$bottom, $focus->column_fields["hdnTaxType"]); 61 $pdf->addLineFormat( $colsAlign); 62 63 /* ************** End Table Setup *********************** */ 64 65 66 67 /* ************* Begin Product Population *************** */ 68 $ppad=3; 69 $y = $body_top+10; 70 71 for($i=0;$i<count($line);$i++) 72 { 73 $size = $pdf->addProductLine( $y, $line[$i] ); 74 $y += $size+$ppad; 75 } 76 77 /* ******************* End product population ********* */ 78 79 80 /* ************* Begin Totals ************************** */ 81 $t=$bottom+56; 82 $pad=6; 83 for($i=0;$i<count($total);$i++) 84 { 85 $size = $pdf->addProductLine( $t, $total[$i], $total[$i] ); 86 $t += $pad; 87 } 88 89 //Set the x and y positions to place the NetTotal, Discount, S&H charge 90 //if taxtype is not individual ie., group tax 91 if($focus->column_fields["hdnTaxType"] != "individual") 92 { 93 $lineData=array("105",$bottom+37,"94"); 94 $pdf->drawLine($lineData); 95 $data= $app_strings['LBL_NET_TOTAL'].":"; 96 $pdf->SetXY( 105 , ($nettotal_y+(0*$next_y)) ); 97 $pdf->SetFont( "Helvetica", "", 10); 98 $pdf->MultiCell(17, 4, $data); 99 100 //Added for value field alignment 101 $pdf->SetXY( $space[strlen($price_subtotal)] , ($nettotal_y+(0*$next_y)) ); 102 $pdf->SetFont( "Helvetica", "", 10); 103 $pdf->MultiCell(110, 4, $price_subtotal); 104 105 106 $lineData=array("105",$bottom+43,"94"); 107 $pdf->drawLine($lineData); 108 109 //For alignment 110 if($final_price_discount_percent != '') 111 $data= $app_strings['LBL_DISCOUNT'].": $final_price_discount_percent";// ".$price_discount.""; 112 else 113 $data= $app_strings['LBL_DISCOUNT'].":";// ".$price_discount.""; 114 $pdf->SetXY( 105 , ($nettotal_y+(1*$next_y)) ); 115 $pdf->SetFont( "Helvetica", "", 10); 116 $pdf->MultiCell(110, 4, $data); 117 118 //Added for value field alignment 119 $pdf->SetXY( $space[strlen($price_discount)] , ($nettotal_y+(1*$next_y)) ); 120 $pdf->SetFont( "Helvetica", "", 10); 121 $pdf->MultiCell(110, 4, $price_discount); 122 123 $lineData=array("105",$bottom+49,"94"); 124 $pdf->drawLine($lineData); 125 $data= $app_strings['LBL_TAX'].": ($group_total_tax_percent %)";// ".$price_salestax.""; 126 $pdf->SetXY( 105 , ($nettotal_y+(2*$next_y)) ); 127 $pdf->SetFont( "Helvetica", "", 10); 128 $pdf->MultiCell(20, 4, $data); 129 130 //Added for value field alignment 131 $pdf->SetXY( $space[strlen($price_salestax)] , ($nettotal_y+(2*$next_y)) ); 132 $pdf->SetFont( "Helvetica", "", 10); 133 $pdf->MultiCell(110, 4, $price_salestax); 134 135 $lineData=array("105",$bottom+55,"94"); 136 $pdf->drawLine($lineData); 137 $data = $app_strings['LBL_SHIPPING_AND_HANDLING_CHARGES'].":";// ".$price_shipping; 138 $pdf->SetXY( 105 , ($nettotal_y+(3*$next_y)) ); 139 $pdf->SetFont( "Helvetica", "", 10); 140 $pdf->MultiCell(50, 4, $data); 141 142 //Added for value field alignment 143 $pdf->SetXY( $space[strlen($price_shipping)] , ($nettotal_y+(3*$next_y)) ); 144 $pdf->SetFont( "Helvetica", "", 10); 145 $pdf->MultiCell(110, 4, $price_shipping); 146 } 147 else 148 { 149 //if taxtype is individual 150 $lineData=array("105",$bottom+43,"94"); 151 $pdf->drawLine($lineData); 152 $data= $app_strings['LBL_NET_TOTAL'].":";// ".$price_subtotal.""; 153 $pdf->SetXY( 105 , ($nettotal_y+(1*$next_y)) ); 154 $pdf->SetFont( "Helvetica", "", 10); 155 $pdf->MultiCell(17, 4, $data); 156 157 // added for value field allignment 158 159 $pdf->SetXY( $space[strlen($price_subtotal)] , ($nettotal_y+(1*$next_y)) ); 160 $pdf->SetFont( "Helvetica", "", 10); 161 $pdf->MultiCell(110, 4,$price_subtotal); 162 163 164 $lineData=array("105",$bottom+49,"94"); 165 $pdf->drawLine($lineData); 166 167 //For alignment 168 if($final_price_discount_percent != '') 169 $data= $app_strings['LBL_DISCOUNT'].": $final_price_discount_percent";// ".$price_discount.""; 170 else 171 $data= $app_strings['LBL_DISCOUNT'].":";// ".$price_discount.""; 172 173 $pdf->SetXY( 105 , ($nettotal_y+(2*$next_y)) ); 174 $pdf->SetFont( "Helvetica", "", 10); 175 $pdf->MultiCell(110, 4, $data); 176 //Added for value field alignment 177 $pdf->SetXY( $space[strlen($price_discount)] , ($nettotal_y+(2*$next_y)) ); 178 $pdf->SetFont( "Helvetica", "", 10); 179 $pdf->MultiCell(110, 4, $price_discount); 180 181 182 $lineData=array("105",$bottom+55,"94"); 183 $pdf->drawLine($lineData); 184 $data = $app_strings['LBL_SHIPPING_AND_HANDLING_CHARGES'].":";// ".$price_shipping; 185 $pdf->SetXY( 105 , ($nettotal_y+(3*$next_y)) ); 186 $pdf->SetFont( "Helvetica", "", 10); 187 $pdf->MultiCell(50, 4, $data); 188 189 //Added for value field alignment 190 191 $pdf->SetXY( $space[strlen($price_shipping)] , ($nettotal_y+(3*$next_y)) ); 192 $pdf->SetFont( "Helvetica", "", 10); 193 $pdf->MultiCell(110, 4, $price_shipping); 194 195 } 196 197 //Set the x and y positions to place the S&H Tax, Adjustment and Grand Total 198 $lineData=array("105",$bottom+61,"94"); 199 $pdf->drawLine($lineData); 200 $data = $app_strings['LBL_TAX_FOR_SHIPPING_AND_HANDLING'].": ($sh_tax_percent %)";// ".$price_shipping_tax; 201 $pdf->SetXY( 105 , ($nettotal_y+(4*$next_y)) ); 202 $pdf->SetFont( "Helvetica", "", 10); 203 $pdf->MultiCell(65, 4, $data); 204 205 //Added for value field alignment 206 $pdf->SetXY( $space[strlen($price_shipping_tax)] , ($nettotal_y+(4*$next_y)) ); 207 $pdf->SetFont( "Helvetica", "", 10); 208 $pdf->MultiCell(110, 4, $price_shipping_tax); 209 210 $lineData=array("105",$bottom+67,"94"); 211 $pdf->drawLine($lineData); 212 $data = $app_strings['LBL_ADJUSTMENT'].":";// ".$price_adjustment; 213 $pdf->SetXY( 105 , ($nettotal_y+(5*$next_y)) ); 214 $pdf->SetFont( "Helvetica", "", 10); 215 $pdf->MultiCell(110, 4, $data); 216 217 //Added for value field alignment 218 $pdf->SetXY( $space[strlen($price_adjustment)] , ($nettotal_y+(5*$next_y)) ); 219 $pdf->SetFont( "Helvetica", "", 10); 220 $pdf->MultiCell(110, 4, $price_adjustment); 221 222 223 $lineData=array("105",$bottom+73,"94"); 224 $pdf->drawLine($lineData); 225 $data = $app_strings['LBL_GRAND_TOTAL'].":(in $currency_symbol)";// ".$price_total; 226 $pdf->SetXY( 105 , ($nettotal_y+(6*$next_y)) ); 227 $pdf->SetFont( "Helvetica", "", 10); 228 $pdf->MultiCell(28, 4, $data); 229 230 //Added for value field alignment 231 $pdf->SetXY( $space[strlen($price_total)] , ($nettotal_y+(6*$next_y)) ); 232 $pdf->SetFont( "Helvetica", "", 10); 233 $pdf->MultiCell(110, 4, $price_total); 234 235 /* ************** End Totals *********************** */ 236 237 238 ?>
title
Description
Body
title
Description
Body
title
Description
Body
title
Body
Generated: Fri Nov 28 20:08:37 2014 | Cross-referenced by PHPXref 0.7.1 |