Thanks for the prompt reply, Joe.

I believe that this is a bit more complex and that using a sales kit will not solve the issue.

Let me dig a bit on the subject.

If I correctly understood the logic behind FA, this is the current scenario:

For each supplier you assign a purchase account from the COA.

Each document (invoice) received from that supplier will assign that account in GL, correct?

In general, you have items for which you want to have an inventory available and items for which you do not care.
For those for which you don't need inventory, the simplest of solution is to create a generic editable item under services.
This way inventory will not be involved.

I know for a fact that you cannot assign multiple purchase accounts to the same purchase invoice, because that piece of information is related to the document and not to each individual item you buy (unless you use inventory).

The best solution would be to have a piece of information for each line of the invoice where you could edit the Purchase account selected from the COA, using the predefined one with the supplier as a default.

This, though, would imply recording the purchase account somewhere with the detail of the purchase document details.

That is not yet implemented in the DB and I know that you are somehow reluctant to change the DB structure, unless absolutely necessary.

The goal is to "desctructure" each purchase because, expecially with generic suppliers, you may buy several items each belonging to a different category (e.g. different Purchase account in the COA).

The example I provided was the extreme one.

From a supermarket you can buy thousands of items each potentially belonging to a different category and therefore to a different kind of use and, therefore, subjected to be recorded with its COA purchase account (also to check budgets, etc.)

Frankly I think that there is no alternative to "re-write" part of the code in order to reflect a solution for this but that will imply modifying the DB structure.

Prior to doing this, I was wondering if you had already devised a solution for such a common task in accounting.

Any viable hint will be more that welcome.

Once and if solved I will be glad to provide the altered code for your review, naturally.

Best,

Carlo

Hi all.

I have the following problem and need some advise on how to correctly input into FA.

Let's say that I have a supplier (ABC) which is a supermarket.

I buy from such supplier cleaning items and mineral waters.

I then receive the invoice from the supplier.

Let's say, for the example, that I bought 100 USD of cleaning stuff and 100 USD of bottled water.

None of the two items I bought need to be recorded into my inventory.

The cleaning material will be used to clean the floor while mineral water will be available for employees for their use.

What I need is to correctly input the invoice.

I will have ONE reference number for the supplier's invoice (e.g. their invoice number)
I will have line 1 of the invoice showing 100 USD for cleaning material
I will have line 2 of the invoice showing 100 USD for bottled water

cleaning material have to be assigned to a certain account in my COA
bottled water will have to be assigned to a different account in my COA

I will then have the total of the taxable amount (200 USD) on top of which FA will show the amount of VAT (in my case 22%)
I will then have a total invoice of 244 USD.

Currently, I cannot find a way to easily divide the 200 USD into two lines each for 100 USD and each with its COA account number as a counterpart.

How do I do it?

I am no accountant but I must presume that such a usual situation has been already encountered and solved in FA.

Any suggestion will be highly appreciated since, at the moment, the only possibility I face is to write a lot of code if such regiatration were not feasible.

Best to everybody and thanks for the efforts.

Carlo

I am running ver. 2.3.22 (which I believed to be the last one).

I noticed some differences between the version I'm running and the one you suggested to use as a comparison version.

Which of the two is the latest?

working on a PDF to explain what I did so far.
I just need to download a "virgin" FA and compare files with mine since I was so stupid not to keep an efficient track of changes.
I may take a few days to complete the doc and then I'll post it.

I have already uploaded the code, together with a backup of the DB (under company/0/backup) named

antemovimenti.sql

(which is a today's backup).

You may download the zip file from

http://FAdev.gelatiflor.net/erp20150322.zip

Needless to say, since I am just a mere newbie with PHP, I am certain that there will be many naiveties in my code.

I'm here to learn, please.

Best and thanks,

Carlo

Hi all.
I actually solved the whole problem by adding a few functions (most of the credit goes to apmuthu, to be frank), although I needed to alter a few tables in the DB in order to accomodate historically the bit of info so obtained.
I'd like to share it with the community if there is any interest.
I have no idea how to do that, though.
Any help, if interested, will be appreciated.
Carlo

Hi dls.
The data you mention are those already used in the bottom summary.
get_trans_tax_details(ST_SALESINVOICE, $I) is already a summary and is not item related.
It is a summary of all items using each single $tax_item['rate'].
That is of little use when trying to single out each item's rate and it is calculated AFTER the call for each item in a separate array.
I'll see if I can create a function with my little PHP knowledge.
In the meantime, whenever you or others have time, any hint will be more than appreciated.
Best,
Carlo

Hi.

I need to create a function in PHP but I'm not very familiar.
Can you help?

What I need is to pass to a function the stock_id (from stock_master.stock_id) and get the value of tax_types.rate associated.

I understand that for a PHP programmer is a walk in the park but I'm not such a thing.

Thanks for any help you may provide.

Best,
Carlo

Thank you dls.
Unfortunately this is not sufficient.
Let me better explain:

Let's start with the result.
See here a new template for invoice
(I am sorry it's in dual language at the moment so I provide only the landscape version and I apologise using my company details on that)

http://printdemo.gelatiflor.net/wrong_invoice.pdf

Some background:
We have 5 VAT rates used in this invoice, specifically 22%, 10%, 4%, 0% for a reason, 0% for another reason.

The 2 zero rate items are fictionary and they refer to a sale outside EU (E1) and to a sale within EU (E2).

The items are self explanatory and, for the example, are named A22, A10, A4, E1 and E2 (incidentally they are all services so I didn't have to bother with inventory for each of the numerous tests I did)

My goal was to show the VAT rate per each item in the invoice and then, at the end of the invoice, show a summary of all VAT rates involved, with a sum of taxable amount and a total of taxes amounts.

I already managed to have the summary adjust its size according to the number of lines it contains. No big deal but I hope that the layout of the invoice is more readable and more attractive this way.

The solution you provide (which you correctly state is taken from elsewhere in the Forum) shows the VAT rate (or better say the tax rate) with a reverse calculation based on taxable amount and tax amount.

That is what I used too.

Now look at the last line of page 2.

I intentionally used a very low value as the price for a given item.
Specifically 1.58
Then I applied a discount of 25%
on the net price I calculated 4% of VAT.
These are the non rounded results:
           
Net price   
1.185
Tax   
0.0474
Total   
1.2324
Naturally, if I reverse calculate the tax, it shows 4.00%
If I round values to cents (as it is for the far majority of cases) these are the results:
           
Net price   
1.19
Tax
0.05   
Total   
1.24
These values are more than fine for the GL as rounding is a necessity.
If I now try and calculate the tax percentage with the formula that is e.g. in rep107 (untouched) which shows:
$DisplayTaxRate = number_format2($myrow2["unit_tax"] * 100 / $myrow2["unit_price"], user_percent_dec()) . "%";

The result is shown there and it's obviously wrong.

At first I thought to create or use an already created function to retrieve the tax rate for each item in the invoice and use that to print the associated tax rate.

Bear in mind that this is just to show the rate on the invoice, not to change the posts on GL because they are correct and rounded as they should.

If I increase the number of decimals in my preferences I get the right result but I cannot show amounts wiht less than cents (or pence, if you like) because that would be obviously wrong for accounting and VAT reports (of whichever nature they were).
Using a function could be a solution if tax rates were not subjected to changes from time to time.
(imagine UK VAT 17.5% increased to 19%: each re-print of the invoice would show the wrong tax rates)

That means that the tax rate must be filed with the value AT THE TIME OF ORIGINAL TRANSACTION.

The simplest solution, which would NOT bother the DB but in a very minimal way, would be –to my humble opinion- to add a field, say taxrate, in debtor_trans_details.

No big deal, I guess.

Nevertheless that would be a sort of problem in future updates or versions of FA.

As you can see, my invoice template is compliant with EU vat rules and, presumably, also with the UK ones.

I am relatively new to the forum and do not even know where or to whom I should ask for these relatively small changes.

Any hint on how to solve the problem?

Sorry for the lengthy replay but I needed to fully explain the context.

Best and thanks again,

Carlo

Hi all!
I have been browsing forum and (with my little knowledge) the source code to understand how I could retrieve, during the generation of rep107, the tax rate per each item to include it in the invoice (that is a requirement locally).
I cannot "guess" the rate by reverse calculation due to rounding of numbers.
e.g. an item with VAT 4% priced 1.58 EUR with a discount of 25% will generate values that, applied to the reverse calculation of VAT, will return 3.92% (which is obviously wrong).
While that is correct in GL, because the needed rounding of numbers, that is of no value to print the rate used originally.
How can I retrieve that value?
Any SQL you might suggest?
Any help will be highly appreciated because I am totally stuck without such info.
Thanks a lot to all for the great job and support.
Carlo

apmuthu wrote:

The complete UK rep107.php and doctext.inc patch with screenshots are attached herein. Please check how you wish to code in the summary tax (or omit it fully) and the correctness of the "included" tax in the line items. Please test for multiple items with different rates of tax in invoices before submitting full patch.

Hello.
I have tried the report but, at least as far as Italian (and presumably EU) rules are concerned there are some glitches.

Let me start with the most annoying one:

Let's assume, for the sake of the example, that you are selling 5 items, each with a different VAT situation.

Items 1 is VAT taxed at 22%
Items 2 is VAT taxed at 10%
Items 3 is VAT taxed at 4%
Items 4 is VAT taxed at 0% although it's a domestic sale for some tax reasons
Items 5 is VAT taxed at 0% although it's a domestic sale for some other tax reasons

I am not making thing complicated. I tried to keep it simple but this is what really happens in reality (at least here in Italy).

I made a little modification so that I could get the total of the taxable amounts per each VAT%. Simple and easy.

When I print the invoice (using the above mentioned patch), is shows (at the end of the invoice) the correct amounts for all VAT% which are above zero.

For some unknown reason, it does not show the taxable amount for the zero rated VAT lines and, instead of showing zero in the newly added VAT% column, it shows 32%. (none of the VAT rates in the system is set to 32%, only 22,10,4,0 and 0).

Any idea why?
Best,
Carlo

Hi all.
I am trying to include some additional info into rep107 (sales invoice).

in a modified  rep107.php file that was posted in this forum, I find (around line 107) the following code:

****
$Net = round2($sign * ((1 - $myrow2["discount_percent"]) * $myrow2["unit_price"] * $myrow2["quantity"]),
                   user_price_dec());
                $SubTotal += $Net;
                $DisplayPrice = number_format2($myrow2["unit_price"],$dec);
                $DisplayQty = number_format2($sign*$myrow2["quantity"],get_qty_dec($myrow2['stock_id']));
                $DisplayTaxRate = number_format2($myrow2["unit_tax"] * 100 / $myrow2["unit_price"],user_percent_dec()) . "%";
                $DisplayNet = number_format2($Net,$dec);
                if ($myrow2["discount_percent"]==0)
****

What I actually need is to show, instead of
number_format2($myrow2["unit_tax"] * 100 / $myrow2["unit_price"],user_percent_dec()) . "%";

the field 'name' of table 'item_tax_type' which is associated to each item sold.

The purpose is to show per each item sold the code of the tax associated with the item as required by accounting here in Italy.
I cannot use the percentage as in the example but the name given to such tax, because some tax types need to be identified correctly: e.g. 0 VAT can depend on many reasons, export (a code), special VAT rate (another code), etc.

Is it feasible?
Any suggestions?

Thanks for the great job you are doing with FA!

Regards,

Carlo

Hi all.
Among several other languages which are available, I noticed that the Italian version is somehow behind.
There are two areas which needs improvements.
The translation of the internal program messages is missing some parts which have been left in English.
In this case the .PO lacks the entire line that needs translation.
For example, Print Invoices and Print Credit Notes is left in English but, when I edited the .PO file, such part was missing (I mean the original English ones) so I could not proceed and amend the translation (which for the rest is good enough).

Going to the main goal, I'd like to implement your wike pages into Italian.
I have already installed on my server PmWiki.
Is there a way that I can locally upload your current wiki in its entirety so that I can edit the same and add Italian off-line?
Once finished, I'd gladly share this with everybody and you could add this language too in your wiki pages.

Please let me know how and if I can proceed.

Thanks and best,
Carlo

Hi all.
I have a customer which is selling ice-cream ingredients AND ready made ice-cream.
When I need to process a sales order, everything is smooth and easy.
This is just a process of items input and no manufacturing is involved.
This kind of sales are directed to those ice-cream parlours which are then going to process the ingredients in their workshop.
Some other clients, on the other hand, are ordering ready made ice-cream and that involves manufacturing.
This is posing some problems.
First I have to move the ingredients need to make each specific flavours from the main warehouse to the factory area, so that their specific warehouse got enough "materials" to manufacture the specific item.
Then I have to make, for each flavour, a WO so that the factory can process the same.
Usually it is a long list of flavours and it is very much time consuming.
Is there any way to automate this process? Let's say a sort of batch command or a script?
Any hint or idea is more than welcome.
Thanks,
Carlo

I will try your suggestions and report back as soon as it is done.
To be frank with you, I had tried already that route on my own but installing a clean 2.3.19 version.
Unpleasently the results were the same with errors.
I'll try with your and let you know.
Best,
Carlo

Dear Joe,
I sent the required files about 4 minutes ago.
I used contributions since I could not find a way to attach a document using the forum (my inexperience, I suppose).
Best,
Carlo

Thanks for your prompt reply.

All I can think of, excluding a coding error, is that I made a backup and immediately after a restore.

It could be that in the process something went ape.

Would it help if I sent you the backup sql?

That way you'd be able to reproduce the error (I guess) and maybe find out why.

Let me know if you think this is a viable approach.

Thanks again,

Carlo

I was using FA with no big problems.
Today I needed, for the first time ever, to invoice some services.
This is what I did:
I created a new item as a service.
I created a new customer with all his relevant data.

I then tried placing an order as usual, except the "goods" was a service.
Naturally that did not involve inventory.

I issued a delivery note (although I do not understand the need since it's a service).
When printing the delivery not, to my surprise, instead of the delivery note number I got a text string.
"Project-Id-Version: FrontA"
I presume that the string was longer but it was cut due to the field constrains in printing.

I carried on and tried to print my invoice, hoping that this was just a glitch.

Same result.

The same text instead of the invoice number.

I tried with direct invoice with the same result.

I created a new customer again, a new item again and attempted again with both methods.

Same result.

I even installed a new clean FA (I'm using version 2.3.19) and recreated the whole thing.

Again that string instead of the number.

I'm simply stuck.

Any idea? Does anybody know what that might be?

Any help will be appeciated.

Thanks in advance,

Carlo

P.S. besides this problem, I am an FA enthusiast.

18

(1 replies, posted in Setup)

Hi to all.
We operate in Dubai and there is no such thing as GST and/or VAT in that country.
I can set no tax but when I print a delivery note or an invoice it shows "TOTAL DELIVERY INCL. VAT".
How can I get rid of that sentence or how can I change it to "TOTAL DELIVERY VALUE" (for example)?

I already examined both doctext.inc and header2.inc to no joy...

Any hint anybody?

Thank you so much from a very very novice with FA.

Best,

Carlo