projects
/
freeside.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
make CDR invoice details appear chronologically on invoices, for voip_cdr, RT10960
[freeside.git]
/
FS
/
FS
/
cust_pkg.pm
diff --git
a/FS/FS/cust_pkg.pm
b/FS/FS/cust_pkg.pm
index
2ed25a0
..
c3d3cb9
100644
(file)
--- a/
FS/FS/cust_pkg.pm
+++ b/
FS/FS/cust_pkg.pm
@@
-125,6
+125,10
@@
Billing item definition (see L<FS::part_pkg>)
Optional link to package location (see L<FS::location>)
Optional link to package location (see L<FS::location>)
+=item order_date
+
+date package was ordered (also remains same on changes)
+
=item start_date
date
=item start_date
date
@@
-271,6
+275,8
@@
sub insert {
}
}
}
}
+ $self->order_date(time);
+
local $SIG{HUP} = 'IGNORE';
local $SIG{INT} = 'IGNORE';
local $SIG{QUIT} = 'IGNORE';
local $SIG{HUP} = 'IGNORE';
local $SIG{INT} = 'IGNORE';
local $SIG{QUIT} = 'IGNORE';
@@
-487,7
+493,10
@@
sub replace {
#trigger export of new RADIUS Expiration attribute when cust_pkg.bill changes
foreach my $old_svc_acct ( @svc_acct ) {
my $new_svc_acct = new FS::svc_acct { $old_svc_acct->hash };
#trigger export of new RADIUS Expiration attribute when cust_pkg.bill changes
foreach my $old_svc_acct ( @svc_acct ) {
my $new_svc_acct = new FS::svc_acct { $old_svc_acct->hash };
- my $s_error = $new_svc_acct->replace($old_svc_acct);
+ my $s_error =
+ $new_svc_acct->replace( $old_svc_acct,
+ 'depend_jobnum' => $options->{depend_jobnum},
+ );
if ( $s_error ) {
$dbh->rollback if $oldAutoCommit;
return $s_error;
if ( $s_error ) {
$dbh->rollback if $oldAutoCommit;
return $s_error;
@@
-2500,7
+2509,6
@@
sub insert_discount {
'discountnum' => $self->discountnum,
'months_used' => 0,
'end_date' => '', #XXX
'discountnum' => $self->discountnum,
'months_used' => 0,
'end_date' => '', #XXX
- 'otaker' => $self->otaker,
#for the create a new discount case
'_type' => $self->discountnum__type,
'amount' => $self->discountnum_amount,
#for the create a new discount case
'_type' => $self->discountnum__type,
'amount' => $self->discountnum_amount,
@@
-3396,6
+3404,10
@@
sub _upgrade_data { # class method
'UPDATE cust_pkg SET bill = bill + (365*24*60*60) WHERE bill < last_bill
AND bill > 1259654400 AND bill < 1262332800 AND (SELECT plan FROM part_pkg
WHERE part_pkg.pkgpart = cust_pkg.pkgpart) = \'prorate\'',
'UPDATE cust_pkg SET bill = bill + (365*24*60*60) WHERE bill < last_bill
AND bill > 1259654400 AND bill < 1262332800 AND (SELECT plan FROM part_pkg
WHERE part_pkg.pkgpart = cust_pkg.pkgpart) = \'prorate\'',
+ # RT6628, add order_date to cust_pkg
+ 'update cust_pkg set order_date = (select history_date from h_cust_pkg
+ where h_cust_pkg.pkgnum = cust_pkg.pkgnum and
+ history_action = \'insert\') where order_date is null',
);
foreach my $sql (@statements) {
my $sth = dbh->prepare($sql);
);
foreach my $sql (@statements) {
my $sth = dbh->prepare($sql);