Here is my patch to make values from the product table also available in the pdf template for quotes:
# diff -u application/modules/quotes/models/Mdl_quote_items.php.orig application/modules/quotes/models/Mdl_quote_items.php
--- application/modules/quotes/models/Mdl_quote_items.php.orig 2020-04-11 19:02:08.000000000 +0200
+++ application/modules/quotes/models/Mdl_quote_items.php 2021-01-11 11:30:00.981821000 +0100
@@ -24,7 +24,8 @@
public function default_select()
{
- $this->db->select('ip_quote_item_amounts.*, ip_quote_items.*, item_tax_rates.tax_rate_percent AS item_tax_rate_percent');
+ $this->db->select('ip_quote_item_amounts.*, ip_products.*, ip_quote_items.*,
+ item_tax_rates.tax_rate_percent AS item_tax_rate_percent');
}
public function default_order_by()
@@ -36,6 +37,7 @@
{
$this->db->join('ip_quote_item_amounts', 'ip_quote_item_amounts.item_id = ip_quote_items.item_id', 'left');
$this->db->join('ip_tax_rates AS item_tax_rates', 'item_tax_rates.tax_rate_id = ip_quote_items.item_tax_rate_id', 'left');
+ $this->db->join('ip_products', 'ip_products.product_id = ip_quote_items.item_product_id', 'left');
}
/**
@@ -49,6 +51,11 @@
'label' => trans('quote'),
'rules' => 'required',
],
+ 'item_sku' => [
+ 'field' => 'item_sku',
+ 'label' => trans('item_sku'),
+ 'rules' => 'required|unique',
+ ],
'item_name' => [
'field' => 'item_name',
'label' => trans('item_name'),
The patch was done against the currently released version 1.5.11. Maybe it’s something to include in 1.5.12?
DISCLAIMER: When you use this patch, you alter a part of the core code and this patch will be lost after every update to the core code (unless it gets incorporated by someone with commit privileges). You have to re-patch after each core code update!
Bye.
Markus