projects
/
fa-stable.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Auto Increase of Document References (company setup)
[fa-stable.git]
/
admin
/
fiscalyears.php
diff --git
a/admin/fiscalyears.php
b/admin/fiscalyears.php
index 1926d48e1719c6c0a6bec73b5ac605f4f8f2b5e8..d6d05c5a14153a643c25e7fc4c924adcd66c32cc 100644
(file)
--- a/
admin/fiscalyears.php
+++ b/
admin/fiscalyears.php
@@
-20,7
+20,7
@@
include_once($path_to_root . "/includes/ui.inc");
include_once($path_to_root . "/sales/includes/db/cust_trans_db.inc");
include_once($path_to_root . "/admin/db/maintenance_db.inc");
$js = "";
include_once($path_to_root . "/sales/includes/db/cust_trans_db.inc");
include_once($path_to_root . "/admin/db/maintenance_db.inc");
$js = "";
-if (
$use_date_picker
)
+if (
user_use_date_picker()
)
$js .= get_js_date_picker();
page(_($help_context = "Fiscal Years"), false, false, "", $js);
$js .= get_js_date_picker();
page(_($help_context = "Fiscal Years"), false, false, "", $js);
@@
-29,7
+29,7
@@
simple_page_mode(true);
function check_data()
{
function check_data()
{
- if (!is_date($_POST['from_date']) || is_date_in_fiscalyears($_POST['from_date'])
|| !check_begin_date($_POST['from_date'])
)
+ if (!is_date($_POST['from_date']) || is_date_in_fiscalyears($_POST['from_date']))
{
display_error( _("Invalid BEGIN date in fiscal year."));
set_focus('from_date');
{
display_error( _("Invalid BEGIN date in fiscal year."));
set_focus('from_date');
@@
-41,6
+41,12
@@
function check_data()
set_focus('to_date');
return false;
}
set_focus('to_date');
return false;
}
+ if (!check_begin_end_date($_POST['from_date'], $_POST['to_date']))
+ {
+ display_error( _("Invalid BEGIN or END date in fiscal year."));
+ set_focus('from_date');
+ return false;
+ }
if (date1_greater_date2($_POST['from_date'], $_POST['to_date']))
{
display_error( _("BEGIN date bigger than END date."));
if (date1_greater_date2($_POST['from_date'], $_POST['to_date']))
{
display_error( _("BEGIN date bigger than END date."));
@@
-93,7
+99,7
@@
function check_can_delete($selected_id)
// PREVENT DELETES IF DEPENDENT RECORDS IN gl_trans
if (check_years_before(sql2date($myrow['begin']), true))
{
// PREVENT DELETES IF DEPENDENT RECORDS IN gl_trans
if (check_years_before(sql2date($myrow['begin']), true))
{
- display_error(_("Cannot delete this fiscal year because ther
a
are fiscal years before."));
+ display_error(_("Cannot delete this fiscal year because ther
e
are fiscal years before."));
return false;
}
if ($myrow['closed'] == 0)
return false;
}
if ($myrow['closed'] == 0)
@@
-196,16
+202,13
@@
function display_fiscalyear_edit($selected_id)
}
else
{
}
else
{
- $begin =
check_begin_date("", false
);
- if ($begin)
+ $begin =
next_begin_date(
);
+ if ($begin
&& $Mode != 'ADD_ITEM'
)
{
$_POST['from_date'] = $begin;
{
$_POST['from_date'] = $begin;
- hidden('from_date', $begin);
$_POST['to_date'] = end_month(add_months($begin, 11));
$_POST['to_date'] = end_month(add_months($begin, 11));
- label_row(_("Fiscal Year Begin:"), $_POST['from_date']);
}
}
- else
- date_row(_("Fiscal Year Begin:"), 'from_date', '', null, 0, 0, 1001);
+ date_row(_("Fiscal Year Begin:"), 'from_date', '', null, 0, 0, 1001);
date_row(_("Fiscal Year End:"), 'to_date', '', null, 0, 0, 1001);
}
hidden('selected_id', $selected_id);
date_row(_("Fiscal Year End:"), 'to_date', '', null, 0, 0, 1001);
}
hidden('selected_id', $selected_id);
@@
-250,4
+253,3
@@
display_fiscalyear_edit($selected_id);
end_page();
end_page();
-?>