2 +--------------------------------------------------------------------+
3 | CiviCRM version 4.7 |
4 +--------------------------------------------------------------------+
5 | Copyright CiviCRM LLC (c) 2004-2016 |
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 $displayLineItemFinancialType}
40 <th>{ts}Financial Type{/ts}</th>
42 {if $context EQ "Membership"}
43 <th class="right">{ts}Fee{/ts}</th>
45 <th class="right">{ts}Qty{/ts}</th>
46 <th class="right">{ts}Unit Price{/ts}</th>
48 <th class="right">{ts}Total Price{/ts}</th>
53 <th class="right">{ts}Subtotal{/ts}</th>
54 <th class="right">{ts}Tax Rate{/ts}</th>
55 <th class="right">{ts}Tax Amount{/ts}</th>
56 <th class="right">{ts}Total Amount{/ts}</th>
59 {if $pricesetFieldsCount}
60 <th class="right">{ts}Total Participants{/ts}</th>
63 {foreach from=$value item=line}
64 <tr{if $line.qty EQ 0} class="cancelled"{/if}>
65 <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>
66 {if $displayLineItemFinancialType}
67 <td>{$line.financial_type}</td>
69 {if $context NEQ "Membership"}
70 <td class="right">{$line.qty}</td>
71 <td class="right">{$line.unit_price|crmMoney}</td>
73 <td class="right">{$line.line_total|crmMoney}</td>
75 {if !$getTaxDetails && $context NEQ "Membership"}
76 <td class="right">{$line.line_total|crmMoney}</td>
79 <td class="right">{$line.line_total|crmMoney}</td>
80 {if $line.tax_rate != "" || $line.tax_amount != ""}
81 <td class="right">{$taxTerm} ({$line.tax_rate|string_format:"%.2f"}%)</td>
82 <td class="right">{$line.tax_amount|crmMoney}</td>
87 <td class="right">{$line.line_total+$line.tax_amount|crmMoney}</td>
89 {if $pricesetFieldsCount}
90 <td class="right">{$line.participant_count}</td>
98 <div class="crm-section no-label total_amount-section">
99 <div class="content bold">
100 {if $getTaxDetails && $totalTaxAmount}
101 {ts}Total Tax Amount{/ts}: {$totalTaxAmount|crmMoney}<br />
103 {if $context EQ "Contribution"}
104 {ts}Contribution Total{/ts}:
105 {elseif $context EQ "Event"}
107 {ts}Event SubTotal: {$totalAmount-$totalTaxAmount|crmMoney}{/ts}<br />
109 {ts}Event Total{/ts}:
110 {elseif $context EQ "Membership"}
111 {ts}Membership Fee Total{/ts}:
113 {ts}Total Amount{/ts}:
115 {$totalAmount|crmMoney}
117 <div class="clear"></div>
118 <div class="content bold">
119 {if $pricesetFieldsCount}
120 {ts}Total Participants{/ts}:
121 {foreach from=$lineItem item=pcount}
122 {if $pcount neq 'skip'}
123 {assign var="lineItemCount" value=0}
125 {foreach from=$pcount item=p_count}
126 {assign var="lineItemCount" value=$lineItemCount+$p_count.participant_count}
128 {if $lineItemCount < 1 }
129 {assign var="lineItemCount" value=1}
131 {assign var="totalcount" value=$totalcount+$lineItemCount}
137 <div class="clear"></div>
140 {if $hookDiscount.message}
141 <div class="crm-section hookDiscount-section">
142 <em>({$hookDiscount.message})</em>
146 <script type="text/javascript">
149 var comma = '{$config->monetaryThousandSeparator}';
150 var dot = '{$config->monetaryDecimalPoint}';
151 var format = '{$config->moneyformat}';
152 var currency = '{$currency}';
153 var currencySymbol = '{$currencySymbol}';
155 // Todo: This function should be a utility
156 function moneyFormat(amount) {
157 amount = parseFloat(amount).toFixed(2);
158 amount = amount.replace(',', 'comma').replace('.', 'dot');
159 amount = amount.replace('comma', comma).replace('dot', dot);
160 return format.replace('%C', currency).replace('%c', currencySymbol).replace('%a', amount);