059c7bd13e270e09bb04d81b92e6b7aeee13e94e
[fa-stable.git] / purchasing / includes / ui / grn_ui.inc
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 //---------------------------------------------------------------------------------------------------
13
14 function display_grn_summary(&$po)
15 {
16         global $Refs;
17     start_table(TABLESTYLE2, "width=90%");
18
19     start_row();
20         label_cells(_("Supplier"), $po->supplier_name, "class='tableheader2'");
21
22     if (!is_company_currency($po->curr_code))
23         label_cells(_("Order Currency"), $po->curr_code, "class='tableheader2'");
24
25     label_cells(_("For Purchase Order"), get_trans_view_str(ST_PURCHORDER, $po->order_no),
26         "class='tableheader2'");
27
28         label_cells(_("Ordered On"), $po->orig_order_date, "class='tableheader2'");
29         end_row();
30
31         start_row();
32         label_cells(_("Reference"), $po->reference, "class='tableheader2'");
33         label_cells(_("Deliver Into Location"), get_location_name($po->Location), "class='tableheader2'");
34         label_cells(_("Supplier's Reference"), $po->supp_ref, "class='tableheader2'");
35
36     end_row();
37
38         label_row(_("Delivery Address"), $po->delivery_address, "class='tableheader2'", "colspan=9");
39
40     if ($po->Comments != "")
41         label_row(_("Order Comments"), $po->Comments, "class='tableheader2'", "colspan=9");
42     end_table(1);
43 }
44
45 function edit_grn_summary(&$po)
46 {
47         global $Refs;
48
49         start_outer_table(TABLESTYLE2, "width=80%");
50
51         table_section(1);
52                 label_row(_("Supplier"), $po->supplier_name);
53
54         if (!is_company_currency($po->curr_code))
55                 label_row(_("Order Currency"), $po->curr_code);
56
57             label_row(_("For Purchase Order"), get_trans_view_str(ST_PURCHORDER, $po->order_no));
58
59                 label_row(_("Ordered On"), $po->orig_order_date);
60
61         table_section(2);
62         if (!isset($_POST['ref']))
63             $_POST['ref'] = $Refs->get_next(ST_SUPPRECEIVE);
64         ref_row(_("Reference"), 'ref', '', null);
65
66         if (!isset($_POST['Location']))
67                 $_POST['Location'] = $po->Location;
68
69         locations_list_row(_("Deliver Into Location"), "Location", $_POST['Location']);
70
71         if (!isset($_POST['DefaultReceivedDate']))
72                 $_POST['DefaultReceivedDate'] = new_doc_date();
73
74         date_row(_("Date Items Received"), 'DefaultReceivedDate', '', true, 0, 0, 0, '', true);
75
76         table_section(3);
77                 // currently this is related order supp reference
78 //              ref_row(_("Supplier's Reference"), 'supp_ref', _("Supplier's Reference"));
79                 label_row(_("Supplier's Reference"), $po->supp_ref);
80
81                 label_row(_("Delivery Address"), $po->delivery_address);
82
83         if ($po->Comments != "")
84                 label_row(_("Order Comments"), $po->Comments, "class='tableheader2'", "colspan=9");
85
86             if (!is_company_currency($po->curr_code))
87                         exchange_rate_display(get_company_currency(), $po->curr_code, get_post('DefaultReceivedDate'));
88         end_outer_table(1);
89 }
90
91 ?>