From 74c9101d79b0dfd2f2d3a2996bd3d3575ada9252 Mon Sep 17 00:00:00 2001 From: Mark Wells Date: Wed, 25 Jul 2012 16:16:02 -0700 Subject: fix ordering packages with no unit price, #13136 --- httemplate/misc/order_pkg.html | 2 ++ 1 file changed, 2 insertions(+) (limited to 'httemplate/misc') diff --git a/httemplate/misc/order_pkg.html b/httemplate/misc/order_pkg.html index 7aa024a34..c5d3fa3a8 100644 --- a/httemplate/misc/order_pkg.html +++ b/httemplate/misc/order_pkg.html @@ -39,6 +39,8 @@ +% } else { + % } -- cgit v1.2.1 From 2528cc7b182781a82844d8bbb1b555560487abc7 Mon Sep 17 00:00:00 2001 From: Ivan Kohler Date: Thu, 26 Jul 2012 14:05:05 -0700 Subject: quotations, RT#16996 --- httemplate/misc/order_pkg.html | 62 ++++++++++++++++++++++++++++++------------ 1 file changed, 45 insertions(+), 17 deletions(-) (limited to 'httemplate/misc') diff --git a/httemplate/misc/order_pkg.html b/httemplate/misc/order_pkg.html index 7aa024a34..57fdd64ee 100644 --- a/httemplate/misc/order_pkg.html +++ b/httemplate/misc/order_pkg.html @@ -1,4 +1,6 @@ -<& /elements/header-popup.html, mt('Order new package') &> +<& /elements/header-popup.html, $quotationnum ? mt('Add package to quotation') + : mt('Order new package') +&> @@ -11,8 +13,10 @@
- + + + % if ( $svcpart ) { % } @@ -26,9 +30,10 @@ % } else { <& /elements/tr-select-cust-part_pkg.html, - 'curr_value' => $pkgpart, - 'classnum' => -1, - 'cust_main' => $cust_main, + 'curr_value' => $pkgpart, + 'classnum' => -1, + 'cust_main' => $cust_main, + 'prospect_main' => $prospect_main, &> % } @@ -54,7 +59,7 @@ -% if ( $cust_main->payby =~ /^(CARD|CHEK)$/ ) { +% if ( $cust_main && $cust_main->payby =~ /^(CARD|CHEK)$/ ) { % my $what = lc(FS::payby->shortname($cust_main->payby)); <% mt("Disable automatic $what charge") |h %> @@ -97,8 +102,9 @@ % } else { <& /elements/tr-select-cust_location.html, - 'cgi' => $cgi, - 'cust_main' => $cust_main, + 'cgi' => $cgi, + 'cust_main' => $cust_main, + 'prospect_main' => $prospect_main, &> % } @@ -152,20 +158,42 @@ die "access denied" my $conf = new FS::Conf; my $date_format = $conf->config('date_format') || '%m/%d/%Y'; -$cgi->param('custnum') =~ /^(\d+)$/ or die "no custnum"; -my $custnum = $1; -my $cust_main = qsearchs({ - 'table' => 'cust_main', - 'hashref' => { 'custnum' => $custnum }, - 'extra_sql' => ' AND '. $FS::CurrentUser::CurrentUser->agentnums_sql, -}); +my $cust_main = ''; +if ( $cgi->param('custnum') =~ /^(\d+)$/ ) { + my $custnum = $1; + $cust_main = qsearchs({ + 'table' => 'cust_main', + 'hashref' => { 'custnum' => $custnum }, + 'extra_sql' => ' AND '. $curuser->agentnums_sql, + }); +} + +my $prospect_main = ''; +if ( $cgi->param('prospectnum') =~ /^(\d+)$/ ) { + my $prospectnum = $1; + $prospect_main = qsearchs({ + 'table' => 'prospect_main', + 'hashref' => { 'prospectnum' => $prospectnum }, + 'extra_sql' => ' AND '. $curuser->agentnums_sql, + }); +} + +my $quotationnum = ''; +if ( $cgi->param('quotationnum') =~ /^(\d+)$/ ) { + $quotationnum = $1; +} + +die 'no custnum or prospectnum' unless $cust_main || $prospect_main; my $part_pkg = ''; if ( $cgi->param('lock_pkgpart') ) { $part_pkg = qsearchs({ 'table' => 'part_pkg', 'hashref' => { 'pkgpart' => scalar($cgi->param('lock_pkgpart')) }, - 'extra_sql' => ' AND '. FS::part_pkg->agent_pkgs_sql( $cust_main->agent ), + 'extra_sql' => ' AND '. FS::part_pkg->agent_pkgs_sql( + $cust_main ? $cust_main->agent + : $prospect_main->agent + ), }) or die "unknown pkgpart ". $cgi->param('lock_pkgpart'); } @@ -179,7 +207,7 @@ if ( $cgi->param('quantity') =~ /^\s*(\d+)\s*$/ ) { my $format = $date_format. ' %T %z (%Z)'; #false laziness w/REAL_cust_pkg.cgi? my $start_date = ''; -if( ! $conf->exists('order_pkg-no_start_date') ) { +if( ! $conf->exists('order_pkg-no_start_date') && $cust_main ) { $start_date = $cust_main->next_bill_date; $start_date = $start_date ? time2str($format, $start_date) : ''; } -- cgit v1.2.1 From f24c4bebce257bfcc61ba07fd3d16c5c0d730071 Mon Sep 17 00:00:00 2001 From: Ivan Kohler Date: Tue, 31 Jul 2012 23:02:14 -0700 Subject: invoice voiding, RT#18677 --- httemplate/misc/process/void-cust_bill.html | 22 ++++++++++++++ httemplate/misc/void-cust_bill.html | 45 +++++++++++++++++++++++++++++ 2 files changed, 67 insertions(+) create mode 100755 httemplate/misc/process/void-cust_bill.html create mode 100644 httemplate/misc/void-cust_bill.html (limited to 'httemplate/misc') diff --git a/httemplate/misc/process/void-cust_bill.html b/httemplate/misc/process/void-cust_bill.html new file mode 100755 index 000000000..f2930ec01 --- /dev/null +++ b/httemplate/misc/process/void-cust_bill.html @@ -0,0 +1,22 @@ +%if ( $error ) { +% $cgi->param('error', $error); +<% $cgi->redirect(popurl(1). "void-cust_bill.html?". $cgi->query_string ) %> +%} else { +<% $cgi->redirect(popurl(3). "view/cust_main.cgi?". $custnum) %> +%} +<%init> + +die "access denied" + unless $FS::CurrentUser::CurrentUser->access_right('Void invoices'); + +#untaint invnum +$cgi->param('invnum') =~ /^(\d+)$/ || die "Illegal invnum"; +my $invnum = $1; + +my $cust_bill = qsearchs('cust_bill',{'invnum'=>$invnum}); + +my $custnum = $cust_bill->custnum; + +my $error = $cust_bill->void( $cgi->param('reason') ); + + diff --git a/httemplate/misc/void-cust_bill.html b/httemplate/misc/void-cust_bill.html new file mode 100644 index 000000000..1608fd051 --- /dev/null +++ b/httemplate/misc/void-cust_bill.html @@ -0,0 +1,45 @@ +<& /elements/header-popup.html, mt('Void invoice') &> + +<% include('/elements/error.html') %> + +<% emt('Are you sure you want to void this invoice?') %> +

+ +<% emt("Invoice #[_1] ([_2])",$cust_bill->display_invnum, $money_char. $cust_bill->owed) %> +

+ + + + +<% ntable("#cccccc", 2) %> + + Reason + + + + + +
+
+   \ + +
+ + + + +<%init> + +die "access denied" + unless $FS::CurrentUser::CurrentUser->access_right('Void invoices'); + +my $conf = new FS::Conf; +my $money_char = $conf->config('money_char') || '$'; + +#untaint invnum +$cgi->param('invnum') =~ /^(\d+)$/ || die "Illegal invnum"; +my $invnum = $1; + +my $cust_bill = qsearchs('cust_bill',{'invnum'=>$invnum}); + + -- cgit v1.2.1 From bec3b6c2bf97d66b992866d7ee7295f1f05452e6 Mon Sep 17 00:00:00 2001 From: Ivan Kohler Date: Wed, 1 Aug 2012 14:01:14 -0700 Subject: invoice voiding, RT#18677 --- httemplate/misc/process/void-cust_bill.html | 6 +++++- httemplate/misc/unvoid-cust_bill_void.html | 25 +++++++++++++++++++++++++ httemplate/misc/unvoid-cust_pay_void.cgi | 2 +- httemplate/misc/void-cust_pay.cgi | 2 +- 4 files changed, 32 insertions(+), 3 deletions(-) create mode 100755 httemplate/misc/unvoid-cust_bill_void.html (limited to 'httemplate/misc') diff --git a/httemplate/misc/process/void-cust_bill.html b/httemplate/misc/process/void-cust_bill.html index f2930ec01..899901a50 100755 --- a/httemplate/misc/process/void-cust_bill.html +++ b/httemplate/misc/process/void-cust_bill.html @@ -2,7 +2,11 @@ % $cgi->param('error', $error); <% $cgi->redirect(popurl(1). "void-cust_bill.html?". $cgi->query_string ) %> %} else { -<% $cgi->redirect(popurl(3). "view/cust_main.cgi?". $custnum) %> +<& /elements/header-popup.html, 'Invoice voided' &> + + %} <%init> diff --git a/httemplate/misc/unvoid-cust_bill_void.html b/httemplate/misc/unvoid-cust_bill_void.html new file mode 100755 index 000000000..f61416549 --- /dev/null +++ b/httemplate/misc/unvoid-cust_bill_void.html @@ -0,0 +1,25 @@ +%if ( $error ) { +% errorpage($error); +%} else { +% my $show = $curuser->default_customer_view =~ /^(jumbo|payment_history)$/ +% ? '' +% : ';show=payment_history'; +<% $cgi->redirect($p. "view/cust_main.cgi?custnum=$custnum$show" ) %> +%} +<%init> + +my $curuser = $FS::CurrentUser::CurrentUser; + +die "access denied" + unless $curuser->access_right('Unvoid invoices'); + +#untaint invnum +$cgi->param('invnum') =~ /^(\d+)$/ || die "Illegal invnum"; +my $invnum = $1; + +my $cust_bill_void = qsearchs('cust_bill_void', { 'invnum' => $invnum } ); +my $custnum = $cust_bill_void->custnum; + +my $error = $cust_bill_void->unvoid; + + diff --git a/httemplate/misc/unvoid-cust_pay_void.cgi b/httemplate/misc/unvoid-cust_pay_void.cgi index 91fe1c223..4726ee576 100755 --- a/httemplate/misc/unvoid-cust_pay_void.cgi +++ b/httemplate/misc/unvoid-cust_pay_void.cgi @@ -6,7 +6,7 @@ <%init> die "access denied" - unless $FS::CurrentUser::CurrentUser->access_right('Unvoid'); + unless $FS::CurrentUser::CurrentUser->access_right('Unvoid payments'); #untaint paynum my($query) = $cgi->keywords; diff --git a/httemplate/misc/void-cust_pay.cgi b/httemplate/misc/void-cust_pay.cgi index 7b484e93e..31b7a6201 100755 --- a/httemplate/misc/void-cust_pay.cgi +++ b/httemplate/misc/void-cust_pay.cgi @@ -12,7 +12,7 @@ my $paynum = $1; my $cust_pay = qsearchs('cust_pay',{'paynum'=>$paynum}); -my $right = 'Regular void'; +my $right = 'Void payments'; $right = 'Credit card void' if $cust_pay->payby eq 'CARD'; $right = 'Echeck void' if $cust_pay->payby eq 'CHEK'; -- cgit v1.2.1 From 45346fd655ba53b82c80b920da945cc0b87ece01 Mon Sep 17 00:00:00 2001 From: Ivan Kohler Date: Fri, 3 Aug 2012 13:09:05 -0700 Subject: selfservice payment fees, RT#18345 --- httemplate/misc/payment.cgi | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) (limited to 'httemplate/misc') diff --git a/httemplate/misc/payment.cgi b/httemplate/misc/payment.cgi index 1ae15b930..e221c600a 100644 --- a/httemplate/misc/payment.cgi +++ b/httemplate/misc/payment.cgi @@ -16,7 +16,7 @@ 'process-display' => scalar($conf->config('manual_process-display')), 'process-skip-first' => $conf->exists('manual_process-skip_first'), 'num_payments' => scalar($cust_main->cust_pay), - 'post_fee_callback' => $post_fee_callback, + 'surcharge_percentage' => scalar($conf->config('credit-card-surcharge-percentage')), &> <& /elements/tr-select-discount_term.html, @@ -269,19 +269,6 @@ if ( $balance > 0 ) { $amount = $balance; } -my $post_fee_callback = sub { - my( $amountref ) = @_; - - return unless $$amountref > 0; - - my $conf = new FS::Conf; - - my $cc_surcharge_pct = $conf->config('credit-card-surcharge-percentage'); - $$amountref += $$amountref * $cc_surcharge_pct/100 if $cc_surcharge_pct > 0; - - $$amountref = sprintf("%.2f", $$amountref); -}; - my $payunique = "webui-payment-". time. "-$$-". rand() * 2**32; -- cgit v1.2.1 From 0d8eb2d4d4a372680d0fa564fbfcba0d6674b259 Mon Sep 17 00:00:00 2001 From: Ivan Kohler Date: Sat, 4 Aug 2012 09:26:23 -0700 Subject: fix skipping processing fee for first payment, RT#18345 --- httemplate/misc/payment.cgi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'httemplate/misc') diff --git a/httemplate/misc/payment.cgi b/httemplate/misc/payment.cgi index e221c600a..2d7307233 100644 --- a/httemplate/misc/payment.cgi +++ b/httemplate/misc/payment.cgi @@ -14,7 +14,7 @@ 'amount' => $amount, 'process-pkgpart' => scalar($conf->config('manual_process-pkgpart')), 'process-display' => scalar($conf->config('manual_process-display')), - 'process-skip-first' => $conf->exists('manual_process-skip_first'), + 'process-skip_first' => $conf->exists('manual_process-skip_first'), 'num_payments' => scalar($cust_main->cust_pay), 'surcharge_percentage' => scalar($conf->config('credit-card-surcharge-percentage')), &> -- cgit v1.2.1 From dcb3f6aedb9f8af8495302ed7e2ba6b56bc6b0d8 Mon Sep 17 00:00:00 2001 From: Ivan Kohler Date: Mon, 13 Aug 2012 23:56:59 -0700 Subject: clean up various other RT initialization inconsistancy, RT#18719 --- httemplate/misc/timeworked.html | 2 -- 1 file changed, 2 deletions(-) (limited to 'httemplate/misc') diff --git a/httemplate/misc/timeworked.html b/httemplate/misc/timeworked.html index 672fad8d6..e4392825c 100755 --- a/httemplate/misc/timeworked.html +++ b/httemplate/misc/timeworked.html @@ -99,8 +99,6 @@ my(%ticketmap, %ticket, %customers); my $title = 'Assign Time Worked'; tie %ticketmap, 'Tie::IxHash'; -RT::Init(); - my $CurrentUser = RT::CurrentUser->new(); $CurrentUser->LoadByName($FS::CurrentUser::CurrentUser->username); -- cgit v1.2.1 From fa2326a36a5ce74e8c9dab504c3274688a297c04 Mon Sep 17 00:00:00 2001 From: Ivan Kohler Date: Tue, 21 Aug 2012 14:15:40 -0700 Subject: add preference to enable fuzzy searching even on exact matches, RT#18962 --- httemplate/misc/xmlhttp-cust_main-search.cgi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'httemplate/misc') diff --git a/httemplate/misc/xmlhttp-cust_main-search.cgi b/httemplate/misc/xmlhttp-cust_main-search.cgi index 16f7cd2bc..acf7e70e2 100644 --- a/httemplate/misc/xmlhttp-cust_main-search.cgi +++ b/httemplate/misc/xmlhttp-cust_main-search.cgi @@ -10,7 +10,7 @@ % % my $string = $cgi->param('arg'); % my @cust_main = smart_search( 'search' => $string, -% 'no_fuzzy_on_exact' => 1, #pref? +% 'no_fuzzy_on_exact' => ! $FS::CurrentUser::CurrentUser->option('enable_fuzzy_on_exact'), % ); % my $return = [ map [ $_->custnum, % $_->name, -- cgit v1.2.1 From 03b8791b0253e3fd66a6eae75ff54bdd7b51db9d Mon Sep 17 00:00:00 2001 From: Ivan Kohler Date: Wed, 22 Aug 2012 12:08:44 -0700 Subject: add "National ID, plus account and phone services" import format, RT#18946 --- httemplate/misc/cust_main-import.cgi | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'httemplate/misc') diff --git a/httemplate/misc/cust_main-import.cgi b/httemplate/misc/cust_main-import.cgi index 74f9b4c89..a5f1d1153 100644 --- a/httemplate/misc/cust_main-import.cgi +++ b/httemplate/misc/cust_main-import.cgi @@ -36,6 +36,7 @@ Import a file containing customer records.