diff options
author | Ivan Kohler <ivan@freeside.biz> | 2012-04-02 10:37:52 -0700 |
---|---|---|
committer | Ivan Kohler <ivan@freeside.biz> | 2012-04-02 10:37:52 -0700 |
commit | f84937b2a6cc6ba63cdab177866b1417c32b1028 (patch) | |
tree | 945b3e0bb69355c264f43d5a83e2fde70fef9d98 /httemplate/edit | |
parent | 59db9d8aa66fe128a26e512c5172982e041c59ae (diff) | |
parent | c2ee6c5c4f274bbf86729cacd2fe011ea71f725d (diff) |
Merge branch 'master' of git.freeside.biz:/home/git/freeside
Diffstat (limited to 'httemplate/edit')
-rwxr-xr-x | httemplate/edit/cust_pay.cgi | 26 | ||||
-rwxr-xr-x | httemplate/edit/part_pkg.cgi | 28 | ||||
-rwxr-xr-x | httemplate/edit/process/cust_pay.cgi | 5 |
3 files changed, 54 insertions, 5 deletions
diff --git a/httemplate/edit/cust_pay.cgi b/httemplate/edit/cust_pay.cgi index 3fd9c79eb..7a1bb00fa 100755 --- a/httemplate/edit/cust_pay.cgi +++ b/httemplate/edit/cust_pay.cgi @@ -18,7 +18,7 @@ <INPUT TYPE="hidden" NAME="payby" VALUE="<% $payby %>"> <INPUT TYPE="hidden" NAME="paybatch" VALUE="<% $paybatch %>"> -<BR><BR> +<BR> <% mt('Payment') |h %> <% ntable("#cccccc", 2) %> @@ -56,7 +56,29 @@ <TD ALIGN="right"><% mt('Check #') |h %></TD> <TD COLSPAN=2><INPUT TYPE="text" NAME="payinfo" VALUE="<% $payinfo %>" SIZE=10></TD> </TR> -% } +% } +% elsif ( $payby eq 'CASH' and $conf->exists('require_cash_deposit_info') ) { + <TR> + <TD ALIGN="right"><% mt('Bank') |h %></TD> + <TD COLSPAN=3><INPUT TYPE="text" NAME="bank" VALUE="<% $cgi->param('bank') %>"></TD> + </TR> + <TR> + <TD ALIGN="right"><% mt('Check #') |h %></TD> + <TD COLSPAN=2><INPUT TYPE="text" NAME="payinfo" VALUE="<% $payinfo %>" SIZE=10></TD> + </TR> + <TR> + <TD ALIGN="right"><% mt('Teller #') |h %></TD> + <TD COLSPAN=2><INPUT TYPE="text" NAME="teller" VALUE="<% $cgi->param('teller') %>" SIZE=10></TD> + </TR> + <TR> + <TD ALIGN="right"><% mt('Depositor') |h %></TD> + <TD COLSPAN=3><INPUT TYPE="text" NAME="depositor" VALUE="<% $cgi->param('depositor') %>"></TD> + </TR> + <TR> + <TD ALIGN="right"><% mt('Account #') |h %></TD> + <TD COLSPAN=2><INPUT TYPE="text" NAME="account" VALUE="<% $cgi->param('account') %>" SIZE=18></TD> + </TR> +% } <TR> % if ( $link eq 'custnum' || $link eq 'popup' ) { diff --git a/httemplate/edit/part_pkg.cgi b/httemplate/edit/part_pkg.cgi index e5edcdedc..cd0731370 100755 --- a/httemplate/edit/part_pkg.cgi +++ b/httemplate/edit/part_pkg.cgi @@ -24,6 +24,8 @@ 'error_callback' => $error_callback, 'field_callback' => $field_callback, + 'onsubmit' => 'confirm_submit', + 'labels' => { 'pkgpart' => 'Package Definition', 'pkg' => 'Package (customer-visible)', @@ -66,6 +68,8 @@ }, { field=>'custom', type=>'hidden' }, + { field=>'family_pkgpart', type=>'hidden' }, + { field=>'successor', type=>'hidden' }, { type => 'columnstart' }, @@ -593,7 +597,7 @@ my $javascript = <<'END'; } - function aux_planchanged(what) { + function aux_planchanged(what) { //? alert('called!'); var plan = what.options[what.selectedIndex].value; @@ -609,9 +613,29 @@ my $javascript = <<'END'; } - </SCRIPT> END +my $warning = + 'Changing the setup or recurring fee will create a new package definition. '. + 'Continue?'; + +if ( $conf->exists('part_pkg-lineage') ) { + $javascript .= " + function confirm_submit(f) { + + var fields = Array('setup_fee','recur_fee'); + for(var i=0; i < fields.length; i++) { + if ( f[fields[i]].value != f[fields[i]].defaultValue ) { + return confirm('$warning'); + } + } + return true; + } +"; +} + +$javascript .= '</SCRIPT>'; + tie my %plans, 'Tie::IxHash', %{ FS::part_pkg::plan_info() }; tie my %plan_labels, 'Tie::IxHash', diff --git a/httemplate/edit/process/cust_pay.cgi b/httemplate/edit/process/cust_pay.cgi index e74f9022f..06f5e64d5 100755 --- a/httemplate/edit/process/cust_pay.cgi +++ b/httemplate/edit/process/cust_pay.cgi @@ -28,6 +28,8 @@ %} <%init> +my $conf = FS::Conf->new; + $cgi->param('linknum') =~ /^(\d+)$/ or die "Illegal linknum: ". $cgi->param('linknum'); my $linknum = $1; @@ -46,6 +48,7 @@ my $new = new FS::cust_pay ( { $_, scalar($cgi->param($_)); } qw( paid payby payinfo paybatch pkgnum discount_term + bank depositor account teller ) #} fields('cust_pay') } ); @@ -57,6 +60,6 @@ push @rights, 'Post cash payment' if $new->payby eq 'CASH'; die "access denied" unless $FS::CurrentUser::CurrentUser->access_right(\@rights); -my $error = $new->insert( 'manual' => 1 ); +my $error ||= $new->insert( 'manual' => 1 ); </%init> |