projects
/
freeside.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
b03df92
)
book closing schema changes
author
ivan
<ivan>
Mon, 28 Jan 2002 06:57:23 +0000
(06:57 +0000)
committer
ivan
<ivan>
Mon, 28 Jan 2002 06:57:23 +0000
(06:57 +0000)
FS/FS/cust_bill.pm
patch
|
blob
|
history
FS/FS/cust_credit.pm
patch
|
blob
|
history
FS/FS/cust_pay.pm
patch
|
blob
|
history
FS/FS/cust_refund.pm
patch
|
blob
|
history
FS/FS/part_pkg.pm
patch
|
blob
|
history
FS/FS/part_svc.pm
patch
|
blob
|
history
README.1.4.0pre4567-8
patch
|
blob
|
history
bin/fs-setup
patch
|
blob
|
history
httemplate/docs/schema.html
patch
|
blob
|
history
httemplate/docs/upgrade8.html
patch
|
blob
|
history
diff --git
a/FS/FS/cust_bill.pm
b/FS/FS/cust_bill.pm
index
fbccff1
..
8b326a5
100644
(file)
--- 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 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
=back
=head1 METHODS
@@
-120,7
+122,9
@@
no record you ever posted this invoice (which is bad, no?)
=cut
sub delete {
=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
}
=item replace OLD_RECORD
@@
-160,6
+164,7
@@
sub check {
|| $self->ut_numbern('_date')
|| $self->ut_money('charged')
|| $self->ut_numbern('printed')
|| $self->ut_numbern('_date')
|| $self->ut_money('charged')
|| $self->ut_numbern('printed')
+ || $self->ut_enum('closed', [ '', 'Y' ])
;
return $error if $error;
;
return $error if $error;
@@
-495,7
+500,7
@@
sub print_text {
=head1 VERSION
=head1 VERSION
-$Id: cust_bill.pm,v 1.1
4 2001-12-21 21:40:24
ivan Exp $
+$Id: cust_bill.pm,v 1.1
5 2002-01-28 06:57:23
ivan Exp $
=head1 BUGS
=head1 BUGS
diff --git
a/FS/FS/cust_credit.pm
b/FS/FS/cust_credit.pm
index
3044af7
..
0ce5ac6
100644
(file)
--- 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 reason - text
+=item closed - books closed flag, empty or `Y'
+
=back
=head1 METHODS
=back
=head1 METHODS
@@
-126,7
+128,9
@@
Currently unimplemented.
=cut
sub delete {
=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
}
=item replace OLD_RECORD
@@
-156,7
+160,8
@@
sub check {
|| $self->ut_number('custnum')
|| $self->ut_numbern('_date')
|| $self->ut_money('amount')
|| $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;
;
return $error if $error;
@@
-237,7
+242,7
@@
sub credited {
=head1 VERSION
=head1 VERSION
-$Id: cust_credit.pm,v 1.1
4 2002-01-24 16:58:47
ivan Exp $
+$Id: cust_credit.pm,v 1.1
5 2002-01-28 06:57:23
ivan Exp $
=head1 BUGS
=head1 BUGS
diff --git
a/FS/FS/cust_pay.pm
b/FS/FS/cust_pay.pm
index
8f790a6
..
3f81135
100644
(file)
--- 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 paybatch - text field for tracking card processing
+=item closed - books closed flag, empty or `Y'
+
=back
=head1 METHODS
=back
=head1 METHODS
@@
-208,7
+210,9
@@
Currently unimplemented (accounting reasons).
=cut
sub delete {
=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
}
=item replace OLD_RECORD
@@
-237,6
+241,7
@@
sub check {
|| $self->ut_money('paid')
|| $self->ut_numbern('_date')
|| $self->ut_textn('paybatch')
|| $self->ut_money('paid')
|| $self->ut_numbern('_date')
|| $self->ut_textn('paybatch')
+ || $self->ut_enum('closed', [ '', 'Y' ])
;
return $error if $error;
;
return $error if $error;
@@
-307,7
+312,7
@@
sub unapplied {
=head1 VERSION
=head1 VERSION
-$Id: cust_pay.pm,v 1.1
3 2002-01-24 16:58:47
ivan Exp $
+$Id: cust_pay.pm,v 1.1
4 2002-01-28 06:57:23
ivan Exp $
=head1 BUGS
=head1 BUGS
diff --git
a/FS/FS/cust_refund.pm
b/FS/FS/cust_refund.pm
index
2f7b3af
..
3dbd4ef
100644
(file)
--- 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 otaker - order taker (assigned automatically, see L<FS::UID>)
+=item closed - books closed flag, empty or `Y'
+
=back
=head1 METHODS
=back
=head1 METHODS
@@
-189,7
+191,9
@@
Currently unimplemented (accounting reasons).
=cut
sub delete {
=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
}
=item replace OLD_RECORD
@@
-218,6
+222,7
@@
sub check {
|| $self->ut_money('refund')
|| $self->ut_numbern('_date')
|| $self->ut_textn('paybatch')
|| $self->ut_money('refund')
|| $self->ut_numbern('_date')
|| $self->ut_textn('paybatch')
+ || $self->ut_enum('closed', [ '', 'Y' ])
;
return $error if $error;
;
return $error if $error;
@@
-261,7
+266,7
@@
sub check {
=head1 VERSION
=head1 VERSION
-$Id: cust_refund.pm,v 1.1
4 2002-01-24 16:58:47
ivan Exp $
+$Id: cust_refund.pm,v 1.1
5 2002-01-28 06:57:23
ivan Exp $
=head1 BUGS
=head1 BUGS
diff --git
a/FS/FS/part_pkg.pm
b/FS/FS/part_pkg.pm
index
be2ad93
..
29257c0
100644
(file)
--- 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;
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_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_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
}
=item pkg_svc
@@
-190,7
+182,7
@@
sub svcpart {
=head1 VERSION
=head1 VERSION
-$Id: part_pkg.pm,v 1.
5 2001-12-27 09:26:1
3 ivan Exp $
+$Id: part_pkg.pm,v 1.
6 2002-01-28 06:57:2
3 ivan Exp $
=head1 BUGS
=head1 BUGS
diff --git
a/FS/FS/part_svc.pm
b/FS/FS/part_svc.pm
index
446d88c
..
41ee21d
100644
(file)
--- 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_numbern('svcpart')
|| $self->ut_text('svc')
|| $self->ut_alpha('svcdb')
+ || $self->ut_enum('disabled', [ '', 'Y' ] )
;
return $error if $error;
;
return $error if $error;
@@
-262,9
+263,6
@@
sub check {
# }
# }
# }
# }
- $self->disabled =~ /^(Y?)$/ or return "Illegal disabled: ". $self->disabled;
- $self->disabled($1);
-
''; #no error
}
''; #no error
}
@@
-301,7
+299,7
@@
sub all_part_svc_column {
=head1 VERSION
=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
=head1 BUGS
diff --git
a/README.1.4.0pre4567-8
b/README.1.4.0pre4567-8
index
57474fe
..
1f78783
100644
(file)
--- a/
README.1.4.0pre4567-8
+++ b/
README.1.4.0pre4567-8
@@
-51,6
+51,11
@@
CREATE INDEX part_export_option (
CREATE INDEX part_export_option1 ON part_export ( exportnum );
CREATE INDEX part_export_option2 ON part_export ( option );
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
Run bin/dbdef-create
Restart Apache and freeside-queued
diff --git
a/bin/fs-setup
b/bin/fs-setup
index
5b82eaf
..
e3dd8b0
100755
(executable)
--- a/
bin/fs-setup
+++ b/
bin/fs-setup
@@
-1,6
+1,6
@@
#!/usr/bin/perl -Tw
#
#!/usr/bin/perl -Tw
#
-# $Id: fs-setup,v 1.7
0 2002-01-28 05:15:28
ivan Exp $
+# $Id: fs-setup,v 1.7
1 2002-01-28 06:57:23
ivan Exp $
#to delay loading dbdef until we're ready
BEGIN { $FS::Record::setup_hack = 1; }
#to delay loading dbdef until we're ready
BEGIN { $FS::Record::setup_hack = 1; }
@@
-293,6
+293,7
@@
sub tables_hash_hack {
'_date', @date_type,
'charged', @money_type,
'printed', 'int', '', '',
'_date', @date_type,
'charged', @money_type,
'printed', 'int', '', '',
+ 'closed', 'char', 'NULL', 1,
],
'primary_key' => 'invnum',
'unique' => [ [] ],
],
'primary_key' => 'invnum',
'unique' => [ [] ],
@@
-347,6
+348,7
@@
sub tables_hash_hack {
'amount', @money_type,
'otaker', 'varchar', '', 8,
'reason', 'text', 'NULL', '',
'amount', @money_type,
'otaker', 'varchar', '', 8,
'reason', 'text', 'NULL', '',
+ 'closed', 'char', 'NULL', 1,
],
'primary_key' => 'crednum',
'unique' => [ [] ],
],
'primary_key' => 'crednum',
'unique' => [ [] ],
@@
-455,6
+457,7
@@
sub tables_hash_hack {
# payment type table.
'payinfo', 'varchar', 'NULL', 16, #see cust_main above
'paybatch', 'varchar', 'NULL', $char_d, #for auditing purposes.
# 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' => [ [] ],
],
'primary_key' => 'paynum',
'unique' => [ [] ],
@@
-531,6
+534,7
@@
sub tables_hash_hack {
# into payment type table.
'payinfo', 'varchar', 'NULL', 16, #see cust_main above
'paybatch', 'varchar', 'NULL', $char_d,
# 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' => [ [] ],
],
'primary_key' => 'refundnum',
'unique' => [ [] ],
diff --git
a/httemplate/docs/schema.html
b/httemplate/docs/schema.html
index
3e9189b
..
21da3ec
100644
(file)
--- a/
httemplate/docs/schema.html
+++ b/
httemplate/docs/schema.html
@@
-24,6
+24,7
@@
<li>_date
<li>charged - amount of this invoice
<li>printed - how many times this invoice has been printed automatically
<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>
</ul>
<li><a name="cust_bill_event" href="man/FS/cust_bill_event.html">cust_bill_event</a> - Invoice event history
<ul>
@@
-58,6
+59,7
@@
<li>_date
<li>otaker - order taker
<li>reason
<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>
</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>
@@
-132,6
+134,7
@@
<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>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>
</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>
@@
-181,6
+184,7
@@
<li>payby - CARD, BILL or COMP
<li>payinfo - card number, P.O.#, or comp issuer
<li>otaker - order taker
<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>
</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>
diff --git
a/httemplate/docs/upgrade8.html
b/httemplate/docs/upgrade8.html
index
144242b
..
bbb528c
100644
(file)
--- a/
httemplate/docs/upgrade8.html
+++ b/
httemplate/docs/upgrade8.html
@@
-175,6
+175,10
@@
ALTER TABLE part_pkg ADD setuptax char(1) NULL;
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 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 );
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 );