Well I ran into this little problem:
The invoice details where showing as IDs instead of the actual data when printing the Invoice (Master Detail printing).
Here is the solution:
Instead of this:
Code: Select all
$id=makeSafe($_POST['SelectedID']);
$footer="<script>\$('invoiceItems').innerHTML='<br><br><table cellpadding=\"3\" cellspacing=\"0\">";
$footer.='<tr><td class="TableHeaderPrint">Product</td><td class="TableHeaderPrint">Net Weight</td><td class="TableHeaderPrint">Gross Weight</td><td class="TableHeaderPrint">Carton Number</td></tr>';
$res=sql("select Product, NetWeight, GrossWeight, CartonNumber from Invoice_Details where IDLet='$id' order by ID",$eo);
while($row=mysql_fetch_row($res)){
$footer.='<tr>';
$footer.='<td class="TableBodyPrint">'.$row[0].'</td>';
$footer.='<td class="TableBodyPrint" align="right">'.$row[1].'</td>';
$footer.='<td class="TableBodyPrint" align="right">'.$row[2].'</td>';
$footer.='<td class="TableBodyPrint" align="right">'.$row[3].'</td>';
$footer.='</tr>';
}
$footer.="</table>';";
$footer.='</script>';
Code: Select all
$id=makeSafe($_POST['SelectedID']);
$footer="<script>\$('invoiceItems').innerHTML='<br><br><table cellpadding=\"3\" cellspacing=\"0\">";
$footer.='<tr><td class="TableHeaderPrint">Product</td><td class="TableHeaderPrint">Net Weight</td><td class="TableHeaderPrint">Gross Weight</td><td class="TableHeaderPrint">Carton Number</td></tr>';
$res=sql("select (Select Product from Products where Products.ProductID = Invoice_Details.Product limit 1) as Product, NetWeight, GrossWeight, CartonNumber from Invoice_Details where IDLet='$id' order by ID",$eo);
while($row=mysql_fetch_row($res)){
$footer.='<tr>';
$footer.='<td class="TableBodyPrint">'.$row[0].'</td>';
$footer.='<td class="TableBodyPrint" align="right">'.$row[1].'</td>';
$footer.='<td class="TableBodyPrint" align="right">'.$row[2].'</td>';
$footer.='<td class="TableBodyPrint" align="right">'.$row[3].'</td>';
$footer.='</tr>';
}
$footer.="</table>';";
$footer.='</script>';