Commit | Line | Data |
---|---|---|
6a488035 TO |
1 | {* |
2 | +--------------------------------------------------------------------+ | |
2c4c49ca | 3 | | CiviCRM version 4.7 | |
6a488035 | 4 | +--------------------------------------------------------------------+ |
e7112fa7 | 5 | | Copyright CiviCRM LLC (c) 2004-2015 | |
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 | ||
27 | {* Displays contribution/event fees when price set is used. *} | |
28 | {foreach from=$lineItem item=value key=priceset} | |
29 | {if $value neq 'skip'} | |
30 | {if $lineItem|@count GT 1} {* Header for multi participant registration cases. *} | |
31 | {if $priceset GT 0} | |
32 | <br /> | |
33 | {/if} | |
34 | <strong>{ts}Participant {$priceset+1}{/ts}</strong> {$part.$priceset.info} | |
35 | {/if} | |
36 | <table> | |
d7266ca8 | 37 | <tr class="columnheader"> |
152ff8b9 | 38 | <th>{ts}Item{/ts}</th> |
d7266ca8 DG |
39 | {if $context EQ "Membership"} |
40 | <th class="right">{ts}Fee{/ts}</th> | |
41 | {else} | |
42 | <th class="right">{ts}Qty{/ts}</th> | |
43 | <th class="right">{ts}Unit Price{/ts}</th> | |
24f81279 | 44 | {if !$getTaxDetails} |
45 | <th class="right">{ts}Total Price{/ts}</th> | |
46 | {/if} | |
a32709be | 47 | {/if} |
a32709be | 48 | |
03b412ae | 49 | {if $getTaxDetails} |
a32709be PB |
50 | <th class="right">{ts}Subtotal{/ts}</th> |
51 | <th class="right">{ts}Tax Rate{/ts}</th> | |
52 | <th class="right">{ts}Tax Amount{/ts}</th> | |
53 | <th class="right">{ts}Total Amount{/ts}</th> | |
54 | {/if} | |
152ff8b9 | 55 | |
d7266ca8 DG |
56 | {if $pricesetFieldsCount} |
57 | <th class="right">{ts}Total Participants{/ts}</th> | |
58 | {/if} | |
59 | </tr> | |
60 | {foreach from=$value item=line} | |
61 | <tr{if $line.qty EQ 0} class="cancelled"{/if}> | |
62 | <td>{if $line.html_type eq 'Text'}{$line.label}{else}{$line.field_title} - {$line.label}{/if} {if $line.description}<div class="description">{$line.description}</div>{/if}</td> | |
63 | {if $context NEQ "Membership"} | |
64 | <td class="right">{$line.qty}</td> | |
65 | <td class="right">{$line.unit_price|crmMoney}</td> | |
d75f2f47 | 66 | {else} |
24f81279 | 67 | <td class="right">{$line.line_total|crmMoney}</td> |
d7266ca8 | 68 | {/if} |
d75f2f47 EM |
69 | {if !$getTaxDetails && $context NEQ "Membership"} |
70 | <td class="right">{$line.line_total|crmMoney}</td> | |
71 | {/if} | |
72 | {if $getTaxDetails} | |
73 | <td class="right">{$line.line_total|crmMoney}</td> | |
74 | {if $line.tax_rate != "" || $line.tax_amount != ""} | |
75 | <td class="right">{$taxTerm} ({$line.tax_rate|string_format:"%.2f"}%)</td> | |
76 | <td class="right">{$line.tax_amount|crmMoney}</td> | |
77 | {else} | |
78 | <td></td> | |
79 | <td></td> | |
80 | {/if} | |
81 | <td class="right">{$line.line_total+$line.tax_amount|crmMoney}</td> | |
82 | {/if} | |
d7266ca8 DG |
83 | {if $pricesetFieldsCount} |
84 | <td class="right">{$line.participant_count}</td> | |
85 | {/if} | |
86 | </tr> | |
87 | {/foreach} | |
6a488035 | 88 | </table> |
d7266ca8 | 89 | {/if} |
6a488035 TO |
90 | {/foreach} |
91 | ||
92 | <div class="crm-section no-label total_amount-section"> | |
d7266ca8 | 93 | <div class="content bold"> |
24f81279 | 94 | {if $getTaxDetails && $totalTaxAmount} |
95 | {ts}Total Tax Amount{/ts}: {$totalTaxAmount|crmMoney}<br /> | |
96 | {/if} | |
d7266ca8 DG |
97 | {if $context EQ "Contribution"} |
98 | {ts}Contribution Total{/ts}: | |
99 | {elseif $context EQ "Event"} | |
24f81279 | 100 | {if $totalTaxAmount} |
101 | {ts}Event SubTotal: {$totalAmount-$totalTaxAmount|crmMoney}{/ts}<br /> | |
a32709be | 102 | {/if} |
d7266ca8 DG |
103 | {ts}Event Total{/ts}: |
104 | {elseif $context EQ "Membership"} | |
105 | {ts}Membership Fee Total{/ts}: | |
106 | {else} | |
107 | {ts}Total Amount{/ts}: | |
108 | {/if} | |
6a488035 | 109 | {$totalAmount|crmMoney} |
d7266ca8 DG |
110 | </div> |
111 | <div class="clear"></div> | |
112 | <div class="content bold"> | |
113 | {if $pricesetFieldsCount} | |
6a488035 TO |
114 | {ts}Total Participants{/ts}: |
115 | {foreach from=$lineItem item=pcount} | |
116 | {if $pcount neq 'skip'} | |
117 | {assign var="lineItemCount" value=0} | |
118 | ||
119 | {foreach from=$pcount item=p_count} | |
120 | {assign var="lineItemCount" value=$lineItemCount+$p_count.participant_count} | |
121 | {/foreach} | |
122 | {if $lineItemCount < 1 } | |
123 | {assign var="lineItemCount" value=1} | |
124 | {/if} | |
125 | {assign var="totalcount" value=$totalcount+$lineItemCount} | |
126 | {/if} | |
127 | {/foreach} | |
128 | {$totalcount} | |
d7266ca8 DG |
129 | {/if} |
130 | </div> | |
131 | <div class="clear"></div> | |
6a488035 TO |
132 | </div> |
133 | ||
134 | {if $hookDiscount.message} | |
135 | <div class="crm-section hookDiscount-section"> | |
d7266ca8 | 136 | <em>({$hookDiscount.message})</em> |
6a488035 TO |
137 | </div> |
138 | {/if} | |
139 | {literal} | |
140 | <script type="text/javascript"> | |
32678ccb | 141 | CRM.$(function($) { |
6a488035 TO |
142 | {/literal} |
143 | var comma = '{$config->monetaryThousandSeparator}'; | |
144 | var dot = '{$config->monetaryDecimalPoint}'; | |
145 | var format = '{$config->moneyformat}'; | |
146 | var currency = '{$currency}'; | |
147 | var currencySymbol = '{$currencySymbol}'; | |
152ff8b9 | 148 | {literal} |
6a488035 TO |
149 | // Todo: This function should be a utility |
150 | function moneyFormat(amount) { | |
151 | amount = parseFloat(amount).toFixed(2); | |
152 | amount = amount.replace(',', 'comma').replace('.', 'dot'); | |
153 | amount = amount.replace('comma', comma).replace('dot', dot); | |
154 | return format.replace('%C', currency).replace('%c', currencySymbol).replace('%a', amount); | |
155 | }}); | |
156 | </script> | |
157 | {/literal} |