Support A2Billing :

provided by Star2Billing S.L.

Support A2Billing :
It is currently Sun Apr 05, 2020 1:12 pm
Hosted Voice Broadcast


All times are UTC




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: FG_var_card.inc: how to assign a default value
PostPosted: Wed Jun 04, 2008 5:03 pm 
Offline

Joined: Sun May 25, 2008 12:08 am
Posts: 5
I try to assign a default value for VAT by putting a value in the third parameter in AddEditElement. However, it does not get displayed when to go create a new customer. Does any know why?

$HD_Form -> AddEditElement (gettext("VAT"),
"vat",
"",
"INPUT",
"size=10 maxlength=6",
"12",
gettext("Insert the number for the VAT"),
"" , "", "", "", "", "", "NO-NULL" , gettext("VAT to add on the invoice of this customer. it should be a decimal value '21' this will be for 21% of VAT!"));


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jun 04, 2008 6:09 pm 
Offline
Moderator
User avatar

Joined: Thu Jun 22, 2006 2:19 pm
Posts: 2890
Location: Devon, UK
That's a good question. You've got me stumped for the moment.


Top
 Profile  
 
 Post subject:
PostPosted: Sat Jun 14, 2008 7:46 am 
Offline
User avatar

Joined: Mon Apr 30, 2007 6:43 am
Posts: 1060
Location: Canada
Here is our you would add 21 as default value for 21% of VAT.

Code:
$HD_Form -> AddEditElement (gettext("VAT"),
"vat",
"",
"INPUT",
"size=10 maxlength=6 value='21'",
"12",
gettext("Insert the number for the VAT"),
"" , "", "", "", "", "", "NO-NULL" , gettext("VAT to add on the invoice of this customer. it should be a decimal value '21' this will be for 21% of VAT!"));


You can make it fancier by reading the default value from the configuration file (a2billing.conf). I will assume that the constant DEFAULT_VAT will be created in Class.A2billing.php in the same fashion the other constants are set using config options.

Code:
$default_vat = DEFAULT_VAT

$HD_Form -> AddEditElement (gettext("VAT"),
"vat",
"",
"INPUT",
"size=10 maxlength=6 value='{$default_vat}'",
"12",
gettext("Insert the number for the VAT"),
"" , "", "", "", "", "", "NO-NULL" , gettext("VAT to add on the invoice of this customer. it should be a decimal value '21' this will be for 21% of VAT!"));


Cheers


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 
VoIP Billing solution


All times are UTC


Who is online

Users browsing this forum: No registered users and 1 guest


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