New files from unstable branch
[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, $editable=false)
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     if ($editable) 
33     {
34         if (!isset($_POST['ref']))
35             $_POST['ref'] = $Refs->get_next(ST_SUPPRECEIVE);
36         ref_cells(_("Reference"), 'ref', '', null, "class='tableheader2'");
37                 
38         if (!isset($_POST['Location']))
39                 $_POST['Location'] = $po->Location;
40         label_cell(_("Deliver Into Location"), "class='tableheader2'");
41         locations_list_cells(null, "Location", $_POST['Location']);
42         
43         if (!isset($_POST['DefaultReceivedDate']))
44                 $_POST['DefaultReceivedDate'] = new_doc_date();
45         
46         date_cells(_("Date Items Received"), 'DefaultReceivedDate', '', true, 0, 0, 0, "class='tableheader2'");    
47                 // currently this is related order supp reference
48 //              ref_cells(_("Supplier's Reference"), 'supp_ref', _("Supplier's Reference"), null, "class='tableheader2'");
49                 label_cells(_("Supplier's Reference"), $po->supp_ref, "class='tableheader2'");
50     } 
51     else 
52     {
53         label_cells(_("Reference"), $po->reference, "class='tableheader2'");
54         label_cells(_("Deliver Into Location"), get_location_name($po->Location), "class='tableheader2'");
55                 label_cells(_("Supplier's Reference"), $po->supp_ref, "class='tableheader2'");
56     }
57     
58     end_row();
59     
60     if (!$editable)
61     
62         label_row(_("Delivery Address"), $po->delivery_address, "class='tableheader2'", "colspan=9");
63     
64     if ($po->Comments != "")
65         label_row(_("Order Comments"), $po->Comments, "class='tableheader2'", "colspan=9");
66     end_table(1);       
67 }
68
69 ?>