Support A2Billing :

provided by Star2Billing S.L.

Support A2Billing :
It is currently Thu Mar 28, 2024 9:16 pm
Predictive Dialer


All times are UTC




Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: Multiple subscriptions and pro-rate subscription billing
PostPosted: Mon Jul 16, 2007 9:22 am 
Offline

Joined: Wed Jul 11, 2007 8:25 am
Posts: 13
I would like to make it possible for users to choose more than one subscription and to suscribe multiple time for the same subscription

this implies:
- modifications in database
- delete the id_subscription_fee
- create a new table associating cards and subscriptions
- modification of the cron a2billing_subscription_fee.php
- add pages in ui to add and list customers who suscribed

Then I would like to add a pro-rate option in a subscription. So if someone suscribes in the middle of the month, he only pays half the price.

Then another option to make him pay in advance

And to make it appear more clearly in the invoice ...


So I'd like to know if it will be possible, once finished, to include it in the trunk


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jul 19, 2007 3:39 pm 
Offline

Joined: Wed Jul 11, 2007 8:25 am
Posts: 13
For those who might be interested:

Description:
this patch adds the possibility to choose to which customer a subscription applies and to define for how long it will apply

Changes:
    added 2 pages in A2Billing_UI
    updated subscription cron service

Installation:
apply patch

for mysql
Code:
CREATE TABLE cc_card_subscription (
   id                         BIGINT NOT NULL AUTO_INCREMENT,
   id_cc_card                   BIGINT ,
   id_subscription_fee          INT,
    startdate                   TIMESTAMP DEFAULT CURRENT_TIMESTAMP NOT NULL,
    stopdate                   TIMESTAMP,
   description                MEDIUMTEXT,
   PRIMARY KEY (id)
)ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE utf8_bin;

ALTER TABLE cc_card DROP id_subscription_fee;

for pgsql:
Code:
CREATE TABLE cc_card_subscription (
   id                         BIGSERIAL NOT NULL,
   id_cc_card                   BIGINT DEFAULT 0 NOT NULL,
   id_subscription_fee          BIGINT DEFAULT 0 NOT NULL,
    startdate                   TIMESTAMP WITHOUT TIME ZONE DEFAULT NOW(),
    stopdate                   TIMESTAMP WITHOUT TIME ZONE,
   description                TEXT,
   PRIMARY KEY (id)
);

ALTER TABLE ONLY cc_card_subscription
    ADD CONSTRAINT cc_card_subscription_pkey PRIMARY KEY (id);

ALTER TABLE cc_card DROP id_subscription_fee;

Limits:
    I haven't tested it with pgsql
    I haven't programmed pro-rate and in advance billing yet


Attachments:
File comment: patch to apply from revision 86
patch from revision 86 - subscription 0.1.patch.txt [16.52 KiB]
Downloaded 429 times
Top
 Profile  
 
 Post subject:
PostPosted: Thu Jul 19, 2007 4:16 pm 
Offline
User avatar

Joined: Mon Apr 30, 2007 6:43 am
Posts: 1060
Location: Canada
Excellent contribution.

Can you add it to the trac?


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jul 23, 2007 7:35 am 
Offline

Joined: Wed Jul 11, 2007 8:25 am
Posts: 13
included in revision 92
thanx


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 
Predictive Dialer


All times are UTC


Who is online

Users browsing this forum: No registered users and 12 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