diff --git a/src/Controller/JobOrderController.php b/src/Controller/JobOrderController.php index dcda1cf6..b7f847d9 100644 --- a/src/Controller/JobOrderController.php +++ b/src/Controller/JobOrderController.php @@ -1757,7 +1757,7 @@ class JobOrderController extends BaseController $jo_font_size = 16; $col1_x = $margin; $col2_x = 120; - $label_width = 35; + $label_width = 40; $val_width = 60; // insert the logo @@ -1904,7 +1904,7 @@ class JobOrderController extends BaseController $pdf->Cell($label_width, $line_height, 'Wty. Exp. Date:'); $pdf->MultiCell($val_width, $line_height, $cv && $cv->getWarrantyExpiration() ? $cv->getWarrantyExpiration()->format("d/m/Y") : '', 0, 'L'); - // insert address info + // insert transaction details $pdf->Ln(); $pdf->SetFont($font_face, 'B', $header_font_size); $pdf->Cell($label_width, $line_height, 'Transaction Details'); @@ -1915,6 +1915,22 @@ class JobOrderController extends BaseController // get current Y $y = $pdf->GetY(); + $pdf->Cell($label_width, $line_height, 'Warranty Class:'); + $pdf->MultiCell($val_width, $line_height, WarrantyClass::getName($obj->getWarrantyClass()), 0, 'L'); + + // get Y after left cell + $y1 = $pdf->GetY(); + + $pdf->SetXY($col2_x, $y); + $pdf->Cell($label_width, $line_height, 'Mode of Payment:'); + $pdf->MultiCell(0, $line_height, ModeOfPayment::getName($obj->getModeOfPayment()), 0, 'L'); + + // get Y after right cell + $y2 = $pdf->GetY(); + + // get row height + $y = max($y1, $y2); + $pdf->Cell($label_width, $line_height, 'Delivery Address:'); $pdf->MultiCell($val_width, $line_height, $obj->getDeliveryAddress(), 0, 'L'); @@ -1994,29 +2010,68 @@ class JobOrderController extends BaseController // get current Y $y = $pdf->GetY(); + // insert invoice footer details $pdf->Cell($label_width, $line_height, 'Transaction Type:'); $pdf->MultiCell($val_width, $line_height, ServiceType::getName($obj->getServiceType()), 0, 'L'); - // insert footer totals + // get Y after left cell + $y1 = $pdf->GetY(); + $pdf->SetXY($col2_x, $y); $pdf->SetFont($font_face, 'B'); $pdf->Cell($label_width, $line_height, 'SUBTOTAL:'); $pdf->SetFont($font_face, ''); $pdf->MultiCell(0, $line_height, number_format($invoice->getVATExclusivePrice(), 2), 0, 'R'); - $pdf->SetX($col2_x); + // get Y after right cell + $y2 = $pdf->GetY(); + + // get row height + $y = max($y1, $y2); + + $pdf->SetXY($col1_x, $y); + $pdf->Cell($label_width, $line_height, 'OR Name:'); + $pdf->MultiCell($val_width, $line_height, $obj->getORName(), 0, 'L'); + + // get Y after left cell + $y1 = $pdf->GetY(); + + $pdf->SetXY($col2_x, $y); $pdf->SetFont($font_face, 'B'); $pdf->Cell($label_width, $line_height, 'TAX:'); $pdf->SetFont($font_face, ''); $pdf->MultiCell(0, $line_height, number_format($invoice->getVAT(), 2), 0, 'R'); - $pdf->SetX($col2_x); + // get Y after right cell + $y2 = $pdf->GetY(); + + // get row height + $y = max($y1, $y2); + + $pdf->SetXY($col1_x, $y); + $pdf->Cell($label_width, $line_height, 'Emp. ID/Card No./Ref. By:'); + $pdf->MultiCell($val_width, $line_height, $obj->getPromoDetail(), 0, 'L'); + + // get Y after left cell + $y1 = $pdf->GetY(); + + $pdf->SetXY($col2_x, $y); $pdf->SetFont($font_face, 'B'); $pdf->Cell($label_width, $line_height, 'DISCOUNT:'); $pdf->SetFont($font_face, ''); $pdf->MultiCell(0, $line_height, number_format($invoice->getDiscount(), 2), 0, 'R'); - $pdf->SetX($col2_x); + // get Y after right cell + $y2 = $pdf->GetY(); + + // get row height + $y = max($y1, $y2); + + $pdf->SetXY($col1_x, $y); + $pdf->Cell($label_width, $line_height, 'Discount Type:'); + $pdf->MultiCell($val_width, $line_height, $invoice->getPromo()->getName(), 0, 'L'); + + $pdf->SetXY($col2_x, $y); $pdf->SetFont($font_face, 'B'); $pdf->Cell($label_width, $line_height, 'FINAL AMOUNT:'); $pdf->MultiCell(0, $line_height, number_format($invoice->getTotalPrice(), 2), 0, 'R');