2 +--------------------------------------------------------------------+
3 | CiviCRM version 4.5 |
4 +--------------------------------------------------------------------+
5 | Copyright CiviCRM LLC (c) 2004-2014 |
6 +--------------------------------------------------------------------+
7 | This file is a part of CiviCRM. |
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. |
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. |
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 +--------------------------------------------------------------------+
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. *}
34 <strong>{ts}Participant {$priceset+1}{/ts}</strong> {$part.$priceset.info}
37 <tr class="columnheader">
38 <th>{ts}Item{/ts}</th>
39 {if $context EQ "Membership"}
40 <th class="right">{ts}Fee{/ts}</th>
42 <th class="right">{ts}Qty{/ts}</th>
43 <th class="right">{ts}Unit Price{/ts}</th>
45 <th class="right">{ts}Total Price{/ts}</th>
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>
56 {if $pricesetFieldsCount}
57 <th class="right">{ts}Total Participants{/ts}</th>{/if}
59 {foreach from=$value item=line}
61 <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>
62 {if $context NEQ "Membership"}
63 <td class="right">{$line.qty}</td>
64 <td class="right">{$line.unit_price|crmMoney}</td>
66 <td class="right">{$line.line_total|crmMoney}</td>
68 {if !$totalTaxAmount && $context NEQ "Membership"}
69 <td class="right">{$line.line_total|crmMoney}</td>
72 <td class="right">{$line.line_total-$line.tax_amount|crmMoney}</td>
73 {if $line.tax_rate != ""}
74 {if $line.tax_rate == 0}
75 <td class="right">{ts}VAT(exempt){/ts}</td>
77 <td class="right">{ts}VAT{/ts}({$line.tax_rate|string_format:"%.2f"}%)</td>
79 <td class="right">{$line.tax_amount|crmMoney}</td>
80 {elseif $line.tax_amount != ''}
81 <td class="right">{ts}VAT(exempt){/ts}</td>
82 <td class="right">{$line.tax_amount|crmMoney}</td>
87 <td class="right">{$line.line_total|crmMoney}</td>
89 {if $pricesetFieldsCount}<td class="right">{$line.participant_count}</td> {/if}
96 <div class="crm-section no-label total_amount-section">
97 <div class="content bold">
99 {ts}Total Tax Amount{/ts}: {$totalTaxAmount|crmMoney}<br />
101 {if $context EQ "Contribution"}
102 {ts}Contribution Total{/ts}:
103 {elseif $context EQ "Event"}
105 {ts}Event SubTotal: {$totalAmount-$totalTaxAmount|crmMoney}{/ts}<br />
108 {elseif $context EQ "Membership"}
109 {ts}Membership Fee Total{/ts}:
111 {ts}Total Amount{/ts}:
113 {$totalAmount|crmMoney}
115 <div class="clear"></div>
116 <div class="content bold">
117 {if $pricesetFieldsCount}
118 {ts}Total Participants{/ts}:
119 {foreach from=$lineItem item=pcount}
120 {if $pcount neq 'skip'}
121 {assign var="lineItemCount" value=0}
123 {foreach from=$pcount item=p_count}
124 {assign var="lineItemCount" value=$lineItemCount+$p_count.participant_count}
126 {if $lineItemCount < 1 }
127 {assign var="lineItemCount" value=1}
129 {assign var="totalcount" value=$totalcount+$lineItemCount}
135 <div class="clear"></div>
138 {if $hookDiscount.message}
139 <div class="crm-section hookDiscount-section">
140 <em>({$hookDiscount.message})</em>
144 <script type="text/javascript">
145 cj(document).ready(function($) {
147 var comma = '{$config->monetaryThousandSeparator}';
148 var dot = '{$config->monetaryDecimalPoint}';
149 var format = '{$config->moneyformat}';
150 var currency = '{$currency}';
151 var currencySymbol = '{$currencySymbol}';
153 // Todo: This function should be a utility
154 function moneyFormat(amount) {
155 amount = parseFloat(amount).toFixed(2);
156 amount = amount.replace(',', 'comma').replace('.', 'dot');
157 amount = amount.replace('comma', comma).replace('dot', dot);
158 return format.replace('%C', currency).replace('%c', currencySymbol).replace('%a', amount);