diff options
author | ivan <ivan> | 2002-01-28 06:57:23 +0000 |
---|---|---|
committer | ivan <ivan> | 2002-01-28 06:57:23 +0000 |
commit | 1aa750eba2b9b73b4f09f28b9acd748ee3669bd4 (patch) | |
tree | 08133c5572e09b75b3557b32335ad53d0668c6eb /FS | |
parent | b03df92e48df653460cb8b6034a06dd1de6f4095 (diff) |
book closing schema changes
Diffstat (limited to 'FS')
-rw-r--r-- | FS/FS/cust_bill.pm | 9 | ||||
-rw-r--r-- | FS/FS/cust_credit.pm | 11 | ||||
-rw-r--r-- | FS/FS/cust_pay.pm | 9 | ||||
-rw-r--r-- | FS/FS/cust_refund.pm | 9 | ||||
-rw-r--r-- | FS/FS/part_pkg.pm | 18 | ||||
-rw-r--r-- | FS/FS/part_svc.pm | 6 |
6 files changed, 36 insertions, 26 deletions
diff --git a/FS/FS/cust_bill.pm b/FS/FS/cust_bill.pm index fbccff1ff..8b326a56f 100644 --- a/FS/FS/cust_bill.pm +++ b/FS/FS/cust_bill.pm @@ -91,6 +91,8 @@ L<Time::Local> and L<Date::Parse> for conversion functions. =item printed - how many times this invoice has been printed automatically (see L<FS::cust_main/"collect">). +=item closed - books closed flag, empty or `Y' + =back =head1 METHODS @@ -120,7 +122,9 @@ no record you ever posted this invoice (which is bad, no?) =cut sub delete { - return "Can't remove invoice!" + my $self = shift; + return "Can't delete closed invoice" if $self->closed =~ /^Y/i; + $self->SUPER::delete(@_); } =item replace OLD_RECORD @@ -160,6 +164,7 @@ sub check { || $self->ut_numbern('_date') || $self->ut_money('charged') || $self->ut_numbern('printed') + || $self->ut_enum('closed', [ '', 'Y' ]) ; return $error if $error; @@ -495,7 +500,7 @@ sub print_text { =head1 VERSION -$Id: cust_bill.pm,v 1.14 2001-12-21 21:40:24 ivan Exp $ +$Id: cust_bill.pm,v 1.15 2002-01-28 06:57:23 ivan Exp $ =head1 BUGS diff --git a/FS/FS/cust_credit.pm b/FS/FS/cust_credit.pm index 3044af7ea..0ce5ac614 100644 --- a/FS/FS/cust_credit.pm +++ b/FS/FS/cust_credit.pm @@ -58,6 +58,8 @@ L<Time::Local> and L<Date::Parse> for conversion functions. =item reason - text +=item closed - books closed flag, empty or `Y' + =back =head1 METHODS @@ -126,7 +128,9 @@ Currently unimplemented. =cut sub delete { - return "Can't remove credit!" + my $self = shift; + return "Can't delete closed credit" if $self->closed =~ /^Y/i; + $self->SUPER::delete(@_); } =item replace OLD_RECORD @@ -156,7 +160,8 @@ sub check { || $self->ut_number('custnum') || $self->ut_numbern('_date') || $self->ut_money('amount') - || $self->ut_textn('reason'); + || $self->ut_textn('reason') + || $self->ut_enum('closed', [ '', 'Y' ]) ; return $error if $error; @@ -237,7 +242,7 @@ sub credited { =head1 VERSION -$Id: cust_credit.pm,v 1.14 2002-01-24 16:58:47 ivan Exp $ +$Id: cust_credit.pm,v 1.15 2002-01-28 06:57:23 ivan Exp $ =head1 BUGS diff --git a/FS/FS/cust_pay.pm b/FS/FS/cust_pay.pm index 8f790a61a..3f811357a 100644 --- a/FS/FS/cust_pay.pm +++ b/FS/FS/cust_pay.pm @@ -61,6 +61,8 @@ L<Time::Local> and L<Date::Parse> for conversion functions. =item paybatch - text field for tracking card processing +=item closed - books closed flag, empty or `Y' + =back =head1 METHODS @@ -208,7 +210,9 @@ Currently unimplemented (accounting reasons). =cut sub delete { - return "Can't (yet?) delete cust_pay records!"; + my $self = shift; + return "Can't delete closed payment" if $self->closed =~ /^Y/i; + $self->SUPER::delete(@_); } =item replace OLD_RECORD @@ -237,6 +241,7 @@ sub check { || $self->ut_money('paid') || $self->ut_numbern('_date') || $self->ut_textn('paybatch') + || $self->ut_enum('closed', [ '', 'Y' ]) ; return $error if $error; @@ -307,7 +312,7 @@ sub unapplied { =head1 VERSION -$Id: cust_pay.pm,v 1.13 2002-01-24 16:58:47 ivan Exp $ +$Id: cust_pay.pm,v 1.14 2002-01-28 06:57:23 ivan Exp $ =head1 BUGS diff --git a/FS/FS/cust_refund.pm b/FS/FS/cust_refund.pm index 2f7b3af4f..3dbd4ef39 100644 --- a/FS/FS/cust_refund.pm +++ b/FS/FS/cust_refund.pm @@ -55,6 +55,8 @@ L<Time::Local> and L<Date::Parse> for conversion functions. =item otaker - order taker (assigned automatically, see L<FS::UID>) +=item closed - books closed flag, empty or `Y' + =back =head1 METHODS @@ -189,7 +191,9 @@ Currently unimplemented (accounting reasons). =cut sub delete { - return "Can't (yet?) delete cust_refund records!"; + my $self = shift; + return "Can't delete closed refund" if $self->closed =~ /^Y/i; + $self->SUPER::delete(@_); } =item replace OLD_RECORD @@ -218,6 +222,7 @@ sub check { || $self->ut_money('refund') || $self->ut_numbern('_date') || $self->ut_textn('paybatch') + || $self->ut_enum('closed', [ '', 'Y' ]) ; return $error if $error; @@ -261,7 +266,7 @@ sub check { =head1 VERSION -$Id: cust_refund.pm,v 1.14 2002-01-24 16:58:47 ivan Exp $ +$Id: cust_refund.pm,v 1.15 2002-01-28 06:57:23 ivan Exp $ =head1 BUGS diff --git a/FS/FS/part_pkg.pm b/FS/FS/part_pkg.pm index be2ad935f..29257c0cb 100644 --- a/FS/FS/part_pkg.pm +++ b/FS/FS/part_pkg.pm @@ -132,7 +132,7 @@ insert and replace methods. sub check { my $self = shift; - my $error = $self->ut_numbern('pkgpart') + $self->ut_numbern('pkgpart') || $self->ut_text('pkg') || $self->ut_text('comment') || $self->ut_anything('setup') @@ -140,19 +140,11 @@ sub check { || $self->ut_anything('recur') || $self->ut_alphan('plan') || $self->ut_anything('plandata') + || $self->ut_enum('setuptax', [ '', 'Y' ] ) + || $self->ut_enum('recurtax', [ '', 'Y' ] ) + || $self->ut_enum('disabled', [ '', 'Y' ] ) ; - return $error if $error; - $self->setuptax =~ /^(Y?)$/ or return "Illegal setuptax: ". $self->setuptax; - $self->setuptax($1); - - $self->recurtax =~ /^(Y?)$/ or return "Illegal recrutax: ". $self->recurtax; - $self->recurtax($1); - - $self->disabled =~ /^(Y?)$/ or return "Illegal disabled: ". $self->disabled; - $self->disabled($1); - - ''; } =item pkg_svc @@ -190,7 +182,7 @@ sub svcpart { =head1 VERSION -$Id: part_pkg.pm,v 1.5 2001-12-27 09:26:13 ivan Exp $ +$Id: part_pkg.pm,v 1.6 2002-01-28 06:57:23 ivan Exp $ =head1 BUGS diff --git a/FS/FS/part_svc.pm b/FS/FS/part_svc.pm index 446d88c7e..41ee21d31 100644 --- a/FS/FS/part_svc.pm +++ b/FS/FS/part_svc.pm @@ -231,6 +231,7 @@ sub check { $self->ut_numbern('svcpart') || $self->ut_text('svc') || $self->ut_alpha('svcdb') + || $self->ut_enum('disabled', [ '', 'Y' ] ) ; return $error if $error; @@ -262,9 +263,6 @@ sub check { # } # } - $self->disabled =~ /^(Y?)$/ or return "Illegal disabled: ". $self->disabled; - $self->disabled($1); - ''; #no error } @@ -301,7 +299,7 @@ sub all_part_svc_column { =head1 VERSION -$Id: part_svc.pm,v 1.8 2002-01-22 14:55:25 ivan Exp $ +$Id: part_svc.pm,v 1.9 2002-01-28 06:57:23 ivan Exp $ =head1 BUGS |