DecimalSeparator returns empty value in web function
Aldevinas Katkus
2-24-23
Operating system: Windows
I am importing invoices and could not figure out why 200.10 becomes 210.00.
DecimalSeparator returns empty value.
Everything is OK if importing is done with periodic task which loads csv file.

Maybe someone has an idea why DecimalSeparator() returns empty value even though the decimal separator is set in the "Company date and numeric format"?
Aldevinas Katkus
2-27-23
What is more interesting, that output to the log file knows about decimal separator and it is a different separator (dot), than that set in the "Company date and numeric format" (comma). for example:


2023-02-27 08:52:04 AD WARNING: DecimalSeparator returns blank, failing over to company decimal separator ,
2023-02-27 08:52:04 AD LineNr 2 tstr=110.25 SubTotal=110.25 VAT=756.36 Total=866.61
Carolina Valentino
3-2-23
hello, i will ask a programmer, but i hear about that issue from an argentinean partner
Carolina Valentino
3-6-23
Hi

the programmers said that It sounds like a bug and you should report it and create backup so that we can repeat

please detail every step. are you doing any company switching in import routine is also question. Probably not but this seems like it fails to load numeric format from the company it is importing in


please tell me if you report it thanks
Aldevinas Katkus
3-8-23
Unfortunately, I could not replicate it with test procedures, but it has something to do with qupdating calls. If I make web procedure updating and all calls are non qupdating, then DecimalSepator is nonblank.
If nonupdating WebStoreTabInvoice() calls qupdating.ImportSalesInvoicesFromArea(), then ImportSalesInvoicesFromArea does not know about the decimal separator:

2023-03-08 11:59:19 AD executing WebStoreTabInvoice CurrentCompany=1 DecimalSeparator=,
2023-03-08 11:59:19 AD ImportSalesInvoicesFromArea DecimalSeparator=
5-1-23
Hi. Try to use SetCompany(x, false); where x is the target company number, even if there is only one company on the server, before you call DecimalSepator().
Aldevinas Katkus
5-3-23
Created by10:14 1 May 2023
Hi. Try to use SetCompany(x, false); where x is the target company number, even if there is only one company on the server, before you call DecimalSepator().
I am using SetCompany(x, false)
David Delač
5-10-23
Are you calling it inside ImportSalesInvoicesFromArea or before that qupdating function is called?
Yavuz Yigiterhan
6-26-23
Hello Aldevinas,

Thank you for below discussion. We will consider it is closed , unless there is an update from yourside to above.
Aldevinas Katkus
7-4-23
Created byDavid Delač16:29 10 May 2023
Are you calling it inside ImportSalesInvoicesFromArea or before that qupdating function is called?
It is like this. Just checked again. As you can see ImportSalesInvoicesFromArea() forgets DecimalSeparator.

2023-07-04 17:15:48 AD executing WebStoreTabInvoice CurrentCompany=1 DecimalSeparator=,
2023-07-04 17:15:48 AD ImportSalesInvoicesFromArea DecimalSeparator=

global
updating procedure ImportSalesInvoicesFromArea(...)
begin
Logtext(0,"ImportSalesInvoicesFromArea DecimalSeparator=" & DecimalSeparator);
...
end;

global
procedure WebStoreTabInvoice()
begin
LogText(0,"executing WebStoreTabInvoice CurrentCompany=" & CurrentCompany & " DecimalSeparator=" & DecimalSeparator);
qupdating.ImportSalesInvoicesFromArea(..) //removing qupdating helps to remember DecimalSeparator
queued.StoreResultsEMail(Mailr);
end;

global
procedure WebExtraAPI()
begin

...
oldcomp = CurrentCompany;
//if (newcomp!=oldcomp) then begin <- commenting this out didn't help
if (SetCompany(newcomp,false)) then begin
WebStoreTabInvoice();

end;
end;
Aldevinas Katkus
7-7-23
We can put this on hold, because there is a workaround.
Leave Comment
You can subscribe to notifications for this post by selecting the 'star' icon on the top right corner of the post.
Back to the list
Latest Posts
Andis Blicāns, Grasko
The above applies to the window when it is opened for the first time. If the window is already open and I choose Window/Restore Position, the window takes the correct position. Namely, the upper left ...
00:43 18 July 2024
Neil
Version: 2024-03-16 Server: Linux Client: MacOS Sonoma I am seeing multiple users in different locations getting logged off many times per day when idle sometimes after a few minutes of being awa...
20:09 17 July 2024