projects
/
fa-stable.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
8a566dd
)
Changed naming convention in purchase order class (orig_order_date ->tran_date)
author
Janusz Dobrowolski
<janusz@frontaccounting.eu>
Wed, 3 Jul 2019 11:19:09 +0000
(13:19 +0200)
committer
Janusz Dobrowolski
<janusz@frontaccounting.eu>
Mon, 19 Aug 2019 10:41:57 +0000
(12:41 +0200)
purchasing/includes/db/grn_db.inc
patch
|
blob
|
history
purchasing/includes/db/po_db.inc
patch
|
blob
|
history
purchasing/includes/po_class.inc
patch
|
blob
|
history
purchasing/includes/purchasing_db.inc
patch
|
blob
|
history
purchasing/includes/ui/grn_ui.inc
patch
|
blob
|
history
purchasing/includes/ui/invoice_ui.inc
patch
|
blob
|
history
purchasing/includes/ui/po_ui.inc
patch
|
blob
|
history
purchasing/po_entry_items.php
patch
|
blob
|
history
purchasing/po_receive_items.php
patch
|
blob
|
history
diff --git
a/purchasing/includes/db/grn_db.inc
b/purchasing/includes/db/grn_db.inc
index 740ef18ca4713c06480b085f330781324a5ae86d..e66c0910a4fe722d8b8abc21a08c70d6df7d0aaa 100644
(file)
--- a/
purchasing/includes/db/grn_db.inc
+++ b/
purchasing/includes/db/grn_db.inc
@@
-85,7
+85,7
@@
function write_grn(&$po)
{
global $Refs;
{
global $Refs;
- $date_ = $po->
orig_order
_date;
+ $date_ = $po->
tran
_date;
$grn = $po->grn_id;
begin_transaction();
$grn = $po->grn_id;
begin_transaction();
@@
-404,7
+404,7
@@
function read_grn($grn_batch, &$order)
{
$order->trans_type = ST_SUPPRECEIVE;
{
$order->trans_type = ST_SUPPRECEIVE;
- $order->
orig_order
_date = sql2date($row["delivery_date"]);
+ $order->
tran
_date = sql2date($row["delivery_date"]);
$order->Location = $row["loc_code"];
$order->reference = $row["reference"];
$order->grn_id = $grn_batch;
$order->Location = $row["loc_code"];
$order->reference = $row["reference"];
$order->grn_id = $grn_batch;
diff --git
a/purchasing/includes/db/po_db.inc
b/purchasing/includes/db/po_db.inc
index c11e7b9b903622227cb9c47bbc2299e3db9f3c5f..75da89da6eb83c0cf7fb26abe8b09b23437421d0 100644
(file)
--- a/
purchasing/includes/db/po_db.inc
+++ b/
purchasing/includes/db/po_db.inc
@@
-74,7
+74,7
@@
function add_po(&$po_obj)
requisition_no, into_stock_location, delivery_address, total, tax_included, prep_amount) VALUES(";
$sql .= db_escape($po_obj->supplier_id) . "," .
db_escape($po_obj->Comments) . ",'" .
requisition_no, 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->
orig_order
_date) . "', " .
+ date2sql($po_obj->
tran
_date) . "', " .
db_escape($po_obj->reference) . ", " .
db_escape($po_obj->supp_ref) . ", " .
db_escape($po_obj->Location) . ", " .
db_escape($po_obj->reference) . ", " .
db_escape($po_obj->supp_ref) . ", " .
db_escape($po_obj->Location) . ", " .
@@
-103,7
+103,7
@@
function add_po(&$po_obj)
$Refs->save(ST_PURCHORDER, $po_obj->order_no, $po_obj->reference);
$Refs->save(ST_PURCHORDER, $po_obj->order_no, $po_obj->reference);
- add_audit_trail(ST_PURCHORDER, $po_obj->order_no, $po_obj->
orig_order
_date);
+ add_audit_trail(ST_PURCHORDER, $po_obj->order_no, $po_obj->
tran
_date);
hook_db_postwrite($po_obj, ST_PURCHORDER);
commit_transaction();
hook_db_postwrite($po_obj, ST_PURCHORDER);
commit_transaction();
@@
-121,7
+121,7
@@
function update_po(&$po_obj)
$sql = "UPDATE ".TB_PREF."purch_orders SET Comments=" . db_escape($po_obj->Comments) . ",
requisition_no= ". db_escape( $po_obj->supp_ref). ",
into_stock_location=" . db_escape($po_obj->Location). ",
$sql = "UPDATE ".TB_PREF."purch_orders SET Comments=" . db_escape($po_obj->Comments) . ",
requisition_no= ". db_escape( $po_obj->supp_ref). ",
into_stock_location=" . db_escape($po_obj->Location). ",
- ord_date='" . date2sql($po_obj->
orig_order
_date) . "',
+ ord_date='" . date2sql($po_obj->
tran
_date) . "',
delivery_address=" . db_escape($po_obj->delivery_address).",
total=". db_escape($po_obj->get_trans_total()).",
prep_amount=". db_escape($po_obj->prep_amount).",
delivery_address=" . db_escape($po_obj->delivery_address).",
total=". db_escape($po_obj->get_trans_total()).",
prep_amount=". db_escape($po_obj->prep_amount).",
@@
-149,7
+149,7
@@
function update_po(&$po_obj)
db_query($sql, "One of the purchase order detail records could not be updated");
}
db_query($sql, "One of the purchase order detail records could not be updated");
}
- reallocate_payments($po_obj->order_no, ST_PURCHORDER, $po_obj->
orig_order
_date, $po_obj->get_trans_total(), $po_obj->prepayments, $po_obj->supplier_id);
+ reallocate_payments($po_obj->order_no, ST_PURCHORDER, $po_obj->
tran
_date, $po_obj->get_trans_total(), $po_obj->prepayments, $po_obj->supplier_id);
add_audit_trail($po_obj->trans_type, $po_obj->order_no, Today(), _("Updated."));
hook_db_postwrite($po_obj, ST_PURCHORDER);
add_audit_trail($po_obj->trans_type, $po_obj->order_no, Today(), _("Updated."));
hook_db_postwrite($po_obj, ST_PURCHORDER);
@@
-185,7
+185,7
@@
function read_po_header($order_no, &$order)
$order->credit = get_current_supp_credit($order->supplier_id);
$order->credit = get_current_supp_credit($order->supplier_id);
- $order->
orig_order
_date = sql2date($myrow["ord_date"]);
+ $order->
tran
_date = sql2date($myrow["ord_date"]);
$order->Comments = $myrow["comments"];
$order->Location = $myrow["into_stock_location"];
$order->supp_ref = $myrow["requisition_no"];
$order->Comments = $myrow["comments"];
$order->Location = $myrow["into_stock_location"];
$order->supp_ref = $myrow["requisition_no"];
diff --git
a/purchasing/includes/po_class.inc
b/purchasing/includes/po_class.inc
index b7f15ac5307b5864aa6e3ea13590e7eea723d4ad..970cce200f72a34a81aa165858084004048bf1d3 100644
(file)
--- a/
purchasing/includes/po_class.inc
+++ b/
purchasing/includes/po_class.inc
@@
-24,7
+24,7
@@
class purch_order
var $Location;
var $supplier_id;
var $supplier_name;
var $Location;
var $supplier_id;
var $supplier_name;
- var $
orig_order
_date;
+ 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 $due_date;
var $order_no; /*Only used for modification of existing orders otherwise only established when order committed */
var $lines_on_order = 0;
diff --git
a/purchasing/includes/purchasing_db.inc
b/purchasing/includes/purchasing_db.inc
index c963fa4a221c5f557e9860b501db58116d3ad436..745b175b2ec375260be392d531303f1f5aa253db 100644
(file)
--- a/
purchasing/includes/purchasing_db.inc
+++ b/
purchasing/includes/purchasing_db.inc
@@
-153,7
+153,7
@@
function add_direct_supp_trans($cart)
if ($cart->trans_type != ST_PURCHORDER) {
// for direct grn/invoice set same dates for lines as for whole document
foreach ($cart->line_items as $line_no =>$line)
if ($cart->trans_type != ST_PURCHORDER) {
// for direct grn/invoice set same dates for lines as for whole document
foreach ($cart->line_items as $line_no =>$line)
- $cart->line_items[$line_no]->req_del_date = $cart->
orig_order
_date;
+ $cart->line_items[$line_no]->req_del_date = $cart->
tran
_date;
}
$ref = $cart->reference;
}
$ref = $cart->reference;
@@
-182,7
+182,7
@@
function add_direct_supp_trans($cart)
$inv = new supp_trans(ST_SUPPINVOICE);
$inv->Comments = $cart->Comments;
$inv->supplier_id = $cart->supplier_id;
$inv = new supp_trans(ST_SUPPINVOICE);
$inv->Comments = $cart->Comments;
$inv->supplier_id = $cart->supplier_id;
- $inv->tran_date = $cart->
orig_order
_date;
+ $inv->tran_date = $cart->
tran
_date;
$inv->due_date = $cart->due_date;
$inv->dimension = $cart->dimension;
$inv->dimension2 = $cart->dimension2;
$inv->due_date = $cart->due_date;
$inv->dimension = $cart->dimension;
$inv->dimension2 = $cart->dimension2;
diff --git
a/purchasing/includes/ui/grn_ui.inc
b/purchasing/includes/ui/grn_ui.inc
index 8fb7568a523c43f2fe6b73100f56ef8b4e273d6b..370687ab71760af9f567ff15299ddfec94da716b 100644
(file)
--- a/
purchasing/includes/ui/grn_ui.inc
+++ b/
purchasing/includes/ui/grn_ui.inc
@@
-25,7
+25,7
@@
function display_grn_summary(&$po)
label_cells(_("For Purchase Order"), get_trans_view_str(ST_PURCHORDER, $po->order_no),
"class='tableheader2'");
label_cells(_("For Purchase Order"), get_trans_view_str(ST_PURCHORDER, $po->order_no),
"class='tableheader2'");
- label_cells(_("Delivery
Date"), $po->orig_order_date, "class='tableheader2'"); // FIXME: delivery date
+ label_cells(_("Delivery
On"), $po->tran_date, "class='tableheader2'");
end_row();
start_row();
end_row();
start_row();
@@
-56,7
+56,7
@@
function edit_grn_summary(&$po)
label_row(_("For Purchase Order"), get_trans_view_str(ST_PURCHORDER, $po->order_no));
label_row(_("For Purchase Order"), get_trans_view_str(ST_PURCHORDER, $po->order_no));
- label_row(_("Ordered On"), $po->
orig_order
_date);
+ label_row(_("Ordered On"), $po->
tran
_date);
table_section(2);
if (!isset($_POST['ref']))
table_section(2);
if (!isset($_POST['ref']))
@@
-67,10
+67,10
@@
function edit_grn_summary(&$po)
locations_list_row(_("Deliver Into Location"), "Location", $_POST['Location']);
locations_list_row(_("Deliver Into Location"), "Location", $_POST['Location']);
- if (!isset($_POST['
DefaultReceivedD
ate']))
- $_POST['
DefaultReceivedD
ate'] = new_doc_date();
+ if (!isset($_POST['
tran_d
ate']))
+ $_POST['
tran_d
ate'] = new_doc_date();
- date_row(_("Date Items Received"), '
DefaultReceivedD
ate', '', true, 0, 0, 0, '', true);
+ date_row(_("Date Items Received"), '
tran_d
ate', '', true, 0, 0, 0, '', true);
table_section(3);
label_row(_("Supplier's Reference"), $po->supp_ref);
table_section(3);
label_row(_("Supplier's Reference"), $po->supp_ref);
@@
-81,7
+81,7
@@
function edit_grn_summary(&$po)
label_row(_("Order Comments"), $po->Comments, "class='tableheader2'", "colspan=9");
if (!is_company_currency($po->curr_code))
label_row(_("Order Comments"), $po->Comments, "class='tableheader2'", "colspan=9");
if (!is_company_currency($po->curr_code))
- exchange_rate_display(get_company_currency(), $po->curr_code, get_post('
DefaultReceivedD
ate'));
+ exchange_rate_display(get_company_currency(), $po->curr_code, get_post('
tran_d
ate'));
end_outer_table(1);
}
end_outer_table(1);
}
diff --git
a/purchasing/includes/ui/invoice_ui.inc
b/purchasing/includes/ui/invoice_ui.inc
index fc779227793c7c0497f8a73933df2665fca5de8a..04a008793e1ecdadb60715260777de43c6ce72bd 100644
(file)
--- a/
purchasing/includes/ui/invoice_ui.inc
+++ b/
purchasing/includes/ui/invoice_ui.inc
@@
-596,7
+596,7
@@
function display_grn_items(&$supp_trans, $mode=0)
//--------------------------------------------------------------------------------------------------
function get_duedate_from_terms(&$trans)
{
//--------------------------------------------------------------------------------------------------
function get_duedate_from_terms(&$trans)
{
- $date =
get_class($trans) == 'purch_order' ? $trans->orig_order_date :
$trans->tran_date;
+ $date = $trans->tran_date;
if (!is_date($date))
{
if (!is_date($date))
{
diff --git
a/purchasing/includes/ui/po_ui.inc
b/purchasing/includes/ui/po_ui.inc
index 88385649307122e43961df37c0f61557ed92497c..34252f3427a325df1302e5ec08a2986b195e02c9 100644
(file)
--- a/
purchasing/includes/ui/po_ui.inc
+++ b/
purchasing/includes/ui/po_ui.inc
@@
-18,7
+18,7
@@
function copy_from_cart()
$cart = &$_SESSION['PO'];
$_POST['supplier_id'] = $cart->supplier_id;
$cart = &$_SESSION['PO'];
$_POST['supplier_id'] = $cart->supplier_id;
- $_POST['OrderDate'] = $cart->
orig_order
_date;
+ $_POST['OrderDate'] = $cart->
tran
_date;
if ($cart->trans_type == ST_SUPPINVOICE)
$_POST['due_date'] = $cart->due_date;
$_POST['supp_ref'] = $cart->supp_ref;
if ($cart->trans_type == ST_SUPPINVOICE)
$_POST['due_date'] = $cart->due_date;
$_POST['supp_ref'] = $cart->supp_ref;
@@
-40,7
+40,7
@@
function copy_to_cart()
$cart = &$_SESSION['PO'];
$cart->supplier_id = $_POST['supplier_id'];
$cart = &$_SESSION['PO'];
$cart->supplier_id = $_POST['supplier_id'];
- $cart->
orig_order
_date = $_POST['OrderDate'];
+ $cart->
tran
_date = $_POST['OrderDate'];
if ($cart->trans_type == ST_SUPPINVOICE)
{
$cart->due_date = $_POST['due_date'];
if ($cart->trans_type == ST_SUPPINVOICE)
{
$cart->due_date = $_POST['due_date'];
@@
-85,7
+85,7
@@
function create_cart($trans_type, $trans_no)
$_POST['OrderDate'] = new_doc_date();
if (!is_date_in_fiscalyear($_POST['OrderDate']))
$_POST['OrderDate'] = end_fiscalyear();
$_POST['OrderDate'] = new_doc_date();
if (!is_date_in_fiscalyear($_POST['OrderDate']))
$_POST['OrderDate'] = end_fiscalyear();
- $cart->due_date = $cart->
orig_order
_date = $_POST['OrderDate'];
+ $cart->due_date = $cart->
tran
_date = $_POST['OrderDate'];
/* read in all the selected order into the Items cart */
if ($trans_no) {
read_po($trans_no, $cart);
/* read in all the selected order into the Items cart */
if ($trans_no) {
read_po($trans_no, $cart);
@@
-145,7
+145,7
@@
function display_po_header(&$order)
'OrderDate', '', true, 0, 0, 0, null, true);
if (isset($_POST['_OrderDate_changed'])) {
'OrderDate', '', true, 0, 0, 0, null, true);
if (isset($_POST['_OrderDate_changed'])) {
- $order->
orig_order
_date = $_POST['OrderDate'];
+ $order->
tran
_date = $_POST['OrderDate'];
get_duedate_from_terms($order);
$_POST['due_date'] = $order->due_date;
$Ajax->activate('due_date');
get_duedate_from_terms($order);
$_POST['due_date'] = $order->due_date;
$Ajax->activate('due_date');
@@
-321,7
+321,7
@@
function display_po_summary(&$po, $is_self=false, $editable=false)
}
end_row();
start_row();
}
end_row();
start_row();
- label_cells(_("Date"), $po->
orig_order
_date, "class='tableheader2'");
+ label_cells(_("Date"), $po->
tran
_date, "class='tableheader2'");
if ($editable)
{
if ($editable)
{
diff --git
a/purchasing/po_entry_items.php
b/purchasing/po_entry_items.php
index b562e7cfa9e77cbdc725804e76740bafc026cdc0..0a79185514aaf447e884076caa84fc0204b12cd5 100644
(file)
--- a/
purchasing/po_entry_items.php
+++ b/
purchasing/po_entry_items.php
@@
-418,7
+418,7
@@
function handle_commit_order()
if (can_commit()) {
copy_to_cart();
if (can_commit()) {
copy_to_cart();
- new_doc_date($cart->
orig_order
_date);
+ new_doc_date($cart->
tran
_date);
if ($cart->order_no == 0) { // new po/grn/invoice
$trans_no = add_direct_supp_trans($cart);
if ($trans_no) {
if ($cart->order_no == 0) { // new po/grn/invoice
$trans_no = add_direct_supp_trans($cart);
if ($trans_no) {
diff --git
a/purchasing/po_receive_items.php
b/purchasing/po_receive_items.php
index 2850496dca12f55cadc6c2fe25ae69ed52beeca6..5d3bff5d6c1f7b3ff61305dd63849618f3ae6f47 100644
(file)
--- a/
purchasing/po_receive_items.php
+++ b/
purchasing/po_receive_items.php
@@
-202,15
+202,15
@@
function can_process()
return false;
}
return false;
}
- if (!is_date($_POST['
DefaultReceivedD
ate']))
+ if (!is_date($_POST['
tran_d
ate']))
{
display_error(_("The entered date is invalid."));
{
display_error(_("The entered date is invalid."));
- set_focus('
DefaultReceivedD
ate');
+ set_focus('
tran_d
ate');
return false;
}
return false;
}
- if (!is_date_in_fiscalyear($_POST['
DefaultReceivedD
ate'])) {
+ if (!is_date_in_fiscalyear($_POST['
tran_d
ate'])) {
display_error(_("The entered date is out of fiscal year or is closed for further data entry."));
display_error(_("The entered date is out of fiscal year or is closed for further data entry."));
- set_focus('
DefaultReceivedD
ate');
+ set_focus('
tran_d
ate');
return false;
}
return false;
}
@@
-291,7
+291,7
@@
function process_receive_po()
}
$grn = &$_SESSION['PO'];
}
$grn = &$_SESSION['PO'];
- $grn->
orig_order_date = $_POST['DefaultReceivedD
ate'];
+ $grn->
tran_date = $_POST['tran_d
ate'];
$grn->reference = $_POST['ref'];
$grn->Location = $_POST['Location'];
$grn->ex_rate = input_num('_ex_rate', null);
$grn->reference = $_POST['ref'];
$grn->Location = $_POST['Location'];
$grn->ex_rate = input_num('_ex_rate', null);
@@
-299,7
+299,7
@@
function process_receive_po()
$trans_no = write_grn($grn);
$new = $grn->grn_id == 0;
$trans_no = write_grn($grn);
$new = $grn->grn_id == 0;
- new_doc_date($_POST['
DefaultReceivedD
ate']);
+ new_doc_date($_POST['
tran_d
ate']);
unset($_SESSION['PO']->line_items);
unset($_SESSION['PO']);
unset($_SESSION['PO']->line_items);
unset($_SESSION['PO']);
@@
-322,8
+322,8
@@
if (isset($_POST['Update']) || isset($_POST['ProcessGoodsReceived']))
if (!check_num($line->line_no))
$_POST[$line->line_no] = number_format2(0, get_qty_dec($line->stock_id));
if (!check_num($line->line_no))
$_POST[$line->line_no] = number_format2(0, get_qty_dec($line->stock_id));
- if (!isset($_POST['
DefaultReceivedDate']) || $_POST['DefaultReceivedD
ate'] == "")
- $_POST['
DefaultReceivedD
ate'] = new_doc_date();
+ if (!isset($_POST['
tran_date']) || $_POST['tran_d
ate'] == "")
+ $_POST['
tran_d
ate'] = new_doc_date();
$_SESSION['PO']->line_items[$line->line_no]->quantity = input_num($line->line_no);
$_SESSION['PO']->line_items[$line->line_no]->quantity = input_num($line->line_no);