Invoice, Delivery Note, Receipt - Delay interest

Before you ask about IDnR Addon see the VirtueMart - Invoice, Delivery Note and Receipt Addon
Talyn
Phoca Newbie
Phoca Newbie
Posts: 6
Joined: 11 Oct 2009, 00:56

Invoice, Delivery Note, Receipt - Delay interest

Post by Talyn »

Hi
The addon is really great. I try to adapt it for my purposes (for polish law), but i have one little problem.
The "Delay interest" textfield allow only to write a number. I need to write a words in there.

I have change meaning of that function, because I need type there amount in words.
I have found in ps_delivery.php function "exists_and_is_numeric" that checks delay interest input. And if it is in words, the invoice can't be created.

If there is other way to add function thats translate invoice amount in words please give me a solution.
Please help! :)
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 48403
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Invoice, Delivery Note, Receipt - Delay interest

Post by Jan »

Hi, maybe you can work with numbers and only as output you can add some string (some word function) so the invoice will display it as not a number :idea:
If you find Phoca extensions useful, please support the project
Talyn
Phoca Newbie
Phoca Newbie
Posts: 6
Joined: 11 Oct 2009, 00:56

Re: Invoice, Delivery Note, Receipt - Delay interest

Post by Talyn »

Hi, thanks for answer.
It would be great.
And how to make that?
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 48403
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Invoice, Delivery Note, Receipt - Delay interest

Post by Jan »

:( no idea as I didn't do such customization yet :(
If you find Phoca extensions useful, please support the project
boskoff
Phoca Newbie
Phoca Newbie
Posts: 9
Joined: 06 May 2010, 17:39

Re: Invoice, Delivery Note, Receipt - Delay interest

Post by boskoff »

Hi,

I was trying to add a function based on Numbers_Words PEAR class. I installed PEAR and I added the Numbers_Words class. I fixed files locations with .htaccess in /administrator/components/com_virtuemart/pdf... Test scripts are working well.

But when I try to add a function or just to implement the function it simply does not allow the script to generate the pdf.

The script I tried to add in delivery.pdf.php was:

Code: Select all

// include class
include("Numbers/Words.php");
// create object
$inwords = new Numbers_Words();
// convert to string
$inwords->toWords($with_tax['final_price']);
and then maybe smthng like this:

Code: Select all

$pdf->Cell(30,5,$pdf->($inwords),0,0,'R')
I'm not very skilled in php - could you advice?
klikaklika
Phoca Newbie
Phoca Newbie
Posts: 3
Joined: 18 Feb 2010, 00:29
Location: Czech republic

Re: Invoice, Delivery Note, Receipt - Delay interest

Post by klikaklika »

Hello, i got a problem with this addon.
No offence, it is a great addon. I spend a lot of time on customization invoice.
There is a problem when i have a goods with two different taxes. e.g. 10% and 20% the counting is ok but in czech republic we have to see something like this:
Total 10% tax 12,- CZK
Total 20% tax 38,- CZK
And that is what i am missing on that addon.
It is possible that i only do not see it in code. (i am beginner in that)
Now i have on invoice this:
subtotal without tax ...
Total tax 50,- CZK
With tax
shipping
...
Can you give me an advice what and where to import to code, to see the same as in basket?
copied:
Celkem: 181,- Kč
DPH celkem: 20,- Kč
Celkové DPH obsahuje:
7,97600,- Kč (20% DPH)
12,06400,- Kč (10% DPH)
link is: www.cars-auticka.cz
product with 10% tax is: Omalovánky (use search)
product with 20% tax is any other

A ted cesky:
S timhle super doplnkem jsem az doposud nemel zadne problemy. Zatim jsem stravil spoustu casu nad upravovanim vystupu faktury. Ovsem nyni se objevila potreba druhe sazby dph. 10 a 20. Soucty jsou vsechny v poradku ale v cesu je potreba kdyz jsem platce dph aby byl rozpis jendotlivych sazeb...
je mozne ze jsem v kodu neco prehledl (neodkomentoval) jsem skutecne jeste zacatecnik.
Ale ve fakture se mi tento rozpis nezobrazuje. Chtel bych aby se to tam zobrazovalo alespon tak jako v kosiku kdyz pridam zbozi s 10% a s 20% tak se dole objevi:
Celkem: 181,- Kč
DPH celkem: 20,- Kč
Celkové DPH obsahuje:
7,97600,- Kč (20% DPH)
12,06400,- Kč (10% DPH)
odkaz: www.cars-auticka.cz
produkt s 10% dph jsou např. Omalovánky
produkt s 20% dph jsou všechny ostatní


Please help me with this.
Prosim o pomoc s timhle problemem.
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 48403
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Invoice, Delivery Note, Receipt - Delay interest

Post by Jan »

Hi, displaying of the parts on the invoice is made by these files:

administrator/components/com_virtuemart/pdf/delivery.pdf.php
administrator/components/com_virtuemart/pdf/phoca.tcpdf.php

Jan
If you find Phoca extensions useful, please support the project
klikaklika
Phoca Newbie
Phoca Newbie
Posts: 3
Joined: 18 Feb 2010, 00:29
Location: Czech republic

Re: Invoice, Delivery Note, Receipt - Delay interest

Post by klikaklika »

Well, thank you for info. I know this.
The problem is that the tax details is not shown on the invoice and i dont you how to ad them. I looked at the another topic and tryed the manual from there. But nothing has worked.
Should i post here those two files?
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 48403
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Invoice, Delivery Note, Receipt - Delay interest

Post by Jan »

This doesn't help. :( You need to load the data from database (if you doesn't have them) and somehow paste them to the PDF format (with help of the TCPDF class).

There is some default settings (default format of displaying) but this can be overriden (which is not easy - as working with PDF format and placing parts to the PDF document is not easy) - so in fact it is only a question of tests - try to find the value which you need and try to paste it into the document and test how this is displayed in the PDF, if not correctly then try to paste it into document with some other coordinate values :-( :-( The problem of VM is, there are a lot of options so the data can be loaded and worked on a lot of different places :-( so it is not easy to find the right value :-(
If you find Phoca extensions useful, please support the project
boskoff
Phoca Newbie
Phoca Newbie
Posts: 9
Joined: 06 May 2010, 17:39

Re: Invoice, Delivery Note, Receipt - Delay interest

Post by boskoff »

Jan wrote:Hi, maybe you can work with numbers and only as output you can add some string (some word function) so the invoice will display it as not a number :idea:
Hi All,

I managed to solve this using the NEW phoca invoice addon.

And this looks like this (I aplogise for not really proffesional expressions, I'm not php programmer):

1. in virtuemarthelper.php place a function which converts a number into words - just find one in the web, there are many scripts available. Let's say the finction name is "convert_to_words"

2. in virtuemartpdfoutput.php place something like this:
i.e. somwhere around line 97 (to define variable):

Code: Select all

$amount_in_words = string;
and then around line 252:

Code: Select all

$amount_in_words = PhocaPDFVirtueMartHelper::convert_to_words($a['with_tax']['final_price']);
$a['in_words'] = $amount_in_words;
3. in tmpl.invoice.php place something to display your words, choose a place you whish in the file, i.e. around line 84:

Code: Select all

//PLACE AMOUNT IN WORDS
$o .= ''
.'<table class="productattribute" cellspacing="2" cellpadding="0">'
.'<tr width="100%"><td>Amount paid in words:</td></tr>'
.'<tr width="100%"><td>'.$a['in_words'].'</td></tr>'
.'<tr><td colspan="2"></td></tr>'
.'</table>';
//END AMOUNT IN WORDS
That's it! :D

PS If I forgot about something let me know, I'm not a pro :roll:
Post Reply