projects
/
freeside.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
RT#39627: System log daily context also includes Cron::bill and Cron::upload results
[freeside.git]
/
FS
/
FS
/
quotation.pm
diff --git
a/FS/FS/quotation.pm
b/FS/FS/quotation.pm
index
cb3d80b
..
0549853
100644
(file)
--- a/
FS/FS/quotation.pm
+++ b/
FS/FS/quotation.pm
@@
-69,6
+69,13
@@
disabled
usernum
usernum
+=item close_date
+
+projected date when the quotation will be closed
+
+=item confidence
+
+projected confidence (expressed as integer) that quotation will close
=back
=back
@@
-122,6
+129,8
@@
sub check {
|| $self->ut_numbern('_date')
|| $self->ut_enum('disabled', [ '', 'Y' ])
|| $self->ut_numbern('usernum')
|| $self->ut_numbern('_date')
|| $self->ut_enum('disabled', [ '', 'Y' ])
|| $self->ut_numbern('usernum')
+ || $self->ut_numbern('close_date')
+ || $self->ut_numbern('confidence')
;
return $error if $error;
;
return $error if $error;
@@
-129,6
+138,9
@@
sub check {
$self->usernum($FS::CurrentUser::CurrentUser->usernum) unless $self->usernum;
$self->usernum($FS::CurrentUser::CurrentUser->usernum) unless $self->usernum;
+ return 'confidence must be an integer between 1 and 100'
+ if length($self->confidence) && (($self->confidence < 1) || ($self->confidence > 100));
+
return 'prospectnum or custnum must be specified'
if ! $self->prospectnum
&& ! $self->custnum;
return 'prospectnum or custnum must be specified'
if ! $self->prospectnum
&& ! $self->custnum;
@@
-268,8
+280,8
@@
sub _items_sections {
my $part_pkg = $pkg->part_pkg;
my $recur_freq = $part_pkg->freq;
my $part_pkg = $pkg->part_pkg;
my $recur_freq = $part_pkg->freq;
- $show{$recur_freq} = 1 if $pkg->unitrecur > 0;
- $show{0} = 1 if $pkg->unitsetup > 0;
+ $show{$recur_freq} = 1 if $pkg->unitrecur > 0
or $pkg->recur_show_zero
;
+ $show{0} = 1 if $pkg->unitsetup > 0
or $pkg->setup_show_zero
;
($subtotals{0} ||= 0) += $pkg->setup + $pkg->setup_tax;
($subtotals{$recur_freq} ||= 0) += $pkg->recur + $pkg->recur_tax;
($subtotals{0} ||= 0) += $pkg->setup + $pkg->setup_tax;
($subtotals{$recur_freq} ||= 0) += $pkg->recur + $pkg->recur_tax;
@@
-1041,7
+1053,11
@@
sub _items_pkg {
$quotation_pkg->get('unit'.$setuprecur));
$this_item->{'amount'} = sprintf('%.2f', $this_item->{'unit_amount'}
* $quotation_pkg->quantity);
$quotation_pkg->get('unit'.$setuprecur));
$this_item->{'amount'} = sprintf('%.2f', $this_item->{'unit_amount'}
* $quotation_pkg->quantity);
- next if $this_item->{'amount'} == 0;
+ next if $this_item->{'amount'} == 0 and !(
+ $setuprecur eq 'setup'
+ ? $quotation_pkg->setup_show_zero
+ : $quotation_pkg->recur_show_zero
+ );
if ( $preref ) {
$this_item->{'preref_html'} = &$preref($quotation_pkg);
if ( $preref ) {
$this_item->{'preref_html'} = &$preref($quotation_pkg);