view.phtml 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  1. <?php
  2. /**
  3. * @version 7.7
  4. */
  5. /** @var \Ppb\Db\Table\Row\Sale $sale */
  6. /** @var \Ppb\Db\Table\Row\User $buyer */
  7. $buyer = $sale->findParentRow('\Ppb\Db\Table\Users', 'Buyer');
  8. /** @var \Ppb\Db\Table\Row\User $seller */
  9. $seller = $sale->findParentRow('\Ppb\Db\Table\Users', 'Seller');
  10. $storeSettings = $seller->getStoreSettings();
  11. $logo = (!empty($storeSettings['store_logo_path'])) ? $storeSettings['store_logo_path'] : null;
  12. ?>
  13. <div id="print-area">
  14. <div class="row">
  15. <div class="col-sm-6">
  16. <?php if ($logo) { ?>
  17. <?php echo $this->thumbnail($logo, 200, null, array('alt' => $seller->storeName(), 'crop' => false)); ?>
  18. <?php } ?>
  19. </div>
  20. <div class="col-sm-6">
  21. <table class="table table-condensed well">
  22. <tbody>
  23. <tr>
  24. <td class="text-right"><strong><?php echo $this->_('Invoice #'); ?></strong></td>
  25. <td><?php echo $sale['id']; ?></td>
  26. </tr>
  27. <tr>
  28. <td class="text-right"><strong><?php echo $this->_('Invoice Date'); ?></strong></td>
  29. <td><?php echo $this->date(max(array($sale['created_at'], $sale['updated_at'])), true); ?></td>
  30. </tr>
  31. <tr>
  32. <td class="text-right"><strong><?php echo $this->_('Payment Status'); ?></strong></td>
  33. <td><?php echo $this->_($sale->getPaymentStatusDescription()); ?></td>
  34. </tr>
  35. <?php if ($transaction = $sale->getSaleTransaction()) { ?>
  36. <tr>
  37. <td class="text-right"><strong><?php echo $this->_('Payment Method'); ?></strong></td>
  38. <td><?php echo $transaction->findParentRow('\Ppb\Db\Table\PaymentGateways')->getData('name'); ?></td>
  39. </tr>
  40. <tr>
  41. <td class="text-right"><strong><?php echo $this->_('Transaction ID'); ?></strong></td>
  42. <td><?php echo $transaction['gateway_transaction_code']; ?></td>
  43. </tr>
  44. <tr>
  45. <td class="text-right"><strong><?php echo $this->_('Payment Date'); ?></strong></td>
  46. <td><?php echo $this->date(max(array($transaction['created_at'], $transaction['updated_at'])),
  47. true); ?></td>
  48. </tr>
  49. <?php } ?>
  50. </tbody>
  51. </table>
  52. <?php echo $this->renderText($seller['sale_invoices_content'], true); ?>
  53. </div>
  54. </div>
  55. <div class="row">
  56. <div class="col-sm-6">
  57. <?php echo $this->_('Seller Address:'); ?>
  58. <?php echo $this->userDetails($seller)->displayFullAddress(); ?>
  59. </div>
  60. <div class="col-sm-3">
  61. <?php echo $this->_('Billing Address:'); ?>
  62. <?php echo $this->userDetails($buyer)->setAddress($sale['billing_address_id'])->displayFullAddress(); ?>
  63. </div>
  64. <?php if ($sale->hasPostage()) { ?>
  65. <div class="col-sm-3">
  66. <div>
  67. <?php echo $this->_('Delivery Address:'); ?>
  68. <?php echo $this->userDetails($buyer)->setAddress($sale['shipping_address_id'])->displayFullAddress(); ?>
  69. </div>
  70. <p>
  71. <?php echo $this->_('Delivery Method:'); ?> <br>
  72. <strong><?php echo $sale->getPostageMethod(); ?></strong>
  73. </p>
  74. </div>
  75. <?php } ?>
  76. </div>
  77. <div class="row">
  78. <div class="col-sm-12">
  79. <?php echo $this->partial('partials/sale.phtml', array(
  80. 'sale' => $sale,
  81. 'invoice' => true,
  82. 'caption' => '<h2>' . $this->_('Invoice') . '</h2>')); ?>
  83. </div>
  84. </div>
  85. </div>
  86. <div class="clearfix"></div>
  87. <div>
  88. <?php echo $this->formElement('\Ppb\Form\Element\PrintButton', 'printButton', $this->_('Print'))
  89. ->setAttributes(array(
  90. 'class' => 'btn btn-lg btn-info',
  91. 'rel' => 'print-area',
  92. ))
  93. ->render();
  94. ?>
  95. </div>