projects
/
fa-stable.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
17c5d03
)
Cleanups (fixed obscure numeric references to some sql helpers results).
author
Janusz Dobrowolski
<janusz@frontaccounting.eu>
Mon, 5 Nov 2018 11:02:11 +0000
(12:02 +0100)
committer
Janusz Dobrowolski
<janusz@frontaccounting.eu>
Mon, 5 Nov 2018 11:10:10 +0000
(12:10 +0100)
dimensions/dimension_entry.php
patch
|
blob
|
history
dimensions/view/view_dimension.php
patch
|
blob
|
history
manufacturing/includes/db/work_orders_db.inc
patch
|
blob
|
history
manufacturing/includes/manufacturing_ui.inc
patch
|
blob
|
history
manufacturing/work_order_add_finished.php
patch
|
blob
|
history
manufacturing/work_order_costs.php
patch
|
blob
|
history
manufacturing/work_order_entry.php
patch
|
blob
|
history
purchasing/includes/db/invoice_db.inc
patch
|
blob
|
history
diff --git
a/dimensions/dimension_entry.php
b/dimensions/dimension_entry.php
index 98c1d120974f9a2b4d41faa21bff1e69b2eb685d..3a11e6656a156fc4141ec047e44a9bce2112ffc2 100644
(file)
--- a/
dimensions/dimension_entry.php
+++ b/
dimensions/dimension_entry.php
@@
-217,9
+217,9
@@
start_table(TABLESTYLE2);
if ($selected_id != -1)
{
if ($selected_id != -1)
{
- $myrow = get_dimension($selected_id);
+ $myrow = get_dimension($selected_id
, true
);
- if (
strlen($myrow[0]) == 0
)
+ if (
$myrow === false
)
{
display_error(_("The dimension sent is not valid."));
display_footer_exit();
{
display_error(_("The dimension sent is not valid."));
display_footer_exit();
diff --git
a/dimensions/view/view_dimension.php
b/dimensions/view/view_dimension.php
index 8b658278a5380417471e43fd4213aa12df55e87f..b6b3df7386463f8c3ef2060df6ecc19f27f6aa08 100644
(file)
--- a/
dimensions/view/view_dimension.php
+++ b/
dimensions/view/view_dimension.php
@@
-42,9
+42,9
@@
if (isset($_POST['Show']))
display_heading($systypes_array[ST_DIMENSION] . " # " . $id);
br(1);
display_heading($systypes_array[ST_DIMENSION] . " # " . $id);
br(1);
-$myrow = get_dimension($id);
+$myrow = get_dimension($id
, true
);
-if (
strlen($myrow[0]) == 0
)
+if (
$myrow == false
)
{
echo _("The dimension number sent is not valid.");
exit;
{
echo _("The dimension number sent is not valid.");
exit;
diff --git
a/manufacturing/includes/db/work_orders_db.inc
b/manufacturing/includes/db/work_orders_db.inc
index 5c7210e5b8572cd5fa6c97a09cb698b12d3b561b..05ddbb6b4075247e1c7cee399f015ec0c8aac3d3 100644
(file)
--- a/
manufacturing/includes/db/work_orders_db.inc
+++ b/
manufacturing/includes/db/work_orders_db.inc
@@
-130,11
+130,11
@@
function get_work_order($woid, $allow_null=false)
AND wo.id=".db_escape($woid)."
GROUP BY wo.id";
AND wo.id=".db_escape($woid)."
GROUP BY wo.id";
- $result = db_query($sql, "The work order
issues
could not be retrieved");
+ $result = db_query($sql, "The work order could not be retrieved");
if (!$allow_null && db_num_rows($result) == 0)
{
if (!$allow_null && db_num_rows($result) == 0)
{
- display_db_error("Could not find work order
$woid"
, $sql);
+ display_db_error("Could not find work order
".(int)$woid
, $sql);
return false;
}
return false;
}
diff --git
a/manufacturing/includes/manufacturing_ui.inc
b/manufacturing/includes/manufacturing_ui.inc
index 812590edd1a9f6a51884f7e5c1921e7cbd5a3867..e3dbbfa3a1e767d627bfa634396c9685f56e18cd 100644
(file)
--- a/
manufacturing/includes/manufacturing_ui.inc
+++ b/
manufacturing/includes/manufacturing_ui.inc
@@
-277,9
+277,9
@@
function display_wo_details($woid, $suppress_view_link=false)
{
global $wo_types_array;
{
global $wo_types_array;
- $myrow = get_work_order($woid);
+ $myrow = get_work_order($woid
, true
);
- if (
strlen($myrow[0]) == 0
)
+ if (
$myrow == false
)
{
display_note(_("The work order number sent is not valid."));
exit;
{
display_note(_("The work order number sent is not valid."));
exit;
@@
-333,9
+333,9
@@
function display_wo_details_quick($woid, $suppress_view_link=false)
{
global $wo_types_array;
{
global $wo_types_array;
- $myrow = get_work_order($woid);
+ $myrow = get_work_order($woid
, true
);
- if (
strlen($myrow[0]) == 0
)
+ if (
$myrow === false
)
{
display_note(_("The work order number sent is not valid."));
exit;
{
display_note(_("The work order number sent is not valid."));
exit;
diff --git
a/manufacturing/work_order_add_finished.php
b/manufacturing/work_order_add_finished.php
index 43072682cbab2e1e777fa0392c14fbf7e0f3f4b0..6d508c64963ac0dd35b9df843f89aa4c4a793893 100644
(file)
--- a/
manufacturing/work_order_add_finished.php
+++ b/
manufacturing/work_order_add_finished.php
@@
-57,9
+57,9
@@
if (isset($_GET['AddedID']))
//--------------------------------------------------------------------------------------------------
//--------------------------------------------------------------------------------------------------
-$wo_details = get_work_order($_POST['selected_id']);
+$wo_details = get_work_order($_POST['selected_id']
, true
);
-if (
strlen($wo_details[0]) == 0
)
+if (
$wo_details === false
)
{
display_error(_("The order number sent is not valid."));
exit;
{
display_error(_("The order number sent is not valid."));
exit;
diff --git
a/manufacturing/work_order_costs.php
b/manufacturing/work_order_costs.php
index bd262f81138d96901c7bd48d1bd360edb20fd219..07efe640b339af563932e2edc0fb97d4a4911c50 100644
(file)
--- a/
manufacturing/work_order_costs.php
+++ b/
manufacturing/work_order_costs.php
@@
-56,9
+56,9
@@
if (isset($_GET['AddedID']))
//--------------------------------------------------------------------------------------------------
//--------------------------------------------------------------------------------------------------
-$wo_details = get_work_order($_POST['selected_id']);
+$wo_details = get_work_order($_POST['selected_id']
, true
);
-if (
strlen($wo_details[0]) == 0
)
+if (
$wo_details === false
)
{
display_error(_("The order number sent is not valid."));
exit;
{
display_error(_("The order number sent is not valid."));
exit;
@@
-139,7
+139,7
@@
if (list_updated('PaymentType'))
$item = get_item($wo_details['stock_id']);
$r = get_default_bank_account(get_company_pref('curr_default'));
$item = get_item($wo_details['stock_id']);
$r = get_default_bank_account(get_company_pref('curr_default'));
-$_POST['cr_acc'] = $r[
0
];
+$_POST['cr_acc'] = $r[
'account_code'
];
$_POST['costs'] = price_format(get_post('PaymentType')==WO_OVERHEAD ? $item['overhead_cost'] : $item['labour_cost']);
amount_row(_("Additional Costs:"), 'costs');
$_POST['costs'] = price_format(get_post('PaymentType')==WO_OVERHEAD ? $item['overhead_cost'] : $item['labour_cost']);
amount_row(_("Additional Costs:"), 'costs');
diff --git
a/manufacturing/work_order_entry.php
b/manufacturing/work_order_entry.php
index aa13e8d5a145150765c775b812b617f918404179..4aea96fb15d8f5d3b8378e08d0e706ad44ddb1d2 100644
(file)
--- a/
manufacturing/work_order_entry.php
+++ b/
manufacturing/work_order_entry.php
@@
-316,9
+316,9
@@
$existing_comments = "";
$dec = 0;
if (isset($selected_id))
{
$dec = 0;
if (isset($selected_id))
{
- $myrow = get_work_order($selected_id);
+ $myrow = get_work_order($selected_id
, true
);
- if (
strlen($myrow[0]) == 0
)
+ if (
$myrow === false
)
{
echo _("The order number sent is not valid.");
safe_exit();
{
echo _("The order number sent is not valid.");
safe_exit();
diff --git
a/purchasing/includes/db/invoice_db.inc
b/purchasing/includes/db/invoice_db.inc
index aee0bfcce7ab478afb5e30da8c23d41a6be008f8..503ed275e3b165f338d1a32683f9ac1eddc5c868 100644
(file)
--- a/
purchasing/includes/db/invoice_db.inc
+++ b/
purchasing/includes/db/invoice_db.inc
@@
-70,10
+70,10
@@
function update_supp_received_items_for_invoice($id, $po_detail_item, $qty_invoi
$sql = "SELECT act_price, unit_price FROM ".TB_PREF."purch_order_details WHERE
po_detail_item = ".db_escape($po_detail_item);
$result = db_query($sql, "The old actual price of the purchase order line could not be retrieved");
$sql = "SELECT act_price, unit_price FROM ".TB_PREF."purch_order_details WHERE
po_detail_item = ".db_escape($po_detail_item);
$result = db_query($sql, "The old actual price of the purchase order line could not be retrieved");
- $row = db_fetch
_row
($result);
- $ret = $row[
0
];
+ $row = db_fetch($result);
+ $ret = $row[
'act_price'
];
- $unit_price = $row[
1
]; //Added by Rasmus
+ $unit_price = $row[
'unit_price'
]; //Added by Rasmus
$sql = "SELECT delivery_date
FROM ".TB_PREF."grn_batch grn,"
$sql = "SELECT delivery_date
FROM ".TB_PREF."grn_batch grn,"
@@
-81,8
+81,8
@@
function update_supp_received_items_for_invoice($id, $po_detail_item, $qty_invoi
WHERE
grn.id = line.grn_batch_id AND line.id=".db_escape($id);
$result = db_query($sql, "The old delivery date from the received record cout not be retrieved");
WHERE
grn.id = line.grn_batch_id AND line.id=".db_escape($id);
$result = db_query($sql, "The old delivery date from the received record cout not be retrieved");
- $row = db_fetch
_row
($result);
- $date = $row[
0
];
+ $row = db_fetch($result);
+ $date = $row[
'delivery_date'
];
}
else
{
}
else
{