RE: How to print Batch Number On Tax Invoice
You need to modify PrintCustTras.php or PrintCustTransPortrait.php depending on if you print portrait or landscape.
Add "stockmaster.controlled," to the sql statements around lines 264 and 288.
then where you want to print the Lot or Serial# you can add code something like the below (Somewhere around line 368 after descriptions and translations have printed
if ($myrow2['controlled']==1){
$GetControlMovts = DB_query("SELECT moveqty,
serialno
FROM stockserialmoves
WHERE stockmoveno='" . $myrow2['stkmoveno'] . "'",$db);
if ($myrow2['serialised']==1){
while ($ControlledMovtRow = DB_fetch_array($GetControlMovts)){
$YPos -= (10*$lines);
$LeftOvers = $pdf->addTextWrap($Left_Margin+10,$YPos,71,$FontSize,_('Serial:'),'right');
$LeftOvers = $pdf->addTextWrap($Left_Margin+82,$YPos,100,$FontSize,$ControlledMovtRow['serialno'],'left');
if ($YPos-$line_height <= $Bottom_Margin){
/* head up a new invoice/credit note page */
/*draw the vertical column lines right to the bottom */
PrintLinesToBottom ();
include ('includes/PDFTransPageHeaderPortrait.inc');
} //end if need a new page headed up
}
} else {
while ($ControlledMovtRow = DB_fetch_array($GetControlMovts)){
$YPos -= (10*$lines);
$LeftOvers = $pdf->addTextWrap($Left_Margin+10,$YPos,71,$FontSize,_('Lot:'),'right');
$LeftOvers = $pdf->addTextWrap($Left_Margin+82,$YPos,100,$FontSize,(-$ControlledMovtRow['moveqty']) . ' x ' . $ControlledMovtRow['serialno'],'left');
if ($YPos-$line_height <= $Bottom_Margin){
/* head up a new invoice/credit note page */
/*draw the vertical column lines right to the bottom */
PrintLinesToBottom ();
include ('includes/PDFTransPageHeaderPortrait.inc');
} //end if need a new page headed up
}
}
}
|