PageRenderTime 39ms CodeModel.GetById 12ms RepoModel.GetById 0ms app.codeStats 1ms

/modules/AOS_PDF_Templates/samples/smpl_Quote_Sample.php

https://gitlab.com/tjaafar/SuiteCRM
PHP | 142 lines | 139 code | 3 blank | 0 comment | 0 complexity | 059ec6380ece741c6ed926c279996a6e MD5 | raw file
  1. <?php
  2. class smpl_Quote_Sample{
  3. function getType() {
  4. return 'AOS_Quotes';
  5. }
  6. function getBody() {
  7. $d_image = explode('?',SugarThemeRegistry::current()->getImageURL('company_logo.png'));
  8. return '<table style="width: 100%; font-family: Arial; text-align: center;" border="0" cellpadding="2" cellspacing="2">
  9. <tbody style="text-align: left;">
  10. <tr style="text-align: left;">
  11. <td style="text-align: left;">
  12. <p><img src="'.$d_image[0].'" style="float: left;"/>&nbsp;</p>
  13. </td>
  14. </tr>
  15. <tr>
  16. <td style="font-weight: bold; text-align: left;"><div>'.translate('LBL_BROWSER_TITLE').' Ltd<br />'.translate('LBL_ANY_STREET','AOS_PDF_Templates').'<br />'.translate('LBL_ANY_TOWN','AOS_PDF_Templates').'</span><br />'.translate('LBL_ANY_WHERE','AOS_PDF_Templates').'</div></td>
  17. </tr>
  18. <tr style="text-align: left;">
  19. <td style="text-align: left;"></td>
  20. </tr>
  21. <tr style="text-align: left;">
  22. <td style="text-align: left;">
  23. <h1>'.strtoupper(translate('LBL_PDF_NAME','AOS_Quotes')).'</h1>
  24. </td>
  25. </tr>
  26. </tbody>
  27. </table>
  28. <p style="font-family: Arial; text-align: center;">&nbsp;</p>
  29. <table style="text-align: center; width: 100%; border: 0pt none; border-spacing: 0pt;">
  30. <tbody style="text-align: left;">
  31. <tr style="text-align: left;">
  32. <td style="font-weight: bold; background-color: #b0c4de; padding: 2px 6px; border-style: solid; border-width: 0.5px; vertical-align: top; text-align: left; width: 50%;">'.translate('LBL_PREPARED_FOR','AOS_PDF_Templates').'</td>
  33. <td style="font-weight: bold; background-color: #b0c4de; padding: 2px 6px; border-style: solid; border-width: 0.5px; vertical-align: top; text-align: left; width: 50%;">'.translate('LBL_PREPARED_BY','AOS_PDF_Templates').'</td>
  34. </tr>
  35. <tr style="text-align: left;">
  36. <td style="padding: 2px 6px; border-style: solid; border-width: 0.5px; width: 50%; vertical-align: top; text-align: left;">
  37. <div>$aos_quotes_billing_account<br /> $aos_quotes_billing_address_street<br /> $aos_quotes_billing_address_city <br /> $aos_quotes_billing_address_state $aos_quotes_billing_address_postalcode</div>
  38. <br /></td>
  39. <td style="padding: 2px 6px; border-style: solid; border-width: 0.5px; width: 50%; vertical-align: top; text-align: left;"><div>$aos_quotes_modified_by_name</div></td>
  40. </tr>
  41. <tr style="text-align: left;">
  42. <td style="font-weight: bold; background-color: #b0c4de; padding: 2px 6px; border-style: solid; border-width: 0.5px; vertical-align: top; text-align: left; width: 50%;">'.translate('LBL_QUOTE_DATE','AOS_Quotes').'</td>
  43. <td style="font-weight: bold; background-color: #b0c4de; padding: 2px 6px; border-style: solid; border-width: 0.5px; vertical-align: top; text-align: left; width: 50%;">'.translate('LBL_EXPIRATION','AOS_Quotes').'</td>
  44. </tr>
  45. <tr style="text-align: left;">
  46. <td style="padding: 2px 6px; border-style: solid; border-width: 0.5px; width: 50%; vertical-align: top; text-align: left;"><div>$aos_quotes_date_entered</div></td>
  47. <td style="padding: 2px 6px; border-style: solid; border-width: 0.5px; width: 50%; vertical-align: top; text-align: left;"><div>$aos_quotes_expiration</div></td>
  48. </tr>
  49. <tr style="text-align: left;">
  50. <td style="font-weight: bold; background-color: #b0c4de; padding: 2px 6px; border-style: solid; border-width: 0.5px; vertical-align: top; text-align: left; width: 50%;">'.translate('LBL_QUOTE_NUMBER','AOS_Quotes').'</td>
  51. <td style="font-weight: bold; background-color: #b0c4de; padding: 2px 6px; border-style: solid; border-width: 0.5px; vertical-align: top; text-align: left; width: 50%;">'.translate('LBL_TERM','AOS_Quotes').'</td>
  52. </tr>
  53. <tr style="text-align: left;">
  54. <td style="padding: 2px 6px; border-style: solid; border-width: 0.5px; width: 50%; vertical-align: top; text-align: left;"><div>$aos_quotes_number</div></td>
  55. <td style="padding: 2px 6px; border-style: solid; border-width: 0.5px; width: 50%; vertical-align: top; text-align: left;"><div>$aos_quotes_term</div></td>
  56. </tr>
  57. </tbody>
  58. </table>
  59. <p>&nbsp;</p>
  60. <table repeat_header="1" style="width: 100%; border: 0pt none; border-spacing: 0pt;">
  61. <tbody>
  62. <tr>
  63. <td style="border-style: solid; background-color: #b0c4de; border-width: 0.5px; padding: 2px 6px; font-weight: bold; text-align: center;">'.translate('LBL_PRODUCT_QUANITY','AOS_Quotes').'</td>
  64. <td style="border-style: solid; background-color: #b0c4de; border-width: 0.5px; padding: 2px 6px; font-weight: bold; text-align: center;">'.translate('LBL_PRODUCT_NAME','AOS_Quotes').'</td>
  65. <td style="border-style: solid; background-color: #b0c4de; border-width: 0.5px; padding: 2px 6px; font-weight: bold; text-align: center;">'.translate('LBL_DESCRIPTION','AOS_Products').'</td>
  66. <td style="border-style: solid; background-color: #b0c4de; border-width: 0.5px; padding: 2px 6px; font-weight: bold; text-align: center;">'.translate('LBL_LIST_PRICE','AOS_Quotes').'</td>
  67. <td style="border-style: solid; background-color: #b0c4de; border-width: 0.5px; padding: 2px 6px; font-weight: bold; text-align: center;">'.translate('LBL_DISCOUNT_AMT','AOS_Quotes').'</td>
  68. <td style="border-style: solid; background-color: #b0c4de; border-width: 0.5px; padding: 2px 6px; font-weight: bold; text-align: center;">'.translate('LBL_UNIT_PRICE','AOS_Quotes').'</td>
  69. <td style="border-style: solid; background-color: #b0c4de; border-width: 0.5px; padding: 2px 6px; font-weight: bold; text-align: center;">'.translate('LBL_VAT','AOS_Quotes').'</td>
  70. <td style="border-style: solid; background-color: #b0c4de; border-width: 0.5px; padding: 2px 6px; font-weight: bold; text-align: center;">'.translate('LBL_TOTAL_PRICE','AOS_Quotes').'</td>
  71. </tr>
  72. <tr>
  73. <td style="border-style: solid; border-width: 0.5px; padding: 2px 6px; text-align: center;">$aos_products_quotes_product_qty</td>
  74. <td style="border-style: solid; border-width: 0.5px; padding: 2px 6px;">$aos_products_quotes_name</td>
  75. <td style="border-style: solid; border-width: 0.5px; padding: 2px 6px;">$aos_products_description</td>
  76. <td style="border-style: solid; border-width: 0.5px; padding: 2px 6px;">$aos_products_quotes_product_list_price</td>
  77. <td style="border-style: solid; border-width: 0.5px; padding: 2px 6px;">$aos_products_quotes_product_discount</td>
  78. <td style="border-style: solid; border-width: 0.5px; padding: 2px 6px;">$aos_products_quotes_product_unit_price</td>
  79. <td style="border-style: solid; border-width: 0.5px; padding: 2px 6px;">$aos_products_quotes_vat</td>
  80. <td style="border-style: solid; border-width: 0.5px; padding: 2px 6px;">$aos_products_quotes_product_total_price</td>
  81. </tr>
  82. <tr>
  83. <td style="border-style: solid; border-width: 0.5px; padding: 2px 6px;" colspan="3">$aos_services_quotes_name</td>
  84. <td style="border-style: solid; border-width: 0.5px; padding: 2px 6px;">$aos_services_quotes_service_list_price</td>
  85. <td style="border-style: solid; border-width: 0.5px; padding: 2px 6px;">$aos_services_quotes_service_discount</td>
  86. <td style="border-style: solid; border-width: 0.5px; padding: 2px 6px;">$aos_services_quotes_service_unit_price</td>
  87. <td style="border-style: solid; border-width: 0.5px; padding: 2px 6px;">$aos_services_quotes_vat</td>
  88. <td style="border-style: solid; border-width: 0.5px; padding: 2px 6px;">$aos_services_quotes_service_total_price</td>
  89. </tr>
  90. <tr>
  91. <td colspan="6">&nbsp;</td>
  92. <td style="border-style: solid; border-width: 0.5px; padding: 2px 6px; font-weight: bold; text-align: right;">'.translate('LBL_TOTAL_AMT','AOS_Quotes').'</td>
  93. <td style="border-style: solid; border-width: 0.5px; padding: 2px 6px;">$total_amt</td>
  94. </tr>
  95. <tr>
  96. <td colspan="6">&nbsp;</td>
  97. <td style="border-style: solid; border-width: 0.5px; padding: 2px 6px; font-weight: bold; text-align: right;">'.translate('LBL_DISCOUNT_AMOUNT','AOS_Quotes').'</td>
  98. <td style="border-style: solid; border-width: 0.5px; padding: 2px 6px;">$discount_amount</td>
  99. </tr>
  100. <tr>
  101. <td colspan="6">&nbsp;</td>
  102. <td style="border-style: solid; border-width: 0.5px; padding: 2px 6px; font-weight: bold; text-align: right;">'.translate('LBL_SUBTOTAL_AMOUNT','AOS_Quotes').'</td>
  103. <td style="border-style: solid; border-width: 0.5px; padding: 2px 6px;">$subtotal_amount</td>
  104. </tr>
  105. <tr>
  106. <td colspan="6">&nbsp;</td>
  107. <td style="border-style: solid; border-width: 0.5px; padding: 2px 6px; font-weight: bold; text-align: right;">'.translate('LBL_TAX_AMOUNT','AOS_Quotes').'</td>
  108. <td style="border-style: solid; border-width: 0.5px; padding: 2px 6px;">$tax_amount</td>
  109. </tr>
  110. <tr>
  111. <td colspan="6">&nbsp;</td>
  112. <td style="border-style: solid; border-width: 0.5px; padding: 2px 6px; font-weight: bold; text-align: right;">'.translate('LBL_SHIPPING_AMOUNT','AOS_Quotes').'</td>
  113. <td style="border-style: solid; border-width: 0.5px; padding: 2px 6px;">$shipping_amount</td>
  114. </tr>
  115. <tr>
  116. <td colspan="6">&nbsp;</td>
  117. <td style="border-style: solid; border-width: 0.5px; padding: 2px 6px; font-weight: bold; text-align: right;">'.translate('LBL_GRAND_TOTAL','AOS_Quotes').'</td>
  118. <td style="border-style: solid; border-width: 0.5px; padding: 2px 6px;">$total_amount</td>
  119. </tr>
  120. </tbody>
  121. </table>
  122. <p>&nbsp;</p>';
  123. }
  124. function getHeader() {
  125. return '';
  126. }
  127. function getFooter() {
  128. global $locale;
  129. return '<table style="width: 100%; border: 0pt none; border-spacing: 0pt;">
  130. <tbody>
  131. <tr>
  132. <td>'.translate('LBL_PAGE','AOS_PDF_Templates').' {PAGENO}</td>
  133. <td style="text-align: right;">{DATE '.$locale->getPrecedentPreference('default_date_format').'}</td>
  134. </tr>
  135. </tbody>
  136. </table>';
  137. }
  138. }
  139. ?>