X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;ds=sidebyside;f=purchasing%2Fincludes%2Fui%2Finvoice_ui.inc;h=2f99a616529a6f7332b8c7973f4a900dfa2b4a52;hb=6425de92749015d0e7ab29b5fd071a9d70cbb7d5;hp=67f63e82e053eb705fd491be63368d2168267d7a;hpb=19823e144d3a0e45476177da0c7262787abf398e;p=fa-stable.git diff --git a/purchasing/includes/ui/invoice_ui.inc b/purchasing/includes/ui/invoice_ui.inc index 67f63e82..2f99a616 100644 --- a/purchasing/includes/ui/invoice_ui.inc +++ b/purchasing/includes/ui/invoice_ui.inc @@ -1,13 +1,13 @@ . + See the License here . ***********************************************************************/ //-------------------------------------------------------------------------------------------------- @@ -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 "
"; echo _("Quick Entry:")." "; - quick_entries_list('qid', null, 0, 1); - echo " "._("Amount")." "; - $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 " ".$qid['base_desc'].":"." "; + + $amount = input_num('totamount', $qid['base_amount']); $dec = user_price_dec(); echo " "; submit('go', _("Go"), true, false, true); echo "
"; + } } display_heading($heading); @@ -316,7 +323,9 @@ function display_grn_items_for_selection(&$supp_trans, $k) $result = get_grn_items(0, $supp_trans->supplier_id, true); else { - if (isset($_POST['invoice_no'])) + if (isset($_POST['receive_begin']) && isset($_POST['receive_end'])) + $result = get_grn_items(0, $supp_trans->supplier_id, false, true, 0, $_POST['receive_begin'], $_POST['receive_end']); + else if (isset($_POST['invoice_no'])) $result = get_grn_items(0, $supp_trans->supplier_id, false, true, $_POST['invoice_no']); else $result = get_grn_items(0, $supp_trans->supplier_id, false, true); @@ -376,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(); } } @@ -428,6 +440,15 @@ function display_grn_items(&$supp_trans, $mode=0) if ($mode == 1) { + if (!$supp_trans->is_invoice && !isset($_POST['invoice_no'])) + { + echo ""; + 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 ""; + } + if ($heading2 != "") { //br();