[-] PDF : Bug Fixed #PSFV-330 - Shopname not correct on invoice

This commit is contained in:
fBrignoli
2012-01-05 15:30:34 +00:00
parent 5e909ae891
commit 0800290ab2
5 changed files with 13 additions and 13 deletions
+9 -5
View File
@@ -33,9 +33,9 @@ abstract class HTMLTemplateCore
{ {
public $title; public $title;
public $date; public $date;
public $address;
public $available_in_your_account = true; public $available_in_your_account = true;
public $smarty; public $smarty;
public $shop;
/** /**
* Returns the template's HTML header * Returns the template's HTML header
@@ -49,7 +49,7 @@ abstract class HTMLTemplateCore
'img_update_time' => Configuration::get('PS_IMG_UPDATE_TIME'), 'img_update_time' => Configuration::get('PS_IMG_UPDATE_TIME'),
'title' => $this->title, 'title' => $this->title,
'date' => $this->date, 'date' => $this->date,
'shop_name' => Configuration::get('PS_SHOP_NAME') 'shop_name' => $this->shop->name
)); ));
return $this->smarty->fetch(_PS_THEME_DIR_.'/pdf/header.tpl'); return $this->smarty->fetch(_PS_THEME_DIR_.'/pdf/header.tpl');
@@ -62,9 +62,13 @@ abstract class HTMLTemplateCore
public function getFooter() public function getFooter()
{ {
$shop_address = ''; $shop_address = '';
if (isset($this->address) && $this->address instanceof Address) if (Validate::isLoadedObject($this->shop))
$shop_address = AddressFormat::generateAddress($this->address, array(), ' - ', ' '); {
$shop_address_obj = $this->shop->getAddress();
if (isset($shop_address_obj) && $shop_address_obj instanceof Address)
$shop_address = AddressFormat::generateAddress($shop_address_obj, array(), ' - ', ' ');
}
$this->smarty->assign(array( $this->smarty->assign(array(
'available_in_your_account' => $this->available_in_your_account, 'available_in_your_account' => $this->available_in_your_account,
'shop_address' => $shop_address, 'shop_address' => $shop_address,
+1 -2
View File
@@ -43,8 +43,7 @@ class HTMLTemplateDeliverySlipCore extends HTMLTemplate
$this->title = self::l('Delivery').' #'.Configuration::get('PS_DELIVERY_PREFIX', Context::getContext()->language->id).sprintf('%06d', $this->order_invoice->delivery_number); $this->title = self::l('Delivery').' #'.Configuration::get('PS_DELIVERY_PREFIX', Context::getContext()->language->id).sprintf('%06d', $this->order_invoice->delivery_number);
// footer informations // footer informations
$shop = new Shop((int)$this->order->id_shop); $this->shop = new Shop((int)$this->order->id_shop);
$this->address = $shop->getAddress();
} }
/** /**
+1 -2
View File
@@ -45,8 +45,7 @@ class HTMLTemplateInvoiceCore extends HTMLTemplate
$this->title = self::l('Invoice ').' #'.Configuration::get('PS_INVOICE_PREFIX', Context::getContext()->language->id).sprintf('%06d', $order_invoice->number); $this->title = self::l('Invoice ').' #'.Configuration::get('PS_INVOICE_PREFIX', Context::getContext()->language->id).sprintf('%06d', $order_invoice->number);
// footer informations // footer informations
$shop = new Shop((int)$this->order->id_shop); $this->shop = new Shop((int)$this->order->id_shop);
$this->address = $shop->getAddress();
} }
/** /**
+1 -2
View File
@@ -44,8 +44,7 @@ class HTMLTemplateOrderReturnCore extends HTMLTemplate
$this->title = 'Order Return '.sprintf('%06d', $this->order_return->id); // TODO $this->title = 'Order Return '.sprintf('%06d', $this->order_return->id); // TODO
// footer informations // footer informations
$shop = new Shop((int)$this->order->id_shop); $this->shop = new Shop((int)$this->order->id_shop);
$this->address = $shop->getAddress();
} }
/** /**
+1 -2
View File
@@ -50,8 +50,7 @@ class HTMLTemplateOrderSlipCore extends HTMLTemplateInvoice
$this->title = self::l('Slip #').sprintf('%06d', $this->order_slip->id); $this->title = self::l('Slip #').sprintf('%06d', $this->order_slip->id);
// footer informations // footer informations
$shop = new Shop((int)$this->order->id_shop); $this->shop = new Shop((int)$this->order->id_shop);
$this->address = $shop->getAddress();
} }
/** /**