/*Insert to purchase order header record */
$sql = "INSERT INTO ".TB_PREF."purch_orders (supplier_id, Comments, ord_date, reference,
- requisition_no, into_stock_location, delivery_address, total, tax_included, prep_amount) VALUES(";
+ supp_reference, into_stock_location, delivery_address, total, tax_included, prep_amount) VALUES(";
$sql .= db_escape($po_obj->supplier_id) . "," .
db_escape($po_obj->Comments) . ",'" .
date2sql($po_obj->tran_date) . "', " .
/*Update the purchase order header with any changes */
$sql = "UPDATE ".TB_PREF."purch_orders SET Comments=" . db_escape($po_obj->Comments) . ",
- requisition_no= ". db_escape( $po_obj->supp_ref). ",
+ supp_reference= ". db_escape( $po_obj->supp_ref). ",
into_stock_location=" . db_escape($po_obj->Location). ",
ord_date='" . date2sql($po_obj->tran_date) . "',
delivery_address=" . db_escape($po_obj->delivery_address).",
$order->tran_date = sql2date($myrow["ord_date"]);
$order->Comments = $myrow["comments"];
$order->Location = $myrow["into_stock_location"];
- $order->supp_ref = $myrow["requisition_no"];
+ $order->supp_ref = $myrow["supp_reference"];
$order->reference = $myrow["reference"];
$order->delivery_address = $myrow["delivery_address"];
$order->alloc = $myrow["alloc"];
porder.reference,
supplier.supp_name,
location.location_name,
- porder.requisition_no,
+ porder.supp_reference,
porder.ord_date,
supplier.curr_code,
Sum(line.unit_price*line.quantity_ordered) AS OrderValue,
porder.reference,
supplier.supp_name,
location.location_name,
- porder.requisition_no,
+ porder.supp_reference,
porder.ord_date,
supplier.curr_code,
Sum(line.unit_price*line.quantity_ordered) AS OrderValue,
trans.id as trans_no,
trans.reference,
supplier.supp_name,
- po.requisition_no AS supp_reference,
+ po.supp_reference,
delivery_date as tran_date,
'' as due_date,
supplier.curr_code,
due_dates.date as due_date,
supplier.address,
amt,
- requisition_no as supp_ref
+ supp_reference as supp_ref
FROM ".TB_PREF."purch_orders as porder
LEFT JOIN ".TB_PREF."suppliers as supplier ON porder.supplier_id = supplier.supplier_id
LEFT JOIN ".TB_PREF."supp_allocations as alloc
{
var $trans_type; // order/grn/invoice (direct)
- var $line_items;
- var $curr_code;
- var $supp_ref;
- var $delivery_address;
+ var $supplier_id;
var $Comments;
+ var $tran_date;
+ var $reference;
+ var $supp_ref;
var $Location;
- var $supplier_id;
+ var $delivery_address;
+
+ var $prep_amount = 0; // prepayment required
+ var $alloc; // sum of payments allocated
+ var $tax_included; // type of prices
+
+ var $line_items;
+ var $curr_code;
var $supplier_name;
- var $tran_date;
var $due_date;
var $order_no; /*Only used for modification of existing orders otherwise only established when order committed */
var $lines_on_order = 0;
var $credit;
var $tax_group_id;
var $tax_group_array = null; // saves db queries
- var $tax_included; // type of prices
var $terms;
var $ex_rate;
var $cash_account;
var $dimension,
$dimension2;
- var $reference;
var $tax_overrides = array(); // array of taxes manually inserted during sales invoice entry (direct invoice)
-
- var $prep_amount = 0; // prepayment required
- var $alloc; // sum of payments allocated
+
var $prepayments = array();
var $fixed_asset = false;
var $price;
var $units;
var $req_del_date;
- var $tax_type;
- var $tax_type_name;
var $quantity; // this document line quantity
var $qty_inv; // quantity already invoiced against this line (all PIs)
$this->req_del_date = $req_del_date;
$this->price = $prc;
// $this->units = $uom;
- $this->tax_type = $item_row["tax_type_id"];
- $this->tax_type_name = $item_row["tax_type_name"];
$this->units = $item_row["units"];
$this->qty_received = $qty_recd;
$this->qty_inv = $qty_inv;
$this->qty_ordered = $qty_ordered;
}
- // Deprecated, use with care. If you need line value as it is calculated in invoice, use taxfree_charge_value below.
- function taxfree_charge_price($po)
- {
- return get_tax_free_price_for_item($this->stock_id, $this->price,
- $po->tax_group_id, $po->tax_included, $po->tax_group_array);
- }
-
//
// GRN line tax free value.
//
_("Customer's Reference") => $this->formData['supp_account_no'],
_("Sales Person") => $this->formData['contact'],
_("Your VAT no.") => $this->formData['tax_id'],
- _("Supplier's Reference") => @$this->formData['requisition_no'],
+ _("Supplier's Reference") => @$this->formData['supp_reference'],
_("Order Date") => sql2date($this->formData['document_date']),
);
'DebtorName', 'supp_account_no', 'wo_ref', 'debtor_ref','type', 'trans_no',
'StockItemName', 'tax_id', 'order_', 'delivery_date', 'units_issued',
'due_date', 'required_by', 'payment_terms', 'curr_code',
- 'ov_freight', 'ov_gst', 'ov_amount', 'prepaid', 'requisition_no', 'contact'),
+ 'ov_freight', 'ov_gst', 'ov_amount', 'prepaid', 'supp_reference', 'contact'),
'branch' => array('br_address', 'br_name', 'salesman', 'disable_branch'),
'sales_order' => array('deliver_to', 'delivery_address', 'customer_ref'),
'bankaccount' => array('bank_name', 'bank_account_number', 'payment_service')
# reliable cost change log in stock_moves
ALTER TABLE `0_stock_moves` CHANGE COLUMN `standard_cost` `unit_cost` double NOT NULL DEFAULT '0';
ALTER TABLE `0_debtor_trans_details` CHANGE COLUMN `standard_cost` `unit_cost` double NOT NULL DEFAULT '0';
+#naming cleanups
+ALTER TABLE `0_purch_orders` CHANGE COLUMN `requisition_no` `supp_reference` tinytext;
`comments` tinytext,
`ord_date` date NOT NULL DEFAULT '0000-00-00',
`reference` tinytext NOT NULL,
- `requisition_no` tinytext,
+ `supp_reference` tinytext,
`into_stock_location` varchar(5) NOT NULL DEFAULT '',
`delivery_address` tinytext NOT NULL,
`total` double NOT NULL DEFAULT '0',
`comments` tinytext,
`ord_date` date NOT NULL DEFAULT '0000-00-00',
`reference` tinytext NOT NULL,
- `requisition_no` tinytext,
+ `supp_reference` tinytext,
`into_stock_location` varchar(5) NOT NULL DEFAULT '',
`delivery_address` tinytext NOT NULL,
`total` double NOT NULL DEFAULT '0',