vtiger Forum Index vtiger
The Honest Open Source CRM
 

[PATCH]VTiger5 RC invoice export to pdf
Click here to go to the original topic

 
       vtiger Forum Index -> Code Contributions - 5.0.2
Previous topic :: Next topic  
Author Message
GJdeBoer



Joined: 14 Aug 2006
Posts: 4
Location: Drachten

Posted: Mon Aug 14, 2006 7:54 pm    Post subject: [PATCH]VTiger5 RC invoice export to pdf  

The invoice export to pdf did not work in RC.
I fixed a small error in Invoice.js where product_name and product_id should be replaced with invoice_name and invoice_id.

Below is the .diff:
root@siona:/home/www/virtual/nosco-ict.nl/crm/htdocs/modules/Invoice# diff Invoice.js.back Invoice.js
21,22c21,22
< var fldName = getOpenerObj("product_name");
< var fldId = getOpenerObj("product_id");
---
> var fldName = getOpenerObj("invoice_name");
> var fldId = getOpenerObj("invoice_id");
root@siona:/home/www/virtual/nosco-ict.nl/crm/htdocs/modules/Invoice#

Hope this helps.

Regards,

Gert-Jan de Boer
Back to top  
codyheit



Joined: 17 Jun 2006
Posts: 258

Posted: Tue Aug 15, 2006 12:57 am    Post subject: [PATCH]VTiger5 RC invoice export to pdf  

Yes I hope that this error was going to be fixed with the RC release. We should update the code to reflect this fix!
Back to top  
mmbrich



Joined: 24 Sep 2005
Posts: 428
Location: Colorado USA

Posted: Tue Aug 15, 2006 5:09 am    Post subject: [PATCH]VTiger5 RC invoice export to pdf  

I have a bunch of work to do on the PDFs before GA. Taxes, adjustments, etc still need to be added to most of the PDFs... I'll look into adding this patch while I am in there breaking stuff.

matt
Back to top  
codyheit



Joined: 17 Jun 2006
Posts: 258

Posted: Tue Aug 15, 2006 5:22 am    Post subject: [PATCH]VTiger5 RC invoice export to pdf  

Ok thanks

I assume that vtiger 5 will not work on mysql 4?
Back to top  
mmbrich



Joined: 24 Sep 2005
Posts: 428
Location: Colorado USA

Posted: Tue Aug 15, 2006 5:47 am    Post subject: [PATCH]VTiger5 RC invoice export to pdf  

I don't think it will but I haven't tried it.

Matt
Back to top  
GJdeBoer



Joined: 14 Aug 2006
Posts: 4
Location: Drachten

Posted: Tue Aug 15, 2006 7:08 am    Post subject: Re: [PATCH]VTiger5 RC invoice export to pdf  

mmbrich wrote: I have a bunch of work to do on the PDFs before GA. Taxes, adjustments, etc still need to be added to most of the PDFs... I'll look into adding this patch while I am in there breaking stuff.

matt
I only need working exported Invoices, sales orders can stay in the system, but I need to bill my clients.

Is there a quick workaround in the CreatePDF.php to add the Tax amount? It should just work. I guessed I could do a $total - ($subtotal-$adjustment) for now, but this doesn't work in CreatePDF because the fields are text and not numbers.
Back to top  
mmbrich



Joined: 24 Sep 2005
Posts: 428
Location: Colorado USA

Posted: Tue Aug 15, 2006 7:46 am    Post subject: Re: [PATCH]VTiger5 RC invoice export to pdf  

GJdeBoer wrote:
Is there a quick workaround in the CreatePDF.php to add the Tax amount? It should just work. I guessed I could do a $total - ($subtotal-$adjustment) for now, but this doesn't work in CreatePDF because the fields are text and not numbers.
I actually started my work in the Invoices just before beta. The formulas are not correct though, I was still too busy with the joomla stuff to pay any attention. Also, you can still do math functions on text fields, as long as the data you are working with is actual ints or floats your fine:
Code:
if((is_int($tax_percent) || is_float($tax_percent) && (is_int($total) || is_float($total)) {
        $total_with_tax = (($total * $tax_percent)/100);
}


I had planned on jumping back into the PDFs tomorrow, if you can wait a bit longer they will be done.. I may even get around to some of it tonight.

Matt
Back to top  
codyheit



Joined: 17 Jun 2006
Posts: 258

Posted: Tue Aug 15, 2006 12:15 pm    Post subject: Re: [PATCH]VTiger5 RC invoice export to pdf  

Well it looks like we have found the first problem with version 5.
Back to top  
GJdeBoer



Joined: 14 Aug 2006
Posts: 4
Location: Drachten

Posted: Tue Aug 15, 2006 1:18 pm    Post subject: Re: [PATCH]VTiger5 RC invoice export to pdf  

mmbrich wrote: GJdeBoer wrote:
Is there a quick workaround in the CreatePDF.php to add the Tax amount? It should just work. I guessed I could do a $total - ($subtotal-$adjustment) for now, but this doesn't work in CreatePDF because the fields are text and not numbers.
I actually started my work in the Invoices just before beta. The formulas are not correct though, I was still too busy with the joomla stuff to pay any attention. Also, you can still do math functions on text fields, as long as the data you are working with is actual ints or floats your fine:
Code:
if((is_int($tax_percent) || is_float($tax_percent) && (is_int($total) || is_float($total)) {
        $total_with_tax = (($total * $tax_percent)/100);
}


I had planned on jumping back into the PDFs tomorrow, if you can wait a bit longer they will be done.. I may even get around to some of it tonight.

Matt
Oh, I can wait. It works for the moment. Tomorrow my new business wil go into business, but I can work fine with a self-coded work-around for now. As long as the final version of vtiger5 will support full international invoices. (I need to replace the default currency with Euro)
Back to top  
 
       vtiger Forum Index -> Code Contributions - 5.0.2
Page 1 of 1


Powered by phpBB Search Engine Indexer
Powered by phpBB 2.0.15 © 2001, 2002 phpBB Group