Support A2Billing :

provided by Star2Billing S.L.

Support A2Billing :
It is currently Fri Apr 26, 2024 12:24 am
Hosted Voice Broadcast


All times are UTC




Post new topic Reply to topic  [ 8 posts ] 
Author Message
 Post subject: Invoices - Formatting Fixed - Email fixed
PostPosted: Sun Dec 30, 2007 9:19 pm 
Offline

Joined: Mon Oct 01, 2007 10:44 pm
Posts: 230
Location: Bovey, Devon, UK
Updated 14/1/08

Further update. Headers in the email sending out invoices did not include a valid return path. This means that you would not be notified if message bounced.

Issue fixed as per patch submitted to Trac

http://trac.asterisk2billing.org/cgi-bin/trac.cgi/ticket/182

This reformating exercise has now been submitted to trac (ticket 177) as there has been some further modifications. The patch files are based on 1.3.1

http://trac.asterisk2billing.org/cgi-bin/trac.cgi/ticket/177


Quote:
Formating of invoices were not displaying properly. In addition, legal requirements for invoicing were not present. DID billing SQL select did not work properly

** Note ** No data was harmed in this exercise (it's all display work)

Changes

Added a function in Misc.php to format totals to two decimal places Added new section [invoice] in Defines.php to allow entry of invoice company name, address, vat number etc (these should be in the DB, but I don't have the skills to write forms)

New section of a2billing.conf

[invoice]
;Information to be displayed on Invoices emailed to customers
my_company_name = My Company
my_company_reg =
my_company_vat_num = VAT: 999 996 3760 88
my_company_add1 = Line 1
my_company_add2 = Line 2
my_company_add3 = Line 3
my_company_add4 = Line 4

Misc.php now has option to specify date format

[webui]
;Format for date display
; 1 (default) d/m/y
; 2 m/d/y ;date_format_display = 2


Files affected
/A2Billing_UI/lib/invoice.php
/A2Billing_UI/lib/Misc.php
/A2Billing_UI/lib/defines.php
/A2Billing_UI/Public/A2B_entity_invoice_detail.php

regards

Attachments
defines.patch (2.3 kB) - added by middletn on 01/05/08 12:53:34.
invoice.patch (22.3 kB) - added by middletn on 01/05/08 12:55:28.
Misc.patch (1.5 kB) - added by middletn on 01/05/08 12:55:54.
A2B_entity_invoice_detail.patch (2.2 kB) - added by middletn on 01/05/08 12:57:29.






I've cleaned up the invoice module as it wasn't displaying properly and there was no invoice number

The part in question was the script that emailed invoices to customers.

The invoice now displays properly as a PDF.

If you want to display your own info, such as company details etc, suggestion would be to replace asterisk01.jpg

Changes:

Added Invoice number and account name
Totals including tax/VAT are now rounded to two decimal places
Changed DID charges to correct value
Modified where cause not to retrieve zero value DID's
Removed connection status (who cares, it's an invoice!)
Now displays unbilled/billed on invoice and file name as appropriate
fixed image path

Installation:

Download invoice.txt and misc.txt. Then rename to .php then
simply copy invoice.php to /a2billing_UI/lib folder overwriting old ones

[Update]
Grand total wasn't being displayed.
Made changes to misc.php as follows
Added new function to display to 2 decimal places
Changed date format to European d/m/y, clearly if you are in the US, you'll need to edit misc.php to be 'm/d/y' as required


regards


Last edited by middletn on Mon Jan 14, 2008 9:10 pm, edited 8 times in total.

Top
 Profile  
 
 Post subject:
PostPosted: Sun Dec 30, 2007 9:50 pm 
Offline

Joined: Fri Apr 28, 2006 5:11 am
Posts: 426
Great job!!! :clap2:
Thank you, middletn!


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jan 01, 2008 12:14 am 
Offline
Moderator
User avatar

Joined: Thu Jun 22, 2006 2:19 pm
Posts: 2890
Location: Devon, UK
Thanks for that middletn. Which version of A2B did you start from before making your changes?

You may want to consider submitting your changes as patches rather than monolithic source files in future. This is as easy as capturing the output of:
Code:
diff -u file.php.original file.php
This would be a great aid, as it lets us see exactly what you modified without having to engage in a sometimes time-consuming search for the exact version of the file you started from and then running the diff ourselves. Attaching the diff to a ticket on Trac will let us all analyse it with Trac's excellent patch highlighting view, again lowering the barrier to your work's acceptance into the tree.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jan 01, 2008 2:59 am 
Offline
User avatar

Joined: Mon Apr 30, 2007 6:43 am
Posts: 1060
Location: Canada
I am just adding up to Stavros message.
Code:
diff -u file.php.original file.php > patchfile.txt


Top
 Profile  
 
 Post subject: how do i input this into my a2b
PostPosted: Thu Jan 03, 2008 9:45 pm 
Offline

Joined: Fri Jan 26, 2007 9:52 pm
Posts: 23
how do i update this


Top
 Profile  
 
 Post subject: Re: how do i input this into my a2b
PostPosted: Thu Jan 03, 2008 9:57 pm 
Offline
Moderator
User avatar

Joined: Thu Jun 22, 2006 2:19 pm
Posts: 2890
Location: Devon, UK
rishkid wrote:
how do i update this
Read the first post again. :?


Top
 Profile  
 
 Post subject: found it
PostPosted: Thu Jan 03, 2008 11:39 pm 
Offline

Joined: Fri Jan 26, 2007 9:52 pm
Posts: 23
where is this folder

Added after 1 hours 3 minutes:

/var/www/html/A2Billing_UI/lib


Top
 Profile  
 
 Post subject: Re: found it
PostPosted: Sat Jan 05, 2008 9:19 pm 
Offline

Joined: Mon Oct 01, 2007 10:44 pm
Posts: 230
Location: Bovey, Devon, UK
rishkid wrote:
where is this folder

/var/www/html/A2Billing_UI/lib


Files affected
/A2Billing_UI/lib/invoice.php
/A2Billing_UI/lib/Misc.php
/A2Billing_UI/lib/defines.php
/A2Billing_UI/Public/A2B_entity_invoice_detail.php


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 8 posts ] 
Voice Broadcast System


All times are UTC


Who is online

Users browsing this forum: No registered users and 26 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group