$sql= "SELECT ".TB_PREF."sales_orders.order_no,
".TB_PREF."sales_orders.debtor_no,
".TB_PREF."sales_orders.branch_code,
$sql= "SELECT ".TB_PREF."sales_orders.order_no,
".TB_PREF."sales_orders.debtor_no,
".TB_PREF."sales_orders.branch_code,
".TB_PREF."stock_master.description,
".TB_PREF."stock_master.units,
".TB_PREF."sales_order_details.quantity,
".TB_PREF."stock_master.description,
".TB_PREF."stock_master.units,
".TB_PREF."sales_order_details.quantity,
FROM ".TB_PREF."sales_orders
INNER JOIN ".TB_PREF."sales_order_details
ON ".TB_PREF."sales_orders.order_no = ".TB_PREF."sales_order_details.order_no
FROM ".TB_PREF."sales_orders
INNER JOIN ".TB_PREF."sales_order_details
ON ".TB_PREF."sales_orders.order_no = ".TB_PREF."sales_order_details.order_no
- $sql .= "AND ".TB_PREF."sales_order_details.quantity - ".TB_PREF."sales_order_details.qty_invoiced > 0";
- $sql .= " ORDER BY ".TB_PREF."sales_orders.order_no";
-
+ $sql .= "AND ".TB_PREF."sales_order_details.quantity - ".TB_PREF."sales_order_details.qty_sent > 0";
+ $sql .= " ORDER BY ".TB_PREF."sales_orders.order_no";
+
//----------------------------------------------------------------------------------------------------
function print_order_status_list()
{
global $path_to_root;
//----------------------------------------------------------------------------------------------------
function print_order_status_list()
{
global $path_to_root;
$cols = array(0, 60, 150, 260, 325, 385, 450, 515);
$cols = array(0, 60, 150, 260, 325, 385, 450, 515);
$headers2 = array(_('Order'), _('Customer'), _('Branch'), _('Customer Ref'),
_('Ord Date'), _('Del Date'), _('Loc'));
$headers2 = array(_('Order'), _('Customer'), _('Branch'), _('Customer Ref'),
_('Ord Date'), _('Del Date'), _('Loc'));
$aligns = array('left', 'left', 'right', 'right', 'right', 'right', 'right');
$headers = array(_('Code'), _('Description'), _('Ordered'), _('Invoiced'),
$aligns = array('left', 'left', 'right', 'right', 'right', 'right', 'right');
$headers = array(_('Code'), _('Description'), _('Ordered'), _('Invoiced'),
$params = array( 0 => $comments,
1 => array( 'text' => _('Period'), 'from' => $from, 'to' => $to),
2 => array( 'text' => _('Category'), 'from' => $cat,'to' => ''),
$params = array( 0 => $comments,
1 => array( 'text' => _('Period'), 'from' => $from, 'to' => $to),
2 => array( 'text' => _('Category'), 'from' => $cat,'to' => ''),
$rep = new FrontReport(_('Order Status Listing'), "OrderStatusListing.pdf", user_pagesize());
$rep->Font();
$rep->Info($params, $cols, $headers, $aligns, $cols2, $headers2, $aligns2);
$rep = new FrontReport(_('Order Status Listing'), "OrderStatusListing.pdf", user_pagesize());
$rep->Font();
$rep->Info($params, $cols, $headers, $aligns, $cols2, $headers2, $aligns2);
$orderno = 0;
$result = GetSalesOrders($from, $to, $category, $location, $backorder);
$orderno = 0;
$result = GetSalesOrders($from, $to, $category, $location, $backorder);
$rep->NewLine(0, 2, false, $orderno);
if ($orderno != $myrow['order_no'])
{
$rep->NewLine(0, 2, false, $orderno);
if ($orderno != $myrow['order_no'])
{
$rep->TextCol(5, 6, sql2date($myrow['delivery_date']));
$rep->TextCol(6, 7, $myrow['from_stk_loc']);
$rep->NewLine(2);
$rep->TextCol(5, 6, sql2date($myrow['delivery_date']));
$rep->TextCol(6, 7, $myrow['from_stk_loc']);
$rep->NewLine(2);
}
$rep->TextCol(0, 1, $myrow['stk_code']);
$rep->TextCol(1, 2, $myrow['description']);
$rep->TextCol(2, 3, number_format2($myrow['quantity'], $dec));
}
$rep->TextCol(0, 1, $myrow['stk_code']);
$rep->TextCol(1, 2, $myrow['description']);
$rep->TextCol(2, 3, number_format2($myrow['quantity'], $dec));
- $rep->TextCol(3, 4, number_format2($myrow['qty_invoiced'], $dec));
- $rep->TextCol(4, 5, number_format2($myrow['quantity'] - $myrow['qty_invoiced'], $dec));
- if ($myrow['quantity'] - $myrow['qty_invoiced'] > 0)
+ $rep->TextCol(3, 4, number_format2($myrow['qty_sent'], $dec));
+ $rep->TextCol(4, 5, number_format2($myrow['quantity'] - $myrow['qty_sent'], $dec));
+ if ($myrow['quantity'] - $myrow['qty_sent'] > 0)