$defaults['trxn_date'] = date('Y-m-d H:i:s');
}
- if ($this->isARefund() && $this->amountDue < 0) {
- $defaults['total_amount'] = CRM_Utils_Money::formatLocaleNumericRoundedForDefaultCurrency(abs($this->amountDue));
+ if ($this->isARefund()) {
+ if ($this->amountDue < 0) {
+ $defaults['total_amount'] = CRM_Utils_Money::formatLocaleNumericRoundedForDefaultCurrency(abs($this->amountDue));
+ }
}
- elseif ($this->_owed && $this->amountDue > 0) {
+ elseif ($this->_owed) {
$defaults['total_amount'] = CRM_Utils_Money::formatLocaleNumericRoundedForDefaultCurrency($this->_owed);
}
$attributes['fee_amount']
);
$this->addRule('fee_amount', ts('Please enter a valid monetary value for Fee Amount.'), 'money');
+ $buttonName = $this->isARefund() ? ts('Record Refund') : ts('Record Payment');
+ }
+ else {
+ $buttonName = ts('Submit Payment');
}
- $buttonName = $this->isARefund() ? ts('Record Refund') : ts('Record Payment');
$this->addButtons([
[
'type' => 'upload',
<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} {$form.total_amount.html|crmAddClass:eight}</span> <span class="status">{if $paymentType EQ 'refund' || $paymentAmt < 0}{ts}Refund Due : {$absolutePaymentAmount|crmMoney} {/ts}{else}{ts}Balance Owed{/ts} : {$paymentAmt|crmMoney}{/if}</span>
+ <span id='totalAmount'>{$form.currency.html|crmAddClass:eight} {$form.total_amount.html|crmAddClass:eight}</span> <span class="status">{if $paymentAmt < 0}{ts}Refund Due : {$absolutePaymentAmount|crmMoney} {/ts}{else}{ts}Balance Owed{/ts} : {$paymentAmt|crmMoney}{/if}</span>
</td>
{if $email and $outBound_option != 2}
<tr class="crm-payment-form-block-is_email_receipt">