[freeside-commits] branch master updated. 9d90ce6a6d2c107c0a3bcb7451932b7108466c27

Christopher Burger burgerc at freeside.biz
Wed Jan 3 07:43:59 PST 2018


The branch, master has been updated
       via  9d90ce6a6d2c107c0a3bcb7451932b7108466c27 (commit)
      from  814e5db9cd3953afad6ee1901574180fa0890062 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 9d90ce6a6d2c107c0a3bcb7451932b7108466c27
Author: Christopher Burger <burgerc at freeside.biz>
Date:   Wed Jan 3 10:43:28 2018 -0500

    RT# 34134 - added documentation for new feature

diff --git a/httemplate/elements/tr-select-invoice.html b/httemplate/elements/tr-select-invoice.html
index 70923b633..3728d348d 100644
--- a/httemplate/elements/tr-select-invoice.html
+++ b/httemplate/elements/tr-select-invoice.html
@@ -1,3 +1,15 @@
+<%doc>
+
+Example:
+
+  include( '/elements/tr-select-invoice.html',
+
+    #opt - most get used in /elements/tr-amount-fee
+    'custnum'              => 4,     # customer number,
+    'prefix'               => 'pre', # prefix to fields and row ID's
+  )
+
+</%doc>
 
   <TR ID="invoice_row" STYLE="display:none;">
     <TH ALIGN="right"><% mt('Open invoices') |h %></TH>
@@ -6,7 +18,6 @@
   	  ID       = "<% $opt{prefix} %>invoice"
   	  NAME     = "<% $opt{prefix} %>invoice"
   	  onChange = "<% $opt{prefix} %>invoice_select_changed(this)"
-  	  <% $opt{disabled} %>
 	>
   		<OPTION VALUE="select">Select an invoice to pay</OPTION>
 %         foreach my $record (@records) {
diff --git a/httemplate/elements/tr-select-payment_options.html b/httemplate/elements/tr-select-payment_options.html
index 5197c3706..3c50e88d8 100644
--- a/httemplate/elements/tr-select-payment_options.html
+++ b/httemplate/elements/tr-select-payment_options.html
@@ -1,3 +1,25 @@
+<%doc>
+
+Example:
+
+  include( '/elements/tr-select-payment_options.html',
+
+    #opt - most get used in /elements/tr-amount-fee
+    'custnum'              => 4,     # customer number needed for selecting invoices
+    'prefix'               => 'pre', # prefix to fields and row ID's
+    'amount'               => 1,     # payment amount
+    'process-pkgpart'      => scalar($conf->config('manual_process-pkgpart', $cust_main->agentnum)),
+    'process-display'      => scalar($conf->config('manual_process-display')),
+    'process-skip_first'   => $conf->exists('manual_process-skip_first'),
+    'num_payments'         => scalar($cust_main->cust_pay),
+    'surcharge_percentage' =>
+      ( $payby eq 'CARD'
+          ? scalar($conf->config('credit-card-surcharge-percentage', $cust_main->agentnum))
+          : 0
+      ),
+  )
+
+</%doc>
 
   <TR STYLE="display:block">
     <TH ALIGN="right"><% mt('Payment options') |h %></TH>
@@ -17,7 +39,8 @@
   </TR>
 
   <& /elements/tr-select-invoice.html,
-       %opt
+       'custnum' => $opt{custnum},
+       'prefix'  => $opt{prefix},
   &>
 
   <& /elements/tr-amount_fee.html,
@@ -31,6 +54,7 @@
         if ( what.value == 'select' ) {
         	document.getElementById('payment_amount_row').style.display = 'none';
         	document.getElementById('invoice_row').style.display = 'none';
+          document.getElementById('<% $opt{prefix} %>invoice').value = 'select';
         	document.getElementById('amount').value = '';
         }
         else if ( what.value == 'invoice' ) {
@@ -41,6 +65,7 @@
         else {
         	document.getElementById('payment_amount_row').style.display = 'block';
         	document.getElementById('invoice_row').style.display = 'none';
+          document.getElementById('<% $opt{prefix} %>invoice').value = 'select';
         	document.getElementById('amount').value = what.value;
         }
 

-----------------------------------------------------------------------

Summary of changes:
 httemplate/elements/tr-select-invoice.html         | 13 ++++++++++-
 httemplate/elements/tr-select-payment_options.html | 27 +++++++++++++++++++++-
 2 files changed, 38 insertions(+), 2 deletions(-)




More information about the freeside-commits mailing list