=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
=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
|| $self->ut_numbern('_date')
|| $self->ut_money('charged')
|| $self->ut_numbern('printed')
+ || $self->ut_enum('closed', [ '', 'Y' ])
;
return $error if $error;
=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
=item reason - text
+=item closed - books closed flag, empty or `Y'
+
=back
=head1 METHODS
=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
|| $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;
=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
=item paybatch - text field for tracking card processing
+=item closed - books closed flag, empty or `Y'
+
=back
=head1 METHODS
=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
|| $self->ut_money('paid')
|| $self->ut_numbern('_date')
|| $self->ut_textn('paybatch')
+ || $self->ut_enum('closed', [ '', 'Y' ])
;
return $error if $error;
=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
=item otaker - order taker (assigned automatically, see L<FS::UID>)
+=item closed - books closed flag, empty or `Y'
+
=back
=head1 METHODS
=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
|| $self->ut_money('refund')
|| $self->ut_numbern('_date')
|| $self->ut_textn('paybatch')
+ || $self->ut_enum('closed', [ '', 'Y' ])
;
return $error if $error;
=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
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')
|| $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
=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
$self->ut_numbern('svcpart')
|| $self->ut_text('svc')
|| $self->ut_alpha('svcdb')
+ || $self->ut_enum('disabled', [ '', 'Y' ] )
;
return $error if $error;
# }
# }
- $self->disabled =~ /^(Y?)$/ or return "Illegal disabled: ". $self->disabled;
- $self->disabled($1);
-
''; #no error
}
=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
CREATE INDEX part_export_option1 ON part_export ( exportnum );
CREATE INDEX part_export_option2 ON part_export ( option );
+ALTER TABLE cust_bill ADD closed char(1) NULL;
+ALTER TABLE cust_pay ADD closed char(1) NULL;
+ALTER TABLE cust_credit ADD closed char(1) NULL;
+ALTER TABLE cust_refund ADD closed char(1) NULL;
+
Run bin/dbdef-create
Restart Apache and freeside-queued
#!/usr/bin/perl -Tw
#
-# $Id: fs-setup,v 1.70 2002-01-28 05:15:28 ivan Exp $
+# $Id: fs-setup,v 1.71 2002-01-28 06:57:23 ivan Exp $
#to delay loading dbdef until we're ready
BEGIN { $FS::Record::setup_hack = 1; }
'_date', @date_type,
'charged', @money_type,
'printed', 'int', '', '',
+ 'closed', 'char', 'NULL', 1,
],
'primary_key' => 'invnum',
'unique' => [ [] ],
'amount', @money_type,
'otaker', 'varchar', '', 8,
'reason', 'text', 'NULL', '',
+ 'closed', 'char', 'NULL', 1,
],
'primary_key' => 'crednum',
'unique' => [ [] ],
# payment type table.
'payinfo', 'varchar', 'NULL', 16, #see cust_main above
'paybatch', 'varchar', 'NULL', $char_d, #for auditing purposes.
+ 'closed', 'char', 'NULL', 1,
],
'primary_key' => 'paynum',
'unique' => [ [] ],
# into payment type table.
'payinfo', 'varchar', 'NULL', 16, #see cust_main above
'paybatch', 'varchar', 'NULL', $char_d,
+ 'closed', 'char', 'NULL', 1,
],
'primary_key' => 'refundnum',
'unique' => [ [] ],
<li>_date
<li>charged - amount of this invoice
<li>printed - how many times this invoice has been printed automatically
+ <li>closed - books closed flag, empty or `Y'
</ul>
<li><a name="cust_bill_event" href="man/FS/cust_bill_event.html">cust_bill_event</a> - Invoice event history
<ul>
<li>_date
<li>otaker - order taker
<li>reason
+ <li>closed - books closed flag, empty or `Y'
</ul>
<li><a name="cust_credit_bill" href="man/FS/cust_credit_bill.html">cust_credit_bill</a> - Credit invoice application. Links a credit to an invoice.
<ul>
<li>payby - CARD, BILL, or COMP
<li>payinfo - card number, P.O.#, or comp issuer
<li>paybatch - text field for tracking card processor batches
+ <li>closed - books closed flag, empty or `Y'
</ul>
<li><a name="cust_bill_pay" href="man/FS/cust_bill_pay.html">cust_bill_pay</a> - Applicaton of a payment to a specific invoice.
<ul>
<li>payby - CARD, BILL or COMP
<li>payinfo - card number, P.O.#, or comp issuer
<li>otaker - order taker
+ <li>closed - books closed flag, empty or `Y'
</ul>
<li><a name="cust_credit_refund" href="man/FS/cust_credit_refund.html">cust_credit_refund</a> - Applicaton of a refund to a specific credit.
<ul>
ALTER TABLE part_pkg ADD recurtax char(1) NULL;
ALTER TABLE part_pkg ADD disabled char(1) NULL;
ALTER TABLE part_svc ADD disabled char(1) NULL;
+ALTER TABLE cust_bill ADD closed char(1) NULL;
+ALTER TABLE cust_pay ADD closed char(1) NULL;
+ALTER TABLE cust_credit ADD closed char(1) NULL;
+ALTER TABLE cust_refund ADD closed char(1) NULL;
CREATE INDEX cust_main3 ON cust_main ( referral_custnum );
CREATE INDEX cust_credit_bill1 ON cust_credit_bill ( crednum );
CREATE INDEX cust_credit_bill2 ON cust_credit_bill ( invnum );