Release 2.2.3
[fa-stable.git] / admin / fiscalyears.php
1 <?php
2 /**********************************************************************
3     Copyright (C) FrontAccounting, LLC.
4         Released under the terms of the GNU General Public License, GPL, 
5         as published by the Free Software Foundation, either version 3 
6         of the License, or (at your option) any later version.
7     This program is distributed in the hope that it will be useful,
8     but WITHOUT ANY WARRANTY; without even the implied warranty of
9     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
10     See the License here <http://www.gnu.org/licenses/gpl-3.0.html>.
11 ***********************************************************************/
12 $page_security = 'SA_FISCALYEARS';
13 $path_to_root = "..";
14 include_once($path_to_root . "/includes/session.inc");
15
16 include_once($path_to_root . "/includes/date_functions.inc");
17 include_once($path_to_root . "/admin/db/company_db.inc");
18 include_once($path_to_root . "/includes/ui.inc");
19 include_once($path_to_root . "/sales/includes/db/cust_trans_db.inc");
20 include_once($path_to_root . "/admin/db/maintenance_db.inc");
21 $js = "";
22 if ($use_date_picker)
23         $js .= get_js_date_picker();
24 page(_($help_context = "Fiscal Years"), false, false, "", $js);
25
26 simple_page_mode(true);
27 //---------------------------------------------------------------------------------------------
28
29 function is_date_in_fiscalyears($date)
30 {
31         $date = date2sql($date);
32         $sql = "SELECT * FROM ".TB_PREF."fiscal_year WHERE '$date' >= begin AND '$date' <= end";
33
34         $result = db_query($sql, "could not get all fiscal years");
35         return db_fetch($result) !== false;
36 }
37
38 function is_bad_begin_date($date)
39 {
40         $bdate = date2sql($date);
41         $sql = "SELECT MAX(end) FROM ".TB_PREF."fiscal_year WHERE begin < '$bdate'";
42
43         $result = db_query($sql, "could not retrieve last fiscal years");
44         $row = db_fetch_row($result);
45         if ($row[0] === null)
46                 return false;
47         $max = add_days(sql2date($row[0]), 1);
48         return ($max !== $date);
49 }
50
51 function check_years_before($date, $closed=false)
52 {
53         $date = date2sql($date);
54         $sql = "SELECT COUNT(*) FROM ".TB_PREF."fiscal_year WHERE begin < '$date'";
55         if (!$closed)
56                 $sql .= " AND closed=0";
57
58         $result = db_query($sql, "could not check fiscal years before");
59         $row = db_fetch_row($result);
60         return ($row[0] > 0);
61 }
62
63 function check_data()
64 {
65         if (!is_date($_POST['from_date']) || is_date_in_fiscalyears($_POST['from_date']) || is_bad_begin_date($_POST['from_date']))
66         {
67                 display_error( _("Invalid BEGIN date in fiscal year."));
68                 set_focus('from_date');
69                 return false;
70         }
71         if (!is_date($_POST['to_date']) || is_date_in_fiscalyears($_POST['to_date']))
72         {
73                 display_error( _("Invalid END date in fiscal year."));
74                 set_focus('to_date');
75                 return false;
76         }
77         if (date1_greater_date2($_POST['from_date'], $_POST['to_date']))
78         {
79                 display_error( _("BEGIN date bigger than END date."));
80                 set_focus('from_date');
81                 return false;
82         }
83         return true;
84 }
85 //---------------------------------------------------------------------------------------------
86 function close_year($year)
87 {
88         $co = get_company_prefs();
89         if (get_gl_account($co['retained_earnings_act']) == false || get_gl_account($co['profit_loss_year_act']) == false)
90         {
91                 display_error(_("The Retained Earnings Account or the Profit and Loss Year Account has not been set in System and General GL Setup"));
92                 return false;
93         }
94         begin_transaction();
95
96         $myrow = get_fiscalyear($year);
97         $to = $myrow['end'];
98         // retrieve total balances from balance sheet accounts
99     $sql = "SELECT SUM(amount) FROM ".TB_PREF."gl_trans INNER JOIN ".TB_PREF."chart_master ON account=account_code
100         INNER JOIN ".TB_PREF."chart_types ON account_type=id INNER JOIN ".TB_PREF."chart_class ON class_id=cid 
101                 WHERE ctype>=".CL_ASSETS." AND ctype <=".CL_EQUITY." AND tran_date <= '$to'";
102         $result = db_query($sql, "The total balance could not be calculated");
103
104         $row = db_fetch_row($result);
105         $balance = round2($row[0], user_price_dec());
106
107         $to = sql2date($to);
108
109         if ($balance != 0.0)
110         {
111                 $trans_type = ST_JOURNAL;
112                 $trans_id = get_next_trans_no($trans_type);
113
114                 add_gl_trans($trans_type, $trans_id, $to, $co['retained_earnings_act'],
115                         0, 0, _("Closing Year"), -$balance);
116                 add_gl_trans($trans_type, $trans_id, $to, $co['profit_loss_year_act'],
117                         0, 0, _("Closing Year"), $balance);
118
119         }       
120         close_transactions($to);
121
122         commit_transaction();
123         return true;
124 }
125
126 function open_year($year)
127 {
128         $myrow = get_fiscalyear($year);
129         $from = sql2date($myrow['begin']);
130
131         begin_transaction();
132         open_transactions($from);
133         commit_transaction();
134 }
135
136 function handle_submit()
137 {
138         global $selected_id, $Mode;
139
140         $ok = true;
141         if ($selected_id != -1)
142         {
143                 if ($_POST['closed'] == 1)
144                 {
145                         if (check_years_before($_POST['from_date'], false))
146                         {
147                                 display_error( _("Cannot CLOSE this year because there are open fiscal years before"));
148                                 set_focus('closed');
149                                 return false;
150                         }       
151                         $ok = close_year($selected_id);
152                 }       
153                 else
154                         open_year($selected_id);
155                 if ($ok)
156                 {
157                         update_fiscalyear($selected_id, $_POST['closed']);
158                         display_notification(_('Selected fiscal year has been updated'));
159                 }       
160         }
161         else
162         {
163                 if (!check_data())
164                         return false;
165                 add_fiscalyear($_POST['from_date'], $_POST['to_date'], $_POST['closed']);
166                 display_notification(_('New fiscal year has been added'));
167         }
168         $Mode = 'RESET';
169 }
170
171 //---------------------------------------------------------------------------------------------
172
173 function check_can_delete($selected_id)
174 {
175         $myrow = get_fiscalyear($selected_id);
176         // PREVENT DELETES IF DEPENDENT RECORDS IN gl_trans
177         if (check_years_before(sql2date($myrow['begin']), true))
178         {
179                 display_error(_("Cannot delete this fiscal year because thera are fiscal years before."));
180                 return false;
181         }
182         if ($myrow['closed'] == 0)
183         {
184                 display_error(_("Cannot delete this fiscal year because the fiscal year is not closed."));
185                 return false;
186         }
187         return true;
188 }
189
190 //---------------------------------------------------------------------------------------------
191 function delete_attachments_and_comments($type_no, $trans_no)
192 {
193         global $comp_path;
194         
195         $sql = "SELECT * FROM ".TB_PREF."attachments WHERE type_no = $type_no AND trans_no = $trans_no";
196         $result = db_query($sql, "Could not retrieve attachments");
197         while ($row = db_fetch($result))
198         {
199                 $dir =  $comp_path."/".user_company(). "/attachments";
200                 if (file_exists($dir."/".$row['unique_name']))
201                         unlink($dir."/".$row['unique_name']);
202                 $sql = "DELETE FROM ".TB_PREF."attachments WHERE  type_no = $type_no AND trans_no = $trans_no";
203                 db_query($sql, "Could not delete attachment");
204         }       
205         $sql = "DELETE FROM ".TB_PREF."comments WHERE  type = $type_no AND id = $trans_no";
206         db_query($sql, "Could not delete comments");
207         $sql = "DELETE FROM ".TB_PREF."refs WHERE  type = $type_no AND id = $trans_no";
208         db_query($sql, "Could not delete refs");
209 }       
210
211 function delete_this_fiscalyear($selected_id)
212 {
213         global $db_connections;
214         
215         db_backup($db_connections[$_SESSION["wa_current_user"]->company], 'Security backup before Fiscal Year Removal');
216         begin_transaction();
217         $ref = _("Open Balance");
218         $myrow = get_fiscalyear($selected_id);
219         $to = $myrow['end'];
220         $sql = "SELECT order_no, trans_type FROM ".TB_PREF."sales_orders WHERE ord_date <= '$to' AND type <> 1"; // don't take the templates
221         $result = db_query($sql, "Could not retrieve sales orders");
222         while ($row = db_fetch($result))
223         {
224                 $sql = "SELECT SUM(qty_sent), SUM(quantity) FROM ".TB_PREF."sales_order_details WHERE order_no = {$row['order_no']} AND trans_type = {$row['trans_type']}";
225                 $res = db_query($sql, "Could not retrieve sales order details");
226                 $row2 = db_fetch_row($res);
227                 if ($row2[0] == $row2[1])
228                 {
229                         $sql = "DELETE FROM ".TB_PREF."sales_order_details WHERE order_no = {$row['order_no']} AND trans_type = {$row['trans_type']}";
230                         db_query($sql, "Could not delete sales order details");
231                         $sql = "DELETE FROM ".TB_PREF."sales_orders WHERE order_no = {$row['order_no']} AND trans_type = {$row['trans_type']}";
232                         db_query($sql, "Could not delete sales order");
233                         delete_attachments_and_comments($row['trans_type'], $row['order_no']);
234                 }
235         }
236         $sql = "SELECT order_no FROM ".TB_PREF."purch_orders WHERE ord_date <= '$to'";
237         $result = db_query($sql, "Could not retrieve purchase orders");
238         while ($row = db_fetch($result))
239         {
240                 $sql = "SELECT SUM(quantity_ordered), SUM(quantity_received) FROM ".TB_PREF."purch_order_details WHERE order_no = {$row['order_no']}";
241                 $res = db_query($sql, "Could not retrieve purchase order details");
242                 $row2 = db_fetch_row($res);
243                 if ($row2[0] == $row2[1])
244                 {
245                         $sql = "DELETE FROM ".TB_PREF."purch_order_details WHERE order_no = {$row['order_no']}";
246                         db_query($sql, "Could not delete purchase order details");
247                         $sql = "DELETE FROM ".TB_PREF."purch_orders WHERE order_no = {$row['order_no']}";
248                         db_query($sql, "Could not delete purchase order");
249                         delete_attachments_and_comments(ST_PURCHORDER, $row['order_no']);
250                 }
251         }
252         $sql = "SELECT id FROM ".TB_PREF."grn_batch WHERE delivery_date <= '$to'";
253         $result = db_query($sql, "Could not retrieve grn batch");
254         while ($row = db_fetch($result))
255         {
256                 $sql = "DELETE FROM ".TB_PREF."grn_items WHERE grn_batch_id = {$row['id']}";
257                 db_query($sql, "Could not delete grn items");
258                 $sql = "DELETE FROM ".TB_PREF."grn_batch WHERE id = {$row['id']}";
259                 db_query($sql, "Could not delete grn batch");
260                 delete_attachments_and_comments(25, $row['id']);
261         }
262         $sql = "SELECT trans_no, type FROM ".TB_PREF."debtor_trans WHERE tran_date <= '$to' AND 
263                 (ov_amount + ov_gst + ov_freight + ov_freight_tax + ov_discount) = alloc";
264         $result = db_query($sql, "Could not retrieve debtor trans");
265         while ($row = db_fetch($result))
266         {
267                 if ($row['type'] == ST_SALESINVOICE)
268                 {
269                         $deliveries = get_parent_trans(ST_SALESINVOICE,$row['trans_no']);
270                         foreach ($deliveries as $delivery)
271                         {
272                                 $sql = "DELETE FROM ".TB_PREF."debtor_trans_details WHERE debtor_trans_no = $delivery AND debtor_trans_type = ".ST_CUSTDELIVERY;
273                                 db_query($sql, "Could not delete debtor trans details");
274                                 $sql = "DELETE FROM ".TB_PREF."debtor_trans WHERE trans_no = $delivery AND type = ".ST_CUSTDELIVERY;
275                                 db_query($sql, "Could not delete debtor trans");
276                                 delete_attachments_and_comments(ST_CUSTDELIVERY, $delivery);
277                         }               
278                 }       
279                 $sql = "DELETE FROM ".TB_PREF."cust_allocations WHERE trans_no_from = {$row['trans_no']} AND trans_type_from = {$row['type']}";
280                 db_query($sql, "Could not delete cust allocations");
281                 $sql = "DELETE FROM ".TB_PREF."debtor_trans_details WHERE debtor_trans_no = {$row['trans_no']} AND debtor_trans_type = {$row['type']}";
282                 db_query($sql, "Could not delete debtor trans details");
283                 $sql = "DELETE FROM ".TB_PREF."debtor_trans WHERE trans_no = {$row['trans_no']} AND type = {$row['type']}";
284                 db_query($sql, "Could not delete debtor trans");
285                 delete_attachments_and_comments($row['type'], $row['trans_no']);
286         }
287         $sql = "SELECT trans_no, type FROM ".TB_PREF."supp_trans WHERE tran_date <= '$to' AND 
288                 ABS(ov_amount + ov_gst + ov_discount) = alloc";
289         $result = db_query($sql, "Could not retrieve supp trans");
290         while ($row = db_fetch($result))
291         {
292                 $sql = "DELETE FROM ".TB_PREF."supp_allocations WHERE trans_no_from = {$row['trans_no']} AND trans_type_from = {$row['type']}";
293                 db_query($sql, "Could not delete supp allocations");
294                 $sql = "DELETE FROM ".TB_PREF."supp_invoice_items WHERE supp_trans_no = {$row['trans_no']} AND supp_trans_type = {$row['type']}";
295                 db_query($sql, "Could not delete supp invoice items");
296                 $sql = "DELETE FROM ".TB_PREF."supp_trans WHERE trans_no = {$row['trans_no']} AND type = {$row['type']}";
297                 db_query($sql, "Could not delete supp trans");
298                 delete_attachments_and_comments($row['type'], $row['trans_no']);
299         }
300         $sql = "SELECT id FROM ".TB_PREF."workorders WHERE released_date <= '$to' AND closed=1";
301         $result = db_query($sql, "Could not retrieve supp trans");
302         while ($row = db_fetch($result))
303         {
304                 $sql = "SELECT issue_no FROM ".TB_PREF."wo_issues WHERE workorder_id = {$row['id']}"; 
305                 $res = db_query($sql, "Could not retrieve wo issues");
306                 while ($row2 = db_fetch_row($res))
307                 {
308                         $sql = "DELETE FROM ".TB_PREF."wo_issue_items WHERE issue_id = {$row2[0]}";
309                         db_query($sql, "Could not delete wo issue items");
310                 }       
311                 delete_attachments_and_comments(ST_MANUISSUE, $row['id']);
312                 $sql = "DELETE FROM ".TB_PREF."wo_issues WHERE workorder_id = {$row['id']}";
313                 db_query($sql, "Could not delete wo issues");
314                 $sql = "DELETE FROM ".TB_PREF."wo_manufacture WHERE workorder_id = {$row['id']}";
315                 db_query($sql, "Could not delete wo manufacture");
316                 $sql = "DELETE FROM ".TB_PREF."wo_requirements WHERE workorder_id = {$row['id']}";
317                 db_query($sql, "Could not delete wo requirements");
318                 $sql = "DELETE FROM ".TB_PREF."workorders WHERE id = {$row['id']}";
319                 db_query($sql, "Could not delete workorders");
320                 delete_attachments_and_comments(ST_WORKORDER, $row['id']);
321         }
322         $sql = "SELECT loc_code, stock_id, SUM(qty) AS qty, SUM(qty*standard_cost) AS std_cost FROM ".TB_PREF."stock_moves WHERE tran_date <= '$to' GROUP by 
323                 loc_code, stock_id";
324         $result = db_query($sql, "Could not retrieve supp trans");
325         while ($row = db_fetch($result))
326         {
327                 $sql = "DELETE FROM ".TB_PREF."stock_moves WHERE tran_date <= '$to' AND loc_code = '{$row['loc_code']}' AND stock_id = '{$row['stock_id']}'";
328                 db_query($sql, "Could not delete stock moves");
329                 $qty = $row['qty'];
330                 $std_cost = ($qty == 0 ? 0 : round2($row['std_cost'] / $qty, user_price_dec()));
331                 $sql = "INSERT INTO ".TB_PREF."stock_moves (stock_id, loc_code, tran_date, reference, qty, standard_cost) VALUES
332                         ('{$row['stock_id']}', '{$row['loc_code']}', '$to', '$ref', $qty, $std_cost)";   
333                 db_query($sql, "Could not insert stock move");
334         }               
335         $sql = "DELETE FROM ".TB_PREF."voided WHERE date_ <= '$to'";
336         db_query($sql, "Could not delete voided items");
337         $sql = "DELETE FROM ".TB_PREF."trans_tax_details WHERE tran_date <= '$to'";
338         db_query($sql, "Could not delete trans tax details");
339         $sql = "DELETE FROM ".TB_PREF."exchange_rates WHERE date_ <= '$to'";
340         db_query($sql, "Could not delete exchange rates");
341         $sql = "DELETE FROM ".TB_PREF."budget_trans WHERE tran_date <= '$to'";
342         db_query($sql, "Could not delete exchange rates");
343         
344         $sql = "SELECT account, SUM(amount) AS amount FROM ".TB_PREF."gl_trans WHERE tran_date <= '$to' GROUP by account";
345         $result = db_query($sql, "Could not retrieve gl trans");
346         while ($row = db_fetch($result))
347         {
348                 $sql = "DELETE FROM ".TB_PREF."gl_trans WHERE tran_date <= '$to' AND account = '{$row['account']}'";
349                 db_query($sql, "Could not delete gl trans");
350                 if (is_account_balancesheet($row['account']))
351                 {
352                         $trans_no = get_next_trans_no(ST_JOURNAL);
353                         $sql = "INSERT INTO ".TB_PREF."gl_trans (type, type_no, tran_date, account, memo_, amount) VALUES
354                                 (".ST_JOURNAL.", $trans_no, '$to', '{$row['account']}', '$ref', {$row['amount']})";
355                         db_query($sql, "Could not insert gl trans");
356                 }
357         }
358         
359         $sql = "SELECT bank_act, SUM(amount) AS amount FROM ".TB_PREF."bank_trans WHERE trans_date <= '$to' GROUP BY bank_act";
360         $result = db_query($sql, "Could not retrieve bank trans");
361         while ($row = db_fetch($result))
362         {
363                 $sql = "DELETE FROM ".TB_PREF."bank_trans WHERE trans_date <= '$to' AND bank_act = '{$row['bank_act']}'";
364                 db_query($sql, "Could not delete bank trans");
365                 $sql = "INSERT INTO ".TB_PREF."bank_trans (type, trans_no, trans_date, bank_act, ref, amount) VALUES
366                         (0, 0, '$to', '{$row['bank_act']}', '$ref', {$row['amount']})";
367                 db_query($sql, "Could not insert bank trans");
368         }       
369         
370         $sql = "DELETE FROM ".TB_PREF."audit_trail WHERE gl_date <= '$to'";
371         db_query($sql, "Could not delete audit trail");
372         
373         $sql = "SELECT type, id FROM ".TB_PREF."comments";
374         $result = db_query($sql, "Could not retrieve comments");
375         while ($row = db_fetch($result))
376         {
377                 $sql = "SELECT count(*) FROM ".TB_PREF."gl_trans WHERE type = {$row['type']} AND type_no = {$row['id']}";
378                 $res = db_query($sql, "Could not retrieve gl_trans");
379                 $row2 = db_fetch_row($res);
380                 if ($row2[0] == 0) // if no link, then delete comments
381                 {
382                         $sql = "DELETE FROM ".TB_PREF."comments WHERE type = {$row['type']} AND id = {$row['id']}";
383                         db_query($sql, "Could not delete comments");
384                 }
385         }       
386         $sql = "SELECT type, id FROM ".TB_PREF."refs";
387         $result = db_query($sql, "Could not retrieve refs");
388         while ($row = db_fetch($result))
389         {
390                 $sql = "SELECT count(*) FROM ".TB_PREF."gl_trans WHERE type = {$row['type']} AND type_no = {$row['id']}";
391                 $res = db_query($sql, "Could not retrieve gl_trans");
392                 $row2 = db_fetch_row($res);
393                 if ($row2[0] == 0) // if no link, then delete refs
394                 {
395                         $sql = "DELETE FROM ".TB_PREF."refs WHERE type = {$row['type']} AND id = {$row['id']}";
396                         db_query($sql, "Could not delete refs");
397                 }
398         }       
399                 
400         delete_fiscalyear($selected_id);
401         commit_transaction();   
402 }
403
404 function handle_delete()
405 {
406         global $selected_id, $Mode;
407
408         if (check_can_delete($selected_id)) {
409         //only delete if used in neither customer or supplier, comp prefs, bank trans accounts
410                 delete_this_fiscalyear($selected_id);
411                 display_notification(_('Selected fiscal year has been deleted'));
412         }
413         $Mode = 'RESET';
414 }
415
416 //---------------------------------------------------------------------------------------------
417
418 function display_fiscalyears()
419 {
420         global $table_style;
421
422         $company_year = get_company_pref('f_year');
423
424         $result = get_all_fiscalyears();
425         start_form();
426         display_note(_("Warning: Deleting a fiscal year all transactions 
427                 are removed and converted into relevant balances. This process is irreversible!"), 
428                 0, 0, "class='currentfg'");
429         start_table($table_style);
430
431         $th = array(_("Fiscal Year Begin"), _("Fiscal Year End"), _("Closed"), "", "");
432         table_header($th);
433
434         $k=0;
435         while ($myrow=db_fetch($result))
436         {
437         if ($myrow['id'] == $company_year)
438         {
439                 start_row("class='stockmankobg'");
440         }
441         else
442                 alt_table_row_color($k);
443
444                 $from = sql2date($myrow["begin"]);
445                 $to = sql2date($myrow["end"]);
446                 if ($myrow["closed"] == 0)
447                 {
448                         $closed_text = _("No");
449                 }
450                 else
451                 {
452                         $closed_text = _("Yes");
453                 }
454                 label_cell($from);
455                 label_cell($to);
456                 label_cell($closed_text);
457                 edit_button_cell("Edit".$myrow['id'], _("Edit"));
458                 if ($myrow["id"] != $company_year) {
459                         delete_button_cell("Delete".$myrow['id'], _("Delete"));
460                         submit_js_confirm("Delete".$myrow['id'],
461                                 sprintf(_("Are you sure you want to delete fiscal year %s - %s? All transactions are deleted and converted into relevant balances. Do you want to continue ?"), $from, $to));
462                 } else
463                         label_cell('');
464                 end_row();
465         }
466
467         end_table();
468         end_form();
469         display_note(_("The marked fiscal year is the current fiscal year which cannot be deleted."), 0, 0, "class='currentfg'");
470 }
471
472 //---------------------------------------------------------------------------------------------
473
474 function display_fiscalyear_edit($selected_id)
475 {
476         global $table_style2, $Mode;
477
478         start_form();
479         start_table($table_style2);
480
481         if ($selected_id != -1)
482         {
483                 if($Mode =='Edit')
484                 {
485                         $myrow = get_fiscalyear($selected_id);
486
487                         $_POST['from_date'] = sql2date($myrow["begin"]);
488                         $_POST['to_date']  = sql2date($myrow["end"]);
489                         $_POST['closed']  = $myrow["closed"];
490                 }
491                 hidden('from_date');
492                 hidden('to_date');
493                 label_row(_("Fiscal Year Begin:"), $_POST['from_date']);
494                 label_row(_("Fiscal Year End:"), $_POST['to_date']);
495         }
496         else
497         {
498                 date_row(_("Fiscal Year Begin:"), 'from_date', '', null, 0, 0, 1001);
499                 date_row(_("Fiscal Year End:"), 'to_date', '', null, 0, 0, 1001);
500         }
501         hidden('selected_id', $selected_id);
502
503         yesno_list_row(_("Is Closed:"), 'closed', null, "", "", false);
504
505         end_table(1);
506
507         submit_add_or_update_center($selected_id == -1, '', 'both');
508
509         end_form();
510 }
511
512 //---------------------------------------------------------------------------------------------
513
514 if ($Mode=='ADD_ITEM' || $Mode=='UPDATE_ITEM')
515 {
516         handle_submit();
517 }
518
519 //---------------------------------------------------------------------------------------------
520
521 if ($Mode == 'Delete')
522 {
523         global $selected_id;
524         handle_delete($selected_id);
525 }
526
527 if ($Mode == 'RESET')
528 {
529         $selected_id = -1;
530 }
531 //---------------------------------------------------------------------------------------------
532
533 display_fiscalyears();
534
535 echo '<br>';
536
537 display_fiscalyear_edit($selected_id);
538
539 //---------------------------------------------------------------------------------------------
540
541 end_page();
542
543 ?>