I have to change (a while ago) the SQL (not the PHP) in the themes/execlusive/render.php.
That's everything I found so fa
/Elax
It's much more fun, when you can discuss your problems with others...
You are not logged in. Please login or register.
FrontAccounting forum → Posts by elax
I have to change (a while ago) the SQL (not the PHP) in the themes/execlusive/render.php.
That's everything I found so fa
/Elax
and see if it is ok with the floatcmp.
reporting/rep102.php had alreade a filter in the sql used in the file./Joe
This report should be modified too. Even it's filtered by mysql (and I think mysql have the same problem).
array_sum, sum float in php so it has potentialy the problem (Anyway any comparaison of a floating number to 0 as this problem)
That works with floatcmp.
/Elax
Just search for '== 0' in the code.
So far I found it in 3 files
sales/inquiry/customer_inquiry.php
reporting/rep101.php
reporting/rep102.php
And in the exclusive theme
themes/exclusive/renderer.php
Thanks
/Elax
Of course I can be wrong, so we can switch with all the database double columns to numeric, as soon as the problem will be proven on real example .
Janusz
I have an real example , and strangely it's a php problem
<?php
echo (335.74+30.52) == (305.22+61.04) ? "equal" : "not equal";
?>
>> not equal.
If you do the same in SQL it's equal (I don't know why).
Anyway I have this real , you can do it yourself on a test database
The invoice is 305.22 + 61.04 of VAT
And I payed with 2 different payments : one of 335.74 and the second one of 30.52 (a credit note)
This payment appears in the list of overdue invoices but not in red. I think the "filtering" is done on the 'sales/inquiry/customer_inquiry.php' line 212.
If you change
(abs($row["TotalAmount"]) - $row["Allocated"] != 0)
by
(abs(abs($row["TotalAmount"]) - $row["Allocated"]) > 1e-6)
everything is fine.
(Even if the column was decimal we will still have the problem as the numbers will be added in PHP)
/Elax
Of course I can be wrong, so we can switch with all the database double columns to numeric, as soon as the problem will be proven on real example .Janusz
I have an real example , and strangely it's a php problem<?php echo (335.74+30.52) == (305.22+61.04) ?
I agree 100 % with you. However the source of the problem is to store number as float (or double) in the database rather than using decimal type.
You should know that floating number can't represent exactly every decimal numbers (0.1 for example is 1/10 and needs an infinite number of digit in base-2) and you can't just compare floating number to 0
The problem appears mostly when you use discount or pay an invoice in many payment, therefore to know if the invoice has been fully paid or not, you just not compare the two amounts but have to compare one amount with the sum of other (the amount paid vs the invoice amount + the discount).
/Elax
Really excentric approach .
Keep in mind FA make lots of checks before the data for any entered document are stored in database. The more FA code you ommit the more chances to break your ledger.Janusz
You are right, this is why I want to integrate it in FA (so I can use all the FA code) rather than doing SQL (even though It work pretty well). I've started doing something and It's quite promising, I'll keep you in touch when it's finished.
/Elax
Ok, so it seems I have done stuff wrong, as the wik said I shouldn't pay against the VAT account but used an 'accrued' one.
There is a Accruals account on the UK C.O.A is that the one to use or should I create one ?
(I know that' s an accounting question, so does someone from the UK knows the answer?)
/Elax
I didn't read the last bit, which seems to answer my problem. I'll have a proper look it.
Thanks
Hi
I've just launched an VAT report (because my VAT return is due soon). And it appears that the VAT refund from the last period appears in the VAT report as a normal VATed transaction.
Basically I had a refund of 4 pounds, I entered it as Bank deposit and crediting the 20% VAT account (so at the end the balance on the VAT account is null). However now, there is a transaction with a Net amount of 20 corresponding to those 4 pounds refund.
Did I do something wrong or is this a bug somewhere in FA ?
Many thanks
/Elax
Ok , should I use 1e-6 or anything else (0.01 as I guess pretty much every currency have cents) or an actual decimal settings somewhere in FA ?
How should I send the files ?
/Elax
I understand your concerns. No it doesn't work with single quote, and for some reason I have to remove line 135 (otherwise it seems that it's added to the boundary). Quote seems to be usefull only when the delimiter contains some dodgy character (like so in theory there is no need to.
What is weird, is that I am (apparently ) the only one with this problem.
I'll raise an issue at gmail .
/Elax
Hi
I've been implementing this ruby thing because I don't like the actual order/cart interface neither I will never like GUI based. I want to enter sales order, purchase order, stock transfer, etc in my favorite text editor
- because I love it (my text editor)
- it's faster ( I don't have to wait for anything before entering the next field) ... really faster
- I can do amazing stuff like copy/paste , subsitution (usefull when the order is, I want this in every color or I want Y in the same colors as X) etc
- it doesn't crash in the middle, meaning I have to start from the beginning
- purchase orders can "generated" from sales orders
- I can enter them from email etc etc etc ....
So I had this idea, rather than generating a SQL file that then I have to upload, I can add a "free text" popup in the actual GUI where I could copy/paste my order text file (in my format) and convert it (using PHP or JS) to a cart. I've been looking a bit how it work and it's seems possible to add a import/export to text function to the cart(s) which should then "modify" properly. (I understood that the cart is saved in the session, therefore it should be possible to "build" it from a text).
I'm a wright ? Does it seems to be a good approach or could you suggest me something else ?
/Elax
Hi
Lots of reports and bits of code allow zero things to be filtered using (both in PHP and SQL) a ' something == 0'. However this doesn't always work due to rounding error (and float/double representation) .
There are two ways to fix that. The first (less intrusive) is to replace that by 'abs(something) <1e-6' (or equivalet). The other way would be to change in the database the types of columns from double to decimal. This would allow sql query to work but not the php one , as I guess decimal values would be converted to float in PHP.
/Elax
PS: I have started to the replacement in the reports where it 's bothering, and will happily shared it if needed.
Found it. I have this problem only with Gmail. It doesn't like the quotes around the boundary definition.
I don't know if it's a bug or depend on the encoding. Internet is not consistent about to use or not quotes in boundary delimiter definition. However what works is to change the following lines in 'reporting/includes/class.mail.inc'
134 $this->header .= "Content-Type: multipart/mixed;\n boundary=\"$this->boundary\"\n";
135 $this->header .= "This is a multi-part message in MIME format.\n";
by
134 $this->header .= "Content-Type: multipart/mixed;\n boundary=$this->boundary\n";
135
/Elax
I get something like that
%PDF-1.3
1.00 w
3 0 obj
<</Type /Page
/Parent 1 0 R
/MediaBox [0 0 595.28 841.89]
/Resources 2 0 R
/Contents 4 0 R>>
endobj
4 0 obj
<</Filter /FlateDecode /Length 1486>>
stream
xœÕš]oÛ6†ïý+°›
kd~‹ÊÕœ¥i×$MÔEÑÁV]¯¶ÔÊJ»îײ¤ˆ”8"ÕˆeÓ9"òå9¤M=BàxažÿÀ»÷æefžgæ9…0þ“e…UøNÃýш§‰ûz}6›ZFRÉâÒºxY±ŠËÜTÍ™J$a`_M%ô‡+Ñ>5·DW&!›WÖ2ØK¶©ê€nîÍbøÐj¤²[¹·Ù´ì}áØ—Åì¥rìËâc;ÁÈã:QÚÜÛ€"n§ÉžNSæt¢*ÚöŽ÷vvV¸î®Ë– “n%uÙ2áÒ¥.[&BµPÔV-í¡w‡ê±&Ž¯w¹Fµ(˶I{ü\oL¾€6߈‘@Ù†ØL?ئ+ŸS8Iáu©Uæhµþ(Ø«÷z„Só‹yëé\³9˜–Óž6d~áÞýzNÂÓW§áoï!|aš‡×…%-hþ»¤`õÑ#S…}K_úÚãº$~åyœá8Íóh7ÜÝS(uGAY0WÑ"ë4šõ !ÅÄEüísšå}¶.Ø]ë§Ñ:‡·iöiýq‘õ:œ4³á
•À^ß@ŸíÓf6¾yù„
—Êâ}*KÍtºú˜&ñ}
Howeve, the PDF seemst alriqht, that's more the 'embedding' of it inside the email which doesn't work
/Elax
I have only $debug set to 1.
$pdf_debug is set to 0
(I have always had this problem anyway, even when I first install FA)
/Elax
Hi
I'm trying to send a statement to a customer (myself as I m testing). I don't get an attached document but instead a criptic ascii bit, which I think is the PDF.
something like
--f557c2c70897ee6a29e37c8b9cd2bffd
Content-Type: application/pdf; name="Statement2.pdf"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="Statement2.pdf"
JVBERi0xLjMKMS4wMCB3CjMgMCBvYmoKPDwvVHlwZSAvUGFnZQovUGFyZW50IDEgMCBSCi9N
ZWRpYUJveCBbMCAwIDU5NS4yOCA4NDE
I'm sure I can transform that into a PDF, but I guess my customers won't. Am I only one having this problem ?
/Elax
Ok
Thanks
/Elax
Hi
I've made a mistake (setup an item with the wrong cogs) and I need supplier invioce transaction.
What is the best way to do so ?
I can either
- modify the gl_tran row manually on the database. Is it safe to do so ?(or is the information somehow denormalize and repeated in other tables) . That seems to be the
Hi
I've been copying my FA installation to a new machine (so I can do local development).
I didn't reinstall it but just copied everything (files + database)
Everything works fine , however I all the graphic are broken (I used the exclusive theme).
I guess I have some PHP modules missing , can anyone help me to figure out which ones to install ?
thanks
/Elax
Hi
It would be really nice to have a state or something on order (mainly sales order) , so order can be 'checked' or 'finished' etc.
I mean, all the time , I'm entering an order from a client (from a paper or an excel spreadsheet) and I have to stop in the middle because some items doesn't exist or the prices are dodgy etc. So I would like to be able to mark an order as 'uncomplet' or 'to check' so I can come back on it later, or ask someone to check order which need to be check etc.
Obvioulsy, and order which is not in a 'checked' or 'validate' state could not be dispatched.
Am i the only one with this need ?
Currently I had a code in the reference so I can spot them from the orders inquiry page.
/Elax
Hi
I've modified the Stock Sheet Report to filter items using either a regular expression or 'like' filter.
Is anyone interested ?
/Elax
Hello,
I haven't upgraded yet to 2.3.8 regarding this an other of bugs I've seen in the buck tracker, my question is the following :
Is 2.3.8 stable and is it safe to migrate or should I better wait a bit ?
thx
FrontAccounting forum → Posts by elax
Powered by PunBB, supported by Informer Technologies, Inc.
Currently installed 4 official extensions. Copyright © 2003–2009 PunBB.