2 +--------------------------------------------------------------------+
3 | Copyright CiviCRM LLC. All rights reserved. |
5 | This work is published under the GNU AGPLv3 license with some |
6 | permitted exceptions and without any warranty. For full license |
7 | and copyright information, see https://civicrm.org/licensing |
8 +--------------------------------------------------------------------+
11 {* Displays contribution/event fees when price set is used. *}
12 {if !$currency && $fee_currency}
13 {assign var=currency value="$fee_currency"}
16 {foreach from=$lineItem item=value key=priceset}
17 {if $value neq 'skip'}
18 {if $lineItem|@count GT 1} {* Header for multi participant registration cases. *}
22 <strong>{ts}Participant {$priceset+1}{/ts}</strong> {$part.$priceset.info}
25 <tr class="columnheader">
26 <th>{ts}Item{/ts}</th>
27 {if $displayLineItemFinancialType}
28 <th>{ts}Financial Type{/ts}</th>
30 {if $context EQ "Membership"}
31 <th class="right">{ts}Fee{/ts}</th>
33 <th class="right">{ts}Qty{/ts}</th>
34 <th class="right">{ts}Unit Price{/ts}</th>
36 <th class="right">{ts}Total Price{/ts}</th>
41 <th class="right">{ts}Subtotal{/ts}</th>
42 <th class="right">{ts}Tax Rate{/ts}</th>
43 <th class="right">{ts}Tax Amount{/ts}</th>
44 <th class="right">{ts}Total Amount{/ts}</th>
47 {if $pricesetFieldsCount}
48 <th class="right">{ts}Total Participants{/ts}</th>
51 {foreach from=$value item=line}
52 <tr{if $line.qty EQ 0} class="cancelled"{/if}>
53 <td>{if $line.field_title && $line.html_type neq 'Text'}{$line.field_title} – {$line.label}{else}{$line.label}{/if} {if $line.description}<div class="description">{$line.description}</div>{/if}</td>
54 {if $displayLineItemFinancialType}
55 <td>{$line.financial_type}</td>
57 {if $context NEQ "Membership"}
58 <td class="right">{$line.qty}</td>
59 <td class="right">{$line.unit_price|crmMoney:$currency}</td>
61 <td class="right">{$line.line_total|crmMoney:$currency}</td>
63 {if !$getTaxDetails && $context NEQ "Membership"}
64 <td class="right">{$line.line_total|crmMoney:$currency}</td>
67 <td class="right">{$line.line_total|crmMoney:$currency}</td>
68 {if $line.tax_rate != "" || $line.tax_amount != ""}
69 <td class="right">{$taxTerm} ({$line.tax_rate}%)</td>
70 <td class="right">{$line.tax_amount|crmMoney:$currency}</td>
75 <td class="right">{$line.line_total+$line.tax_amount|crmMoney:$currency}</td>
77 {if $pricesetFieldsCount}
78 <td class="right">{$line.participant_count}</td>
86 <div class="crm-section no-label total_amount-section">
87 <div class="content bold">
88 {if $getTaxDetails && $totalTaxAmount}
89 {ts 1=$taxTerm}Total %1 Amount{/ts}: {$totalTaxAmount|crmMoney:$currency}<br />
91 {if $context EQ "Contribution"}
92 {ts}Contribution Total{/ts}:
93 {elseif $context EQ "Event"}
95 {ts}Event SubTotal: {$totalAmount-$totalTaxAmount|crmMoney:$currency}{/ts}<br />
98 {elseif $context EQ "Membership"}
99 {ts}Membership Fee Total{/ts}:
101 {ts}Total Amount{/ts}:
103 {$totalAmount|crmMoney:$currency}
105 <div class="clear"></div>
106 <div class="content bold">
107 {if $pricesetFieldsCount}
108 {ts}Total Participants{/ts}:
109 {foreach from=$lineItem item=pcount}
110 {if $pcount neq 'skip'}
111 {assign var="lineItemCount" value=0}
113 {foreach from=$pcount item=p_count}
114 {assign var="intPCount" value=$p_count.participant_count|intval}
115 {assign var="lineItemCount" value=$lineItemCount+$intPCount}
117 {if $lineItemCount < 1 }
118 {assign var="lineItemCount" value=1}
120 {assign var="totalcount" value=$totalcount+$lineItemCount}
126 <div class="clear"></div>
129 {if $hookDiscount && $hookDiscount.message}
130 <div class="crm-section hookDiscount-section">
131 <em>({$hookDiscount.message})</em>
135 <script type="text/javascript">
138 var comma = '{$config->monetaryThousandSeparator}';
139 var dot = '{$config->monetaryDecimalPoint}';
140 var format = '{$config->moneyformat}';
141 var currency = '{$currency}';
142 var currencySymbol = '{$currencySymbol}';
144 // Todo: This function should be a utility
145 function moneyFormat(amount) {
146 amount = parseFloat(amount).toFixed(2);
147 amount = amount.replace(',', 'comma').replace('.', 'dot');
148 amount = amount.replace('comma', comma).replace('dot', dot);
149 return format.replace('%C', currency).replace('%c', currencySymbol).replace('%a', amount);