Changed the text Manifactoring => Manifacturing
[fa-stable.git] / purchasing / includes / ui / invoice_ui.inc
index 116dee3c4df33a092ba6a97b64a48227fc339a4d..2f99a616529a6f7332b8c7973f4a900dfa2b4a52 100644 (file)
@@ -1,13 +1,13 @@
 <?php
 /**********************************************************************
     Copyright (C) FrontAccounting, LLC.
-       Released under the terms of the GNU Affero General Public License,
-       AGPL, as published by the Free Software Foundation, either version 
-       of the License, or (at your option) any later version.
+       Released under the terms of the GNU General Public License, GPL, 
+       as published by the Free Software Foundation, either version 3 
+       of the License, or (at your option) any later version.
     This program is distributed in the hope that it will be useful,
     but WITHOUT ANY WARRANTY; without even the implied warranty of
     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
-    See the License here <http://www.gnu.org/licenses/agpl-3.0.html>.
+    See the License here <http://www.gnu.org/licenses/gpl-3.0.html>.
 ***********************************************************************/
 //--------------------------------------------------------------------------------------------------
 
@@ -101,7 +101,7 @@ function invoice_header(&$supp_trans)
 
        table_section(2, "33%");
 
-       date_row(_("Date") . ":", 'tran_date', '', null, 0, 0, 0, "", true);
+       date_row(_("Date") . ":", 'tran_date', '', true, 0, 0, 0, "", true);
        if (isset($_POST['_tran_date_changed'])) {
                $Ajax->activate('_ex_rate');
                $supp_trans->tran_date = $_POST['tran_date'];
@@ -195,7 +195,7 @@ function display_gl_controls(&$supp_trans, $k)
 
 function display_gl_items(&$supp_trans, $mode=0)
 {
-       global $table_style, $path_to_root;
+       global $table_style, $path_to_root, $Ajax;
 
     // if displaying in form, and no items, exit
     if (($mode == 2 || $mode == 3) && count($supp_trans->gl_codes) == 0)
@@ -212,18 +212,25 @@ function display_gl_items(&$supp_trans, $mode=0)
 
        if ($mode == 1)
        {
-               $qes = has_quick_entries(-1, 0);
+               $qes = has_quick_entries(QE_SUPPINV);
                if ($qes !== false)
                {
                        echo "<div style='float:right;'>";
                        echo _("Quick Entry:")."&nbsp;"; 
-                       quick_entries_list('qid', null, 0, 1);
-                       echo "&nbsp;"._("Amount")."&nbsp;";
-                       $amount = input_num('totamount');
+                       quick_entries_list('qid', null, QE_SUPPINV, true);
+                       $qid = get_quick_entry(get_post('qid'));
+                       if (list_updated('qid')) {
+                               unset($_POST['totamount']); // enable default
+                               $Ajax->activate('totamount');
+                       }
+                       echo "&nbsp;".$qid['base_desc'].":"."&nbsp;";
+
+                       $amount = input_num('totamount', $qid['base_amount']);
                        $dec = user_price_dec();
                        echo "<input class='amount' type='text' name='totamount' size='7' maxlength='12' dec='$dec' value='$amount'>&nbsp;";
                        submit('go', _("Go"), true, false, true);
                        echo "</div>";
+
                }       
        }
        display_heading($heading);
@@ -378,8 +385,11 @@ function display_grn_items_for_selection(&$supp_trans, $k)
                        submit_cells('grn_item_id'.$n, _("Add"), '', _("Add to Invoice"), true);
                else    
                        submit_cells('grn_item_id'.$n, _("Add"), '', _("Add to Credit Note"), true);
-               if ($supp_trans->is_invoice && $_SESSION["wa_current_user"]->access == 2)       // Added 2008-10-18 by Joe Hunt. Only admins can remove GRNs
+               if ($supp_trans->is_invoice && $_SESSION["wa_current_user"]->access == 2) {     // Added 2008-10-18 by Joe Hunt. Only admins can remove GRNs
                        submit_cells('void_item_id'.$n, _("Remove"), '', _("WARNING! Be careful with removal. The operation is executed immediately and cannot be undone !!!"), true);
+                               submit_js_confirm('void_item_id'.$n,
+                                       sprintf(_('You are about to remove all yet non-invoiced items from delivery line #%d. This operation also irreversibly changes related order line. Do you want to continue ?'), $n));
+                       }
                        end_row();
        }
     }
@@ -433,8 +443,8 @@ function display_grn_items(&$supp_trans, $mode=0)
                if (!$supp_trans->is_invoice && !isset($_POST['invoice_no']))
                {
                        echo "</td>";
-                       date_cells(_("Received between"), 'receive_begin', "", null, -30);
-                       date_cells(_("and"), 'receive_end', '', null, 1);
+                       date_cells(_("Received between"), 'receive_begin', "", null, -30, 0, 0, "valign=middle");
+                       date_cells(_("and"), 'receive_end', '', null, 1, 0, 0, "valign=middle");
                        submit_cells('RefreshInquiry', _("Search"),'',_('Refresh Inquiry'), true);
                        echo "<td>";
                }