Topic: Adding delivery-date for each item in sales-invoice
Hi,
I want the 'delivery date' for each item in salesinvoice ((new) column 'Date' ('tran_date' of delivery)). I know I have to change the function 'get_customer_trans_details' in '/sales/includes/db/cust_trans_details_db.inc', but how to select the 'tran_date' of the delivery in the sql-syntax ?
This is the function :
function get_customer_trans_details($debtor_trans_type, $debtor_trans_no)
{
if (!is_array($debtor_trans_no))
$debtor_trans_no = array( 0=>$debtor_trans_no );$sql = "SELECT line.*,
line.unit_price+line.unit_tax AS FullUnitPrice,
line.unit_price AS UnitPriceExTax,
line.description AS StockDescription,
item.long_description AS StockLongDescription,
item.units, item.mb_flag
FROM "
.TB_PREF."debtor_trans_details line,"
.TB_PREF."stock_master item
WHERE (";$tr=array();
foreach ($debtor_trans_no as $trans_no)
$tr[] = 'debtor_trans_no='.db_escape($trans_no);$sql .= implode(' OR ', $tr);
$sql.= ") AND debtor_trans_type=".db_escape($debtor_trans_type)."
AND item.stock_id=line.stock_id
ORDER BY id";
return db_query($sql, "The debtor transaction detail could not be queried");
}
Thanks,
F.