From 425cf92cbeb8b417c8ebfb5a7e00d23eca866506 Mon Sep 17 00:00:00 2001 From: Jonathan Prykop Date: Sun, 31 May 2015 18:17:28 -0500 Subject: RT#17828: Additional invoice fields on invoice view in selfservice portal --- FS/FS/ClientAPI/MyAccount.pm | 46 ++++++++++++++---------- fs_selfservice/FS-SelfService/cgi/invoices.html | 26 +++++++++----- fs_selfservice/FS-SelfService/cgi/myaccount.html | 28 +++++++++------ 3 files changed, 62 insertions(+), 38 deletions(-) diff --git a/FS/FS/ClientAPI/MyAccount.pm b/FS/FS/ClientAPI/MyAccount.pm index fee59bd55..11523013c 100644 --- a/FS/FS/ClientAPI/MyAccount.pm +++ b/FS/FS/ClientAPI/MyAccount.pm @@ -444,11 +444,13 @@ sub customer_info { if ( $session->{'pkgnum'} ) { #XXX open invoices in the pkg-balances case } else { + $return{'money_char'} = $conf->config("money_char") || '$'; my @open = map { { - invnum => $_->invnum, - date => time2str("%b %o, %Y", $_->_date), - owed => $_->owed, + invnum => $_->invnum, + date => time2str("%b %o, %Y", $_->_date), + owed => $_->owed, + charged => $_->charged, }; } $cust_main->open_cust_bill; $return{open_invoices} = \@open; @@ -1555,25 +1557,31 @@ sub list_invoices { my @cust_bill = grep ! $_->hide, $cust_main->cust_bill; my $balance = 0; + my $invoices = [ + map { + #not super efficient, we also run cust_bill_pay/cust_credited inside owed + my @payments_and_credits = sort {$b->_date <=> $a->_date} ($_->cust_bill_pay,$_->cust_credited); + my $owed = $_->owed; + $balance += $owed; + +{ 'invnum' => $_->invnum, + '_date' => $_->_date, + 'date' => time2str("%b %o, %Y", $_->_date), + 'date_short' => time2str("%m-%d-%Y", $_->_date), + 'previous' => sprintf('%.2f', ($_->previous)[0]), + 'charged' => sprintf('%.2f', $_->charged), + 'owed' => sprintf('%.2f', $owed), + 'balance' => sprintf('%.2f', $balance), + 'lastpay' => @payments_and_credits + ? time2str("%b %o, %Y", $payments_and_credits[0]->_date) + : '', + } + } @cust_bill + ]; return { 'error' => '', 'balance' => $cust_main->balance, - 'invoices' => [ - map { - my $owed = $_->owed; - $balance += $owed; - +{ 'invnum' => $_->invnum, - '_date' => $_->_date, - 'date' => time2str("%b %o, %Y", $_->_date), - 'date_short' => time2str("%m-%d-%Y", $_->_date), - 'previous' => sprintf('%.2f', ($_->previous)[0]), - 'charged' => sprintf('%.2f', $_->charged), - 'owed' => sprintf('%.2f', $owed), - 'balance' => sprintf('%.2f', $balance), - } - } - @cust_bill - ], + 'money_char' => $conf->config("money_char") || '$', + 'invoices' => $invoices, 'legacy_invoices' => [ map { +{ 'legacyinvnum' => $_->legacyinvnum, diff --git a/fs_selfservice/FS-SelfService/cgi/invoices.html b/fs_selfservice/FS-SelfService/cgi/invoices.html index 752805123..ffc44ec85 100644 --- a/fs_selfservice/FS-SelfService/cgi/invoices.html +++ b/fs_selfservice/FS-SelfService/cgi/invoices.html @@ -3,24 +3,34 @@ <%= if ( @invoices ) { - $OUT .= ''. - ''; - my $col1 = "ffffff"; - my $col2 = "dddddd"; + my $th = q!
All Invoices
!; + my $thr = q!!; + $OUT .= ''. + ''.$th.'Invoice #'.$th.'Date'.$thr.'Charges' + .$th.'Date Paid'.$thr.'Owed'; + my $col1 = "#ffffff"; + my $col2 = "#dddddd"; my $col = $col1; foreach my $invoice ( @invoices ) { - my $td = qq!$td${a}Invoice #". $invoice->{'invnum'}. "$td ". - "$td$a". $invoice->{'date'}. "$td". + "". + $td . $a . $invoice->{'invnum'}. "" . + $td . $a . $invoice->{'date'} . "" . + $tdr . $a . $money_char . $invoice->{'charged'} . "" . + $td . $a . $invoice->{'lastpay'} . "" . + $tdr . $a . $money_char . $invoice->{'owed'} . "" . ''; $col = $col eq $col1 ? $col2 : $col1; } + my $tht = ''.$tht.'BALANCE DUE'.$tht.$money_char.$balance.''; $OUT .= '
!; + my $td = qq!!; + my $tdr = qq!!; my $a=qq!'; $OUT .= - "
'; + $OUT .= '

'; } else { - $OUT .= 'You have no invoices.

'; + $OUT .= '

You have no invoices.

'; } %> diff --git a/fs_selfservice/FS-SelfService/cgi/myaccount.html b/fs_selfservice/FS-SelfService/cgi/myaccount.html index 66e2c692e..309021a87 100644 --- a/fs_selfservice/FS-SelfService/cgi/myaccount.html +++ b/fs_selfservice/FS-SelfService/cgi/myaccount.html @@ -28,28 +28,34 @@ Hello <%= $name %>!

} %> <%= if ( @open_invoices ) { - $OUT .= ''. - ''; - my $link = qq!!; + my $thr = q!
Open Invoices
!; + $OUT .= ''. + ''. + ''.$th.'Invoice #'.$th.'Date'.$thr.'Charges' + .$thr.'Owed'; + my $col1 = "#ffffff"; + my $col2 = "#dddddd"; my $col = $col1; foreach my $invoice ( @open_invoices ) { - my $td = qq!$td${a}Invoice #". $invoice->{'invnum'}. "$td". - "$td$a". $invoice->{'date'}. "$td". - qq!'. + "". + $td . $a . $invoice->{'invnum'}. "" . + $td . $a . $invoice->{'date'} . "" . + $tdr . $a . $money_char . $invoice->{'charged'} . "" . + $tdr . $a . $money_char . $invoice->{'owed'} . "" . ''; $col = $col eq $col1 ? $col2 : $col1; } $OUT .= '
Open Invoices
!; + my $td = qq!!; + my $tdr = qq!!; my $a=qq!'; $OUT .= - "
$a\$!. $invoice->{'owed'}. - '

'; } else { - $OUT .= 'You have no outstanding invoices.

'; + $OUT .= '

You have no outstanding invoices.

'; } + %> <%= -- cgit v1.2.1 From 5f8552ce33ca87edc21e931c9eefbecc1d74fe14 Mon Sep 17 00:00:00 2001 From: Jeremy Davis Date: Thu, 11 Jun 2015 09:11:42 -0400 Subject: Ticket #36760 Preserve NG-selfservice configuration Debian packaging --- debian/conffiles | 1 + 1 file changed, 1 insertion(+) diff --git a/debian/conffiles b/debian/conffiles index 5b6b01019..653a5eb4a 100644 --- a/debian/conffiles +++ b/debian/conffiles @@ -1,3 +1,4 @@ /usr/local/etc/freeside/secrets /etc/default/freeside /opt/rt3/etc/RT_SiteConfig.pm +/var/www/ng_selfservice-DIST/freeside.class.php -- cgit v1.2.1 From 0068c5ee1d0e13bee273abd3b9f8ec9f441c45e4 Mon Sep 17 00:00:00 2001 From: Jeremy Davis Date: Thu, 11 Jun 2015 14:52:25 -0400 Subject: Ticket #34719 Debain 8 packages --- debian/control | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/debian/control b/debian/control index 7a6bb08fd..986178a16 100644 --- a/debian/control +++ b/debian/control @@ -21,7 +21,7 @@ Description: Billing and trouble ticketing for service providers Package: freeside-lib Architecture: all -Depends: gnupg,ghostscript,gsfonts,gzip,latex-xcolor,libbusiness-creditcard-perl,libcache-cache-perl,libcache-simple-timedexpiry-perl,libchart-perl,libclass-container-perl,libclass-data-inheritable-perl,libclass-returnvalue-perl,libcolor-scheme-perl,libcompress-zlib-perl,libconvert-binhex-perl,libcrypt-passwdmd5-perl,libcrypt-ssleay-perl,libcss-squish-perl,libdate-manip-perl,libdbd-mysql-perl,libdbd-pg-perl,libdbi-perl,libdbix-dbschema-perl,libdbix-searchbuilder-perl,libdevel-stacktrace-perl,libdevel-symdump-perl,liberror-perl,libexcel-writer-xlsx-perl,libexception-class-perl,libfile-counterfile-perl,libfile-rsync-perl,libfont-afm-perl,libfreezethaw-perl,libfrontier-rpc-perl,libgd-gd2-perl,libgd-graph-perl,libhtml-format-perl,libhtml-mason-perl,libhtml-parser-perl,libhtml-scrubber-perl,libhtml-tagset-perl,libhtml-tree-perl,libhtml-widgets-selectlayers-perl,libio-stringy-perl,libipc-run-perl,libipc-run3-perl,libipc-sharelite-perl,libjavascript-rpc-perl,libjson-perl,liblingua-en-inflect-perl,liblingua-en-nameparse-perl,liblocale-gettext-perl,liblocale-maketext-fuzzy-perl,liblocale-maketext-lexicon-perl,liblocale-subcountry-perl,liblog-dispatch-perl,libmailtools-perl,libmime-tools-perl,libmodule-versions-report-perl,libnet-daemon-perl,libnet-ping-external-perl,libnet-scp-perl,libnet-ssh-perl,libnet-whois-raw-perl,libnetaddr-ip-perl,libnumber-format-perl,libpam-modules,libpam-runtime,libpaper-utils,libparams-validate-perl,libparse-recdescent-perl,libpg-perl,libregexp-common-perl,libspreadsheet-writeexcel-perl,libstring-approx-perl,libstring-shellquote-perl,libterm-readkey-perl,libtest-inline-perl,libtext-autoformat-perl,libtext-charwidth-perl,libtext-csv-perl,libtext-iconv-perl,libtext-quoted-perl,libtext-reform-perl,libtext-template-perl,libtext-wrapi18n-perl,libtext-wrapper-perl,libtie-ixhash-perl,libtime-duration-perl,libtime-modules-perl,libtimedate-perl,libtree-simple-perl,libuniversal-require-perl,liburi-perl,libwant-perl,libwww-perl,libxml-parser-perl,libyaml-perl,lmodern,locales,lpr,mime-support,ntp,ntpdate,perl,perl-base,perl-modules,postgresql,postgresql-client,psutils,rsync,openssh-client,texlive,texlive-latex-extra,texinfo,ttf-bitstream-vera,ttf-dustin,libdatetime-perl,libdatetime-format-strptime-perl,libfile-slurp-perl,libspreadsheet-parseexcel-perl,libauthen-passphrase-perl,libnet-domain-tld-perl,libbusiness-us-usps-webtools-perl,libxml-simple-perl,libemail-sender-perl,libemail-sender-transport-smtp-tls-perl,libemail-sender-perl,libemail-sender-transport-smtp-tls-perl,libhtml-defang-perl,libdatetime-format-natural-perl,libcgi-pm-perl,libfile-sharedir-perl,libmodule-versions-report-perl,libtext-wikiformat-perl,libnet-server-perl,libhttp-server-simple-perl,libhtml-rewriteattributes-perl,libmime-types-perl,libperlio-eol-perl,libgnupg-interface-perl,libdata-ical-perl,libcalendar-simple-perl,libdatetime-set-perl,libhook-lexwrap-perl,libhttp-server-simple-mason-perl,libxml-rss-perl,libipc-run-safehandles-perl,libpoe-perl,libsoap-lite-perl,libhtml-tableextract-perl,libhtml-element-extended-perl,libcam-pdf-perl,libnet-openssh-perl,libgd-barcode-perl,sam2p,libsys-sigaction-perl,libgeo-googleearth-pluggable-perl,libgeo-coder-googlev3-perl,libnet-snmp-perl,libcrypt-openssl-rsa-perl,libregexp-common-perl,libnet-cidr-perl,libregexp-ipv6-perl,libhtml-quoted-perl,libtext-password-pronounceable-perl,libconvert-color-perl,liburi-perl,libhtml-rewriteattributes-perl,libregexp-common-net-cidr-perl,liblog-dispatch-perl,libdbix-searchbuilder-perl,libencode-perl,libhtml-mason-psgihandler-perl,libdate-simple-perl,libsnmp-perl,libemail-valid-perl,libio-string-perl,libnet-smtp-ssl-perl,libgeo-coder-googlev3-perl,libcam-pdf-perl,libnet-openssh-perl,libhtml-quoted-perl,libregexp-ipv6-perl,libregexp-common-net-cidr-perl,libencode-perl,libexcel-writer-xlsx-perl,libgeo-googleearth-pluggable-perl,libhtml-mason-psgihandler-perl,libdate-simple-perl,libsnmp-perl,libemail-valid-perl,libparse-fixedlength-perl,libregexp-common-net-cidr-perl,libio-string-perl,libnet-mac-vendor-perl,libnet-https-any-perl +Depends: gnupg,ghostscript,gsfonts,gzip,latex-xcolor,libbusiness-creditcard-perl,libcache-cache-perl,libcache-simple-timedexpiry-perl,libchart-perl,libclass-container-perl,libclass-data-inheritable-perl,libclass-returnvalue-perl,libcolor-scheme-perl,libcompress-zlib-perl,libconvert-binhex-perl,libcrypt-passwdmd5-perl,libcrypt-ssleay-perl,libcss-squish-perl,libdate-manip-perl,libdbd-mysql-perl,libdbd-pg-perl,libdbi-perl,libdbix-dbschema-perl,libdbix-searchbuilder-perl,libdevel-stacktrace-perl,libdevel-symdump-perl,liberror-perl,libexcel-writer-xlsx-perl,libexception-class-perl,libfile-counterfile-perl,libfile-rsync-perl,libfont-afm-perl,libfreezethaw-perl,libfrontier-rpc-perl,libgd-gd2-perl,libgd-graph-perl,libhtml-format-perl,libhtml-mason-perl,libhtml-parser-perl,libhtml-scrubber-perl,libhtml-tagset-perl,libhtml-tree-perl,libhtml-widgets-selectlayers-perl,libio-stringy-perl,libipc-run-perl,libipc-run3-perl,libipc-sharelite-perl,libjavascript-rpc-perl,libjson-perl,liblingua-en-inflect-perl,liblingua-en-nameparse-perl,liblocale-gettext-perl,liblocale-maketext-fuzzy-perl,liblocale-maketext-lexicon-perl,liblocale-subcountry-perl,liblog-dispatch-perl,libmailtools-perl,libmime-tools-perl,libmodule-versions-report-perl,libnet-daemon-perl,libnet-ping-external-perl,libnet-scp-perl,libnet-ssh-perl,libnet-whois-raw-perl,libnetaddr-ip-perl,libnumber-format-perl,libpam-modules,libpam-runtime,libpaper-utils,libparams-validate-perl,libparse-recdescent-perl,libpg-perl,libregexp-common-perl,libspreadsheet-writeexcel-perl,libstring-approx-perl,libstring-shellquote-perl,libterm-readkey-perl,libtest-inline-perl,libtext-autoformat-perl,libtext-charwidth-perl,libtext-csv-perl,libtext-iconv-perl,libtext-quoted-perl,libtext-reform-perl,libtext-template-perl,libtext-wrapi18n-perl,libtext-wrapper-perl,libtie-ixhash-perl,libtime-duration-perl,libtime-modules-perl,libtimedate-perl,libtree-simple-perl,libuniversal-require-perl,liburi-perl,libwant-perl,libwww-perl,libxml-parser-perl,libyaml-perl,lmodern,locales,lpr,mime-support,ntp,ntpdate,perl,perl-base,perl-modules,postgresql,postgresql-client,psutils,rsync,openssh-client,texlive,texlive-latex-extra,texinfo,ttf-bitstream-vera,fonts-dustin,libdatetime-perl,libdatetime-format-strptime-perl,libfile-slurp-perl,libspreadsheet-parseexcel-perl,libauthen-passphrase-perl,libnet-domain-tld-perl,libbusiness-us-usps-webtools-perl,libxml-simple-perl,libemail-sender-perl,libemail-sender-transport-smtp-tls-perl,libemail-sender-perl,libemail-sender-transport-smtp-tls-perl,libhtml-defang-perl,libdatetime-format-natural-perl,libcgi-pm-perl,libfile-sharedir-perl,libmodule-versions-report-perl,libtext-wikiformat-perl,libnet-server-perl,libhttp-server-simple-perl,libhtml-rewriteattributes-perl,libmime-types-perl,libperlio-eol-perl,libgnupg-interface-perl,libdata-ical-perl,libcalendar-simple-perl,libdatetime-set-perl,libhook-lexwrap-perl,libhttp-server-simple-mason-perl,libxml-rss-perl,libipc-run-safehandles-perl,libpoe-perl,libsoap-lite-perl,libhtml-tableextract-perl,libhtml-element-extended-perl,libcam-pdf-perl,libnet-openssh-perl,libgd-barcode-perl,sam2p,libsys-sigaction-perl,libgeo-googleearth-pluggable-perl,libgeo-coder-googlev3-perl,libnet-snmp-perl,libcrypt-openssl-rsa-perl,libregexp-common-perl,libnet-cidr-perl,libregexp-ipv6-perl,libhtml-quoted-perl,libtext-password-pronounceable-perl,libconvert-color-perl,liburi-perl,libhtml-rewriteattributes-perl,libregexp-common-net-cidr-perl,liblog-dispatch-perl,libdbix-searchbuilder-perl,libencode-perl,libhtml-mason-psgihandler-perl,libdate-simple-perl,libsnmp-perl,libemail-valid-perl,libio-string-perl,libnet-smtp-ssl-perl,libgeo-coder-googlev3-perl,libcam-pdf-perl,libnet-openssh-perl,libhtml-quoted-perl,libregexp-ipv6-perl,libregexp-common-net-cidr-perl,libencode-perl,libexcel-writer-xlsx-perl,libgeo-googleearth-pluggable-perl,libhtml-mason-psgihandler-perl,libdate-simple-perl,libsnmp-perl,libemail-valid-perl,libparse-fixedlength-perl,libregexp-common-net-cidr-perl,libio-string-perl,libnet-mac-vendor-perl,libnet-https-any-perl Suggests: libbusiness-onlinepayment-perl Description: Libraries for Freeside billing and trouble ticketing Freeside is a web-based billing and trouble ticketing application. -- cgit v1.2.1 From 76d2bd33f0b9dd003457fc40c97f253ce1aaf5d1 Mon Sep 17 00:00:00 2001 From: Jeremy Davis Date: Thu, 11 Jun 2015 16:38:12 -0400 Subject: Reverting changes on Ticket #36760 --- debian/conffiles | 1 - 1 file changed, 1 deletion(-) diff --git a/debian/conffiles b/debian/conffiles index 653a5eb4a..5b6b01019 100644 --- a/debian/conffiles +++ b/debian/conffiles @@ -1,4 +1,3 @@ /usr/local/etc/freeside/secrets /etc/default/freeside /opt/rt3/etc/RT_SiteConfig.pm -/var/www/ng_selfservice-DIST/freeside.class.php -- cgit v1.2.1 From eb6536b41456955fc425dba2e156a996e8fe2837 Mon Sep 17 00:00:00 2001 From: Mark Wells Date: Fri, 12 Jun 2015 17:32:07 -0700 Subject: fix autocommit in part_pkg_link->insert/delete, #36784 --- FS/FS/part_pkg_link.pm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/FS/FS/part_pkg_link.pm b/FS/FS/part_pkg_link.pm index 8e43d155e..ce071ef17 100644 --- a/FS/FS/part_pkg_link.pm +++ b/FS/FS/part_pkg_link.pm @@ -130,6 +130,7 @@ sub insert { return $error if $error; } + $dbh->commit if $oldAutoCommit; return; } @@ -166,7 +167,7 @@ sub delete { $dbh->rollback if $oldAutoCommit; return $error; } - $dbh->commit; + $dbh->commit if $oldAutoCommit; return; } -- cgit v1.2.1