summaryrefslogtreecommitdiff
path: root/httemplate/edit
diff options
context:
space:
mode:
authorivan <ivan>2009-07-30 06:42:33 +0000
committerivan <ivan>2009-07-30 06:42:33 +0000
commit4396080ed2829ae0595f1fd777f39d090c9bcd7c (patch)
treebf0b7e0fb2437873447d79d3c1291d62902c3be1 /httemplate/edit
parent50f5d60aef5ee82be33c978db6424372bfd7995b (diff)
experimental package balances, RT#4339
Diffstat (limited to 'httemplate/edit')
-rwxr-xr-xhttemplate/edit/cust_credit.cgi13
-rwxr-xr-xhttemplate/edit/cust_pay.cgi14
-rwxr-xr-xhttemplate/edit/process/cust_pay.cgi4
3 files changed, 28 insertions, 3 deletions
diff --git a/httemplate/edit/cust_credit.cgi b/httemplate/edit/cust_credit.cgi
index c9ca31ff3..c6b2bcbea 100755
--- a/httemplate/edit/cust_credit.cgi
+++ b/httemplate/edit/cust_credit.cgi
@@ -40,6 +40,16 @@ Credit
<TD><SELECT NAME="apply"><OPTION VALUE="yes" SELECTED>yes<OPTION>no</SELECT></TD>
</TR>
+% if ( $conf->exists('pkg-balances') ) {
+ <% include('/elements/tr-select-cust_pkg-balances.html',
+ 'custnum' => $custnum,
+ 'cgi' => $cgi
+ )
+ %>
+% } else {
+ <INPUT TYPE="hidden" NAME="pkgnum" VALUE="">
+% }
+
</TABLE>
<BR>
@@ -65,4 +75,7 @@ my $_date = time;
my $otaker = getotaker;
my $p1 = popurl(1);
+my $cust_main = qsearchs('cust_main', { 'custnum' => $custnum } )
+ or die "unknown custnum $custnum\n";
+
</%init>
diff --git a/httemplate/edit/cust_pay.cgi b/httemplate/edit/cust_pay.cgi
index 3c2877498..4dff06d88 100755
--- a/httemplate/edit/cust_pay.cgi
+++ b/httemplate/edit/cust_pay.cgi
@@ -72,6 +72,16 @@ Payment
% }
</TR>
+% if ( $conf->exists('pkg-balances') ) {
+ <% include('/elements/tr-select-cust_pkg-balances.html',
+ 'custnum' => $custnum,
+ 'cgi' => $cgi
+ )
+ %>
+% } else {
+ <INPUT TYPE="hidden" NAME="pkgnum" VALUE="">
+% }
+
</TABLE>
<BR>
@@ -95,7 +105,7 @@ my $money_char = $conf->config('money_char') || '$';
die "access denied"
unless $FS::CurrentUser::CurrentUser->access_right('Post payment');
-my($link, $linknum, $paid, $payby, $payinfo, $_date);
+my($link, $linknum, $paid, $payby, $payinfo, $_date, $pkgnum);
if ( $cgi->param('error') ) {
$link = $cgi->param('link');
$linknum = $cgi->param('linknum');
@@ -131,7 +141,7 @@ if ( $link eq 'invnum' ) {
my $cust_bill = qsearchs('cust_bill', { 'invnum' => $linknum } )
or die "unknown invnum $linknum";
$custnum = $cust_bill->custnum;
-} elsif ( $link eq 'custnum' ) {
+} elsif ( $link eq 'custnum' || $link eq 'popup' ) {
$custnum = $linknum;
}
diff --git a/httemplate/edit/process/cust_pay.cgi b/httemplate/edit/process/cust_pay.cgi
index 647f6fc6c..f8ac8b183 100755
--- a/httemplate/edit/process/cust_pay.cgi
+++ b/httemplate/edit/process/cust_pay.cgi
@@ -46,7 +46,9 @@ my $new = new FS::cust_pay ( {
_date => $_date,
map {
$_, scalar($cgi->param($_));
- } qw(paid payby payinfo paybatch)
+ } qw( paid payby payinfo paybatch
+ pkgnum
+ )
#} fields('cust_pay')
} );