***********************************************************************/
include_once($path_to_root . "/includes/banking.inc");
include_once($path_to_root . "/includes/db/inventory_db.inc");
+include_once($path_to_root . "/includes/db/allocations_db.inc");
include_once($path_to_root . "/sales/includes/db/sales_order_db.inc");
include_once($path_to_root . "/sales/includes/db/sales_credit_db.inc");
include_once($path_to_root . "/sales/includes/db/sales_invoice_db.inc");
$qty_dispatched = (float)$qty_dispatched;
// echo "update line: $line_id, $doc_type, $qty_dispatched";
- if ($doc_type==0)
+ if ($doc_type == 0)
return false;
else {
- if ($doc_type==ST_SALESORDER)
+ if ($doc_type==ST_SALESORDER || $doc_type==ST_SALESQUOTE)
{
$sql = "UPDATE ".TB_PREF."sales_order_details
SET qty_sent = qty_sent + $qty_dispatched";
if ($auto)
$sql .= ", quantity = quantity + $qty_dispatched";
$sql .= " WHERE id=".db_escape($line_id);
- }
+ }
else
$sql = "UPDATE ".TB_PREF."debtor_trans_details
SET qty_done = qty_done + $qty_dispatched
$myrow["tax_group_name"]);
$cart->reference = $myrow["reference"];
+ $cart->prepaid = $myrow["prepaid"];
$cart->order_no = $myrow["order_"];
$cart->due_date = sql2date($myrow["due_date"]);
$cart->document_date = sql2date($myrow["tran_date"]);
@$myrow["src_id"]);
}
}
+ $cart->prepayments = get_payments_for($trans_no, $doc_type);
+
} // !newdoc
return true;
return db_query($sql,"The related credit notes could not be retreived");
}
-
-?>
\ No newline at end of file