Topic: Reference problem

I have a new version of FA 2.4 and now there is a BUG when I try to change the file.  When I open the file to correct it, the reference change to a last number, as it was the new file. Now I always have to correct the reference number. Do you maybe have a solution for this problem? Thanks.

Re: Reference problem

Did you upgrade from 2.3?
Which file did you change and why?
Where did you correct the reference number?

Re: Reference problem

No, it's a fresh installation. I imported the data from the old database 2.3. If I want to change an existing document in Sales Orders or Sales Quotations, the reference changes to the last possible number.

Re: Reference problem

The references table setup and usage is different/enhanced in FA 2.4 with templating.
How did you import your data?
The schema is slightly different with a table replaced and some fields modified / added / removed. The permissions / roles too will differ.
If you restore a v2.3 backup into the v2.4 installation directly, then make sure login as admin and perform the db upgrade.
And that too only if the v2.3 was devoid of any plugins that may have created additional / modified tables / fields.
The asset_register module that was in v2.3 is now native to v2.4 and hence should not have the module installed in it.

Re: Reference problem

Pictures from the reference problem: References

https://drive.google.com/file/d/0B5xSrmfwObFgcldXRTJNV1BjLWM/view?usp=sharing

The database is from backup 2.3 and upgraded to 2.4 with admin rights. In which folder exactly there is a  update  script for the document Change or reference 'UPDATE' .

Greeting's Mihael

6 (edited by poncho1234 08/26/2017 04:32:11 pm)

Re: Reference problem

I know you have not actually done an upgrade, but effectively you have.

The 2.3 database will not run in 2.4, there have been many changes, most noticeably in your case references have changed to reflines, so you need to continue with your upgrade:-

Its all explained in the update.html file which is in FA's root directory - Please read this 1st - I've completed many upgrades by following these instructions and never had a problem.

There are 2 parts to the upgrade, the software upgrade and the database upgrade, from your description and the screenshot, it 'looks' like you have done the software upgrade, now you need to do the database upgrade - I think you need to go to Setup - Software Upgrade (this is really the database upgrade), this should show you that you have an upgrade - click the 2.4 upgrade and it will make the necessary changes in the database. It will take a while to make the necessary changes, this will depend on the size of your database.

To answer your question

In which folder exactly there is a  update  script for the document Change or reference 'UPDATE' .

Its in the "sql" folder. Have a look at the sql in this file and you will see that it corresponds with your screenshot errors. You could run this directly in myphpadmin, but the software upgrade works fine and I've used it numerous times.

The FrontAccounting Wiki(Manual, examples, tips, setup info, links to accounting sites, etc) https://frontaccounting.com/fawiki/

Re: Reference problem

The files in the sql folder used are:

alter2.4rc1.php
alter2.4rc1.sql
alter2.4.php
alter2.4.sql

Whilst the *.sql files bring the schema uptodate, the *.php files migrate the data carefully into the new constructs and then cleans up the old ones.

Re: Reference problem

The database was updated.

Upgrade_Screen

There is another new installation here, the same error

FA2.4.2

user:admin
pass:pasword

Post's attachments

upgrade_screen.jpg 267.4 kb, file has never been downloaded. 

You don't have the permssions to download the attachments of this post.

Re: Reference problem

Check your db tables and remember you are using a non-numeric table prefix.

In the db:
1. You have 2 entries for the same item in the same sales quotation but no sales order.
2. You have 1 sales quotation (and the corresponding entry in the refs table).
3. You have no sales invoices.

These can be verified in the Setup -> View/Print Transactions page.


Here is how to trouble shoot it.
1. Take a backup of a freshly installed en_US-demo.sql based default company.
2. Take another backup of your company db.
3. Replace all company db table's prefixes with "0_" to match the first one.
4. Use any diff tool (WinMerge) to check the differences between the two backups.

You did not have the 2017 year in your fiscal years table and I have created it.
You made the sales quotation in Aug 2017 and expected it to be valid till end of Jan 2017!
Your operational fiscal year was 2016 and hence the reference was needed to be reset each time as your quote was for 2017. I have now made it to be the newly created fiscal year 2017.

Now all is well.

Re: Reference problem

I installed a new version of 2.42 with DEMO data from Frontaccounting.com, the same error occurs. I am interested in how to read the program reference. In which folders are the scripts?

I do not know exactly if we understand each other, so I made a short Screen Capture on the problem.

VIDEO (37.6 MB)

Re: Reference problem

Sorry, bad quality

YOUTUBE

Re: Reference problem

If a Sales Quotation is entered in the current fiscal year then all is okay.
Why should you quote as of any older fiscal year?

Check your install and you will find that the Company's current fiscal year is 2016 instead of 2017 (hope you have created 2017).

@joe: I can confirm this to be an issue in FA 2.4.2+. If you enter a Sales Quotation (possibly Sales Order too) in any previous fiscal year then it will not show up in a transaction search (Sales Quotation Inquiry). Also in a listing of Sales quotations, we can disable the GL entries icon. Any further new / edit Sales Quotation entry will show up the last reference value instead of the relevant next ref value for the new one / same reference value of the one to be edited.

Best is not to allow creation of any Sales Quotation in any previous fiscal year with an allow override permission for edge cases like accounting from archived vouchers. In any case this issue needs resolution.

Re: Reference problem

I will send this to Janusz.

Joe

Re: Reference problem

Whilst this is being done by fixing the function get_sql_for_sales_orders_view() in sales/includes/db/sales_order_db.inc, the indents of the last few lines before the return statement in it can be fixed as well.

Also the function date2sql() in includes/date_functions.inc can be fixed by replacing:

    if ($date_ == null || strlen($date_) == 0)
        return "";

    $date_ = trim($date_);

with

    $date_ = trim($date_);

    if ($date_ == null || strlen($date_) == 0)
        return "";

Committed

Re: Reference problem

Yes, indeed there is a bug in references handling during document edition. It will be fixed in next 2.4.* release.
In mean time, if you don't want to wait, just fix it in your local app sources.

Thank you for pointing this problem.

Janusz

Re: Reference problem

After applying @itronics update:

Fiscal years 2016 and 2017 are open.
Company is set to Fiscal Year 2016.
3 Quotes - Nos. 1,2,3 are created in 2017 fiscal year.
1 Quote - No. 4 is created in 2016 fiscal year now during Aug 2017.

The View Quote shows the reference as 004/2016 whereas it should be 001/2016 which it is in the refs table.
The Print Quote shows 001/2016 as the Quote No (reference) in the header and in the middle, it shows Quotation No. 4.

These need to be fixed as well.

Post's attachments

NewQuoteInOldYear.zip 34.1 kb, 4 downloads since 2017-08-28 

You don't have the permssions to download the attachments of this post.

Re: Reference problem

There is no way to extend / change the validity end date of a quotation for cash only quotes.

Post's attachments

CashQuoteTillDate_Missing.png 29.9 kb, file has never been downloaded. 

You don't have the permssions to download the attachments of this post.

Re: Reference problem

Great, now the references work, thank you all. One problem is with popup window when using F4 button, see video (the select button is missing , because the main menu  is also present in the popup). I would also like to have a larger pop window, because it's a bit too small . Where can I change the size? The upload of backups also doesn't work (folder company / 0 has the rights 775, error: File was not uploaded into the system.).

Video

Greeting's Mihael

Re: Reference problem

Make sure that the company folder and all it's subfolders are writeable by the web server owner.

To enlarge the F2 screen for customers replace Line 506 in includes/ui/ui_controls.inc from

        113,    _("Customers"), 900, 500),

with

        113,    _("Customers"), 900, 600),

@joe: can commit this.
Committed

Why are we sprinkling variable and array assignments in files that otherwise contain functions only?

Re: Reference problem

Only some Sales Quotes have the original Quote Date editable whilst others do not. Also when the Customer name, Branch, Valid Till Date and Payment Terms are changed, the reference value shown in the View Sales Quote page reverts to the first number in the template but the database entries and Print Sales Quote are okay.

Post's attachments

SalesQuote_Edit_Error.png 21.1 kb, file has never been downloaded. 

You don't have the permssions to download the attachments of this post.