function line($x1, $y1, $x2, $y2, $color, $width, $style = array())
 {
     //pre_r(compact("x1", "y1", "x2", "y2", "color", "width", "style"));
     $this->_set_stroke_color($color);
     $this->_set_line_style($width, "butt", "", $style);
     $this->_pdf->line($x1, $this->y($y1), $x2, $this->y($y2));
 }
 function line($x1, $y1, $x2, $y2, $color, $width, $style = array(), $blend = "Normal", $opacity = 1.0)
 {
     //pre_r(compact("x1", "y1", "x2", "y2", "color", "width", "style"));
     $this->_set_stroke_color($color);
     $this->_set_line_style($width, "butt", "", $style);
     $this->_set_line_transparency($blend, $opacity);
     $this->_pdf->line($x1, $this->y($y1), $x2, $this->y($y2));
 }
 function line($x1, $y1, $x2, $y2, $color, $width, $style = array())
 {
     $this->_set_stroke_color($color);
     $this->_set_line_style($width, "butt", "", $style);
     $this->_pdf->line($x1, $this->y($y1), $x2, $this->y($y2));
 }
while ($InventoryValn = DB_fetch_array($InventoryResult, $db)) {
    if ($Category != $InventoryValn['categoryid']) {
        $FontSize = 10;
        if ($Category != '') {
            /*Then it's NOT the first time round */
            /* need to print the total of previous category */
            if ($_POST['DetailedReport'] == 'Yes') {
                $YPos -= 2 * $line_height;
                $LeftOvers = $pdf->addTextWrap($Left_Margin, $YPos, 260 - $Left_Margin, $FontSize, _('Total for') . ' ' . $Category . ' - ' . $CategoryName);
            }
            $DisplayCatTotVal = locale_money_format($CatTot_Val, $_SESSION['CompanyRecord']['currencydefault']);
            $LeftOvers = $pdf->addTextWrap(500, $YPos, 60, $FontSize, $DisplayCatTotVal, 'right');
            $YPos -= $line_height;
            if ($_POST['DetailedReport'] == 'Yes') {
                /*draw a line under the CATEGORY TOTAL*/
                $pdf->line($Left_Margin, $YPos + $line_height - 2, $Page_Width - $Right_Margin, $YPos + $line_height - 2);
                $YPos -= 2 * $line_height;
            }
            $CatTot_Val = 0;
        }
        $LeftOvers = $pdf->addTextWrap($Left_Margin, $YPos, 260 - $Left_Margin, $FontSize, $InventoryValn['categoryid'] . " - " . $InventoryValn['categorydescription']);
        $Category = $InventoryValn['categoryid'];
        $CategoryName = $InventoryValn['categorydescription'];
    }
    if ($_POST['DetailedReport'] == 'Yes') {
        $YPos -= $line_height;
        $FontSize = 8;
        $LeftOvers = $pdf->addTextWrap($Left_Margin, $YPos, 60, $FontSize, $InventoryValn['stockid']);
        $LeftOvers = $pdf->addTextWrap(120, $YPos, 260, $FontSize, $InventoryValn['description']);
        $DisplayUnitCost = locale_money_format($InventoryValn['unitcost'], $_SESSION['CompanyRecord']['currencydefault']);
        $DisplayQtyOnHand = locale_number_format($InventoryValn['qtyonhand'], $InventoryValn['decimalplaces']);
         }
         //end if need a new page headed up
     }
     /*end while there are line items to print out*/
 }
 /*end if there are stock movements to show on the invoice or credit note*/
 $YPos -= $line_height;
 /* check to see enough space left to print the 4 lines for the totals/footer */
 if ($YPos - $Bottom_Margin < 2 * $line_height) {
     PrintLinesToBottom();
     include 'includes/PDFTransPageHeaderPortrait.inc';
 }
 /*Print a column vertical line  with enough space for the footer*/
 /*draw the vertical column lines to 4 lines shy of the bottom
 		to leave space for invoice footer info ie totals etc*/
 $pdf->line($Left_Margin + 78, $TopOfColHeadings + 12, $Left_Margin + 78, $Bottom_Margin + 4 * $line_height);
 /*Print a column vertical line */
 $pdf->line($Left_Margin + 268, $TopOfColHeadings + 12, $Left_Margin + 268, $Bottom_Margin + 4 * $line_height);
 /*Print a column vertical line */
 $pdf->line($Left_Margin + 348, $TopOfColHeadings + 12, $Left_Margin + 348, $Bottom_Margin + 4 * $line_height);
 /*Print a column vertical line */
 $pdf->line($Left_Margin + 388, $TopOfColHeadings + 12, $Left_Margin + 388, $Bottom_Margin + 4 * $line_height);
 /*Print a column vertical line */
 $pdf->line($Left_Margin + 418, $TopOfColHeadings + 12, $Left_Margin + 418, $Bottom_Margin + 4 * $line_height);
 $pdf->line($Left_Margin + 448, $TopOfColHeadings + 12, $Left_Margin + 448, $Bottom_Margin + 4 * $line_height);
 /*Rule off at bottom of the vertical lines */
 $pdf->line($Left_Margin, $Bottom_Margin + 4 * $line_height, $Page_Width - $Right_Margin, $Bottom_Margin + 4 * $line_height);
 /*Now print out the footer and totals */
 if ($InvOrCredit == 'Invoice') {
     $DisplaySubTot = locale_number_format($myrow['ovamount'], $myrow['decimalplaces']);
     $DisplayFreight = locale_number_format($myrow['ovfreight'], $myrow['decimalplaces']);
//+----------------------------------------------------------------------+
// Set the width of the section
$note_section_width = 320 - $left_margin;
// Set the height of the section
$note_section_height = $page_length - $bottom_margin;
// Loop through and draw each line
$c = $bottom_margin;
if (isset($_GET['show_notes_lines']) && $_GET['show_notes_lines'] == "on") {
    while ($c < $note_section_height - 10) {
        // Set the line style
        if (isset($_GET['use_light_lines'])) {
            $pdf->setLineStyle(0.5);
        } else {
            $pdf->setLineStyle(1);
        }
        $pdf->line($left_margin, $c, $note_section_width, $c);
        $c = $c + $line_height;
    }
}
// Set the line color/style
$pdf->setStrokeColor(0, 0, 0);
if (isset($_GET['use_light_lines'])) {
    $pdf->setLineStyle(0.5);
} else {
    $pdf->setLineStyle(1);
}
// Draw the title
$note_title_left_margin = round($note_section_width / 2, 2);
$pdf->addText($note_title_left_margin, $note_section_height, 10, "Notes", 0, 0);
//+----------------------------------------------------------------------+
//| DRAW THE PAGE BOX
             include 'includes/PDFTransPageHeader.inc';
         }
         //end if need a new page headed up
     }
     //end while there invoice are line items to print out
 }
 /*end if there are stock movements to show on the invoice or credit note*/
 $YPos -= $line_height;
 /* check to see enough space left to print the 4 lines for the totals/footer */
 if ($YPos - $Bottom_Margin < 2 * $line_height) {
     PrintLinesToBottom();
     include 'includes/PDFTransPageHeader.inc';
 }
 /* Print a column vertical line  with enough space for the footer */
 /* draw the vertical column lines to 4 lines shy of the bottom to leave space for invoice footer info ie totals etc */
 $pdf->line($Left_Margin + 97, $TopOfColHeadings + 12, $Left_Margin + 97, $Bottom_Margin + 4 * $line_height);
 /* Print a column vertical line */
 $pdf->line($Left_Margin + 350, $TopOfColHeadings + 12, $Left_Margin + 350, $Bottom_Margin + 4 * $line_height);
 /* Print a column vertical line */
 $pdf->line($Left_Margin + 450, $TopOfColHeadings + 12, $Left_Margin + 450, $Bottom_Margin + 4 * $line_height);
 /* Print a column vertical line */
 $pdf->line($Left_Margin + 550, $TopOfColHeadings + 12, $Left_Margin + 550, $Bottom_Margin + 4 * $line_height);
 /* Print a column vertical line */
 $pdf->line($Left_Margin + 587, $TopOfColHeadings + 12, $Left_Margin + 587, $Bottom_Margin + 4 * $line_height);
 $pdf->line($Left_Margin + 640, $TopOfColHeadings + 12, $Left_Margin + 640, $Bottom_Margin + 4 * $line_height);
 /* Rule off at bottom of the vertical lines */
 $pdf->line($Left_Margin, $Bottom_Margin + 4 * $line_height, $Page_Width - $Right_Margin, $Bottom_Margin + 4 * $line_height);
 /* Now print out the footer and totals */
 if ($InvOrCredit == 'Invoice') {
     $DisplaySubTot = locale_number_format($myrow['ovamount'], $myrow['decimalplaces']);
     $DisplayFreight = locale_number_format($myrow['ovfreight'], $myrow['decimalplaces']);