X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=FS%2FFS%2FClientAPI%2FMyAccount%2Fquotation.pm;h=f19071aa81f2d8574bf06b42084e7c8ed7cff4dc;hb=e2f23d0d3110ccff9dadf523d150a0d747130b43;hp=90c2acebb5f491155bc5c3f3e3bf0bcf5a128ce2;hpb=37d0fe4165cbfaf57d82f3aff926508d565759f6;p=freeside.git diff --git a/FS/FS/ClientAPI/MyAccount/quotation.pm b/FS/FS/ClientAPI/MyAccount/quotation.pm index 90c2acebb..f19071aa8 100644 --- a/FS/FS/ClientAPI/MyAccount/quotation.pm +++ b/FS/FS/ClientAPI/MyAccount/quotation.pm @@ -5,7 +5,7 @@ use FS::Record qw(qsearch qsearchs); use FS::quotation; use FS::quotation_pkg; -our $DEBUG = 1; +our $DEBUG = 0; sub _custoragent_session_custnum { FS::ClientAPI::MyAccount::_custoragent_session_custnum(@_); @@ -69,13 +69,21 @@ sub quotation_info { warn "quotation_info #".$quotation->quotationnum if $DEBUG; - # code reuse ftw my $null_escape = sub { @_ }; - my ($sections) = $quotation->_items_sections(escape => $null_escape); - foreach my $section (@$sections) { - $section->{'detail_items'} = - [ $quotation->_items_pkg('section' => $section, escape_function => $null_escape) ]; - } + # 3.x only; 4.x quotation redesign uses actual sections for this + # and isn't a weird hack + my @items = + map { $_->{'pkgnum'} = $_->{'preref_html'}; $_ } + $quotation->_items_pkg(escape_function => $null_escape, + preref_callback => sub { shift->quotationpkgnum }); + push @items, $quotation->_items_total(); + + my $sections = [ + { 'description' => 'Estimated Charges', + 'detail_items' => \@items + } + ]; + return { 'error' => '', 'sections' => $sections } } @@ -215,6 +223,9 @@ sub quotation_order { my $error = $quotation->order; + $quotation->set('disabled' => 'Y'); + $error ||= $quotation->replace; + return { 'error' => $error }; }