Merge pull request #4935 from atif-shaikh/CRM-15804
[civicrm-core.git] / templates / CRM / Pledge / Page / Payment.tpl
CommitLineData
6a488035
TO
1{*
2 +--------------------------------------------------------------------+
39de6fd5 3 | CiviCRM version 4.6 |
6a488035 4 +--------------------------------------------------------------------+
819d0d41 5 | Copyright CiviCRM LLC (c) 2004-2014 |
6a488035
TO
6 +--------------------------------------------------------------------+
7 | This file is a part of CiviCRM. |
8 | |
9 | CiviCRM is free software; you can copy, modify, and distribute it |
10 | under the terms of the GNU Affero General Public License |
11 | Version 3, 19 November 2007 and the CiviCRM Licensing Exception. |
12 | |
13 | CiviCRM is distributed in the hope that it will be useful, but |
14 | WITHOUT ANY WARRANTY; without even the implied warranty of |
15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
16 | See the GNU Affero General Public License for more details. |
17 | |
18 | You should have received a copy of the GNU Affero General Public |
19 | License and the CiviCRM Licensing Exception along |
20 | with this program; if not, contact CiviCRM LLC |
21 | at info[AT]civicrm[DOT]org. If you have questions about the |
22 | GNU Affero General Public License or the licensing of CiviCRM, |
23 | see the CiviCRM license FAQ at http://civicrm.org/licensing |
24 +--------------------------------------------------------------------+
25*}
26{if $action eq 2 } {* update *}
27 {include file="CRM/Pledge/Form/Payment.tpl"}
28{else}
29{if $context eq 'dashboard'}{assign var='context' value='pledgeDashboard'}{/if}
30<table class="nestedSelector">
31 <tr class="columnheader">
32 <th>{ts}Amount Due{/ts}</th>
33 <th>{ts}Due Date{/ts}</th>
34 <th>{ts}Amount Paid{/ts}</th>
35 <th>{ts}Paid Date{/ts}</th>
36 <th>{ts}Last Reminder{/ts}</th>
37 <th>{ts}Reminders Sent{/ts}</th>
38 <th colspan="2">{ts}Status{/ts}</th>
39 </tr>
40
41 {foreach from=$rows item=row}
42 <tr class="{cycle values="odd-row,even-row"} {if $row.status eq 'Overdue' } status-overdue{/if}">
43 <td class="right">{$row.scheduled_amount|crmMoney:$row.currency}</td>
44 <td>{$row.scheduled_date|truncate:10:''|crmDate}</td>
45 <td class="right">{$row.total_amount|crmMoney:$row.currency}</td>
46 <td>{$row.receive_date|truncate:10:''|crmDate}</td>
47 <td>{$row.reminder_date|truncate:10:''|crmDate}</td>
48 <td class="right">{if $row.reminder_count}{$row.reminder_count}{/if}</td>
49 <td {if ! ($permission EQ 'edit' and ($row.status eq 'Pending' or $row.status eq 'Overdue' or $row.status eq 'Completed')) } colspan="2"{/if} >{$row.label}</td>
50{if $context neq user}
51 {if $permission EQ 'edit' and ($row.status eq 'Pending' or $row.status eq 'Overdue' or $row.status eq 'Completed') }
e2046b33 52 <td class="nowrap">
6a488035
TO
53 {if $row.status eq 'Completed'} {* Link to view contribution record for completed payment.*}
54 {capture assign=viewContribURL}{crmURL p="civicrm/contact/view/contribution" q="reset=1&id=`$row.contribution_id`&cid=`$contactId`&action=view&context=`$context`"}{/capture}
e2046b33 55 <a class="crm-hover-button action-item" href="{$viewContribURL}">{ts}View Payment{/ts}</a>
6a488035
TO
56 {else} {* Links to record / submit a payment. *}
57 {capture assign=newContribURL}{crmURL p="civicrm/contact/view/contribution" q="reset=1&action=add&cid=`$contactId`&context=`$context`&ppid=`$row.id`"}{/capture}
5fffbbe4 58 <a class="open-inline-noreturn crm-hover-button action-item" href="{$newContribURL}">{ts}Record Payment{/ts}</a>
6a488035 59 {if $newCredit}
6a488035 60 {capture assign=newCreditURL}{crmURL p="civicrm/contact/view/contribution" q="reset=1&action=add&cid=`$contactId`&ppid=`$row.id`&context=`$context`&mode=live"}{/capture}
5fffbbe4 61 <a class="open-inline-noreturn action-item crm-hover-button" href="{$newCreditURL}">{ts}Credit Card Payment{/ts}</a>
6a488035 62 {/if}
6a488035 63 {capture assign=editURL}{crmURL p="civicrm/pledge/payment" q="reset=1&action=update&cid=`$contactId`&context=`$context`&ppId=`$row.id`"}{/capture}
e2046b33 64 <a class="crm-hover-button action-item" href="{$editURL}">{ts}Edit Scheduled Payment{/ts}</a>
6a488035
TO
65 {/if}
66 </td>
67 {/if}
68{/if}
69 </tr>
70 {/foreach}
71</table>
232624b1 72{/if}