<?php
-
+/**********************************************************************
+ Copyright (C) FrontAccounting, LLC.
+ Released under the terms of the GNU General Public License, GPL,
+ as published by the Free Software Foundation, either version 3
+ of the License, or (at your option) any later version.
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ See the License here <http://www.gnu.org/licenses/gpl-3.0.html>.
+***********************************************************************/
//----------------------------------------------------------------------------------------
function get_demand_qty($stockid, $location)
{
db_escape($order->Comments) .",'" .
date2sql($order->document_date) . "', " .
db_escape($order->sales_type) . ", " .
- $_POST['ship_via'] ."," .
+ db_escape($order->ship_via)."," .
db_escape($order->deliver_to) . "," .
db_escape($order->delivery_address) . ", " .
db_escape($order->phone) . ", " .
$order->set_branch($myrow["branch_code"], $myrow["tax_group_id"],
$myrow["tax_group_name"], $myrow["contact_phone"], $myrow["contact_email"]);
- $order->set_sales_type($myrow["sales_type_id"], $myrow["sales_type"], $myrow["tax_included"]);
+ $order->set_sales_type($myrow["sales_type_id"], $myrow["sales_type"],
+ $myrow["tax_included"], 0); // no default price calculations on edit
$order->set_location($myrow["from_stk_loc"], $myrow["location_name"]);
{
if (!is_date($invdate))
{
- return Today();
+ return new_doc_date();
}
$sql = "SELECT ".TB_PREF."debtors_master.debtor_no, ".TB_PREF."debtors_master.payment_terms, ".TB_PREF."payment_terms.* FROM ".TB_PREF."debtors_master,
".TB_PREF."payment_terms WHERE ".TB_PREF."debtors_master.payment_terms = ".TB_PREF."payment_terms.terms_indicator AND
.TB_PREF."debtors_master.address, "
.TB_PREF."credit_status.dissallow_invoices, "
.TB_PREF."debtors_master.sales_type AS salestype, "
+ .TB_PREF."debtors_master.dimension_id, "
+ .TB_PREF."debtors_master.dimension2_id, "
.TB_PREF."sales_types.sales_type, "
.TB_PREF."sales_types.tax_included, "
+ .TB_PREF."sales_types.factor, "
.TB_PREF."debtors_master.curr_code, "
- .TB_PREF."debtors_master.discount
+ .TB_PREF."debtors_master.discount,"
+ .TB_PREF."debtors_master.pymt_discount
FROM ".TB_PREF."debtors_master, "
.TB_PREF."credit_status, "
.TB_PREF."sales_types