✏️ 正在编辑: HTMLTemplatePo.php
路径:
/home/bpioifn/www/pigmentse/modules/bmsprocurement/classes/HTMLTemplatePo.php
提示:
您可以编辑任何文件(包括二进制文件),但请注意不当修改可能导致文件损坏。
<?php /** * 2007-2017 PrestaShop * * NOTICE OF LICENSE * * This source file is subject to the Open Software License (OSL 3.0) * that is bundled with this package in the file LICENSE.txt. * It is also available through the world-wide-web at this URL: * https://opensource.org/licenses/OSL-3.0 * If you did not receive a copy of the license and are unable to * obtain it through the world-wide-web, please send an email * to license@prestashop.com so we can send you a copy immediately. * * DISCLAIMER * * Do not edit or add to this file if you wish to upgrade PrestaShop to newer * versions in the future. If you wish to customize PrestaShop for your * needs please refer to http://www.prestashop.com for more information. * * @author PrestaShop SA <contact@prestashop.com> * @copyright 2007-2017 PrestaShop SA * @license https://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0) * International Registered Trademark & Property of PrestaShop SA */ /** * * @since 1.5 */ class HTMLTemplatePo extends HTMLTemplate { public $purchaseOrder; /** * * @param OrderInvoice $order_invoice * @param * $smarty * @throws PrestaShopException */ public function __construct(BmsProcurementPurchaseOrder $po, $smarty, $bulk_mode = false) { $this->purchaseOrder = $po; $this->smarty = $smarty; // header informations $this->date = Tools::displayDate($po->date_add); $id_lang = Context::getContext()->language->id; $this->title = $po->reference; $this->shop = 1; } public function getBulkFilename() { return parent::getBulkFilename(); } /** * Returns the template's HTML header * * @return string HTML header */ public function getHeader() { $this->assignCommonHeaderData(); $employee = Context::getContext()->employee; $supplier = new Supplier($this->purchaseOrder->supplier_id); $this->smarty->assign(array( 'purchase_order' => $this->purchaseOrder, 'employee' => $employee, 'supplier_name' => $supplier->name, 'payment_term_name' => BmsProcurementPaymentTerm::getPaymentTermFromId($this->purchaseOrder->supplier_payment_terms_id) )); return $this->smarty->fetch(_PS_MODULE_DIR_ . 'bmsprocurement/views/templates/admin/pdf/purchaseorder/header_purchaseorder.tpl'); } public function getFooter() { return ''; } /** * Returns the template's HTML content * * @return string HTML content */ public function getContent() { $id_address_supplier = Address::getAddressIdBySupplierId($this->purchaseOrder->supplier_id); /* * echo '<pre>'; * var_dump(Context::getContext()->employee); * die(); */ $arrPop = $this->purchaseOrder->getProducts($this->purchaseOrder->id); $subTotal = BmsProcurementPurchaseOrderProduct::getSubTotal($this->purchaseOrder->id); $subTotalTaxed = BmsProcurementPurchaseOrderProduct::getSubTotalTaxed($this->purchaseOrder->id); $shipping = $this->purchaseOrder->additional_cost + $this->purchaseOrder->shipping_cost; $taxes = $subTotalTaxed + ($shipping * $this->purchaseOrder->taxe_rate / 100); $data = array( 'purchase_order' => $this->purchaseOrder, 'products' => $arrPop, 'taxes' => $taxes, 'po' => $this->purchaseOrder, 'shipping' => $shipping, 'sub_total' => $subTotal, 'total' => $subTotal + $shipping + $taxes ) ; $this->smarty->assign($data); $tpls = array( 'style_tab' => $this->smarty->fetch(_PS_MODULE_DIR_ . 'bmsprocurement/views/templates/admin/pdf/style.tpl'), 'addresses_tab' => $this->smarty->fetch(_PS_MODULE_DIR_ . 'bmsprocurement/views/templates/admin/pdf/purchaseorder/addresses.tpl'), 'comments_tab' => $this->smarty->fetch(_PS_MODULE_DIR_ . 'bmsprocurement/views/templates/admin/pdf/purchaseorder/comments.tpl'), 'product_tab' => $this->smarty->fetch(_PS_MODULE_DIR_ . 'bmsprocurement/views/templates/admin/pdf/purchaseorder/product-tab.tpl'), 'total_tab' => $this->smarty->fetch(_PS_MODULE_DIR_ . 'bmsprocurement/views/templates/admin/pdf/purchaseorder/total-tab.tpl') ); $this->smarty->assign($tpls); return $this->smarty->fetch(_PS_MODULE_DIR_ . 'bmsprocurement/views/templates/admin/pdf/purchaseorder/purchaseorder.tpl'); } /** * Returns the template filename * * @return string filename */ public function getFilename() { return 'purchase_order.pdf'; } }
💾 保存文件
← 返回文件管理器