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:
5189bc2
)
Fixed warnings related to empty item/customer/supplier selector in search modes.
author
Janusz Dobrowolski
<janusz@frontaccounting.eu>
Mon, 28 Sep 2020 19:42:32 +0000
(21:42 +0200)
committer
Janusz Dobrowolski
<janusz@frontaccounting.eu>
Mon, 28 Sep 2020 19:42:32 +0000
(21:42 +0200)
gl/includes/db/gl_db_bank_accounts.inc
patch
|
blob
|
history
inventory/cost_update.php
patch
|
blob
|
history
inventory/manage/item_codes.php
patch
|
blob
|
history
inventory/prices.php
patch
|
blob
|
history
inventory/purchasing_data.php
patch
|
blob
|
history
purchasing/includes/db/supp_trans_db.inc
patch
|
blob
|
history
purchasing/includes/db/suppliers_db.inc
patch
|
blob
|
history
sales/includes/db/customers_db.inc
patch
|
blob
|
history
sales/manage/customer_branches.php
patch
|
blob
|
history
diff --git
a/gl/includes/db/gl_db_bank_accounts.inc
b/gl/includes/db/gl_db_bank_accounts.inc
index ea9a83ac08ce06ca699cfe2a49c97185f335cf15..ee535be7b1eb75302ada063dfc76931d3f89a305 100644
(file)
--- a/
gl/includes/db/gl_db_bank_accounts.inc
+++ b/
gl/includes/db/gl_db_bank_accounts.inc
@@
-344,8
+344,8
@@
function get_default_supplier_bank_account($supplier_id)
$sql = "SELECT curr_code FROM ".TB_PREF."suppliers WHERE supplier_id=".db_escape($supplier_id);
$result = db_query($sql, "could not retreive default supplier currency code");
$row = db_fetch_row($result);
$sql = "SELECT curr_code FROM ".TB_PREF."suppliers WHERE supplier_id=".db_escape($supplier_id);
$result = db_query($sql, "could not retreive default supplier currency code");
$row = db_fetch_row($result);
- $
ba = get_default_bank_account($row[0])
;
- return $
ba['id']
;
+ $
id = $row ? get_default_bank_account($row[0])['id'] : 0
;
+ return $
id
;
}
//---------------------------------------------------------------------------------------------
//
}
//---------------------------------------------------------------------------------------------
//
diff --git
a/inventory/cost_update.php
b/inventory/cost_update.php
index 35347000c7eaa2b570a5aeec9328cc566bd58dd3..f4fa70ba0f0fec5cf7b2ecb1b4372a794edd346e 100644
(file)
--- a/
inventory/cost_update.php
+++ b/
inventory/cost_update.php
@@
-126,13
+126,15
@@
div_start('cost_table');
start_table(TABLESTYLE2);
$dec1 = $dec2 = $dec3 = 0;
start_table(TABLESTYLE2);
$dec1 = $dec2 = $dec3 = 0;
-$_POST['material_cost'] = price_decimal_format($myrow["material_cost"], $dec1);
-$_POST['labour_cost'] = price_decimal_format($myrow["labour_cost"], $dec2);
-$_POST['overhead_cost'] = price_decimal_format($myrow["overhead_cost"], $dec3);
+if ($myrow) {
+ $_POST['material_cost'] = price_decimal_format($myrow["material_cost"], $dec1);
+ $_POST['labour_cost'] = price_decimal_format($myrow["labour_cost"], $dec2);
+ $_POST['overhead_cost'] = price_decimal_format($myrow["overhead_cost"], $dec3);
+}
amount_row(_("Unit cost"), "material_cost", null, "class='tableheader2'", null, $dec1);
amount_row(_("Unit cost"), "material_cost", null, "class='tableheader2'", null, $dec1);
-if ($myrow["mb_flag"]=='M')
+if ($myrow
&& $myrow
["mb_flag"]=='M')
{
amount_row(_("Standard Labour Cost Per Unit"), "labour_cost", null, "class='tableheader2'", null, $dec2);
amount_row(_("Standard Overhead Cost Per Unit"), "overhead_cost", null, "class='tableheader2'", null, $dec3);
{
amount_row(_("Standard Labour Cost Per Unit"), "labour_cost", null, "class='tableheader2'", null, $dec2);
amount_row(_("Standard Overhead Cost Per Unit"), "overhead_cost", null, "class='tableheader2'", null, $dec3);
diff --git
a/inventory/manage/item_codes.php
b/inventory/manage/item_codes.php
index 0742780aaa272753e7d2cbfa7e017e2a6b3e7b2f..1881258c22593c9cc1c66a47c9bef3530946ca45 100644
(file)
--- a/
inventory/manage/item_codes.php
+++ b/
inventory/manage/item_codes.php
@@
-113,11
+113,15
@@
echo "<hr></center>";
set_global_stock_item($_POST['stock_id']);
set_global_stock_item($_POST['stock_id']);
+$units = $dec = '';
$result = get_item_code_dflts($_POST['stock_id']);
$result = get_item_code_dflts($_POST['stock_id']);
-$dec = $result['decimals'];
-$units = $result['units'];
-$dflt_desc = $result['description'];
-$dflt_cat = $result['category_id'];
+if ($result) {
+ $dec = $result['decimals'];
+ $units = $result['units'];
+ $dflt_desc = $result['description'];
+ $dflt_cat = $result['category_id'];
+}
+
$result = get_all_item_codes($_POST['stock_id']);
div_start('code_table');
$result = get_all_item_codes($_POST['stock_id']);
div_start('code_table');
diff --git
a/inventory/prices.php
b/inventory/prices.php
index 70dd97d8a39f4a4639fb885e12ff714e0ad32899..7132eb624c7fab66153285b2cb4e8c6fd38b9445 100644
(file)
--- a/
inventory/prices.php
+++ b/
inventory/prices.php
@@
-200,7
+200,8
@@
if (!isset($_POST['price'])) {
}
$kit = get_item_code_dflts($_POST['stock_id']);
}
$kit = get_item_code_dflts($_POST['stock_id']);
-small_amount_row(_("Price:"), 'price', null, '', _('per') .' '.$kit["units"]);
+$units = $kit ? $kit["units"] : '';
+small_amount_row(_("Price:"), 'price', null, '', _('per') .' '.$units);
end_table(1);
if ($calculated)
end_table(1);
if ($calculated)
diff --git
a/inventory/purchasing_data.php
b/inventory/purchasing_data.php
index 8be2566b88555e276826ad0e10de247473c0122f..43cb467e802c4602f13be6f4f509b173e22bd259 100644
(file)
--- a/
inventory/purchasing_data.php
+++ b/
inventory/purchasing_data.php
@@
-133,6
+133,7
@@
$mb_flag = get_mb_flag($_POST['stock_id']);
if ($mb_flag == -1)
{
display_error(_("Entered item is not defined. Please re-enter."));
if ($mb_flag == -1)
{
display_error(_("Entered item is not defined. Please re-enter."));
+ $Ajax->activate('price_table');
set_focus('stock_id');
}
else
set_focus('stock_id');
}
else
diff --git
a/purchasing/includes/db/supp_trans_db.inc
b/purchasing/includes/db/supp_trans_db.inc
index 8a2f85a9701b4acf2117bbf896abe80360f15dba..aa9490afc707e048723376ab87c05c1704a1fff1 100644
(file)
--- a/
purchasing/includes/db/supp_trans_db.inc
+++ b/
purchasing/includes/db/supp_trans_db.inc
@@
-131,7
+131,7
@@
function get_supp_payment_before($supplier_id, $date)
. TB_PREF . "bank_trans,"
. TB_PREF . "bank_accounts "
. "WHERE "
. TB_PREF . "bank_trans,"
. TB_PREF . "bank_accounts "
. "WHERE "
- . TB_PREF . "supp_trans.supplier_id=
" . $supplier_id . "
"
+ . TB_PREF . "supp_trans.supplier_id=
'" . $supplier_id . "'
"
. "AND " . TB_PREF . "supp_trans.tran_date<'" . $date . "' "
. "AND " . TB_PREF . "supp_trans.type=" . ST_SUPPAYMENT . " "
. "AND " . TB_PREF . "supp_trans.trans_no=" . TB_PREF . "bank_trans.trans_no "
. "AND " . TB_PREF . "supp_trans.tran_date<'" . $date . "' "
. "AND " . TB_PREF . "supp_trans.type=" . ST_SUPPAYMENT . " "
. "AND " . TB_PREF . "supp_trans.trans_no=" . TB_PREF . "bank_trans.trans_no "
diff --git
a/purchasing/includes/db/suppliers_db.inc
b/purchasing/includes/db/suppliers_db.inc
index d66c89fc7941fb20c3912d1175eb0413b366fb2a..602b86bf60049a52f50d3c385785510480909acb 100644
(file)
--- a/
purchasing/includes/db/suppliers_db.inc
+++ b/
purchasing/includes/db/suppliers_db.inc
@@
-187,7
+187,7
@@
function get_supplier_currency($supplier_id)
$result = db_query($sql, "Retreive currency of supplier $supplier_id");
$myrow=db_fetch_row($result);
$result = db_query($sql, "Retreive currency of supplier $supplier_id");
$myrow=db_fetch_row($result);
- return $myrow
[0]
;
+ return $myrow
? $myrow[0] : get_company_currency()
;
}
function get_suppliers_search($supplier)
}
function get_suppliers_search($supplier)
diff --git
a/sales/includes/db/customers_db.inc
b/sales/includes/db/customers_db.inc
index 0dfc17e28e85fa9ddf1ad0de89fa026fb6b9b700..f9b111a0b70445160b0ec3612f357576d664bfec 100644
(file)
--- a/
sales/includes/db/customers_db.inc
+++ b/
sales/includes/db/customers_db.inc
@@
-197,7
+197,7
@@
function get_customer_currency($customer_id=null, $branch_id=null)
$result = db_query($sql, "Retreive currency of customer $customer_id");
$myrow=db_fetch_row($result);
$result = db_query($sql, "Retreive currency of customer $customer_id");
$myrow=db_fetch_row($result);
- return $myrow
[0]
;
+ return $myrow
? $myrow[0] : get_company_currency()
;
}
function get_customers_search($customer)
}
function get_customers_search($customer)
diff --git
a/sales/manage/customer_branches.php
b/sales/manage/customer_branches.php
index 2e1eae54fca9ef9e2d954d60c1e8c130d591146e..48b8e76a4501c31a4904193a35a9e648a2f3a504 100644
(file)
--- a/
sales/manage/customer_branches.php
+++ b/
sales/manage/customer_branches.php
@@
-203,7
+203,7
@@
function branch_settings($selected_id, $num_branches) {
elseif ($Mode != 'ADD_ITEM')
{
$myrow = get_default_info_for_branch($_POST['customer_id']);
elseif ($Mode != 'ADD_ITEM')
{
$myrow = get_default_info_for_branch($_POST['customer_id']);
- if(!$num_branches) {
+ if(
$myrow &&
!$num_branches) {
$_POST['br_name'] = $myrow["name"];
$_POST['br_ref'] = $myrow["debtor_ref"];
$_POST['contact_name'] = _('Main Branch');
$_POST['br_name'] = $myrow["name"];
$_POST['br_ref'] = $myrow["debtor_ref"];
$_POST['contact_name'] = _('Main Branch');