This issue probably happens when using jquery and its conflict match in jquery

Another fix is to change match with test

if (found[k].className && new RegExp('\\b'+className+'\\b').test(found[k].className)) {
     currentContext[currentContextIndex++] = found[k];
}

like this

Note: match returns array or null but test returns boolean true or false

Also need to clear the cache to take effect new change

Thanks @Joe, @Varadha

I have been facing issue while creating modules related to purchase.

Hi,

I found a bug in delete_po($po) function

hook_db_prevoid($po, ST_PURCHORDER);

it has to be

hook_db_prevoid(ST_PURCHORDER, $po);

please correct me, if i am wrong

Updated the links, Kindly see first post

I will upload the new one , and will give you the link here  , by this weekend.

Another way to overcome this,

use the activate_extension function in module

function activate_extension($company, $check_only = true)
    {
        global $path_to_root, $db_connections;

        $file = $path_to_root . '/includes/session.inc';
        if (file_exists($file)) {
            $mstring = 'add_access_extensions();';
            // Open the file to get existing content
            $current = file_get_contents($file);
            if (strpos($current, $mstring) === false) {
                $current .= $mstring . "\n";
                // Write the contents back to the file
                file_put_contents($file, $current);
            }
        }
        
        $updates = array('update.sql' => array('pos'));
        return $this->update_databases($company, $updates, $check_only);
    }

Hi,

I think Approval System for GL Transactions should work fine here. Refer Forum Post.

So system administrator/Accountant  can review and approve it.

Hi,

if the list of Invoices are little long and when you go down and click on 'All' or 'None' the page will scroll to top.

this may be an unwanted behavior and to stop this change the below  code

File : includes/ui/allocation_cart.inc

line: 306-310

label_cell("<a href='#' name=Alloc$id onclick='allocate_all(this.name.substr(5));return true;'>"
                     . _("All") . "</a>");
                label_cell("<a href='#' name=DeAll$id onclick='allocate_none(this.name.substr(5));return true;'>"
                     . _("None") . "</a>".hidden("un_allocated" . $id, 
                     price_format($un_allocated), false));

to

label_cell("<a href='javascript:void(0)' name=Alloc$id onclick='allocate_all(this.name.substr(5));return true;'>"
                     . _("All") . "</a>");
                label_cell("<a href='javascript:void(0)' name=DeAll$id onclick='allocate_none(this.name.substr(5));return true;'>"
                     . _("None") . "</a>".hidden("un_allocated" . $id, 
                     price_format($un_allocated), false));

Hi,

you can download patch file from HERE

ok right, if anybody shifting to FA but dont want to import old transactions  but want to start as new in FA , i think they can use this solution for their old customers and suppliers

This solution can be applied when people shifting to FA

I have done like this and would like to know will it be a proper solution?

This solution will accept negative values too , which will be a bank deposit by customer or payment to supplier

1. include item cart class in customer and suppliers

   

      include_once($path_to_root . "/includes/ui/items_cart.inc");
    

2. added two input fields to customers and suppliers master (amount and date)
   a. Customer

table_section(2);
    if (!$selected_id) {
        table_section_title(_("Opening Balance"));
        amount_row(_("Amount:"), 'opening_bal');
        if (!isset($_POST['ob_date']))
            $_POST['ob_date'] = add_days(begin_fiscalyear(), -1);
        date_row(_("As of:"), 'ob_date');
    } else {
        hidden('opening_bal', 0);
        hidden('ob_date', Today());
    }

b. Supplier

   if (!$supplier_id) {
        table_section_title(_("Opening Balance"));
        amount_row(_("Amount:"), 'opening_bal');
        if (!isset($_POST['ob_date']))
            $_POST['ob_date'] = add_days(begin_fiscalyear(), -1);
        date_row(_("As of:"), 'ob_date');
    } else {
        hidden('opening_bal', 0);
        hidden('ob_date', Today());
    }

It will appear only in new customer or supplier mode

3. Validation of Opening balance entry date in can_process() method

   for both Customer and supplier
   

    if (input_num('opening_bal') != 0 && !is_date(get_post('ob_date'))) {
        display_error(_("Invalid opening balance entry date."));
        set_focus('ob_date');
        return false;
    }
    

4.  Journal entry in handle_submit method
    a. customer
     

       if (input_num('opening_bal') != 0) {
            $cart = new items_cart(ST_JOURNAL);
            $cart->order_id = 0;
            $cart->tran_date = $cart->doc_date = $cart->event_date = get_post('ob_date');
            $cart->reference = $Refs->get_next(ST_JOURNAL, null, $cart->tran_date);
            $cart->tax_info = false;
            $cart->memo_ = _("Opening Balance Entry");
            $cart->currency = $_POST['curr_code'];
            if ($cart->currency != get_company_pref('curr_default'))
                $cart->rate = get_exchange_rate_to_home_currency($cart->currency,get_post('ob_date'));
            $cart->clear_items();
            if (input_num('opening_bal') > 0) {
                $cart->add_gl_item(get_company_pref('debtors_act'), 0,
                    0, input_num('opening_bal'), _("Opening Balance Entry"), '', $selected_id);
                $cart->add_gl_item(get_company_pref('default_inv_sales_act'), 0,
                    0, input_num('opening_bal') * -1, _("Opening Balance Entry"), '', $selected_id);
            } else {
                $cart->add_gl_item(get_company_pref('debtors_act'), 0,
                    0, input_num('opening_bal'), _("Opening Balance Entry"), '', $selected_id);
                $bank_account= get_bank_account(get_default_customer_bank_account($selected_id));
                $cart->add_gl_item($bank_account['account_code'], 0,
                    0, input_num('opening_bal')*-1 , _("Opening Balance Entry"), '', $selected_id);
            }
            $trans_no = write_journal_entries($cart);

        }
     

    b. Supplier
     

if (input_num('opening_bal') != 0) {
            $cart = new items_cart(ST_JOURNAL);
            $cart->order_id = 0;
            $cart->tran_date = $cart->doc_date = $cart->event_date = get_post('ob_date');
            $cart->reference = $Refs->get_next(ST_JOURNAL, null, $cart->tran_date);
            $cart->tax_info = false;
            $cart->memo_ = _("Opening Balance Entry");
            $cart->currency = $_POST['curr_code'];
            if ($cart->currency != get_company_pref('curr_default'))
                $cart->rate = get_exchange_rate_to_home_currency($cart->currency,get_post('ob_date'));
            $cart->clear_items();
            if (input_num('opening_bal') > 0) {
                $cart->add_gl_item($_POST['payable_account'], 0,
                    0, input_num('opening_bal')* -1, _("Opening Balance Entry"), '', $supplier_id);
                $cart->add_gl_item($_POST['purchase_account']!=''?$_POST['purchase_account']:get_company_pref('grn_clearing_act'), 0,
                    0, input_num('opening_bal') , _("Opening Balance Entry"), '', $supplier_id);
            } else {
                $cart->add_gl_item($_POST['payable_account'], 0,
                    0, input_num('opening_bal')* -1, _("Opening Balance Entry"), '', $supplier_id);
                $bank_account= get_bank_account(get_default_supplier_bank_account($supplier_id));
                $cart->add_gl_item($bank_account['account_code'], 0,
                    0, input_num('opening_bal') , _("Opening Balance Entry"), '', $supplier_id);
            }
            $trans_no = write_journal_entries($cart);

        }
      

NB: patch file is available on request

13

(4 replies, posted in FA Modifications)

hi,

Can you describe some use cases of this  by which most of fa users will get benefited?

I think we can do this

Update

Changed files for FA 2.4.7

Download

Copy the files to root folder and do the software update and Its Done!

NB: github repo not updated

get it from here

https://getcomposer.org/download/

install into your server or to local(then copy all to server)  then edit your composer.json to update dependency versions

then run composer install in command line

Hello guys ,

I have updated api to Slim 3

We can easily implement Eloquent ORM too (Laravel One)

index.php looks like this

if (!isset($path_to_root))
{
    $path_to_root = "../../..";
}

ini_set('html_errors', false);
ini_set('xdebug.show_exception_trace', 0);
ini_set('xdebug.auto_trace', 2);
error_reporting(E_ALL);
ini_set("display_errors", 1);

include_once('config_api.php');

global $security_areas, $security_groups, $security_headings, $path_to_root, $db, $db_connections;

$page_security = 'SA_API';




include_once(FA_ROOT . "/sales/includes/cart_class.inc");
include_once(FA_ROOT . "/includes/session.inc");

include_once(FA_ROOT . "/includes/ui.inc");
include_once(FA_ROOT . "/sales/includes/sales_ui.inc");
include_once(FA_ROOT . "/sales/includes/ui/sales_order_ui.inc");
include_once(FA_ROOT . "/sales/includes/db/sales_order_db.inc");
include_once(FA_ROOT . "/sales/includes/db/sales_invoice_db.inc");
include_once(FA_ROOT . "/sales/includes/db/sales_delivery_db.inc");

include_once (API_ROOT . "/vendor/autoload.php");

$app = new \Slim\App([
    'debug' => false,
    'settings' => [
        'displayErrorDetails' => true
    ]
]);

require __DIR__ . "/app/Helpers/dependencies.php";
require __DIR__ . "/app/Helpers/handlers.php";
require __DIR__ . "/app/Helpers/middleware.php";


require __DIR__ . '/app/Sales/routes.php';



$app->run();

Thanks Joe..

@joe if you include this it will be very helpful for lots of users

it helps to monitor accountants entry, if any help required  i am ready

Hello Boxy,

pls shorten the date period and find out the transaction/transactions caused it. then dig on that

Hi,
I can help you I am from Kochi

mostly it should work , you may try once, by the way i will check it and post an update

22

(1 replies, posted in FA Modifications)

Hi,

try to put the table inside an div using div_start('id_to_update') and div_end() method

then update the div, it may work

hi,

You can use like this

$js = "alert('Hi')";

if (in_ajax()) {
    $Ajax->addScript(true, $js);
} else
    add_js_source($js);

this code will retain after ajax also

if you are using any jquery plugin and your jquery is loaded in footer part of renderer

then you have to load the plugin in renderer after jquery (it will be loaded on all pages)

or you can customize the core and define a function to load javascript files in footer

add_js_ufile() function is there but it will load in header only

24

(82 replies, posted in FA Modifications)

great looking forward

25

(2 replies, posted in Report Bugs here)

the function get_unit_descr($unit) on line no 44 defined in inventory/includes/db/item_units_db.inc file

instead of name you are selecting description column which does not exist in db

function get_unit_descr($unit)
{
    $sql = "SELECT description FROM ".TB_PREF."item_units WHERE abbr=".db_escape($unit);
    $result = db_query($sql, "could not unit description");
    $row = db_fetch_row($result);
    return $row[0];
}

change to

function get_unit_descr($unit)
{
    $sql = "SELECT name FROM ".TB_PREF."item_units WHERE abbr=".db_escape($unit);
    $result = db_query($sql, "could not retrieve unit name");
    $row = db_fetch_row($result);
    return $row[0];
}