From: <dai...@us...> - 2011-03-03 09:14:52
|
Revision: 4502 http://web-erp.svn.sourceforge.net/web-erp/?rev=4502&view=rev Author: daintree Date: 2011-03-03 09:14:45 +0000 (Thu, 03 Mar 2011) Log Message: ----------- New Portrait quotation OutputSerialItems Added Paths: ----------- trunk/PDFQuotationPortrait.php trunk/includes/OutputSerialItems.php trunk/includes/PDFQuotationPortraitPageHeader.inc Added: trunk/PDFQuotationPortrait.php =================================================================== --- trunk/PDFQuotationPortrait.php (rev 0) +++ trunk/PDFQuotationPortrait.php 2011-03-03 09:14:45 UTC (rev 4502) @@ -0,0 +1,252 @@ +<?php + +/* $Id: PDFQuotationPortrait.php 4491 2011-02-15 06:31:08Z daintree $ */ + + +include('includes/session.inc'); +include('includes/SQL_CommonFunctions.inc'); + +//Get Out if we have no order number to work with +If (!isset($_GET['QuotationNo']) || $_GET['QuotationNo']==""){ + $title = _('Select Quotation To Print'); + include('includes/header.inc'); + echo '<div class="centre"><br><br><br>'; + prnMsg( _('Select a Quotation to Print before calling this page') , 'error'); + echo '<br><br><br><table class="table_index"><tr><td class="menu_group_item"> + <li><a href="'. $rootpath . '/SelectSalesOrder.php?'. SID .'&Quotations=Quotes_Only">' . _('Quotations') . '</a></li> + </td></tr></table></div><br><br><br>'; + include('includes/footer.inc'); + exit(); +} + +/*retrieve the order details from the database to print */ +$ErrMsg = _('There was a problem retrieving the quotation header details for Order Number') . ' ' . $_GET['QuotationNo'] . ' ' . _('from the database'); + +$sql = "SELECT salesorders.customerref, + salesorders.comments, + salesorders.orddate, + salesorders.deliverto, + salesorders.deladd1, + salesorders.deladd2, + salesorders.deladd3, + salesorders.deladd4, + salesorders.deladd5, + salesorders.deladd6, + debtorsmaster.name, + debtorsmaster.address1, + debtorsmaster.address2, + debtorsmaster.address3, + debtorsmaster.address4, + debtorsmaster.address5, + debtorsmaster.address6, + shippers.shippername, + salesorders.printedpackingslip, + salesorders.datepackingslipprinted, + salesorders.branchcode, + locations.taxprovinceid, + locations.locationname + FROM salesorders, + debtorsmaster, + shippers, + locations + WHERE salesorders.debtorno=debtorsmaster.debtorno + AND salesorders.shipvia=shippers.shipper_id + AND salesorders.fromstkloc=locations.loccode + AND salesorders.quotation=1 + AND salesorders.orderno='" . $_GET['QuotationNo'] ."'"; + +$result=DB_query($sql,$db, $ErrMsg); + +//If there are no rows, there's a problem. +if (DB_num_rows($result)==0){ + $title = _('Print Quotation Error'); + include('includes/header.inc'); + echo '<div class="centre"><br><br><br>'; + prnMsg( _('Unable to Locate Quotation Number') . ' : ' . $_GET['QuotationNo'] . ' ', 'error'); + echo '<br><br><br><table class="table_index"><tr><td class="menu_group_item"> + <li><a href="'. $rootpath . '/SelectSalesOrder.php?'. SID .'&Quotations=Quotes_Only">' . _('Outstanding Quotations') . '</a></li> + </td></tr></table></div><br><br><br>'; + include('includes/footer.inc'); + exit; +} elseif (DB_num_rows($result)==1){ /*There is only one order header returned - thats good! */ + + $myrow = DB_fetch_array($result); +} + +/*retrieve the order details from the database to print */ + +/* Then there's an order to print and its not been printed already (or its been flagged for reprinting/ge_Width=807; +) +LETS GO */ +$PaperSize = 'A4'; +include('includes/PDFStarter.php'); +$pdf->addInfo('Title', _('Customer Quotation') ); +$pdf->addInfo('Subject', _('Quotation') . ' ' . $_GET['QuotationNo']); +$FontSize=12; +$PageNumber = 1; +$line_height=24; +// $pdf->selectFont('./fonts/Helvetica.afm'); + +/* Now ... Has the order got any line items still outstanding to be invoiced */ + +$ErrMsg = _('There was a problem retrieving the quotation line details for quotation Number') . ' ' . + $_GET['QuotationNo'] . ' ' . _('from the database'); + +$sql = "SELECT salesorderdetails.stkcode, + stockmaster.description, + salesorderdetails.quantity, + salesorderdetails.qtyinvoiced, + salesorderdetails.unitprice, + salesorderdetails.discountpercent, + stockmaster.taxcatid, + salesorderdetails.narrative + FROM salesorderdetails INNER JOIN stockmaster + ON salesorderdetails.stkcode=stockmaster.stockid + WHERE salesorderdetails.orderno='" . $_GET['QuotationNo'] . "'"; + +$result=DB_query($sql,$db, $ErrMsg); + +$ListCount = 0; // UldisN + +if (DB_num_rows($result)>0){ + /*Yes there are line items to start the ball rolling with a page header */ + include('includes/PDFQuotationPortraitPageHeader.inc'); + + $QuotationTotal =0; + $QuotationTotalEx=0; + $TaxTotal=0; + + while ($myrow2=DB_fetch_array($result)){ + + $ListCount ++; + + if ((strlen($myrow2['narrative']) >200 AND $YPos-$line_height <= 75) + OR (strlen($myrow2['narrative']) >1 AND $YPos-$line_height <= 62) + OR $YPos-$line_height <= 50){ + /* We reached the end of the page so finsih off the page and start a newy */ + $PageNumber++; + include ('includes/PDFQuotationPageHeader.inc'); + + } //end if need a new page headed up + + $DisplayQty = number_format($myrow2['quantity'],2); + $DisplayPrevDel = number_format($myrow2['qtyinvoiced'],2); + $DisplayPrice = number_format($myrow2['unitprice'],2); + $DisplayDiscount = number_format($myrow2['discountpercent']*100,2) . '%'; + $SubTot = $myrow2['unitprice']*$myrow2['quantity']*(1-$myrow2['discountpercent']); + $TaxProv = $myrow['taxprovinceid']; + $TaxCat = $myrow2['taxcatid']; + $Branch = $myrow['branchcode']; + $sql3 = " select taxgrouptaxes.taxauthid from taxgrouptaxes INNER JOIN custbranch ON taxgrouptaxes.taxgroupid=custbranch.taxgroupid WHERE custbranch.branchcode='" .$Branch ."'"; + $result3=DB_query($sql3,$db, $ErrMsg); + while ($myrow3=DB_fetch_array($result3)){ + $TaxAuth = $myrow3['taxauthid']; + } + + $sql4 = "SELECT * FROM taxauthrates WHERE dispatchtaxprovince='" .$TaxProv ."' AND taxcatid='" .$TaxCat ."' AND taxauthority='" .$TaxAuth ."'"; + $result4=DB_query($sql4,$db, $ErrMsg); + while ($myrow4=DB_fetch_array($result4)){ + $TaxClass = 100 * $myrow4['taxrate']; + } + + $DisplayTaxClass = $TaxClass . "%"; + $TaxAmount = (($SubTot/100)*(100+$TaxClass))-$SubTot; + $DisplayTaxAmount = number_format($TaxAmount,2); + + $LineTotal = $SubTot + $TaxAmount; + $DisplayTotal = number_format($LineTotal,2); + + $FontSize=10; + + $LeftOvers = $pdf->addTextWrap($XPos+1,$YPos,100,$FontSize,$myrow2['stkcode']); + $LeftOvers = $pdf->addTextWrap(120,$YPos,295,$FontSize,$myrow2['description']); + $LeftOvers = $pdf->addTextWrap(180,$YPos,85,$FontSize,$DisplayQty,'right'); + $LeftOvers = $pdf->addTextWrap(230,$YPos,85,$FontSize,$DisplayPrice,'right'); + if ($DisplayDiscount > 0){ + $LeftOvers = $pdf->addTextWrap(280,$YPos,85,$FontSize,$DisplayDiscount,'right'); + } + $LeftOvers = $pdf->addTextWrap(330,$YPos,85,$FontSize,$DisplayTaxClass,'right'); + $LeftOvers = $pdf->addTextWrap(410,$YPos,85,$FontSize,$DisplayTaxAmount,'center'); + $LeftOvers = $pdf->addTextWrap(460,$YPos,90,$FontSize,$DisplayTotal,'right'); + if (strlen($myrow2['narrative'])>1){ + $YPos -= 10; + $LeftOvers = $pdf->addTextWrap($XPos+1,$YPos,750,10,$myrow2['narrative']); + if (strlen($LeftOvers>1)){ + $YPos -= 10; + $LeftOvers = $pdf->addTextWrap($XPos+1,$YPos,750,10,$LeftOvers); + } + } + $QuotationTotal +=$LineTotal; + $QuotationTotalEx +=$SubTot; + $TaxTotal +=$TaxAmount; + + /*increment a line down for the next line item */ + $YPos -= ($line_height); + + } //end while there are line items to print out + if ((strlen($myrow['comments']) >200 AND $YPos-$line_height <= 75) + OR (strlen($myrow['comments']) >1 AND $YPos-$line_height <= 62) + OR $YPos-$line_height <= 50){ + /* We reached the end of the page so finsih off the page and start a newy */ + $PageNumber++; + include ('includes/PDFQuotationPageHeader.inc'); + + } //end if need a new page headed up + + $LeftOvers = $pdf->addTextWrap($XPos,$YPos-80,200,10,_('Notes:')); + $LeftOvers = $pdf->addText($XPos,$YPos-95,10,$myrow['comments']); + + if (strlen($LeftOvers)>1){ + $YPos -= 10; + $LeftOvers = $pdf->addTextWrap($XPos,$YPos,700,10,$LeftOvers); + if (strlen($LeftOvers)>1){ + $YPos -= 10; + $LeftOvers = $pdf->addTextWrap($XPos,$YPos,700,10,$LeftOvers); + if (strlen($LeftOvers)>1){ + $YPos -= 10; + $LeftOvers = $pdf->addTextWrap($XPos,$YPos,700,10,$LeftOvers); + if (strlen($LeftOvers)>1){ + $YPos -= 10; + $LeftOvers = $pdf->addTextWrap($XPos,$YPos,10,$FontSize,$LeftOvers); + } + } + } + } + $YPos -= ($line_height); + $LeftOvers = $pdf->addTextWrap(40,$YPos,655,$FontSize,_('Total Tax'),'right'); + $LeftOvers = $pdf->addTextWrap(700,$YPos,90,$FontSize,number_format($TaxTotal,2),'right'); + $YPos -= 12; + $LeftOvers = $pdf->addTextWrap(40,$YPos,655,$FontSize,_('Quotation Excluding Tax'),'right'); + $LeftOvers = $pdf->addTextWrap(700,$YPos,90,$FontSize,number_format($QuotationTotalEx,2),'right'); + $YPos -= 12; + $LeftOvers = $pdf->addTextWrap(40,$YPos,655,$FontSize,_('Quotation Including Tax'),'right'); + $LeftOvers = $pdf->addTextWrap(700,$YPos,90,$FontSize,number_format($QuotationTotal,2),'right'); + +} /*end if there are line details to show on the quotation*/ + + +//$pdfcode = $pdf->output('PDFQuotation.pdf', 'I'); +//$len = strlen($pdfcode); +if ($ListCount == 0){ + $title = _('Print Quotation Error'); + include('includes/header.inc'); + echo '<p>'. _('There were no items on the quotation') . '. ' . _('The quotation cannot be printed'). + '<br><a href="' . $rootpath . '/SelectSalesOrder.php?' . SID . '&Quotation=Quotes_only">'. _('Print Another Quotation'). + '</a>' . '<br>'. '<a href="' . $rootpath . '/index.php?' . SID . '">' . _('Back to the menu') . '</a>'; + include('includes/footer.inc'); + exit; +} else { +/* + header('Content-type: application/pdf'); + header('Content-Length: ' . $len); + header('Content-Disposition: inline; filename=Quotation.pdf'); + header('Expires: 0'); + header('Cache-Control: must-revalidate, post-check=0, pre-check=0'); + header('Pragma: public'); +//echo 'here'; + $pdf->Output('PDFQuotation.pdf', 'I'); +*/ + $pdf->OutputI($_SESSION['DatabaseName'] . '_Quotation_' . date('Y-m-d') . '.pdf');//UldisN + $pdf->__destruct(); //UldisN +} +?> Added: trunk/includes/OutputSerialItems.php =================================================================== --- trunk/includes/OutputSerialItems.php (rev 0) +++ trunk/includes/OutputSerialItems.php 2011-03-03 09:14:45 UTC (rev 4502) @@ -0,0 +1,210 @@ +<?php +/* $Id$*/ +/*Input Serial Items - used for inputing serial numbers or batch/roll/bundle references +for controlled items - used in: +- ConfirmDispatchControlledInvoice.php +- GoodsReceivedControlled.php +- StockAdjustments.php +- StockTransfers.php +- CreditItemsControlled.php + +*/ + +//we start with a batch or serial no header and need to display something for verification... +global $tableheader; + +include ('includes/Add_SerialItemsOut.php'); + +global $tableheader; +/* Link to clear the list and start from scratch */ +$EditLink = '<br><div class="centre"><a href="' . $_SERVER['PHP_SELF'] . '?' . SID . '&EditControlled=true&StockID=' . $LineItem->StockID . + '&LineNo=' . $LineNo .'">'. _('Edit'). '</a> | '; +$RemoveLink = '<a href="' . $_SERVER['PHP_SELF'] . '?' . SID . '&DELETEALL=YES&StockID=' . $LineItem->StockID . + '&LineNo=' . $LineNo .'">'. _('Remove All'). '</a><br></div>'; +$sql="SELECT perishable + FROM stockmaster + WHERE stockid='".$StockID."'"; +$result=DB_query($sql, $db); +$myrow=DB_fetch_array($result); +$Perishable=$myrow['perishable']; +if ($LineItem->Serialised==1){ + $tableheader .= '<tr> + <th>'. _('Serial No').'</th> + </tr>'; + $listtableheader=$tableheader; +} else if ($LineItem->Serialised==0 and $Perishable==1){ + $tableheader = '<tr> + <th>'. _('Batch/Roll/Bundle'). ' #</th> + <th>'. _('Available'). '</th> + <th>'. _('Quantity'). '</th> + <th>'. _('Expiry Date'). '</th> + </tr>'; + $listtableheader = '<tr> + <th>'. _('Batch/Roll/Bundle'). ' #</th> + <th>'. _('Quantity'). '</th> + <th>'. _('Expiry Date'). '</th> + </tr>'; +} else { + $tableheader = '<tr> + <th>'. _('Batch/Roll/Bundle'). ' #</th> + <th>'. _('Quantity'). '</th> + </tr>'; + $listtableheader=$tableheader; +} + +echo $EditLink . $RemoveLink; + +if (isset($_GET['LineNo'])){ + $LineNo = $_GET['LineNo']; +} elseif (isset($_POST['LineNo'])){ + $LineNo = $_POST['LineNo']; +} + +/*Display the batches already entered with quantities if not serialised */ + +echo '<table class=selection><tr><td valign=top><table class=selection>'; +echo $listtableheader; + +$TotalQuantity = 0; /*Variable to accumulate total quantity received */ +$RowCounter =0; + +$k=0; +foreach ($LineItem->SerialItems as $Bundle){ + + if ($RowCounter == 10){ + echo $listtableheader; + $RowCounter =0; + } else { + $RowCounter++; + } + + if ($k==1){ + echo '<tr bgcolor="#CCCCCC">'; + $k=0; + } else { + echo '<tr bgcolor="#EEEEEE">'; + $k=1; + } + + echo '<td>' . $Bundle->BundleRef . '</td>'; + + if ($LineItem->Serialised==0 and $Perishable==0){ + echo '<td class=number>' . number_format($Bundle->BundleQty, $LineItem->DecimalPlaces) . '</td>'; + } else if ($LineItem->Serialised==0 and $Perishable==1){ + echo '<td class=number>' . number_format($Bundle->BundleQty, $LineItem->DecimalPlaces) . '</td>'; + echo '<td class=number>' . $Bundle->ExpiryDate . '</td>'; + } + + echo '<td><a href="' . $_SERVER['PHP_SELF'] . '?' . SID . 'Delete=' . $Bundle->BundleRef . '&StockID=' . $LineItem->StockID . '&LineNo=' . $LineNo .'">'. _('Delete'). '</a></td></tr>'; + + $TotalQuantity += $Bundle->BundleQty; +} + + +/*Display the totals and rule off before allowing new entries */ +if ($LineItem->Serialised==1){ + echo '<tr><td class=number><B>'. _('Total Quantity'). ': ' . number_format($TotalQuantity,$LineItem->DecimalPlaces) . '</b></td></tr>'; +} else { + echo '<tr><td class=number><B>'. _('Total Quantity'). ':</b></td><td class=number><b>' . number_format($TotalQuantity,$LineItem->DecimalPlaces) . '</b></td></tr>'; +} + +/*Close off old table */ +echo '</table></td><td valign=top>'; + +/*Start a new table for the Serial/Batch ref input in one column (as a sub table +then the multi select box for selection of existing bundle/serial nos for dispatch if applicable*/ +//echo '<TABLE><TR><TD valign=TOP>'; + +/*in the first column add a table for the input of newies */ +echo '<table class=selection>'; +echo $tableheader; + + +echo '<form action="' . $_SERVER['PHP_SELF'] . '?=' . SID . '" name="Ga6uF5Wa" method="post"> + <input type=hidden name=LineNo value="' . $LineNo . '"> + <input type=hidden name=StockID value="' . $StockID . '"> + <input type=hidden name=EntryType value="KEYED">'; +echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; +if ( isset($_GET['EditControlled']) ) { + $EditControlled = isset($_GET['EditControlled'])?$_GET['EditControlled']:false; +} elseif ( isset($_POST['EditControlled']) ){ + $EditControlled = isset($_POST['EditControlled'])?$_POST['EditControlled']:false; +} else { + $EditControlled=false; +} +$TotalQuantity = 0; /*Variable to accumulate total quantity received */ +$RowCounter =0; + +$k=0; + +$StartAddingAt = 0; +if ($EditControlled){ + foreach ($LineItem->SerialItems as $Bundle){ + + echo '<tr><td valign=top><input type=text name="SerialNo'. $StartAddingAt .'" + value="'.$Bundle->BundleRef.'" size=21 maxlength=20></td>'; + + /*if the item is controlled not serialised - batch quantity required so just enter bundle refs + into the form for entry of quantities manually */ + + if ($LineItem->Serialised==1){ + echo '<input type=hidden name="Qty' . $StartAddingAt .'" Value=1></TR>'; + } else if ($LineItem->Serialised==0 and $Perishable==1) { + echo '<td><input type=text class="number" name="Qty' . $StartAddingAt .'" size=11 + value="'. number_format($Bundle->BundleQty, $LineItem->DecimalPlaces). '" maxlength=10></tr>'; + } else { + echo '<td><input type=text class="number" name="Qty' . $StartAddingAt .'" size=11 + value="'. number_format($Bundle->BundleQty, $LineItem->DecimalPlaces). '" maxlength=10></tr>'; + } + + $StartAddingAt++; + } +} + +$sql="SELECT serialno, + quantity, + expirationdate + FROM stockserialitems + WHERE stockid='".$StockID."' + AND loccode='".$_SESSION['Items']->Location."'"; +$result=DB_query($sql, $db); + +$RowNumber=0; +while ($myrow=DB_fetch_array($result)){ + + echo '<tr><td valign=top>'.$myrow['serialno'].'<input type=hidden name="SerialNo'. ($RowNumber) .'" size=21 value="'.$myrow['serialno'].'" maxlength=20></td>'; + + /*if the item is controlled not serialised - batch quantity required so just enter bundle refs + into the form for entry of quantities manually */ + + if ($LineItem->Serialised==1){ + echo '<input type=hidden name="Qty' . ($StartAddingAt+$RowNumber) .'" Value=1></tr>'; + } else if ($LineItem->Serialised==0 and $Perishable==1) { + if (isset($LineItem->SerialItems[$myrow['serialno']])) { + echo '<td class=number>'.number_format($myrow['quantity']-$LineItem->SerialItems[$myrow['serialno']]->BundleQty,$LineItem->DecimalPlaces).'</td>'; + } else { + echo '<td class=number>'.number_format($myrow['quantity'],$LineItem->DecimalPlaces).'</td>'; + } + echo '<td><input type=text class="number" name="Qty' . ($StartAddingAt+$RowNumber) .'" size=11 value="0" maxlength=10></td>'; + echo '<td><input type=hidden class="date" name="ExpiryDate' . ($StartAddingAt+$RowNumber) .'" size=11 + value="'.ConvertSQLDate($myrow['expirationdate']).'" alt="'.$_SESSION['DefaultDateFormat'].'" maxlength=10>'.ConvertSQLDate($myrow['expirationdate']).'</td></tr>'; + } else { + echo '<td><input type=text class="number" name="Qty' . ($StartAddingAt+$RowNumber) .'" size=11 value="'.$myrow['quantity'].'" maxlength=10></tr>'; + } + $RowNumber++; +} + +echo '</table>'; +echo '<br><div class=centre><input type=submit name="AddBatches" value="'. _('Enter'). '"></div>'; +echo '</form></td><td valign=top>'; +$ShowExisting=True; +$_POST['EntryType']='Sequential'; +if ($ShowExisting){ + include('includes/InputSerialItemsExisting.php'); +} +echo '</td></tr></table><script type="text/javascript"> +//<![CDATA[ +document.Ga6uF5Wa.SerialNo0.focus(); +//]]> +</script>'; /*end of nested table */ +?> \ No newline at end of file Added: trunk/includes/PDFQuotationPortraitPageHeader.inc =================================================================== --- trunk/includes/PDFQuotationPortraitPageHeader.inc (rev 0) +++ trunk/includes/PDFQuotationPortraitPageHeader.inc 2011-03-03 09:14:45 UTC (rev 4502) @@ -0,0 +1,136 @@ +<?php +/* $Id: PDFQuotationPortrait.php 4491 2011-02-15 06:31:08Z daintree $ */ + +if ($PageNumber>1){ + $pdf->newPage(); +} + +$XPos = $Page_Width/2 - 140; +$pdf->addJpegFromFile($_SESSION['LogoFile'],$XPos+90,720,0,60); + +$XPos = $XPos + 130; + +$FontSize=18; +$pdf->addText($XPos,820,$FontSize, _('Quotation')); +$FontSize=12; +$YPos = 720; +$pdf->addText($XPos, $YPos,$FontSize, $_SESSION['CompanyRecord']['coyname']); +$FontSize =10; +$pdf->addText($XPos, $YPos-12,$FontSize, $_SESSION['CompanyRecord']['regoffice1']); +$pdf->addText($XPos, $YPos-21,$FontSize, $_SESSION['CompanyRecord']['regoffice2']); +$pdf->addText($XPos, $YPos-30,$FontSize, $_SESSION['CompanyRecord']['regoffice3'] . ' ' . $_SESSION['CompanyRecord']['regoffice4'] . ' ' . $_SESSION['CompanyRecord']['regoffice5']); +$pdf->addText($XPos, $YPos-39,$FontSize, _('Ph') . ': ' . $_SESSION['CompanyRecord']['telephone'] . ' ' . _('Fax'). ': ' . $_SESSION['CompanyRecord']['fax']); +$pdf->addText($XPos, $YPos-48,$FontSize, $_SESSION['CompanyRecord']['email']); + + +$XPos = 46; +$YPos = 770; + +$FontSize=12; +$pdf->addText($XPos, $YPos+10,$FontSize, _('Delivery To').':' ); +$pdf->addText($XPos, $YPos- 3,$FontSize, $myrow['deliverto']); +$pdf->addText($XPos, $YPos-15,$FontSize, $myrow['deladd1']); +$pdf->addText($XPos, $YPos-30,$FontSize, $myrow['deladd2']); +$pdf->addText($XPos, $YPos-45,$FontSize, $myrow['deladd3'] . ' ' . $myrow['deladd4'] . ' ' . $myrow['deladd5']); + +$YPos -= 80; + +$pdf->addText($XPos, $YPos,$FontSize, _('Quotation For').':'); +$pdf->addText($XPos, $YPos-15,$FontSize, $myrow['name']); +$pdf->addText($XPos, $YPos-30,$FontSize, $myrow['address1']); +$pdf->addText($XPos, $YPos-45,$FontSize, $myrow['address2']); +$pdf->addText($XPos, $YPos-60,$FontSize, $myrow['address3'] . ' ' . $myrow['address4'] . ' ' . $myrow['address5']); + + +$XPos= 50; +$YPos += 25; +/*draw a nice curved corner box around the delivery details */ +/*from the top right */ +$pdf->partEllipse($XPos+200,$YPos+60,0,90,10,10); +/*line to the top left */ +$pdf->line($XPos+200, $YPos+70,$XPos, $YPos+70); +/*Dow top left corner */ +$pdf->partEllipse($XPos, $YPos+60,90,180,10,10); +/*Do a line to the bottom left corner */ +$pdf->line($XPos-10, $YPos+60,$XPos-10, $YPos); +/*Now do the bottom left corner 180 - 270 coming back west*/ +$pdf->partEllipse($XPos, $YPos,180,270,10,10); +/*Now a line to the bottom right */ +$pdf->line($XPos, $YPos-10,$XPos+200, $YPos-10); +/*Now do the bottom right corner */ +$pdf->partEllipse($XPos+200, $YPos,270,360,10,10); +/*Finally join up to the top right corner where started */ +$pdf->line($XPos+210, $YPos,$XPos+210, $YPos+60); + + +$YPos -= 90; +/*draw a nice curved corner box around the billing details */ +/*from the top right */ +$pdf->partEllipse($XPos+200,$YPos+60,0,90,10,10); +/*line to the top left */ +$pdf->line($XPos+200, $YPos+70,$XPos, $YPos+70); +/*Dow top left corner */ +$pdf->partEllipse($XPos, $YPos+60,90,180,10,10); +/*Do a line to the bottom left corner */ +$pdf->line($XPos-10, $YPos+60,$XPos-10, $YPos); +/*Now do the bottom left corner 180 - 270 coming back west*/ +$pdf->partEllipse($XPos, $YPos,180,270,10,10); +/*Now a line to the bottom right */ +$pdf->line($XPos, $YPos-10,$XPos+200, $YPos-10); +/*Now do the bottom right corner */ +$pdf->partEllipse($XPos+200, $YPos,270,360,10,10); +/*Finally join up to the top right corner where started */ +$pdf->line($XPos+210, $YPos,$XPos+210, $YPos+60); + + +$pdf->addText(490, 790,$FontSize, _('Number'). ':'); +$pdf->addText(535, 790,$FontSize, $_GET['QuotationNo']); +$pdf->addText(490, 790-15,$FontSize, _('Your Ref'). ':'); +$pdf->addText(520, 790-15,$FontSize, $myrow['customerref']); +$pdf->addText(490, 790-30,$FontSize, _('Date'). ':'); +$pdf->addText(520, 790-30,$FontSize, ConvertSQLDate($myrow['orddate'])); +$pdf->addText(490, 790-45,$FontSize, _('Page'). ':'); +$pdf->addText(520, 790-45,$FontSize, $PageNumber); + +$YPos -= 45; +$XPos = 40; + +$FontSize=10; +$LeftOvers = $pdf->addTextWrap($XPos+2,$YPos,100,$FontSize, _('Item Code'),'left'); +$LeftOvers = $pdf->addTextWrap(120,$YPos,235,$FontSize, _('Item Description'),'left'); +$LeftOvers = $pdf->addTextWrap(180,$YPos,85,$FontSize, _('Quantity'),'right'); +$LeftOvers = $pdf->addTextWrap(230,$YPos,85,$FontSize,_('Price'),'right'); +$LeftOvers = $pdf->addTextWrap(280,$YPos,85,$FontSize, _('Discount'),'right'); +$LeftOvers = $pdf->addTextWrap(330,$YPos,85,$FontSize, _('Tax Class'),'right'); +$LeftOvers = $pdf->addTextWrap(400,$YPos,85,$FontSize, _('Tax Amount'),'right'); +$LeftOvers = $pdf->addTextWrap(450,$YPos,90,$FontSize, _('Total'),'right'); + + +/*draw a box with nice round corner for entering line items */ +/*90 degree arc at top right of box 0 degrees starts a bottom */ +$pdf->partEllipse($Page_Width-$Right_Margin-0, $Bottom_Margin+560,0,90,10,10); +/*line to the top left */ +$pdf->line($Page_Width-$Right_Margin-0, $Bottom_Margin+570,$Left_Margin+10, $Bottom_Margin+570); + +/*line under headings to top left */ +$pdf->line($Page_Width-$Right_Margin+10, $Bottom_Margin+538,$Left_Margin, $Bottom_Margin+538); + + +/*Dow top left corner */ +$pdf->partEllipse($Left_Margin+10, $Bottom_Margin+560,90,180,10,10); +/*Do a line to the bottom left corner */ +$pdf->line($Left_Margin, $Bottom_Margin+560,$Left_Margin, $Bottom_Margin+10); +/*Now do the bottom left corner 180 - 270 coming back west*/ +$pdf->partEllipse($Left_Margin+10, $Bottom_Margin+10,180,270,10,10); +/*Now a line to the bottom right */ +$pdf->line($Left_Margin+10, $Bottom_Margin,$Page_Width-$Right_Margin-0, $Bottom_Margin); +/*Now do the bottom right corner */ +$pdf->partEllipse($Page_Width-$Right_Margin-0, $Bottom_Margin+10,270,360,10,10); +/*Finally join up to the top right corner where started */ +$pdf->line($Page_Width-$Right_Margin+10, $Bottom_Margin+10,$Page_Width-$Right_Margin+10, $Bottom_Margin+560); + +$YPos -= $line_height; + +$FontSize =12; + +?> \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |