@kvvaradha thank you for testing it and your comments. The ajax search is same as popup search available in core

for customer and suppplier it search for name,short name,address and tax id
customer branch - branch name
items - name, code category name

i just copied the function from core and added little tweak.


and about that search box,  i just left it unchanged . If i removed it some layout issues will come and more files will be involved.

@boxygen

sorry mistakenly uploaded non-ajax version

here is the download link again

Download

@kvvaradha

This issue has resolved earlier (see post no 7 ) . Please use latest files

@kvvaradha

thanks for notifying this. Fixed and updated dropbox download link

kvvaradha wrote:

Ajax concept i didnt understand. it brings all the elements in the customers when i see

I didnt get it

@boxygen

dropbox link

Download files

@boxygen

migrating to new server reconstructing my website will be back soon

32

(14 replies, posted in Report Bugs here)

Thanks Janusz and apmuthu

33

(14 replies, posted in Report Bugs here)

@apmuthu

you  can see my changes on my fork over

here

update is on 2.4.6 /includes/references.inc file

1. line no 55 updated the placeholder array to

$refline_placeholders = array(
    'MM' => 'date',
    'Y' => 'date',
    'YY' => 'date',
    'YYY' => 'date',
    'YYYY' => 'date',
    'UU' => 'user',
    'P' => 'pos',
//     FIXME:  for placeholders below all the code should work, but as the ref length is variable,
//       length specification in placeholder format should be implemented.
//    'C' => 'customer',
//    'B' => 'branch',
//    'S' => 'supplier',
//    'L' => 'location'
);

2. added new template in switch case line no 124

                        case 'Y':
                        case 'YYY':
                            list($begin_day, $begin_month, $begin_year) = explode_date_to_dmy(begin_fiscalyear());
                            list($end_day, $end_month, $end_year) = explode_date_to_dmy(end_fiscalyear());
                            $out .= $ph == 'Y' ? sprintf('%04d', $begin_year) : sprintf('%04d', $begin_year) . "-" . sprintf('%02d', $end_year % 100);
                            break;

3. updated is_valid function line no 266


function is_valid($reference, $type, $context=null, $line=null)
    {
         if (!isset($line))
             $line = $this->reflines->find_refline_id($reference, $type, true);

         if (!isset($line))
             return false;

        $refline = $this->reflines->get($line);

        if ($this->_legacy_line($refline))    //legacy non-templated line
            return strlen(trim($reference)) > 0;

        $regex = preg_quote($refline['prefix'].$refline['pattern']);
        if (!is_array($context))
            $context = array('date'=>$context);

         $context['pos'] = $_SESSION["wa_current_user"]->pos;

        if (is_date(@$context['date']))
        {
            list($year4, $month, $day) = explode("-", date2sql($context['date']));
            list($begin_year, $begin_month, $begin_day) = explode("-", date2sql(begin_fiscalyear()));
            list($end_year, $end_month, $end_day) = explode("-", date2sql(end_fiscalyear()));
            $year2 = substr($year4, 2);
            $year3 = $begin_year."-".substr($end_year, 2);
        } else
        {
            $month = '\d{2,}';
            $year2 = '\d{2,}';
            $year4 = '\d{4,}';
            $begin_year = '\d{4,}';
            $year3 = '\d{4,}-\d{2,}';
        }
        $cust = @$context['customer'] ? $context['customer'] : '\d+';
        $supp = @$context['supplier'] ? $context['supplier'] : '\d+';
        $branch = @$context['branch'] ? $context['branch'] : '\d+';
        $location = @$context['location'] ? $context['location'] : '[a-z0-9]+';
         $pos = @$context['pos'] ? $context['pos'] : '\d+';
        $user = sprintf("%02d", $_SESSION['wa_current_user']->user);

        $regex = preg_replace(
            array(
                '/\\\{/',    // unquote placeholders
                '/\\\}/',
                '/\{MM\}/',
                '/\{Y\}/',
                '/\{YY\}/',
                '/\{YYY\}/',
                '/\{YYYY\}/',
                '/\{C\}/',
                '/\{B\}/',
                '/\{S\}/',
                '/\{L\}/',
                '/\{UU\}/',
                 '/\{P\}/',
                '/\{\d+}/',
            ),
            array(
                '{',
                '}',
                $month,
                $begin_year,
                $year2,
                $year3,
                $year4,
                $cust,
                $branch,
                $supp,
                $location,
                $user,
                 $pos,
                '\d+',
            ), $regex);

        $regex = '"^'.$regex.'"i';

        return preg_match($regex, $reference, $match) ? 1 : 0;
    }

34

(14 replies, posted in Report Bugs here)

i have made some changes to my code for now
expecting new format will come shortly

35

(14 replies, posted in Report Bugs here)

@apmuthu

Thanks and its very easy to do by calling begin fiscal year method

hi,
I found one issue that , in India fiscal year end is 31st March of every year, so if I use {YYYY) template on reference, the reference number will reset to start from one on 1st of January.

for eg. 31st December reference was SO201800080 but on January 1st it became SO201900001 which cant be accepted because current fiscal year is not closed and it should be continuation of last reference (SO201800081)  till 31st March.

My ugly hack to resolve this is

1. get current fiscal year begin
2. check context date is in fiscal year and both year is not same
3. if its matching create a new date with previous year and set it as date in reference context

        list($day, $month, $year) = explode_date_to_dmy(begin_fiscalyear());
        list($day1, $month1, $year1) = explode_date_to_dmy($context['date']);

    if(is_date_in_fiscalyear($context['date'])&&$year!=$year1){
            $mdate=sql2date($year."-".$month1."-".$day1);
            $context['date']=$mdate;
        }

added above code in reference.inc line number 99

Please suggest me if there is better way to resolve this

HI @boxygen

let me check, we can do that

@phpninja123

welcome and thanks for using this feature

hows the loading speed now?

@phpninja123

I have updated the files and download link. Please download new files and check,

update includes

1. removed looping
2. you can now enable/disable ajax search in config.php

40

(36 replies, posted in FA Modifications)

thanks Braath and i will upadate the code shortly with your changes

@apmuthu

HI link is updated

42

(36 replies, posted in FA Modifications)

@Braath Waate

yeah, please do your contribution so everyone can get benefit of it
thanks for notifying these issues

@boxygen

sure we can , will do it on next update

I can help you

please contact on anopmb12@gmail.com

Hi,

As per the request from members of this forum i have made ajax driven autocomplete feature

**WARNING**

its on development only
use at your own risk

this update is on latest version (2.4.6)

demo can be found here

username : demouser
password : demo

Changed Files Zip can be downloaded from  here

Expecting your comments an suggestions or your on mods to this

46

(36 replies, posted in FA Modifications)

@ kvvaradha

yeah we can try that  as the popup search type is available now  in combo input function.

let me take a look

thanks for testing

47

(36 replies, posted in FA Modifications)

@boxygen

please use a file compare utility.


i changed ui_lists.inc and auto_select_box.inc

changed $auto_select_box to $SysPrefs->auto_select_box

48

(36 replies, posted in FA Modifications)

@pswamis

Hi,

you can download the changed files from here

Download files

its updated to latest version 2.4.6

thanks for using this

Hi,

I was developing a custom theme for FA which uses Jquery and Bootstrap and I found that when using jquery fa throwing some error that className.match is not a function from behaviour.js ,so to overcome this i have replaced match functions with test method.

So if you can add this to core it will be very useful for future developers creating custom themes

PS: is there any other way?

@kvvaradha
Looking forward to it. Previously i have created one and lost the code and i was thinking about to do it again becoz lots of peole were asking about it