Skip to content

Commit

Permalink
No edit in supplier invoice quick entry fixed. @braath Waate.
Browse files Browse the repository at this point in the history
  • Loading branch information
joe-hunt committed Mar 19, 2019
1 parent 268a54d commit c001557
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 3 deletions.
8 changes: 5 additions & 3 deletions purchasing/includes/ui/invoice_ui.inc
Expand Up @@ -199,8 +199,9 @@ function invoice_totals(&$supp_trans)
function display_gl_controls(&$supp_trans, $k)
{
$accs = get_supplier_accounts($supp_trans->supplier_id);
$_POST['gl_code'] = $accs['purchase_account'] ?
$accs['purchase_account'] : get_company_pref('default_cogs_act');
if (!isset($_POST['gl_code']))
$_POST['gl_code'] = $accs['purchase_account'] ?
$accs['purchase_account'] : get_company_pref('default_cogs_act');

alt_table_row_color($k);
echo gl_all_accounts_list('gl_code', null, true, true);
Expand Down Expand Up @@ -316,7 +317,8 @@ function display_gl_items(&$supp_trans, $mode=0)
{
delete_button_cell("Delete2" . $entered_gl_code->Counter, _("Delete"),
_('Remove line from document'));
label_cell("");
edit_button_cell("Edit" . $entered_gl_code->Counter, _("Edit"),
_('Edit line from document'));
}
end_row();
if ($mode > 1) {
Expand Down
14 changes: 14 additions & 0 deletions purchasing/supplier_invoice.php
Expand Up @@ -352,6 +352,20 @@ function commit_item_data($n)
$Ajax->activate('gl_items');
}

$id5 = find_submit('Edit');
if ($id5 != -1)
{
$_POST['gl_code'] = $_SESSION['supp_trans']->gl_codes[$id5]->gl_code;
$_POST['dimension_id'] = $_SESSION['supp_trans']->gl_codes[$id5]->gl_dim;
$_POST['dimension2_id'] = $_SESSION['supp_trans']->gl_codes[$id5]->gl_dim2;
$_POST['amount'] = $_SESSION['supp_trans']->gl_codes[$id5]->amount;
$_POST['memo_'] = $_SESSION['supp_trans']->gl_codes[$id5]->memo_;

$_SESSION['supp_trans']->remove_gl_codes_from_trans($id5);
reset_tax_input();
$Ajax->activate('gl_items');
}

$id2 = -1;
if ($_SESSION["wa_current_user"]->can_access('SA_GRNDELETE'))
{
Expand Down

0 comments on commit c001557

Please sign in to comment.