CRM-16320 - Multiple Registration Confirmation Email does not shows individual sums
authoratif-shaikh <shaikh388@gmail.com>
Mon, 4 May 2015 12:28:41 +0000 (17:58 +0530)
committeratif-shaikh <shaikh388@gmail.com>
Tue, 5 May 2015 06:12:47 +0000 (11:42 +0530)
https://issues.civicrm.org/jira/browse/CRM-16320

CRM/Event/Form/Registration/Confirm.php
CRM/Event/Form/Registration/ThankYou.php
CRM/Upgrade/4.6.3.msg_template/civicrm_msg_template.tpl [new file with mode: 0644]
CRM/Upgrade/4.6.3.msg_template/message_templates/event_online_receipt_html.tpl [new file with mode: 0644]
CRM/Upgrade/4.6.3.msg_template/message_templates/event_online_receipt_text.tpl [new file with mode: 0644]
CRM/Upgrade/Incremental/sql/4.6.3.mysql.tpl
xml/templates/message_templates/event_online_receipt_html.tpl
xml/templates/message_templates/event_online_receipt_text.tpl

index 8075840714f513bedccb464c117cc887f879b090..08c6ce521f7de8119222852b5e8a38309241a255 100644 (file)
@@ -234,6 +234,7 @@ class CRM_Event_Form_Registration_Confirm extends CRM_Event_Form_Registration {
 
       $taxAmount = 0;
       foreach ($this->_params as $k => $v) {
+        $individualTaxAmount = 0;
         //display tax amount on confirmation page
         $taxAmount += $v['tax_amount'];
         if (is_array($v)) {
@@ -270,6 +271,10 @@ class CRM_Event_Form_Registration_Confirm extends CRM_Event_Form_Registration {
           if (empty($v['first_name'])) {
             $this->_part[$k]['info'] = $append;
           }
+
+          /*CRM-16320 */
+          $individual[$k]['totalAmtWithTax'] = $this->_amount[$k]['amount'];
+          $individual[$k]['totalTaxAmt'] = $individualTaxAmount + $v['tax_amount'];
           $this->_totalAmount = $this->_totalAmount + $this->_amount[$k]['amount'];
           if (!empty($v['is_primary'])) {
             $this->set('primaryParticipantAmount', $this->_amount[$k]['amount']);
@@ -283,7 +288,10 @@ class CRM_Event_Form_Registration_Confirm extends CRM_Event_Form_Registration {
       if ($invoicing) {
         $this->assign('totalTaxAmount', $taxAmount);
         $this->assign('taxTerm', $taxTerm);
+        $this->assign('individual', $individual);
+        $this->set('individual', $individual);
       }
+
       $this->assign('part', $this->_part);
       $this->set('part', $this->_part);
       $this->assign('amounts', $this->_amount);
@@ -936,6 +944,14 @@ class CRM_Event_Form_Registration_Confirm extends CRM_Event_Form_Registration {
             if ($lineItemValue = CRM_Utils_Array::value($participantNum, $lineItems)) {
               $lineItem[] = $lineItemValue;
             }
+            if ($invoicing) {
+              $individual = $this->get('individual');
+              $dataArray[key($dataArray)] = $individual[$participantNum]['totalTaxAmt'];
+              $this->assign('dataArray', $dataArray);
+              $this->assign('totalAmount', $individual[$participantNum]['totalAmtWithTax']);
+              $this->assign('totalTaxAmount', $individual[$participantNum]['totalTaxAmt']);
+              $this->assign('individual', array($individual[$participantNum]));
+            }
             $this->assign('lineItem', $lineItem);
           }
           $this->_values['params']['additionalParticipant'] = TRUE;
index 84272298ccac043a79d4c0764d538cc4f518c7fb..f99c4586322229a25522128546d8e4e41fa74296 100644 (file)
@@ -60,6 +60,7 @@ class CRM_Event_Form_Registration_ThankYou extends CRM_Event_Form_Registration {
     $this->assign('participantInfo', $participantInfo);
     $customGroup = $this->get('customProfile');
     $this->assign('customProfile', $customGroup);
+    $this->assign('individual', $this->get('individual'));
 
     CRM_Event_Form_Registration_Confirm::assignProfiles($this);
 
diff --git a/CRM/Upgrade/4.6.3.msg_template/civicrm_msg_template.tpl b/CRM/Upgrade/4.6.3.msg_template/civicrm_msg_template.tpl
new file mode 100644 (file)
index 0000000..91e0955
--- /dev/null
@@ -0,0 +1,16 @@
+{php}
+  $dir = SMARTY_DIR . '/../../CRM/Upgrade/4.6.3.msg_template/message_templates';
+  $templates = array();
+  foreach (preg_grep('/\.tpl$/', scandir($dir)) as $filename) {
+    $parts = explode('_', basename($filename, '.tpl'));
+    $templates[] = array('type' => array_pop($parts), 'name' => implode('_', $parts), 'filename' => "$dir/$filename");
+  }
+  $this->assign('templates', $templates);
+{/php}
+
+{foreach from=$templates item=tpl}
+  {fetch assign=content file=$tpl.filename}
+  SELECT @workflow_id := MAX(id) FROM civicrm_option_value WHERE name = '{$tpl.name}';
+  SELECT @content := msg_{$tpl.type} FROM civicrm_msg_template WHERE workflow_id = @workflow_id AND is_reserved = 1 LIMIT 1;
+  UPDATE civicrm_msg_template SET msg_{$tpl.type} = '{$content|escape:"quotes"}' WHERE workflow_id = @workflow_id AND (is_reserved = 1 OR (is_default = 1 AND msg_{$tpl.type} = @content));
+{/foreach}
diff --git a/CRM/Upgrade/4.6.3.msg_template/message_templates/event_online_receipt_html.tpl b/CRM/Upgrade/4.6.3.msg_template/message_templates/event_online_receipt_html.tpl
new file mode 100644 (file)
index 0000000..4de0179
--- /dev/null
@@ -0,0 +1,518 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <title></title>
+</head>
+<body>
+
+{capture assign=headerStyle}colspan="2" style="text-align: left; padding: 4px; border-bottom: 1px solid #999; background-color: #eee;"{/capture}
+{capture assign=labelStyle }style="padding: 4px; border-bottom: 1px solid #999; background-color: #f7f7f7;"{/capture}
+{capture assign=valueStyle }style="padding: 4px; border-bottom: 1px solid #999;"{/capture}
+{capture assign=tdfirstStyle}style="width: 180px; padding-bottom: 15px;"{/capture}
+{capture assign=tdStyle}style="width: 100px;"{/capture}
+{capture assign=participantTotal}style="margin: 0.5em 0 0.5em;padding: 0.5em;background-color: #999999;font-weight: bold;color: #FAFAFA;border-radius: 2px;"{/capture}
+
+
+<center>
+ <table width="700" border="0" cellpadding="0" cellspacing="0" id="crm-event_receipt" style="font-family: Arial, Verdana, sans-serif; text-align: left;">
+
+  <!-- BEGIN HEADER -->
+  <!-- You can add table row(s) here with logo or other header elements -->
+  <!-- END HEADER -->
+
+  <!-- BEGIN CONTENT -->
+
+  <tr>
+   <td>
+  <p>Dear {contact.display_name},</p>
+
+    {if $event.confirm_email_text AND (not $isOnWaitlist AND not $isRequireApproval)}
+     <p>{$event.confirm_email_text|htmlize}</p>
+
+    {else}
+  <p>Thank you for your participation.  This letter is a confirmation that your registration has been received and your status has been updated to <strong>{if $participant_status}{$participant_status}{else}{if $isOnWaitlist}waitlisted{else}registered{/if}{/if}</strong>.</p>
+
+    {/if}
+
+    <p>
+    {if $isOnWaitlist}
+     <p>{ts}You have been added to the WAIT LIST for this event.{/ts}</p>
+     {if $isPrimary}
+       <p>{ts}If space becomes available you will receive an email with a link to a web page where you can complete your registration.{/ts}</p>
+     {/if}
+    {elseif $isRequireApproval}
+     <p>{ts}Your registration has been submitted.{/ts}</p>
+     {if $isPrimary}
+      <p>{ts}Once your registration has been reviewed, you will receive an email with a link to a web page where you can complete the registration process.{/ts}</p>
+     {/if}
+    {elseif $is_pay_later && !$isAmountzero && !$isAdditionalParticipant}
+     <p>{$pay_later_receipt}</p> {* FIXME: this might be text rather than HTML *}
+    {else}
+     <p>{ts}Please print this confirmation for your records.{/ts}</p>
+    {/if}
+
+   </td>
+  </tr>
+  <tr>
+   <td>
+    <table width="700" style="border: 1px solid #999; margin: 1em 0em 1em; border-collapse: collapse;">
+     <tr>
+      <th {$headerStyle}>
+       {ts}Event Information and Location{/ts}
+      </th>
+     </tr>
+     <tr>
+      <td colspan="2" {$valueStyle}>
+       {$event.event_title}<br />
+       {$event.event_start_date|date_format:"%A"} {$event.event_start_date|crmDate}{if $event.event_end_date}-{if $event.event_end_date|date_format:"%Y%m%d" == $event.event_start_date|date_format:"%Y%m%d"}{$event.event_end_date|crmDate:0:1}{else}{$event.event_end_date|date_format:"%A"} {$event.event_end_date|crmDate}{/if}{/if}
+      </td>
+     </tr>
+
+
+     {if $conference_sessions}
+      <tr>
+       <td colspan="2" {$labelStyle}>
+  {ts}Your schedule:{/ts}
+       </td>
+      </tr>
+      <tr>
+       <td colspan="2" {$valueStyle}>
+  {assign var='group_by_day' value='NA'}
+  {foreach from=$conference_sessions item=session}
+   {if $session.start_date|date_format:"%Y/%m/%d" != $group_by_day|date_format:"%Y/%m/%d"}
+    {assign var='group_by_day' value=$session.start_date}
+          <em>{$group_by_day|date_format:"%m/%d/%Y"}</em><br />
+   {/if}
+   {$session.start_date|crmDate:0:1}{if $session.end_date}-{$session.end_date|crmDate:0:1}{/if} {$session.title}<br />
+   {if $session.location}&nbsp;&nbsp;&nbsp;&nbsp;{$session.location}<br />{/if}
+  {/foreach}
+       </td>
+      </tr>
+     {/if}
+
+     {if $event.participant_role neq 'Attendee' and $defaultRole}
+      <tr>
+       <td {$labelStyle}>
+        {ts}Participant Role{/ts}
+       </td>
+       <td {$valueStyle}>
+        {$event.participant_role}
+       </td>
+      </tr>
+     {/if}
+
+     {if $isShowLocation}
+      <tr>
+       <td colspan="2" {$valueStyle}>
+        {if $location.address.1.name}
+         {$location.address.1.name}<br />
+        {/if}
+        {if $location.address.1.street_address}
+         {$location.address.1.street_address}<br />
+        {/if}
+        {if $location.address.1.supplemental_address_1}
+         {$location.address.1.supplemental_address_1}<br />
+        {/if}
+        {if $location.address.1.supplemental_address_2}
+         {$location.address.1.supplemental_address_2}<br />
+        {/if}
+        {if $location.address.1.city}
+         {$location.address.1.city}, {$location.address.1.state_province} {$location.address.1.postal_code}{if $location.address.1.postal_code_suffix} - {$location.address.1.postal_code_suffix}{/if}<br />
+        {/if}
+       </td>
+      </tr>
+     {/if}
+
+     {if $location.phone.1.phone || $location.email.1.email}
+      <tr>
+       <td colspan="2" {$labelStyle}>
+        {ts}Event Contacts:{/ts}
+       </td>
+      </tr>
+      {foreach from=$location.phone item=phone}
+       {if $phone.phone}
+        <tr>
+         <td {$labelStyle}>
+          {if $phone.phone_type}
+           {$phone.phone_type_display}
+          {else}
+           {ts}Phone{/ts}
+          {/if}
+         </td>
+         <td {$valueStyle}>
+          {$phone.phone} {if $phone.phone_ext}&nbsp;{ts}ext.{/ts} {$phone.phone_ext}{/if}
+         </td>
+        </tr>
+       {/if}
+      {/foreach}
+      {foreach from=$location.email item=eventEmail}
+       {if $eventEmail.email}
+        <tr>
+         <td {$labelStyle}>
+          {ts}Email{/ts}
+         </td>
+         <td {$valueStyle}>
+          {$eventEmail.email}
+         </td>
+        </tr>
+       {/if}
+      {/foreach}
+     {/if}
+
+     {if $event.is_public}
+      <tr>
+       <td colspan="2" {$valueStyle}>
+        {capture assign=icalFeed}{crmURL p='civicrm/event/ical' q="reset=1&id=`$event.id`" h=0 a=1 fe=1}{/capture}
+        <a href="{$icalFeed}">{ts}Download iCalendar File{/ts}</a>
+       </td>
+      </tr>
+     {/if}
+
+    {if $event.is_share}
+        <tr>
+            <td colspan="2" {$valueStyle}>
+                {capture assign=eventUrl}{crmURL p='civicrm/event/info' q="id=`$event.id`&reset=1" a=true fe=1 h=1}{/capture}
+                {include file="CRM/common/SocialNetwork.tpl" emailMode=true url=$eventUrl title=$event.title pageURL=$eventUrl}
+            </td>
+        </tr>
+    {/if}
+    {if $payer.name}
+     <tr>
+       <th {$headerStyle}>
+         {ts}You were registered by:{/ts}
+       </th>
+     </tr>
+     <tr>
+       <td colspan="2" {$valueStyle}>
+        {$payer.name}
+       </td>
+     </tr>
+    {/if}
+    {if $event.is_monetary}
+
+      <tr>
+       <th {$headerStyle}>
+        {$event.fee_label}
+       </th>
+      </tr>
+
+      {if $lineItem}
+       {foreach from=$lineItem item=value key=priceset}
+        {if $value neq 'skip'}
+         {if $isPrimary}
+          {if $lineItem|@count GT 1} {* Header for multi participant registration cases. *}
+           <tr>
+            <td colspan="2" {$labelStyle}>
+             {ts 1=$priceset+1}Participant %1{/ts} {$part.$priceset.info}
+            </td>
+           </tr>
+          {/if}
+         {/if}
+         <tr>
+          <td colspan="2" {$valueStyle}>
+           <table> {* FIXME: style this table so that it looks like the text version (justification, etc.) *}
+            <tr>
+             <th>{ts}Item{/ts}</th>
+             <th>{ts}Qty{/ts}</th>
+             <th>{ts}Each{/ts}</th>
+             {if $dataArray}
+              <th>{ts}SubTotal{/ts}</th>
+              <th>{ts}Tax Rate{/ts}</th>
+              <th>{ts}Tax Amount{/ts}</th>
+             {/if}
+             <th>{ts}Total{/ts}</th>
+       {if  $pricesetFieldsCount }<th>{ts}Total Participants{/ts}</th>{/if}
+            </tr>
+            {foreach from=$value item=line}
+             <tr>
+              <td {$tdfirstStyle}>
+              {if $line.html_type eq 'Text'}{$line.label}{else}{$line.field_title} - {$line.label}{/if} {if $line.description}<div>{$line.description|truncate:30:"..."}</div>{/if}
+              </td>
+              <td {$tdStyle} align="middle">
+               {$line.qty}
+              </td>
+              <td {$tdStyle}>
+               {$line.unit_price|crmMoney:$currency}
+              </td>
+              {if $dataArray}
+               <td {$tdStyle}>
+                {$line.unit_price*$line.qty|crmMoney}
+               </td>
+               {if $line.tax_rate != "" || $line.tax_amount != ""}
+                <td {$tdStyle}>
+                 {$line.tax_rate|string_format:"%.2f"}%
+                </td>
+                <td {$tdStyle}>
+                 {$line.tax_amount|crmMoney}
+                </td>
+               {else}
+                <td></td>
+                <td></td>
+               {/if}
+              {/if}
+              <td {$tdStyle}>
+               {$line.line_total+$line.tax_amount|crmMoney:$currency}
+              </td>
+        {if $pricesetFieldsCount }<td {$tdStyle}>{$line.participant_count}</td> {/if}
+             </tr>
+            {/foreach}
+            {if $individual}
+              <tr {$participantTotal}>
+                <td colspan=3>{ts}Participant Total{/ts}</td>
+                <td  colspan=2>{$individual.$priceset.totalAmtWithTax-$individual.$priceset.totalTaxAmt|crmMoney}</td>
+                <td  colspan=1>{$individual.$priceset.totalTaxAmt|crmMoney}</td>
+                <td  colspan=2>{$individual.$priceset.totalAmtWithTax|crmMoney}</td>
+              </tr>
+            {/if}
+           </table>
+          </td>
+         </tr>
+        {/if}
+       {/foreach}
+       {if $dataArray}
+        <tr>
+         <td {$labelStyle}>
+          {ts} Amount Before Tax: {/ts}
+         </td>
+         <td {$valueStyle}>
+          {$totalAmount-$totalTaxAmount|crmMoney}
+         </td>
+        </tr>
+        {foreach from=$dataArray item=value key=priceset}
+         <tr>
+          {if $priceset || $priceset == 0}
+           <td>&nbsp;{$taxTerm} {$priceset|string_format:"%.2f"}%</td>
+           <td>&nbsp;{$value|crmMoney:$currency}</td>
+          {else}
+           <td>&nbsp;{ts}No{/ts} {$taxTerm}</td>
+           <td>&nbsp;{$value|crmMoney:$currency}</td>
+          {/if}
+         </tr>
+        {/foreach}
+       {/if}
+      {/if}
+
+      {if $amounts && !$lineItem}
+       {foreach from=$amounts item=amnt key=level}
+        <tr>
+         <td colspan="2" {$valueStyle}>
+          {$amnt.amount|crmMoney:$currency} {$amnt.label}
+         </td>
+        </tr>
+       {/foreach}
+      {/if}
+
+    {if $totalTaxAmount}
+       <tr>
+        <td {$labelStyle}>
+         {ts}Total Tax Amount{/ts}
+        </td>
+        <td {$valueStyle}>
+         {$totalTaxAmount|crmMoney:$currency}
+        </td>
+       </tr>
+      {/if}
+      {if $isPrimary}
+       <tr>
+        <td {$labelStyle}>
+         {ts}Total Amount{/ts}
+        </td>
+        <td {$valueStyle}>
+         {$totalAmount|crmMoney:$currency} {if $hookDiscount.message}({$hookDiscount.message}){/if}
+        </td>
+       </tr>
+       {if $pricesetFieldsCount }
+     <tr>
+       <td {$labelStyle}>
+      {ts}Total Participants{/ts}</td>
+      <td {$valueStyle}>
+      {assign var="count" value= 0}
+      {foreach from=$lineItem item=pcount}
+      {assign var="lineItemCount" value=0}
+      {if $pcount neq 'skip'}
+        {foreach from=$pcount item=p_count}
+        {assign var="lineItemCount" value=$lineItemCount+$p_count.participant_count}
+        {/foreach}
+      {if $lineItemCount < 1 }
+        {assign var="lineItemCount" value=1}
+      {/if}
+      {assign var="count" value=$count+$lineItemCount}
+      {/if}
+      {/foreach}
+     {$count}
+     </td> </tr>
+      {/if}
+
+       {if $register_date}
+        <tr>
+         <td {$labelStyle}>
+          {ts}Registration Date{/ts}
+         </td>
+         <td {$valueStyle}>
+          {$register_date|crmDate}
+         </td>
+        </tr>
+       {/if}
+
+       {if $receive_date}
+        <tr>
+         <td {$labelStyle}>
+          {ts}Transaction Date{/ts}
+         </td>
+         <td {$valueStyle}>
+          {$receive_date|crmDate}
+         </td>
+        </tr>
+       {/if}
+
+       {if $contributionTypeName}
+        <tr>
+         <td {$labelStyle}>
+          {ts}Financial Type{/ts}
+         </td>
+         <td {$valueStyle}>
+          {$contributionTypeName}
+         </td>
+        </tr>
+       {/if}
+
+       {if $trxn_id}
+        <tr>
+         <td {$labelStyle}>
+          {ts}Transaction #{/ts}
+         </td>
+         <td {$valueStyle}>
+          {$trxn_id}
+         </td>
+        </tr>
+       {/if}
+
+       {if $paidBy}
+        <tr>
+         <td {$labelStyle}>
+          {ts}Paid By{/ts}
+         </td>
+         <td {$valueStyle}>
+         {$paidBy}
+         </td>
+        </tr>
+       {/if}
+
+       {if $checkNumber}
+        <tr>
+         <td {$labelStyle}>
+          {ts}Check Number{/ts}
+         </td>
+         <td {$valueStyle}>
+          {$checkNumber}
+         </td>
+        </tr>
+       {/if}
+
+       {if $contributeMode ne 'notify' and !$isAmountzero and (!$is_pay_later or $isBillingAddressRequiredForPayLater) and !$isOnWaitlist and !$isRequireApproval}
+        <tr>
+         <th {$headerStyle}>
+          {ts}Billing Name and Address{/ts}
+         </th>
+        </tr>
+        <tr>
+         <td colspan="2" {$valueStyle}>
+          {$billingName}<br />
+          {$address|nl2br}
+         </td>
+        </tr>
+       {/if}
+
+       {if $contributeMode eq 'direct' and !$isAmountzero and !$is_pay_later and !$isOnWaitlist and !$isRequireApproval}
+        <tr>
+         <th {$headerStyle}>
+          {ts}Credit Card Information{/ts}
+         </th>
+        </tr>
+        <tr>
+         <td colspan="2" {$valueStyle}>
+          {$credit_card_type}<br />
+          {$credit_card_number}<br />
+          {ts}Expires{/ts}: {$credit_card_exp_date|truncate:7:''|crmDate}
+         </td>
+        </tr>
+       {/if}
+
+      {/if}
+
+     {/if} {* End of conditional section for Paid events *}
+
+
+{if $customPre}
+{foreach from=$customPre item=customPr key=i}
+   <tr> <th {$headerStyle}>{$customPre_grouptitle.$i}</th></tr>
+   {foreach from=$customPr item=customValue key=customName}
+   {if ( $trackingFields and ! in_array( $customName, $trackingFields ) ) or ! $trackingFields}
+     <tr>
+         <td {$labelStyle}>{$customName}</td>
+         <td {$valueStyle}>{$customValue}</td>
+     </tr>
+   {/if}
+   {/foreach}
+{/foreach}
+{/if}
+
+{if $customPost}
+{foreach from=$customPost item=customPos key=j}
+   <tr> <th {$headerStyle}>{$customPost_grouptitle.$j}</th></tr>
+   {foreach from=$customPos item=customValue key=customName}
+   {if ( $trackingFields and ! in_array( $customName, $trackingFields ) ) or ! $trackingFields}
+     <tr>
+         <td {$labelStyle}>{$customName}</td>
+         <td {$valueStyle}>{$customValue}</td>
+     </tr>
+{/if}
+{/foreach}
+{/foreach}
+{/if}
+
+{if $customProfile}
+{foreach from=$customProfile.profile item=eachParticipant key=participantID}
+     <tr><th {$headerStyle}>{ts 1=$participantID+2}Participant %1{/ts} </th></tr>
+     {foreach from=$eachParticipant item=eachProfile key=pid}
+     <tr><th {$headerStyle}>{$customProfile.title.$pid}</th></tr>
+     {foreach from=$eachProfile item=val key=field}
+     <tr>{foreach from=$val item=v key=f}
+         <td {$labelStyle}>{$field}</td>
+         <td {$valueStyle}>{$v}</td>
+         {/foreach}
+     </tr>
+     {/foreach}
+{/foreach}
+{/foreach}
+{/if}
+
+    {if $customGroup}
+      {foreach from=$customGroup item=value key=customName}
+       <tr>
+        <th {$headerStyle}>
+         {$customName}
+        </th>
+       </tr>
+       {foreach from=$value item=v key=n}
+        <tr>
+         <td {$labelStyle}>
+          {$n}
+         </td>
+         <td {$valueStyle}>
+          {$v}
+         </td>
+        </tr>
+       {/foreach}
+      {/foreach}
+     {/if}
+
+    </table>
+   </td>
+  </tr>
+ </table>
+</center>
+
+</body>
+</html>
diff --git a/CRM/Upgrade/4.6.3.msg_template/message_templates/event_online_receipt_text.tpl b/CRM/Upgrade/4.6.3.msg_template/message_templates/event_online_receipt_text.tpl
new file mode 100644 (file)
index 0000000..8d11638
--- /dev/null
@@ -0,0 +1,305 @@
+Dear {contact.display_name},
+
+{if $event.confirm_email_text AND (not $isOnWaitlist AND not $isRequireApproval)}
+{$event.confirm_email_text}
+
+{else}
+Thank you for your participation.  This letter is a confirmation that your registration has been received and your status has been updated to {if $participant_status}{$participant_status}{else}{if $isOnWaitlist}waitlisted{else}registered{/if}{/if}.
+
+{/if}
+
+{if $isOnWaitlist}
+==========================================================={if $pricesetFieldsCount }===================={/if}
+
+{ts}You have been added to the WAIT LIST for this event.{/ts}
+
+{if $isPrimary}
+{ts}If space becomes available you will receive an email with a link to a web page where you can complete your registration.{/ts}
+{/if}
+==========================================================={if $pricesetFieldsCount }===================={/if}
+
+{elseif $isRequireApproval}
+==========================================================={if $pricesetFieldsCount }===================={/if}
+
+{ts}Your registration has been submitted.{/ts}
+
+{if $isPrimary}
+{ts}Once your registration has been reviewed, you will receive an email with a link to a web page where you can complete the registration process.{/ts}
+
+{/if}
+==========================================================={if $pricesetFieldsCount }===================={/if}
+
+{elseif $is_pay_later && !$isAmountzero && !$isAdditionalParticipant}
+
+==========================================================={if $pricesetFieldsCount }===================={/if}
+
+{$pay_later_receipt}
+==========================================================={if $pricesetFieldsCount }===================={/if}
+
+{else}
+
+{ts}Please print this confirmation for your records.{/ts}
+{/if}
+
+
+==========================================================={if $pricesetFieldsCount }===================={/if}
+
+{ts}Event Information and Location{/ts}
+
+==========================================================={if $pricesetFieldsCount }===================={/if}
+
+{$event.event_title}
+{$event.event_start_date|date_format:"%A"} {$event.event_start_date|crmDate}{if $event.event_end_date}-{if $event.event_end_date|date_format:"%Y%m%d" == $event.event_start_date|date_format:"%Y%m%d"}{$event.event_end_date|crmDate:0:1}{else}{$event.event_end_date|date_format:"%A"} {$event.event_end_date|crmDate}{/if}{/if}
+{if $conference_sessions}
+
+
+{ts}Your schedule:{/ts}
+{assign var='group_by_day' value='NA'}
+{foreach from=$conference_sessions item=session}
+{if $session.start_date|date_format:"%Y/%m/%d" != $group_by_day|date_format:"%Y/%m/%d"}
+{assign var='group_by_day' value=$session.start_date}
+
+{$group_by_day|date_format:"%m/%d/%Y"}
+
+
+{/if}
+{$session.start_date|crmDate:0:1}{if $session.end_date}-{$session.end_date|crmDate:0:1}{/if} {$session.title}
+{if $session.location}    {$session.location}{/if}
+{/foreach}
+{/if}
+
+{if $event.participant_role neq 'Attendee' and $defaultRole}
+{ts}Participant Role{/ts}: {$event.participant_role}
+{/if}
+
+{if $isShowLocation}
+{if $location.address.1.name}
+
+{$location.address.1.name}
+{/if}
+{if $location.address.1.street_address}{$location.address.1.street_address}
+{/if}
+{if $location.address.1.supplemental_address_1}{$location.address.1.supplemental_address_1}
+{/if}
+{if $location.address.1.supplemental_address_2}{$location.address.1.supplemental_address_2}
+{/if}
+{if $location.address.1.city}{$location.address.1.city}, {$location.address.1.state_province} {$location.address.1.postal_code}{if $location.address.1.postal_code_suffix} - {$location.address.1.postal_code_suffix}{/if}
+{/if}
+
+{/if}{*End of isShowLocation condition*}
+
+{if $location.phone.1.phone || $location.email.1.email}
+
+{ts}Event Contacts:{/ts}
+{foreach from=$location.phone item=phone}
+{if $phone.phone}
+
+{if $phone.phone_type}{$phone.phone_type_display}{else}{ts}Phone{/ts}{/if}: {$phone.phone}{/if} {if $phone.phone_ext} {ts}ext.{/ts} {$phone.phone_ext}{/if}
+{/foreach}
+{foreach from=$location.email item=eventEmail}
+{if $eventEmail.email}
+
+{ts}Email{/ts}: {$eventEmail.email}{/if}{/foreach}
+{/if}
+
+{if $event.is_public}
+{capture assign=icalFeed}{crmURL p='civicrm/event/ical' q="reset=1&id=`$event.id`" h=0 a=1 fe=1}{/capture}
+{ts}Download iCalendar File:{/ts} {$icalFeed}
+{/if}
+
+{if $payer.name}
+You were registered by: {$payer.name}
+{/if}
+{if $event.is_monetary} {* This section for Paid events only.*}
+
+==========================================================={if $pricesetFieldsCount }===================={/if}
+
+{$event.fee_label}
+==========================================================={if $pricesetFieldsCount }===================={/if}
+
+{if $lineItem}{foreach from=$lineItem item=value key=priceset}
+
+{if $value neq 'skip'}
+{if $isPrimary}
+{if $lineItem|@count GT 1} {* Header for multi participant registration cases. *}
+{ts 1=$priceset+1}Participant %1{/ts} {$part.$priceset.info}
+
+{/if}
+{/if}
+-----------------------------------------------------------{if $pricesetFieldsCount }-----------------------------------------------------{/if}
+
+{capture assign=ts_item}{ts}Item{/ts}{/capture}
+{capture assign=ts_qty}{ts}Qty{/ts}{/capture}
+{capture assign=ts_each}{ts}Each{/ts}{/capture}
+{if $dataArray}
+{capture assign=ts_subtotal}{ts}Subtotal{/ts}{/capture}
+{capture assign=ts_taxRate}{ts}Tax Rate{/ts}{/capture}
+{capture assign=ts_taxAmount}{ts}Tax Amount{/ts}{/capture}
+{/if}
+{capture assign=ts_total}{ts}Total{/ts}{/capture}
+{if $pricesetFieldsCount }{capture assign=ts_participant_total}{ts}Total Participants{/ts}{/capture}{/if}
+{$ts_item|string_format:"%-30s"} {$ts_qty|string_format:"%5s"} {$ts_each|string_format:"%10s"} {if $dataArray} {$ts_subtotal|string_format:"%10s"} {$ts_taxRate|string_format:"%10s"} {$ts_taxAmount|string_format:"%10s"} {/if} {$ts_total|string_format:"%10s"} {$ts_participant_total|string_format:"%10s"}
+-----------------------------------------------------------{if $pricesetFieldsCount }-----------------------------------------------------{/if}
+
+{foreach from=$value item=line}
+{if $pricesetFieldsCount }{capture assign=ts_participant_count}{$line.participant_count}{/capture}{/if}
+{capture assign=ts_item}{if $line.html_type eq 'Text'}{$line.label}{else}{$line.field_title} - {$line.label}{/if} {if $line.description} {$line.description}{/if}{/capture}{$ts_item|truncate:30:"..."|string_format:"%-30s"} {$line.qty|string_format:"%5s"} {$line.unit_price|crmMoney:$currency|string_format:"%10s"} {if $dataArray} {$line.unit_price*$line.qty|crmMoney:$currency|string_format:"%10s"} {if $line.tax_rate != "" || $line.tax_amount != ""}  {$line.tax_rate|string_format:"%.2f"} %  {$line.tax_amount|crmMoney:$currency|string_format:"%10s"} {else}                  {/if}  {/if} {$line.line_total+$line.tax_amount|crmMoney:$currency|string_format:"%10s"}{$ts_participant_count|string_format:"%10s"}
+{/foreach}
+----------------------------------------------------------------------------------------------------------------
+{if $lineItem|@count GT 1 && $individual}{ts}Participant Total{/ts} {$individual.$priceset.totalAmtWithTax-$individual.$priceset.totalTaxAmt|crmMoney:$currency|string_format:"%29s"} {$individual.$priceset.totalTaxAmt|crmMoney:$currency|string_format:"%33s"} {$individual.$priceset.totalAmtWithTax|crmMoney:$currency|string_format:"%12s"}{/if}
+{/if}
+{""|string_format:"%120s"}
+{/foreach}
+{""|string_format:"%120s"}
+
+{if $dataArray}
+{ts}Amount before Tax{/ts}: {$totalAmount-$totalTaxAmount|crmMoney:$currency}
+
+{foreach from=$dataArray item=value key=priceset}
+{if $priceset || $priceset == 0}
+{$taxTerm} {$priceset|string_format:"%.2f"}%: {$value|crmMoney:$currency}
+{else}
+{ts}No{/ts} {$taxTerm}: {$value|crmMoney:$currency}
+{/if}
+{/foreach}
+{/if}
+{/if}
+
+{if $amounts && !$lineItem}
+{foreach from=$amounts item=amnt key=level}{$amnt.amount|crmMoney:$currency} {$amnt.label}
+{/foreach}
+{/if}
+
+{if $totalTaxAmount}
+{ts}Total Tax Amount{/ts}: {$totalTaxAmount|crmMoney:$currency}
+{/if}
+{if $isPrimary }
+
+{ts}Total Amount{/ts}: {$totalAmount|crmMoney:$currency} {if $hookDiscount.message}({$hookDiscount.message}){/if}
+
+{if $pricesetFieldsCount }
+      {assign var="count" value= 0}
+      {foreach from=$lineItem item=pcount}
+      {assign var="lineItemCount" value=0}
+      {if $pcount neq 'skip'}
+        {foreach from=$pcount item=p_count}
+        {assign var="lineItemCount" value=$lineItemCount+$p_count.participant_count}
+        {/foreach}
+      {if $lineItemCount < 1 }
+        {assign var="lineItemCount" value=1}
+      {/if}
+      {assign var="count" value=$count+$lineItemCount}
+      {/if}
+      {/foreach}
+
+{ts}Total Participants{/ts}: {$count}
+{/if}
+
+{if $register_date}
+{ts}Registration Date{/ts}: {$register_date|crmDate}
+{/if}
+{if $receive_date}
+{ts}Transaction Date{/ts}: {$receive_date|crmDate}
+{/if}
+{if $contributionTypeName}
+{ts}Financial Type{/ts}: {$contributionTypeName}
+{/if}
+{if $trxn_id}
+{ts}Transaction #{/ts}: {$trxn_id}
+{/if}
+{if $paidBy}
+{ts}Paid By{/ts}: {$paidBy}
+{/if}
+{if $checkNumber}
+{ts}Check Number{/ts}: {$checkNumber}
+{/if}
+{if $contributeMode ne 'notify' and !$isAmountzero and (!$is_pay_later or $isBillingAddressRequiredForPayLater) and !$isOnWaitlist and !$isRequireApproval}
+
+==========================================================={if $pricesetFieldsCount }===================={/if}
+
+{ts}Billing Name and Address{/ts}
+
+==========================================================={if $pricesetFieldsCount }===================={/if}
+
+{$billingName}
+{$address}
+{/if}
+
+{if $contributeMode eq 'direct' and !$isAmountzero and !$is_pay_later and !$isOnWaitlist and !$isRequireApproval}
+==========================================================={if $pricesetFieldsCount }===================={/if}
+
+{ts}Credit Card Information{/ts}
+
+==========================================================={if $pricesetFieldsCount }===================={/if}
+
+{$credit_card_type}
+{$credit_card_number}
+{ts}Expires{/ts}: {$credit_card_exp_date|truncate:7:''|crmDate}
+{/if}
+{/if}
+{/if} {* End of conditional section for Paid events *}
+
+{if $customPre}
+{foreach from=$customPre item=customPr key=i}
+==========================================================={if $pricesetFieldsCount }===================={/if}
+
+{$customPre_grouptitle.$i}
+==========================================================={if $pricesetFieldsCount }===================={/if}
+
+{foreach from=$customPr item=customValue key=customName}
+{if ( $trackingFields and ! in_array( $customName, $trackingFields ) ) or ! $trackingFields}
+ {$customName}: {$customValue}
+{/if}
+{/foreach}
+{/foreach}
+{/if}
+
+{if $customPost}
+{foreach from=$customPost item=customPos key=j}
+==========================================================={if $pricesetFieldsCount }===================={/if}
+
+{$customPost_grouptitle.$j}
+==========================================================={if $pricesetFieldsCount }===================={/if}
+
+{foreach from=$customPos item=customValue key=customName}
+{if ( $trackingFields and ! in_array( $customName, $trackingFields ) ) or ! $trackingFields}
+ {$customName}: {$customValue}
+{/if}
+{/foreach}
+{/foreach}
+{/if}
+{if $customProfile}
+
+{foreach from=$customProfile.profile item=eachParticipant key=participantID}
+==========================================================={if $pricesetFieldsCount }===================={/if}
+
+{ts 1=$participantID+2}Participant Information - Participant %1{/ts}
+
+==========================================================={if $pricesetFieldsCount }===================={/if}
+
+{foreach from=$eachParticipant item=eachProfile key=pid}
+----------------------------------------------------------{if $pricesetFieldsCount }--------------------{/if}
+
+{$customProfile.title.$pid}
+----------------------------------------------------------{if $pricesetFieldsCount }--------------------{/if}
+
+{foreach from=$eachProfile item=val key=field}
+{foreach from=$val item=v key=f}
+{$field}: {$v}
+{/foreach}
+{/foreach}
+{/foreach}
+{/foreach}
+{/if}
+{if $customGroup}
+{foreach from=$customGroup item=value key=customName}
+=========================================================={if $pricesetFieldsCount }===================={/if}
+
+{$customName}
+=========================================================={if $pricesetFieldsCount }===================={/if}
+
+{foreach from=$value item=v key=n}
+{$n}: {$v}
+{/foreach}
+{/foreach}
+{/if}
index 0d1c4e02f22d5121bd93f20f60fb45ba4b220049..6a500768595a26b39919a351a64a58750e1a0b06 100644 (file)
@@ -2,4 +2,7 @@
 -- CRM-16307 fix CRM-15578 typo - Require access CiviMail permission for A/B Testing feature
 UPDATE civicrm_navigation
 SET permission = 'access CiviMail', permission_operator = ''
-WHERE name = 'New A/B Test' OR name = 'Manage A/B Tests';
\ No newline at end of file
+WHERE name = 'New A/B Test' OR name = 'Manage A/B Tests';
+
+--CRM-16320
+{include file='../CRM/Upgrade/4.6.3.msg_template/civicrm_msg_template.tpl'}
index d5be9dd8a093c4949fb82cea3afb886b43467bbc..4de01793ed94c285eb554b4f315a4e4b2b13f834 100644 (file)
@@ -9,9 +9,13 @@
 {capture assign=headerStyle}colspan="2" style="text-align: left; padding: 4px; border-bottom: 1px solid #999; background-color: #eee;"{/capture}
 {capture assign=labelStyle }style="padding: 4px; border-bottom: 1px solid #999; background-color: #f7f7f7;"{/capture}
 {capture assign=valueStyle }style="padding: 4px; border-bottom: 1px solid #999;"{/capture}
+{capture assign=tdfirstStyle}style="width: 180px; padding-bottom: 15px;"{/capture}
+{capture assign=tdStyle}style="width: 100px;"{/capture}
+{capture assign=participantTotal}style="margin: 0.5em 0 0.5em;padding: 0.5em;background-color: #999999;font-weight: bold;color: #FAFAFA;border-radius: 2px;"{/capture}
+
 
 <center>
- <table width="500" border="0" cellpadding="0" cellspacing="0" id="crm-event_receipt" style="font-family: Arial, Verdana, sans-serif; text-align: left;">
+ <table width="700" border="0" cellpadding="0" cellspacing="0" id="crm-event_receipt" style="font-family: Arial, Verdana, sans-serif; text-align: left;">
 
   <!-- BEGIN HEADER -->
   <!-- You can add table row(s) here with logo or other header elements -->
@@ -52,7 +56,7 @@
   </tr>
   <tr>
    <td>
-    <table width="500" style="border: 1px solid #999; margin: 1em 0em 1em; border-collapse: collapse;">
+    <table width="700" style="border: 1px solid #999; margin: 1em 0em 1em; border-collapse: collapse;">
      <tr>
       <th {$headerStyle}>
        {ts}Event Information and Location{/ts}
             </tr>
             {foreach from=$value item=line}
              <tr>
-              <td>
+              <td {$tdfirstStyle}>
               {if $line.html_type eq 'Text'}{$line.label}{else}{$line.field_title} - {$line.label}{/if} {if $line.description}<div>{$line.description|truncate:30:"..."}</div>{/if}
               </td>
-              <td>
+              <td {$tdStyle} align="middle">
                {$line.qty}
               </td>
-              <td>
+              <td {$tdStyle}>
                {$line.unit_price|crmMoney:$currency}
               </td>
               {if $dataArray}
-               <td>
+               <td {$tdStyle}>
                 {$line.unit_price*$line.qty|crmMoney}
                </td>
                {if $line.tax_rate != "" || $line.tax_amount != ""}
-                <td>
+                <td {$tdStyle}>
                  {$line.tax_rate|string_format:"%.2f"}%
                 </td>
-                <td>
+                <td {$tdStyle}>
                  {$line.tax_amount|crmMoney}
                 </td>
                {else}
                 <td></td>
                {/if}
               {/if}
-              <td>
+              <td {$tdStyle}>
                {$line.line_total+$line.tax_amount|crmMoney:$currency}
               </td>
-        {if $pricesetFieldsCount }<td>{$line.participant_count}</td> {/if}
+        {if $pricesetFieldsCount }<td {$tdStyle}>{$line.participant_count}</td> {/if}
              </tr>
             {/foreach}
+            {if $individual}
+              <tr {$participantTotal}>
+                <td colspan=3>{ts}Participant Total{/ts}</td>
+                <td  colspan=2>{$individual.$priceset.totalAmtWithTax-$individual.$priceset.totalTaxAmt|crmMoney}</td>
+                <td  colspan=1>{$individual.$priceset.totalTaxAmt|crmMoney}</td>
+                <td  colspan=2>{$individual.$priceset.totalAmtWithTax|crmMoney}</td>
+              </tr>
+            {/if}
            </table>
           </td>
          </tr>
index ee41487e10b9f50d59c8c7c06c8c6606448a2d48..8d11638c3897709a4d79851248d7deeeec97f233 100644 (file)
@@ -126,7 +126,7 @@ You were registered by: {$payer.name}
 
 {/if}
 {/if}
------------------------------------------------------------{if $pricesetFieldsCount }--------------------{/if}
+-----------------------------------------------------------{if $pricesetFieldsCount }-----------------------------------------------------{/if}
 
 {capture assign=ts_item}{ts}Item{/ts}{/capture}
 {capture assign=ts_qty}{ts}Qty{/ts}{/capture}
@@ -139,14 +139,18 @@ You were registered by: {$payer.name}
 {capture assign=ts_total}{ts}Total{/ts}{/capture}
 {if $pricesetFieldsCount }{capture assign=ts_participant_total}{ts}Total Participants{/ts}{/capture}{/if}
 {$ts_item|string_format:"%-30s"} {$ts_qty|string_format:"%5s"} {$ts_each|string_format:"%10s"} {if $dataArray} {$ts_subtotal|string_format:"%10s"} {$ts_taxRate|string_format:"%10s"} {$ts_taxAmount|string_format:"%10s"} {/if} {$ts_total|string_format:"%10s"} {$ts_participant_total|string_format:"%10s"}
------------------------------------------------------------{if $pricesetFieldsCount }--------------------{/if}
+-----------------------------------------------------------{if $pricesetFieldsCount }-----------------------------------------------------{/if}
 
 {foreach from=$value item=line}
 {if $pricesetFieldsCount }{capture assign=ts_participant_count}{$line.participant_count}{/capture}{/if}
 {capture assign=ts_item}{if $line.html_type eq 'Text'}{$line.label}{else}{$line.field_title} - {$line.label}{/if} {if $line.description} {$line.description}{/if}{/capture}{$ts_item|truncate:30:"..."|string_format:"%-30s"} {$line.qty|string_format:"%5s"} {$line.unit_price|crmMoney:$currency|string_format:"%10s"} {if $dataArray} {$line.unit_price*$line.qty|crmMoney:$currency|string_format:"%10s"} {if $line.tax_rate != "" || $line.tax_amount != ""}  {$line.tax_rate|string_format:"%.2f"} %  {$line.tax_amount|crmMoney:$currency|string_format:"%10s"} {else}                  {/if}  {/if} {$line.line_total+$line.tax_amount|crmMoney:$currency|string_format:"%10s"}{$ts_participant_count|string_format:"%10s"}
 {/foreach}
+----------------------------------------------------------------------------------------------------------------
+{if $lineItem|@count GT 1 && $individual}{ts}Participant Total{/ts} {$individual.$priceset.totalAmtWithTax-$individual.$priceset.totalTaxAmt|crmMoney:$currency|string_format:"%29s"} {$individual.$priceset.totalTaxAmt|crmMoney:$currency|string_format:"%33s"} {$individual.$priceset.totalAmtWithTax|crmMoney:$currency|string_format:"%12s"}{/if}
 {/if}
+{""|string_format:"%120s"}
 {/foreach}
+{""|string_format:"%120s"}
 
 {if $dataArray}
 {ts}Amount before Tax{/ts}: {$totalAmount-$totalTaxAmount|crmMoney:$currency}