Topic: Allow Bank Transfers Via Bank Payments

I have customized the code as below

includes/access_levels.inc Line 269

'SA_BANK2BANK' => array(SS_GL|13, _("Bank Transfer Through Bank Payment")), //added by faisal

includes/ui/gl_bank_ui.inc at Line 253

if (@$_GET['NewPayment'] == 'Yes') //Added by faisal
        $skip_bank = !$_SESSION["wa_current_user"]->can_access('SA_BANK2BANK');
    else {
        $skip_bank = true;
    }

    echo gl_all_accounts_list('code_id', null, $skip_bank, true); // modified by faisal

gl/includes/db/gl_db_banking.inc at Line 477

        if ($trans_type == ST_BANKPAYMENT AND $is_bank_to && !$_SESSION["wa_current_user"]->can_access('SA_BANK2BANK'))

Line numbers may vary.

Please test and comment.

www.boxygen.pk

Re: Allow Bank Transfers Via Bank Payments

@joe: Does this make it to the core?

Re: Allow Bank Transfers Via Bank Payments

I don't know. I am out of office a week. Will look at it when I am back.

Joe

4 (edited by boxygen 08/01/2018 07:43:42 pm)

Re: Allow Bank Transfers Via Bank Payments

Add this line at Line 411 in gl_bank.php

hidden('ModifyPayment',@$_GET['ModifyPayment']); //added by faisal
hidden('NewPayment',@$_GET['NewPayment']); //added by faisal

includes/ui/gl_bank_ui.inc at Line 253 (ignore this code set in above post#1)

if (@$_GET['NewPayment'] == 'Yes' || @$_POST['NewPayment'] == 'Yes' || @$_GET['ModifyPayment'] == 'Yes' || @$_POST['ModifyPayment'] == 'Yes' )
            $skip_bank = !$_SESSION["wa_current_user"]->can_access('SA_BANK2BANK');
    else {
        $skip_bank = true;
    }

    echo gl_all_accounts_list('code_id', null, $skip_bank, true); // modified by faisal
www.boxygen.pk

Re: Allow Bank Transfers Via Bank Payments

Modify the Code block at Line 182 on gl_bank.php with code below. This is to ensure the Edit of Bank Payment.

while ($row = db_fetch($result)) {
                if (is_bank_account($row['account']) && $_GET['ModifyPayment']=='Yes' && $row['amount'] > 0) //Added block by faisal
                {
                    $cart->add_gl_item( $row['account'], $row['dimension_id'],
                        $row['dimension2_id'], $row['amount'], $row['memo_']);
                }
                elseif (is_bank_account($row['account']) ) {
                    // date exchange rate is currenly not stored in bank transaction,
                    // so we have to restore it from original gl amounts
                    $ex_rate = $bank_trans['amount']/$row['amount'];
                }
                 else {
                    $cart->add_gl_item( $row['account'], $row['dimension_id'],
                        $row['dimension2_id'], $row['amount'], $row['memo_']);
                }
            }
www.boxygen.pk