} else {
            display_warning(" Your Current Account Balance is lower than the payout!.");
        }
        echo '</tr>';
        end_table();
    } else {
        display_warning(" Paid Already!.");
    }
    div_end();
}
end_form();
if (get_post('RefreshInquiry')) {
    $Ajax->activate('gross_salary');
    $Ajax->activate('leave_days');
    $Ajax->activate('monthly_loan');
    $Ajax->activate('totals_tbl');
}
if (get_post('pay_salary')) {
    global $Refs;
    $pay_slip_id = add_payslip($_POST['year'], $_POST['month'], $_POST['empl_id'], $_POST['basic'], $_POST['da'], $_POST['hra'], $_POST['convey_allow'], $_POST['edu_other_allow'], $_POST['pf'], $_POST['lop_amount'], $_POST['tds'], $_POST['total_ded'], $_POST['total_net'], $_POST['date_of_pay']);
    add_gl_trans(99, $pay_slip_id, $_POST['date_of_pay'], 5410, 0, 0, 'employee Salary #' . $_POST['empl_id'], $_POST['total_net']);
    add_gl_trans(99, $pay_slip_id, $_POST['date_of_pay'], 1060, 0, 0, 'employee Salary #' . $_POST['empl_id'], -$_POST['total_net']);
    $trans_no = kv_get_next_trans_no(99) + 1;
    $ref = get_next_reference(99);
    $total_net_pay = -$_POST['total_net'];
    add_bank_trans(99, $trans_no, 1, $ref, $_POST['date_of_pay'], $total_net_pay, 99, $_POST['empl_id']);
    $Refs->save(99, $trans_no, $ref);
    kv_save_next_trans_no($trans_no);
    display_notification(' The Employee Payslip is added #' . $pay_slip_id);
}
end_page();
Ejemplo n.º 2
0
        return false;
    }
    return true;
}
//-----------------------------------------------------------------------------
if (isset($_POST['update'])) {
    copy_to_cart();
    $Ajax->activate('items_table');
}
if (isset($_POST['ProcessOrder']) && can_process()) {
    $modified = $_SESSION['Items']->trans_no != 0;
    $so_type = $_SESSION['Items']->so_type;
    $ret = $_SESSION['Items']->write(1);
    if ($ret == -1) {
        display_error(_("The entered reference is already in use."));
        $ref = get_next_reference($_SESSION['Items']->trans_type);
        if ($ref != $_SESSION['Items']->reference) {
            display_error(_("The reference number field has been increased. Please save the document again."));
            $_POST['ref'] = $_SESSION['Items']->reference = $ref;
            $Ajax->activate('ref');
        }
        set_focus('ref');
    } else {
        if (count($messages)) {
            // abort on failure or error messages are lost
            $Ajax->activate('_page_body');
            display_footer_exit();
        }
        $trans_no = key($_SESSION['Items']->trans_no);
        $trans_type = $_SESSION['Items']->trans_type;
        new_doc_date($_SESSION['Items']->document_date);