better docs for the worst bit, finally
[freeside.git] / TODO
1 $Id: TODO,v 1.60 2001-04-15 10:33:40 ivan Exp $
2
3 If you are interested in helping with any of these, please join the
4 *development* mailing list (send a blank message to
5 ivan-freeside-devel-subscribe@sisd.com) to avoid duplication of effort.
6
7 ---
8
9 ********
10 for 1.3.0: 
11 ********
12
13 move to DBIx::DBSchema.  (gets non-MySQL-specific dbdef-create)
14
15 finish transactions (svc_*.pm, fs_register/)
16
17 Pg-style or universal-style locking in fs_sessmon FS/FS/nas.pm, or rewrite it
18 to use a database expression that won't need it, or just dump the locking
19 entirely as nas_heartbeat stuff doesn't need to be accurate; it's just informational.
20
21 radius 
22
23 test with MySQL+Sleepycat?
24
25 ********
26 unclassified, probably either done already or post-1.3.0
27 ********
28
29 anything doing transactions in the web interface should likely move into *.pm.
30 (transactions are here woo!)
31
32 write some sample billing expressions with libcflow-perl :)
33
34 (future templating)
35 .
36 (at least) These questions need to be answered for Mason, Apache::ASP and
37 eperl.  If eperl becomes too much of a pain, I'm okay with forgetting 
38 about it - it's not well-maintained.  The answers below are for Mason.
39 .
40 How do you interpolate a value?  <% $value %>
41 .
42 How do you interpolate a value without escaping HTML? <% $value |n %>
43 .
44 How do you interpolate a (possibly non-stand-alone, non-interpolated) 
45 control structure?  With an inital % - for example:
46 .     
47         % for each $value ( @values ) {
48         <OPTION><% $value %></OPTION>
49         % }
50 .     
51 This is one of the things I worry that the webmonkey HTML editors will not
52 like about Mason.  That and the <%INIT> and <%PERL> tags.
53
54
55 in the context of a state machine (& MySQL and Pg locking) for LDAP export:
56 .
57 Also note that Pg locks are for the duration of the transaction, so 
58 Freeside needs to start using transactions for this to happen.  
59 FS::UID::adminsuidsetup should explicitly set AutoCommit false and export
60 some functions to begin and end transactions on $FS::UID::dbh.  (Well,
61 eventually FS::UID should be an overloaded subclass of a DBI handle, but
62 we don't have to worry about that until perl threads + mod_perl + threaded
63 Apache 2.0 is stable, i.e. quite some time).
64
65 Postfix
66 also supports virtual domains in a way that's somewhat similar (but not
67 compatible with) the way sendmail does.  In the postfix world, all virtual
68 domain info is contained in one file (similar to the virtusertable), but
69 is formatted as such:
70 bar.com         virtual
71 foo@bar.com             some@other.net
72 quux@bar.com    localuser1
73 ...
74 and so on.  After the file is generated, it gets compiled into a hash db
75 using, "postmap /etc/postfix/virtual".
76
77
78 steal all the play-nice-with-cache stuff back from RT
79
80 Use this for email checking:
81 libemail-valid-perl - Check validity of Internet email addresses
82 .                                                                
83 This module determines whether an email address is well-formed, and 
84 optionally, whether a mail host exists for the domain.
85
86
87 wishlist from drenalin@ultimanet.com:
88 * delete button for customers
89 - 15th of the month billing
90 - field for customer referrals (naming who it is) and automatically crediting
91 +that account
92 - ability to edit referrals
93 - catch expired credit cards and notify via email when they are expiring
94 * show passwords
95 - set default shell to /bin/false when adding ppp account
96 - import list of POPs from Megapop (see www.ultimanet.com and click on locations
97 +from text in index page)
98
99
100 wishlist wrt projects/consulting from jivko@ijs.com:
101 >The other thing, which is the serious part, is the following: We do not
102 >offer dial-up services and that part of the system does not have to work,
103 >but we have many customer, for which we do both hosting and consulting work.
104 .
105 >The hosting can be handled by freeside fine, but in the little time I spent 
106 >on it I could not see how exactly to solve the consulting problem. What I
107 >would love to see there is a way to create 'projects' for each customer and
108 >ability to follow up on those (I mean to be able to add new comments,
109 >descriptions, progress updates etc.). You already have the feature, which
110 >allows multiple people to access the system with different access rights so
111 >it should be possible to make it keep track of who and when updated given
112 >'project' so we could have the developers access the database and update
113 >the projects they are working on.
114 .
115 Hmm.  Is this accurate:  Each project is related to a single customer, and
116 zero or more packages (billing items).  Each project has a name, due date,    
117 and zero or more log entries consisting of date, user, and a text field
118 (for "new comments, descriptions, progress updates etc." - would you like
119 anything more specific?)
120
121 In conjunction with that it looks like you need the ability to create
122 "one-off" packages on the fly for arbitrary charges.
123
124 > Additionally it would be nice to have a page, where all open projects can
125 > be listed and not only that but be able list them by date too. (Say I want
126 > to find out which projects are due today or two days from today, or which
127 > projects are running late)
128 .
129 Browse/search project by date and customer.
130 .
131 > Finally it would be real nice if the billing script could add the cost for
132 > all completed projects (or work done by the hour) to the monthly bill along   
133 > with the hosting information and using the description of the work from the
134 > 'project' table. 
135 .
136 Can you be more specific about your needs here?
137 .
138 > This is a lot of work, unless you disagree :-), and I would not expect you
139 > to do all of it - we can work on it too - but I would hope for you to lead 
140 > the effort.
141 .
142 I'm trying to get a handle on specifically what you need.
143 .
144 > Oh, and there is one more thing, but that should be simple to do. I would
145 > like to be able to give the customers access to selected information from
146 > their account. I want them to be able to monitor the progress of their
147 > projects and the status of their accounts. 
148 .
149 Ok.
150 .
151 > Does all this make sense? It must be close to what you need at your office
152 > though or at least I think so.
153 .
154 Yes, but we're small and have been tracking projects manually.
155 .
156 .
157 >You may have this already .. what I have in mind is the following. Say you
158 >have a customer for which you do hosting and some consulting (CGI, JAVA
159 >etc) At the end of the month you need to bill the customer for the hosting,
160 >35hours of Java programming and 10 hours of HTML authoring. The last two
161 >are not because the project is over but because the work was done during
162 >that month.
163 >
164 >So the way I see it, and it could be wrong, is that during the month the
165 >people who work on particular project enter their comments and time spent
166 >on the project. At the end of the month the billing script generates
167 >invoices in which besides the hosting charges there are also charges for
168 >work done during the period.
169 >
170 >Currently we do this in a very stupid way by maintaining a customer file,
171 >in which a script saves things to be invoiced. At the end of the month a
172 >script goes through these files and generates invoices with all items from
173 >the files, which have not been flagged as 'paid'. The convenience of this
174 >is that no one needs to worry about the invoices containing the items they
175 >need to contain.
176
177
178
179 first package select field in edit/cust_main.cgi isn't sticky on errors, yuck
180 (also referral isn't sticky either?  yuck)
181
182 > 1. A Web Form to the user get his account added automatically . The
183 > /etc/raddb/users and /etc/passwd would be updated automatically (these
184 > file are on the same machine Freeside is). I guess the the Add
185 > Customer
186 > page with some customization could be the work.
187 > 2. A Canceling Account Web Form available to user cancel his account   
188 > at
189 > any time he wants.
190 > 3. A Password Changing Web Form where the user could change your
191 > password by sending your username, old and new password.
192 > 4. Additional POP Accounts Creation where the user supply only his
193 > main
194 > username/password (probably provided from a PPP Account already
195 > created)
196 > and his POP username/password for this specific account.
197 (actually need something more general i guess - probably need some way to say
198 which accounts (svc_acct) can log in and make changes per customer (cust_main) )
199
200 this is awfully vauge, perhaps email for more info?  don't want to alientate
201 someone with accounting experience, but i just don't have time right now.
202 .
203 Hi Ivan,
204 .
205 Thanks for the information. It took me a little while to figure it out, but I
206 +was
207 able to create an invoice. As a lamer and an accountant, may I make a few
208 suggestions?
209 .
210 On the Customer view page:
211 1) Layout the information in the manner the invoicing process is conducted.
212     a) Customer information                                                
213     b) Package Ordering    
214     c)  Add a "Create & Edit Invoice" section - this allows auditing of  the
215 invoice     before it is processed.
216     d) then put the billing section to actually process the invoice
217     e) then put payment history information                        
218 .
219 Thanks,
220 Mark Roberts <mroberts@iopenenterprises.com>
221
222
223 new overdue code might be overzealous.  test carefully.
224
225 Port Freeside to use the modules that were abstracted from it:
226 Net::SSH, Net::SCP, DBIx::DataSource and DBIx::DBSchema, at least.
227
228 "first package" and email invoice (?) not sticky on errors in new/edit customer
229 screen.
230
231 http://www.ipmeter.com/ integration would be useful
232
233 http://tangram.sourceforge.net/
234 Tie::DBI
235
236 mmm, http://pootpoot.com/~dlowe/DBIx-Table/
237
238 The cybercash links in htdocs/docs/config.html are b0rken.
239
240 Yes.  Which is what I've been trying to tell you.  (destination user,
241 destination domainname) would be represented by the svcnum of a record in
242 svc_acct.  (In retrospect, using the uid instead of the svcnum was a bad
243 choice).  (domuser, domain name) would be part of the svc_acct_sm record,
244 as domuser and domsvc.
245
246 Upon further consideration, I'll probably eliminate the svc_acct_sm table
247 completely, and just add a field for the svcnum of a domain and the svcnum
248 of a destination mailbox to svc_acct (or perhaps a one-to-many
249 relationship - multiple svcnum(s) for multiple destination mailboxes.
250 hmm.)
251
252 > > > > Longer-term, I need to do something about the length of the             
253 > > > > column names -                                                          
254 > > > > The SQL1992 standard defines 18 character column names,                 
255 > > > > which would be a                                                        
256 > > > > reasonable goal.                                                        
257 > > >                                                                           
258 > > > Maybe the thing to do would be to separate these out to separate          
259 > > > tables.                                                                   
260 > > > then we could simply use something like id, attrib_name,                  
261 > > attrib_value                                                                
262 > > > to                                                                        
263 > > > store all of the radius values.                                           
264 > >                                                                             
265 > > Hmm, no, that's not quite right.  You don't want to store the actual        
266 > > strings in the records for each account.  Probably need a table that        
267 > > corresponds to the RADIUS dictionary file, with a list of                   
268 > > attributes and                                                              
269 > > attribute id's, then reference the attribute by id and not name.            
270 > >                                                                             
271 > > The more difficult bit is handling the service definitions                  
272 > > correctly -                                                                 
273 > > part_svc and it's effects.                                                  
274 >                                                                               
275 > Yes that could be a bit tricky. Perhaps just one "radius" field in            
276 > part_svc that held a list of id's from the radius table that applied          
277 > that particular service?                                                      
278
279 No, that wouldn't let you set defaults or fixed values for each attribute,
280 like part_svc currently does.
281  
282
283
284 hmm - if you delete an account in svc_acct somehow that a mail alias points to,
285 svc_acct_sm.export will fail.  make sure this can't be done using
286 the web interface.
287
288 Bug: during the linking process apparantly you can link too many services to 
289 a package.  *sigh*
290
291 zip code i18n is not very good :( but at least US, CA, HU, ?
292
293 ut_phonen doesn't check data length.  several
294 orthogonal cleanup projects here.  *sigh*
295
296 update the cybercash links in config.html and in the homepage.  add more explicit support for other payment types.  etc.
297
298 From "Tim Jung" <tjung@igateway.net>
299 .
300 Automatic CC Decline Notices via email
301 Block Time billing for prepaid internet cards (400 hours or whatever block
302 time of hours)
303 Trouble Ticket System with simple search function for Knowledge Base feature
304 Employee Timecards
305 Credit Card System support for Red Hat's CCVS, and other Linux credit card
306 programs
307 Contact Manager/Lead Tracking
308 Pre-Sale Quotes
309 Cisco NetFlow Account for IP traffic billing
310 VoIP and FoIP billing
311 Roaming per minute billing based on Radius Proxy support or number they
312 dialed into from Radius logs (800# etc)
313 Support for OpenSRS Domain Registration
314 Support for TUCOWS signup CDs
315
316
317 dbdef-create for postgres
318
319 pro-rating, fiddling dates
320
321 It looks like svc_acct.import doesn't deal well with comments and
322 multi-attribute lines.
323
324 ivan@rootwood:~/freeside_current$ rgrep -r domuid * | cut -d: -f1 | sort |
325 uniq
326 CVS/Base/TODO
327 TODO
328 bin/fs-setup
329 bin/svc_acct_sm.export
330 bin/svc_acct_sm.import
331 htdocs/docs/man/svc_acct_sm.txt
332 htdocs/docs/schema.html
333 htdocs/edit/CVS/Base/part_svc.cgi
334 htdocs/edit/part_svc.cgi
335 htdocs/edit/process/svc_acct_sm.cgi
336 htdocs/edit/svc_acct_sm.cgi
337 htdocs/search/svc_acct_sm.cgi
338 htdocs/view/svc_acct_sm.cgi
339 site_perl/svc_acct_sm.pm
340
341 rootwood:COMPLETEHOST/TODO
342
343 Currently, you set a value in the %FS::UID::callback hash with a coderef  
344 of the code you want to execute, but this was bad design and will shortly
345 be changed to a subroutine to which you pass your coderef to register it.
346
347 This is not a bug, it is how the system is currently designed.  After 
348 defining a new package, you need to specifically allow agent types to
349 purchase packages.  You can do this from the edit screen of the new agent
350 type.
351 .
352 It wouldn't be a bad idea to add a configuration value that makes new
353 packages available for all currently existing agent types automatically.
354 .
355 On Fri, Apr 07, 2000 at 10:50:35AM -0500, David Morton wrote:
356 > For some reason, the type_pkgs table didn't get updated when I tried to
357 > create a domain service and package...  insert into type_pkgs values   
358 > (4,1);  fixed it up so that I could actually order the package.
359
360
361 From: Chuck Cochems <zaphod@tdl.com>
362 .
363 1) automated generating of late notices.  So far the only way I know to
364 generate one is to re-invoice manually.
365
366 2) smart credit card rejection handling.  It should e-mail a note at
367 least, explainig that it did't go through, and why.
368
369 3)coment field in the main customer record.
370 .
371 4) streamlined payment entry feature. the current scheme has it fairly
372 buried.
373
374 5) queries to show al customers who owe money,and such stuff as that.
375
376
377 credits aren't counted against past invoices?  hmm.  something needs to be
378 done to "apply payment" genericly. and zero out invoices etc.
379
380 more email which should make it into a more organized TODO list:
381 .
382 I would also love to see Freeside support bandwidth billing by reading the
383 Cisco NetFlow Accounting data so we and other ISP's could automatically bill
384 co-located servers and even potentially other virtually hosted sites like
385 MUD, Palace Chat, IRC Chat, etc based on the bandwidth they use or average
386 sustained rates or whatever. I'm not much of a programmer so I don't know
387 what all this entails but I did download a NetFlow client agent/whatever for
388 Linux though.
389  .
390 It would also be nice to see Freeside be able to read Apache log files and
391 bill customers for web traffic that way as an option also. Plus an option to
392 bill for excessive disk usage without having to use quotas if you didn't
393 want to, would be a nice feature as well. So you could monitor with a script
394 or something to see how much disk space a user was using then get some
395 average and charge a certain amount for anything above some preset limit for
396 that account type. I might be able to hack something like this up, but I'm
397 not 100% sure where to start or if there is something out there that could
398 be modified or not.
399 .
400 Do you think that you will ever support the HKS CCVS (Hell's Kitchen
401 Software Credit Card Verification Software) since Red Hat bought them out
402 and is going to be including that for credit card processing when you buy
403 the professional version? What about possibly supporting the OpenCCVS which
404 is a GNU/GPL version of a credit card program? I haven't had time to comb
405 through the Freeside code to see how hard it would be to add support for
406 these as externally called programs.
407 .
408 Also any thoughts on help desk, and knowledge base stuff? Any thoughts on
409 this stuff, and how possible and what kinds of work or time frame would be
410 involved?
411 .
412 Tim Jung
413 System Admin
414 Internet Gateway Inc.
415 tjung@igateway.net
416
417
418
419            CVS via SSH (Score:1)
420            by platinum (jedgar at fxp dot org) on Thursday September 30, @07:13PM EDT (#4)
421            (User Info) http://www.fxp.org/~jedgar
422            The links above are your best bet for basic cvs server configuration. Once you have a pserver set up, you
423            may consider using cvs via ssh. All you need to do is the following: 
424
425            1) Have ssh and sshd set up on the client and server machines 
426            2) Set CVSROOT="joe@example.com:/home/ncvs" 
427            3) Set CVS_RSH="/usr/local/bin/ssh" 
428            4) Use cvs normally 
429            (Obviously, insert the proper host/paths above) 
430
431            You can also set up cvs/ssh to not need a password every time (similiar to an initial 'cvs login'): 
432
433            1) run ssh-keygen on client machine using no passphrase. 
434            2) copy/add ~/.ssh/identity.pub on the client to ~/.ssh/authorized_keys on the server 
435            (man ssh for more details) 
436
437            The main reason I mentio
438            CVS via SSH (Score:1)
439            by platinum (jedgar at fxp dot org) on Thursday September 30, @07:13PM EDT (#4)
440            (User Info) http://www.fxp.org/~jedgar
441
442
443 There's no way to do this currently, though it would be pretty
444 straightforward to modify the source - specifically, the _collect_
445 subroutine in FS::cust_main.
446 >
447 On Mon, Dec 13, 1999 at 04:05:32PM -0700, Jeff Garner wrote:
448 > Freeside will e-mail my users when they are billed if they are setup as
449 > billing.
450 >
451 > When setup by credit card it does not e-mail them.  Is there a way to
452 > turn on e-mail invoices for those who are billed via credit card?  Kind
453 > of like a recipt of billing....
454
455
456 doc: http://www.softagency.co.jp/mysql/qmail.en.html
457
458 sql1992.txt standard is 18 character column names.  shoot for that, not just
459 32 (postgresql default)
460
461 Also note that (AFAIK) Freeside won't display any package that has more
462 than one service on the "Add Customer" page.  The reason for this is
463 because there's no way to dynamically alter the displayed html form
464 based on which package is selected. One possible solution would be to
465 make an additional page that's used in the signup process that would
466 display the form for each package, like a MS-style "Wizard".  The first
467 page lets you select the package, then the second page has the custom
468 form with fields for each service in that package and a save button. Of
469 course, that would require a little perl work.
470 .
471 Later,
472 Scott Cruzen <sic@boernenet.com>
473
474
475 Your suggested script with back up /usr/local/etc/freeside, but will miss
476 any database not named `freeside'.  Both of our scripts are specific to
477 MySQL.  If you're interested in contributing to Freeside, maybe you could
478 work on a script which: reads the mapsecrets configuration file and then
479 each secrets file to find out what specific database engine(s) (MySQL,
480 PostgreSQL, etc.) and database(s) need to be backed up, then does so,
481 serializing backups of the same engine, i.e. stop mysql, do all the mysql
482 backups, start mysql, stop postgresql, do all the postgresql backups,
483 start postgresql, etc.
484 > #!/bin/sh                                                                     
485 > apachectl stop                                                                
486 > mysqldump -t freeside > fs-backup.sql                                         
487 > apachectl start                                                               
488 > tar -Pzcvf fs-backup-`date +%y%m%d%H%M%S`.tgz fs-backup.sql /usr/local/etc/freeside/                                                       
489 > rm fs-backup.sql                                                              
490
491 I chose to use counters in the filesystem because there is no standard way
492 to get the value of an auto-incrementing keyfield which is common across  
493 all databases (as seen through DBI/DBD).
494 .
495 It certainly wouldn't be a bad idea to use the database-specific methods,
496 when available.
497
498 htdocs/edit/svc_acct.cgi:
499 (Does the `*HIDDEN*' show up when you are adding a new account, and 
500 specify the password, then receive an error and are returned to the form?)
501
502 more DOC:
503 Thought some of you might be interested in this:
504   
505 <ftp://ftp.minivend.com/pub> has CyberCash compatibility modules for 
506 Paymentnet <http://www.paymentnet.com> and Authorizenet 
507 <http://www.authorizenet.com> which should allow you process transactions
508 using those services as well as CyberCash.
509
510 The files are named CCLib.pm.paymentnet and CCLib.pm_authorizenet,
511 respectively, and are installed by renaming to CCLib.pm and moving to your
512 site_perl directory.  Otherwise, follow the directions for Cybercash v2 in
513 htdocs/docs/config.html
514
515 DOC:
516 fs_passwd/ is a client-server replacement for the `passwd', `chfn' and    
517 `chsh' commands that updates the Freeside database.  (so for that to be   
518 useful, you'd have to be exporting that data periodically)
519   
520 fs_radlog/ is a client-server RADIUS log parser that stuffs the data into
521 SQL.  It isn't finished, and probably won't be unless someone who I can't
522 convince to use one of the RADIUS daemons that logs to SQL directly pays  
523 me money or something.
524   
525 fs_signup/ is a client-server signup server.  i'm just finishing it up    
526 now; probably isn't on your machine yet.
527
528
529 http://www.sisd.com/freeside/list-archive/msg00812.html
530
531 package definitions should be implicit allow wrt agent types, not implicit deny
532 (with the old behavior possible via a config file)
533
534 > So is there anyway it could be setup to allow you to select a "primary
535 > service" from each package?  This service would be the one you were prompted
536 > for.  Could the signup server then be expanded to allow users to go into
537 > their package and "turn-on" the remaining non-primary services(using the
538 > primary account.)
539
540 take the GPL'ed whois proxy stuff at www.geektools.com and turn it into
541 intelligence for Net::Whois.
542
543 A web version of the fs_passwd stuff would be nifty.   
544
545 If you have Cistron authenticating directly from MySQL, you can replicate
546 in real-time instead of exporting periodically.  See 
547 <http://www.mysql.com/Manual_chapter/manual_Common_problems.html#Replication>.
548
549 these go in docs:
550 <http://www.sisd.com/freeside/list-archive/msg00541.html> (was 546), and
551
552 and http://www.sisd.com/freeside/list-archive/msg00421.html (was 423)
553
554 > > 5: Is there anyway to get freeside to send a sysadmin a warning when a
555 > > credit card has expired?
556 No, but there should be.
557
558 Put this in the doc (quoting Mark Wells <mark@pc-intouch.com>):
559 >Of course, thanks to the sheer coolness of SQL and MyODBC, you can do
560 >whatever reports you want in basically whatever application you want.
561 >There's no need for Freeside itself to do any reports at all.
562
563 middle names and titles
564
565 On Wed, Jul 07, 1999 at 01:11:40PM -0400, Frank Nazario wrote:
566 > Playing and entering information to Freeside i encountered the following
567 > missing reports:
568
569 > View Customers by Agent
570
571 > View Pending Invoices
572
573
574 grep 'uncomment this to encrypt password immediately' site_perl/svc_acct.pm
575 Not to say that it shouldn't be a configurable option.
576
577 in site_perl/cust_main_invoice.pm (elsewhere?), error out if mydomain config file is gone
578 (at least until the idea of a default domain goes away)
579
580 FS::Record::qsearch does an eval every loop iteration (which is itself not
581 guaranteed to work across all DBD's and should be fixed).  This has got to be
582 slow.  Fix it.  (I think recent Perls might have a way to accept a variable
583 there, no eval needed?)
584
585 Could you have added /bin/sync, /sbin/shutdown, and /bin/halt to the
586 `shells' configuration file before importing, and removed them afterwords?
587 (even better if svc_acct.import did that automatically - it could just    
588 munge and restore @FS::svc_acct::shells... hmm.)
589
590 > BTW, Ivan, I am trying to verify in an additional database table that a
591 > particular user doesn't exist. This database is used to store email aliases a$
592 > additional POP boxes for our customers (kinda like AOL allows). I have toyed  
593 > with the idea of just writing the aliases to an email only svc_acct that
594 > doesn't write to the password file, but that isn't really how I want to do it.
595
596 Actually, I think that's a pretty good way to do it.  Cerkit contributed
597 support a little while back for svc_acct.pm and svc_acct.export for
598 multiple export targets.  It needs to be cleaned up and documented, which
599 I'll try to get to soon.  For this to work correctly, the svc_acct_sm
600 table should go away, along with the concept of a "default" domain.  
601
602 default setting for new packages should allow all agents to purchase them...
603 with a config file for the old behaviour
604
605 fix or replace Term::Query (Quiz::Question doesn't do what i need)
606
607 Check config file reading stuff from CPAN
608  
609 Authorizenet module from CPAN!
610
611 <http://www.math.fu-berlin.de/~leitner/mutt/faq.html> has a good y2k complience
612 statement!
613
614     I'm hoping Freeside can support arbitrailly complex pricing plans
615     because of a simple concept: all prices are perl expressions.  So if
616     you use `19.95' for example, perl evalates that to be `19.95'.  But if
617     you need to do a complex pricing scheme, you just need to write an
618     appropriate perl expression, which will most likely pull data from the
619     database to return pricing.  Some things will already log to SQL; for
620     example most RADIUS servers can or have a patch available.  Getting
621     Freeside to bill based on any sort of data then becomes a matter of
622     importing the data into the database.
623  
624     There are some issues involved with pro-rating, partial month charges,
625     that sort of thing.  Expressions will need a standard way to have the
626     applicable time/data ranges passed to them.  Also the expressions are
627     currently running under the Safe perl module, and the opmask might not
628     be right in all situations.  I'll try to spend some time working on
629     this if you are using it.
630
631 > 2. can customers view their bills on-line.                                    
632  
633 Not yet; it needs to be proxied from Freeside to a customer web server in
634 a secure way using something not completely unlike the fs_passwd,
635 fs_passwdd, fs_passwd_server trio.
636
637
638 > Lastly, if someone over pays on an invoice, the credit part does not flow
639 > over to other invoices..
640
641 The total balance flows over correctly, but individual payments don't.
642 The code you're looking for is in FS::cust_pay::insert
643
644 The question of what to do with overpayments that don't have another 
645 invoice to flow into (yet.. or possibly not) is still an open one.    The
646 legacy system Freeside replaced long ago had a separate place for this
647 (payments waiting for an invoice) for each customer, and it gave our
648 bookeeper fits.
649
650
651 option to relax username uniqueness in favor of username+domain or mail/shell
652 vs. radius to ease import for isp's with namespace problems or who buy others.
653
654 do i have to store anything for radius realms besides regular radius attributes
655 (which are handled fine now)?
656
657 warn or complain or something when invoice_from is empty (and we use it)
658
659 Right now Freeside uses the `freq' field of a package definition as a 
660 number of months.  The specific section of code you're looking for is in  
661 FS::cust_main::bill:
662         
663         #change this bit to use Date::Manip?
664         #$sdate=$cust_pkg->bill || time;
665         #$sdate=$cust_pkg->bill || $time;
666         $sdate = $cust_pkg->bill || $cust_pkg->setup || $time;
667         my ($sec,$min,$hour,$mday,$mon,$year) =
668           (localtime($sdate) )[0,1,2,3,4,5];
669         $mon += $part_pkg->getfield('freq');
670         until ( $mon < 12 ) { $mon -= 12; $year++; }
671         $cust_pkg->setfield('bill',
672           timelocal($sec,$min,$hour,$mday,$mon,$year));
673         $cust_pkg_mod_flag = 1;
674   
675 ..and when I went poking for this, looks like it tells us just what needs   
676 to be done!  Hehehe...
677
678 Date::Manip can handle cool things like "+ 1 month" (actually the current
679 case of /^(\d+)$/ would have to be added as a special case of "+ $1 
680 month") and "+ 30 days" (what you need) and even "+ 5 business days" !
681
682
683 On Wed, Apr 28, 1999 at 08:38:16PM +0000, Kristian Hoffmann wrote:
684 > I can't quite seem to figure out how this exporting works.  From what I
685 > understand, when you run svc_acct.export, it rewrites the /etc/passwd,
686 > /etc/shadow, etc. files.  Is this only for initial setups with the
687 > export hooks being in the pm's?
688  
689 You can use both, or just one method.  The configuration files control    
690 this.  One of the things in the TODO is to take out the last few things   
691 that aren't customizable wrt this and put them in config files.
692
693 http://www.daemonnews.org/199905/user-mgmt.html
694
695 Term::Query doesn't install out of the box from CPAN.  Fix it (and get it 
696 submitted upstream!), or remove requirement from bin/svc_acct.import and
697 bin/svc_acct_sm.import and take it out of the install instructions.
698
699 use this cool link to explain the Freeside API
700 ftp://cpan.nas.nasa.gov/pub/perl/CPAN/doc/FMTEYEWTK/easy_objects.html
701
702 Multiple tax rates by geographic region (county, state, and county) are   
703 supported; just choose View/Edit tax rates from the main menu.
704
705 Multiple tax rates by package are not (yet) supported.
706
707 On Wed, Jul 07, 1999 at 12:13:36PM -0400, Shaun Batterton wrote:
708 > How would you handle something like multiple tax rates and multiple   
709 > states?  For example in Connecticut, they just changed computer and/or
710 > data processing services to 3% (whatever that is), and everything else
711 > is 6%.
712
713
714 > Second, when trying to add a new user I get two types of errors; first one
715 > is when I place an e-mail address and select the "submit," Freeside
716 > complains with "Error: Unknown local account (specified literally)"
717 .  
718 You probably put a (local) email address in for email invoices.  Freeside
719 stores these as references to the database records, so (for example) they
720 follow username changes.
721 .
722 I'm guessing you put in the email address that you were creating, and got
723 that error because it didn't exist yet.  Sounds like a buglet to me.  I'll
724 try to fix that soon; in the meantime you can add the invoicing email 
725 address afterwords.
726
727 (workaround for postgres before 6.5) (unlikely to ever be implemented)
728 In the mean-time, this could probably be fixed with the reverse of        
729 the kludge in FS::Record::new.  This removes `$' and `,' from money fields
730 coming out of the database.  Something which fixed up the data so Postgres
731 was happy with it could go in FS::Record::_quote, for data going into the
732 database.
733
734 our data display problem might be a Freeside problem wrt not using 
735 Oracle-compatible DBI syntax (fixed using the return value from $sth->execute
736 as a number of rows - something else?).
737
738 hooks for arbitrary commands out of configuration files
739 svc_acct.pm svc_acct_sm.pm etc.
740
741 Add this to a FAQ, along with doing it for middle names:
742
743
744 >  What I'm finding difficult is how to easily 
745 > customize fields.  For example, I am trying to add a "middle name" field
746 > to the Customer Edit, view, etc.  If I'm going about it right, it appears
747 > I have to edit the cust_main.cgi under edit and edit/process and the
748 > site_perl/cust_main.pm, as well as other things.  Perhaps you could shed
749 > some light on the best way of doing this.
750
751 You have the basic idea.  To implement that completely, I would:
752 - Add the new field to bin/fs-setup for new users
753 - Document the field in htdocs/docs/schema.html
754 - Document the change in a new file, htdocs/docs/upgrade4.html
755 * Run bin/dbdef-create
756 * Add the new field to edit/cust_main.cgi and edit/process/cust_main.cgi
757
758 For bonus points, I'd grep around for the various bits which use "$first 
759 $last" or "$last, $first" and replace them with a method call in cust_main.pm,
760  , like search/cust_main.cgi
761
762 document security model:
763 Don't forget about Apache usernames - since, via the mapsecrets file, each
764 user can login to the SQL database with a different username and
765 password, you can utitilize the security model of the SQL database as
766 well.  Also, each username here can point to a different configuration
767 directory where you could store user-specific configuration info.  Then   
768 you could link each username to one-to-many agents. 
769 (The web demo works using a trivial version of this.)
770
771 Yes, queue processing or the equivalent via checkpoint fields on various  
772 talbes (which you pick up via a pretty simple SELECT) would be really 
773 nice too.
774
775 default (and ordering) state/county/country config file
776 expand the
777 cust_main_county table to provide a preferred ordering, so the most common
778 entries would be at the top of the selection box.  automatically, based on
779 recent selections?
780
781 hmm... maybe svc_acct__shell should check off the legal shells list if
782 applicable?  yeah... cool.
783
784 payinfo field should me much larger than 16
785
786
787 [Mon Apr 12 20:31:21 1999] [error] [Mon Apr 12 20:31:21 1999] null: Error closing true: Broken pipe at /usr/local/lib/site_perl/FS/cust_main.pm line 615.
788
789 javascript (yuck!) "are you sure?" confirmation on cancelations, etc.
790 (view/cust_pkg and view/svc_*)
791
792 get rid of time2str("%D") which formats dates in a non-y2k-safe looking fashion
793 (all the actual date handling uses UNIX timestamps and is fine)
794
795 uncomment expire in view/cust_pkg.cgi and find the expire cron from fsold
796
797 (Test this)
798 one-time/per-customer/? changes in rates and descriptions ('remembered
799 invoices'): implement by creating a new package on the fly... but it isn't 
800 associated with any agent types so it won't show up for other customers to buy.
801 (but also... make sure they go away when the customer does! - need this? :
802  one-off package edits! : need a cust_pkgs or cust_part_pkgs or something table,
803  with custnum and partpkg (like type_pkgs)
804 (what happens if you hit "custom pricing" but the pricing is already custom?)
805
806 Lay out any remaining ugly forms better.
807
808 remove "records identical" warning?  gets in the way of more important stuff.
809 or fix logic which tries to update identical records??
810 1.2 should be quiet enough that the error log is useful, hopefully.
811
812 Postgres has a maximum column length of 31 characters (but see NAMEDATALEN in
813 postgres_ext.h).  part_svc has columns like: svc_acct__radius_Attribute_flag
814 (22 characters!)  It seems that stuff over the limit is silently ignored,
815 so we get 4 characters back.  So, Radius_Attributes are max 13 characters with
816 stock Postgres.  see rfc2138 for what's affected
817 What's a good fix?  (besides recompiling postgres with NAMEDATALEN 64)
818 (mysql has a 64 character max column length.  others?)
819
820 [Mon Mar 29 06:57:56 1999] -e: Use of uninitialized value at /usr/lib/perl5/Date/Format.pm line 333.
821 (when sending mail in cust_main.pm::bill or svc_domain.pm)
822
823 look at DBIx::Recordset!  (and Tie::DBI, and...)
824
825 undefined conf/lpr gives this uninfomative error:
826 [Fri Feb 26 16:42:36 1999] bill.cgi: Can't do bidirectional pipe at
827 /usr/lib/per
828 l5/site_perl/FS/cust_main.pm line 629.
829 [Fri Feb 26 16:42:38 1999] bill.cgi: Error closing : Broken pipe at
830 /usr/lib/per
831 l5/site_perl/FS/cust_main.pm line 631.
832 So give a meaningful error!
833
834 password and slipip stuff in svc_acct.pm store need to be split into two fields or something, so the silliness in svc_acct.pm and svc_acct.export with looking at the data to decide what to do with it can be fixed
835
836 i10n: Apache::Language
837
838 Apache::Session?  Other useful Apache::* ?
839
840 email invoices are only sent for the BILL payby.  If setup, should statements
841 (since they're not invoices) be sent for COMP and CARD as well?
842
843 $cgi->keywords is causing the (hard to trace) error:
844         Use of uninitialized value at (eval 5) line 5
845
846 edit/cust_main.cgi gives an uninformative error message:
847 > Can't call method "agentnum" without a package or object reference at   
848 > /usr/local/apache-ssl/htdocs/freeside/edit/cust_main.cgi line 116.
849 if there are no agents.
850
851 (is this missing on any web screens?  (easy with $cust_svc->label)
852 Add the ability for services to filter information up to the package level
853 for web screens, so you can select a particlar package based
854 on username or domain name, etc.
855
856 Allow a cancelled/suspended/active status from packages to bubble up to
857 the customer lists.  Put active, then suspended, then cancelled accounts.
858 Similar ordering on the package listing inside a single customer.
859
860 false laziness: edit/cust_main.cgi got some parts copied from edit/svc_acct.cgi
861 the web interface in general needs to be redone in a more abstract way.
862
863 false laziness: some of search/svc_acct_sm.cgi was copied to search/svc_domain.cgi.  but web interface in general needs to be rewritten in a mucho cleaner way.
864
865 subroutine the where clause (eventually all SQL) as OO perhaps (has anyone done this?)
866
867 add a select method to FS::Record?
868
869 one-time/per-customer/? changes in rates and descriptions ('remembered
870 invoices'): implement by creating a new package on the fly... but it isn't 
871 associated with any agent types so it won't show up for other customers to buy.
872 (but also... make sure they go away when the customer does! - need this? :
873  one-off package edits! : need a cust_pkgs or cust_part_pkgs or something table,
874  with custnum and partpkg (like type_pkgs)
875 (what happens if you hit "custom pricing" but the pricing is already custom?)
876
877 You can't delete the stuff under administration yet.  Add this,
878 _including_ making sure the thing you are deleting is not in use!
879
880 add links on view/cust_main.cgi to setup services, like view/cust_pkg.cgi
881
882 FS::cust_pkg _require_'s FS::$svc, but this won't work with %FS::UID::callback
883 loading of configuration.  (pry need same idea, but will run immediately if
884 context allows).  Looks like error is masked by 'use FS::cust_svc' which in
885 turn 'use's FS::{svc_acct, svc_acct_sm, svc_domain}' which is now explicit
886 w/comments in source
887
888 Allow a cancelled/suspended/active status from packages to bubble up to
889 the customer lists.  Put active, then suspended, then cancelled accounts.
890 Similar ordering on the package listing inside a single customer.
891
892 svc_domain.pm mail sending uses Date::Format which doesn't seem to pick up 
893 correct timezone.
894
895 view/svc_domain.cgi needs to know the domain might be unaudited (cosmetic)
896
897 remove whois_hack set to 1 for svc_domain.pm?  add all known registries and
898 whois accordingly.
899 .us domains and others!
900 site_perl/svc_domain.cgi (hmm... or maybe should have a button?  or maybe svc_domain.pm should handle this) should set $whois_hack for non-internic domains, so you can add them...
901
902 turn on the depriciation warnings for [e]idiot in FS::CGI. Stop using [e]idiot
903 the last places it is (htdocs/search/ htdocs/misc/ htdocs/misc/process)
904
905 (test cust_main.pm with cybercash v2 and v3, especially with the callback
906  stuff AND with mod_perl w/cybercash v2 kludge in package main)
907 (callback stuff should be eliminated by now)
908
909 bah, table/itable/*table in FS::CGI is silly.
910
911 doc Apache::AuthDBI as well
912 ..
913 Provide sample httpd.conf files.
914
915 hey look: Tie::DBI!  Check that out.  Override its commit with something that
916 does perl-side caching for ? a performance improvement and as an emulation
917 layer to plug in f.ex mysql's atomic transactions
918 ..
919 Record.pm uses does some non-portable DBI things.  MySQL and Pg seem fine.
920 Fix it anyway unless we migrate to Tie::DBI.
921
922 faq
923
924 cust_bill.pm uses '==' comparison on dates because they're currently ints
925
926 config file for allowed card types
927
928 write instructions for adding new services w/svc_Common.pm.  Get rid of all
929 places where svc_* tables are hardcoded (rename svc_acct_pop to part_pop so
930 we can do that)
931
932 test and document libapache-dbi-logger (woo!)
933
934 radius logfile parsing and perl expression check.
935
936 Fix in cust_bill BUGS: 
937 There is an off-by-one error in print_text which causes a visual error (Page 1
938 of 2 printed on some single-page invoices).
939
940 fields should be a method against a FS::Record or derived object, as well as
941 being something you can call as FS::Record::fields('tablename').  Might
942 even be able to handle both in the same routine (that would be neato).
943
944 Immediate removal of incorrectly entered check payments (can't take too
945 long to do this, or accounting is fubared).
946
947 Add code to move from one service to another (POP to SLIP/PPP, etc.).
948 This _should_ be possible by working off the rules in part_svc rather than
949 hardcoding anything in.  The rules in part_svc may need some elaboration,
950 perhaps.
951
952 Use ut_ FS::Record methods in all derived classes (possibly some from dbdef?... eventually all from dbdef??? - but then `dbdef-create' would be impossible as there would be metadata we couldn't ask the backend for.  hmm.)
953
954 (bring back from fsold, ) Generalize config-sending stuff and make more configurable.
955 Expand the HylaFAX interface (also possibly generalize for other fax
956 softwar ie .comfaxe); allow things like arbitrary faxes of sales
957 literature, specific troubleshooting documents and so on.  Maybe even
958 allow users to do this (though that might not belong in Freeside).
959 misc/sendconfig.cgi
960 misc/process/sendconfig.cgi
961 Configure fax recipients via a separate box rather than using the finger
962 name or first+last from cust_main.
963
964 move all phone number logic out of Freeside - let HylaFAX or whatever
965 handle it.
966
967 soundex searches for customer name and company?  where are free soundex tools? (standard Text::Soundex duh) - I could have sworn I saw Text::Soundex on CPAN?!
968
969 should be able to link on some field in email alias (right now you can link
970 on username or domain with a fallback to svcnum)
971
972 generalize and make configurable new invoice printing scheme in FS::cust_main::collect (past due)
973
974 deleting an svc_domain should delete all associated svc_acct_sm records.
975 same with a svc_acct.
976
977 periodic password encrypter
978
979 Automated, configurable notification, suspension and cancellation of
980 defunct accounts.
981 ...
982 expire cron job
983 ...
984 Allow for a future setup date on accounts.
985
986 sub AUTOLOAD in FS::Record should warn? die? if used with a non-existant column
987 name?
988
989 edit (not just import, export and allow default/fixed) arbitrary radius stuff
990 in svc_acct
991 edit/svc_acct.cgi and edit/process/svc_acct.cgi should deal with arbitrary radius stuff
992
993 radius import should take DEFAULT entry and put it in /var/spool/freeside/conf/radius-default ; svc_acct.export should use it (and doc)
994
995 in UI, s/State/State\/Provence/go and s/County/County\/Locality/go
996
997 what else (besides l10n) for i18n? (money!)
998
999 audit htdocs/* for things that should be libraried and things that should be
1000 new methods on the objects (need to do this before implementing a new UI)
1001 all the big things are done
1002
1003 some places we die() where we should &FS::CGI::idiot (and perhaps vice-versa).
1004 Decide based on whether or not the "error" should show up in logs.
1005
1006 all .cgi's should use standard header/footer and idiot() subroutines.  maybe HTML:: perl modules
1007 for HTML creation.  Maybe Embperl or something along those lines.  ?
1008
1009 When running bin/bill, Fix this (Annoying but harmless):
1010 Use of uninitialized value at /usr/local/lib/site_perl/FS/cust_pkg.pm line 99, <ADDRESS> chunk 4.
1011 Use of uninitialized value at /usr/local/lib/site_perl/FS/cust_pkg.pm line 102, <ADDRESS> chunk 4.
1012 Use of uninitialized value at /usr/local/lib/site_perl/FS/cust_pkg.pm line 105, <ADDRESS> chunk 4.
1013
1014 all cgi (but internal to the isp) places where package names are listed should also have
1015 comment (like agent_type)
1016
1017 clean up $recref and other silliness and use -> calls where possible, or
1018 one other alternative.  clean up everything else.
1019 should FS::Record use Tie::Hash?  That would be very clean, but where do we
1020 store the other information?  Maybe you could ask any FS::Record object for a
1021 tied hash?
1022
1023 change all file access from regular open(FILE,) stuff to OO, because of 
1024 problems scoping and passing filehandles like that.
1025
1026 the web interface should create a new object and use it instead of a blank
1027 form for new records.  the create method of svc_ objects should set defaults
1028 (from part_svc).
1029
1030 sub check in man FS::table_name should be rewriteen.  Get rid of $recref
1031 stuff.  Make sure all fields that refer to other database are checked.
1032
1033 Integration with signup disks (are there any free ones?  Netscape?).
1034
1035 One-button cancel (+refund) for lusers who can't get online.
1036
1037 Keep information on virtual web servers (hostname, IP, host machine,
1038 directory, etc.) and export this information for importation into the ISPs
1039 web farm. 
1040
1041 Remove requirement that the first mail alias be the catchall?  Still make
1042 sure only one catchall per domain is defined in any case, of course. 
1043
1044 Ability to move cust_pkg records from one customer to another? (proably
1045 will need to cancel the old and create a new like when we move services
1046 between packages). 
1047
1048 Auto-increment expired cards one year, and try again?
1049
1050 More non-US stuff - zip codes, country codes, foreign currencies, etc.
1051
1052 cust_refund.{cgi.pm} need to do cards xaxtions.  (now we only have cust_credit)
1053
1054 Nicer set of integrated reporting possibilities, like weekly sales totals
1055 by customer, package, agent, referral, etc., aging reports sorted by lots
1056 of different things, and so on.
1057
1058 Client/server setup for users to modify their own passwords, shells, etc,
1059 via passwd or secure web interface (prelminary passwd/chfn/chsh
1060 replacement done).  Complicated by the fact that we don't want to allow
1061 incoming connections to the machine running Freeside, so we probably need
1062 to have a daemon on each external shell or web machine that is contacted
1063 by the Freeside machine.  Be very very careful for both traditional
1064 security issues and DoS problems. 
1065
1066 An extension of the above to allow users to modify selected parts of their
1067 own information, order and cancel services.  A web interface for new
1068 customers.
1069
1070 Expand domain name stuff to house all domain information.  Export
1071 named.boot/named.conf (primary and secondary) and named.{domain} files.
1072 Add more registries (not just InterNIC's com org net edu)
1073
1074 Nice postscript paper invoices, rather than current ASCII invoices.
1075
1076 think about race-condititions in FS::Record and derived ->check ->insert
1077 and so on, uid and username checks in svc_acct, etc.
1078
1079 Move to rsync over ssh file exportation rather than scp.
1080
1081 check 'n fix the proactive password checker. (cracklib?)
1082
1083 refunds of "BILL" payments: generate pseudo-check.
1084
1085 write batch senders and batch parsers for the different credit card processors
1086 people use/
1087 More CC processors/methods.
1088
1089 you should be able to fiddle the setup date in cust_pkg. (at least initially)
1090
1091 delete options in administration section
1092
1093 write a generic batch senders and batch parsers.
1094
1095 need a way to override svc_acct export on a per-machine basis; just use config files based on machine name i suppose; document that. (no, import desync_hosts
1096 type stuff from cerkit)
1097 ...
1098 add a table with column of export services (passwd, shadow, master.passwd, .qmail file update, dns update, etc.) and rows machine groups and whether or not to export that (and any necessary parameters).  wasn't matt (vunderkid, not matt@michweb) working on this?  find him?  each machine goes in a group of its own as well as a group based on function.  add a table with only svcpart and machine group.  now, when you import from each machine, it can get its own accounts with one svcpart and universal accounts with another svcpart.  (though that does make the username duplicate checking more interesting)
1099
1100 you should be able to get column types as a method against an FS::Record object
1101 as well as dbdef->table($table)->column($column)->type
1102
1103 move to perl module for fuzzy and soundex searching.
1104
1105 package view needs to list extraneous services; we need to prevent the
1106 creation of them so this never happens (and mark it as such in the source)
1107 (the creation problem should be fixed - though they will still happen if people
1108 fsck around in the data manually, so list them anyway)
1109
1110 add attribute dictionary to fs-setup as a menu, plus analyze users file to
1111 decide automatically
1112
1113 Check for and report on duplicate billing accounts (cust_main, though many
1114 will have a need for these so probably don't disable them outright.)
1115
1116 create a ->warn as well as a ->check method for all FS::table classes?
1117 (see above)
1118
1119 something to automate making a release and updating the web demo
1120
1121 export a debian-style (also redhat and?) /etc/group file aswell!
1122
1123 svc_acct_sm.import qmail import should pull in recipientmap people too.
1124
1125 .pm's like svc_acct.pm which need to do time-consuming things like ssh remotely
1126 should fork and do them in a child.
1127
1128 i18n/l10n: take ALL messages and catalog them in english.txt or in database or something, so we can eventually go int'l.  int'l currency support would be a help aswell.
1129
1130 get some of { city, county, state, zip } from the missing bits if
1131 possible (where can i get the data to do this?  usps.gov?)
1132
1133 additional interfaces (perltk?  java?)
1134
1135 Put the GPL notice in all files.
1136
1137 integrate w/IDEA's signup server
1138
1139 $cust_bill->owed database field to be eliminated, replaced by a method call
1140 that calculates on the fly.  make sure to grep for ->(get|set)field('owed') 
1141 same for cust_credit->credited
1142
1143 Export quota information.
1144
1145 move all configuration to a central place.  maybe in blob's in the
1146 database.  maybe even things like the code to execute when a username is
1147 changed can be in there, so less of the distributed scripts change between
1148 different sites.
1149
1150 Implement setup and recurring fees as Safe perl expressions rather than
1151 numbers, to allow for variable-rate services.  Backwards compatibility is
1152 obtained because { 43 } in perl is still 43.  :)  Define API to pass
1153 starting and ending dates and any other necessary data to expression
1154 (fees are currently evaluated as Safe expressions but more work needs to
1155 be done to define an opmask for various needs, write examples
1156 (usage-based billing, etc.) and so on).
1157 ...
1158 Add the ability to modify the next billing date in cust_pkg, and take
1159 appropriate action.  This will allow the implementation of pro-rate/1st of
1160 the month billing as well as the ability to manually fiddle with
1161 anniversary dates in cust_pkg, so you can sync a customer's anniversary
1162 date even if you're using anniversary billing (manually or automatically).
1163 (now with above, we need to have a way to automatically pro-rate /^(\d+)$/
1164 charges - anything more complicated should figure it out itself given
1165 starting and ending dates [document that!])
1166 ...
1167 Daily Radius log parsing into database; other logfile formats?
1168 ...
1169 Callbacks to enforce hourly limits on accounts (suspend until the end of
1170 the billing period?), for those who limit customers rather than tack on
1171 extra charges.
1172
1173 Flag packages (part_pkg) as taxable or non/taxable as some ISPs (for
1174 example) need to charge tax on equipment but not service (separate flags
1175 for setup and recurring fee... or perhaps a setup_tax, setup_notax,
1176 recur_tax and recur_notax fees, and possibly something more flexible if
1177 there is need).
1178
1179 Allow for a variable number of invoices for customers who need multiple
1180 copies.
1181
1182 Add a mail alias service with table svc_acct (not domain mail aliasing
1183 which is domain with svc_acct_sm)
1184
1185 (bring back from fsold) Change customer comment field from its current kludge to something more
1186 workable.
1187
1188 Better work orders with more information.  Should eventually open a ticket
1189 when we have such a thing.
1190 edit/svc_wo.cgi
1191 edit/process/svc_wo.cgi
1192 Call tracking and trouble tickets.
1193
1194 More accoutability for complimentary accounts: approval, expiration, term
1195 (no more than x months in advance) and notification.
1196 Flag particular users (or all users, for that matter) as having their
1197 passwords hidden and/or locked from users of Freeside (maybe need Freeside
1198 security levels first?). 
1199 ...
1200 Better Freeside-level configurable access, for those ISP's who have
1201 employees they can't trust.  Right now you're "stuck" with setting up
1202 .htaccess stuff yourself.  This should really just be integrated. 
1203
1204 configuration/setup should get web interface
1205 ...
1206 /usr/local/etc/freeside should be configurable
1207 ...
1208 (probably as part of some automated installation process?)
1209
1210 This requires some serious magic in FS::Record:
1211 ok, if date_type in fs-setup is to be something besides int,
1212 now we need to create wrappers
1213 for them so they behave identically across RDBMS's, ie date pops out as as
1214 UNIX timestamp (or an object of some sort? maybe even a blessed $obj which
1215 is a string not a hashref for backwards compatibility?) and so on. (remember
1216 to treat '0' as Not a Date instead of 1/1/70.
1217
1218 Add Freeside-level transactions for RDBMS's which don't support
1219 transcations?  (Currently we assume a minimal RDBMS which has no rollback,
1220 transactions or atomic updates).  Or just require a RDBMS that supports
1221 rollback and/or atomic updates and get rid of the work-arounds?  The /rdb
1222 interface had this kludge on top of it but is a technical dead-end in most
1223 other ways, unless it can gain an SQL parser and DBD interface.
1224 ...
1225 if i'm really bored, find the /rdb interface in fsold and port it to NoSQL,
1226 and while I'm add it add interfaces for AnyDBM_File tied hash.. hmm.  Shouldn't
1227 an FS::Record have something to do with a tied hash?  But we don't want
1228 performance to go gaga... maybe something with commit to help out here?
1229 ...
1230 Ok: FS::Record gives you a tied hash, and you get methods for commit, etc.
1231
1232 Better automated comparison of our CC records with processors (CyberCash,
1233 at least, has not always had 100% accuracy, though recent versions are
1234 much better) 
1235
1236 Expect or other pty based login check, where we actually connect to a
1237 terminal server or shell machine and test logging in as the user (if we
1238 are keeping a cleartext password for that user)  (This is something tech
1239 support often needs for new customers)
1240
1241 Use cust_main table for pre-sales tracking as well?
1242
1243 Automatic commision report and check generation via freq and prog (to
1244 become a Safe perl expression) fields in agent table, and possibly others.
1245
1246 Database and add a mailed-out date and method for disk/CD mailing, so a
1247 customer can call and you can say, "sent on xx/xx/xx via {US Mail, Fedex,
1248 UPS, etc}" 
1249
1250 Inventory tracking for physical items such as routers (for sale or
1251 lease... probably doesn't make a difference in the ordering... but if you
1252 cancel a router lease the inventory should come back.  hmm.)
1253
1254 -- Matt's wishlist ---
1255
1256 From matt@michweb.net Fri Feb 20 16:39:53 1998
1257 Date: Thu, 19 Feb 1998 23:20:11 -0500
1258 From: Matt Simerson <matt@michweb.net>
1259 Reply-To: quadran-developer@netgoth.com
1260 To: quadran-developer@netgoth.com
1261 Subject: Re: Welcome to quadran-developer
1262
1263 >Whats it based on and what is it supposed to do?  I'm interested, but
1264 >unfortunatly, I don't have that much time to help on the project (I'm busily
1265 >working on one of my own based around MySQL and Qt right now -- don't know
1266 >if it will be GPL'ed or not yet -- we'll probably just use it in house since
1267 >it is designed around our system)...
1268
1269 That's what I set out to find, but didn't find anything on the web site.
1270 I'm looking for something that will do the following:
1271
1272 Single point of entry for users on a secure system:
1273         Creates account on user (public) systems
1274                 update /etc/passwd/master.passwd file
1275                 update radius database (if necessary)
1276         Set up up disk quotas (although I hacked adduser to do this)
1277         Option for adding user to a mailing list(s)
1278         Export of new user info to customizable report (for automated entry
1279 into
1280                 accounting software, etc...)
1281
1282 Automated billing:
1283         Export credit card info for batch processing and have hooks built
1284                 in for other forms of electronic processing.
1285         Batch-Payment (apply payments from formatted text file).
1286         Customizable reports for manual entry/importing into Accounting
1287 software
1288         Email or laser print invoices
1289         Sanity checks credit card numbers before processing (code available)
1290
1291 Simple method for disabling an account.
1292         Arbitrary Expiration Dates (on a given day, in x days)
1293         Remove from radius.
1294         Changing password to '*'
1295         Virtual customers disabling dns, http server, log processing, etc..
1296
1297 Billing for different account types:
1298         Dialup monthly flat rate. Prorates for partial months.
1299         Dialup monthly flat rate for x hours + hourly usage.
1300         Dialup email only
1301         Email only accounts
1302         Virtual Web accounts - w/multiple mailboxes
1303         Leased line accounts
1304         Disk space used over quota.
1305         Tech support minimum + hourly charges
1306         Other for misc stuff (modem, RAM, etc...)
1307
1308 Per user definable RADIUS attributes (ties in with above)
1309         Fixed IP
1310         Simultaneous Use
1311         IP filters (for dialup email only)
1312
1313 Keep logs of modem usage generated daily from radius accounting logs stored
1314 on multiple radius servers.
1315
1316 Keep logs of disk usage generated from quota.
1317
1318 Method of adding virtual domains to your system:
1319         Automatically grabs an IP address from a preassigned pool.
1320         Creates a domain.com database file from database fields
1321         Updates /etc/named.conf or /etc/named.boot and reloads named.
1322         Add's virtual.com to /etc/sendmail.cw or qmail control files.
1323         Edits your web servers httpd.conf file and restarts http server.
1324         An optional section for adding vif's can be added if the users OS
1325                 supports adding them on the fly. Otherwise it's up to the end
1326                 user. Make a hook that can run a custom script that the user
1327                 tweaks for his system.
1328         Update or create the config file your web stats analyzer needs. I've
1329                 done this for analog (free) and http-analyze. Probably
1330                 should only officially support analog and let users hack
1331                 it to their hearts desire.
1332 I've already written scripts that do most of the virtual web stuff on my
1333 system...in bash. Shouldn't be hard for a perlmeister to convert. In fact,
1334 as long as all the info was stored in the database (username, domain name,
1335 and ip pool) this could easily just be run as an external script that the
1336 user tweaks to match his system.
1337
1338 We use a great accounting software (M.Y.O.B) that does all the AP, AR,
1339 Payroll, Tax stuff, and most everything else we could need. It's already
1340 set up for the type of checks we have, etc, etc... I just need something to
1341 do the billing part. I can import/export sales and payments directly once
1342 the billing part is done. You can't write accounting software as good as
1343 M.Y.O.B. for $120.
1344
1345