From 982a174dd0dc4b6f56d3008fa45835dfcdd6869a Mon Sep 17 00:00:00 2001 From: ivan Date: Mon, 23 Mar 1998 07:46:02 +0000 Subject: [PATCH 1/1] Initial revision --- GPL | 339 +++++++++++++++++++++++++++++++++++ INSTALL | 1 + etc/acp_logfile-parse | 197 ++++++++++++++++++++ etc/example-direct-cardin | 67 +++++++ htdocs/edit/cust_credit.cgi | 97 ++++++++++ htdocs/edit/cust_pay.cgi | 76 ++++++++ htdocs/images/sisd.jpg | Bin 0 -> 22122 bytes htdocs/search/cust_bill.html | 21 +++ htdocs/search/cust_main-payinfo.html | 21 +++ htdocs/search/cust_main.html | 36 ++++ htdocs/search/svc_acct.html | 21 +++ htdocs/search/svc_acct_sm.html | 23 +++ htdocs/search/svc_domain.html | 22 +++ site_perl/table_template-svc.pm | 107 +++++++++++ site_perl/table_template-unique.pm | 66 +++++++ site_perl/table_template.pm | 66 +++++++ 16 files changed, 1160 insertions(+) create mode 100644 GPL create mode 100644 INSTALL create mode 100755 etc/acp_logfile-parse create mode 100755 etc/example-direct-cardin create mode 100755 htdocs/edit/cust_credit.cgi create mode 100755 htdocs/edit/cust_pay.cgi create mode 100755 htdocs/images/sisd.jpg create mode 100755 htdocs/search/cust_bill.html create mode 100755 htdocs/search/cust_main-payinfo.html create mode 100755 htdocs/search/cust_main.html create mode 100755 htdocs/search/svc_acct.html create mode 100755 htdocs/search/svc_acct_sm.html create mode 100755 htdocs/search/svc_domain.html create mode 100644 site_perl/table_template-svc.pm create mode 100644 site_perl/table_template-unique.pm create mode 100644 site_perl/table_template.pm diff --git a/GPL b/GPL new file mode 100644 index 000000000..e77696ae8 --- /dev/null +++ b/GPL @@ -0,0 +1,339 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc. + 675 Mass Ave, Cambridge, MA 02139, USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Library General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) 19yy + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) 19yy name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + , 1 April 1989 + Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Library General +Public License instead of this License. diff --git a/INSTALL b/INSTALL new file mode 100644 index 000000000..ff2e43f4e --- /dev/null +++ b/INSTALL @@ -0,0 +1 @@ +See htdocs/docs/index.html diff --git a/etc/acp_logfile-parse b/etc/acp_logfile-parse new file mode 100755 index 000000000..5e258991b --- /dev/null +++ b/etc/acp_logfile-parse @@ -0,0 +1,197 @@ +#!/usr/bin/perl + +### +# WHO WROTE THIS??? +### + +#require "perldb.pl"; + +# Compute SLIP/PPP log times +# Arguments -a Process entire file with totals +# -t Process only totals +# -f File to be processed if not current +# -d processing start date (default is entire file) +# -l to return all totals for dayuse +# -w name of tmp work file for dayuse +# user names + +require "time.pl"; + +$space=' '; + +unless (@ARGV[0]) { + print "Missing Arguments\n"; + print "-a - entire file\n"; + print "-t - totals only\n"; + print "-f - file name to be processed\n"; + print "-d - processing start date (yymmdd)\n"; + print "-l - return totals for dayuse\n"; + print "-w - tmp work file for dayuse\n"; + exit; +} # end if test for missing arguments + +$infile = "/usr/annex/acp_logfile"; +$tmpfile = "/tmp/ppp"; +$n = $#ARGV; +$start_yymmdd = ""; +for ($i = 0; $i <= $n; $i++) { + if ($ARGV[$i] eq "-a") { + $allflag = "true"; + } + elsif ($ARGV[$i] eq "-t") { + $totalflag = "true"; + } + elsif ($ARGV[$i] eq "-f") { + $i++; + $infile = $ARGV[$i]; + } + elsif ($ARGV[$i] eq "-d") { + $i++; + $start_yymmdd = $ARGV[$i]; + } #end start yymmdd + elsif ($ARGV[$i] eq "-l") { + $logflag = "true"; + $totalflag = "true"; + } # end log + elsif ($ARGV[$i] eq "-w") { + $i++; + $tmpfile = $ARGV[$i]; + } # end tmp file + else { + ($arg_user,$arg_yymmdd) = split (/:/, $ARGV[$i]); + $ip_user_date {$arg_user} = $ARGV[$i]; + $userflag = "true"; + } # end else + } # end for 1 = 1 to n + +open (IN,$infile) + || die "Can't open acp_logfile"; + +NEXTUSER: while () { + chop; + ($add,$ether,$port,$date,$time,$type,$action,$user) = split(/:/); + + if ($logflag) { + $start_yymmdd = ''; + if ($ip_user_date{$user}) { + ($ip_user, $start_yymmdd) = + split (/:/, $ip_user_date{$user}); + } # end get date + } # end log flag + if ($start_yymmdd) { + if ($date < $start_yymmdd) { + next NEXTUSER; + } #end date compare + } #end if date + if ($userflag){ + if (!$ip_user_date{$user}) { + next NEXTUSER; + } # end user test + } # end by user or all + if (($totalflag) || + ($allflag) || + ($ip_user_date{$user})) { + if (($type eq 'ppp') || ($type eq 'slip')) { + + if ($action eq 'login') { + $login{$user} = "$time:$date"; + + } + elsif ($action eq 'logout') { + if (!$login{$user}) { + $login{$user} = "010101:$date"; + } #end pad user if carry over + ($stime,$sdate) = split(':',$login{$user}); + $start = &annex2sec($stime); + $end = &annex2sec($time); + + #If we went through midnight, add a day; + if ($end < $start) {$end += 86400;} + $timeon = $end - $start; + + $elapsed{$user} += $timeon; + + if (!$totalflag) { + print (&fmt_user($user), + ' ', &fmt_date($sdate), ' In: ', + &fmt_time($stime),' Out: ', + &fmt_time($time), + ' Elapsed: ', &fmt_sec($timeon), "\n"); + } # end total test + } #end elsif action + } # type = ppp of slip + } # check arguments +} +close IN; + +if ($logflag) { + open (TMPPPP, ">$tmpfile") + || die "Can't open ppp tmp file"; + foreach $user ( sort((keys(%elapsed))) ) { + $log_time = &fmt_sec($elapsed{$user}); + $tmp = join (':', + $user, + $log_time); + print (TMPPPP "$tmp\n"); + } + close (TMPPPP); +} + else { + print "\n\nTotal Time On For Period:\n"; + print "-------------------------\n"; + + foreach $user ( sort((keys(%elapsed))) ) { + print (&fmt_user($user), " ",&fmt_sec($elapsed{$user}), "\n"); + } + } +exit(0); + +#------------------------------------------------------- +#--------------- Subroutines Start Here ---------------- +#------------------------------------------------------- + +sub annex2sec { + local($time) = @_; + return( &time2sec( &break_annex($time) ) ); +} + +sub fmt_date { + local($date) = @_; + + return( substr($date,2,2).'/'.substr($date,4,2).'/'.substr($date,0,2) ); +} + +sub fmt_time { + local($time) = @_; + local($s,$m,$h) = &break_annex($time); + return ("$h:$m:$s"); +} + + +sub break_annex { + local($time) = @_; + local($h,$m,$s); + + $h=substr($time,0,2); + $m=substr($time,2,2); + $s=substr($time,4,2); + + return ($s,$m,$h); +} + +sub fmt_sec { + local(@t) = &sec2time(@_); + @t[2] += (@t[3]*24); + + foreach $a (@t) { + if ($a < 10) {$a = "0$a";} + } + + return ("@t[2]:@t[1]:@t[0]"); +} + +sub fmt_user { + local($user) = @_; + return( $user.substr($space,0,8 - length($user) ).' ' ); +} + diff --git a/etc/example-direct-cardin b/etc/example-direct-cardin new file mode 100755 index 000000000..1a4097221 --- /dev/null +++ b/etc/example-direct-cardin @@ -0,0 +1,67 @@ +#!/usr/local/bin/perl + +### +# THIS IS FROM CYBERCASH (is there a newer version?) +### + +$paymentserverhost = 'localhost'; +$paymentserverport = 8000; +$paymentserversecret = 'two-turntables'; +use CCLib qw(sendmserver); + +# first lets fake up some data +# use time of day and pid to give me my pretend +# order number +# you obviously need to get real data from somewhere... + +$oid = "test$$"; #fake order number. +$amount = 'usd 42.42'; +$ramount = 'usd 24.24'; +$pan = '4111111111111111'; +$name = 'John Q. Doe'; +$addr = '17 Richard Rd.'; +$city = 'Ivyland'; +$state = 'PA'; +$zip = '18974'; +$country = 'USA'; +$exp = '7/97'; + + +%result = &sendmserver('mauthcapture', + 'Order-ID', $oid, + 'Amount', $amount, + 'Card-Number', $pan, + 'Card-Name', $name, + 'Card-Address', $addr, + 'Card-City', $city, + 'Card-State', $state, + 'Card-Zip', $zip, + 'Card-Country', $country, + 'Card-Exp', $exp); + +# +# just dump results to stdout. +# you should process them... +# to allow results to affect operation of your fulfillment... +# +foreach (keys(%result)) { + print " $_ ==> $result{$_}\n"; +} + +print "\n"; + +exit; + +$trans=$result{'MTransactionNumber'}; +$code=$result{'MRetrievalCode'}; + +%result = &sendmserver('return', + 'Order-ID', $oid, + 'Return-Amount',$ramount, + 'Amount',$amount, + ); + +foreach (keys(%result)) { + print " $_ ==> $result{$_}\n"; +} + diff --git a/htdocs/edit/cust_credit.cgi b/htdocs/edit/cust_credit.cgi new file mode 100755 index 000000000..75ef21208 --- /dev/null +++ b/htdocs/edit/cust_credit.cgi @@ -0,0 +1,97 @@ +#!/usr/bin/perl -Tw +# +# cust_credit.cgi: Add a credit (output form) +# +# Usage: cust_credit.cgi custnum [ -paybatch ] +# http://server.name/path/cust_credit?custnum [ -paybatch ] +# +# Note: Should be run setuid root as user nobody. +# +# some hooks in here for modifications as well as additions, but needs (lots) more work. +# also see process/cust_credit.cgi, the script that processes the form. +# +# ivan@voicenet.com 96-dec-05 +# +# paybatch field, differentiates between credits & credits+refunds by commandline +# ivan@voicenet.com 96-dec-08 +# +# added (but commented out) sprintf("%.2f" in amount field. Hmm. +# ivan@voicenet.com 97-jan-3 +# +# paybatch stuff thrown out - has checkbox now instead. +# (well, sort of. still passed around for backward compatability and possible editing hook) +# ivan@voicenet.com 97-apr-21 +# +# rewrite ivan@sisd.com 98-mar-16 + +use strict; +use Date::Format; +use CGI::Base qw(:DEFAULT :CGI); #CGI module +use FS::UID qw(cgisuidsetup getotaker); + +my($cgi) = new CGI::Base; +$cgi->get; +cgisuidsetup($cgi); + +#untaint custnum +$QUERY_STRING =~ /^(\d+)$/; +my($custnum)=$1; + +#untaint otaker +my($otaker)=getotaker; + +SendHeaders(); # one guess. +print < + + Post Credit + + +
+

Post Credit

+
+
+
+END
+
+#crednum
+my($crednum)="";
+print qq!Credit #!, $crednum ? $crednum : " (NEW)", qq!!;
+
+#custnum
+print qq!\nCustomer #$custnum!;
+
+#paybatch
+print qq!!;
+
+#date
+my($date)=time;
+print qq!\nDate: !, time2str("%D",$date), qq!!;
+
+#amount
+my($amount)='';
+print qq!\nAmount \$!;
+
+#refund?
+#print qq! Also post refund!;
+
+#otaker (hidden)
+print qq!!;
+
+#reason
+my($reason)='';
+print qq!\nReason !;
+
+print <
+
+
+END + +print < + + +END + diff --git a/htdocs/edit/cust_pay.cgi b/htdocs/edit/cust_pay.cgi new file mode 100755 index 000000000..a6cb204d1 --- /dev/null +++ b/htdocs/edit/cust_pay.cgi @@ -0,0 +1,76 @@ +#!/usr/bin/perl -Tw +# +# cust_pay.cgi: Add a payment (output form) +# +# Usage: cust_pay.cgi invnum +# http://server.name/path/cust_pay.cgi?invnum +# +# Note: Should be run setuid as user nobody. +# +# some hooks for modifications as well as additions, but needs work. +# +# ivan@voicenet.com 96-dec-11 +# +# rewrite ivan@sisd.com 98-mar-16 + +use strict; +use Date::Format; +use CGI::Base qw(:DEFAULT :CGI); +use FS::UID qw(cgisuidsetup); + +my($cgi) = new CGI::Base; +$cgi->get; +cgisuidsetup($cgi); + +#untaint invnum +$QUERY_STRING =~ /^(\d+)$/; +my($invnum)=$1; + +SendHeaders(); # one guess. +print < + + Enter payment + + +
+

Enter payment

+
+ +
+END
+
+#invnum
+print qq!Invoice #$invnum!;
+
+#date
+my($date)=time;
+print qq!
Date: !, time2str("%D",$date), qq!!; + +#paid +print qq!
Amount \$!; + +#payby +my($payby)="BILL"; +print qq!
Payby: $payby!; + +#payinfo (check # now as payby="BILL" hardcoded.. what to do later?) +my($payinfo)=""; +print qq!
Check #!; + +#paybatch +print qq!!; + +print < +
+
+END + +print < + + +END + diff --git a/htdocs/images/sisd.jpg b/htdocs/images/sisd.jpg new file mode 100755 index 0000000000000000000000000000000000000000..908a5eaff7f7d29bcdc621a480aac43eb62d8a37 GIT binary patch literal 22122 zcmeFYbx>T**Dg9(u;3Ql-GaLYx4_^YTn8TlK>`GKnZY600E4?rf(8w)gIj<=@B|Bo z_d9jZ_x|dhd#djLr}rOSYp=a~cXjPrtNVGL^|bV~3BXrVQdI&VAprnL&llin74Qat z@!|#g3p5OLbaYHi46K*LI4`lWUy>6N;Sp0)(9%#-P*Kq_@vzb{a4}L*v5ByAz2*}X z6r^PplM>~Z+Oiav|*e_q<;Jo6er=sWo|J|Ox00=Mu_ejksNDKgE0wfdy zq^AJ@6##&YjPlQP|5rnMfsTTTfrR|*HN^)YA)}%qqoQMDyud(3MSnI?0H|mLF9_-R zh4o)&1O!Fof#9%43|+6jt#dLaA<;M1J`K#mMcaz{ z-jG+epTdhvW}gQqNBW=be|`9Q$&gV{(Vkr_1kW=<{->cJ0Z{(y0VHGs6na8FR5>CY zVg`OIG=b2k6~N19_w#)MfDE9{!wt8e$d4gZKp?XGm-LCaxtr*2oEmV>RF#9NbT@D7 zAbLr8w;J!qP4CNBlvhEKPXMsm6M+5oUnKPZ_Rug|(WW-Z6t6tI{)>V7FUv0>JXme& zZ<5Pd{~tR1|F*tv3lrROzPXdC?Z?{;k^67!UxUho{ohZV{ojT9&p(QnX>k(#{&LztmUvsHs?|W;YWUd7IZrvr*?L zno7K=mIk>U?P`Gg_*0l=3&2|T>{eYXH;)=1ai7Idtg1)oeI*`_3_mU+o&fe3z>Zp! z;H0{ZQ@G_G3vJ&^oIC0Mj~%d&kj#$&IaGX90<^<7l)YiES9J+B>6dTII$}KbMs;DM z(LF6Ih;I>$SXV_^3Yv_xV--Q~NXB^b6Je~$+UQz{BIKzs{CV;Lm#?GFc>-JubVmfg zM#)^NXQjibrAeChu$_k**{7wn=S!0-#)z{bBp=#G#lNg1+9sp5x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o8wZ{Uy-IAbCb=g zo7?CAHa`#%Z#dP>Pap?4fh9|h>O|Exmz7krZ)+IJL&nK!GPXEQuAe|2N-#Q!M(SVY zr^iURwYbyu>iN9cVo2H)j>F}O>{3)>W&Qyr>T_4g%r^ENRgr9ancWU=vbNz*;8oLa zZrXGWa{dWM`~>#}>LkASof1a2{9h3&-4>T1FR@R}kpG$o-xc{M7VahLTV{YNu>;D1 zh`^Wv1-JX+hBY6e7JLnIYjh%rM$%6xoGD_AzQg2W%`+Jb1?p*E+T`9Bn|*3pPk%x+ zpZ;OlR$EEPpJhI!J`^ty;C46ih zM_yvnK)ijG@cT~a`IBzX1=VFQm8d$F9eNygALI^KZUFr?{3f;&=sg4jzl{9`GT3rg zQR-f6U?9`yu4^Vjf41f&{Td*wN1&=_fPAG)h_%+Tqv3g+!{(d1gRQky(d6GiT7ERo z@33Kbf20s&_^UDdFIK+NznH3Rj;Ao%Rh=!k`;+M7U;Ra1UgLR!-S}vw`jb>a>%T+R ze>UIzPRi+bWE#4h##df8JW05#Fi$h?PJ*8P#o|A;8Enz{t_k~pFW+EG>yPHDKS=$K z%-T;)sA2f7bd26_CO-6Cldzwpeyh#@2kL)KpzasjEyP|KMQ7-wY?_Sq9Ay;#dy;DQ iD<3Y~e0R~)D|X{HTlDC=I0oXuY-`l5k(i>6-~I=c<3tJo literal 0 HcmV?d00001 diff --git a/htdocs/search/cust_bill.html b/htdocs/search/cust_bill.html new file mode 100755 index 000000000..4adb40e4a --- /dev/null +++ b/htdocs/search/cust_bill.html @@ -0,0 +1,21 @@ + + + Invoice Search + + +
+

Invoice Search

+
+
+ + Search for invoice #: + + +

+ +

+ +
+ + + diff --git a/htdocs/search/cust_main-payinfo.html b/htdocs/search/cust_main-payinfo.html new file mode 100755 index 000000000..92341ad13 --- /dev/null +++ b/htdocs/search/cust_main-payinfo.html @@ -0,0 +1,21 @@ + + + Customer Search + + +
+

Customer Search

+
+
+
+ Search for Credit card #: + + + +

+ +

+
+ + + diff --git a/htdocs/search/cust_main.html b/htdocs/search/cust_main.html new file mode 100755 index 000000000..656943f9c --- /dev/null +++ b/htdocs/search/cust_main.html @@ -0,0 +1,36 @@ + + + Customer Search + + +
+

Customer Search

+
+
+
+ Search for last name: + + using search method(s): + +

Search for company: + + using search methods(s): + +

Note: Fuzzy searching can take a while. Please be patient. + +

+ +
Explanation of search methods: +
    +
  • Fuzzy - Searches for matches that are close to your text. +
  • Exact - Finds exact matches only, but much faster than the other search methods. +
+ + + diff --git a/htdocs/search/svc_acct.html b/htdocs/search/svc_acct.html new file mode 100755 index 000000000..91291be99 --- /dev/null +++ b/htdocs/search/svc_acct.html @@ -0,0 +1,21 @@ + + + Account Search + + +
+

Account Search

+
+
+
+ Search for username: + + +

+ +

+ +
+ + + diff --git a/htdocs/search/svc_acct_sm.html b/htdocs/search/svc_acct_sm.html new file mode 100755 index 000000000..0719856db --- /dev/null +++ b/htdocs/search/svc_acct_sm.html @@ -0,0 +1,23 @@ + + + Mail Alias Search + + +
+

Mail Alias Search

+
+
+
+ Search for mail alias: + (opt.) @ + (req.) + +

+ +

+ +
+ + + + diff --git a/htdocs/search/svc_domain.html b/htdocs/search/svc_domain.html new file mode 100755 index 000000000..533743ba2 --- /dev/null +++ b/htdocs/search/svc_domain.html @@ -0,0 +1,22 @@ + + + Domain Search + + +
+

Domain Search

+
+
+
+ Search for domain: + + +

+ +

+ +
+ + + + diff --git a/site_perl/table_template-svc.pm b/site_perl/table_template-svc.pm new file mode 100644 index 000000000..a8cbaed5e --- /dev/null +++ b/site_perl/table_template-svc.pm @@ -0,0 +1,107 @@ +#!/usr/local/bin/perl -Tw +# +# ivan@voicenet.com 97-jul-21 + +package FS::svc_table; + +use strict; +use Exporter; +use FS::Record qw(fields qsearchs); + +@FS::svc_table::ISA = qw(FS::Record Exporter); + +# Usage: $record = create FS::svc_table ( \%hash ); +# $record = create FS::svc_table ( { field=>value, ... } ); +sub create { + my($proto,$hashref)=@_; + + my($field); + foreach $field (fields('svc_table')) { + $hashref->{$field}='' unless defined $hashref->{$field}; + } + + $proto->new('svc_table',$hashref); + +} + +# Usage: $error = $record -> insert; +sub insert { + my($self)=@_; + my($error); + + local $SIG{HUP} = 'IGNORE'; + local $SIG{INT} = 'IGNORE'; + local $SIG{QUIT} = 'IGNORE'; + local $SIG{TERM} = 'IGNORE'; + local $SIG{TSTP} = 'IGNORE'; + + $error=$self->check; + return $error if $error; + + $error = $self->add; + return $error if $error; + + ''; #no error +} + +# Usage: $error = $record -> delete; +sub delete { + my($self)=@_; + my($error); + + $error = $self->del; + return $error if $error; + +} + +# Usage: $error = $newrecord -> replace($oldrecord) +sub replace { + my($new,$old)=@_; + my($error); + + return "(Old) Not a svc_table record!" unless $old->table eq "svc_table"; + return "Can't change svcnum!" + unless $old->getfield('svcnum') eq $new->getfield('svcnum'); + + $error=$new->check; + return $error if $error; + + $error = $new->rep($old); + return $error if $error; + + ''; #no error +} + +# Usage: $error = $record -> suspend; +sub suspend { + ''; #no error (stub) +} + +# Usage: $error = $record -> unsuspend; +sub unsuspend { + ''; #no error (stub) +} + +# Usage: $error = $record -> cancel; +sub cancel { + ''; #no error (stub) +} + +# Usage: $error = $record -> check; +sub check { + my($self)=@_; + return "Not a svc_table record!" unless $self->table eq "svc_table"; + my($recref) = $self->hashref; + + $recref->{svcnum} =~ /^(\d+)$/ or return "Illegal svcnum"; + $recref->{svcnum} = $1; + return "Unknown svcnum" unless + qsearchs('cust_svc',{'svcnum'=> $recref->{svcnum} } ); + + #DATA CHECKS GO HERE! + + ''; #no error +} + +1; + diff --git a/site_perl/table_template-unique.pm b/site_perl/table_template-unique.pm new file mode 100644 index 000000000..32b7e6911 --- /dev/null +++ b/site_perl/table_template-unique.pm @@ -0,0 +1,66 @@ +#!/usr/local/bin/perl -Tw +# +# ivan@voicenet.com 97-jul-1 +# +# added hfields +# ivan@sisd.com 97-nov-13 + +package FS::table_name; + +use strict; +use Exporter; +#use FS::UID qw(getotaker); +use FS::Record qw(fields hfields qsearch qsearchs); + +@FS::table_name::ISA = qw(FS::Record Exporter); +@FS::table_name::EXPORT_OK = qw(hfields); + +# Usage: $record = create FS::table_name ( \%hash ); +# $record = create FS::table_name ( { field=>value, ... } ); +sub create { + my($proto,$hashref)=@_; + + my($field); + foreach $field (fields('table_name')) { + $hashref->{$field}='' unless defined $hashref->{$field}; + } + + $proto->new('table_name',$hashref); +} + +# Usage: $error = $record -> insert; +sub insert { + my($self)=@_; + + $self->check or + $self->add; +} + +# Usage: $error = $record -> delete; +sub delete { + my($self)=@_; + + $self->del; +} + +# Usage: $error = $newrecord -> replace($oldrecord) +sub replace { + my($new,$old)=@_; + return "(Old) Not a table_name record!" unless $old->table eq "table_name"; + return "Can't change keyfield!" + unless $old->getfield('keyfield') eq $new->getfield('keyfield'); + $new->check or + $new->rep($old); +} + +# Usage: $error = $record -> check; +sub check { + my($self)=@_; + return "Not a table_name record!" unless $self->table eq "table_name"; + my($recref) = $self->hashref; + + ''; #no error +} + +1; + diff --git a/site_perl/table_template.pm b/site_perl/table_template.pm new file mode 100644 index 000000000..cef2d92e8 --- /dev/null +++ b/site_perl/table_template.pm @@ -0,0 +1,66 @@ +#!/usr/local/bin/perl -Tw +# +# ivan@voicenet.com 97-jul-1 +# +# added hfields +# ivan@sisd.com 97-nov-13 + +package FS::table_name; + +use strict; +use Exporter; +#use FS::UID qw(getotaker); +use FS::Record qw(hfields qsearch qsearchs); + +@FS::table_name::ISA = qw(FS::Record Exporter); +@FS::table_name::EXPORT_OK = qw(hfields); + +# Usage: $record = create FS::table_name ( \%hash ); +# $record = create FS::table_name ( { field=>value, ... } ); +sub create { + my($proto,$hashref)=@_; + + my($field); + foreach $field (fields('table_name')) { + $hashref->{$field}='' unless defined $hashref->{$field}; + } + + $proto->new('table_name',$hashref); + +} + +# Usage: $error = $record -> insert; +sub insert { + my($self)=@_; + + $self->check or + $self->add; +} + +# Usage: $error = $record -> delete; +sub delete { + my($self)=@_; + + $self->del; +} + +# Usage: $error = $newrecord -> replace($oldrecord) +sub replace { + my($new,$old)=@_; + return "(Old) Not a table_name record!" unless $old->table eq "table_name"; + + $new->check or + $new->rep($old); +} + +# Usage: $error = $record -> check; +sub check { + my($self)=@_; + return "Not a table_name record!" unless $self->table eq "table_name"; + my($recref) = $self->hashref; + + ''; #no error +} + +1; + -- 2.11.0