Advertisement
Apina

ee4rbt

Oct 29th, 2014
182
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 13.88 KB | None | 0 0
  1. <?php
  2. /* @var $events_for_txn EE_Event[] */
  3. $events_for_txn;
  4. /* @var $ticket_line_items_per_event EE_Line_Item[] */
  5. $ticket_line_items_per_event;
  6. /* @var $registrations_per_ticket EE_Registration[] */
  7. $registrations_per_line_item;
  8. /* @var $venues_for_events EE_Venue[] */
  9. $venues_for_events;
  10. /* @var $tax_total_line_item EE_Line_Item */
  11. $tax_total_line_item;
  12. ?>
  13.  
  14. <div id="invoice">
  15.  
  16. <table id="invoice-header" class="not-really-a-table">
  17. <tr>
  18. <td id="logo-dv">
  19. [invoice_logo_image]
  20. <div class="vcard" id="company-address">
  21. <div class="fn org"><strong>[organization]</strong></div>
  22. <div class="adr">
  23. <div class="street-address">[street]
  24. </div>
  25. <!-- street-address -->
  26. <div class="locality">[city], [state]</div>
  27. <div id="company-postcode"><span class="postal-code">[zip]</span></div>
  28. </div>
  29. <!-- adr -->
  30. <div class="email">[email]</div>
  31. <div class="vat"><?php _e('VAT/Tax Number:', 'event_espresso')?> [vat]</div>
  32. </div>
  33. </td>
  34. <td>
  35. <div id="invoice-info">
  36. <h2 id="invoice-hdr"><?php _e('Order Confirmation', 'event_espresso')?></h2>
  37. <h3 id="invoice-date"><?php _e('Date:', 'event_espresso')?> <span class="plain-text">[registration_date]</span></h3>
  38. <h3 id="invoice-txn-id"><?php _e('Transaction ID:', 'event_espresso')?> <span class="plain-text">[transaction_id]</span></h3>
  39. <h3 id="invoice-txn-status"><?php _e('Status:', 'event_espresso')?> <span class="<?php echo $transaction->status_ID()?> plain-text"><?php echo $transaction->pretty_status();?></span></h3>
  40. </div>
  41. </td>
  42. </tr>
  43. </table>
  44. <div class="events">
  45. <?php foreach($events_for_txn as $event_id => $event){
  46. ?><h3 class="section-title event-name"><img class="icon" src="<?php echo EE_IMAGES_URL.'calendar_year-24x24.png';?>"><?php _e("Event Name:","event_espresso")?> <span class="plain-text"><?php echo $event->name();?></span> <span class="small-text link">[ <a href='<?php echo $event->get_permalink()?>'><?php _e('view', 'event_espresso'); ?></a> ]</span></h3>
  47. <?php if (strlen($event->description()>1)){?><p class="event-description"><?php $event->description()?></p><?php }?>
  48. <ul class="tickets-per-event">
  49. <?php foreach($ticket_line_items_per_event[$event_id] as $line_item_id => $line_item){
  50. $ticket = $line_item->ticket();
  51. $taxable_html = $ticket->taxable() ? '*': '';
  52. $subitems = $line_item->children();
  53. $ticket_uses = $ticket->get_pretty('TKT_uses', __("any", "event_espresso"));
  54. ?>
  55. <li class="event-ticket">
  56. <div class="ticket-details">
  57. <table class="invoice-amount">
  58. <thead>
  59. <tr class="header_row">
  60. <th class="name-column"><?php _e("Ticket", "event_espresso");?></th>
  61. <th colspan="2" class="desc-column"><?php _e("Description", "event_espresso");?></th>
  62. <th class="number-column item_c"><?php _e("Quantity", "event_espresso");?></th>
  63. <th class="number-column item_c"><?php _e("Price", "event_espresso");?></th>
  64. <th class="number-column item_r"><?php _e("Total", "event_espresso");?></th>
  65. </tr>
  66. </thead>
  67. <tbody>
  68. <?php if( count($subitems) < 2){?>
  69. <tr class="item">
  70. <td><?php echo $line_item->name().$taxable_html?></td>
  71. <td colspan="2"><?php echo $line_item->desc();?><p class="ticket-note"><?php echo sprintf(__('This ticket can be used once at %s of the dates/times below.', 'event_espresso'), $ticket_uses); ?></p></td>
  72. <td class="item_c"><?php echo $line_item->quantity()?></td>
  73. <td class="item_c"><?php echo $line_item->unit_price_no_code()?></td>
  74. <td class="item_r"><?php echo $line_item->total_no_code()?></td>
  75. </tr>
  76. <?php }else{?>
  77. <tr class="item">
  78. <td class="aln-left"><?php echo $line_item->name().$taxable_html?></td>
  79. <td colspan="2"><?php echo $line_item->desc();?><p class="ticket-note"><?php echo sprintf(__('This ticket can be used once at %s of the dates/times below.', 'event_espresso'), $ticket_uses); ?></p></td>
  80. <td class="item_c"><?php echo $line_item->quantity()?></td>
  81. <td class="item_c"><?php echo $line_item->unit_price_no_code()?></td>
  82. <td class="item_r"><?php echo $line_item->total_no_code()?></td>
  83. </tr>
  84. <?php foreach($subitems as $sub_line_item){
  85. $is_percent = $sub_line_item->is_percent();?>
  86. <tr class="subitem-row">
  87. <td class="subitem"><?php echo $sub_line_item->name()?></td>
  88. <td colspan="2"><?php echo $sub_line_item->desc()?></td>
  89. <td class="item_c"><?php //echo $is_percent ? '' : $sub_line_item->quantity()?></td>
  90. <td class="item_c"><?php echo $is_percent ? $sub_line_item->percent()."%" : $sub_line_item->unit_price_no_code()?></td>
  91. <td class="item_r"><?php echo $sub_line_item->total_no_code()?></td>
  92. </tr>
  93. <?php } ?>
  94. <tr class="total_tr odd">
  95. <td colspan="4"></td>
  96. <td class="total" nowrap="nowrap"><?php _e("Ticket Total:", "event_espresso");?></td>
  97. <td class="item_r"><?php echo $line_item->total_no_code()?></td>
  98. </tr>
  99. <?php }?>
  100. </tbody>
  101. </table>
  102.  
  103. </div>
  104. <div class="reg-details-for-ticket">
  105. <div class="ticket-time-and-place-details">
  106. <div class="ticket-time-details">
  107. <h4 class="sub-section-title no-bottom-margin"><img class="icon" src="<?php echo EE_IMAGES_URL.'clock-16x16.png';?>"><?php echo _n("Date/Time:","Dates/Times:",count($ticket->datetimes()), "event_espresso");?></h4>
  108. <ul class="event-dates">
  109. <?php foreach($ticket->datetimes_ordered() as $datetime){
  110. /* @var $datetime EE_Datetime */ ?>
  111. <li><?php
  112. echo $datetime->name() ? '<b>'.$datetime->name().' </b>' : '' ;
  113. echo sprintf(__("%s - %s (%s)", "event_espresso"),$datetime->start_date_and_time(),$datetime->end_date_and_time(),$datetime->get_timezone());
  114. echo $datetime->description() ? '<p class="ticket-note">'.$datetime->description().'</p>' : '' ?></li>
  115. <?php }?>
  116. </ul>
  117. </div>
  118. <?php if ($event->venues()){?>
  119. <div class="ticket-place-details">
  120. <h4 class="sub-section-title no-bottom-margin"><img class="icon" src="<?php echo EE_IMAGES_URL.'location-pin-16x16.png';?>"><?php echo _n("Venue:","Venues:",count($event->venues()), "event_espresso");?></h4>
  121. <ul class="event-venues">
  122. <?php foreach($event->venues() as $venue){?>
  123. <li><?php echo $venue->name()?> <span class="small-text">[ <a href='<?php echo $venue->get_permalink()?>'><?php _e('view', 'event_espresso'); ?></a> ]</span></li>
  124. <?php } ?>
  125. </ul>
  126. </div>
  127. <?php }?>
  128. </div>
  129. <div class="ticket-registrations-area">
  130. <h4 class="sub-section-title"><img class="icon" src="<?php echo EE_IMAGES_URL.'users-16x16.png';?>"><?php echo __("Registration Details", "event_espresso");?> <span class="small-text link">[ <a class="print_button noPrint" href="<?php echo $edit_reg_info_url; ?>"><?php _e('edit', 'event_espresso'); ?></a> ]</span></h4>
  131. <ul class="ticket-registrations-list">
  132.  
  133. <?php //$ii = 0; ?>
  134. <?php foreach($registrations_per_line_item[$line_item_id] as $registration){
  135. //var_dump($registration);
  136. //if($ii >= 1) { continue; }
  137. //$ii++;
  138. /* @var $registration EE_Registration */
  139. $attendee = $registration->attendee();
  140. $answers = $registration->answers(array('order_by'=>array('Question.Question_Group_Question.QGQ_order'=>'ASC')));?>
  141. <li class="ticket-registration">
  142. <table class="registration-details">
  143. <tr class="odd">
  144. <th><?php echo _e("Registration Code:", "event_espresso");?></th>
  145. <td><?php echo $registration->reg_code();?> - <span class="<?php echo $registration->status_ID()?>"><?php echo $registration->pretty_status()?></span></td>
  146. </tr>
  147. <?php
  148. foreach($event->question_groups() as $question_group){
  149. ?><tr><th><?php $question_group->e('QSG_name');?></th><td></td></tr><?php
  150. $has_personal_info = false;
  151. foreach($question_group->questions() as $question){
  152. if( in_array($question->ID(),$questions_to_skip)){
  153. $has_personal_info = true;
  154. continue;
  155. }
  156. ?><tr>
  157. <th><?php echo $question->display_text()?></th>
  158. <td><?php echo $registration->answer_value_to_question($question);?></td>
  159. </tr><?php
  160. }
  161. if($has_personal_info){
  162. ?><tr><th><?php _e('Attendee', 'event_espresso');?></th><td><?php echo sprintf(__('%s (%s)', "event_espresso"),$attendee->full_name(),$attendee->email())?></td></tr><?php
  163. }
  164. }
  165. ?>
  166. </table>
  167. </li>
  168. <?php } ?>
  169. </ul>
  170. </div>
  171. </div>
  172. </li>
  173. <?php }?>
  174. </ul>
  175.  
  176. <?php }?>
  177. </div>
  178. <div class="taxes">
  179. <?php if ($tax_total_line_item && $tax_total_line_item->children()){?>
  180. <h3 class="section-title"><?php _e("Taxes",'event_espresso')?></h3>
  181. <table class="invoice-amount">
  182.  
  183. <thead>
  184. <tr class="header_row">
  185. <th class="left ticket_th"><?php _e("Tax Name", "event_espresso");?></th>
  186. <th class="left"><?php _e('Description', 'event_espresso');?></th>
  187. <th class="event_th item_c"><?php _e('Rate', 'event_espresso'); ?></th>
  188. <th class="subtotal_th"><?php _e('Tax Amount', 'event_espresso'); ?></th>
  189. </tr>
  190. </thead>
  191. <tbody>
  192. <?php
  193. foreach($tax_total_line_item->children() as $child_tax){?>
  194. <tr>
  195. <td><?php echo $child_tax->name()?></td>
  196. <td><?php echo $child_tax->desc()?></td>
  197. <td class="item_c"><?php echo $child_tax->percent()?>%</td>
  198. <td class="item_r"><?php echo $child_tax->total_no_code()?></td>
  199. </tr>
  200. <?php } ?>
  201. <tr class="total_tr odd">
  202. <td class="total_tr" colspan="2"></td>
  203. <td class="total"><?php _e("Tax Total:", "event_espresso");?></td>
  204. <td class="item_r"><?php echo $tax_total_line_item->total_no_code()?></td>
  205. </tr>
  206. </tbody>
  207.  
  208. </table>
  209. <?php }?>
  210. <p><?php _e("* taxable items", "event_espresso");?></p>
  211. </div>
  212. <div class="grand-total-dv">
  213. <h2 class="grand-total"><?php printf(__("Grand Total: %s", "event_espresso"),EEH_Template::format_currency($total_cost));?></h2>
  214. </div>
  215. <div class="payment-dv">
  216. <h3 class="section-title"><?php _e("Payments",'event_espresso')?></h3>
  217. <p>[instructions]</p>
  218. <table class="invoice-amount">
  219. <thead>
  220. <tr class="header_row">
  221. <th><span class=""><?php _e('Payment Method', 'event_espresso'); ?></span></th>
  222. <th class='left datetime_th'><?php _e("Date",'event_espresso')?></th>
  223. <th><span class=""><?php _e('Transaction Id / Cheque #', 'event_espresso'); ?></span></th>
  224. <th><span class=""><?php _e('P.O. / S.O.#', 'event_espresso'); ?></span></th>
  225. <th><span class=""><?php _e('Status', 'event_espresso'); ?></span></th>
  226. <th><?php _e('Amount', 'event_espresso'); ?></th>
  227. </tr>
  228. </thead>
  229. <tbody>
  230. <?php
  231. $c = false;
  232. if(!empty($payments)){
  233.  
  234. foreach($payments as $payment){
  235. /* @var $payment EE_Payment */?>
  236. <tr class='item <?php echo (($c = !$c) ? ' odd' : '')?>'>
  237. <td><?php $payment->e('PAY_gateway')?></td>
  238. <td><?php echo $payment->timestamp()?></td>
  239. <td><?php $payment->e('PAY_txn_id_chq_nmbr')?></td>
  240. <td><?php $payment->e('PAY_po_number')?></td>
  241. <td><?php $payment->e_pretty_status()?></td>
  242. <td class='item_r'><?php echo $payment->amount_no_code()?></td>
  243. </tr>
  244. <?php }
  245. }else{?>
  246. <tr class='item'>
  247. <td class='aln-cntr' colspan="6"><?php _e("No approved payments have been received.",'event_espresso')?> </td>
  248. </tr>
  249. <?php }
  250. ?><tr class="item" ><td class='aln-cntr' colspan="6"><?php if($amount_owed){?><a class="noPrint" href='<?php echo $retry_payment_url?>'><?php _e("Please make a payment.", "event_espresso");}?></a></td></tr>
  251. </tbody>
  252. <tfoot>
  253. <tr class='total_tr'><td colspan="4">&nbsp;</td>
  254. <td class="item_r"><?php _e('Total Paid','event_espresso')?></td>
  255. <td class="item_r"><?php echo EEH_Template::format_currency($amount_pd,false,false)?> </td>
  256. </tr>
  257. <?php //echo $discount; ?>
  258. <tr class="total_tr odd">
  259. <td colspan="4">&nbsp;</td>
  260. <td class="total" id="total_currency"><?php _e('Amount Owed:', 'event_espresso'); ?></td>
  261. <td class="total"><?php echo EEH_Template::format_currency($amount_owed)?></td>
  262. </tr>
  263. </tfoot>
  264. </table>
  265. </div>
  266. <div class="additional-info-dv">
  267. <h3 class="section-title"><?php _e("Additional Information:", "event_espresso");?></h3>
  268. <div class="additional-info">
  269. <?php if($venues_for_events){?>
  270. <h2><?php echo _n("Venue Details:", "Venues Details:", "event_espresso",count($venues_for_events));?></h2>
  271. <table class="venue-list">
  272. <?php foreach($venues_for_events as $venue){?>
  273. <tr class="venue-details">
  274. <td class="venue-details-part venue-address-dv">
  275. <h3><a href='<?php echo $venue->get_permalink()?>'><?php
  276. echo $venue->name()
  277. ?></a></h3>
  278. <p><?php echo $venue->description()?></p>
  279. <?php echo EEH_Address::format($venue);?></td>
  280. <?php if($venue->enable_for_gmap()){?>
  281. <td class="venue-details-part venue-image-dv"><?php echo EEH_Venue_View::espresso_google_static_map($venue)?></td>
  282. <?php } ?>
  283. </tr>
  284. <?php }?>
  285. </table>
  286. <?php } ?>
  287.  
  288. <?php if($shameless_plug){?>
  289. <div class='aln-cntr'><?php
  290. printf(__("Powered by %sEvent Espresso %s", "event_espresso"),"<a href='http://eventespresso.com'>","</a>");
  291. ?></div>
  292. <?php } ?>
  293. </div>
  294. </div>
  295. </div>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement