From 6991d4986df7fb3a6c7c49b5ae1b3713e87a16c4 Mon Sep 17 00:00:00 2001 From: ivan Date: Tue, 29 Jan 2002 16:33:16 +0000 Subject: - web interface for hourly account charges! (FS::cust_pkg, FS::cust_svc and FS::svc_acct seconds_since methods) - Makefile target to regenerate HTML manpages on install - FS.pm doc update - $FS::Record::Debug now dumps all SQL - new FS::cust_main methods: ->cancel, ->invoicing_list_addpost - start of a billing event web interface - cust_pay::upgrade_replace doesn't error out if history includes overapplied payments --- httemplate/edit/part_bill_event.cgi | 131 ++++++++++++++++++++++++++++++++++++ 1 file changed, 131 insertions(+) create mode 100755 httemplate/edit/part_bill_event.cgi (limited to 'httemplate/edit/part_bill_event.cgi') diff --git a/httemplate/edit/part_bill_event.cgi b/httemplate/edit/part_bill_event.cgi new file mode 100755 index 000000000..41d6666dc --- /dev/null +++ b/httemplate/edit/part_bill_event.cgi @@ -0,0 +1,131 @@ + + +<% + +if ( $cgi->param('eventnum') && $cgi->param('eventnum') =~ /^(\d+)$/ ) { + $cgi->param('eventnum', $1); +} else { + $cgi->param('eventnum', ''); +} + +my ($query) = $cgi->keywords; +my $action = ''; +my $part_bill_event = ''; +if ( $cgi->param('error') ) { + $part_bill_event = new FS::part_bill_event ( { + map { $_, scalar($cgi->param($_)) } fields('part_bill_event') + } ); +} +if ( $query && $query =~ /^(\d+)$/ ) { + $part_bill_event ||= qsearchs('part_bill_event',{'eventpart'=>$1}); +} else { + $part_bill_event ||= new FS::part_bill_event {}; +} +$action ||= $part_bill_event->pkgpart ? 'Edit' : 'Add'; +my $hashref = $part_bill_event->hashref; + +print header("$action Invoice Event Definition", menubar( + 'Main Menu' => popurl(2), + 'View all invoice events' => popurl(2). 'browse/part_bill_event.cgi', +)); + +print qq!Error: !, $cgi->param('error'), + "" + if $cgi->param('error'); + +print '
'; + +print "Invoice Event #", $hashref->{eventpart} ? $hashref->{eventpart} : "(NEW)"; + +print ntable("#cccccc",2), <Payby +After days +END + +print 'Disabled'; +print '{disabled} eq "Y"; +print '>'; +print ''; + +print 'Action'; + +#print ntable(); + +#this is pretty kludgy right here. +tie my %events, 'Tie::IxHash', + + 'Charge a fee' => { + 'code' => '$cust_main->charge( %%%charge%%%, \'%%%reason%%%\' );', + 'html' => 'Amount
'. + 'Reason ', + }, + 'Suspend accounts' => { + 'code' => '$cust_main->suspend();', + }, + 'Cancel accounts' => { + 'code' => '$cust_main->cancel();', + }, + + 'Add postal invoicing' => { + 'code' => '$cust_main->invoicing_list_addpost();', + 'pad' => 10, + }, + + 'Generate invoices' => { + 'code' => '$cust_main->bill();', + 'pad' => 20, + }, + + 'Apply unapplied payments and credits' => { + 'code' => '$cust_main->apply_payments; $cust_main->apply_credits;', + 'pad' => 30, + }, + + 'Collect on invoices' => { + 'code' => '$cust_main->collect();', + 'pad' => 40, + }, + +; + +foreach my $event ( keys %events ) { + print ntable( "#cccccc", 2). qq!$event!; + print ''. $events{$event}{html}. '' if exists $events{$event}{html}; + print qq!!; + print ''; +} + +#print ''; + +print < + +END + +print qq!!; +%> + + + + + -- cgit v1.2.1 From 1fd6d8cf5d7854860ef4fd10ed89828e0c04ec39 Mon Sep 17 00:00:00 2001 From: ivan Date: Wed, 30 Jan 2002 14:18:09 +0000 Subject: remove use Module; and $cgi = new CGI; &cgisuidsetup(); from all templates. should work better under Mason. --- httemplate/edit/part_bill_event.cgi | 45 ++++++++++++++++++++++++------------- 1 file changed, 30 insertions(+), 15 deletions(-) (limited to 'httemplate/edit/part_bill_event.cgi') diff --git a/httemplate/edit/part_bill_event.cgi b/httemplate/edit/part_bill_event.cgi index 41d6666dc..939eff360 100755 --- a/httemplate/edit/part_bill_event.cgi +++ b/httemplate/edit/part_bill_event.cgi @@ -1,4 +1,4 @@ - + <% @@ -71,42 +71,57 @@ print 'Action'; #this is pretty kludgy right here. tie my %events, 'Tie::IxHash', - 'Charge a fee' => { - 'code' => '$cust_main->charge( %%%charge%%%, \'%%%reason%%%\' );', - 'html' => 'Amount
'. + 'fee' => { + 'name' => 'Late fee', + 'code' => '$cust_main->charge( %%%charge%%%, \'%%%reason%%%\' );', + 'html' => 'Amount
'. 'Reason ', + 'weight' => 10, }, - 'Suspend accounts' => { - 'code' => '$cust_main->suspend();', + 'suspend' => { + 'name' => 'Suspend', + 'code' => '$cust_main->suspend();', + 'weight' => 10, }, - 'Cancel accounts' => { - 'code' => '$cust_main->cancel();', + 'cancel' => { + 'name' => 'Cancel', + 'code' => '$cust_main->cancel();', + 'weight' => 10, }, - 'Add postal invoicing' => { + 'addpost' => { + 'name' => 'Add postal invoicing', 'code' => '$cust_main->invoicing_list_addpost();', - 'pad' => 10, + 'pad' => 20, + }, + + 'send' => { + 'name' => 'Send invoice (email/print)', + 'code' => '', + 'weight' => 30 }, 'Generate invoices' => { 'code' => '$cust_main->bill();', - 'pad' => 20, + 'pad' => 40, }, 'Apply unapplied payments and credits' => { 'code' => '$cust_main->apply_payments; $cust_main->apply_credits;', - 'pad' => 30, + 'pad' => 50, }, 'Collect on invoices' => { 'code' => '$cust_main->collect();', - 'pad' => 40, + 'pad' => 60, }, ; foreach my $event ( keys %events ) { - print ntable( "#cccccc", 2). qq!$event!; print ''. $events{$event}{html}. '' if exists $events{$event}{html}; print qq!!; @@ -121,7 +136,7 @@ print <{eventpart} ? "Apply changes" : "Add invoice event", qq!">!; %> -- cgit v1.2.1 From c7ff9a58360788ce776022606c4ec3496062013b Mon Sep 17 00:00:00 2001 From: ivan Date: Wed, 30 Jan 2002 18:22:54 +0000 Subject: fully working invoice event web interface --- httemplate/edit/part_bill_event.cgi | 53 ++++++++++++++++++++++++------------- 1 file changed, 34 insertions(+), 19 deletions(-) (limited to 'httemplate/edit/part_bill_event.cgi') diff --git a/httemplate/edit/part_bill_event.cgi b/httemplate/edit/part_bill_event.cgi index 939eff360..c41cfe9cf 100755 --- a/httemplate/edit/part_bill_event.cgi +++ b/httemplate/edit/part_bill_event.cgi @@ -1,11 +1,11 @@ - + <% -if ( $cgi->param('eventnum') && $cgi->param('eventnum') =~ /^(\d+)$/ ) { - $cgi->param('eventnum', $1); +if ( $cgi->param('eventpart') && $cgi->param('eventpart') =~ /^(\d+)$/ ) { + $cgi->param('eventpart', $1); } else { - $cgi->param('eventnum', ''); + $cgi->param('eventpart', ''); } my ($query) = $cgi->keywords; @@ -33,8 +33,9 @@ print qq!Error: !, $cgi->param('error'), "" if $cgi->param('error'); -print '
'; - +print ''. + ''; print "Invoice Event #", $hashref->{eventpart} ? $hashref->{eventpart} : "(NEW)"; print ntable("#cccccc",2), <{seconds}/3600; +my $days = $hashref->{seconds}/86400; print < @@ -74,8 +75,9 @@ tie my %events, 'Tie::IxHash', 'fee' => { 'name' => 'Late fee', 'code' => '$cust_main->charge( %%%charge%%%, \'%%%reason%%%\' );', - 'html' => 'Amount
'. - 'Reason ', + 'html' => + 'Amount '. + '
Reason ', 'weight' => 10, }, 'suspend' => { @@ -101,29 +103,42 @@ tie my %events, 'Tie::IxHash', 'weight' => 30 }, - 'Generate invoices' => { + 'bill' => { + 'name' => 'Generate invoices', 'code' => '$cust_main->bill();', - 'pad' => 40, + 'weight' => 40, }, - 'Apply unapplied payments and credits' => { + 'apply' => { + 'name' => 'Apply unapplied payments and credits', 'code' => '$cust_main->apply_payments; $cust_main->apply_credits;', - 'pad' => 50, + 'weight' => 50, }, - 'Collect on invoices' => { + 'collect' => { + 'name' => 'Collect on invoices', 'code' => '$cust_main->collect();', - 'pad' => 60, + 'weight' => 60, }, ; foreach my $event ( keys %events ) { + my %plandata = map { /^(\w+) (.*)$/; ($1, $2); } + split(/\n/, $part_bill_event->plandata); + my $html = $events{$event}{html}; + while ( $html =~ /%%%(\w+)%%%/ ) { + my $field = $1; + $html =~ s/%%%$field%%%/$plandata{$field}/; + } + print ntable( "#cccccc", 2). - qq!$event!; - print ''. $events{$event}{html}. '' if exists $events{$event}{html}; + qq!plan; + print qq!VALUE="!. $event. ":". $events{$event}{weight}. ":". + encode_entities($events{$event}{code}). + qq!">$events{$event}{name}!; + print ''. $html. '' if $html; print qq!!; print ''; } -- cgit v1.2.1 From 8cbba53b09bb5b09355316b7ff8948500c3b4b76 Mon Sep 17 00:00:00 2001 From: ivan Date: Mon, 4 Feb 2002 16:44:48 +0000 Subject: billing events! --- httemplate/edit/part_bill_event.cgi | 44 ++++++++++++++++++++++++++++--------- 1 file changed, 34 insertions(+), 10 deletions(-) (limited to 'httemplate/edit/part_bill_event.cgi') diff --git a/httemplate/edit/part_bill_event.cgi b/httemplate/edit/part_bill_event.cgi index c41cfe9cf..70e953ca0 100755 --- a/httemplate/edit/part_bill_event.cgi +++ b/httemplate/edit/part_bill_event.cgi @@ -1,4 +1,4 @@ - + <% @@ -93,32 +93,56 @@ tie my %events, 'Tie::IxHash', 'addpost' => { 'name' => 'Add postal invoicing', - 'code' => '$cust_main->invoicing_list_addpost();', + 'code' => '$cust_main->invoicing_list_addpost(); '';', 'pad' => 20, }, + 'comp' => { + 'name' => 'Pay invoice with a complimentary "payment"', + 'code' => '$cust_bill->comp();', + 'weight' => 30, + }, + + 'realtime-card' => { + 'name' => 'Run card with a Business::OnlinePayment realtime gateway', + 'code' => '$cust_bill->realtime_card();', + 'weight' => 30, + }, + + 'realtime-card-cybercash' => { + 'name' => '(deprecated) Run card with CyberCash CashRegister realtime gateway', + 'code' => '$cust_bill->realtime_card_cybercash();', + 'weight => 30, + }, + + 'batch-card' => { + 'name' => 'Add card to the pending credit card batch', + 'code' => '$cust_bill->batch_card();', + 'weight' => 40, + }, + 'send' => { 'name' => 'Send invoice (email/print)', - 'code' => '', - 'weight' => 30 + 'code' => '$cust_bill->send();', + 'weight' => 50, }, 'bill' => { - 'name' => 'Generate invoices', + 'name' => 'Generate invoices (normally only used with a Late Fee event)', 'code' => '$cust_main->bill();', - 'weight' => 40, + 'weight' => 60, }, 'apply' => { 'name' => 'Apply unapplied payments and credits', - 'code' => '$cust_main->apply_payments; $cust_main->apply_credits;', - 'weight' => 50, + 'code' => '$cust_main->apply_payments; $cust_main->apply_credits; '';', + 'weight' => 70, }, 'collect' => { - 'name' => 'Collect on invoices', + 'name' => 'Collect on invoices (normally only used with a Late Fee and Generate Invoice events)', 'code' => '$cust_main->collect();', - 'weight' => 60, + 'weight' => 80, }, ; -- cgit v1.2.1 From 79f83ad93cc6f77a155528661a4681946fdd17a6 Mon Sep 17 00:00:00 2001 From: ivan Date: Mon, 4 Feb 2002 17:04:33 +0000 Subject: have fs-setup create the necessary "default" billing events documentation on necessary "default" billing events --- httemplate/edit/part_bill_event.cgi | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'httemplate/edit/part_bill_event.cgi') diff --git a/httemplate/edit/part_bill_event.cgi b/httemplate/edit/part_bill_event.cgi index 70e953ca0..580e46734 100755 --- a/httemplate/edit/part_bill_event.cgi +++ b/httemplate/edit/part_bill_event.cgi @@ -1,4 +1,4 @@ - + <% @@ -45,7 +45,7 @@ END for (qw(CARD BILL COMP)) { print qq!"; + print " SELECTED>$_"; } else { print ">$_"; } @@ -93,7 +93,7 @@ tie my %events, 'Tie::IxHash', 'addpost' => { 'name' => 'Add postal invoicing', - 'code' => '$cust_main->invoicing_list_addpost(); '';', + 'code' => '$cust_main->invoicing_list_addpost(); "";', 'pad' => 20, }, @@ -112,7 +112,7 @@ tie my %events, 'Tie::IxHash', 'realtime-card-cybercash' => { 'name' => '(deprecated) Run card with CyberCash CashRegister realtime gateway', 'code' => '$cust_bill->realtime_card_cybercash();', - 'weight => 30, + 'weight' => 30, }, 'batch-card' => { @@ -135,7 +135,7 @@ tie my %events, 'Tie::IxHash', 'apply' => { 'name' => 'Apply unapplied payments and credits', - 'code' => '$cust_main->apply_payments; $cust_main->apply_credits; '';', + 'code' => '$cust_main->apply_payments; $cust_main->apply_credits; "";', 'weight' => 70, }, -- cgit v1.2.1 From 22a35047ecdffff80110e06cc08fc84f9ddba9b0 Mon Sep 17 00:00:00 2001 From: ivan Date: Sun, 10 Feb 2002 13:21:31 +0000 Subject: removed from all files to fix any redirects, whew Mason handler.pl overrides CGI::redirect fixed strict; problems in edit/part_pkg.cgi & edit/process/part_pkg.cgi --- httemplate/edit/part_bill_event.cgi | 2 -- 1 file changed, 2 deletions(-) (limited to 'httemplate/edit/part_bill_event.cgi') diff --git a/httemplate/edit/part_bill_event.cgi b/httemplate/edit/part_bill_event.cgi index 580e46734..25d9bc0ff 100755 --- a/httemplate/edit/part_bill_event.cgi +++ b/httemplate/edit/part_bill_event.cgi @@ -1,5 +1,3 @@ - - <% if ( $cgi->param('eventpart') && $cgi->param('eventpart') =~ /^(\d+)$/ ) { -- cgit v1.2.1 From a4c96748eb6eab29a70f3a944c6520283a635c78 Mon Sep 17 00:00:00 2001 From: ivan Date: Sun, 10 Feb 2002 16:05:22 +0000 Subject: *finally* seems to be working under Mason. sheesh. *finally* seems to be working under Mason. sheesh. *finally* seems to be working under Mason. sheesh. *finally* seems to be working under Mason. sheesh. *finally* seems to be working under Mason. sheesh. *finally* seems to be working under Mason. sheesh. *finally* seems to be working under Mason. sheesh. *finally* seems to be working under Mason. sheesh. --- httemplate/edit/part_bill_event.cgi | 1 + 1 file changed, 1 insertion(+) (limited to 'httemplate/edit/part_bill_event.cgi') diff --git a/httemplate/edit/part_bill_event.cgi b/httemplate/edit/part_bill_event.cgi index 25d9bc0ff..40016433d 100755 --- a/httemplate/edit/part_bill_event.cgi +++ b/httemplate/edit/part_bill_event.cgi @@ -1,3 +1,4 @@ + <% if ( $cgi->param('eventpart') && $cgi->param('eventpart') =~ /^(\d+)$/ ) { -- cgit v1.2.1 From 543ed3f877829e4335eda48d7198d2f92d03545e Mon Sep 17 00:00:00 2001 From: ivan Date: Tue, 12 Feb 2002 04:49:32 +0000 Subject: oops --- httemplate/edit/part_bill_event.cgi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'httemplate/edit/part_bill_event.cgi') diff --git a/httemplate/edit/part_bill_event.cgi b/httemplate/edit/part_bill_event.cgi index 40016433d..018fc94a4 100755 --- a/httemplate/edit/part_bill_event.cgi +++ b/httemplate/edit/part_bill_event.cgi @@ -93,7 +93,7 @@ tie my %events, 'Tie::IxHash', 'addpost' => { 'name' => 'Add postal invoicing', 'code' => '$cust_main->invoicing_list_addpost(); "";', - 'pad' => 20, + 'weight' => 20, }, 'comp' => { -- cgit v1.2.1 From 105c166a23234dd923757a477b4efcda65fb2881 Mon Sep 17 00:00:00 2001 From: ivan Date: Mon, 18 Mar 2002 20:51:09 +0000 Subject: okay, now you can specify an alternate invoice template, and it'll be auto-createad and added to the list of configuration options. closes: Bug#314 --- httemplate/edit/part_bill_event.cgi | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'httemplate/edit/part_bill_event.cgi') diff --git a/httemplate/edit/part_bill_event.cgi b/httemplate/edit/part_bill_event.cgi index 018fc94a4..324daeb90 100755 --- a/httemplate/edit/part_bill_event.cgi +++ b/httemplate/edit/part_bill_event.cgi @@ -126,6 +126,14 @@ tie my %events, 'Tie::IxHash', 'weight' => 50, }, + 'send_alternate' => { + 'name' => 'Send invoice (email/print) with alternate template', + 'code' => '$cust_bill->send(\'%%%templatename%%%\');', + 'html' => + '', + 'weight' => 50, + }, + 'bill' => { 'name' => 'Generate invoices (normally only used with a Late Fee event)', 'code' => '$cust_main->bill();', -- cgit v1.2.1 From 10adfb99055cc684f96cf446da34a7423cac3459 Mon Sep 17 00:00:00 2001 From: ivan Date: Fri, 30 Aug 2002 23:42:47 +0000 Subject: new invoice event: upload a CSV file --- httemplate/edit/part_bill_event.cgi | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'httemplate/edit/part_bill_event.cgi') diff --git a/httemplate/edit/part_bill_event.cgi b/httemplate/edit/part_bill_event.cgi index 324daeb90..a10a186a9 100755 --- a/httemplate/edit/part_bill_event.cgi +++ b/httemplate/edit/part_bill_event.cgi @@ -134,6 +134,30 @@ tie my %events, 'Tie::IxHash', 'weight' => 50, }, + 'send_csv_ftp' => { + 'name' => 'Upload CSV invoice data to an FTP server', + 'code' => '$cust_bill->send_csv( protocol => \'ftp\', + server => \'%%%ftpserver%%%\', + username => \'%%%ftpusername%%%\', + password => \'%%%ftppassword%%%\', + dir => \'%%%ftpdir%%%\' );', + 'html' => + ''. + ''. + ''. + ''. + ''. + ''. + '
FTP server: '. + '
FTP username: '. + ''. + '
FTP password: '. + ''. + '
FTP directory: '. + '
', + 'weight' => 50, + }, + 'bill' => { 'name' => 'Generate invoices (normally only used with a Late Fee event)', 'code' => '$cust_main->bill();', -- cgit v1.2.1 From 0c9f7a9f0e0cb21407051b7804f8454e85421f14 Mon Sep 17 00:00:00 2001 From: ivan Date: Tue, 17 Sep 2002 10:21:47 +0000 Subject: remove obsolete cybercash support --- httemplate/edit/part_bill_event.cgi | 6 ------ 1 file changed, 6 deletions(-) (limited to 'httemplate/edit/part_bill_event.cgi') diff --git a/httemplate/edit/part_bill_event.cgi b/httemplate/edit/part_bill_event.cgi index a10a186a9..1b20ef1d2 100755 --- a/httemplate/edit/part_bill_event.cgi +++ b/httemplate/edit/part_bill_event.cgi @@ -108,12 +108,6 @@ tie my %events, 'Tie::IxHash', 'weight' => 30, }, - 'realtime-card-cybercash' => { - 'name' => '(deprecated) Run card with CyberCash CashRegister realtime gateway', - 'code' => '$cust_bill->realtime_card_cybercash();', - 'weight' => 30, - }, - 'batch-card' => { 'name' => 'Add card to the pending credit card batch', 'code' => '$cust_bill->batch_card();', -- cgit v1.2.1 From 37e3aa89ddad4fce6b5829946925ce53745cdcc3 Mon Sep 17 00:00:00 2001 From: ivan Date: Tue, 22 Oct 2002 06:28:13 +0000 Subject: oops - allow adding CHECK invoice events too --- httemplate/edit/part_bill_event.cgi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'httemplate/edit/part_bill_event.cgi') diff --git a/httemplate/edit/part_bill_event.cgi b/httemplate/edit/part_bill_event.cgi index 1b20ef1d2..5486b1855 100755 --- a/httemplate/edit/part_bill_event.cgi +++ b/httemplate/edit/part_bill_event.cgi @@ -41,7 +41,7 @@ print ntable("#cccccc",2), <Payby END -for (qw(CARD CHEK BILL COMP)) { +for (qw(CARD CHEK LECB BILL COMP)) { print qq!"; -- cgit v1.2.1 From 37dc3ebec42104e6ba77dae9a4d8dbdf31364678 Mon Sep 17 00:00:00 2001 From: ivan Date: Fri, 22 Nov 2002 11:14:04 +0000 Subject: add lec billing event --- httemplate/edit/part_bill_event.cgi | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'httemplate/edit/part_bill_event.cgi') diff --git a/httemplate/edit/part_bill_event.cgi b/httemplate/edit/part_bill_event.cgi index 30a60ea41..2104b4530 100755 --- a/httemplate/edit/part_bill_event.cgi +++ b/httemplate/edit/part_bill_event.cgi @@ -114,6 +114,12 @@ tie my %events, 'Tie::IxHash', 'weight' => 30, }, + 'realtime-lec' => { + 'name' => 'Run phone bill ("LEC") billing with a Business::OnlinePayment realtime gateway', + 'code' => '$cust_bill->realtime_lec();', + 'weight' => 30, + }, + 'batch-card' => { 'name' => 'Add card to the pending credit card batch', 'code' => '$cust_bill->batch_card();', -- cgit v1.2.1 From 030bef17868168b05a67d9f5866b55da1bb9439c Mon Sep 17 00:00:00 2001 From: ivan Date: Mon, 21 Apr 2003 20:53:57 +0000 Subject: on-demand vs. automatic cards & checks: added DCRD and DCHK payment types --- httemplate/edit/part_bill_event.cgi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'httemplate/edit/part_bill_event.cgi') diff --git a/httemplate/edit/part_bill_event.cgi b/httemplate/edit/part_bill_event.cgi index 2104b4530..6426eed93 100755 --- a/httemplate/edit/part_bill_event.cgi +++ b/httemplate/edit/part_bill_event.cgi @@ -41,7 +41,7 @@ print ntable("#cccccc",2), <Payby