From 1564f23d66008e6167af8b517dce364127d34c3c Mon Sep 17 00:00:00 2001 From: Ivan Kohler Date: Mon, 30 Dec 2013 22:14:25 -0800 Subject: (pkg-balances) change package of unapplied payments and credits, RT#22198 --- httemplate/edit/process/cust_credit-pkgnum.html | 35 +++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100755 httemplate/edit/process/cust_credit-pkgnum.html (limited to 'httemplate/edit/process/cust_credit-pkgnum.html') diff --git a/httemplate/edit/process/cust_credit-pkgnum.html b/httemplate/edit/process/cust_credit-pkgnum.html new file mode 100755 index 000000000..8941cbc73 --- /dev/null +++ b/httemplate/edit/process/cust_credit-pkgnum.html @@ -0,0 +1,35 @@ +%if ($error) { +% $cgi->param('error', $error); +<% $cgi->redirect(popurl(2). 'cust_credit-pkgnum.html?'. $cgi->query_string ) %> +%} else { +<% header(emt('Credit package changed')) %> + + + +%} +<%init> + +my $conf = FS::Conf->new; + +die "access denied" + unless $FS::CurrentUser::CurrentUser->access_right('Apply credit'); #own ACL? + +$cgi->param('crednum') =~ /^(\d+)$/ + or die "Illegal crednum: ". $cgi->param('crednum'); +my $crednum = $1; + +my $cust_credit = qsearchs({ + 'select' => 'cust_credit.*', + 'table' => 'cust_credit', + 'addl_from' => 'LEFT JOIN cust_main USING ( custnum )', + 'hashref' => { crednum => scalar($cgi->param('crednum')), }, + 'extra_sql' => ' AND '. $FS::CurrentUser::CurrentUser->agentnums_sql, +}) + or die 'unknown credit'; + +$cust_credit->pkgnum( $cgi->param('pkgnum') ); +my $error = $cust_credit->replace; + + -- cgit v1.2.1