1

(6 replies, posted in Report Bugs here)

EXCHANGE-RATES.ORG can also fetch historical rates

elseif ($provider == 'EXCHANGE-RATES.ORG')
    {
        if ($date != Today())
            $filename = "/exchange-rate-history/{$curr_b}-{$curr_a}-".date2sql($date);
        else
            $filename = "/converter/{$curr_b}-{$curr_a}";
        $site = "exchange-rates.org";
        $proto = 'https://';
        $contents=file_get_contents($proto.$site.$filename);

    
    }

2

(0 replies, posted in Reporting)

I can see there is a function in pdf_report.inc that includes some Customer Header Template from
/reporting/forms folder

function NewPage() 
    {
        if ($this->pageNumber==0)
        {
            // check if there is pdf header template for this report
            // and set if it is found
            $tmpl_pdf = find_custom_file("/reporting/forms/".$this->headerTmpl.".pdf");
            if ($tmpl_pdf) {
                $this->tmplSize = $this->setSourceFile($tmpl_pdf);
            }
        }

        $this->pageNumber++;
        parent::newPage();

        if ($this->tmplSize) {
            $this->row = $this->pageHeight - $this->topMargin; // reset row
            $id = $this->importPage(min($this->pageNumber, $this->tmplSize));
            $this->useTemplate($id);
        }

        // include related php file if any
        $tmpl_php = find_custom_file("/reporting/forms/".$this->headerTmpl.".php");
        if ($tmpl_php) {
            include($tmpl_php);
        }

        if (method_exists($this, $this->headerTmpl))    // draw predefined page layout if any
            $this->{$this->headerTmpl}();
    }

I am not sure How to use this If I add some custom header page in my module. Any help, ideas, sample?

In config.php set go_debug = 2; and then try and share the error here

Somehow I got some solution by Changing some lines in the function exception_handler()
Whole function is mentioned below

function exception_handler($exception)
{
    $trace = $exception->getTrace();
    $str_trace = "";
    foreach ($trace as $line){
        $str_trace .= $line['file']." at Line ".$line['line'] . "<br>";
    }

    error_handler(
        E_ERROR,
        sprintf(_("Unhandled exception [%s]: %s. %s."), $exception->getCode(), $exception->getMessage(), $str_trace),
        $exception->getFile(),
        $exception->getLine()
    );
    end_page();
}

Adding Comparative Bug Display for PHP 7.4 vs PHP 8.1+

https://postimg.cc/HrzNvY5K/b73f5e8d

This is not helpful for Debugging the problem because it is not pin pointing the file from where the problem is aroused.

In PHP 7.4 it gives error like this

DATABASE ERROR : The sales area could not be updated error code : 1054 error message : Unknown column 'descriptio' in 'field list' sql that failed was : UPDATE 0_areas SET descriptio='Global' WHERE area_code = '1' /home/sites/39b/7/7d21587bd2/public_html/dev/includes/errors.inc:235: trigger_error('DATABASE ERROR : The sales area could not be updated error code : 1054 error message : Unknown column 'descriptio' in 'field list' sql that failed was : UPDATE 0_areas SET descriptio='Global' WHERE area_code = '1' ','256') /home/sites/39b/7/7d21587bd2/public_html/dev/includes/errors.inc:261: display_db_error('The sales area could not be updated','UPDATE 0_areas SET descriptio='Global' WHERE area_code = '1'','') /home/sites/39b/7/7d21587bd2/public_html/dev/includes/db/connect_db_mysqli.inc:103: check_db_error('The sales area could not be updated','UPDATE 0_areas SET descriptio='Global' WHERE area_code = '1'','1') /home/sites/39b/7/7d21587bd2/public_html/dev/sales/includes/db/sales_groups_db.inc:71: db_query('UPDATE 0_areas SET descriptio='Global' WHERE area_code = '1'','The sales area could not be updated') /home/sites/39b/7/7d21587bd2/public_html/dev/sales/manage/sales_areas.php:38: update_sales_area('1','Global')

but in php 8.1+ it does not show Backtrace

Unhandled exception [1054]: Unknown column 'descriptio' in 'field list'. in file: /home/sites/39b/7/7d21587bd2/public_html/dev/includes/db/connect_db_mysqli.inc at line 80 exception_handler((mysqli_sql_exception Object))

How to Fix?

I want to print Arabic Customer Name On Invoice.
I don't want full Arabic with RTL Font.
I am using dejavusans font.
It is showing Arabic But it showing it LTR so breaking all characters of Arabic in LTR.

How to Fix this?

Screenshot
https://postimg.cc/6TP2QTWV/179e47e5

9

(2 replies, posted in Report Bugs here)

Please change the go_debug = 2 in config.php and then check

10

(4 replies, posted in Modules/Add-on's)

I think No

I have re bundled module to fetch price of each item upon scan and few other improvements and unnecessary code removed.

11

(4 replies, posted in Modules/Add-on's)

Here is a small module that adds items in the Cart using Bar Code Scan

12

(6 replies, posted in Report Bugs here)

Can you manually approve this account

13

(6 replies, posted in Report Bugs here)

Nothing in spam

https://imgur.com/a/WaU5452

I advised my junior to join forum.
But he is not receiving confirmation link email.

https://imgur.com/a/9r7dDJr

Requested email is

huzaziz1@gmail.com

Average Cost Calculation at FA

1. 10 pcs of Item A purchased at $15
2. 6 pcs are sold
3. 15 pcs of Item A purchased at $18

avg cost = ((15*18)+(4*15)) / 19 = 17.36

This is the formula of Avg Cost

However the problem at FA is that if you even Stock IN it calculates the Avg Cost. Even if you do Stock Transfer it calculates Avg Cost. Even the Voding Stock Moves affects the Average Cost

I have some modifications and conditions applied in

function void_stock_move()

if (!in_array ($type ,array(ST_LOCTRANSFER))) //condition added by faisal
            if(!get_company_pref ('controlled_avg_cost') || in_array ($type, array(ST_WORKORDER, ST_MANURECEIVE, ST_SUPPRECEIVE)))
               update_average_material_cost($row["supplier_id"], $row["stock_id"],
                     $unit_cost, -$row["qty"], sql2date($row["tran_date"]), false, "Void Stock Move # $type_no and type = ".$systypes_array[$type]);

This function also is modified but the idea is to limit it on all Transaction Types

16

(23 replies, posted in Modules/Add-on's)

@tom this extension will access the wordpress database directly hence needed to be on the same server. Right?

Great work

In session.inc comment out following lines

function preventHijacking()
    {
        if (!isset($_SESSION['IPaddress']) || !isset($_SESSION['userAgent']))
            return false;

        // if ($_SESSION['IPaddress'] != $_SERVER['REMOTE_ADDR'])
        //     return false;
    
        // if ( $_SESSION['userAgent'] != @$_SERVER['HTTP_USER_AGENT'])
        //     return false;

        return true;
    }

19

(1 replies, posted in Setup)

Yes you can use Foreign Keys.
FA uses Foreign Keys but not at DB Level.
The referential Integrity is maintained through Code

https://github.com/FrontAccountingERP/FA/commit/6c40a3be4a79826087d7abbdd11b483f19decc2a

This latest commit is returning Ajax Failure on Add Item.

I tested this on one of my installations where some clients have more that 1000 sales orders.

This updated query is taking too long to return stk_code and hence the Ajax is failing and Add Items not working.

21

(2 replies, posted in Accounts Payable)

Hello brothers,

Does anyone else face same issue?

The Ajax call reloads the page and all data is lost.

One of my client he transfers stock in bulk to another store. May be 50 plus items.

After 10-15 items the page reloads due to Ajax call when we add item

22

(2 replies, posted in Accounts Payable)

At one of my installations I am facing a severe issue.
My client's Purchase Invoice contains a lot of Line Items.
Its happening that sometimes maybe (1 out of 10) when he enter any line item or when he press Process Invoice upon Ajax Call the Page gets refresh without saving the data. Hence the whole cart vanishes and it creates a lot of frustration with users.

Has anyone else faced this issue.

How to rescue this?

Actually modules are not the part of core releases. They are maintained in non official repos. Just check BraathWate repo on Github

Thanks

Why are you not using multiple deliveries against sales order and then merge deliveries on sales invoice?