Re: Not working: Automatic Increase of reference number fields in FA 2.4.2

Yes, I agree.

I will first have a discussion withnJanusz about this.

Joe

Re: Not working: Automatic Increase of reference number fields in FA 2.4.2

I would disagree for removing the reference field. Without removing the Reference Field the Functionality shall be added to jump to Next Available Reference without notifying user.

Keeping Reference field open sometimes allow users to maintain a different sequence manually maintained specially in case of Invoices.

Like in our area we have a practice that Sales Taxed Invoices must have a separate sequence then Normal Invoices. In such situation we suggest users to manually maintain a sequence for Sales Taxed Invoices and Put that sequence in the Reference Field before Processing the Invoice.

Re: Not working: Automatic Increase of reference number fields in FA 2.4.2

This problem just have been fixed in our repo, the fix will be included in next release.
Thanks.

Janusz

Re: Not working: Automatic Increase of reference number fields in FA 2.4.2

apmuthu wrote:

@joe: It is better to remove the Reference field from all such forms and save as next available Reference automatically and informing the user of the actual reference it was saved as by reporting it in the "success" message.

Yes, I think that'll be great.

In the interim though, any way I can get the value in the ref field on the form increasing to the next available ref? Or automatically saving with the next available ref if the one displayed is used?

Re: Not working: Automatic Increase of reference number fields in FA 2.4.2

itronics wrote:

This problem just have been fixed in our repo, the fix will be included in next release.
Thanks.

Janusz

Still not working. Unset() definitely destroys $_POST['ref'] but does not refresh/change/increase the ref field on the form and clicking Place Order  again doesn't save the order, just displays same error message again.

 $ref = $Refs->get_next($_SESSION['Items']->trans_type, null, array('date' => Today()));

The get_next() function rightly gets the next available ref. So the only thing left to do is to set the value of the ref field on the form to $ref.

How do we set/change/increase/refresh the value of the ref field on the form to $ref?

Re: Not working: Automatic Increase of reference number fields in FA 2.4.2

I have just tested the fix by Janusz, and it works perfectly.

@davidkumi
Maybe you need to refresh your browser caches. It should work now.

You will get an error saying the reference is already in use. Another line tells that the reference is updated, so you should save again. The reference is updated and when you save it should be ok. Well it could happen that other users are playing with the same numbers, so it could be repeated a few times.

/Joe

Re: Not working: Automatic Increase of reference number fields in FA 2.4.2

Should it not just save with the next available reference by itself and then inform the user of the new reference number it saved it as?

Re: Not working: Automatic Increase of reference number fields in FA 2.4.2

itronics wrote:

This problem just have been fixed in our repo, the fix will be included in next release.
Thanks.

Janusz

Oh yes, you're right. It works like magic. Just had to comment out those two other lines as below:

unset($_POST['ref']); // force refresh reference
display_error(_("The reference number field has been increased. Please save the document again."));
//$_POST['ref'] = $_SESSION['Items']->reference = $ref;
//$Ajax->activate('ref');

Thank you, thank you, thank you all

Re: Not working: Automatic Increase of reference number fields in FA 2.4.2

@ApMuthu,
I don't think so. Now user can easily accept proposed next reference, or change it if he wish, at the low cost of one additional Ctrl-Enter keypress. In alternative scenario, changing once stored invoice is much more unhandy.
Janusz

Re: Not working: Automatic Increase of reference number fields in FA 2.4.2

@itronics, thanks for the reason behind the slight inconvenience of re-submission. When would one want to change the reference the form automatically provides?

Re: Not working: Automatic Increase of reference number fields in FA 2.4.2

I don't know, the people's needs are so various... The reference field is editable, so you can change it according to your imagination, you can
for example want to use some reference from previously voided transaction, and mistake a mistake in number (the entered reference is already used). You should have last chance to edit it after clash again. You would not like to be forced to next reference unconditionally instead, and having to reedit it again.

Janusz

Re: Not working: Automatic Increase of reference number fields in FA 2.4.2

@itronics you solution works only for SalesOrder/Invoices. What for JE, Bank Payments, Bank Deposits and other such transaction forms?

Re: Not working: Automatic Increase of reference number fields in FA 2.4.2

@itronics: looks like every entry screen that has a reference needs to be fixed in a similar way and the empty.po generated again.