2 +--------------------------------------------------------------------+
4 +--------------------------------------------------------------------+
5 | Copyright CiviCRM LLC (c) 2004-2018 |
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 {if !$currency && $fee_currency}
29 {assign var=currency value="$fee_currency"}
32 {foreach from=$lineItem item=value key=priceset}
33 {if $value neq 'skip'}
34 {if $lineItem|@count GT 1} {* Header for multi participant registration cases. *}
38 <strong>{ts}Participant {$priceset+1}{/ts}</strong> {$part.$priceset.info}
41 <tr class="columnheader">
42 <th>{ts}Item{/ts}</th>
43 {if $displayLineItemFinancialType}
44 <th>{ts}Financial Type{/ts}</th>
46 {if $context EQ "Membership"}
47 <th class="right">{ts}Fee{/ts}</th>
49 <th class="right">{ts}Qty{/ts}</th>
50 <th class="right">{ts}Unit Price{/ts}</th>
52 <th class="right">{ts}Total Price{/ts}</th>
57 <th class="right">{ts}Subtotal{/ts}</th>
58 <th class="right">{ts}Tax Rate{/ts}</th>
59 <th class="right">{ts}Tax Amount{/ts}</th>
60 <th class="right">{ts}Total Amount{/ts}</th>
63 {if $pricesetFieldsCount}
64 <th class="right">{ts}Total Participants{/ts}</th>
67 {foreach from=$value item=line}
68 <tr{if $line.qty EQ 0} class="cancelled"{/if}>
69 <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>
70 {if $displayLineItemFinancialType}
71 <td>{$line.financial_type}</td>
73 {if $context NEQ "Membership"}
74 <td class="right">{$line.qty}</td>
75 <td class="right">{$line.unit_price|crmMoney:$currency}</td>
77 <td class="right">{$line.line_total|crmMoney:$currency}</td>
79 {if !$getTaxDetails && $context NEQ "Membership"}
80 <td class="right">{$line.line_total|crmMoney:$currency}</td>
83 <td class="right">{$line.line_total|crmMoney:$currency}</td>
84 {if $line.tax_rate != "" || $line.tax_amount != ""}
85 <td class="right">{$taxTerm} ({$line.tax_rate}%)</td>
86 <td class="right">{$line.tax_amount|crmMoney:$currency}</td>
91 <td class="right">{$line.line_total+$line.tax_amount|crmMoney:$currency}</td>
93 {if $pricesetFieldsCount}
94 <td class="right">{$line.participant_count}</td>
102 <div class="crm-section no-label total_amount-section">
103 <div class="content bold">
104 {if $getTaxDetails && $totalTaxAmount}
105 {ts 1=$taxTerm}Total %1 Amount{/ts}: {$totalTaxAmount|crmMoney:$currency}<br />
107 {if $context EQ "Contribution"}
108 {ts}Contribution Total{/ts}:
109 {elseif $context EQ "Event"}
111 {ts}Event SubTotal: {$totalAmount-$totalTaxAmount|crmMoney:$currency}{/ts}<br />
113 {ts}Event Total{/ts}:
114 {elseif $context EQ "Membership"}
115 {ts}Membership Fee Total{/ts}:
117 {ts}Total Amount{/ts}:
119 {$totalAmount|crmMoney:$currency}
121 <div class="clear"></div>
122 <div class="content bold">
123 {if $pricesetFieldsCount}
124 {ts}Total Participants{/ts}:
125 {foreach from=$lineItem item=pcount}
126 {if $pcount neq 'skip'}
127 {assign var="lineItemCount" value=0}
129 {foreach from=$pcount item=p_count}
130 {assign var="lineItemCount" value=$lineItemCount+$p_count.participant_count}
132 {if $lineItemCount < 1 }
133 {assign var="lineItemCount" value=1}
135 {assign var="totalcount" value=$totalcount+$lineItemCount}
141 <div class="clear"></div>
144 {if $hookDiscount.message}
145 <div class="crm-section hookDiscount-section">
146 <em>({$hookDiscount.message})</em>
150 <script type="text/javascript">
153 var comma = '{$config->monetaryThousandSeparator}';
154 var dot = '{$config->monetaryDecimalPoint}';
155 var format = '{$config->moneyformat}';
156 var currency = '{$currency}';
157 var currencySymbol = '{$currencySymbol}';
159 // Todo: This function should be a utility
160 function moneyFormat(amount) {
161 amount = parseFloat(amount).toFixed(2);
162 amount = amount.replace(',', 'comma').replace('.', 'dot');
163 amount = amount.replace('comma', comma).replace('dot', dot);
164 return format.replace('%C', currency).replace('%c', currencySymbol).replace('%a', amount);