Jump to content

Questions to accountants. Please Help.


milamber

Recommended Posts

Hello,

 

I have started using WHMCS in Poland. I've got EU VAT. However I run into some important problem.

 

I have changed in WHMCS to start invoices sequentially in templates.

I can see that now invoices are created when payement is done which is good BUT the invoice date is the same date as proforma had which couses problems with accounting like:

 

Inovice #100 - date 01/06/2009

Invoice #101 - date 25/05/2009

 

and as you can see invoice #101 has earlier date than invoice #100. I think that invoice should has creation date along with payment to avoide such problems.

 

How did you manage to solve these problems? Thank you in advance!

Link to comment
Share on other sites

i am from within the EU too, this is not a question for book keepers but a technical one imho:

 

use action hooks to set the invoice date to paid date as soon as the invoice is marked as paid.

 

function actionhook_InvoicePaid($vars) {

update_query("tblinvoices",array("date"=>"now()"),array("id"=>$vars["InvoiceID"]));

# This function runs when an invoice is fully paid and therefore the services renewed

# $vars["InvoiceID"]

}

test before putting it in production and of course backup your DB first.

Edited by minadreapta
Link to comment
Share on other sites

Hello,

 

Still problem. I have created test account make new invoice set as like it was created yesterday and then add payment. The invoice was created still with old date :( instead of today date.

 

Invoice Date: 03/06/2009

Due Date: 03/06/2009

Link to comment
Share on other sites

you're doing something wrong, i don't know what... try to empty the templates_c directory, maybe it helps.

 

i am using WHMCS v3.6.2 yet, maybe the action hooks changed in the mean time in 4.0 version...

 

take a better look at the action hook and adapt it to your needs...

 

this works for me

Link to comment
Share on other sites

Hello,

 

Ok I found the problem. In 4.0.1 all hooks are in /includes/hooks there must be a file created. I solved it this way

 

<?php
function update_payment_date($invoiceid) {
update_query("tblinvoices",array("date"=>"now()"),array("id"=>$invoiceid));
}

add_hook("InvoicePaid",1,"update_payment_date","");
?>

 

It is working :) However I found a little annoying thing. The "due date" is now back in history :)

I think that I should not update it this way so the best option would be to edit template and in proforma show due date and in normal invoice show payment date as due date. What do you think ?

Link to comment
Share on other sites

hello milamber,

 

This is also a problem in portugal... but this issue was already discussed on another post

http://forum.whmcs.com/showthread.php?t=10517&highlight=proforma+invoice+date

 

Any way does anybody need to have the invoice with the proforma invoice date? Why not make the payment_date=invoice_date as default, after all isn't the real invoice created when the payment is made?

 

Regards,

David Duarte

Edited by drtduarte
Link to comment
Share on other sites

THank you drtduarte.

 

In fact I asked Mat yesterday why not make this by default:?:

I'm waiting for answer.

 

Anyway thanks to you (in thread you sent link to) I have found out that clients get wrong pdf before date is changed. I stopped sending pdf invoices to clients.

Link to comment
Share on other sites

Hello,

 

Still problem. I have created test account make new invoice set as like it was created yesterday and then add payment. The invoice was created still with old date :( instead of today date.

 

Invoice Date: 03/06/2009

Due Date: 03/06/2009

 

It shouldn't change the date, that doesn't make sense. The invoice date hasn't changed.

 

For your original question, have a look in invoicepdf.tpl and you will see a commented out group of lines. They should be uncommented. I don't know if the previous line should be commented out or not.

 

Usual programming disclaimers, etc. apply.

 

Cheers,

 

Mike

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated