CRM-13965 - label, status and display changes for AdditionalPayment form.
authorDave Greenberg <dave@civicrm.org>
Thu, 13 Feb 2014 01:47:26 +0000 (17:47 -0800)
committerDave Greenberg <dave@civicrm.org>
Thu, 13 Feb 2014 01:47:26 +0000 (17:47 -0800)
----------------------------------------
* CRM-13965: Record additional payments or refunds for pending-pay later OR partially paid event registrations
  http://issues.civicrm.org/jira/browse/CRM-13965

CRM/Contribute/Form/AdditionalPayment.php
templates/CRM/Contribute/Form/AdditionalPayment.tpl

index 633434f744ef9620d4a6fcaae0b6ad695f0be6db..6fb22dfee176b3c5f9d81f01ac16b1f8074aa6af 100644 (file)
@@ -256,7 +256,8 @@ class CRM_Contribute_Form_AdditionalPayment extends CRM_Contribute_Form_Abstract
     $this->add('textarea', 'receipt_text', ts('Confirmation Message'));
 
     // add various dates
-    $this->addDateTime('trxn_date', ts('Received'), FALSE, array('formatType' => 'activityDateTime'));
+    $dateLabel = ($this->_refund) ? 'Refund Date' : 'Received Date';
+    $this->addDateTime('trxn_date', ts('%1', array(1 => $dateLabel)), FALSE, array('formatType' => 'activityDateTime'));
 
     if ($this->_contactId && $this->_id) {
       if ($this->_component == 'event') {
@@ -315,11 +316,11 @@ class CRM_Contribute_Form_AdditionalPayment extends CRM_Contribute_Form_Abstract
       $errors['total_amount'] = ts('Payment amount cannot be greater than owed amount');
     }
     if ($self->_paymentType == 'refund' && $fields['total_amount'] != abs($self->_refund)) {
-      $errors['total_amount'] = ts('Refund amount should not differ');
+      $errors['total_amount'] = ts('Refund amount must equal refund due amount.');
     }
     $netAmt = $fields['total_amount'] - $fields['fee_amount'];
     if (!empty($fields['net_amount']) && $netAmt != $fields['net_amount']) {
-      $errors['net_amount'] = ts('Net amount should be difference of payment amount and fee amount');
+      $errors['net_amount'] = ts('Net amount should be equal to the difference between payment amount and fee amount.');
     }
     return $errors;
   }
index 959a4fab312e44e60cb8d36a07403e6d87fed811..d141b9512aa4e1d8f5bb1aabee96fbf56a38674c 100644 (file)
     <tr class="crm-payment-form-block-total_amount">
       <td class="label">{$form.total_amount.label}</td>
       <td>
-        <span id='totalAmount'>{$form.currency.html|crmAddClass:eight}&nbsp;{$form.total_amount.html|crmAddClass:eight}</span> {$paymentAmt}
+        <span id='totalAmount'>{$form.currency.html|crmAddClass:eight}&nbsp;{$form.total_amount.html|crmAddClass:eight}</span>&nbsp; <span class="status">{if $paymentType EQ 'refund'}{ts}Refund Due{/ts}{else}{ts}Balance Owed{/ts}{/if}:&nbsp;{$paymentAmt|crmMoney}</span>
       </td>
     </tr>
    </table>
     <div class="crm-accordion-wrapper crm-accordion_title-accordion crm-accordion-processed" id="paymentDetails_Information">
       <div class="crm-accordion-header">
-        {ts}Payment Details{/ts}
+        {if $paymentType EQ 'refund'}{ts}Refund Details{/ts}{else}{ts}Payment Details{/ts}{/if}
       </div>
       <div class="crm-accordion-body">
         <table class="form-layout-compressed" >
             <tr class="crm-payment-form-block-is_email_receipt">
               <td class="label">
                 {$form.is_email_receipt.label}</td><td>{$form.is_email_receipt.html}&nbsp;
-                <span class="description">{ts 1=$email}Automatically email a receipt for this payment to %1?{/ts}</span>
+                <span class="description">{ts 1=$email}Automatically email a receipt to %1?{/ts}</span>
               </td>
             </tr>
           {/if}
           <tr id='notice' class="crm-event-eventfees-form-block-receipt_text">
             <td class="label">{$form.receipt_text.label}</td>
             <td><span class="description">
-                {ts}Enter a message you want included at the beginning of the confirmation email. EXAMPLE: 'Thanks for registering for this event.'{/ts}
+                {ts}Enter a message you want included at the beginning of the confirmation email.{/ts}
                 </span><br />
                 {$form.receipt_text.html|crmAddClass:huge}
             </td>