From: <rc...@us...> - 2014-01-15 02:18:13
|
Revision: 6540 http://sourceforge.net/p/web-erp/reponame/6540 Author: rchacon Date: 2014-01-15 02:18:07 +0000 (Wed, 15 Jan 2014) Log Message: ----------- Add $RadiusY option. Set RoundRectangle parameters similar to other RoundRectangle functions. Substitute code with RoundRectangle function. Modified Paths: -------------- trunk/ReorderLevel.php trunk/companies/weberpdemo/FormDesigns/PickingList.xml trunk/companies/weberpdemo/FormDesigns/PurchaseOrder.xml trunk/includes/PDFPickingListHeader.inc trunk/includes/PDFQuotationPageHeader.inc trunk/includes/PO_PDFOrderPageHeader.inc trunk/includes/class.pdf.php Modified: trunk/ReorderLevel.php =================================================================== --- trunk/ReorderLevel.php 2014-01-14 20:17:08 UTC (rev 6539) +++ trunk/ReorderLevel.php 2014-01-15 02:18:07 UTC (rev 6540) @@ -274,8 +274,8 @@ $line_height=12; $FontSize=9; $YPos= $Page_Height-$Top_Margin; - $pdf->RoundRectangle($Left_Margin-5, $YPos+5, 300, ($line_height*3), 10); - $pdf->addTextWrap($Left_Margin,$YPos,300,$FontSize,$_SESSION['CompanyRecord']['coyname']); + $pdf->RoundRectangle($Left_Margin-5, $YPos+5+10, 310, ($line_height*3)+10+10, 10, 10);// Function RoundRectangle from includes/class.pdf.php + $pdf->addTextWrap($Left_Margin,$YPos,290,$FontSize,$_SESSION['CompanyRecord']['coyname']); $YPos -=$line_height; Modified: trunk/companies/weberpdemo/FormDesigns/PickingList.xml =================================================================== --- trunk/companies/weberpdemo/FormDesigns/PickingList.xml 2014-01-14 20:17:08 UTC (rev 6539) +++ trunk/companies/weberpdemo/FormDesigns/PickingList.xml 2014-01-15 02:18:07 UTC (rev 6540) @@ -263,23 +263,23 @@ </Data> <DeliveryAddressBox type="CurvedRectangle" name="Delivery Address Box" id="DeliveryAddressBox"> <x>40</x> - <y>22</y> - <width>180</width> - <height>70</height> + <y>32</y> + <width>190</width> + <height>90</height> <radius>10</radius> </DeliveryAddressBox> <CustomerAddressBox type="CurvedRectangle" name="Customer Address Box" id="CustomerAddressBox"> <x>40</x> - <y>116</y> - <width>200</width> - <height>80</height> + <y>126</y> + <width>210</width> + <height>100</height> <radius>10</radius> </CustomerAddressBox> <DataBox type="CurvedRectangle" name="Data Box" id="DataBox"> <x>20</x> - <y>226</y> - <width>792</width> - <height>350</height> + <y>236</y> + <width>802</width> + <height>370</height> <radius>10</radius> </DataBox> <LineBelowColumns type="Line" name="Line Below Columns" id="LineBelowColumns"> @@ -318,4 +318,4 @@ <endx>690</endx> <endy>586</endy> </ColumnLine5> -</form> \ No newline at end of file +</form> Modified: trunk/companies/weberpdemo/FormDesigns/PurchaseOrder.xml =================================================================== --- trunk/companies/weberpdemo/FormDesigns/PurchaseOrder.xml 2014-01-14 20:17:08 UTC (rev 6539) +++ trunk/companies/weberpdemo/FormDesigns/PurchaseOrder.xml 2014-01-15 02:18:07 UTC (rev 6540) @@ -109,9 +109,9 @@ </DeliveryAddress> <DeliveryAddressBox type="CurvedRectangle" name="Delivery address box" id="DeliveryAddressBox"> <x>436</x> - <y>142</y> - <width>240</width> - <height>72</height> + <y>154</y> + <width>252</width> + <height>96</height> <radius>12</radius> </DeliveryAddressBox> <SupplierName type="SimpleText" name="Supplier name" id="SupplierName"> Modified: trunk/includes/PDFPickingListHeader.inc =================================================================== --- trunk/includes/PDFPickingListHeader.inc 2014-01-14 20:17:08 UTC (rev 6539) +++ trunk/includes/PDFPickingListHeader.inc 2014-01-15 02:18:07 UTC (rev 6540) @@ -76,9 +76,9 @@ $LeftOvers = $pdf->addTextWrap($FormDesign->Headings->Column5->x,$Page_Height - $FormDesign->Headings->Column5->y,$FormDesign->Headings->Column5->Length , $FormDesign->Headings->Column5->FontSize, _('Prev Dels'),'right'); $LeftOvers = $pdf->addTextWrap($FormDesign->Headings->Column6->x,$Page_Height - $FormDesign->Headings->Column6->y,$FormDesign->Headings->Column6->Length , $FormDesign->Headings->Column6->FontSize, _('Actual Picked'),'right'); -$pdf->RoundRectangle($FormDesign->DeliveryAddressBox->x, $Page_Height - $FormDesign->DeliveryAddressBox->y,$FormDesign->DeliveryAddressBox->width, $FormDesign->DeliveryAddressBox->height, $FormDesign->DeliveryAddressBox->radius); -$pdf->RoundRectangle($FormDesign->CustomerAddressBox->x, $Page_Height - $FormDesign->CustomerAddressBox->y,$FormDesign->CustomerAddressBox->width, $FormDesign->CustomerAddressBox->height, $FormDesign->CustomerAddressBox->radius); -$pdf->RoundRectangle($FormDesign->DataBox->x, $Page_Height - $FormDesign->DataBox->y,$FormDesign->DataBox->width, $FormDesign->DataBox->height, $FormDesign->DataBox->radius); +$pdf->RoundRectangle($FormDesign->DeliveryAddressBox->x, $Page_Height - $FormDesign->DeliveryAddressBox->y,$FormDesign->DeliveryAddressBox->width, $FormDesign->DeliveryAddressBox->height, $FormDesign->DeliveryAddressBox->radius, $FormDesign->DeliveryAddressBox->radius);// Function RoundRectangle from includes/class.pdf.php +$pdf->RoundRectangle($FormDesign->CustomerAddressBox->x, $Page_Height - $FormDesign->CustomerAddressBox->y,$FormDesign->CustomerAddressBox->width, $FormDesign->CustomerAddressBox->height, $FormDesign->CustomerAddressBox->radius, $FormDesign->CustomerAddressBox->radius);// Function RoundRectangle from includes/class.pdf.php +$pdf->RoundRectangle($FormDesign->DataBox->x, $Page_Height - $FormDesign->DataBox->y,$FormDesign->DataBox->width, $FormDesign->DataBox->height, $FormDesign->DataBox->radius, $FormDesign->DataBox->radius);// Function RoundRectangle from includes/class.pdf.php $pdf->line($FormDesign->LineBelowColumns->startx, $Page_Height -$FormDesign->LineBelowColumns->starty,$FormDesign->LineBelowColumns->endx, $Page_Height -$FormDesign->LineBelowColumns->endy); $pdf->line($FormDesign->ColumnLine1->startx, $Page_Height -$FormDesign->ColumnLine1->starty,$FormDesign->ColumnLine1->endx, $Page_Height -$FormDesign->ColumnLine1->endy); @@ -87,4 +87,4 @@ $pdf->line($FormDesign->ColumnLine4->startx, $Page_Height -$FormDesign->ColumnLine4->starty,$FormDesign->ColumnLine4->endx, $Page_Height -$FormDesign->ColumnLine4->endy); $pdf->line($FormDesign->ColumnLine5->startx, $Page_Height -$FormDesign->ColumnLine5->starty,$FormDesign->ColumnLine5->endx, $Page_Height -$FormDesign->ColumnLine5->endy); -?> \ No newline at end of file +?> Modified: trunk/includes/PDFQuotationPageHeader.inc =================================================================== --- trunk/includes/PDFQuotationPageHeader.inc 2014-01-14 20:17:08 UTC (rev 6539) +++ trunk/includes/PDFQuotationPageHeader.inc 2014-01-15 02:18:07 UTC (rev 6540) @@ -53,47 +53,16 @@ $pdf->addText($XPos, $YPos-45, $FontSize, $myrow['address2']); $pdf->addText($XPos, $YPos-60, $FontSize, $myrow['address3'] . ' ' . $myrow['address4'] . ' ' . $myrow['address5']); - +// Draw a rectangle with rounded corners around 'Delivery To' info $XPos= 50; $YPos += 12; -/*draw a nice curved corner box around the delivery details */ -/*from the top right */ -$pdf->partEllipse($XPos+225,$YPos+60,0,90,10,10); -/*line to the top left */ -$pdf->line($XPos+225, $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+225, $YPos-10); -/*Now do the bottom right corner */ -$pdf->partEllipse($XPos+225, $YPos,270,360,10,10); -/*Finally join up to the top right corner where started */ -$pdf->line($XPos+235, $YPos,$XPos+235, $YPos+60); +$pdf->RoundRectangle($XPos-10, $YPos+60+10, 225+10+10, 60+10+10, 10, 10);// Function RoundRectangle from includes/class.pdf.php - +// Draw a rectangle with rounded corners around 'Quotation For' info $YPos -= 82; -/*draw a nice curved corner box around the billing details */ -/*from the top right */ -$pdf->partEllipse($XPos+225,$YPos+60,0,90,10,10); -/*line to the top left */ -$pdf->line($XPos+225, $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+225, $YPos-10); -/*Now do the bottom right corner */ -$pdf->partEllipse($XPos+225, $YPos,270,360,10,10); -/*Finally join up to the top right corner where started */ -$pdf->line($XPos+235, $YPos,$XPos+235, $YPos+60); +$pdf->RoundRectangle($XPos-10, $YPos+60+10, 225+10+10, 60+10+10, 10, 10);// Function RoundRectangle from includes/class.pdf.php +// Print the currency name include($PathPrefix . 'includes/CurrenciesArray.php'); // To get the currency name from the currency code. $pdf->addText($Page_Width/2-60, $YPos-5, $FontSize, _('All amounts stated in') . ' - ' . $myrow['currcode'] . ' ' . $CurrencyName[$myrow['currcode']]); Modified: trunk/includes/PO_PDFOrderPageHeader.inc =================================================================== --- trunk/includes/PO_PDFOrderPageHeader.inc 2014-01-14 20:17:08 UTC (rev 6539) +++ trunk/includes/PO_PDFOrderPageHeader.inc 2014-01-15 02:18:07 UTC (rev 6540) @@ -33,9 +33,9 @@ $pdf->addText($FormDesign->DeliveryAddress->Line2->x,$Page_Height - $FormDesign->DeliveryAddress->Line2->y, $FormDesign->DeliveryAddress->Line2->FontSize, $POHeader['deladd2']); $pdf->addText($FormDesign->DeliveryAddress->Line3->x,$Page_Height - $FormDesign->DeliveryAddress->Line3->y, $FormDesign->DeliveryAddress->Line3->FontSize, $POHeader['deladd3']); $pdf->addText($FormDesign->DeliveryAddress->Line4->x,$Page_Height - $FormDesign->DeliveryAddress->Line4->y, $FormDesign->DeliveryAddress->Line4->FontSize, $POHeader['deladd4']); -$pdf->addText($FormDesign->DeliveryAddress->Line5->x,$Page_Height - $FormDesign->DeliveryAddress->Line5->y, $FormDesign->DeliveryAddress->Line5->FontSize, $POHeader['deladd5'] . ' ' . $POHeader['deladd6']); // Includes delivery postal code and country. +$pdf->addText($FormDesign->DeliveryAddress->Line5->x,$Page_Height - $FormDesign->DeliveryAddress->Line5->y, $FormDesign->DeliveryAddress->Line5->FontSize, $POHeader['deladd5'] . ' ' . $POHeader['deladd6']);// Includes delivery postal code and country. /*draw a nice curved corner box around the delivery to address */ -$pdf->RoundRectangle($FormDesign->DeliveryAddressBox->x, $Page_Height - $FormDesign->DeliveryAddressBox->y,$FormDesign->DeliveryAddressBox->width, $FormDesign->DeliveryAddressBox->height, $FormDesign->DeliveryAddressBox->radius); +$pdf->RoundRectangle($FormDesign->DeliveryAddressBox->x, $Page_Height - $FormDesign->DeliveryAddressBox->y,$FormDesign->DeliveryAddressBox->width, $FormDesign->DeliveryAddressBox->height, $FormDesign->DeliveryAddressBox->radius, $FormDesign->DeliveryAddressBox->radius);// Function RoundRectangle from includes/class.pdf.php /*Now the Supplier details */ $pdf->addText($FormDesign->SupplierName->x,$Page_Height - $FormDesign->SupplierName->y, $FormDesign->SupplierName->FontSize, _('To').': '); $pdf->addText($FormDesign->SupplierName->x+30,$Page_Height - $FormDesign->SupplierName->y, $FormDesign->SupplierName->FontSize, $POHeader['suppname']); Modified: trunk/includes/class.pdf.php =================================================================== --- trunk/includes/class.pdf.php 2014-01-14 20:17:08 UTC (rev 6539) +++ trunk/includes/class.pdf.php 2014-01-15 02:18:07 UTC (rev 6540) @@ -218,23 +218,15 @@ $this->Output($DocumentFilename,'D'); } - function RoundRectangle($XPos, $YPos, $Width, $Height, $Radius) { - /*from the top right */ - $this->partEllipse($XPos+$Width,$YPos,0,90,$Radius,$Radius); - /*line to the top left */ - $this->line($XPos+$Width, $YPos+$Radius,$XPos+$Radius, $YPos+$Radius); - /*Do top left corner */ - $this->partEllipse($XPos+$Radius, $YPos,90,180,$Radius,$Radius); - /*Do a line to the bottom left corner */ - $this->line($XPos+$Radius, $YPos-$Height-$Radius,$XPos+$Width, $YPos-$Height-$Radius); - /*Now do the bottom left corner 180 - 270 coming back west*/ - $this->partEllipse($XPos+$Radius, $YPos-$Height,180,270,$Radius,$Radius); - /*Now a line to the bottom right */ - $this->line($XPos, $YPos-$Height,$XPos, $YPos); - /*Now do the bottom right corner */ - $this->partEllipse($XPos+$Width, $YPos-$Height,270,360,$Radius,$Radius); - /*Finally join up to the top right corner where started */ - $this->line($XPos+$Width+$Radius, $YPos-$Height,$XPos+$Width+$Radius, $YPos); + function RoundRectangle($XPos, $YPos, $Width, $Height, $RadiusX, $RadiusY) { + $this->line($XPos, $YPos-$RadiusY, $XPos, $YPos-$Height+$RadiusY);// Left side + $this->line($XPos+$RadiusX, $YPos, $XPos+$Width-$RadiusX, $YPos);// Top side + $this->line($XPos+$RadiusX, $YPos-$Height-$Radius, $XPos+$Width-$RadiusX, $YPos-$Height-$Radius);// Bottom side + $this->line($XPos+$Width, $YPos-$RadiusY, $XPos+$Width, $YPos-$Height+$RadiusY);// Right side + $this->partEllipse($XPos+$RadiusX, $YPos-$RadiusY, 90, 180, $RadiusX, $RadiusY);// Top left corner + $this->partEllipse($XPos+$RadiusX, $YPos-$Height+$RadiusY, 180, 270, $RadiusX, $RadiusY);// Bottom left corner + $this->partEllipse($XPos+$Width-$RadiusX, $YPos-$RadiusY, 0, 90, $RadiusX, $RadiusY);// Top right corner + $this->partEllipse($XPos+$Width-$RadiusX, $YPos-$Height+$RadiusY, 270, 360, $RadiusX, $RadiusY);// Bottom right corner } function Rectangle($XPos, $YPos, $Width, $Height) { @@ -335,4 +327,4 @@ } // end of class } //end if Cpdf class exists already -?> \ No newline at end of file +?> |