551

(27 replies, posted in Installation)

Looks like full mess up with your existing database. Because it looks like the database already has the columns what we introduced new in the version 2.4 in your 2.3.26.  So it looks like some of the db changes you have already done. That's giving trouble now.

My way for you to fix it.

1. Just export the exact database you have in 2.3.26 and keep it.
2. Download a new version 2.4.8 and extract it in separate directory.  And from the files, open FA  directory/sql/en_US-new.sql
3. Use a version comparison software and compare  both sql files.  And bring the missing changes to your existing version and which will help you to fix the problem.

Note: You need some sql query knowledge to fix it. 

The other way is edit the alter2.4.php and alter2.4.sql files inside sql directory.   With that you can remove the changes of duplicate fields. And try again to update.

Looks like we don't need to get global customer id for sales orders view page.  We need to get the customer id for the same sales order. Not the global customer id.

553

(10 replies, posted in FA Modifications)

@joe  , do the needful with core update

There is no developer documentation available  to help you.

If you are interested. You can read my article to understand the basic to start making module.
https://www.kvcodes.com/2014/01/how-to-create-modules-for-frontaccounting/

555

(10 replies, posted in FA Modifications)

Just post the modified code. @joe will add it to core and put it for other users benefit

556

(7 replies, posted in Installation)

Just tell them. Their hosting does not store the sessions due to permission problem server. Just show them the errors and tell them. These errors are not because of the software. It happened with their hosted server permissions. Not the software files.

557

(7 replies, posted in Installation)

Looks like the directory permissions of /var/ is not right. You need to set the permissions to allow. Is it root server or cpanel based server.

If it's root server you can do that with help of terminal.

For the cpanel based server check with hosting provider to set the permissions for you to continue.

No. My suggestion is to get the file from module. Not allowing end users to input into it. Or upload into the system. 

And also I just figured out. The find_custom_file function get the module files too. So we can ignore the  changes what I suggested.

@apmuthu -  For custom header changes, we are allowing to collect from forms directory. And i am trying to bring the same feature to modules directory. I can't understand your point, How it will cause security issues.

@joe - If you think its not good practice, than lets takeout the forms directory and form files support in pdf_report.inc

We are allowing to connect custom reports. If it's giving security issues. That will also give security problems

There is a small change in the core of pdf_report.inc will  give us a good way to add template form from the module itself.

from the reporting/includes/pdf_report.inc:

function NewPage() 
    {
        global $installed_extensions, $path_to_root;
    
    
        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);
            } else {
                // include reports installed inside extension modules
                if (count($installed_extensions) > 0)
                {
                    $extensions = $installed_extensions;
                    foreach ($extensions as $ext)
                        if (($ext['active'] && $ext['type'] == 'extension')) {
                            $tmpl_pdf = find_custom_file($path_to_root.'/'.$ext['path']."/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);
        }  else {
                // include reports installed inside extension modules
                if (count($installed_extensions) > 0)
                {
                    $extensions = $installed_extensions;
                    foreach ($extensions as $ext)
                        if (($ext['active'] && $ext['type'] == 'extension')) {
                            $tmpl_php = find_custom_file($path_to_root.'/'.$ext['path']."/reporting/forms/".$this->headerTmpl.".php");
                            if ($tmpl_php) {
                                $this->tmplSize = $this->setSourceFile($tmpl_php);
                            }
                        }
                }
            }

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

This would help us to hook from the modules template to work on.

This is a good feature.

You can create it. But you need to make an option in the destination and follow it to make program to open it in html view

564

(1 replies, posted in Accounts Receivable)

It's simple dude. Create direct invoice and payment term should not be cash only.

And than goto customer payment. There you can make one payment with one bank partial amount. And than goto customer payment again and make the balance amount. But this time select another bank to complete it.

This way one invoice can be paid by two payments
Even more than 2 payment you can do for a single invoice

565

(3 replies, posted in Installation)

What's ur server configuration.  State here to understand the capacity to help you

566

(3 replies, posted in Development)

This is rare case. Usually people check the Salesmans sales history and balance. But if you want to maintain the balance of terminal. You need to bring the POS id into the debtor trans and stock moves table to get the total cost of a terminal and item details.

567

(7 replies, posted in Accounts Receivable)

Sometimes it happens. If you clear your browser cache the issue will be fixed. But I didn't get exact solution within Fa program itself.

568

(3 replies, posted in Development)

@notrinos,  I think it may help you.
We have a field in users table for pos. With that POS id will be saved in users table. User id will be entered inside audit trail. With that you can relate it by writing a join query

@joe and @itronics, check this with existing core.

The get_balance function also includes the voided payment or edited payment. Its better, we have to include the voided table to exclude the entries of voided amount.

here is my adjusted code.

//----------------------------------------------------------------------------------------------------
function get_balance($account, $dimension, $dimension2, $from, $to, $from_incl=true, $to_incl=true) 
{
    $from_date = date2sql($from);
    $to_date = date2sql($to);

    $sql = "SELECT    SUM(IF(amount >= 0, amount, 0)) as debit, 
                    SUM(IF(amount < 0, -amount, 0)) as credit,
                    SUM(amount) as balance 
        FROM ".TB_PREF."gl_trans trans  LEFT JOIN ".TB_PREF."voided AS vd ON trans.type = vd.type AND trans.type_no = vd.id,"
            .TB_PREF."chart_master coa,"
            .TB_PREF."chart_types act_type, "
            .TB_PREF."chart_class act_class
        WHERE trans.account=coa.account_code  AND ISNULL(vd.id)
            AND coa.account_type=act_type.id 
        AND act_type.class_id=act_class.cid"
        ." AND ".($from_incl ? "tran_date >= '$from_date'" : "tran_date > IF(ctype>0 AND ctype<".CL_INCOME.", '0000-00-00', '$from_date')")
        ." AND ".($to_incl ? "tran_date <= '$to_date'" : "tran_date < '$to_date'")
        .($account == null ? '' : " AND account=".db_escape($account))
        .($dimension == 0 ? ''  : " AND dimension_id = ".($dimension<0 ? 0 : db_escape($dimension)))
        .($dimension2 == 0 ? '' : " AND dimension2_id = ".($dimension2<0 ? 0 : db_escape($dimension2)));

    $result = db_query($sql,"No general ledger accounts were returned");

    return db_fetch($result);
}

for other types.

case 'INVOICE':
                    $IV = $type_shortcuts[ST_SALESINVOICE];
                    $ref = ($SysPrefs->print_invoice_no() == 1 ? "trans_no" : "reference");
                    $sql = "SELECT concat(debtor_trans.trans_no, '-', debtor_trans.type) AS TNO,
                                concat('$IV ', debtor_trans.$ref,' ', debtor.name) as IName
                        FROM ".TB_PREF."debtors_master debtor,"
                            .TB_PREF."debtor_trans debtor_trans LEFT JOIN ".TB_PREF."voided AS vd ON debtor_trans.type=vd.type AND debtor_trans.trans_no=vd.id
                        WHERE debtor_trans.type=".ST_SALESINVOICE." AND debtor.debtor_no=debtor_trans.debtor_no AND ISNULL(vd.id)
                        ORDER BY debtor_trans.trans_no DESC";
                    return combo_input($name, '', $sql, 'TNO', 'IName',array('order'=>false));

                case 'CREDIT':
                    $CN = $type_shortcuts[ST_CUSTCREDIT];
                    $ref = ($SysPrefs->print_invoice_no() == 1 ? "trans_no" : "reference");
                    $sql = "SELECT concat(debtor_trans.trans_no, '-', debtor_trans.type) AS TNO,
                                concat('$CN ', debtor_trans.$ref,' ', debtor.name) as IName
                        FROM ".TB_PREF."debtors_master debtor,"
                            .TB_PREF."debtor_trans debtor_trans LEFT JOIN ".TB_PREF."voided AS vd ON debtor_trans.type=vd.type AND debtor_trans.trans_no=vd.id
                        WHERE debtor_trans.type=".ST_CUSTCREDIT." AND debtor.debtor_no=debtor_trans.debtor_no AND ISNULL(vd.id)
                        ORDER BY debtor_trans.trans_no DESC";
                    return combo_input($name, '', $sql, 'TNO', 'IName',array('order'=>false));

                case 'DELIVERY':
                    $DN = $type_shortcuts[ST_CUSTDELIVERY];
                    $sql = "SELECT    concat(debtor_trans.trans_no, '-', debtor_trans.type) AS TNO,
                                concat(debtor_trans.trans_no, ' $DN ', debtor.name) as IName
                        FROM ".TB_PREF."debtors_master debtor,"
                            .TB_PREF."debtor_trans debtor_trans LEFT JOIN ".TB_PREF."voided AS vd ON debtor_trans.type=vd.type AND debtor_trans.trans_no=vd.id
                        WHERE debtor_trans.type=".ST_CUSTDELIVERY." AND debtor.debtor_no=debtor_trans.debtor_no AND ISNULL(vd.id)
                        ORDER BY debtor_trans.trans_no DESC";
                    return combo_input($name, '', $sql, 'TNO', 'IName',array('order'=>false));


                case 'REMITTANCE':
                    $BP = $type_shortcuts[ST_BANKPAYMENT];
                    $SP = $type_shortcuts[ST_SUPPAYMENT];
                    $CN = $type_shortcuts[ST_SUPPCREDIT];
                    $ref = ($SysPrefs->print_invoice_no() == 1 ? "trans_no" : "reference");
                    $sql = "SELECT concat(trans.trans_no, '-',trans.type) AS TNO,
                                concat(trans.$ref, IF(type=".ST_BANKPAYMENT.", ' $BP ', IF(type=".ST_SUPPAYMENT.", ' $SP ', ' $CN ')), supplier.supp_name) as IName
                            FROM ".TB_PREF."suppliers supplier, "
                                .TB_PREF."supp_trans trans  LEFT JOIN ".TB_PREF."voided AS vd ON trans.type=vd.type AND trans.trans_no=vd.id
                            WHERE trans.type IN(".ST_BANKPAYMENT.",".ST_SUPPAYMENT.",".ST_SUPPCREDIT.")    AND supplier.supplier_id=trans.supplier_id AND ISNULL(vd.id)
                            ORDER BY trans.trans_no DESC";
                    return combo_input($name, '', $sql, 'TNO', 'IName',array('order'=>false));

                case 'RECEIPT':
                    $BD = $type_shortcuts[ST_BANKDEPOSIT];
                    $CP = $type_shortcuts[ST_CUSTPAYMENT];
                    $ref = ($SysPrefs->print_invoice_no() == 1 ? "trans_no" : "reference");
                    $sql = "SELECT concat(trans.trans_no, '-', trans.type) AS TNO,
                                concat(trans.$ref, IF(trans.type=".ST_BANKDEPOSIT.", ' $BD ', ' $CP '), debtor.name) as IName
                        FROM ".TB_PREF."debtors_master debtor,"
                            .TB_PREF."debtor_trans trans LEFT JOIN ".TB_PREF."voided AS vd ON trans.type=vd.type AND trans.trans_no=vd.id
                        WHERE trans.type IN(".ST_BANKDEPOSIT.",".ST_CUSTPAYMENT.",".ST_CUSTCREDIT.") AND debtor.debtor_no=trans.debtor_no AND ISNULL(vd.id)
                        ORDER BY trans.trans_no DESC";
                    return combo_input($name, '', $sql, 'TNO', 'IName',array('order'=>false));

A good issue, @joe looks like we have to add voided table in it.

it sholud be like this for sales invoice

case 'INVOICE':
                    $IV = $type_shortcuts[ST_SALESINVOICE];
                    $ref = ($SysPrefs->print_invoice_no() == 1 ? "trans_no" : "reference");
                    $sql = "SELECT concat(debtor_trans.trans_no, '-', debtor_trans.type) AS TNO,
                                concat('$IV ', debtor_trans.$ref,' ', debtor.name) as IName
                        FROM ".TB_PREF."debtors_master debtor,"
                            .TB_PREF."debtor_trans debtor_trans LEFT JOIN ".TB_PREF."voided AS vd ON debtor_trans.type=vd.type AND debtor_trans.trans_no=vd.id
                        WHERE debtor_trans.type=".ST_SALESINVOICE." AND debtor.debtor_no=debtor_trans.debtor_no AND ISNULL(vd.id)
                        ORDER BY debtor_trans.trans_no DESC";
                    return combo_input($name, '', $sql, 'TNO', 'IName',array('order'=>false));

573

(8 replies, posted in Report Bugs here)

There is no smtp configured to send emails on prompt time.  If you wish to add smtp feature you have to change the default main function with phpmailer to deliver mails immediately.

574

(1 replies, posted in Reporting)

The GD extension is needed . Just enable and  restart your server apache to take effect

You can keep it. Just check at the bottom of pdf_reports .inc.  as you can see the files of 3mins old will be deleted and recreated new PDF in it