first commit
This commit is contained in:
22
plugins/stProductReturnsPlugin/config/config.php
Normal file
22
plugins/stProductReturnsPlugin/config/config.php
Normal file
@@ -0,0 +1,22 @@
|
||||
<?php
|
||||
|
||||
if (SF_APP == 'backend')
|
||||
{
|
||||
stPluginHelper::addEnableModule('stProductReturnsBackend');
|
||||
stPluginHelper::addEnableModule('stProductReturnsPdf', 'backend');
|
||||
|
||||
stPluginHelper::addRouting('stProductReturnsBackend', '/st-product-returns/:action/*', 'stProductReturnsBackend', 'list');
|
||||
stConfiguration::addModule(['label' => 'Zwroty produktów', 'route' => '@stProductReturnsBackend', 'icon' => 'stProductReturnsPlugin'], 'sale');
|
||||
stPluginHelper::addRouting('stProductReturnsPdf', '/productReturnsPdf/*', 'stProductReturnsPdf', 'show', 'backend');
|
||||
|
||||
|
||||
}
|
||||
elseif (SF_APP == 'frontend')
|
||||
{
|
||||
stPluginHelper::addEnableModule('stProductReturnsFrontend');
|
||||
stPluginHelper::addEnableModule('stProductReturnsPdf', 'frontend');
|
||||
|
||||
stPluginHelper::addRouting('stProductReturnsFrontend', '/productReturns/:action/*', 'stProductReturnsFrontend', 'index');
|
||||
stPluginHelper::addRouting('stProductReturnsPdf', '/productReturnsPdf/*', 'stProductReturnsPdf', 'show', 'frontend');
|
||||
|
||||
}
|
||||
83
plugins/stProductReturnsPlugin/config/schema.yml
Normal file
83
plugins/stProductReturnsPlugin/config/schema.yml
Normal file
@@ -0,0 +1,83 @@
|
||||
---
|
||||
propel:
|
||||
_attributes:
|
||||
defaultIdMethod: native
|
||||
package: plugins.stProductReturnsPlugin.lib.model
|
||||
st_product_returns:
|
||||
_attributes:
|
||||
phpName: stProductReturns
|
||||
id:
|
||||
type: INTEGER
|
||||
primaryKey: true
|
||||
required: true
|
||||
autoIncrement: true
|
||||
created_at:
|
||||
type: timestamp
|
||||
updated_at:
|
||||
type: timestamp
|
||||
order_id:
|
||||
type: INTEGER
|
||||
foreignTable: st_order
|
||||
foreignReference: id
|
||||
onDelete: setnull
|
||||
return_type:
|
||||
type: VARCHAR
|
||||
size: 255
|
||||
return_status:
|
||||
type: VARCHAR
|
||||
size: 255
|
||||
user_fullname:
|
||||
type: VARCHAR
|
||||
size: 255
|
||||
user_email:
|
||||
type: VARCHAR
|
||||
size: 255
|
||||
user_phone:
|
||||
type: VARCHAR
|
||||
size: 255
|
||||
user_bank_account:
|
||||
type: VARCHAR
|
||||
size: 255
|
||||
description_complaint:
|
||||
type: LONGVARCHAR
|
||||
description_return:
|
||||
type: LONGVARCHAR
|
||||
admin_note:
|
||||
type: LONGVARCHAR
|
||||
|
||||
st_product_returns_has_order_product:
|
||||
_attributes:
|
||||
phpName: ProductReturnsHasOrderProduct
|
||||
created_at:
|
||||
type: timestamp
|
||||
updated_at:
|
||||
type: timestamp
|
||||
id:
|
||||
type: INTEGER
|
||||
primaryKey: true
|
||||
required: true
|
||||
autoIncrement: true
|
||||
product_returns_id:
|
||||
type: INTEGER
|
||||
primaryKey: true
|
||||
required: true
|
||||
foreignTable: st_product_returns
|
||||
foreignReference: id
|
||||
onDelete: cascade
|
||||
order_product_id:
|
||||
type: INTEGER
|
||||
primaryKey: true
|
||||
required: true
|
||||
foreignTable: st_order_product
|
||||
foreignReference: id
|
||||
onDelete: cascade
|
||||
order_id:
|
||||
type: INTEGER
|
||||
foreignTable: st_order
|
||||
foreignReference: id
|
||||
onDelete: setnull
|
||||
quantity:
|
||||
type: DECIMAL
|
||||
size: 8
|
||||
scale: 2
|
||||
required: true
|
||||
@@ -0,0 +1,12 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Subclass for representing a row from the 'st_product_returns_has_order_product' table.
|
||||
*
|
||||
*
|
||||
*
|
||||
* @package plugins.stProductReturnsPlugin.lib.model
|
||||
*/
|
||||
class ProductReturnsHasOrderProduct extends BaseProductReturnsHasOrderProduct
|
||||
{
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Subclass for performing query and update operations on the 'st_product_returns_has_order_product' table.
|
||||
*
|
||||
*
|
||||
*
|
||||
* @package plugins.stProductReturnsPlugin.lib.model
|
||||
*/
|
||||
class ProductReturnsHasOrderProductPeer extends BaseProductReturnsHasOrderProductPeer
|
||||
{
|
||||
}
|
||||
@@ -0,0 +1,80 @@
|
||||
<?php
|
||||
|
||||
|
||||
/**
|
||||
* This class adds structure of 'st_product_returns_has_order_product' table to 'propel' DatabaseMap object.
|
||||
*
|
||||
*
|
||||
*
|
||||
* These statically-built map classes are used by Propel to do runtime db structure discovery.
|
||||
* For example, the createSelectSql() method checks the type of a given column used in an
|
||||
* ORDER BY clause to know whether it needs to apply SQL to make the ORDER BY case-insensitive
|
||||
* (i.e. if it's a text column type).
|
||||
*
|
||||
* @package plugins.stProductReturnsPlugin.lib.model.map
|
||||
*/
|
||||
class ProductReturnsHasOrderProductMapBuilder {
|
||||
|
||||
/**
|
||||
* The (dot-path) name of this class
|
||||
*/
|
||||
const CLASS_NAME = 'plugins.stProductReturnsPlugin.lib.model.map.ProductReturnsHasOrderProductMapBuilder';
|
||||
|
||||
/**
|
||||
* The database map.
|
||||
*/
|
||||
private $dbMap;
|
||||
|
||||
/**
|
||||
* Tells us if this DatabaseMapBuilder is built so that we
|
||||
* don't have to re-build it every time.
|
||||
*
|
||||
* @return boolean true if this DatabaseMapBuilder is built, false otherwise.
|
||||
*/
|
||||
public function isBuilt()
|
||||
{
|
||||
return ($this->dbMap !== null);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the databasemap this map builder built.
|
||||
*
|
||||
* @return the databasemap
|
||||
*/
|
||||
public function getDatabaseMap()
|
||||
{
|
||||
return $this->dbMap;
|
||||
}
|
||||
|
||||
/**
|
||||
* The doBuild() method builds the DatabaseMap
|
||||
*
|
||||
* @return void
|
||||
* @throws PropelException
|
||||
*/
|
||||
public function doBuild()
|
||||
{
|
||||
$this->dbMap = Propel::getDatabaseMap('propel');
|
||||
|
||||
$tMap = $this->dbMap->addTable('st_product_returns_has_order_product');
|
||||
$tMap->setPhpName('ProductReturnsHasOrderProduct');
|
||||
|
||||
$tMap->setUseIdGenerator(true);
|
||||
|
||||
$tMap->addColumn('CREATED_AT', 'CreatedAt', 'int', CreoleTypes::TIMESTAMP, false, null);
|
||||
|
||||
$tMap->addColumn('UPDATED_AT', 'UpdatedAt', 'int', CreoleTypes::TIMESTAMP, false, null);
|
||||
|
||||
$tMap->addPrimaryKey('ID', 'Id', 'int', CreoleTypes::INTEGER, true, null);
|
||||
|
||||
$tMap->addForeignPrimaryKey('PRODUCT_RETURNS_ID', 'ProductReturnsId', 'int' , CreoleTypes::INTEGER, 'st_product_returns', 'ID', true, null);
|
||||
|
||||
$tMap->addForeignPrimaryKey('ORDER_PRODUCT_ID', 'OrderProductId', 'int' , CreoleTypes::INTEGER, 'st_order_product', 'ID', true, null);
|
||||
|
||||
$tMap->addForeignKey('ORDER_ID', 'OrderId', 'int', CreoleTypes::INTEGER, 'st_order', 'ID', false, null);
|
||||
|
||||
$tMap->addColumn('QUANTITY', 'Quantity', 'double', CreoleTypes::DECIMAL, true, 8);
|
||||
|
||||
} // doBuild()
|
||||
|
||||
} // ProductReturnsHasOrderProductMapBuilder
|
||||
@@ -0,0 +1,92 @@
|
||||
<?php
|
||||
|
||||
|
||||
/**
|
||||
* This class adds structure of 'st_product_returns' table to 'propel' DatabaseMap object.
|
||||
*
|
||||
*
|
||||
*
|
||||
* These statically-built map classes are used by Propel to do runtime db structure discovery.
|
||||
* For example, the createSelectSql() method checks the type of a given column used in an
|
||||
* ORDER BY clause to know whether it needs to apply SQL to make the ORDER BY case-insensitive
|
||||
* (i.e. if it's a text column type).
|
||||
*
|
||||
* @package plugins.stProductReturnsPlugin.lib.model.map
|
||||
*/
|
||||
class stProductReturnsMapBuilder {
|
||||
|
||||
/**
|
||||
* The (dot-path) name of this class
|
||||
*/
|
||||
const CLASS_NAME = 'plugins.stProductReturnsPlugin.lib.model.map.stProductReturnsMapBuilder';
|
||||
|
||||
/**
|
||||
* The database map.
|
||||
*/
|
||||
private $dbMap;
|
||||
|
||||
/**
|
||||
* Tells us if this DatabaseMapBuilder is built so that we
|
||||
* don't have to re-build it every time.
|
||||
*
|
||||
* @return boolean true if this DatabaseMapBuilder is built, false otherwise.
|
||||
*/
|
||||
public function isBuilt()
|
||||
{
|
||||
return ($this->dbMap !== null);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the databasemap this map builder built.
|
||||
*
|
||||
* @return the databasemap
|
||||
*/
|
||||
public function getDatabaseMap()
|
||||
{
|
||||
return $this->dbMap;
|
||||
}
|
||||
|
||||
/**
|
||||
* The doBuild() method builds the DatabaseMap
|
||||
*
|
||||
* @return void
|
||||
* @throws PropelException
|
||||
*/
|
||||
public function doBuild()
|
||||
{
|
||||
$this->dbMap = Propel::getDatabaseMap('propel');
|
||||
|
||||
$tMap = $this->dbMap->addTable('st_product_returns');
|
||||
$tMap->setPhpName('stProductReturns');
|
||||
|
||||
$tMap->setUseIdGenerator(true);
|
||||
|
||||
$tMap->addPrimaryKey('ID', 'Id', 'int', CreoleTypes::INTEGER, true, null);
|
||||
|
||||
$tMap->addColumn('CREATED_AT', 'CreatedAt', 'int', CreoleTypes::TIMESTAMP, false, null);
|
||||
|
||||
$tMap->addColumn('UPDATED_AT', 'UpdatedAt', 'int', CreoleTypes::TIMESTAMP, false, null);
|
||||
|
||||
$tMap->addForeignKey('ORDER_ID', 'OrderId', 'int', CreoleTypes::INTEGER, 'st_order', 'ID', false, null);
|
||||
|
||||
$tMap->addColumn('RETURN_TYPE', 'ReturnType', 'string', CreoleTypes::VARCHAR, false, 255);
|
||||
|
||||
$tMap->addColumn('RETURN_STATUS', 'ReturnStatus', 'string', CreoleTypes::VARCHAR, false, 255);
|
||||
|
||||
$tMap->addColumn('USER_FULLNAME', 'UserFullname', 'string', CreoleTypes::VARCHAR, false, 255);
|
||||
|
||||
$tMap->addColumn('USER_EMAIL', 'UserEmail', 'string', CreoleTypes::VARCHAR, false, 255);
|
||||
|
||||
$tMap->addColumn('USER_PHONE', 'UserPhone', 'string', CreoleTypes::VARCHAR, false, 255);
|
||||
|
||||
$tMap->addColumn('USER_BANK_ACCOUNT', 'UserBankAccount', 'string', CreoleTypes::VARCHAR, false, 255);
|
||||
|
||||
$tMap->addColumn('DESCRIPTION_COMPLAINT', 'DescriptionComplaint', 'string', CreoleTypes::LONGVARCHAR, false, null);
|
||||
|
||||
$tMap->addColumn('DESCRIPTION_RETURN', 'DescriptionReturn', 'string', CreoleTypes::LONGVARCHAR, false, null);
|
||||
|
||||
$tMap->addColumn('ADMIN_NOTE', 'AdminNote', 'string', CreoleTypes::LONGVARCHAR, false, null);
|
||||
|
||||
} // doBuild()
|
||||
|
||||
} // stProductReturnsMapBuilder
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
1586
plugins/stProductReturnsPlugin/lib/model/om/BasestProductReturns.php
Normal file
1586
plugins/stProductReturnsPlugin/lib/model/om/BasestProductReturns.php
Normal file
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,929 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Base static class for performing query and update operations on the 'st_product_returns' table.
|
||||
*
|
||||
*
|
||||
*
|
||||
* @package plugins.stProductReturnsPlugin.lib.model.om
|
||||
*/
|
||||
abstract class BasestProductReturnsPeer {
|
||||
|
||||
/** the default database name for this class */
|
||||
const DATABASE_NAME = 'propel';
|
||||
|
||||
/** the table name for this class */
|
||||
const TABLE_NAME = 'st_product_returns';
|
||||
|
||||
/** A class that can be returned by this peer. */
|
||||
const CLASS_DEFAULT = 'plugins.stProductReturnsPlugin.lib.model.stProductReturns';
|
||||
|
||||
/** The total number of columns. */
|
||||
const NUM_COLUMNS = 13;
|
||||
|
||||
/** The number of lazy-loaded columns. */
|
||||
const NUM_LAZY_LOAD_COLUMNS = 0;
|
||||
|
||||
|
||||
/** the column name for the ID field */
|
||||
const ID = 'st_product_returns.ID';
|
||||
|
||||
/** the column name for the CREATED_AT field */
|
||||
const CREATED_AT = 'st_product_returns.CREATED_AT';
|
||||
|
||||
/** the column name for the UPDATED_AT field */
|
||||
const UPDATED_AT = 'st_product_returns.UPDATED_AT';
|
||||
|
||||
/** the column name for the ORDER_ID field */
|
||||
const ORDER_ID = 'st_product_returns.ORDER_ID';
|
||||
|
||||
/** the column name for the RETURN_TYPE field */
|
||||
const RETURN_TYPE = 'st_product_returns.RETURN_TYPE';
|
||||
|
||||
/** the column name for the RETURN_STATUS field */
|
||||
const RETURN_STATUS = 'st_product_returns.RETURN_STATUS';
|
||||
|
||||
/** the column name for the USER_FULLNAME field */
|
||||
const USER_FULLNAME = 'st_product_returns.USER_FULLNAME';
|
||||
|
||||
/** the column name for the USER_EMAIL field */
|
||||
const USER_EMAIL = 'st_product_returns.USER_EMAIL';
|
||||
|
||||
/** the column name for the USER_PHONE field */
|
||||
const USER_PHONE = 'st_product_returns.USER_PHONE';
|
||||
|
||||
/** the column name for the USER_BANK_ACCOUNT field */
|
||||
const USER_BANK_ACCOUNT = 'st_product_returns.USER_BANK_ACCOUNT';
|
||||
|
||||
/** the column name for the DESCRIPTION_COMPLAINT field */
|
||||
const DESCRIPTION_COMPLAINT = 'st_product_returns.DESCRIPTION_COMPLAINT';
|
||||
|
||||
/** the column name for the DESCRIPTION_RETURN field */
|
||||
const DESCRIPTION_RETURN = 'st_product_returns.DESCRIPTION_RETURN';
|
||||
|
||||
/** the column name for the ADMIN_NOTE field */
|
||||
const ADMIN_NOTE = 'st_product_returns.ADMIN_NOTE';
|
||||
|
||||
/** The PHP to DB Name Mapping */
|
||||
private static $phpNameMap = null;
|
||||
|
||||
|
||||
/**
|
||||
* holds an array of fieldnames
|
||||
*
|
||||
* first dimension keys are the type constants
|
||||
* e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id'
|
||||
*/
|
||||
private static $fieldNames = array (
|
||||
BasePeer::TYPE_PHPNAME => array ('Id', 'CreatedAt', 'UpdatedAt', 'OrderId', 'ReturnType', 'ReturnStatus', 'UserFullname', 'UserEmail', 'UserPhone', 'UserBankAccount', 'DescriptionComplaint', 'DescriptionReturn', 'AdminNote', ),
|
||||
BasePeer::TYPE_COLNAME => array (stProductReturnsPeer::ID, stProductReturnsPeer::CREATED_AT, stProductReturnsPeer::UPDATED_AT, stProductReturnsPeer::ORDER_ID, stProductReturnsPeer::RETURN_TYPE, stProductReturnsPeer::RETURN_STATUS, stProductReturnsPeer::USER_FULLNAME, stProductReturnsPeer::USER_EMAIL, stProductReturnsPeer::USER_PHONE, stProductReturnsPeer::USER_BANK_ACCOUNT, stProductReturnsPeer::DESCRIPTION_COMPLAINT, stProductReturnsPeer::DESCRIPTION_RETURN, stProductReturnsPeer::ADMIN_NOTE, ),
|
||||
BasePeer::TYPE_FIELDNAME => array ('id', 'created_at', 'updated_at', 'order_id', 'return_type', 'return_status', 'user_fullname', 'user_email', 'user_phone', 'user_bank_account', 'description_complaint', 'description_return', 'admin_note', ),
|
||||
BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, )
|
||||
);
|
||||
|
||||
/**
|
||||
* holds an array of keys for quick access to the fieldnames array
|
||||
*
|
||||
* first dimension keys are the type constants
|
||||
* e.g. self::$fieldNames[BasePeer::TYPE_PHPNAME]['Id'] = 0
|
||||
*/
|
||||
private static $fieldKeys = array (
|
||||
BasePeer::TYPE_PHPNAME => array ('Id' => 0, 'CreatedAt' => 1, 'UpdatedAt' => 2, 'OrderId' => 3, 'ReturnType' => 4, 'ReturnStatus' => 5, 'UserFullname' => 6, 'UserEmail' => 7, 'UserPhone' => 8, 'UserBankAccount' => 9, 'DescriptionComplaint' => 10, 'DescriptionReturn' => 11, 'AdminNote' => 12, ),
|
||||
BasePeer::TYPE_COLNAME => array (stProductReturnsPeer::ID => 0, stProductReturnsPeer::CREATED_AT => 1, stProductReturnsPeer::UPDATED_AT => 2, stProductReturnsPeer::ORDER_ID => 3, stProductReturnsPeer::RETURN_TYPE => 4, stProductReturnsPeer::RETURN_STATUS => 5, stProductReturnsPeer::USER_FULLNAME => 6, stProductReturnsPeer::USER_EMAIL => 7, stProductReturnsPeer::USER_PHONE => 8, stProductReturnsPeer::USER_BANK_ACCOUNT => 9, stProductReturnsPeer::DESCRIPTION_COMPLAINT => 10, stProductReturnsPeer::DESCRIPTION_RETURN => 11, stProductReturnsPeer::ADMIN_NOTE => 12, ),
|
||||
BasePeer::TYPE_FIELDNAME => array ('id' => 0, 'created_at' => 1, 'updated_at' => 2, 'order_id' => 3, 'return_type' => 4, 'return_status' => 5, 'user_fullname' => 6, 'user_email' => 7, 'user_phone' => 8, 'user_bank_account' => 9, 'description_complaint' => 10, 'description_return' => 11, 'admin_note' => 12, ),
|
||||
BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, )
|
||||
);
|
||||
|
||||
protected static $hydrateMethod = null;
|
||||
|
||||
protected static $postHydrateMethod = null;
|
||||
|
||||
public static function setHydrateMethod($callback)
|
||||
{
|
||||
self::$hydrateMethod = $callback;
|
||||
}
|
||||
|
||||
public static function setPostHydrateMethod($callback)
|
||||
{
|
||||
self::$postHydrateMethod = $callback;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return MapBuilder the map builder for this peer
|
||||
* @throws PropelException Any exceptions caught during processing will be
|
||||
* rethrown wrapped into a PropelException.
|
||||
*/
|
||||
public static function getMapBuilder()
|
||||
{
|
||||
return BasePeer::getMapBuilder('plugins.stProductReturnsPlugin.lib.model.map.stProductReturnsMapBuilder');
|
||||
}
|
||||
/**
|
||||
* Gets a map (hash) of PHP names to DB column names.
|
||||
*
|
||||
* @return array The PHP to DB name map for this peer
|
||||
* @throws PropelException Any exceptions caught during processing will be
|
||||
* rethrown wrapped into a PropelException.
|
||||
* @deprecated Use the getFieldNames() and translateFieldName() methods instead of this.
|
||||
*/
|
||||
public static function getPhpNameMap()
|
||||
{
|
||||
if (self::$phpNameMap === null) {
|
||||
$map = stProductReturnsPeer::getTableMap();
|
||||
$columns = $map->getColumns();
|
||||
$nameMap = array();
|
||||
foreach ($columns as $column) {
|
||||
$nameMap[$column->getPhpName()] = $column->getColumnName();
|
||||
}
|
||||
self::$phpNameMap = $nameMap;
|
||||
}
|
||||
return self::$phpNameMap;
|
||||
}
|
||||
/**
|
||||
* Translates a fieldname to another type
|
||||
*
|
||||
* @param string $name field name
|
||||
* @param string $fromType One of the class type constants TYPE_PHPNAME,
|
||||
* TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
|
||||
* @param string $toType One of the class type constants
|
||||
* @return string translated name of the field.
|
||||
*/
|
||||
static public function translateFieldName($name, $fromType, $toType)
|
||||
{
|
||||
$toNames = self::getFieldNames($toType);
|
||||
$key = isset(self::$fieldKeys[$fromType][$name]) ? self::$fieldKeys[$fromType][$name] : null;
|
||||
if ($key === null) {
|
||||
throw new PropelException("'$name' could not be found in the field names of type '$fromType'. These are: " . print_r(self::$fieldKeys[$fromType], true));
|
||||
}
|
||||
return $toNames[$key];
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns an array of of field names.
|
||||
*
|
||||
* @param string $type The type of fieldnames to return:
|
||||
* One of the class type constants TYPE_PHPNAME,
|
||||
* TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
|
||||
* @return array A list of field names
|
||||
*/
|
||||
|
||||
static public function getFieldNames($type = BasePeer::TYPE_PHPNAME)
|
||||
{
|
||||
if (!array_key_exists($type, self::$fieldNames)) {
|
||||
throw new PropelException('Method getFieldNames() expects the parameter $type to be one of the class constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM. ' . $type . ' was given.');
|
||||
}
|
||||
return self::$fieldNames[$type];
|
||||
}
|
||||
|
||||
/**
|
||||
* Convenience method which changes table.column to alias.column.
|
||||
*
|
||||
* Using this method you can maintain SQL abstraction while using column aliases.
|
||||
* <code>
|
||||
* $c->addAlias("alias1", TablePeer::TABLE_NAME);
|
||||
* $c->addJoin(TablePeer::alias("alias1", TablePeer::PRIMARY_KEY_COLUMN), TablePeer::PRIMARY_KEY_COLUMN);
|
||||
* </code>
|
||||
* @param string $alias The alias for the current table.
|
||||
* @param string $column The column name for current table. (i.e. stProductReturnsPeer::COLUMN_NAME).
|
||||
* @return string
|
||||
*/
|
||||
public static function alias($alias, $column)
|
||||
{
|
||||
return str_replace(stProductReturnsPeer::TABLE_NAME.'.', $alias.'.', $column);
|
||||
}
|
||||
|
||||
/**
|
||||
* Add all the columns needed to create a new object.
|
||||
*
|
||||
* Note: any columns that were marked with lazyLoad="true" in the
|
||||
* XML schema will not be added to the select list and only loaded
|
||||
* on demand.
|
||||
*
|
||||
* @param criteria object containing the columns to add.
|
||||
* @throws PropelException Any exceptions caught during processing will be
|
||||
* rethrown wrapped into a PropelException.
|
||||
*/
|
||||
public static function addSelectColumns(Criteria $criteria)
|
||||
{
|
||||
|
||||
$criteria->addSelectColumn(stProductReturnsPeer::ID);
|
||||
|
||||
$criteria->addSelectColumn(stProductReturnsPeer::CREATED_AT);
|
||||
|
||||
$criteria->addSelectColumn(stProductReturnsPeer::UPDATED_AT);
|
||||
|
||||
$criteria->addSelectColumn(stProductReturnsPeer::ORDER_ID);
|
||||
|
||||
$criteria->addSelectColumn(stProductReturnsPeer::RETURN_TYPE);
|
||||
|
||||
$criteria->addSelectColumn(stProductReturnsPeer::RETURN_STATUS);
|
||||
|
||||
$criteria->addSelectColumn(stProductReturnsPeer::USER_FULLNAME);
|
||||
|
||||
$criteria->addSelectColumn(stProductReturnsPeer::USER_EMAIL);
|
||||
|
||||
$criteria->addSelectColumn(stProductReturnsPeer::USER_PHONE);
|
||||
|
||||
$criteria->addSelectColumn(stProductReturnsPeer::USER_BANK_ACCOUNT);
|
||||
|
||||
$criteria->addSelectColumn(stProductReturnsPeer::DESCRIPTION_COMPLAINT);
|
||||
|
||||
$criteria->addSelectColumn(stProductReturnsPeer::DESCRIPTION_RETURN);
|
||||
|
||||
$criteria->addSelectColumn(stProductReturnsPeer::ADMIN_NOTE);
|
||||
|
||||
|
||||
if (stEventDispatcher::getInstance()->getListeners('stProductReturnsPeer.postAddSelectColumns')) {
|
||||
stEventDispatcher::getInstance()->notify(new sfEvent($criteria, 'stProductReturnsPeer.postAddSelectColumns'));
|
||||
}
|
||||
}
|
||||
|
||||
const COUNT = 'COUNT(st_product_returns.ID)';
|
||||
const COUNT_DISTINCT = 'COUNT(DISTINCT st_product_returns.ID)';
|
||||
|
||||
/**
|
||||
* Returns the number of rows matching criteria.
|
||||
*
|
||||
* @param Criteria $criteria
|
||||
* @param boolean $distinct Whether to select only distinct columns (You can also set DISTINCT modifier in Criteria).
|
||||
* @param Connection $con
|
||||
* @return int Number of matching rows.
|
||||
*/
|
||||
public static function doCount(Criteria $criteria, $distinct = false, $con = null)
|
||||
{
|
||||
// we're going to modify criteria, so copy it first
|
||||
$criteria = clone $criteria;
|
||||
|
||||
// clear out anything that might confuse the ORDER BY clause
|
||||
$criteria->clearSelectColumns()->clearOrderByColumns();
|
||||
if ($distinct || in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {
|
||||
$criteria->addSelectColumn(stProductReturnsPeer::COUNT_DISTINCT);
|
||||
} else {
|
||||
$criteria->addSelectColumn(stProductReturnsPeer::COUNT);
|
||||
}
|
||||
|
||||
// just in case we're grouping: add those columns to the select statement
|
||||
foreach($criteria->getGroupByColumns() as $column)
|
||||
{
|
||||
$criteria->addSelectColumn($column);
|
||||
}
|
||||
|
||||
$rs = stProductReturnsPeer::doSelectRS($criteria, $con);
|
||||
if ($rs->next()) {
|
||||
return $rs->getInt(1);
|
||||
} else {
|
||||
// no rows returned; we infer that means 0 matches.
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Method to select one object from the DB.
|
||||
*
|
||||
* @param Criteria $criteria object used to create the SELECT statement.
|
||||
* @param Connection $con
|
||||
* @return stProductReturns
|
||||
* @throws PropelException Any exceptions caught during processing will be
|
||||
* rethrown wrapped into a PropelException.
|
||||
*/
|
||||
public static function doSelectOne(Criteria $criteria, $con = null)
|
||||
{
|
||||
$critcopy = clone $criteria;
|
||||
$critcopy->setLimit(1);
|
||||
$objects = stProductReturnsPeer::doSelect($critcopy, $con);
|
||||
if ($objects) {
|
||||
return $objects[0];
|
||||
}
|
||||
return null;
|
||||
}
|
||||
/**
|
||||
* Method to do selects.
|
||||
*
|
||||
* @param Criteria $criteria The Criteria object used to build the SELECT statement.
|
||||
* @param Connection $con
|
||||
* @return stProductReturns[]
|
||||
* @throws PropelException Any exceptions caught during processing will be
|
||||
* rethrown wrapped into a PropelException.
|
||||
*/
|
||||
public static function doSelect(Criteria $criteria, $con = null)
|
||||
{
|
||||
return stProductReturnsPeer::populateObjects(stProductReturnsPeer::doSelectRS($criteria, $con));
|
||||
}
|
||||
/**
|
||||
* Prepares the Criteria object and uses the parent doSelect()
|
||||
* method to get a ResultSet.
|
||||
*
|
||||
* Use this method directly if you want to just get the resultset
|
||||
* (instead of an array of objects).
|
||||
*
|
||||
* @param Criteria $criteria The Criteria object used to build the SELECT statement.
|
||||
* @param Connection $con the connection to use
|
||||
* @throws PropelException Any exceptions caught during processing will be
|
||||
* rethrown wrapped into a PropelException.
|
||||
* @return ResultSet The resultset object with numerically-indexed fields.
|
||||
* @see BasePeer::doSelect()
|
||||
*/
|
||||
public static function doSelectRS(Criteria $criteria, $con = null)
|
||||
{
|
||||
if ($con === null) {
|
||||
$con = Propel::getConnection(self::DATABASE_NAME);
|
||||
}
|
||||
|
||||
if (!$criteria->getSelectColumns()) {
|
||||
$criteria = clone $criteria;
|
||||
stProductReturnsPeer::addSelectColumns($criteria);
|
||||
}
|
||||
|
||||
if (stEventDispatcher::getInstance()->getListeners('BasePeer.preDoSelectRs')) {
|
||||
stEventDispatcher::getInstance()->notify(new sfEvent($criteria, 'BasePeer.preDoSelectRs'));
|
||||
}
|
||||
|
||||
// Set the correct dbName
|
||||
$criteria->setDbName(self::DATABASE_NAME);
|
||||
|
||||
// BasePeer returns a Creole ResultSet, set to return
|
||||
// rows indexed numerically.
|
||||
$rs = BasePeer::doSelect($criteria, $con);
|
||||
|
||||
if (stEventDispatcher::getInstance()->getListeners('BasePeer.postDoSelectRs')) {
|
||||
stEventDispatcher::getInstance()->notify(new sfEvent($rs, 'BasePeer.postDoSelectRs'));
|
||||
}
|
||||
|
||||
return $rs;
|
||||
}
|
||||
/**
|
||||
* The returned array will contain objects of the default type or
|
||||
* objects that inherit from the default.
|
||||
*
|
||||
* @throws PropelException Any exceptions caught during processing will be
|
||||
* rethrown wrapped into a PropelException.
|
||||
*/
|
||||
public static function populateObjects(ResultSet $rs)
|
||||
{
|
||||
|
||||
if (self::$hydrateMethod)
|
||||
{
|
||||
return call_user_func(self::$hydrateMethod, $rs);
|
||||
}
|
||||
$results = array();
|
||||
|
||||
// set the class once to avoid overhead in the loop
|
||||
$cls = stProductReturnsPeer::getOMClass();
|
||||
$cls = Propel::import($cls);
|
||||
// populate the object(s)
|
||||
while($rs->next()) {
|
||||
|
||||
$obj = new $cls();
|
||||
$obj->hydrate($rs);
|
||||
$results[] = self::$postHydrateMethod ? call_user_func(self::$postHydrateMethod, $obj) : $obj;
|
||||
|
||||
}
|
||||
return $results;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the number of rows matching criteria, joining the related Order table
|
||||
*
|
||||
* @param Criteria $c
|
||||
* @param boolean $distinct Whether to select only distinct columns (You can also set DISTINCT modifier in Criteria).
|
||||
* @param Connection $con
|
||||
* @return int Number of matching rows.
|
||||
*/
|
||||
public static function doCountJoinOrder(Criteria $criteria, $distinct = false, $con = null)
|
||||
{
|
||||
// we're going to modify criteria, so copy it first
|
||||
$criteria = clone $criteria;
|
||||
|
||||
// clear out anything that might confuse the ORDER BY clause
|
||||
$criteria->clearSelectColumns()->clearOrderByColumns();
|
||||
if ($distinct || in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {
|
||||
$criteria->addSelectColumn(stProductReturnsPeer::COUNT_DISTINCT);
|
||||
} else {
|
||||
$criteria->addSelectColumn(stProductReturnsPeer::COUNT);
|
||||
}
|
||||
|
||||
// just in case we're grouping: add those columns to the select statement
|
||||
foreach($criteria->getGroupByColumns() as $column)
|
||||
{
|
||||
$criteria->addSelectColumn($column);
|
||||
}
|
||||
|
||||
$criteria->addJoin(stProductReturnsPeer::ORDER_ID, OrderPeer::ID, Criteria::LEFT_JOIN);
|
||||
|
||||
$rs = stProductReturnsPeer::doSelectRS($criteria, $con);
|
||||
if ($rs->next()) {
|
||||
return $rs->getInt(1);
|
||||
} else {
|
||||
// no rows returned; we infer that means 0 matches.
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Selects a collection of stProductReturns objects pre-filled with their Order objects.
|
||||
*
|
||||
* @return stProductReturns[] Array of stProductReturns objects.
|
||||
* @throws PropelException Any exceptions caught during processing will be
|
||||
* rethrown wrapped into a PropelException.
|
||||
*/
|
||||
public static function doSelectJoinOrder(Criteria $c, $con = null)
|
||||
{
|
||||
$c = clone $c;
|
||||
|
||||
// Set the correct dbName if it has not been overridden
|
||||
if ($c->getDbName() == Propel::getDefaultDB()) {
|
||||
$c->setDbName(self::DATABASE_NAME);
|
||||
}
|
||||
|
||||
stProductReturnsPeer::addSelectColumns($c);
|
||||
|
||||
OrderPeer::addSelectColumns($c);
|
||||
|
||||
$c->addJoin(stProductReturnsPeer::ORDER_ID, OrderPeer::ID, Criteria::LEFT_JOIN);
|
||||
$rs = stProductReturnsPeer::doSelectRs($c, $con);
|
||||
|
||||
if (self::$hydrateMethod)
|
||||
{
|
||||
return call_user_func(self::$hydrateMethod, $rs);
|
||||
}
|
||||
|
||||
$results = array();
|
||||
|
||||
while($rs->next()) {
|
||||
|
||||
$obj1 = new stProductReturns();
|
||||
$startcol = $obj1->hydrate($rs);
|
||||
if ($obj1->getOrderId())
|
||||
{
|
||||
|
||||
$obj2 = new Order();
|
||||
$obj2->hydrate($rs, $startcol);
|
||||
$obj2->addstProductReturns($obj1);
|
||||
}
|
||||
$results[] = self::$postHydrateMethod ? call_user_func(self::$postHydrateMethod, $obj1) : $obj1;;
|
||||
}
|
||||
return $results;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Returns the number of rows matching criteria, joining all related tables
|
||||
*
|
||||
* @param Criteria $c
|
||||
* @param boolean $distinct Whether to select only distinct columns (You can also set DISTINCT modifier in Criteria).
|
||||
* @param Connection $con
|
||||
* @return int Number of matching rows.
|
||||
*/
|
||||
public static function doCountJoinAll(Criteria $criteria, $distinct = false, $con = null)
|
||||
{
|
||||
$criteria = clone $criteria;
|
||||
|
||||
// clear out anything that might confuse the ORDER BY clause
|
||||
$criteria->clearSelectColumns()->clearOrderByColumns();
|
||||
if ($distinct || in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {
|
||||
$criteria->addSelectColumn(stProductReturnsPeer::COUNT_DISTINCT);
|
||||
} else {
|
||||
$criteria->addSelectColumn(stProductReturnsPeer::COUNT);
|
||||
}
|
||||
|
||||
// just in case we're grouping: add those columns to the select statement
|
||||
foreach($criteria->getGroupByColumns() as $column)
|
||||
{
|
||||
$criteria->addSelectColumn($column);
|
||||
}
|
||||
|
||||
$criteria->addJoin(stProductReturnsPeer::ORDER_ID, OrderPeer::ID, Criteria::LEFT_JOIN);
|
||||
|
||||
$rs = stProductReturnsPeer::doSelectRS($criteria, $con);
|
||||
if ($rs->next()) {
|
||||
return $rs->getInt(1);
|
||||
} else {
|
||||
// no rows returned; we infer that means 0 matches.
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Selects a collection of stProductReturns objects pre-filled with all related objects.
|
||||
*
|
||||
* @return stProductReturns[]
|
||||
* @throws PropelException Any exceptions caught during processing will be
|
||||
* rethrown wrapped into a PropelException.
|
||||
*/
|
||||
public static function doSelectJoinAll(Criteria $c, $con = null)
|
||||
{
|
||||
$c = clone $c;
|
||||
|
||||
// Set the correct dbName if it has not been overridden
|
||||
if ($c->getDbName() == Propel::getDefaultDB()) {
|
||||
$c->setDbName(self::DATABASE_NAME);
|
||||
}
|
||||
|
||||
stProductReturnsPeer::addSelectColumns($c);
|
||||
$startcol2 = (stProductReturnsPeer::NUM_COLUMNS - stProductReturnsPeer::NUM_LAZY_LOAD_COLUMNS) + 1;
|
||||
|
||||
OrderPeer::addSelectColumns($c);
|
||||
$startcol3 = $startcol2 + OrderPeer::NUM_COLUMNS;
|
||||
|
||||
$c->addJoin(stProductReturnsPeer::ORDER_ID, OrderPeer::ID, Criteria::LEFT_JOIN);
|
||||
|
||||
$rs = BasePeer::doSelect($c, $con);
|
||||
|
||||
if (self::$hydrateMethod)
|
||||
{
|
||||
return call_user_func(self::$hydrateMethod, $rs);
|
||||
}
|
||||
$results = array();
|
||||
|
||||
while($rs->next()) {
|
||||
|
||||
$omClass = stProductReturnsPeer::getOMClass();
|
||||
|
||||
|
||||
$cls = Propel::import($omClass);
|
||||
$obj1 = new $cls();
|
||||
$obj1->hydrate($rs);
|
||||
|
||||
|
||||
// Add objects for joined Order rows
|
||||
|
||||
$omClass = OrderPeer::getOMClass();
|
||||
|
||||
|
||||
$cls = Propel::import($omClass);
|
||||
$obj2 = new $cls();
|
||||
$obj2->hydrate($rs, $startcol2);
|
||||
|
||||
$newObject = true;
|
||||
for ($j=0, $resCount=count($results); $j < $resCount; $j++) {
|
||||
$temp_obj1 = $results[$j];
|
||||
$temp_obj2 = $temp_obj1->getOrder(); // CHECKME
|
||||
if (null !== $temp_obj2 && $temp_obj2->getPrimaryKey() === $obj2->getPrimaryKey()) {
|
||||
$newObject = false;
|
||||
$temp_obj2->addstProductReturns($obj1); // CHECKME
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if ($newObject) {
|
||||
$obj2->initstProductReturnss();
|
||||
$obj2->addstProductReturns($obj1);
|
||||
}
|
||||
|
||||
$results[] = self::$postHydrateMethod ? call_user_func(self::$postHydrateMethod, $obj1) : $obj1;
|
||||
}
|
||||
return $results;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the TableMap related to this peer.
|
||||
* This method is not needed for general use but a specific application could have a need.
|
||||
* @return TableMap
|
||||
* @throws PropelException Any exceptions caught during processing will be
|
||||
* rethrown wrapped into a PropelException.
|
||||
*/
|
||||
public static function getTableMap()
|
||||
{
|
||||
return Propel::getDatabaseMap(self::DATABASE_NAME)->getTable(self::TABLE_NAME);
|
||||
}
|
||||
|
||||
/**
|
||||
* The class that the Peer will make instances of.
|
||||
*
|
||||
* This uses a dot-path notation which is tranalted into a path
|
||||
* relative to a location on the PHP include_path.
|
||||
* (e.g. path.to.MyClass -> 'path/to/MyClass.php')
|
||||
*
|
||||
* @return string path.to.ClassName
|
||||
*/
|
||||
public static function getOMClass()
|
||||
{
|
||||
return stProductReturnsPeer::CLASS_DEFAULT;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method perform an INSERT on the database, given a stProductReturns or Criteria object.
|
||||
*
|
||||
* @param mixed $values Criteria or stProductReturns object containing data that is used to create the INSERT statement.
|
||||
* @param Connection $con the connection to use
|
||||
* @return mixed The new primary key.
|
||||
* @throws PropelException Any exceptions caught during processing will be
|
||||
* rethrown wrapped into a PropelException.
|
||||
*/
|
||||
public static function doInsert($values, $con = null)
|
||||
{
|
||||
|
||||
foreach (sfMixer::getCallables('BasestProductReturnsPeer:doInsert:pre') as $callable)
|
||||
{
|
||||
$ret = call_user_func($callable, 'BasestProductReturnsPeer', $values, $con);
|
||||
if (false !== $ret)
|
||||
{
|
||||
return $ret;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if ($con === null) {
|
||||
$con = Propel::getConnection(self::DATABASE_NAME);
|
||||
}
|
||||
|
||||
if ($values instanceof Criteria) {
|
||||
$criteria = clone $values; // rename for clarity
|
||||
} else {
|
||||
$criteria = $values->buildCriteria(); // build Criteria from stProductReturns object
|
||||
}
|
||||
|
||||
$criteria->remove(stProductReturnsPeer::ID); // remove pkey col since this table uses auto-increment
|
||||
|
||||
|
||||
// Set the correct dbName
|
||||
$criteria->setDbName(self::DATABASE_NAME);
|
||||
|
||||
try {
|
||||
// use transaction because $criteria could contain info
|
||||
// for more than one table (I guess, conceivably)
|
||||
$con->begin();
|
||||
$pk = BasePeer::doInsert($criteria, $con);
|
||||
$con->commit();
|
||||
} catch(PropelException $e) {
|
||||
$con->rollback();
|
||||
throw $e;
|
||||
}
|
||||
|
||||
|
||||
foreach (sfMixer::getCallables('BasestProductReturnsPeer:doInsert:post') as $callable)
|
||||
{
|
||||
call_user_func($callable, 'BasestProductReturnsPeer', $values, $con, $pk);
|
||||
}
|
||||
|
||||
return $pk;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method perform an UPDATE on the database, given a stProductReturns or Criteria object.
|
||||
*
|
||||
* @param mixed $values Criteria or stProductReturns object containing data that is used to create the UPDATE statement.
|
||||
* @param Connection $con The connection to use (specify Connection object to exert more control over transactions).
|
||||
* @return int The number of affected rows (if supported by underlying database driver).
|
||||
* @throws PropelException Any exceptions caught during processing will be
|
||||
* rethrown wrapped into a PropelException.
|
||||
*/
|
||||
public static function doUpdate($values, $con = null)
|
||||
{
|
||||
|
||||
foreach (sfMixer::getCallables('BasestProductReturnsPeer:doUpdate:pre') as $callable)
|
||||
{
|
||||
$ret = call_user_func($callable, 'BasestProductReturnsPeer', $values, $con);
|
||||
if (false !== $ret)
|
||||
{
|
||||
return $ret;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if ($con === null) {
|
||||
$con = Propel::getConnection(self::DATABASE_NAME);
|
||||
}
|
||||
|
||||
$selectCriteria = new Criteria(self::DATABASE_NAME);
|
||||
|
||||
if ($values instanceof Criteria) {
|
||||
$criteria = clone $values; // rename for clarity
|
||||
|
||||
$comparison = $criteria->getComparison(stProductReturnsPeer::ID);
|
||||
$selectCriteria->add(stProductReturnsPeer::ID, $criteria->remove(stProductReturnsPeer::ID), $comparison);
|
||||
|
||||
} else { // $values is stProductReturns object
|
||||
$criteria = $values->buildCriteria(); // gets full criteria
|
||||
$selectCriteria = $values->buildPkeyCriteria(); // gets criteria w/ primary key(s)
|
||||
}
|
||||
|
||||
// set the correct dbName
|
||||
$criteria->setDbName(self::DATABASE_NAME);
|
||||
|
||||
$ret = BasePeer::doUpdate($selectCriteria, $criteria, $con);
|
||||
|
||||
|
||||
foreach (sfMixer::getCallables('BasestProductReturnsPeer:doUpdate:post') as $callable)
|
||||
{
|
||||
call_user_func($callable, 'BasestProductReturnsPeer', $values, $con, $ret);
|
||||
}
|
||||
|
||||
return $ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to DELETE all rows from the st_product_returns table.
|
||||
*
|
||||
* @return int The number of affected rows (if supported by underlying database driver).
|
||||
*/
|
||||
public static function doDeleteAll($con = null)
|
||||
{
|
||||
if ($con === null) {
|
||||
$con = Propel::getConnection(self::DATABASE_NAME);
|
||||
}
|
||||
$affectedRows = 0; // initialize var to track total num of affected rows
|
||||
try {
|
||||
// use transaction because $criteria could contain info
|
||||
// for more than one table or we could emulating ON DELETE CASCADE, etc.
|
||||
$con->begin();
|
||||
$affectedRows += stProductReturnsPeer::doOnDeleteCascade(new Criteria(), $con);
|
||||
$affectedRows += BasePeer::doDeleteAll(stProductReturnsPeer::TABLE_NAME, $con);
|
||||
$con->commit();
|
||||
return $affectedRows;
|
||||
} catch (PropelException $e) {
|
||||
$con->rollback();
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Method perform a DELETE on the database, given a stProductReturns or Criteria object OR a primary key value.
|
||||
*
|
||||
* @param mixed $values Criteria or stProductReturns object or primary key or array of primary keys
|
||||
* which is used to create the DELETE statement
|
||||
* @param Connection $con the connection to use
|
||||
* @return int The number of affected rows (if supported by underlying database driver). This includes CASCADE-related rows
|
||||
* if supported by native driver or if emulated using Propel.
|
||||
* @throws PropelException Any exceptions caught during processing will be
|
||||
* rethrown wrapped into a PropelException.
|
||||
*/
|
||||
public static function doDelete($values, $con = null)
|
||||
{
|
||||
if ($con === null) {
|
||||
$con = Propel::getConnection(stProductReturnsPeer::DATABASE_NAME);
|
||||
}
|
||||
|
||||
if ($values instanceof Criteria) {
|
||||
$criteria = clone $values; // rename for clarity
|
||||
} elseif ($values instanceof stProductReturns) {
|
||||
|
||||
$criteria = $values->buildPkeyCriteria();
|
||||
} else {
|
||||
// it must be the primary key
|
||||
$criteria = new Criteria(self::DATABASE_NAME);
|
||||
$criteria->add(stProductReturnsPeer::ID, (array) $values, Criteria::IN);
|
||||
}
|
||||
|
||||
// Set the correct dbName
|
||||
$criteria->setDbName(self::DATABASE_NAME);
|
||||
|
||||
$affectedRows = 0; // initialize var to track total num of affected rows
|
||||
|
||||
try {
|
||||
// use transaction because $criteria could contain info
|
||||
// for more than one table or we could emulating ON DELETE CASCADE, etc.
|
||||
$con->begin();
|
||||
$affectedRows += stProductReturnsPeer::doOnDeleteCascade($criteria, $con);
|
||||
$affectedRows += BasePeer::doDelete($criteria, $con);
|
||||
$con->commit();
|
||||
return $affectedRows;
|
||||
} catch (PropelException $e) {
|
||||
$con->rollback();
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* This is a method for emulating ON DELETE CASCADE for DBs that don't support this
|
||||
* feature (like MySQL or SQLite).
|
||||
*
|
||||
* This method is not very speedy because it must perform a query first to get
|
||||
* the implicated records and then perform the deletes by calling those Peer classes.
|
||||
*
|
||||
* This method should be used within a transaction if possible.
|
||||
*
|
||||
* @param Criteria $criteria
|
||||
* @param Connection $con
|
||||
* @return int The number of affected rows (if supported by underlying database driver).
|
||||
*/
|
||||
protected static function doOnDeleteCascade(Criteria $criteria, Connection $con)
|
||||
{
|
||||
// initialize var to track total num of affected rows
|
||||
$affectedRows = 0;
|
||||
|
||||
// first find the objects that are implicated by the $criteria
|
||||
$objects = stProductReturnsPeer::doSelect($criteria, $con);
|
||||
foreach($objects as $obj) {
|
||||
|
||||
|
||||
// delete related ProductReturnsHasOrderProduct objects
|
||||
$c = new Criteria();
|
||||
|
||||
$c->add(ProductReturnsHasOrderProductPeer::PRODUCT_RETURNS_ID, $obj->getId());
|
||||
$affectedRows += ProductReturnsHasOrderProductPeer::doDelete($c, $con);
|
||||
}
|
||||
return $affectedRows;
|
||||
}
|
||||
|
||||
/**
|
||||
* Validates all modified columns of given stProductReturns object.
|
||||
* If parameter $columns is either a single column name or an array of column names
|
||||
* than only those columns are validated.
|
||||
*
|
||||
* NOTICE: This does not apply to primary or foreign keys for now.
|
||||
*
|
||||
* @param stProductReturns $obj The object to validate.
|
||||
* @param mixed $cols Column name or array of column names.
|
||||
*
|
||||
* @return mixed TRUE if all columns are valid or the error message of the first invalid column.
|
||||
*/
|
||||
public static function doValidate(stProductReturns $obj, $cols = null)
|
||||
{
|
||||
$columns = array();
|
||||
|
||||
if ($cols) {
|
||||
$dbMap = Propel::getDatabaseMap(stProductReturnsPeer::DATABASE_NAME);
|
||||
$tableMap = $dbMap->getTable(stProductReturnsPeer::TABLE_NAME);
|
||||
|
||||
if (! is_array($cols)) {
|
||||
$cols = array($cols);
|
||||
}
|
||||
|
||||
foreach($cols as $colName) {
|
||||
if ($tableMap->containsColumn($colName)) {
|
||||
$get = 'get' . $tableMap->getColumn($colName)->getPhpName();
|
||||
$columns[$colName] = $obj->$get();
|
||||
}
|
||||
}
|
||||
} else {
|
||||
|
||||
}
|
||||
|
||||
$res = BasePeer::doValidate(stProductReturnsPeer::DATABASE_NAME, stProductReturnsPeer::TABLE_NAME, $columns);
|
||||
if ($res !== true) {
|
||||
$request = sfContext::getInstance()->getRequest();
|
||||
foreach ($res as $failed) {
|
||||
$col = stProductReturnsPeer::translateFieldname($failed->getColumn(), BasePeer::TYPE_COLNAME, BasePeer::TYPE_PHPNAME);
|
||||
$request->setError($col, $failed->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
return $res;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve a single object by pkey.
|
||||
*
|
||||
* @param mixed $pk the primary key.
|
||||
* @param Connection $con the connection to use
|
||||
* @return stProductReturns
|
||||
*/
|
||||
public static function retrieveByPK($pk, $con = null)
|
||||
{
|
||||
if ($con === null) {
|
||||
$con = Propel::getConnection(self::DATABASE_NAME);
|
||||
}
|
||||
|
||||
$criteria = new Criteria(stProductReturnsPeer::DATABASE_NAME);
|
||||
|
||||
$criteria->add(stProductReturnsPeer::ID, $pk);
|
||||
|
||||
|
||||
$v = stProductReturnsPeer::doSelect($criteria, $con);
|
||||
|
||||
return !empty($v) > 0 ? $v[0] : null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve multiple objects by pkey.
|
||||
*
|
||||
* @param array $pks List of primary keys
|
||||
* @param Connection $con the connection to use
|
||||
* @throws PropelException Any exceptions caught during processing will be
|
||||
* rethrown wrapped into a PropelException.
|
||||
* @return stProductReturns[]
|
||||
*/
|
||||
public static function retrieveByPKs($pks, $con = null)
|
||||
{
|
||||
if ($con === null) {
|
||||
$con = Propel::getConnection(self::DATABASE_NAME);
|
||||
}
|
||||
|
||||
$objs = null;
|
||||
if (empty($pks)) {
|
||||
$objs = array();
|
||||
} else {
|
||||
$criteria = new Criteria();
|
||||
$criteria->add(stProductReturnsPeer::ID, $pks, Criteria::IN);
|
||||
$objs = stProductReturnsPeer::doSelect($criteria, $con);
|
||||
}
|
||||
return $objs;
|
||||
}
|
||||
|
||||
} // BasestProductReturnsPeer
|
||||
|
||||
// static code to register the map builder for this Peer with the main Propel class
|
||||
if (Propel::isInit()) {
|
||||
// the MapBuilder classes register themselves with Propel during initialization
|
||||
// so we need to load them here.
|
||||
try {
|
||||
BasestProductReturnsPeer::getMapBuilder();
|
||||
} catch (Exception $e) {
|
||||
Propel::log('Could not initialize Peer: ' . $e->getMessage(), Propel::LOG_ERR);
|
||||
}
|
||||
} else {
|
||||
// even if Propel is not yet initialized, the map builder class can be registered
|
||||
// now and then it will be loaded when Propel initializes.
|
||||
Propel::registerMapBuilder('plugins.stProductReturnsPlugin.lib.model.map.stProductReturnsMapBuilder');
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Subclass for representing a row from the 'st_product_returns' table.
|
||||
*
|
||||
*
|
||||
*
|
||||
* @package plugins.stProductReturnsPlugin.lib.model
|
||||
*/
|
||||
class stProductReturns extends BasestProductReturns
|
||||
{
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Subclass for performing query and update operations on the 'st_product_returns' table.
|
||||
*
|
||||
*
|
||||
*
|
||||
* @package plugins.stProductReturnsPlugin.lib.model
|
||||
*/
|
||||
class stProductReturnsPeer extends BasestProductReturnsPeer
|
||||
{
|
||||
}
|
||||
176
plugins/stProductReturnsPlugin/lib/stProductReturnsPdf.class.php
Normal file
176
plugins/stProductReturnsPlugin/lib/stProductReturnsPdf.class.php
Normal file
@@ -0,0 +1,176 @@
|
||||
<?php
|
||||
/**
|
||||
*
|
||||
*/
|
||||
|
||||
class stProductReturnsPdf {
|
||||
|
||||
protected $pdf = null;
|
||||
|
||||
protected $productReturns = null;
|
||||
|
||||
protected $showBorder = 0;
|
||||
|
||||
public static $PDF_MARGIN_TOP = 5;
|
||||
|
||||
public static $PDF_MARGIN_LEFT = 5;
|
||||
|
||||
public static $PDF_MARGIN_RIGHT = 5;
|
||||
|
||||
protected $download = "D";
|
||||
|
||||
public function __construct($productReturnsId) {
|
||||
|
||||
use_helper('nifty', 'stOrder', 'stUrl', 'stProductOptions', 'stProductImage', 'stDelivery');
|
||||
|
||||
sfLoader::loadHelpers('stProduct', 'stProduct');
|
||||
|
||||
/**
|
||||
* inicjalizacja klasy stInvoicePdf
|
||||
*/
|
||||
$this->pdf = new stCustomTCPDF();
|
||||
|
||||
$c = new Criteria();
|
||||
$c->add(stProductReturnsPeer::ID, $productReturnsId);
|
||||
$this->productReturns = stProductReturnsPeer::doSelectOne($c);
|
||||
|
||||
$c = new Criteria();
|
||||
$c->add(ProductReturnsHasOrderProductPeer::PRODUCT_RETURNS_ID, $this->productReturns->getId());
|
||||
$orderProducts = ProductReturnsHasOrderProductPeer::doSelect($c);
|
||||
|
||||
foreach($orderProducts as $orderProduct){
|
||||
|
||||
$orderProductReturns[$orderProduct->getOrderProductId()] = $orderProduct->getQuantity();
|
||||
|
||||
}
|
||||
|
||||
$order_products = $this->productReturns->getOrder()->getOrderProducts();
|
||||
|
||||
$currency = $this->productReturns->getOrder()->getOrderCurrency();
|
||||
|
||||
$results = array();
|
||||
|
||||
$total_amount_return = 0;
|
||||
|
||||
foreach ($order_products as $order_product)
|
||||
{
|
||||
$total_amount = 0;
|
||||
|
||||
if(array_key_exists($order_product->getId(), $orderProductReturns)){
|
||||
|
||||
$row['code'] = $order_product->getCode();
|
||||
|
||||
$row['validate'] = $order_product->productValidate();
|
||||
|
||||
|
||||
$row['name_show'] = $order_product->getName();
|
||||
|
||||
|
||||
if ($order_product->hasPriceModifiers())
|
||||
{
|
||||
$row['name_show'] = content_tag('div', $row['name_show'], array('class' => 'st_product_name_with_options')).st_product_options_get_view($order_product);
|
||||
}
|
||||
|
||||
$row['price'] = st_order_price_format($order_product->getPriceNetto(true), $currency);
|
||||
|
||||
$row['vat'] = $order_product->getVat();
|
||||
|
||||
$row['price_true'] = st_order_price_format($order_product->getPriceBrutto(true), $currency);
|
||||
|
||||
$row['uom'] = st_product_uom($order_product->getProduct());
|
||||
|
||||
$row['quantity'] = $orderProductReturns[$order_product->getId()];
|
||||
|
||||
$total_amount = $order_product->getPriceBrutto(true) * $orderProductReturns[$order_product->getId()];
|
||||
|
||||
$row['total_amount'] = st_order_price_format($total_amount, $currency);
|
||||
|
||||
|
||||
$results[] = $row;
|
||||
|
||||
$total_amount_return = $total_amount_return + $total_amount;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
$this->total_amount_return = st_order_price_format($total_amount_return, $currency);
|
||||
|
||||
$this->results = $results;
|
||||
|
||||
|
||||
//tryb developerski
|
||||
if (SF_DEBUG) $this->showBorder=1;
|
||||
|
||||
$this->configure();
|
||||
}
|
||||
|
||||
public function getProductReturns()
|
||||
{
|
||||
return $this->productReturns;
|
||||
}
|
||||
|
||||
public function getResults()
|
||||
{
|
||||
return $this->results;
|
||||
}
|
||||
|
||||
protected function configure() {
|
||||
$this->pdf->SetFont("dejavusans", "", 11);
|
||||
$this->pdf->SetMargins(stProductReturnsPdf::$PDF_MARGIN_LEFT, stProductReturnsPdf::$PDF_MARGIN_TOP, stProductReturnsPdf::$PDF_MARGIN_RIGHT);
|
||||
$this->pdf->AddPage();
|
||||
}
|
||||
|
||||
public function forceDownload($download = false) {
|
||||
$this->download = $download?"D":"I";
|
||||
}
|
||||
|
||||
public function renderProductReturns($culture_url = false, $hash_code = false) {
|
||||
|
||||
$this->pdf->startPageGroup();
|
||||
|
||||
$user = sfContext::getInstance()->getUser();
|
||||
$culture = $user->getCulture();
|
||||
|
||||
if (SF_APP == 'backend' && $culture_url==false)
|
||||
{
|
||||
$user->setCulture('pl_PL');
|
||||
$culture_print = 'pl_PL';
|
||||
|
||||
}else{
|
||||
|
||||
$user->setCulture($culture_url);
|
||||
$culture_print = $culture_url;
|
||||
|
||||
}
|
||||
|
||||
// $config = stConfig::getInstance(sfContext::getInstance(), 'stInvoiceBackend');
|
||||
|
||||
$returnsNumberHTML = st_get_component('stProductReturnsPdf', 'returnsNumber', array('productReturns' => $this->productReturns));
|
||||
|
||||
$returnsItemsHTML = st_get_component('stProductReturnsPdf', 'returnsItems', array('productReturns' => $this->productReturns, 'results' => $this->results, 'total_amount_return' => $this->total_amount_return));
|
||||
|
||||
$returnsInfoHTML = st_get_component('stProductReturnsPdf', 'returnsInfo', array('productReturns' => $this->productReturns));
|
||||
|
||||
$this->pdf->SetDrawColor(120, 120, 120);
|
||||
$this->pdf->SetLineWidth(0.2);
|
||||
|
||||
$current_y_pos = stProductReturnsPdf::$PDF_MARGIN_TOP;
|
||||
|
||||
$this->pdf->writeHTMLCell(0,0,0,$current_y_pos, $returnsNumberHTML,$this->showBorder,1,0);
|
||||
|
||||
$this->pdf->writeHTMLCell(0,0,0,0, $returnsItemsHTML,$this->showBorder,1,0);
|
||||
|
||||
$this->pdf->writeHTMLCell(0,0,0,0, $returnsInfoHTML,$this->showBorder,1,0);
|
||||
|
||||
|
||||
|
||||
$result = $this->pdf->Output(null, 'S');
|
||||
|
||||
if($culture_url!=false){
|
||||
$user->setCulture($culture);
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
<?php
|
||||
/**
|
||||
* @package stProductReturnsPlugin */
|
||||
class stProductReturnsPluginListener
|
||||
{
|
||||
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
<?php
|
||||
|
||||
|
||||
|
||||
class stProductReturnsBackendActions extends autoStProductReturnsBackendActions
|
||||
{
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
<?php
|
||||
|
||||
|
||||
|
||||
class stProductReturnsBackendComponents extends autoStProductReturnsBackendComponents
|
||||
{
|
||||
}
|
||||
@@ -0,0 +1,73 @@
|
||||
generator:
|
||||
param:
|
||||
model_class: stProductReturns
|
||||
title: "Zwroty"
|
||||
route: "@stProductReturnsBackend"
|
||||
icon: "stProductReturnsPlugin"
|
||||
|
||||
documentation:
|
||||
pl: "https://www.sote.pl/docs/zwroty"
|
||||
en: "https://www.soteshop.com/docs/zwroty"
|
||||
|
||||
list:
|
||||
menu:
|
||||
display: [list]
|
||||
fields:
|
||||
list: {name: "Lista zwrotów", action: "@stProductReturnsBackend?action=list"}
|
||||
title: "Lista zwrotów"
|
||||
display: [created_at, id, _return_type, _order_id, _return_status, user_fullname, user_email]
|
||||
fields:
|
||||
created_at: {name: Data dodania, type: plain, params: date_format='dd-MM-yyyy'}
|
||||
id: {name: Nr. zwrotu}
|
||||
return_type: {name: Typ, filterable: false}
|
||||
order_id: {name: Zamówienie, type: plain, filterable: false}
|
||||
return_status: {name: Status, filterable: false}
|
||||
user_fullname: {name: Imię i nazwisko}
|
||||
user_email: {name: Email}
|
||||
object_actions:
|
||||
_edit: -
|
||||
_delete: -
|
||||
actions:
|
||||
_delete: -
|
||||
actions: []
|
||||
|
||||
peer_method: doSelect
|
||||
peer_count_method: doCount
|
||||
|
||||
edit:
|
||||
display:
|
||||
"NONE": [created_at, id, _return_type, _return_status, _order_id]
|
||||
"Produkty": [_order_products]
|
||||
"Dane do zwrotu": [user_fullname, user_email, user_phone, user_bank_account, description_complaint, description_return]
|
||||
"Notatki sprzedawcy (widoczne tylko dla sprzedawcy)": [admin_note]
|
||||
fields:
|
||||
created_at: {name: Data dodania, type: plain}
|
||||
id: {name: Nr. zwrotu}
|
||||
return_type: {name: Typ, type: plain}
|
||||
return_status: {name: Status}
|
||||
order_id: {name: Zamówienie, type: plain}
|
||||
order_products: {hide_label: true}
|
||||
user_fullname: {name: Imię i nazwisko, type: plain}
|
||||
user_email: {name: Email, type: plain}
|
||||
user_phone: {name: Telefon, type: plain}
|
||||
user_bank_account: {name: Nr. konta do zwrotu, type: plain}
|
||||
description_complaint: {name: Treść reklamacji, type: plain}
|
||||
description_return: {name: Uwagi do zwrotu, type: plain}
|
||||
admin_note: {hide_label: true, params: "rich=true tinymce_options=height:100,width:'100%',theme:'simple'" }
|
||||
|
||||
|
||||
actions:
|
||||
_list: -
|
||||
_save: -
|
||||
_delete: -
|
||||
|
||||
config:
|
||||
display:
|
||||
"NONE": [enabled, day_to_return]
|
||||
"Teksty formularza": [text_form, text_confirm, text_summary]
|
||||
fields:
|
||||
enabled: {name: "Włącz", checked: false, type: checkbox}
|
||||
day_to_return: {name: "Czas na zwrot", params: size=2, help: 'Ilość dni, po których klient nie będzie mógl zwrócic produktu - liczona od momentu przejścia zamowienia w status "zrealizowany".'}
|
||||
text_form: {name: "Treść formularza", type: textarea_tag, params: "rich=true tinymce_options=height:100,width:'100%',theme:'simple'", is_i18n: true}
|
||||
text_confirm: {name: "Treść na stronie potwierdzenia", type: textarea_tag, params: "rich=true tinymce_options=height:100,width:'100%',theme:'simple'", is_i18n: true}
|
||||
text_summary: {name: "Treść na stronie podsumowania", type: textarea_tag, params: "rich=true tinymce_options=height:100,width:'100%',theme:'simple'", is_i18n: true}
|
||||
@@ -0,0 +1,5 @@
|
||||
<?php
|
||||
|
||||
class stProductReturnsBackendBreadcrumbsBuilder extends autoStProductReturnsBackendBreadcrumbsBuilder
|
||||
{
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
<a href="<?php echo st_url_for("stOrder/edit?id=".$st_product_returns->getOrderId()); ?>">
|
||||
<?php echo $st_product_returns->getOrderId(); ?>
|
||||
</a>
|
||||
@@ -0,0 +1,130 @@
|
||||
<?php use_helper('nifty', 'stOrder', 'stUrl', 'stProductOptions', 'stProductImage', 'stDelivery'); ?>
|
||||
|
||||
<?php sfLoader::loadHelpers('stProduct', 'stProduct'); ?>
|
||||
|
||||
|
||||
<table class="st-responsive st_record_list" cellspacing="0">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="text-left"><?php echo __('Nazwa') ?></th>
|
||||
<th class="text-right"><?php echo __('Netto') ?></th>
|
||||
<th class="text-right"><?php echo __('Vat') ?></th>
|
||||
<th class="text-right"><?php echo __('Brutto') ?></th>
|
||||
<th class="text-right"><?php echo __('Ilość') ?></th>
|
||||
<th class="text-right"><?php echo __('Razem') ?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
|
||||
<tbody>
|
||||
<?php
|
||||
|
||||
$c = new Criteria();
|
||||
$c->add(ProductReturnsHasOrderProductPeer::PRODUCT_RETURNS_ID, $st_product_returns->getId());
|
||||
$orderProducts = ProductReturnsHasOrderProductPeer::doSelect($c);
|
||||
|
||||
|
||||
$total_amount_return = 0;
|
||||
|
||||
foreach($orderProducts as $order_product){
|
||||
|
||||
$total_amount = 0;
|
||||
|
||||
$row = array();
|
||||
|
||||
|
||||
$row['quantity'] = $order_product->getQuantity() ;
|
||||
|
||||
$order = $order_product->getOrderProduct()->getOrder();
|
||||
|
||||
$product = $order_product->getOrderProduct()->getProduct();
|
||||
|
||||
$order_product = $order_product->getOrderProduct();
|
||||
|
||||
$currency = $order->getOrderCurrency();
|
||||
|
||||
$delivery = $order->getOrderDelivery();
|
||||
|
||||
|
||||
|
||||
$row['code'] = $order_product->getCode();
|
||||
|
||||
$row['validate'] = $order_product->productValidate();
|
||||
|
||||
if($row['validate'])
|
||||
{
|
||||
$row['photo'] = st_link_to(st_product_image_tag($order_product, 'icon'), 'stProduct/edit?id='.$order_product->getProduct()->getId());
|
||||
}
|
||||
else
|
||||
{
|
||||
$row['photo'] = st_product_image_tag(null, 'icon');
|
||||
}
|
||||
|
||||
if ($order_product->productValidate())
|
||||
{
|
||||
$row['name_show'] = st_link_to($order_product->getName(), 'stProduct/edit?id=' . $order_product->getProduct()->getId());
|
||||
}
|
||||
else
|
||||
{
|
||||
$row['name_show'] = $order_product->getName();
|
||||
}
|
||||
|
||||
if ($order_product->hasPriceModifiers())
|
||||
{
|
||||
$row['name_show'] = content_tag('div', $row['name_show'], array('class' => 'st_product_name_with_options')).@st_order_render_product_options_backend($order_product);
|
||||
|
||||
}
|
||||
|
||||
$row['price'] = st_order_price_format($order_product->getPriceNetto(true), $currency);
|
||||
|
||||
$row['vat'] = $order_product->getVat();
|
||||
|
||||
$row['price_true'] = st_order_price_format($order_product->getPriceBrutto(true), $currency);
|
||||
|
||||
$row['uom'] = st_product_uom($order_product->getProduct());
|
||||
|
||||
$row['is_without_return'] = $order_product->getIsWithoutReturn();
|
||||
|
||||
$total_amount = $order_product->getPriceBrutto(true) * $row['quantity'];
|
||||
|
||||
$row['total_amount'] = st_order_price_format($total_amount, $currency);
|
||||
|
||||
$total_amount_return = $total_amount_return + $total_amount;
|
||||
|
||||
echo '<tr>';
|
||||
|
||||
echo '<td class="text-left">'.$row['name_show'].'</td>';
|
||||
|
||||
echo '<td class="text-right">'.$row['price'].'</td>';
|
||||
|
||||
echo '<td class="text-right">'.$row['vat'].'%</td>';
|
||||
|
||||
echo '<td class="text-right">'.$row['price_true'].'</td>';
|
||||
|
||||
echo '<td class="text-right">'.$row['quantity']." ".$row['uom'].'</td>';
|
||||
|
||||
echo '<td class="text-right">'.$row['total_amount'].'</td>';
|
||||
|
||||
echo '</tr>';
|
||||
|
||||
}
|
||||
|
||||
|
||||
?>
|
||||
|
||||
</tbody>
|
||||
|
||||
<tfoot>
|
||||
<tr>
|
||||
<th colspan="5" class="text-right">
|
||||
<?php echo __('Razem do zwrotu') ?>
|
||||
</th>
|
||||
|
||||
<th class="text-right">
|
||||
<?php echo st_order_price_format($total_amount_return, $currency) ?>
|
||||
</th>
|
||||
|
||||
</tr>
|
||||
</tfoot>
|
||||
|
||||
</table>
|
||||
@@ -0,0 +1,47 @@
|
||||
<?php if($type=="edit"): ?>
|
||||
<select id="st_product_returns_return_status" name="st_product_returns[return_status]">
|
||||
|
||||
<option class="none" value="stats1" <?php if ($st_product_returns->getReturnStatus()=="stats1") {echo " selected";} ?>><?php echo __('Oczekujemy na przesyłkę') ?></option>
|
||||
|
||||
<option class="none" value="stats2" <?php if ($st_product_returns->getReturnStatus()=="stats2") {echo " selected";} ?>><?php echo __('Trwa rozpatrzenie zwrotu') ?></option>
|
||||
|
||||
<option class="none" value="stats3" <?php if ($st_product_returns->getReturnStatus()=="stats3") {echo " selected";} ?>><?php echo __('Zwrócono środki na konto') ?></option>
|
||||
|
||||
<option class="none" value="stats4" <?php if ($st_product_returns->getReturnStatus()=="stats4") {echo " selected";} ?>><?php echo __('Odrzucono zwrot') ?></option>
|
||||
|
||||
</select>
|
||||
<?php else: ?>
|
||||
|
||||
<?php if ($st_product_returns->getReturnStatus()=="stats1") : ?>
|
||||
|
||||
<span style="background: #ffc107; border-radius: 50%; margin-right: 5px; height: 12px; min-width: 12px; display: inline-block;"></span>
|
||||
<?php echo __('Oczekujemy na przesyłkę'); ?>
|
||||
|
||||
<?php endif; ?>
|
||||
|
||||
|
||||
<?php if ($st_product_returns->getReturnStatus()=="stats2") : ?>
|
||||
|
||||
<span style="background: #ffc107; border-radius: 50%; margin-right: 5px; height: 12px; min-width: 12px; display: inline-block;"></span>
|
||||
<?php echo __('Trwa rozpatrzenie zwrotu'); ?>
|
||||
|
||||
<?php endif; ?>
|
||||
|
||||
|
||||
<?php if ($st_product_returns->getReturnStatus()=="stats3") : ?>
|
||||
|
||||
<span style="background: #28a745; border-radius: 50%; margin-right: 5px; height: 12px; min-width: 12px; display: inline-block;"></span>
|
||||
<?php echo __('Zwrócono środki na konto'); ?>
|
||||
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if ($st_product_returns->getReturnStatus()=="stats4") : ?>
|
||||
|
||||
<span style="background: #6c757d; border-radius: 50%; margin-right: 5px; height: 12px; min-width: 12px; display: inline-block;"></span>
|
||||
<?php echo __('Odrzucono zwrot'); ?>
|
||||
|
||||
<?php endif; ?>
|
||||
|
||||
|
||||
|
||||
<?php endif; ?>
|
||||
@@ -0,0 +1,2 @@
|
||||
<?php if ($st_product_returns->getReturnType()=="return") {echo __('Rezygnacja');} ?>
|
||||
<?php if ($st_product_returns->getReturnType()=="complaint") {echo __('Reklamacja');} ?>
|
||||
@@ -0,0 +1,485 @@
|
||||
<?php
|
||||
|
||||
|
||||
class stProductReturnsFrontendActions extends stActions
|
||||
{
|
||||
|
||||
public function executeForm()
|
||||
{
|
||||
|
||||
if($this->getUser()->isAuthenticated())
|
||||
{
|
||||
|
||||
$this->smarty = new stSmarty('stProductReturnsFrontend');
|
||||
|
||||
$this->basket_config = stConfig::getInstance('stBasket');
|
||||
|
||||
$this->config = stConfig::getInstance(sfContext::getInstance(), 'stProductReturnsBackend');
|
||||
|
||||
$this->order_id = $this->getRequestParameter('id');
|
||||
|
||||
$this->hash_code = $this->getRequestParameter('hash_code');
|
||||
|
||||
$return_form = $this->getRequestParameter('return_form');
|
||||
|
||||
if(!is_array($return_form)){
|
||||
$return_form = json_decode($return_form, true);
|
||||
}
|
||||
|
||||
$this->order = OrderPeer::retrieveByIdAndHashCode($this->getRequestParameter('id'), $this->getRequestParameter('hash_code'));
|
||||
|
||||
$this->forward404Unless($this->order, 'Operacja niedozwolona - brak zamówienia o podanym numerze i ciągu hash');
|
||||
|
||||
$this->user_data_billing = $this->order->getOrderUserDataBilling();
|
||||
|
||||
$this->user_data_delivery = $this->order->getOrderUserDataDelivery();
|
||||
|
||||
$this->currency = $this->order->getOrderCurrency();
|
||||
|
||||
$this->delivery = $this->order->getOrderDelivery();
|
||||
|
||||
if ($this->order->getOrderPayment() && $this->order->getOrderPayment()->getPaymentType())
|
||||
{
|
||||
$this->payment = $this->order->getOrderPayment()->getPaymentType();
|
||||
}
|
||||
|
||||
$this->order_products = $this->order->getOrderProducts();
|
||||
|
||||
|
||||
if(!$return_form){
|
||||
|
||||
foreach($this->order->getOrderProducts() as $order_product){
|
||||
|
||||
$max_quantity = stProductReturnsHelper::getMaxQuantity($order_product);
|
||||
|
||||
$return_form['checkbox'][$order_product->getCode()] = $order_product->getId();
|
||||
$return_form['quantity'][$order_product->getCode()] = $max_quantity;
|
||||
$return_form['max_quantity'][$order_product->getCode()] =$max_quantity;
|
||||
|
||||
}
|
||||
|
||||
$return_form['fullname'] = $this->order->getOrderUserDataBilling()->getFullname();
|
||||
$return_form['email'] = $this->order->getOptClientEmail();
|
||||
$return_form['phone'] = $this->order->getOrderUserDataBilling()->getPhone();
|
||||
|
||||
}else{
|
||||
|
||||
foreach($this->order->getOrderProducts() as $order_product){
|
||||
|
||||
$max_quantity = stProductReturnsHelper::getMaxQuantity($order_product);
|
||||
|
||||
$return_form['max_quantity'][$order_product->getCode()] = $max_quantity;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
$this->return_form = $return_form;
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
stUser::processAuthentication();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
public function executeConfirmForm()
|
||||
{
|
||||
|
||||
if($this->getUser()->isAuthenticated())
|
||||
{
|
||||
|
||||
$this->smarty = new stSmarty('stProductReturnsFrontend');
|
||||
|
||||
|
||||
$this->basket_config = stConfig::getInstance('stBasket');
|
||||
|
||||
$this->config = stConfig::getInstance(sfContext::getInstance(), 'stProductReturnsBackend');
|
||||
|
||||
$this->order_id = $this->getRequestParameter('id');
|
||||
|
||||
$this->hash_code = $this->getRequestParameter('hash_code');
|
||||
|
||||
$return_form = $this->getRequestParameter('return_form');
|
||||
|
||||
|
||||
$this->order = OrderPeer::retrieveByIdAndHashCode($this->getRequestParameter('id'), $this->getRequestParameter('hash_code'));
|
||||
|
||||
|
||||
$this->forward404Unless($this->order, 'Operacja niedozwolona - brak zamówienia o podanym numerze i ciągu hash');
|
||||
|
||||
$this->user_data_billing = $this->order->getOrderUserDataBilling();
|
||||
|
||||
$this->user_data_delivery = $this->order->getOrderUserDataDelivery();
|
||||
|
||||
$this->currency = $this->order->getOrderCurrency();
|
||||
|
||||
$this->delivery = $this->order->getOrderDelivery();
|
||||
|
||||
if ($this->order->getOrderPayment() && $this->order->getOrderPayment()->getPaymentType())
|
||||
{
|
||||
$this->payment = $this->order->getOrderPayment()->getPaymentType();
|
||||
}
|
||||
|
||||
$this->order_products = $this->order->getOrderProducts();
|
||||
|
||||
$this->return_form = $return_form;
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
stUser::processAuthentication();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public function executeShow()
|
||||
{
|
||||
if($this->getUser()->isAuthenticated())
|
||||
{
|
||||
|
||||
$this->smarty = new stSmarty('stProductReturnsFrontend');
|
||||
|
||||
$this->basket_config = stConfig::getInstance('stBasket');
|
||||
|
||||
$return_id = $this->getRequestParameter('id');
|
||||
|
||||
$this->show_back = $this->getRequestParameter('show_back');
|
||||
|
||||
|
||||
$c = new Criteria();
|
||||
$c->add(stProductReturnsPeer::ID, $return_id);
|
||||
$productReturns = stProductReturnsPeer::doSelectOne($c);
|
||||
|
||||
$c = new Criteria();
|
||||
$c->add(ProductReturnsHasOrderProductPeer::PRODUCT_RETURNS_ID, $productReturns->getId());
|
||||
$orderProducts = ProductReturnsHasOrderProductPeer::doSelect($c);
|
||||
|
||||
foreach($orderProducts as $orderProduct){
|
||||
|
||||
$orderProductReturns[$orderProduct->getOrderProductId()] = $orderProduct->getQuantity();
|
||||
|
||||
}
|
||||
|
||||
$order_id = $productReturns->getOrder()->getId();
|
||||
|
||||
$hash_code = $productReturns->getOrder()->getHashCode();
|
||||
|
||||
|
||||
if($this->getUser()->getGuardUser()->getId() != $productReturns->getOrder()->getSfGuardUser()->getId()){
|
||||
$this->redirect('stUserData/userPanel');
|
||||
return sfView::NONE;
|
||||
}
|
||||
|
||||
|
||||
$this->order = $productReturns->getOrder();
|
||||
|
||||
$this->user_data_billing = $this->order->getOrderUserDataBilling();
|
||||
|
||||
$this->user_data_delivery = $this->order->getOrderUserDataDelivery();
|
||||
|
||||
$this->currency = $this->order->getOrderCurrency();
|
||||
|
||||
$this->delivery = $this->order->getOrderDelivery();
|
||||
|
||||
if ($this->order->getOrderPayment() && $this->order->getOrderPayment()->getPaymentType())
|
||||
{
|
||||
$this->payment = $this->order->getOrderPayment()->getPaymentType();
|
||||
}
|
||||
|
||||
$this->orderProductReturns = $orderProductReturns;
|
||||
|
||||
$this->order_products = $this->order->getOrderProducts();
|
||||
|
||||
$return_form['type'] = $productReturns->getReturnType();
|
||||
$return_form['status'] = $productReturns->getReturnStatus();
|
||||
$return_form['fullname'] = $productReturns->getUserFullname();
|
||||
$return_form['email'] = $productReturns->getUserEmail();
|
||||
$return_form['phone'] = $productReturns->getUserPhone();
|
||||
$return_form['bank_account'] = $productReturns->getUserBankAccount();
|
||||
$return_form['return_id'] = $return_id;
|
||||
$return_form['description_complaint'] = $productReturns->getDescriptionComplaint();
|
||||
$return_form['description_return'] = $productReturns->getDescriptionReturn();
|
||||
$return_form['hash_code'] = $hash_code;
|
||||
|
||||
|
||||
|
||||
$this->return_form = $return_form;
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
stUser::processAuthentication();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public function executeSaveForm()
|
||||
{
|
||||
|
||||
|
||||
if($this->getUser()->isAuthenticated())
|
||||
{
|
||||
|
||||
$order_id = $this->getRequestParameter('id');
|
||||
|
||||
$hash_code = $this->getRequestParameter('hash_code');
|
||||
|
||||
$return_form = $this->getRequestParameter('return_form');
|
||||
|
||||
$return_form = json_decode($return_form, true);
|
||||
|
||||
/*echo "<pre>";
|
||||
print_r($return_form);
|
||||
echo "</pre>";
|
||||
die();*/
|
||||
|
||||
$return = new stProductReturns();
|
||||
|
||||
$return->setOrderId($order_id);
|
||||
$return->setReturnType($return_form['type']);
|
||||
$return->setReturnStatus("stats1");
|
||||
|
||||
$return->setUserFullname($return_form['fullname']);
|
||||
$return->setUserEmail($return_form['email']);
|
||||
$return->setUserPhone($return_form['phone']);
|
||||
$return->setUserBankAccount($return_form['bank_account']);
|
||||
$return->setDescriptionComplaint($return_form['description_complaint']);
|
||||
$return->setDescriptionReturn($return_form['description_return']);
|
||||
|
||||
$return->save();
|
||||
|
||||
foreach($return_form['checkbox'] as $code => $order_product_id){
|
||||
|
||||
$productReturns = new ProductReturnsHasOrderProduct();
|
||||
|
||||
$productReturns->setProductReturnsId($return->getId());
|
||||
$productReturns->setOrderProductId($order_product_id);
|
||||
$productReturns->setOrderId($order_id);
|
||||
$productReturns->setQuantity($return_form['quantity'][$code]);
|
||||
|
||||
$productReturns->save();
|
||||
|
||||
}
|
||||
|
||||
$this->sendMail($return);
|
||||
|
||||
return $this->redirect('stProductReturnsFrontend/summaryForm?id='.$return->getId());
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
stUser::processAuthentication();
|
||||
}
|
||||
}
|
||||
|
||||
public function executeSummaryForm()
|
||||
{
|
||||
|
||||
$this->smarty = new stSmarty('stProductReturnsFrontend');
|
||||
|
||||
$this->config = stConfig::getInstance(sfContext::getInstance(), 'stProductReturnsBackend');
|
||||
|
||||
if($this->getUser()->isAuthenticated())
|
||||
{
|
||||
|
||||
$return_id = $this->getRequestParameter('id');
|
||||
|
||||
$c = new Criteria();
|
||||
$c->add(stProductReturnsPeer::ID, $return_id);
|
||||
$productReturns = stProductReturnsPeer::doSelectOne($c);
|
||||
|
||||
$this->return_form_type = $productReturns->getReturnType();
|
||||
|
||||
$this->order = $productReturns->getOrder();
|
||||
|
||||
$this->return_id = $return_id;
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
stUser::processAuthentication();
|
||||
}
|
||||
}
|
||||
|
||||
public function validateConfirmForm()
|
||||
{
|
||||
|
||||
$error_exists = false;
|
||||
|
||||
$i18n = $this->getContext()->getI18N();
|
||||
|
||||
$return_form = $this->getRequestParameter('return_form', array());
|
||||
|
||||
|
||||
if (!$return_form['fullname'])
|
||||
{
|
||||
$this->getRequest()->setError('return_form{fullname}', $i18n->__('Brak imienia i nazwiska.'));
|
||||
$error_exists = true;
|
||||
}
|
||||
|
||||
if (!$return_form['checkbox'])
|
||||
{
|
||||
$this->getRequest()->setError('return_form{checkbox}', $i18n->__('Nie wybrano produktów do zwrotu.'));
|
||||
$error_exists = true;
|
||||
}
|
||||
|
||||
if (!$return_form['email'])
|
||||
{
|
||||
$this->getRequest()->setError('return_form{email}', $i18n->__('Brak adresu email.'));
|
||||
$error_exists = true;
|
||||
}
|
||||
|
||||
if (!filter_var($return_form['email'], FILTER_VALIDATE_EMAIL)) {
|
||||
|
||||
$this->getRequest()->setError('return_form{email}', $i18n->__('Nieprawidłowy format adresu e-mail.'));
|
||||
$error_exists = true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
if (!$return_form['phone'])
|
||||
{
|
||||
$this->getRequest()->setError('return_form{phone}', $i18n->__('Brak telefonu.'));
|
||||
$error_exists = true;
|
||||
}
|
||||
|
||||
if (!$return_form['bank_account'] && $return_form['type'] == "return")
|
||||
{
|
||||
$this->getRequest()->setError('return_form{bank_account}', $i18n->__('Brak numeru konta do zwrotu.'));
|
||||
$error_exists = true;
|
||||
}
|
||||
|
||||
return !$error_exists;
|
||||
}
|
||||
|
||||
|
||||
public function handleErrorConfirmForm()
|
||||
{
|
||||
$this->smarty = new stSmarty($this->getModuleName());
|
||||
|
||||
$this->order_id = $this->getRequestParameter('id');
|
||||
|
||||
$this->hash_code = $this->getRequestParameter('hash_code');
|
||||
|
||||
$this->return_form = $this->getRequestParameter('return_form');
|
||||
|
||||
return $this->forward('stProductReturnsFrontend', 'form');
|
||||
}
|
||||
|
||||
/**
|
||||
* Obsługuje wysyłanie mail'i
|
||||
*/
|
||||
function SendMail($productReturns)
|
||||
{
|
||||
$mail_error = $this->MailWithProductReturnsToUser($productReturns);
|
||||
$mail_error = $this->MailWithProductReturnsToAdmin($productReturns);
|
||||
|
||||
return $mail_error;
|
||||
}
|
||||
|
||||
/**
|
||||
* Wysyła mail z zamówieniem do klienta
|
||||
*/
|
||||
function mailWithProductReturnsToUser($productReturns)
|
||||
{
|
||||
$this->smarty = new stSmarty($this->getModuleName());
|
||||
|
||||
$mail_config = stConfig::getInstance($this->getContext(), 'stMailAccountBackend');
|
||||
|
||||
$compatibility_config = stConfig::getInstance('stCompatibilityBackend');
|
||||
|
||||
$mail = stMailer::getInstance();
|
||||
|
||||
$c = new Criteria();
|
||||
$c->add(ProductReturnsHasOrderProductPeer::PRODUCT_RETURNS_ID, $productReturns->getId());
|
||||
$orderProducts = ProductReturnsHasOrderProductPeer::doSelect($c);
|
||||
|
||||
foreach($orderProducts as $orderProduct){
|
||||
$orderProductReturns[$orderProduct->getOrderProductId()] = $orderProduct->getQuantity();
|
||||
}
|
||||
|
||||
$order_products = $productReturns->getOrder()->getOrderProducts();
|
||||
|
||||
$currency = $productReturns->getOrder()->getOrderCurrency();
|
||||
|
||||
|
||||
$mailHtmlHead = stMailer::getHtmlMailDescription("header");
|
||||
|
||||
$mailHtmlFoot = stMailer::getHtmlMailDescription("footer");
|
||||
|
||||
$mailHtmlHeadContent = stMailer::getHtmlMailDescription("top_product_returns_confirm");
|
||||
|
||||
$mailHtmlFootContent = stMailer::getHtmlMailDescription("bottom_product_returns_confirm");
|
||||
|
||||
$sendProductReturnsToUserHtmlMailMessage = stMailTemplate::render('sendProductReturnsToUserHtml', array('productReturns' => $productReturns, 'head' => $mailHtmlHead, 'foot' => $mailHtmlFoot, 'head_content' => $mailHtmlHeadContent, 'foot_content' => $mailHtmlFootContent, 'orderProductReturns' => $orderProductReturns, 'order_products' => $order_products, 'currency' => $currency, 'smarty' => $this->smarty, 'mail_config' => $mail_config));
|
||||
|
||||
$sendProductReturnsToUserPlainMailMessage = stMailTemplate::render('sendProductReturnsToUserPlain', array('productReturns' => $productReturns, 'smarty' => $this->smarty));
|
||||
|
||||
$mail->setSubject(__('Zwrot numer') . ': ' . $productReturns->getId())->setHtmlMessage($sendProductReturnsToUserHtmlMailMessage)->setPlainMessage($sendProductReturnsToUserPlainMailMessage)->setTo($productReturns->getUserEmail());
|
||||
|
||||
|
||||
$ret = $mail->sendToClient();
|
||||
|
||||
return $ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* Wysyła mail z zamówieniem do administratora
|
||||
*/
|
||||
function mailWithProductReturnsToAdmin($productReturns)
|
||||
{
|
||||
$this->smarty = new stSmarty($this->getModuleName());
|
||||
|
||||
$user = $this->getUser();
|
||||
|
||||
$culture = $user->getCulture();
|
||||
|
||||
$mail_config = stConfig::getInstance($this->getContext(), 'stMailAccountBackend');
|
||||
|
||||
$mail = stMailer::getInstance();
|
||||
|
||||
$mail = stMailer::getInstance();
|
||||
|
||||
$c = new Criteria();
|
||||
$c->add(ProductReturnsHasOrderProductPeer::PRODUCT_RETURNS_ID, $productReturns->getId());
|
||||
$orderProducts = ProductReturnsHasOrderProductPeer::doSelect($c);
|
||||
|
||||
foreach($orderProducts as $orderProduct){
|
||||
$orderProductReturns[$orderProduct->getOrderProductId()] = $orderProduct->getQuantity();
|
||||
}
|
||||
|
||||
$order_products = $productReturns->getOrder()->getOrderProducts();
|
||||
|
||||
$currency = $productReturns->getOrder()->getOrderCurrency();
|
||||
|
||||
$c = new Criteria();
|
||||
$c->add(LanguagePeer::IS_DEFAULT_PANEL, 1);
|
||||
$language = LanguagePeer::doSelectOne($c);
|
||||
if (is_object($language)){
|
||||
$user->setCulture($language->getOriginalLanguage());
|
||||
}
|
||||
|
||||
$mailHtmlHead = stMailer::getHtmlMailDescription("header");
|
||||
|
||||
$mailHtmlFoot = stMailer::getHtmlMailDescription("footer");
|
||||
|
||||
|
||||
$sendProductReturnsToAdminHtmlMailMessage = stMailTemplate::render('sendProductReturnsToAdminHtml', array('productReturns' => $productReturns, 'head' => $mailHtmlHead, 'foot' => $mailHtmlFoot, 'head_content' => $mailHtmlHeadContent, 'foot_content' => $mailHtmlFootContent, 'orderProductReturns' => $orderProductReturns, 'order_products' => $order_products, 'currency' => $currency, 'smarty' => $this->smarty, 'mail_config' => $mail_config));
|
||||
|
||||
$sendProductReturnsToAdminPlainMailMessage = stMailTemplate::render('sendProductReturnsToAdminPlain', array('productReturns' => $productReturns, 'smarty' => $this->smarty));
|
||||
|
||||
$mail->setSubject(__('Zgłoszono nowy zwrot') . ': ' . $productReturns->getId())->setHtmlMessage($sendProductReturnsToAdminHtmlMailMessage)->setPlainMessage($sendProductReturnsToAdminPlainMailMessage)->setReplyTo($productReturns->getUserEmail());
|
||||
|
||||
$ret = $mail->sendToMerchant();
|
||||
|
||||
$user->setCulture($culture);
|
||||
|
||||
return $ret;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,85 @@
|
||||
<?php
|
||||
|
||||
|
||||
class stProductReturnsFrontendComponents extends sfComponents
|
||||
{
|
||||
|
||||
|
||||
public function executeShow()
|
||||
{
|
||||
if($this->getUser()->isAuthenticated())
|
||||
{
|
||||
|
||||
$this->smarty = new stSmarty('stProductReturnsFrontend');
|
||||
|
||||
$this->basket_config = stConfig::getInstance('stBasket');
|
||||
|
||||
$config = stConfig::getInstance(sfContext::getInstance(), 'stProductReturnsBackend');
|
||||
|
||||
if(!$config->get('enabled')==1){
|
||||
return sfView::NONE;
|
||||
}
|
||||
|
||||
$this->show_back = $this->show_back;
|
||||
|
||||
$c = new Criteria();
|
||||
$c->add(stProductReturnsPeer::ID, $this->return_id);
|
||||
$productReturns = stProductReturnsPeer::doSelectOne($c);
|
||||
|
||||
$c = new Criteria();
|
||||
$c->add(ProductReturnsHasOrderProductPeer::PRODUCT_RETURNS_ID, $productReturns->getId());
|
||||
$orderProducts = ProductReturnsHasOrderProductPeer::doSelect($c);
|
||||
|
||||
foreach($orderProducts as $orderProduct){
|
||||
|
||||
$orderProductReturns[$orderProduct->getOrderProductId()] = $orderProduct->getQuantity();
|
||||
|
||||
}
|
||||
|
||||
$order_id = $productReturns->getOrder()->getId();
|
||||
|
||||
$hash_code = $productReturns->getOrder()->getHashCode();
|
||||
|
||||
|
||||
$this->order = $productReturns->getOrder();
|
||||
|
||||
$this->user_data_billing = $this->order->getOrderUserDataBilling();
|
||||
|
||||
$this->user_data_delivery = $this->order->getOrderUserDataDelivery();
|
||||
|
||||
$this->currency = $this->order->getOrderCurrency();
|
||||
|
||||
$this->delivery = $this->order->getOrderDelivery();
|
||||
|
||||
if ($this->order->getOrderPayment() && $this->order->getOrderPayment()->getPaymentType())
|
||||
{
|
||||
$this->payment = $this->order->getOrderPayment()->getPaymentType();
|
||||
}
|
||||
|
||||
$this->orderProductReturns = $orderProductReturns;
|
||||
|
||||
$this->order_products = $this->order->getOrderProducts();
|
||||
|
||||
$return_form['type'] = $productReturns->getReturnType();
|
||||
$return_form['status'] = $productReturns->getReturnStatus();
|
||||
$return_form['fullname'] = $productReturns->getUserFullname();
|
||||
$return_form['email'] = $productReturns->getUserEmail();
|
||||
$return_form['phone'] = $productReturns->getUserPhone();
|
||||
$return_form['bank_account'] = $productReturns->getUserBankAccount();
|
||||
$return_form['return_id'] = $this->return_id;
|
||||
$return_form['description_complaint'] = $productReturns->getDescriptionComplaint();
|
||||
$return_form['description_return'] = $productReturns->getDescriptionReturn();
|
||||
$return_form['hash_code'] = $hash_code;
|
||||
|
||||
|
||||
|
||||
$this->return_form = $return_form;
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
stUser::processAuthentication();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,105 @@
|
||||
<?php
|
||||
|
||||
use_helper('nifty', 'stOrder', 'stUrl', 'stProductOptions', 'stProductImage', 'stDelivery');
|
||||
|
||||
sfLoader::loadHelpers('stProduct', 'stProduct');
|
||||
|
||||
|
||||
st_theme_use_stylesheet('stUser.css');
|
||||
|
||||
st_theme_use_stylesheet('stOrder.css');
|
||||
|
||||
|
||||
$smarty->assign('return_form', $return_form);
|
||||
|
||||
|
||||
$results = array();
|
||||
|
||||
$total_amount_return = 0;
|
||||
|
||||
foreach ($order_products as $order_product)
|
||||
{
|
||||
$total_amount = 0;
|
||||
|
||||
if(array_key_exists($order_product->getId(), $orderProductReturns)){
|
||||
|
||||
$row['code'] = $order_product->getCode();
|
||||
|
||||
$row['validate'] = $order_product->productValidate();
|
||||
|
||||
if($row['validate'])
|
||||
{
|
||||
$row['photo'] = st_link_to(st_product_image_tag($order_product, 'icon'), 'stProduct/show?url='.$order_product->getProduct()->getFriendlyUrl());
|
||||
}
|
||||
else
|
||||
{
|
||||
$row['photo'] = st_product_image_tag(null, 'icon');
|
||||
}
|
||||
|
||||
if ($order_product->productValidate())
|
||||
{
|
||||
$row['name_show'] = st_link_to($order_product->getName(), 'stProduct/show?url=' . $order_product->getProduct()->getFriendlyUrl());
|
||||
}
|
||||
else
|
||||
{
|
||||
$row['name_show'] = $order_product->getName();
|
||||
}
|
||||
|
||||
if ($order_product->hasPriceModifiers())
|
||||
{
|
||||
$row['name_show'] = content_tag('div', $row['name_show'], array('class' => 'st_product_name_with_options')).st_product_options_get_view($order_product);
|
||||
}
|
||||
|
||||
$row['price'] = st_order_price_format($order_product->getPriceNetto(true), $currency);
|
||||
|
||||
$row['vat'] = $order_product->getVat();
|
||||
|
||||
$row['price_true'] = st_order_price_format($order_product->getPriceBrutto(true), $currency);
|
||||
|
||||
$row['uom'] = st_product_uom($order_product->getProduct());
|
||||
|
||||
$row['quantity'] = $orderProductReturns[$order_product->getId()];
|
||||
|
||||
$total_amount = $order_product->getPriceBrutto(true) * $orderProductReturns[$order_product->getId()];
|
||||
|
||||
$row['total_amount'] = st_order_price_format($total_amount, $currency);
|
||||
|
||||
|
||||
$results[] = $row;
|
||||
|
||||
$total_amount_return = $total_amount_return + $total_amount;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
$total_amount_return =st_order_price_format($total_amount_return, $currency);
|
||||
|
||||
|
||||
$smarty->assign('total_amount_return', $total_amount_return);
|
||||
|
||||
$smarty->assign('results', $results);
|
||||
|
||||
$smarty->assign("show_code_in_basket", $basket_config->get('show_code_in_basket'));
|
||||
|
||||
$smarty->assign("show_photo_in_basket", $basket_config->get('show_photo_in_basket'));
|
||||
|
||||
$smarty->assign("show_netto_in_basket", $basket_config->get('show_netto_in_basket'));
|
||||
|
||||
$smarty->assign("show_tax_in_basket", $basket_config->get('show_tax_in_basket'));
|
||||
|
||||
$smarty->assign("show_uom_in_basket", $basket_config->get('show_uom_in_basket'));
|
||||
|
||||
$culture = sfContext::getInstance()->getUser()->getCulture();
|
||||
|
||||
$smarty->assign('pdf_link', st_url_for('stProductReturnsPdf/show?id=' . $return_form['return_id'] . '&hash_code=' . $return_form['hash_code']. '&culture=' . $culture));
|
||||
|
||||
$smarty->assign('return_link', st_url_for('stOrder/show?id=' . $order->getId() . '&hash_code=' . $order->getHashCode()));
|
||||
|
||||
$smarty->assign('show_back', $show_back);
|
||||
|
||||
|
||||
$smarty->display('return_show_return.html'); ?>
|
||||
@@ -0,0 +1,117 @@
|
||||
<?php
|
||||
|
||||
use_helper('nifty', 'stOrder', 'stUrl', 'stProductOptions', 'stProductImage', 'stDelivery');
|
||||
|
||||
sfLoader::loadHelpers('stProduct', 'stProduct');
|
||||
|
||||
|
||||
st_theme_use_stylesheet('stUser.css');
|
||||
|
||||
st_theme_use_stylesheet('stOrder.css');
|
||||
|
||||
$smarty->assign('user_panel_menu', st_get_component('stUserData', 'userPanelMenu'));
|
||||
|
||||
$smarty->assign('form_start', form_tag('stProductReturnsFrontend/saveForm', array('class' => 'st_form_ver6', 'name'=>'return_confirm_form')));
|
||||
|
||||
$smarty->assign('form_back', form_tag('stProductReturnsFrontend/form', array('class' => 'st_form_ver6', 'name'=>'return_confirm_form_back')));
|
||||
|
||||
/*echo "<pre>";
|
||||
print_r($return_form);
|
||||
echo "</pre>";*/
|
||||
|
||||
|
||||
$return_form_input = json_encode($return_form);
|
||||
|
||||
|
||||
$smarty->assign('return_form', $return_form);
|
||||
|
||||
$smarty->assign('input_hidden_order_id', input_hidden_tag('id', $order_id, array('id' => 'order_id')));
|
||||
|
||||
$smarty->assign('input_hidden_hash_code', input_hidden_tag('hash_code', $hash_code, array('id' => 'hash_code')));
|
||||
|
||||
$smarty->assign('input_hidden_return_form', input_hidden_tag('return_form', $return_form_input, array('id' => 'return_form')));
|
||||
|
||||
|
||||
$results = array();
|
||||
|
||||
$total_amount_return = 0;
|
||||
|
||||
foreach ($order_products as $order_product)
|
||||
{
|
||||
|
||||
if(array_key_exists($order_product->getCode(), $return_form['checkbox'])){
|
||||
|
||||
$total_amount = 0;
|
||||
|
||||
$row['code'] = $order_product->getCode();
|
||||
|
||||
$row['validate'] = $order_product->productValidate();
|
||||
|
||||
if($row['validate'])
|
||||
{
|
||||
$row['photo'] = st_link_to(st_product_image_tag($order_product, 'icon'), 'stProduct/show?url='.$order_product->getProduct()->getFriendlyUrl());
|
||||
}
|
||||
else
|
||||
{
|
||||
$row['photo'] = st_product_image_tag(null, 'icon');
|
||||
}
|
||||
|
||||
if ($order_product->productValidate())
|
||||
{
|
||||
$row['name_show'] = st_link_to($order_product->getName(), 'stProduct/show?url=' . $order_product->getProduct()->getFriendlyUrl());
|
||||
}
|
||||
else
|
||||
{
|
||||
$row['name_show'] = $order_product->getName();
|
||||
}
|
||||
|
||||
if ($order_product->hasPriceModifiers())
|
||||
{
|
||||
$row['name_show'] = content_tag('div', $row['name_show'], array('class' => 'st_product_name_with_options')).st_product_options_get_view($order_product);
|
||||
}
|
||||
|
||||
$row['price'] = st_order_price_format($order_product->getPriceNetto(true), $currency);
|
||||
|
||||
$row['vat'] = $order_product->getVat();
|
||||
|
||||
$row['price_true'] = st_order_price_format($order_product->getPriceBrutto(true), $currency);
|
||||
|
||||
$row['quantity'] = $return_form['quantity'][$order_product->getCode()] ;
|
||||
|
||||
$row['uom'] = st_product_uom($order_product->getProduct());
|
||||
|
||||
$total_amount = $order_product->getPriceBrutto(true) * $return_form['quantity'][$order_product->getCode()];
|
||||
|
||||
$row['total_amount'] = st_order_price_format($total_amount, $currency);
|
||||
|
||||
|
||||
$results[] = $row;
|
||||
|
||||
$total_amount_return = $total_amount_return + $total_amount;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
$total_amount_return =st_order_price_format($total_amount_return, $currency);
|
||||
|
||||
$smarty->assign('input_hidden_total_amount_return', input_hidden_tag('return_total_amount_return', $total_amount_return, array('id' => 'total_amount_return')));
|
||||
|
||||
$smarty->assign('total_amount_return', $total_amount_return);
|
||||
|
||||
$smarty->assign('results', $results);
|
||||
|
||||
$smarty->assign("show_code_in_basket", $basket_config->get('show_code_in_basket'));
|
||||
|
||||
$smarty->assign("show_photo_in_basket", $basket_config->get('show_photo_in_basket'));
|
||||
|
||||
$smarty->assign("show_netto_in_basket", $basket_config->get('show_netto_in_basket'));
|
||||
|
||||
$smarty->assign("show_tax_in_basket", $basket_config->get('show_tax_in_basket'));
|
||||
|
||||
$smarty->assign("show_uom_in_basket", $basket_config->get('show_uom_in_basket'));
|
||||
|
||||
$smarty->assign("text_confirm", $config->get('text_confirm', null, true));
|
||||
|
||||
|
||||
$smarty->display('return_confirm_form.html'); ?>
|
||||
@@ -0,0 +1,151 @@
|
||||
<?php
|
||||
|
||||
use_helper('nifty', 'stOrder', 'stUrl', 'stProductOptions', 'stProductImage', 'stDelivery');
|
||||
|
||||
sfLoader::loadHelpers('stProduct', 'stProduct');
|
||||
|
||||
|
||||
st_theme_use_stylesheet('stUser.css');
|
||||
|
||||
st_theme_use_stylesheet('stOrder.css');
|
||||
|
||||
|
||||
|
||||
$smarty->assign('user_panel_menu', st_get_component('stUserData', 'userPanelMenu'));
|
||||
|
||||
$smarty->assign('form_start', form_tag('stProductReturnsFrontend/confirmForm', array('class' => 'st_form_ver6', 'name'=>'return_form')));
|
||||
|
||||
|
||||
$smarty->assign('error_return_checkbox', $sf_request->getError('return_form{checkbox}'));
|
||||
|
||||
|
||||
$smarty->assign('error_return_fullname', $sf_request->getError('return_form{fullname}'));
|
||||
|
||||
$smarty->assign('input_return_fullname', input_tag('return_form[fullname]', @$return_form['fullname'], array('id' => 'fullname', 'placeholder' => '* ' . __("Imię i nazwisko"), 'maxlength' => '255', 'class' => 'form-control')));
|
||||
|
||||
|
||||
$smarty->assign('error_return_email', $sf_request->getError('return_form{email}'));
|
||||
|
||||
$smarty->assign('input_return_email', input_tag('return_form[email]', @$return_form['email'], array('id' => 'email', 'placeholder' => '* ' . __("Email"), 'maxlength' => '255', 'class' => 'form-control')));
|
||||
|
||||
|
||||
$smarty->assign('error_return_phone', $sf_request->getError('return_form{phone}'));
|
||||
|
||||
$smarty->assign('input_return_phone', input_tag('return_form[phone]', @$return_form['phone'], array('id' => 'phone', 'placeholder' => '* ' . __("Telefon"), 'maxlength' => '255', 'class' => 'form-control')));
|
||||
|
||||
|
||||
$smarty->assign('error_return_bank_account', $sf_request->getError('return_form{bank_account}'));
|
||||
|
||||
$smarty->assign('input_return_bank_account', input_tag('return_form[bank_account]', @$return_form['bank_account'], array('id' => 'bank_account', 'placeholder' => '* ' . __("Nr. Konta do zwrotu"), 'maxlength' => '255', 'class' => 'form-control')));
|
||||
|
||||
|
||||
|
||||
|
||||
$smarty->assign('input_return_type_return', radiobutton_tag('return_form[type]', 'return', @$return_form['type'] == 'return', array('class' => 'radio_type')));
|
||||
|
||||
$smarty->assign('input_return_type_complaint', radiobutton_tag('return_form[type]', 'complaint', @$return_form['type'] == 'complaint', array('class' => 'radio_type')));
|
||||
|
||||
$smarty->assign('description_complaint', @$return_form['description_complaint']);
|
||||
|
||||
$smarty->assign('description_return', @$return_form['description_return']);
|
||||
|
||||
|
||||
|
||||
|
||||
$results = array();
|
||||
|
||||
foreach ($order_products as $order_product)
|
||||
{
|
||||
|
||||
$checkbox_id = "return_form_checkbox_".$order_product->getCode();
|
||||
|
||||
$day_to_return = "+".$config->get('day_to_return')." day";
|
||||
$date = strtotime($order_product->getDateToReturn());
|
||||
|
||||
//$date_to_return = date('d-m-Y', strtotime($day_to_return, $date));
|
||||
$date_to_return = strtotime($day_to_return, $date);
|
||||
|
||||
|
||||
$row['checkbox'] = checkbox_tag("return_form[checkbox][".$order_product->getCode()."]", $order_product->getId(), @$return_form['checkbox'][$order_product->getCode()], array('id' => $checkbox_id, 'class' => 'checkobox', 'data-visible' => $order_product->getCode(), 'data-without-return' => $order_product->getIsWithoutReturn(), 'data-date-to-return' => $date_to_return));
|
||||
|
||||
$row['radio'] = radiobutton_tag("return_form[radio]", $order_product->getId(), @$return_form['radio'][$order_product->getCode()]);
|
||||
|
||||
$row['quantity'] = input_tag("return_form[quantity][".$order_product->getCode()."]", @$return_form['quantity'][$order_product->getCode()], array('id' => 'bank_account', 'style'=>'text-align:center;', 'type'=>'number', 'min'=>'1', 'max'=>@$return_form['max_quantity'][$order_product->getCode()], 'placeholder' => '* ' . __("ilość"), 'maxlength' => '5', 'class' => 'form-control'));
|
||||
|
||||
|
||||
$row['code'] = $order_product->getCode();
|
||||
|
||||
$row['validate'] = $order_product->productValidate();
|
||||
|
||||
if($row['validate'])
|
||||
{
|
||||
$row['photo'] = st_link_to(st_product_image_tag($order_product, 'icon'), 'stProduct/show?url='.$order_product->getProduct()->getFriendlyUrl());
|
||||
}
|
||||
else
|
||||
{
|
||||
$row['photo'] = st_product_image_tag(null, 'icon');
|
||||
}
|
||||
|
||||
if ($order_product->productValidate())
|
||||
{
|
||||
$row['name_show'] = st_link_to($order_product->getName(), 'stProduct/show?url=' . $order_product->getProduct()->getFriendlyUrl());
|
||||
}
|
||||
else
|
||||
{
|
||||
$row['name_show'] = $order_product->getName();
|
||||
}
|
||||
|
||||
if ($order_product->hasPriceModifiers())
|
||||
{
|
||||
$row['name_show'] = content_tag('div', $row['name_show'], array('class' => 'st_product_name_with_options')).st_product_options_get_view($order_product);
|
||||
}
|
||||
|
||||
$row['price'] = st_order_price_format($order_product->getPriceNetto(true), $currency);
|
||||
|
||||
$row['vat'] = $order_product->getVat();
|
||||
|
||||
$row['price_true'] = st_order_price_format($order_product->getPriceBrutto(true), $currency);
|
||||
|
||||
$row['uom'] = st_product_uom($order_product->getProduct());
|
||||
|
||||
$row['is_without_return'] = $order_product->getIsWithoutReturn();
|
||||
|
||||
$total_amount = $order_product->getTotalAmount(true, true);
|
||||
|
||||
$row['total_amount'] = st_order_price_format($total_amount, $currency);
|
||||
|
||||
if(@$return_form['quantity'][$order_product->getCode()] !=0 ){
|
||||
$results[] = $row;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
$smarty->assign('results', $results);
|
||||
|
||||
$smarty->assign('input_hidden_order_id', input_hidden_tag('id', $order_id, array('id' => 'order_id')));
|
||||
|
||||
$smarty->assign('input_hidden_hash_code', input_hidden_tag('hash_code', $hash_code, array('id' => 'hash_code')));
|
||||
|
||||
|
||||
$smarty->assign("show_code_in_basket", $basket_config->get('show_code_in_basket'));
|
||||
|
||||
$smarty->assign("show_photo_in_basket", $basket_config->get('show_photo_in_basket'));
|
||||
|
||||
$smarty->assign("show_netto_in_basket", $basket_config->get('show_netto_in_basket'));
|
||||
|
||||
$smarty->assign("show_tax_in_basket", $basket_config->get('show_tax_in_basket'));
|
||||
|
||||
$smarty->assign("show_uom_in_basket", $basket_config->get('show_uom_in_basket'));
|
||||
|
||||
|
||||
$smarty->assign("text_form", $config->get('text_form', null, true));
|
||||
|
||||
|
||||
$today_to_return = strtotime(date("Y-m-d H:i:s"));
|
||||
|
||||
$smarty->assign("today_to_return", $today_to_return);
|
||||
|
||||
|
||||
|
||||
|
||||
$smarty->display('return_form.html'); ?>
|
||||
@@ -0,0 +1,129 @@
|
||||
<?php
|
||||
|
||||
sfLoader::loadHelpers('stProduct', 'stProduct');
|
||||
|
||||
use_helper('nifty', 'stOrder', 'stUrl', 'stProductOptions', 'stProductImage', 'stDelivery', 'stCurrency');
|
||||
|
||||
|
||||
|
||||
$smarty->assign('host', $sf_request->getHost());
|
||||
|
||||
$smarty->assign('created_at', date("d-m-Y H:i", strtotime($productReturns->getCreatedAt())));
|
||||
|
||||
$smarty->assign('number', $productReturns->getId());
|
||||
|
||||
$smarty->assign('product_returns', $productReturns);
|
||||
|
||||
|
||||
|
||||
$return_form['type'] = $productReturns->getReturnType();
|
||||
$return_form['fullname'] = $productReturns->getUserFullname();
|
||||
$return_form['email'] = $productReturns->getUserEmail();
|
||||
$return_form['phone'] = $productReturns->getUserPhone();
|
||||
$return_form['bank_account'] = $productReturns->getUserBankAccount();
|
||||
$return_form['description_complaint'] = $productReturns->getDescriptionComplaint();
|
||||
$return_form['description_return'] = $productReturns->getDescriptionReturn();
|
||||
|
||||
$smarty->assign('return_form', $return_form);
|
||||
|
||||
|
||||
$results = array();
|
||||
|
||||
$total_amount_return = 0;
|
||||
|
||||
foreach ($order_products as $order_product)
|
||||
{
|
||||
$total_amount = 0;
|
||||
|
||||
if(array_key_exists($order_product->getId(), $orderProductReturns)){
|
||||
|
||||
$row['code'] = $order_product->getCode();
|
||||
|
||||
$row['validate'] = $order_product->productValidate();
|
||||
|
||||
$row['instance'] = $order_product->getProduct();
|
||||
|
||||
if($row['validate'])
|
||||
{
|
||||
$row['photo'] = st_link_to(st_product_image_tag($order_product, 'icon'), 'stProduct/show?url='.$order_product->getProduct()->getFriendlyUrl());
|
||||
}
|
||||
else
|
||||
{
|
||||
$row['photo'] = st_product_image_tag(null, 'icon');
|
||||
}
|
||||
|
||||
if ($order_product->productValidate())
|
||||
{
|
||||
$row['name_show'] = st_link_to($order_product->getName(), 'stProduct/show?url=' . $order_product->getProduct()->getFriendlyUrl());
|
||||
}
|
||||
else
|
||||
{
|
||||
$row['name_show'] = $order_product->getName();
|
||||
}
|
||||
|
||||
if ($order_product->hasPriceModifiers())
|
||||
{
|
||||
$row['name_show'] = content_tag('div', $row['name_show'], array('class' => 'st_product_name_with_options')).st_product_options_get_view($order_product);
|
||||
}
|
||||
|
||||
$row['price'] = st_order_price_format($order_product->getPriceNetto(true), $currency);
|
||||
|
||||
$row['vat'] = $order_product->getVat();
|
||||
|
||||
$row['price_true'] = st_order_price_format($order_product->getPriceBrutto(true), $currency);
|
||||
|
||||
$row['uom'] = st_product_uom($order_product->getProduct());
|
||||
|
||||
$row['quantity'] = $orderProductReturns[$order_product->getId()];
|
||||
|
||||
$total_amount = $order_product->getPriceBrutto(true) * $orderProductReturns[$order_product->getId()];
|
||||
|
||||
$row['total_amount'] = st_order_price_format($total_amount, $currency);
|
||||
|
||||
|
||||
$results[] = $row;
|
||||
|
||||
$total_amount_return = $total_amount_return + $total_amount;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
$total_amount_return =st_order_price_format($total_amount_return, $currency);
|
||||
|
||||
|
||||
$smarty->assign('total_amount_return', $total_amount_return);
|
||||
|
||||
$smarty->assign('results', $results);
|
||||
|
||||
|
||||
/*$smarty->assign('front_symbol', st_front_symbol());
|
||||
|
||||
$smarty->assign('total_amount_html', st_currency_format($final_total_amount));
|
||||
|
||||
$smarty->assign('final_total_amount', st_currency_format($final_total_amount));
|
||||
|
||||
$smarty->assign('back_symbol', st_back_symbol());*/
|
||||
|
||||
|
||||
|
||||
|
||||
$smarty->assign('results', $results);
|
||||
|
||||
$smarty->assign('user_head', $head);
|
||||
|
||||
$smarty->assign('user_foot', $foot);
|
||||
|
||||
$smarty->assign('user_content_head', $head_content);
|
||||
|
||||
$smarty->assign('user_content_foot', $foot_content);
|
||||
|
||||
|
||||
$smarty->assign('bg_header_color', $mail_config->get('bg_header_color'));
|
||||
$smarty->assign('bg_footer_color', $mail_config->get('bg_footer_color'));
|
||||
$smarty->assign('bg_action_color', $mail_config->get('bg_action_color'));
|
||||
$smarty->assign('bg_action_link_color', $mail_config->get('bg_action_link_color'));
|
||||
$smarty->assign('link_color', $mail_config->get('link_color'));
|
||||
$smarty->assign('logo', $mail_config->get('logo'));
|
||||
|
||||
$smarty->display('return_send_product_returns_to_admin_html_mail.html');
|
||||
@@ -0,0 +1,62 @@
|
||||
<?php
|
||||
|
||||
use_helper('stCurrency');
|
||||
|
||||
sfLoader::loadHelpers('stProduct', 'stProduct');
|
||||
|
||||
/*$smarty->assign('created_at', $order->getCreatedAt());
|
||||
|
||||
$smarty->assign('id', $order->getId());
|
||||
|
||||
$smarty->assign('number', $order->getNumber());
|
||||
|
||||
$smarty->assign('username', $order->getSfGuardUser()->getUsername());
|
||||
|
||||
$results = array();
|
||||
|
||||
foreach ($order->getOrderProducts() as $product)
|
||||
{
|
||||
$row['instance'] = $product;
|
||||
|
||||
$row['code'] = $product->getCode();
|
||||
|
||||
$options = '';
|
||||
|
||||
if ($product->hasPriceModifiers())
|
||||
{
|
||||
foreach ($product->getPriceModifiers() as $price_modifier)
|
||||
{
|
||||
if (isset($price_modifier['custom']['field']))
|
||||
{
|
||||
$options .= ', '.$price_modifier['custom']['field'].': '.$price_modifier['label'];
|
||||
}
|
||||
else
|
||||
{
|
||||
$options .= ', '.$price_modifier['label'];
|
||||
}
|
||||
}
|
||||
|
||||
$options = '('.ltrim($options, ', ').')';
|
||||
}
|
||||
|
||||
$row['name'] = $product->getName() . " " . $options;
|
||||
|
||||
$row['netto'] = st_currency_format($product->getPriceNetto(true));
|
||||
|
||||
$row['vat'] = $product->getVat();
|
||||
|
||||
$row['brutto'] = st_currency_format($product->getPriceBrutto(true));
|
||||
|
||||
$row['quantity'] = $product->getQuantity();
|
||||
|
||||
$row['uom'] = st_product_uom($product->getProduct());
|
||||
|
||||
$row['total_amount'] = st_currency_format($product->getTotalAmount(true, true));
|
||||
|
||||
$results[] = $row;
|
||||
}
|
||||
|
||||
|
||||
$smarty->assign('results', $results);*/
|
||||
|
||||
$smarty->display('return_send_product_returns_to_admin_plain_mail.html');
|
||||
@@ -0,0 +1,129 @@
|
||||
<?php
|
||||
|
||||
sfLoader::loadHelpers('stProduct', 'stProduct');
|
||||
|
||||
use_helper('nifty', 'stOrder', 'stUrl', 'stProductOptions', 'stProductImage', 'stDelivery', 'stCurrency');
|
||||
|
||||
|
||||
|
||||
$smarty->assign('host', $sf_request->getHost());
|
||||
|
||||
$smarty->assign('created_at', date("d-m-Y H:i", strtotime($productReturns->getCreatedAt())));
|
||||
|
||||
$smarty->assign('number', $productReturns->getId());
|
||||
|
||||
$smarty->assign('product_returns', $productReturns);
|
||||
|
||||
|
||||
|
||||
$return_form['type'] = $productReturns->getReturnType();
|
||||
$return_form['fullname'] = $productReturns->getUserFullname();
|
||||
$return_form['email'] = $productReturns->getUserEmail();
|
||||
$return_form['phone'] = $productReturns->getUserPhone();
|
||||
$return_form['bank_account'] = $productReturns->getUserBankAccount();
|
||||
$return_form['description_complaint'] = $productReturns->getDescriptionComplaint();
|
||||
$return_form['description_return'] = $productReturns->getDescriptionReturn();
|
||||
|
||||
$smarty->assign('return_form', $return_form);
|
||||
|
||||
|
||||
$results = array();
|
||||
|
||||
$total_amount_return = 0;
|
||||
|
||||
foreach ($order_products as $order_product)
|
||||
{
|
||||
$total_amount = 0;
|
||||
|
||||
if(array_key_exists($order_product->getId(), $orderProductReturns)){
|
||||
|
||||
$row['code'] = $order_product->getCode();
|
||||
|
||||
$row['validate'] = $order_product->productValidate();
|
||||
|
||||
$row['instance'] = $order_product->getProduct();
|
||||
|
||||
if($row['validate'])
|
||||
{
|
||||
$row['photo'] = st_link_to(st_product_image_tag($order_product, 'icon'), 'stProduct/show?url='.$order_product->getProduct()->getFriendlyUrl());
|
||||
}
|
||||
else
|
||||
{
|
||||
$row['photo'] = st_product_image_tag(null, 'icon');
|
||||
}
|
||||
|
||||
if ($order_product->productValidate())
|
||||
{
|
||||
$row['name_show'] = st_link_to($order_product->getName(), 'stProduct/show?url=' . $order_product->getProduct()->getFriendlyUrl());
|
||||
}
|
||||
else
|
||||
{
|
||||
$row['name_show'] = $order_product->getName();
|
||||
}
|
||||
|
||||
if ($order_product->hasPriceModifiers())
|
||||
{
|
||||
$row['name_show'] = content_tag('div', $row['name_show'], array('class' => 'st_product_name_with_options')).st_product_options_get_view($order_product);
|
||||
}
|
||||
|
||||
$row['price'] = st_order_price_format($order_product->getPriceNetto(true), $currency);
|
||||
|
||||
$row['vat'] = $order_product->getVat();
|
||||
|
||||
$row['price_true'] = st_order_price_format($order_product->getPriceBrutto(true), $currency);
|
||||
|
||||
$row['uom'] = st_product_uom($order_product->getProduct());
|
||||
|
||||
$row['quantity'] = $orderProductReturns[$order_product->getId()];
|
||||
|
||||
$total_amount = $order_product->getPriceBrutto(true) * $orderProductReturns[$order_product->getId()];
|
||||
|
||||
$row['total_amount'] = st_order_price_format($total_amount, $currency);
|
||||
|
||||
|
||||
$results[] = $row;
|
||||
|
||||
$total_amount_return = $total_amount_return + $total_amount;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
$total_amount_return =st_order_price_format($total_amount_return, $currency);
|
||||
|
||||
|
||||
$smarty->assign('total_amount_return', $total_amount_return);
|
||||
|
||||
$smarty->assign('results', $results);
|
||||
|
||||
|
||||
/*$smarty->assign('front_symbol', st_front_symbol());
|
||||
|
||||
$smarty->assign('total_amount_html', st_currency_format($final_total_amount));
|
||||
|
||||
$smarty->assign('final_total_amount', st_currency_format($final_total_amount));
|
||||
|
||||
$smarty->assign('back_symbol', st_back_symbol());*/
|
||||
|
||||
|
||||
|
||||
|
||||
$smarty->assign('results', $results);
|
||||
|
||||
$smarty->assign('user_head', $head);
|
||||
|
||||
$smarty->assign('user_foot', $foot);
|
||||
|
||||
$smarty->assign('user_content_head', $head_content);
|
||||
|
||||
$smarty->assign('user_content_foot', $foot_content);
|
||||
|
||||
|
||||
$smarty->assign('bg_header_color', $mail_config->get('bg_header_color'));
|
||||
$smarty->assign('bg_footer_color', $mail_config->get('bg_footer_color'));
|
||||
$smarty->assign('bg_action_color', $mail_config->get('bg_action_color'));
|
||||
$smarty->assign('bg_action_link_color', $mail_config->get('bg_action_link_color'));
|
||||
$smarty->assign('link_color', $mail_config->get('link_color'));
|
||||
$smarty->assign('logo', $mail_config->get('logo'));
|
||||
|
||||
$smarty->display('return_send_product_returns_to_user_html_mail.html');
|
||||
@@ -0,0 +1,62 @@
|
||||
<?php
|
||||
|
||||
use_helper('stCurrency');
|
||||
|
||||
sfLoader::loadHelpers('stProduct', 'stProduct');
|
||||
|
||||
/*$smarty->assign('created_at', $order->getCreatedAt());
|
||||
|
||||
$smarty->assign('id', $order->getId());
|
||||
|
||||
$smarty->assign('number', $order->getNumber());
|
||||
|
||||
$smarty->assign('username', $order->getSfGuardUser()->getUsername());
|
||||
|
||||
$results = array();
|
||||
|
||||
foreach ($order->getOrderProducts() as $product)
|
||||
{
|
||||
$row['instance'] = $product;
|
||||
|
||||
$row['code'] = $product->getCode();
|
||||
|
||||
$options = '';
|
||||
|
||||
if ($product->hasPriceModifiers())
|
||||
{
|
||||
foreach ($product->getPriceModifiers() as $price_modifier)
|
||||
{
|
||||
if (isset($price_modifier['custom']['field']))
|
||||
{
|
||||
$options .= ', '.$price_modifier['custom']['field'].': '.$price_modifier['label'];
|
||||
}
|
||||
else
|
||||
{
|
||||
$options .= ', '.$price_modifier['label'];
|
||||
}
|
||||
}
|
||||
|
||||
$options = '('.ltrim($options, ', ').')';
|
||||
}
|
||||
|
||||
$row['name'] = $product->getName() . " " . $options;
|
||||
|
||||
$row['netto'] = st_currency_format($product->getPriceNetto(true));
|
||||
|
||||
$row['vat'] = $product->getVat();
|
||||
|
||||
$row['brutto'] = st_currency_format($product->getPriceBrutto(true));
|
||||
|
||||
$row['quantity'] = $product->getQuantity();
|
||||
|
||||
$row['uom'] = st_product_uom($product->getProduct());
|
||||
|
||||
$row['total_amount'] = st_currency_format($product->getTotalAmount(true, true));
|
||||
|
||||
$results[] = $row;
|
||||
}
|
||||
|
||||
|
||||
$smarty->assign('results', $results);*/
|
||||
|
||||
$smarty->display('return_send_product_returns_to_user_plain_mail.html');
|
||||
@@ -0,0 +1,106 @@
|
||||
<?php
|
||||
|
||||
use_helper('nifty', 'stOrder', 'stUrl', 'stProductOptions', 'stProductImage', 'stDelivery');
|
||||
|
||||
sfLoader::loadHelpers('stProduct', 'stProduct');
|
||||
|
||||
|
||||
st_theme_use_stylesheet('stUser.css');
|
||||
|
||||
st_theme_use_stylesheet('stOrder.css');
|
||||
|
||||
$smarty->assign('user_panel_menu', st_get_component('stUserData', 'userPanelMenu'));
|
||||
|
||||
|
||||
$smarty->assign('return_form', $return_form);
|
||||
|
||||
|
||||
$results = array();
|
||||
|
||||
$total_amount_return = 0;
|
||||
|
||||
foreach ($order_products as $order_product)
|
||||
{
|
||||
$total_amount = 0;
|
||||
|
||||
if(array_key_exists($order_product->getId(), $orderProductReturns)){
|
||||
|
||||
$row['code'] = $order_product->getCode();
|
||||
|
||||
$row['validate'] = $order_product->productValidate();
|
||||
|
||||
if($row['validate'])
|
||||
{
|
||||
$row['photo'] = st_link_to(st_product_image_tag($order_product, 'icon'), 'stProduct/show?url='.$order_product->getProduct()->getFriendlyUrl());
|
||||
}
|
||||
else
|
||||
{
|
||||
$row['photo'] = st_product_image_tag(null, 'icon');
|
||||
}
|
||||
|
||||
if ($order_product->productValidate())
|
||||
{
|
||||
$row['name_show'] = st_link_to($order_product->getName(), 'stProduct/show?url=' . $order_product->getProduct()->getFriendlyUrl());
|
||||
}
|
||||
else
|
||||
{
|
||||
$row['name_show'] = $order_product->getName();
|
||||
}
|
||||
|
||||
if ($order_product->hasPriceModifiers())
|
||||
{
|
||||
$row['name_show'] = content_tag('div', $row['name_show'], array('class' => 'st_product_name_with_options')).st_product_options_get_view($order_product);
|
||||
}
|
||||
|
||||
$row['price'] = st_order_price_format($order_product->getPriceNetto(true), $currency);
|
||||
|
||||
$row['vat'] = $order_product->getVat();
|
||||
|
||||
$row['price_true'] = st_order_price_format($order_product->getPriceBrutto(true), $currency);
|
||||
|
||||
$row['uom'] = st_product_uom($order_product->getProduct());
|
||||
|
||||
$row['quantity'] = $orderProductReturns[$order_product->getId()];
|
||||
|
||||
$total_amount = $order_product->getPriceBrutto(true) * $orderProductReturns[$order_product->getId()];
|
||||
|
||||
$row['total_amount'] = st_order_price_format($total_amount, $currency);
|
||||
|
||||
|
||||
$results[] = $row;
|
||||
|
||||
$total_amount_return = $total_amount_return + $total_amount;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
$total_amount_return =st_order_price_format($total_amount_return, $currency);
|
||||
|
||||
|
||||
$smarty->assign('total_amount_return', $total_amount_return);
|
||||
|
||||
$smarty->assign('results', $results);
|
||||
|
||||
$smarty->assign("show_code_in_basket", $basket_config->get('show_code_in_basket'));
|
||||
|
||||
$smarty->assign("show_photo_in_basket", $basket_config->get('show_photo_in_basket'));
|
||||
|
||||
$smarty->assign("show_netto_in_basket", $basket_config->get('show_netto_in_basket'));
|
||||
|
||||
$smarty->assign("show_tax_in_basket", $basket_config->get('show_tax_in_basket'));
|
||||
|
||||
$smarty->assign("show_uom_in_basket", $basket_config->get('show_uom_in_basket'));
|
||||
|
||||
$culture = sfContext::getInstance()->getUser()->getCulture();
|
||||
|
||||
$smarty->assign('pdf_link', st_url_for('stProductReturnsPdf/show?id=' . $return_form['return_id'] . '&hash_code=' . $return_form['hash_code']. '&culture=' . $culture));
|
||||
|
||||
|
||||
$smarty->assign('return_link', st_url_for('stOrder/show?id=' . $order->getId() . '&hash_code=' . $order->getHashCode()));
|
||||
|
||||
|
||||
$smarty->display('return_show.html'); ?>
|
||||
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
use_helper('nifty', 'stOrder', 'stUrl', 'stProductOptions', 'stProductImage', 'stDelivery');
|
||||
|
||||
sfLoader::loadHelpers('stProduct', 'stProduct');
|
||||
|
||||
|
||||
st_theme_use_stylesheet('stUser.css');
|
||||
|
||||
st_theme_use_stylesheet('stOrder.css');
|
||||
|
||||
$smarty->assign('return_id', $return_id);
|
||||
|
||||
$smarty->assign('show_back', $show_back);
|
||||
|
||||
$smarty->assign('return_form_type', $return_form_type);
|
||||
|
||||
$smarty->assign('return_link', st_url_for('stOrder/show?id=' . $order->getId() . '&hash_code=' . $order->getHashCode()));
|
||||
|
||||
$culture = sfContext::getInstance()->getUser()->getCulture();
|
||||
|
||||
|
||||
$smarty->assign('pdf_link', st_url_for('stProductReturnsPdf/show?id=' . $return_id . '&hash_code=' . $order->getHashCode(). '&culture=' . $culture));
|
||||
|
||||
$smarty->assign("text_summary", $config->get('text_summary', null, true));
|
||||
|
||||
|
||||
$smarty->display('return_summary_form.html'); ?>
|
||||
@@ -0,0 +1 @@
|
||||
<h1>{$hello}</h1>
|
||||
@@ -0,0 +1,211 @@
|
||||
{set layout="one_column"}
|
||||
<div class="user-control">
|
||||
{st_get_component module="stUserData" component="responsiveUserPanelMenu" active_tab="2"}
|
||||
<div id="order-show">
|
||||
|
||||
{if $return_form.type == "return"}
|
||||
<h3>{__ text="Weryfikacja danych rezygnacji"}</h3>
|
||||
{/if}
|
||||
|
||||
{if $return_form.type == "complaint"}
|
||||
<h3>{__ text="Weryfikacja danych reklamacji"}</h3>
|
||||
{/if}
|
||||
|
||||
|
||||
{$text_confirm}
|
||||
|
||||
<br><br>
|
||||
|
||||
<div class="row">
|
||||
|
||||
<div class="col-sm-12 col-lg-12">
|
||||
|
||||
<h4>{__ text="Typ zwrotu"}</h4>
|
||||
|
||||
{if $return_form.type == "return"}
|
||||
{__ text="Rezygnacja - chce zwrócić zakupiony produkt."}
|
||||
{/if}
|
||||
|
||||
{if $return_form.type == "complaint"}
|
||||
{__ text="Reklamacja - produkt jest uszkodzony lub niepełnowartościowy."}
|
||||
{/if}
|
||||
|
||||
<br><br>
|
||||
|
||||
<h4>{__ text="Wybrane produkty do zwrotu"}</h4>
|
||||
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
{if $show_code_in_basket}<th>{__ text="kod"}</th>{/if}
|
||||
<th>{__ text="nazwa"}</th>
|
||||
{if $show_netto_in_basket}<th class="th-td-right">{__ text="netto"}</th>{/if}
|
||||
{if $show_tax_in_basket}<th class="th-td-center">{__ text="vat"}</th>{/if}
|
||||
<th class="th-td-right">{__ text="cena jed. brutto"}</th>
|
||||
<th class="th-td-center">{__ text="ilość"}</th>
|
||||
{if $show_uom_in_basket}<th class="th-td-center">{__ text="j.m."}</th>{/if}
|
||||
<th class="th-td-right">{__ text="suma"}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{foreach key=row item=order_product from=$results}
|
||||
<tr id="row-{$order_product.code}">
|
||||
{if $show_code_in_basket}<td data-th='{__ text="kod"}' class="mobile">{$order_product.code}</td>{/if}
|
||||
<td data-th='{__ text="nazwa"}' class="product-name">{if isset($order_product.product_name)}{$order_product.product_name}{else}{if isset($order_product.validate)}{$order_product.name_show}{else}{$order_product.name}{/if}{/if}</td>
|
||||
{if $show_netto_in_basket}<td data-th='{__ text="netto"}' class="th-td-right mobile" nowrap>{$order_product.price}</td>{/if}
|
||||
{if $show_tax_in_basket}<td data-th='{__ text="vat"}' class="th-td-center mobile" nowrap>{$order_product.vat} %</td>{/if}
|
||||
<td nowrap data-th='{__ text="brutto"}' class="th-td-right mobile">{$order_product.price_true}</td>
|
||||
<td data-th='{__ text="ilość"}' class="th-td-center mobile">{$order_product.quantity}</td>
|
||||
{if $show_uom_in_basket}<td data-th='{__ text="j.m."}' class="th-td-center mobile">{$order_product.uom}</td>{/if}
|
||||
<td data-th='{__ text="suma"}' class="th-td-right">{$order_product.total_amount}</td>
|
||||
</tr>
|
||||
|
||||
{/foreach}
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
{if $return_form.type == "return"}
|
||||
<table class="table">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td class="th-td-right">{__ text="Całkowita kwota zwrotu"}: <b>{$total_amount_return}</b></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
{/if}
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
|
||||
<div class="col-sm-4 col-lg-4">
|
||||
|
||||
<h4>{__ text="Dane zwrotu"}</h4>
|
||||
|
||||
{$return_form.fullname}<br>
|
||||
{$return_form.email}<br>
|
||||
{$return_form.phone}<br>
|
||||
|
||||
{if $return_form.bank_account != "" && $return_form.type == "return"}
|
||||
{$return_form.bank_account}<br>
|
||||
{/if}
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
{if $return_form.description_complaint != ""}
|
||||
<div class="col-sm-4 col-lg-4">
|
||||
|
||||
<h4>{__ text="Opis reklamacji"}</h4>
|
||||
{$return_form.description_complaint}<br>
|
||||
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
|
||||
{if $return_form.description_return != ""}
|
||||
<div class="col-sm-4 col-lg-4">
|
||||
|
||||
<h4>{__ text="Uwagi do zwrotu"}</h4>
|
||||
{$return_form.description_return}<br>
|
||||
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<br><br>
|
||||
|
||||
|
||||
<div class="row">
|
||||
|
||||
{$form_start}
|
||||
|
||||
{$input_hidden_order_id}
|
||||
{$input_hidden_hash_code}
|
||||
{$input_hidden_return_form}
|
||||
{$input_hidden_total_amount_return}
|
||||
|
||||
{if $return_form.type == "return"}
|
||||
<button id="confirm-button" type="submit" class="btn btn-primary pull-right">
|
||||
{__ text="Wyślij rezygnację"}
|
||||
</button>
|
||||
{/if}
|
||||
|
||||
{if $return_form.type == "complaint"}
|
||||
|
||||
<button id="confirm-button" type="submit" class="btn btn-primary pull-right">
|
||||
{__ text="Wyślij reklamację"}
|
||||
</button>
|
||||
|
||||
{/if}
|
||||
|
||||
|
||||
|
||||
</form>
|
||||
|
||||
|
||||
{$form_back}
|
||||
|
||||
{$input_hidden_order_id}
|
||||
{$input_hidden_hash_code}
|
||||
{$input_hidden_return_form}
|
||||
|
||||
|
||||
<button type="submit" class="btn btn-default pull-left" >
|
||||
{__ text="Popraw dane"}
|
||||
</button>
|
||||
|
||||
</form>
|
||||
|
||||
|
||||
<!-- Modal -->
|
||||
<div class="modal fade" id="confirm-modal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true" style="top: 20vh;">
|
||||
<div class="modal-dialog">
|
||||
|
||||
<div class="modal-content text-center" style="padding: 30px;">
|
||||
|
||||
{if $return_form.type == "return"}
|
||||
|
||||
{__ text="Trwa składanie rezygnacji."}
|
||||
|
||||
{/if}
|
||||
|
||||
{if $return_form.type == "complaint"}
|
||||
|
||||
{__ text="Trwa składanie reklamacji."}
|
||||
|
||||
{/if}
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
{literal}
|
||||
<script type="text/javascript" language="javascript">
|
||||
jQuery(function ($)
|
||||
{
|
||||
$(document).ready(function ()
|
||||
{
|
||||
$('#confirm-button').click(function()
|
||||
{
|
||||
$('#confirm-modal').modal({backdrop: 'static', keyboard: false});
|
||||
$('#confirm-modal').modal('show');
|
||||
|
||||
});
|
||||
|
||||
});
|
||||
});
|
||||
</script>
|
||||
{/literal}
|
||||
@@ -0,0 +1,268 @@
|
||||
{set layout="one_column"}
|
||||
<div class="user-control">
|
||||
{st_get_component module="stUserData" component="responsiveUserPanelMenu" active_tab="2"}
|
||||
<div id="order-show">
|
||||
|
||||
<h3>{__ text="Formularz zwrotu"}</h3>
|
||||
|
||||
{$text_form}
|
||||
|
||||
<br><br>
|
||||
|
||||
{$form_start}
|
||||
|
||||
|
||||
<div class="row">
|
||||
|
||||
<div class="col-sm-12 col-lg-12">
|
||||
|
||||
<h4>{__ text="Typ zwrotu"}</h4>
|
||||
|
||||
<div class="form-group">
|
||||
{$input_return_type_return} {__ text="Rezygnacja - chce zwrócić zakupiony produkt."}
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
{$input_return_type_complaint} {__ text="Reklamacja - produkt jest uszkodzony lub niepełnowartościowy."}
|
||||
</div>
|
||||
|
||||
|
||||
<br><br>
|
||||
|
||||
<h4>{__ text="Wybierz produkty do zwrotu"}</h4>
|
||||
|
||||
<div class="form-group {if $error_return_checkbox!=''}has-error{/if}">
|
||||
{if $error_return_checkbox!=""}<label class="control-label" for="return_products">{$error_return_checkbox}</label>{/if}
|
||||
</div>
|
||||
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th></th>
|
||||
{if $show_code_in_basket}<th>{__ text="kod"}</th>{/if}
|
||||
<th>{__ text="nazwa"}</th>
|
||||
{if $show_netto_in_basket}<th class="th-td-right">{__ text="netto"}</th>{/if}
|
||||
{if $show_tax_in_basket}<th class="th-td-center">{__ text="vat"}</th>{/if}
|
||||
<th class="th-td-right">{__ text="cena jed. brutto"}</th>
|
||||
<th class="th-td-center">{__ text="ilość"}</th>
|
||||
{if $show_uom_in_basket}<th class="th-td-center">{__ text="j.m."}</th>{/if}
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{foreach key=row item=order_product from=$results}
|
||||
<tr id="row-{$order_product.code}" >
|
||||
<td>{$order_product.checkbox}</td>
|
||||
{if $show_code_in_basket}<td data-th='{__ text="kod"}' class="mobile">{$order_product.code}</td>{/if}
|
||||
<td data-th='{__ text="nazwa"}' class="product-name">{if isset($order_product.product_name)}{$order_product.product_name}{else}{if isset($order_product.validate)}{$order_product.name_show}{else}{$order_product.name}{/if}{/if}<br><div class="has-error"><i class="control-label" style="font-size: 12px;" id="return_form_checkbox_{$order_product.code}_label" ></i></div></div></td>
|
||||
{if $show_netto_in_basket}<td data-th='{__ text="netto"}' class="th-td-right mobile" nowrap>{$order_product.price}</td>{/if}
|
||||
{if $show_tax_in_basket}<td data-th='{__ text="vat"}' class="th-td-center mobile" nowrap>{$order_product.vat} %</td>{/if}
|
||||
<td nowrap data-th='{__ text="brutto"}' class="th-td-right mobile">{$order_product.price_true}</td>
|
||||
<td data-th='{__ text="ilość"}' class="th-td-center mobile"><div style="width: 80px; margin: 0px auto;">{$order_product.quantity}</div></td>
|
||||
{if $show_uom_in_basket}<td data-th='{__ text="j.m."}' class="th-td-center mobile">{$order_product.uom}</td>{/if}
|
||||
</tr>
|
||||
|
||||
{/foreach}
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
|
||||
<div class="col-sm-6 col-lg-6">
|
||||
|
||||
</div>
|
||||
|
||||
<div class="col-sm-6 col-lg-6">
|
||||
|
||||
<h4>{__ text="Dane zwrotu"}</h4>
|
||||
|
||||
<div class="form-group {if $error_return_fullname!=''}has-error{/if}">
|
||||
{if $error_return_fullname!=""}<label class="control-label" for="return_fullname">{$error_return_fullname}</label>{/if}
|
||||
{$input_return_fullname}
|
||||
</div>
|
||||
|
||||
|
||||
<div class="form-group {if $error_return_email!=''}has-error{/if}">
|
||||
{if $error_return_email!=""}<label class="control-label" for="return_email">{$error_return_email}</label>{/if}
|
||||
{$input_return_email}
|
||||
</div>
|
||||
|
||||
<div class="form-group {if $error_return_phone!=''}has-error{/if}">
|
||||
{if $error_return_phone!=""}<label class="control-label" for="return_phone">{$error_return_phone}</label>{/if}
|
||||
{$input_return_phone}
|
||||
</div>
|
||||
|
||||
<div id="form-group-bank-account" class="form-group {if $error_return_bank_account!=''}has-error{/if}">
|
||||
{if $error_return_bank_account!=""}<label class="control-label" for="return_bank_account">{$error_return_bank_account}</label>{/if}
|
||||
{$input_return_bank_account}
|
||||
</div>
|
||||
|
||||
<textarea style="margin-bottom: 3px;" id="description_complaint" name="return_form[description_complaint]" placeholder='{__ text="Opis reklamacji"}' class="form-control" rows="3" >{$description_complaint}</textarea>
|
||||
|
||||
<textarea id="description_return" name="return_form[description_return]" placeholder='{__ text="Uwagi do zwrotu"}' class="form-control" rows="3" >{$description_return}</textarea>
|
||||
|
||||
|
||||
{$input_hidden_order_id}
|
||||
{$input_hidden_hash_code}
|
||||
|
||||
<br>
|
||||
|
||||
|
||||
<button id="button-submit-return" type="submit" class="btn btn-primary pull-right" >
|
||||
{__ text="Przejdź do podsumowania rezygnacji"}
|
||||
</button>
|
||||
|
||||
<button id="button-submit-complaint" type="submit" class="btn btn-primary pull-right" >
|
||||
{__ text="Przejdź do podsumowania reklamacji"}
|
||||
</button>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</form>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
{literal}
|
||||
<script type="text/javascript">
|
||||
jQuery(function ($)
|
||||
{
|
||||
$(document).ready(function()
|
||||
{
|
||||
|
||||
setDefaultRadio();
|
||||
checkReturnType();
|
||||
disabledWithoutReturn();
|
||||
hideUnchecked();
|
||||
|
||||
|
||||
$( ".checkobox" ).change(function() {
|
||||
disabledWithoutReturn();
|
||||
hideUnchecked();
|
||||
});
|
||||
|
||||
$( ".radio_type" ).change(function() {
|
||||
checkReturnType();
|
||||
|
||||
disabledWithoutReturn();
|
||||
hideUnchecked();
|
||||
});
|
||||
|
||||
|
||||
function hideUnchecked(){
|
||||
$('.checkobox').each(function(i, obj) {
|
||||
|
||||
$val = $(this).attr('data-visible');
|
||||
|
||||
if($(this).prop('checked')){
|
||||
|
||||
$('#row-'+$val).css('opacity', '1');
|
||||
|
||||
}else{
|
||||
|
||||
$('#row-'+$val).css('opacity', '0.4');
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
function disabledWithoutReturn(){
|
||||
$('.checkobox').each(function(i, obj) {
|
||||
|
||||
var without_return = $(this).attr('data-without-return');
|
||||
|
||||
var date_to_return = $(this).attr('data-date-to-return');
|
||||
|
||||
var return_type = $('input[name="return_form[type]"]:checked').val();
|
||||
|
||||
var today = {/literal}{$today_to_return}{literal};
|
||||
|
||||
if(return_type == "return"){
|
||||
|
||||
if(date_to_return <= today){
|
||||
console.log("minął czas na zwrot");
|
||||
|
||||
$(this).attr("disabled", true);
|
||||
$(this).attr("checked", false);
|
||||
$(this).hide();
|
||||
|
||||
var id = $(this).attr("id");
|
||||
$("#"+id+"_label").html('{/literal}{__ text="Minął czas zwrotu produktu"}{literal}');
|
||||
}
|
||||
|
||||
if(without_return == 1){
|
||||
console.log("produkt bez zwrotu");
|
||||
|
||||
$(this).attr("disabled", true);
|
||||
$(this).attr("checked", false);
|
||||
$(this).hide();
|
||||
|
||||
var id = $(this).attr("id");
|
||||
$("#"+id+"_label").html('{/literal}{__ text="Produkt bez możliwości zwrotu"}{literal}');
|
||||
}
|
||||
|
||||
|
||||
|
||||
}else{
|
||||
|
||||
$(this).attr("disabled", false);
|
||||
$(this).show();
|
||||
|
||||
var id = $(this).attr("id");
|
||||
$("#"+id+"_label").html('');
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
function setDefaultRadio(){
|
||||
|
||||
var $radios = $('input:radio[name="return_form[type]"]');
|
||||
|
||||
if($radios.is(':checked') === false) {
|
||||
$radios.filter('[value=return]').prop('checked', true);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function checkReturnType(){
|
||||
|
||||
$return_type = $('input[name="return_form[type]"]:checked').val();
|
||||
|
||||
if($return_type == "return"){
|
||||
$('#description_complaint').hide();
|
||||
$('#form-group-bank-account').show();
|
||||
|
||||
$("#button-submit-return").show();
|
||||
$("#button-submit-complaint").hide();
|
||||
}
|
||||
|
||||
if($return_type == "complaint"){
|
||||
$('#description_complaint').show();
|
||||
$('#form-group-bank-account').hide();
|
||||
|
||||
$("#button-submit-return").hide();
|
||||
$("#button-submit-complaint").show();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
});
|
||||
});
|
||||
</script>
|
||||
{/literal}
|
||||
@@ -0,0 +1,547 @@
|
||||
<!-- http://templates.mailchimp.com/resources/inline-css/ -->
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" style="margin: 0;padding: 0;font-family: Arial, sans-serif;">
|
||||
<head style="margin: 0;padding: 0;font-family: Arial, sans-serif;">
|
||||
|
||||
<meta name="viewport" content="width=device-width" style="margin: 0;padding: 0;font-family: Arial, sans-serif;">
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" style="margin: 0;padding: 0;font-family: Arial, sans-serif;">
|
||||
<title style="margin: 0;padding: 0;font-family: Arial, sans-serif;">ZURBemails</title>
|
||||
|
||||
<style style="margin: 0;padding: 0;font-family: Arial, sans-serif;">
|
||||
{literal}
|
||||
/* -------------------------------------
|
||||
GLOBAL
|
||||
------------------------------------- */
|
||||
* {
|
||||
margin:0;
|
||||
padding:0;
|
||||
}
|
||||
* { font-family: Arial, sans-serif; }
|
||||
|
||||
img {
|
||||
max-width: 100%;
|
||||
}
|
||||
.collapse {
|
||||
margin:0;
|
||||
padding:0;
|
||||
}
|
||||
|
||||
body {
|
||||
-webkit-font-smoothing:antialiased;
|
||||
-webkit-text-size-adjust:none;
|
||||
width: 100%!important;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.tinymce_html{
|
||||
font-size:10px;
|
||||
}
|
||||
|
||||
.tinymce_html img,
|
||||
.tinymce_html embed,
|
||||
.tinymce_html video
|
||||
{
|
||||
max-width: 100%;
|
||||
height: auto !important;
|
||||
}
|
||||
|
||||
.image > a > img
|
||||
{
|
||||
max-width: 100% !important;
|
||||
height: auto !important;
|
||||
}
|
||||
|
||||
.tinymce_html object,
|
||||
.tinymce_html iframe
|
||||
{
|
||||
max-width: 100%;
|
||||
}
|
||||
|
||||
.tinymce_html table th,
|
||||
.tinymce_html table td
|
||||
{
|
||||
padding: 5px 10px;
|
||||
}
|
||||
|
||||
.tinymce_html ul
|
||||
{
|
||||
padding-left: 19px;
|
||||
}
|
||||
|
||||
.tinymce_html ul ul,
|
||||
.tinymce_html ol
|
||||
{
|
||||
padding-left: 30px;
|
||||
font-size:12px;
|
||||
}
|
||||
|
||||
.tinymce_html ol
|
||||
{
|
||||
counter-reset: item;
|
||||
}
|
||||
|
||||
.tinymce_html ol > li:before
|
||||
{
|
||||
content: counters(item, ".") ". ";
|
||||
counter-increment: item;
|
||||
position: absolute;
|
||||
margin-left: -19px;
|
||||
}
|
||||
|
||||
.tinymce_html ol[style*="lower"] ol,
|
||||
.tinymce_html ol[style*="upper"] ol
|
||||
{
|
||||
list-style-type: decimal;
|
||||
padding-left: 17px;
|
||||
}
|
||||
|
||||
.tinymce_html ol[style*="lower"] li:before,
|
||||
.tinymce_html ol[style*="upper"] li:before
|
||||
{
|
||||
display: none;
|
||||
}
|
||||
|
||||
.tinymce_html ol ol
|
||||
{
|
||||
padding-left: 27px;
|
||||
}
|
||||
|
||||
.tinymce_html ol ol li:before
|
||||
{
|
||||
margin-left: -27px;
|
||||
}
|
||||
|
||||
.tinymce_html ol ol ol
|
||||
{
|
||||
padding-left: 38px;
|
||||
}
|
||||
|
||||
.tinymce_html ol ol ol li:before
|
||||
{
|
||||
margin-left: -38px;
|
||||
}
|
||||
|
||||
.tinymce_html ol ol ol ol
|
||||
{
|
||||
padding-left: 48px;
|
||||
}
|
||||
|
||||
.tinymce_html ol ol ol ol li:before
|
||||
{
|
||||
margin-left: -48px;
|
||||
}
|
||||
|
||||
.tinymce_html a
|
||||
{
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
.tinymce_html h1
|
||||
{
|
||||
margin-top:15px;
|
||||
font-size: 20px;
|
||||
}
|
||||
|
||||
.tinymce_html h2
|
||||
{
|
||||
margin-top:15px;
|
||||
font-size: 18px;
|
||||
}
|
||||
|
||||
.tinymce_html h3
|
||||
{
|
||||
margin-top:15px;
|
||||
font-size: 16px;
|
||||
font-weight: 300;
|
||||
}
|
||||
|
||||
.tinymce_html h4
|
||||
{
|
||||
margin-top:15px;
|
||||
font-size: 15px;
|
||||
font-weight: 300;
|
||||
}
|
||||
|
||||
.tinymce_html h5
|
||||
{
|
||||
margin-top:15px;
|
||||
font-size: 14px;
|
||||
font-weight: 300;
|
||||
}
|
||||
|
||||
.tinymce_html h6
|
||||
{
|
||||
margin-top:15px;
|
||||
font-size: 14px;
|
||||
font-weight: 300;
|
||||
}
|
||||
|
||||
/* -------------------------------------
|
||||
ELEMENTS
|
||||
------------------------------------- */
|
||||
a { color: #{/literal}{$link_color}{literal};}
|
||||
|
||||
.btn {
|
||||
text-decoration:none;
|
||||
color: #FFF;
|
||||
background-color: #666;
|
||||
padding:10px 16px;
|
||||
font-weight:bold;
|
||||
margin-right:10px;
|
||||
text-align:center;
|
||||
cursor:pointer;
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
p.callout {
|
||||
padding:15px;
|
||||
background-color:#ECF8FF;
|
||||
margin-bottom: 15px;
|
||||
}
|
||||
.callout a {
|
||||
font-weight:bold;
|
||||
color: #2BA6CB;
|
||||
}
|
||||
|
||||
table.social {
|
||||
|
||||
background-color: #ebebeb;
|
||||
|
||||
}
|
||||
.social .soc-btn {
|
||||
padding: 3px 7px;
|
||||
font-size:12px;
|
||||
margin-bottom:10px;
|
||||
text-decoration:none;
|
||||
color: #FFF;font-weight:bold;
|
||||
display:block;
|
||||
text-align:center;
|
||||
}
|
||||
a.fb { background-color: #3B5998!important; }
|
||||
a.tw { background-color: #1daced!important; }
|
||||
a.gp { background-color: #DB4A39!important; }
|
||||
a.ms { background-color: #000!important; }
|
||||
|
||||
.sidebar .soc-btn {
|
||||
display:block;
|
||||
width:100%;
|
||||
}
|
||||
|
||||
/* -------------------------------------
|
||||
HEADER
|
||||
------------------------------------- */
|
||||
table.head-wrap { width: 100%;}
|
||||
|
||||
.header.container table td.logo { padding: 15px; }
|
||||
.header.container table td.label { padding: 15px; padding-left:0px;}
|
||||
|
||||
|
||||
/* -------------------------------------
|
||||
BODY
|
||||
------------------------------------- */
|
||||
table.body-wrap { width: 100%;}
|
||||
|
||||
|
||||
/* -------------------------------------
|
||||
FOOTER
|
||||
------------------------------------- */
|
||||
table.footer-wrap { width: 100%; clear:both!important;
|
||||
}
|
||||
.footer-wrap .container td.content p { border-top: 1px solid rgb(215,215,215); padding-top:15px;}
|
||||
.footer-wrap .container td.content p {
|
||||
font-size:10px;
|
||||
font-weight: bold;
|
||||
|
||||
}
|
||||
|
||||
|
||||
/* -------------------------------------
|
||||
TYPOGRAPHY
|
||||
------------------------------------- */
|
||||
h1,h2,h3,h4,h5,h6 {
|
||||
font-family: Arial, sans-serif; line-height: 1.1; margin-bottom:15px; color:#000;
|
||||
}
|
||||
h1 small, h2 small, h3 small, h4 small, h5 small, h6 small { font-size: 60%; color: #6f6f6f; line-height: 0; text-transform: none; }
|
||||
|
||||
h1 { font-weight:200; font-size: 44px;}
|
||||
h2 { font-weight:200; font-size: 37px;}
|
||||
h3 { font-weight:500; font-size: 27px;}
|
||||
h4 { font-weight:500; font-size: 23px;}
|
||||
h5 { font-weight:900; font-size: 17px;}
|
||||
h6 { font-weight:900; font-size: 14px; text-transform: uppercase; color:#444;}
|
||||
|
||||
.collapse { margin:0!important;}
|
||||
|
||||
p, ul {
|
||||
margin-bottom: 10px;
|
||||
font-weight: normal;
|
||||
font-size:12px;
|
||||
line-height:1.6;
|
||||
}
|
||||
p.lead { font-size:17px; }
|
||||
p.last { margin-bottom:0px;}
|
||||
|
||||
ul li {
|
||||
margin-left:5px;
|
||||
list-style-position: inside;
|
||||
}
|
||||
|
||||
/* -------------------------------------
|
||||
SIDEBAR
|
||||
------------------------------------- */
|
||||
ul.sidebar {
|
||||
background:#ebebeb;
|
||||
display:block;
|
||||
list-style-type: none;
|
||||
}
|
||||
ul.sidebar li { display: block; margin:0;}
|
||||
ul.sidebar li a {
|
||||
text-decoration:none;
|
||||
color: #666;
|
||||
padding:10px 16px;
|
||||
/* font-weight:bold; */
|
||||
margin-right:10px;
|
||||
/* text-align:center; */
|
||||
cursor:pointer;
|
||||
border-bottom: 1px solid #777777;
|
||||
border-top: 1px solid #FFFFFF;
|
||||
display:block;
|
||||
margin:0;
|
||||
}
|
||||
ul.sidebar li a.last { border-bottom-width:0px;}
|
||||
ul.sidebar li a h1,ul.sidebar li a h2,ul.sidebar li a h3,ul.sidebar li a h4,ul.sidebar li a h5,ul.sidebar li a h6,ul.sidebar li a p { margin-bottom:0!important;}
|
||||
|
||||
|
||||
|
||||
/* ---------------------------------------------------
|
||||
RESPONSIVENESS
|
||||
Nuke it from orbit. It's the only way to be sure.
|
||||
------------------------------------------------------ */
|
||||
|
||||
/* Set a max-width, and make it display as block so it will automatically stretch to that width, but will also shrink down on a phone or something */
|
||||
.container {
|
||||
display:block!important;
|
||||
max-width:600px!important;
|
||||
margin:0 auto!important; /* makes it centered */
|
||||
clear:both!important;
|
||||
}
|
||||
|
||||
/* This should also be a block element, so that it will fill 100% of the .container */
|
||||
.content {
|
||||
padding:15px;
|
||||
max-width:600px;
|
||||
margin:0 auto;
|
||||
display:block;
|
||||
}
|
||||
|
||||
/* Let's make sure tables in the content area are 100% wide */
|
||||
.content table { width: 100%; }
|
||||
|
||||
|
||||
/* Odds and ends */
|
||||
.column {
|
||||
width: 300px;
|
||||
float:left;
|
||||
}
|
||||
.social .column tr td { padding: 15px; }
|
||||
|
||||
.user_data .column tr td { padding-bottom: 15px; }
|
||||
|
||||
.column-wrap {
|
||||
padding:0!important;
|
||||
margin:0 auto;
|
||||
max-width:600px!important;
|
||||
}
|
||||
.column table { width:100%;}
|
||||
|
||||
.social .column {
|
||||
width: 280px;
|
||||
min-width: 279px;
|
||||
float:left;
|
||||
}
|
||||
|
||||
.user_data .column {
|
||||
width: 280px;
|
||||
min-width: 279px;
|
||||
float:left;
|
||||
}
|
||||
|
||||
/* Be sure to place a .clear element after each set of columns, just to be safe */
|
||||
.clear { display: block; clear: both; }
|
||||
|
||||
|
||||
/* -------------------------------------------
|
||||
PHONE
|
||||
For clients that support media queries.
|
||||
Nothing fancy.
|
||||
-------------------------------------------- */
|
||||
@media only screen and (max-width: 600px) {
|
||||
|
||||
a[class="btn"] { display:block!important; margin-bottom:10px!important; background-image:none!important; margin-right:0!important;}
|
||||
|
||||
div[class="column"] { width: auto!important; float:none!important;}
|
||||
|
||||
table.social div[class="column"] {
|
||||
width:auto!important;
|
||||
}
|
||||
|
||||
}
|
||||
{/literal}
|
||||
</style>
|
||||
|
||||
</head>
|
||||
|
||||
<body bgcolor="#FFFFFF" style="margin: 0;padding: 0;font-family: Arial, sans-serif;font-size: 12px;-webkit-font-smoothing: antialiased;-webkit-text-size-adjust: none;height: 100%;width: 100%!important;">
|
||||
|
||||
<!-- HEADER -->
|
||||
<table class="head-wrap" bgcolor="#{$bg_header_color}" style="margin: 0;padding: 0;font-family: Arial, sans-serif;font-size: 12px;width: 100%;">
|
||||
<tr style="margin: 0;padding: 0;font-family: Arial, sans-serif;font-size: 12px;">
|
||||
<td style="margin: 0;padding: 0;font-family: Arial, sans-serif;font-size: 12px;"></td>
|
||||
<td class="header container" style="margin: 0 auto!important;padding: 0;font-family: Arial, sans-serif;font-size: 12px;display: block!important;max-width: 600px!important;clear: both!important;">
|
||||
|
||||
<div class="content" style="margin: 0 auto;padding: 15px;font-family: Arial, sans-serif;font-size: 12px;max-width: 600px;display: block;">
|
||||
<table bgcolor="#{$bg_header_color}" style="margin: 0;padding: 0;font-family: Arial, sans-serif;font-size: 12px;width: 100%;">
|
||||
<tr style="margin: 0;padding: 0;font-family: Arial, sans-serif;font-size: 12px;">
|
||||
<td style="margin: 0;padding: 0;font-family: Arial, sans-serif;font-size: 12px;">{if $logo!=""}<img src="http://{$host}/uploads{$logo}?version=1" style="margin: 0;padding: 0;font-family: Arial, sans-serif;font-size: 12px;max-width: 100%; max-height: 50px;">{/if}</td>
|
||||
<td align="right" style="margin: 0;padding: 0;font-family: Arial, sans-serif;"><h6 class="collapse" style="margin: 0!important;padding: 0;font-family: "helveticaneue-light": ;, ": ;helvetica neue light": ;helvetica neue": ;, helvetica, arial, ": ;lucida grande": ;, sans-serif: ;line-height: 1.1;margin-bottom: 15px;color: #444;font-weight: 900;font-size: 14px;text-transform: uppercase;">{$created_at}</h6></td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
</td>
|
||||
<td style="margin: 0;padding: 0;font-family: Arial, sans-serif;"></td>
|
||||
</tr>
|
||||
</table><!-- /HEADER -->
|
||||
|
||||
|
||||
<!-- BODY -->
|
||||
<table class="body-wrap" cellpadding="0" cellspacing="0" style="margin: 0;padding: 0;font-family: Arial, sans-serif;width: 100%;">
|
||||
<tr style="margin: 0;padding: 0;font-family: Arial, sans-serif;">
|
||||
<td style="margin: 0;padding: 0;font-family: Arial, sans-serif;"></td>
|
||||
<td class="container" bgcolor="#FFFFFF" style="margin: 0 auto!important;padding: 0;font-family: Arial, sans-serif;display: block!important;max-width: 600px!important;clear: both!important;">
|
||||
|
||||
<div class="content" style="margin: 0 auto;padding: 15px;font-family: Arial, sans-serif;max-width: 600px;display: block;">
|
||||
<table cellpadding="0" cellspacing="0" style="margin: 0;padding: 0;font-family: Arial, sans-serif;width: 100%;">
|
||||
<tr style="margin: 0;padding: 0;font-family: Arial, sans-serif;">
|
||||
<td style="margin: 0;padding: 0;font-family: Arial, sans-serif;">
|
||||
<p style="font-size: 12px;margin: 0;padding: 0;font-family: Arial, sans-serif;margin-bottom: 10px;font-weight: normal;line-height: 1.6;">{$user_head}</p>
|
||||
|
||||
<h4 style="margin: 0;padding: 0;font-family: "helveticaneue-light": ;, ": ;helvetica neue light": ;helvetica neue": ;, helvetica, arial, ": ;lucida grande": ;, sans-serif: ;line-height: 1.1;margin-bottom: 15px;color: #000;font-weight: 500;font-size: 23px;"> {__ text="Zwrot numer"}: {$number}</h4>
|
||||
|
||||
<p style="font-size: 12px;margin: 0;padding: 0;font-family: Arial, sans-serif;margin-bottom: 10px;font-weight: normal;line-height: 1.6;">{$user_content_head}</p>
|
||||
|
||||
<span style="font-size: 12px;color: #576278;margin: 0;padding: 0;font-family: Arial, sans-serif;">{__ text="Typ zwrotu"}: </span><br style="margin: 0;padding: 0;font-family: Arial, sans-serif;">
|
||||
|
||||
{if $return_form.type == "return"}
|
||||
<span style="font-size: 12px;color: #404040;margin: 0;padding: 0;font-family: Arial, sans-serif;">{__ text="Rezygnacja"}</span><br style="margin: 0;padding: 0;font-family: Arial, sans-serif;">
|
||||
{/if}
|
||||
|
||||
{if $return_form.type == "complaint"}
|
||||
<span style="font-size: 12px;color: #404040;margin: 0;padding: 0;font-family: Arial, sans-serif;">{__ text="Reklamacja"}</span><br style="margin: 0;padding: 0;font-family: Arial, sans-serif;">
|
||||
{/if}
|
||||
|
||||
<br style="margin: 0;padding: 0;font-family: Arial, sans-serif;">
|
||||
|
||||
<span style="font-size: 12px;color: #576278;margin: 0;padding: 0;font-family: Arial, sans-serif;">{__ text="Produkty do zwrotu"}: </span><br style="margin: 0;padding: 0;font-family: Arial, sans-serif;">
|
||||
|
||||
<div style="margin: 0;padding: 0;font-family: Arial, sans-serif;">
|
||||
<table cellpadding="0" cellspacing="0" border="0" width="600" style="margin: 0;padding: 0;font-family: Arial, sans-serif;width: 100%;">
|
||||
|
||||
<tbody style="margin: 0;padding: 0;font-family: Arial, sans-serif;">
|
||||
{foreach key=row item=product from=$results}
|
||||
<tr style="margin: 0;padding: 0;font-family: Arial, sans-serif;">
|
||||
<td style="font-size: 12px;color: #404040;margin: 0;padding: 10px 0px 4px 0px;font-family: Arial, sans-serif; text-align: left;" colspan="2" valign="bottom">
|
||||
{$product.code} <strong style="margin: 0;padding: 0;font-family: Arial, sans-serif;">{$product.name_show}</strong>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="70%" style="font-size: 12px;color: #404040;border-bottom: 1px solid #cccccc;margin: 0;padding: 0 0 5px 0;font-family: Arial, sans-serif;" valign="bottom">{$product.quantity} {$product.uom} x {$product.brutto} ( {$product.netto} x {$product.vat} % )</td>
|
||||
<td width="30%" style="font-size: 12px;color: #404040;border-bottom: 1px solid #cccccc;margin: 0;padding: 0 0 5px 0;font-family: Arial, sans-serif; text-align: right" valign="bottom">
|
||||
{if $product.is_item_by_points} {$product.points_value} {else} {$product.total_amount} {/if}
|
||||
</td>
|
||||
</tr>
|
||||
{/foreach}
|
||||
|
||||
<tr>
|
||||
<td colspan="2" style="font-size: 12px; color: #404040; margin: 0; padding: 0 0 5px 0; font-family: Arial, sans-serif; text-align: right;" valign="bottom">{__ text="Kwota zwrotu"}: <strong>{$total_amount_return}</strong></td>
|
||||
</tr>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<br style="margin: 0;padding: 0;font-family: Arial, sans-serif;">
|
||||
|
||||
<table class="user_data" width="100%" cellpadding="0" cellspacing="0" style="margin: 0;padding: 0;font-family: Arial, sans-serif;width: 100%;">
|
||||
<tr style="margin: 0;padding: 0;font-family: Arial, sans-serif;">
|
||||
<td style="margin: 0;padding: 0;font-family: Arial, sans-serif;">
|
||||
|
||||
<!-- column 1 -->
|
||||
<table align="left" class="column" cellpadding="0" cellspacing="0" style="margin: 0;padding: 0;font-family: Arial, sans-serif;width: 280px;float: left;min-width: 279px;">
|
||||
<tr style="margin: 0;padding: 0;font-family: Arial, sans-serif;">
|
||||
<td style="margin: 0;padding: 0;font-family: Arial, sans-serif;padding-bottom: 15px;">
|
||||
<span style="font-size: 12px;color: #576278;margin: 0;padding: 0;font-family: Arial, sans-serif;">{__ text="Dane zwrotu"}: </span><br style="margin: 0;padding: 0;font-family: Arial, sans-serif;">
|
||||
|
||||
|
||||
{if $return_form.fullname != ""}
|
||||
<span style="font-size: 12px;color: #404040;margin: 0;padding: 0;font-family: Arial, sans-serif;">{$return_form.fullname}</span><br style="margin: 0;padding: 0;font-family: Arial, sans-serif;">
|
||||
{/if}
|
||||
|
||||
{if $return_form.email != ""}
|
||||
<span style="font-size: 12px;color: #404040;margin: 0;padding: 0;font-family: Arial, sans-serif;">{$return_form.email}</span><br style="margin: 0;padding: 0;font-family: Arial, sans-serif;">
|
||||
{/if}
|
||||
|
||||
{if $return_form.phone != ""}
|
||||
<span style="font-size: 12px;color: #404040;margin: 0;padding: 0;font-family: Arial, sans-serif;">{$return_form.phone}</span><br style="margin: 0;padding: 0;font-family: Arial, sans-serif;">
|
||||
{/if}
|
||||
|
||||
{if $return_form.bank_account != ""}
|
||||
<span style="font-size: 12px;color: #404040;margin: 0;padding: 0;font-family: Arial, sans-serif;">{$return_form.bank_account}</span><br style="margin: 0;padding: 0;font-family: Arial, sans-serif;">
|
||||
{/if}
|
||||
|
||||
<span style="font-size: 12px;color: #404040;margin: 0;padding: 0;font-family: Arial, sans-serif;">{$billing_full_phone}</span>
|
||||
</td>
|
||||
</tr>
|
||||
</table><!-- /column 1 -->
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
</table><!-- /social & contact -->
|
||||
|
||||
{if $return_form.description_complaint != ""}
|
||||
<span style="font-size: 12px;color: #576278;margin: 0;padding: 0;font-family: Arial, sans-serif;">{__ text="Opis reklamacji"}: </span><br style="margin: 0;padding: 0;font-family: Arial, sans-serif;">
|
||||
<span style="font-size: 12px;color: #404040;margin: 0;padding: 0;font-family: Arial, sans-serif;">{$return_form.description_complaint}</span><br style="margin: 0;padding: 0;font-family: Arial, sans-serif;">
|
||||
<br style="margin: 0;padding: 0;font-family: Arial, sans-serif;">
|
||||
{/if}
|
||||
|
||||
{if $return_form.description_return != ""}
|
||||
<span style="font-size: 12px;color: #576278;margin: 0;padding: 0;font-family: Arial, sans-serif;">{__ text="Uwagi do zwrotu"}: </span><br style="margin: 0;padding: 0;font-family: Arial, sans-serif;">
|
||||
<span style="font-size: 12px;color: #404040;margin: 0;padding: 0;font-family: Arial, sans-serif;">{$return_form.description_return}</span><br style="margin: 0;padding: 0;font-family: Arial, sans-serif;">
|
||||
<br style="margin: 0;padding: 0;font-family: Arial, sans-serif;">
|
||||
{/if}
|
||||
|
||||
<p style="font-size: 12px;margin: 0;padding: 0;font-family: Arial, sans-serif;margin-bottom: 10px;font-weight: normal;line-height: 1.6;">{$user_content_foot}</p>
|
||||
|
||||
|
||||
<!-- social & contact -->
|
||||
<table class="social" width="100%" style="margin: 0;padding: 0;font-family: Arial, sans-serif;font-size: 12px;background-color: #{$bg_footer_color};width: 100%;">
|
||||
<tr style="margin: 0;padding: 0;font-family: Arial, sans-serif;">
|
||||
<td style="font-size: 12px;margin: 0;padding: 0;font-family: Arial, sans-serif;">
|
||||
{$user_foot}
|
||||
</td>
|
||||
</tr>
|
||||
</table><!-- /social & contact -->
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div><!-- /content -->
|
||||
|
||||
</td>
|
||||
<td style="margin: 0;padding: 0;font-family: Arial, sans-serif;"></td>
|
||||
</tr>
|
||||
</table><!-- /BODY -->
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,547 @@
|
||||
<!-- http://templates.mailchimp.com/resources/inline-css/ -->
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" style="margin: 0;padding: 0;font-family: Arial, sans-serif;">
|
||||
<head style="margin: 0;padding: 0;font-family: Arial, sans-serif;">
|
||||
|
||||
<meta name="viewport" content="width=device-width" style="margin: 0;padding: 0;font-family: Arial, sans-serif;">
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" style="margin: 0;padding: 0;font-family: Arial, sans-serif;">
|
||||
<title style="margin: 0;padding: 0;font-family: Arial, sans-serif;">ZURBemails</title>
|
||||
|
||||
<style style="margin: 0;padding: 0;font-family: Arial, sans-serif;">
|
||||
{literal}
|
||||
/* -------------------------------------
|
||||
GLOBAL
|
||||
------------------------------------- */
|
||||
* {
|
||||
margin:0;
|
||||
padding:0;
|
||||
}
|
||||
* { font-family: Arial, sans-serif; }
|
||||
|
||||
img {
|
||||
max-width: 100%;
|
||||
}
|
||||
.collapse {
|
||||
margin:0;
|
||||
padding:0;
|
||||
}
|
||||
|
||||
body {
|
||||
-webkit-font-smoothing:antialiased;
|
||||
-webkit-text-size-adjust:none;
|
||||
width: 100%!important;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.tinymce_html{
|
||||
font-size:10px;
|
||||
}
|
||||
|
||||
.tinymce_html img,
|
||||
.tinymce_html embed,
|
||||
.tinymce_html video
|
||||
{
|
||||
max-width: 100%;
|
||||
height: auto !important;
|
||||
}
|
||||
|
||||
.image > a > img
|
||||
{
|
||||
max-width: 100% !important;
|
||||
height: auto !important;
|
||||
}
|
||||
|
||||
.tinymce_html object,
|
||||
.tinymce_html iframe
|
||||
{
|
||||
max-width: 100%;
|
||||
}
|
||||
|
||||
.tinymce_html table th,
|
||||
.tinymce_html table td
|
||||
{
|
||||
padding: 5px 10px;
|
||||
}
|
||||
|
||||
.tinymce_html ul
|
||||
{
|
||||
padding-left: 19px;
|
||||
}
|
||||
|
||||
.tinymce_html ul ul,
|
||||
.tinymce_html ol
|
||||
{
|
||||
padding-left: 30px;
|
||||
font-size:12px;
|
||||
}
|
||||
|
||||
.tinymce_html ol
|
||||
{
|
||||
counter-reset: item;
|
||||
}
|
||||
|
||||
.tinymce_html ol > li:before
|
||||
{
|
||||
content: counters(item, ".") ". ";
|
||||
counter-increment: item;
|
||||
position: absolute;
|
||||
margin-left: -19px;
|
||||
}
|
||||
|
||||
.tinymce_html ol[style*="lower"] ol,
|
||||
.tinymce_html ol[style*="upper"] ol
|
||||
{
|
||||
list-style-type: decimal;
|
||||
padding-left: 17px;
|
||||
}
|
||||
|
||||
.tinymce_html ol[style*="lower"] li:before,
|
||||
.tinymce_html ol[style*="upper"] li:before
|
||||
{
|
||||
display: none;
|
||||
}
|
||||
|
||||
.tinymce_html ol ol
|
||||
{
|
||||
padding-left: 27px;
|
||||
}
|
||||
|
||||
.tinymce_html ol ol li:before
|
||||
{
|
||||
margin-left: -27px;
|
||||
}
|
||||
|
||||
.tinymce_html ol ol ol
|
||||
{
|
||||
padding-left: 38px;
|
||||
}
|
||||
|
||||
.tinymce_html ol ol ol li:before
|
||||
{
|
||||
margin-left: -38px;
|
||||
}
|
||||
|
||||
.tinymce_html ol ol ol ol
|
||||
{
|
||||
padding-left: 48px;
|
||||
}
|
||||
|
||||
.tinymce_html ol ol ol ol li:before
|
||||
{
|
||||
margin-left: -48px;
|
||||
}
|
||||
|
||||
.tinymce_html a
|
||||
{
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
.tinymce_html h1
|
||||
{
|
||||
margin-top:15px;
|
||||
font-size: 20px;
|
||||
}
|
||||
|
||||
.tinymce_html h2
|
||||
{
|
||||
margin-top:15px;
|
||||
font-size: 18px;
|
||||
}
|
||||
|
||||
.tinymce_html h3
|
||||
{
|
||||
margin-top:15px;
|
||||
font-size: 16px;
|
||||
font-weight: 300;
|
||||
}
|
||||
|
||||
.tinymce_html h4
|
||||
{
|
||||
margin-top:15px;
|
||||
font-size: 15px;
|
||||
font-weight: 300;
|
||||
}
|
||||
|
||||
.tinymce_html h5
|
||||
{
|
||||
margin-top:15px;
|
||||
font-size: 14px;
|
||||
font-weight: 300;
|
||||
}
|
||||
|
||||
.tinymce_html h6
|
||||
{
|
||||
margin-top:15px;
|
||||
font-size: 14px;
|
||||
font-weight: 300;
|
||||
}
|
||||
|
||||
/* -------------------------------------
|
||||
ELEMENTS
|
||||
------------------------------------- */
|
||||
a { color: #{/literal}{$link_color}{literal};}
|
||||
|
||||
.btn {
|
||||
text-decoration:none;
|
||||
color: #FFF;
|
||||
background-color: #666;
|
||||
padding:10px 16px;
|
||||
font-weight:bold;
|
||||
margin-right:10px;
|
||||
text-align:center;
|
||||
cursor:pointer;
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
p.callout {
|
||||
padding:15px;
|
||||
background-color:#ECF8FF;
|
||||
margin-bottom: 15px;
|
||||
}
|
||||
.callout a {
|
||||
font-weight:bold;
|
||||
color: #2BA6CB;
|
||||
}
|
||||
|
||||
table.social {
|
||||
|
||||
background-color: #ebebeb;
|
||||
|
||||
}
|
||||
.social .soc-btn {
|
||||
padding: 3px 7px;
|
||||
font-size:12px;
|
||||
margin-bottom:10px;
|
||||
text-decoration:none;
|
||||
color: #FFF;font-weight:bold;
|
||||
display:block;
|
||||
text-align:center;
|
||||
}
|
||||
a.fb { background-color: #3B5998!important; }
|
||||
a.tw { background-color: #1daced!important; }
|
||||
a.gp { background-color: #DB4A39!important; }
|
||||
a.ms { background-color: #000!important; }
|
||||
|
||||
.sidebar .soc-btn {
|
||||
display:block;
|
||||
width:100%;
|
||||
}
|
||||
|
||||
/* -------------------------------------
|
||||
HEADER
|
||||
------------------------------------- */
|
||||
table.head-wrap { width: 100%;}
|
||||
|
||||
.header.container table td.logo { padding: 15px; }
|
||||
.header.container table td.label { padding: 15px; padding-left:0px;}
|
||||
|
||||
|
||||
/* -------------------------------------
|
||||
BODY
|
||||
------------------------------------- */
|
||||
table.body-wrap { width: 100%;}
|
||||
|
||||
|
||||
/* -------------------------------------
|
||||
FOOTER
|
||||
------------------------------------- */
|
||||
table.footer-wrap { width: 100%; clear:both!important;
|
||||
}
|
||||
.footer-wrap .container td.content p { border-top: 1px solid rgb(215,215,215); padding-top:15px;}
|
||||
.footer-wrap .container td.content p {
|
||||
font-size:10px;
|
||||
font-weight: bold;
|
||||
|
||||
}
|
||||
|
||||
|
||||
/* -------------------------------------
|
||||
TYPOGRAPHY
|
||||
------------------------------------- */
|
||||
h1,h2,h3,h4,h5,h6 {
|
||||
font-family: Arial, sans-serif; line-height: 1.1; margin-bottom:15px; color:#000;
|
||||
}
|
||||
h1 small, h2 small, h3 small, h4 small, h5 small, h6 small { font-size: 60%; color: #6f6f6f; line-height: 0; text-transform: none; }
|
||||
|
||||
h1 { font-weight:200; font-size: 44px;}
|
||||
h2 { font-weight:200; font-size: 37px;}
|
||||
h3 { font-weight:500; font-size: 27px;}
|
||||
h4 { font-weight:500; font-size: 23px;}
|
||||
h5 { font-weight:900; font-size: 17px;}
|
||||
h6 { font-weight:900; font-size: 14px; text-transform: uppercase; color:#444;}
|
||||
|
||||
.collapse { margin:0!important;}
|
||||
|
||||
p, ul {
|
||||
margin-bottom: 10px;
|
||||
font-weight: normal;
|
||||
font-size:12px;
|
||||
line-height:1.6;
|
||||
}
|
||||
p.lead { font-size:17px; }
|
||||
p.last { margin-bottom:0px;}
|
||||
|
||||
ul li {
|
||||
margin-left:5px;
|
||||
list-style-position: inside;
|
||||
}
|
||||
|
||||
/* -------------------------------------
|
||||
SIDEBAR
|
||||
------------------------------------- */
|
||||
ul.sidebar {
|
||||
background:#ebebeb;
|
||||
display:block;
|
||||
list-style-type: none;
|
||||
}
|
||||
ul.sidebar li { display: block; margin:0;}
|
||||
ul.sidebar li a {
|
||||
text-decoration:none;
|
||||
color: #666;
|
||||
padding:10px 16px;
|
||||
/* font-weight:bold; */
|
||||
margin-right:10px;
|
||||
/* text-align:center; */
|
||||
cursor:pointer;
|
||||
border-bottom: 1px solid #777777;
|
||||
border-top: 1px solid #FFFFFF;
|
||||
display:block;
|
||||
margin:0;
|
||||
}
|
||||
ul.sidebar li a.last { border-bottom-width:0px;}
|
||||
ul.sidebar li a h1,ul.sidebar li a h2,ul.sidebar li a h3,ul.sidebar li a h4,ul.sidebar li a h5,ul.sidebar li a h6,ul.sidebar li a p { margin-bottom:0!important;}
|
||||
|
||||
|
||||
|
||||
/* ---------------------------------------------------
|
||||
RESPONSIVENESS
|
||||
Nuke it from orbit. It's the only way to be sure.
|
||||
------------------------------------------------------ */
|
||||
|
||||
/* Set a max-width, and make it display as block so it will automatically stretch to that width, but will also shrink down on a phone or something */
|
||||
.container {
|
||||
display:block!important;
|
||||
max-width:600px!important;
|
||||
margin:0 auto!important; /* makes it centered */
|
||||
clear:both!important;
|
||||
}
|
||||
|
||||
/* This should also be a block element, so that it will fill 100% of the .container */
|
||||
.content {
|
||||
padding:15px;
|
||||
max-width:600px;
|
||||
margin:0 auto;
|
||||
display:block;
|
||||
}
|
||||
|
||||
/* Let's make sure tables in the content area are 100% wide */
|
||||
.content table { width: 100%; }
|
||||
|
||||
|
||||
/* Odds and ends */
|
||||
.column {
|
||||
width: 300px;
|
||||
float:left;
|
||||
}
|
||||
.social .column tr td { padding: 15px; }
|
||||
|
||||
.user_data .column tr td { padding-bottom: 15px; }
|
||||
|
||||
.column-wrap {
|
||||
padding:0!important;
|
||||
margin:0 auto;
|
||||
max-width:600px!important;
|
||||
}
|
||||
.column table { width:100%;}
|
||||
|
||||
.social .column {
|
||||
width: 280px;
|
||||
min-width: 279px;
|
||||
float:left;
|
||||
}
|
||||
|
||||
.user_data .column {
|
||||
width: 280px;
|
||||
min-width: 279px;
|
||||
float:left;
|
||||
}
|
||||
|
||||
/* Be sure to place a .clear element after each set of columns, just to be safe */
|
||||
.clear { display: block; clear: both; }
|
||||
|
||||
|
||||
/* -------------------------------------------
|
||||
PHONE
|
||||
For clients that support media queries.
|
||||
Nothing fancy.
|
||||
-------------------------------------------- */
|
||||
@media only screen and (max-width: 600px) {
|
||||
|
||||
a[class="btn"] { display:block!important; margin-bottom:10px!important; background-image:none!important; margin-right:0!important;}
|
||||
|
||||
div[class="column"] { width: auto!important; float:none!important;}
|
||||
|
||||
table.social div[class="column"] {
|
||||
width:auto!important;
|
||||
}
|
||||
|
||||
}
|
||||
{/literal}
|
||||
</style>
|
||||
|
||||
</head>
|
||||
|
||||
<body bgcolor="#FFFFFF" style="margin: 0;padding: 0;font-family: Arial, sans-serif;font-size: 12px;-webkit-font-smoothing: antialiased;-webkit-text-size-adjust: none;height: 100%;width: 100%!important;">
|
||||
|
||||
<!-- HEADER -->
|
||||
<table class="head-wrap" bgcolor="#{$bg_header_color}" style="margin: 0;padding: 0;font-family: Arial, sans-serif;font-size: 12px;width: 100%;">
|
||||
<tr style="margin: 0;padding: 0;font-family: Arial, sans-serif;font-size: 12px;">
|
||||
<td style="margin: 0;padding: 0;font-family: Arial, sans-serif;font-size: 12px;"></td>
|
||||
<td class="header container" style="margin: 0 auto!important;padding: 0;font-family: Arial, sans-serif;font-size: 12px;display: block!important;max-width: 600px!important;clear: both!important;">
|
||||
|
||||
<div class="content" style="margin: 0 auto;padding: 15px;font-family: Arial, sans-serif;font-size: 12px;max-width: 600px;display: block;">
|
||||
<table bgcolor="#{$bg_header_color}" style="margin: 0;padding: 0;font-family: Arial, sans-serif;font-size: 12px;width: 100%;">
|
||||
<tr style="margin: 0;padding: 0;font-family: Arial, sans-serif;font-size: 12px;">
|
||||
<td style="margin: 0;padding: 0;font-family: Arial, sans-serif;font-size: 12px;">{if $logo!=""}<img src="http://{$host}/uploads{$logo}?version=1" style="margin: 0;padding: 0;font-family: Arial, sans-serif;font-size: 12px;max-width: 100%; max-height: 50px;">{/if}</td>
|
||||
<td align="right" style="margin: 0;padding: 0;font-family: Arial, sans-serif;"><h6 class="collapse" style="margin: 0!important;padding: 0;font-family: "helveticaneue-light": ;, ": ;helvetica neue light": ;helvetica neue": ;, helvetica, arial, ": ;lucida grande": ;, sans-serif: ;line-height: 1.1;margin-bottom: 15px;color: #444;font-weight: 900;font-size: 14px;text-transform: uppercase;">{$created_at}</h6></td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
</td>
|
||||
<td style="margin: 0;padding: 0;font-family: Arial, sans-serif;"></td>
|
||||
</tr>
|
||||
</table><!-- /HEADER -->
|
||||
|
||||
|
||||
<!-- BODY -->
|
||||
<table class="body-wrap" cellpadding="0" cellspacing="0" style="margin: 0;padding: 0;font-family: Arial, sans-serif;width: 100%;">
|
||||
<tr style="margin: 0;padding: 0;font-family: Arial, sans-serif;">
|
||||
<td style="margin: 0;padding: 0;font-family: Arial, sans-serif;"></td>
|
||||
<td class="container" bgcolor="#FFFFFF" style="margin: 0 auto!important;padding: 0;font-family: Arial, sans-serif;display: block!important;max-width: 600px!important;clear: both!important;">
|
||||
|
||||
<div class="content" style="margin: 0 auto;padding: 15px;font-family: Arial, sans-serif;max-width: 600px;display: block;">
|
||||
<table cellpadding="0" cellspacing="0" style="margin: 0;padding: 0;font-family: Arial, sans-serif;width: 100%;">
|
||||
<tr style="margin: 0;padding: 0;font-family: Arial, sans-serif;">
|
||||
<td style="margin: 0;padding: 0;font-family: Arial, sans-serif;">
|
||||
<p style="font-size: 12px;margin: 0;padding: 0;font-family: Arial, sans-serif;margin-bottom: 10px;font-weight: normal;line-height: 1.6;">{$user_head}</p>
|
||||
|
||||
<h4 style="margin: 0;padding: 0;font-family: "helveticaneue-light": ;, ": ;helvetica neue light": ;helvetica neue": ;, helvetica, arial, ": ;lucida grande": ;, sans-serif: ;line-height: 1.1;margin-bottom: 15px;color: #000;font-weight: 500;font-size: 23px;"> {__ text="Zwrot numer"}: {$number}</h4>
|
||||
|
||||
<p style="font-size: 12px;margin: 0;padding: 0;font-family: Arial, sans-serif;margin-bottom: 10px;font-weight: normal;line-height: 1.6;">{$user_content_head}</p>
|
||||
|
||||
<span style="font-size: 12px;color: #576278;margin: 0;padding: 0;font-family: Arial, sans-serif;">{__ text="Typ zwrotu"}: </span><br style="margin: 0;padding: 0;font-family: Arial, sans-serif;">
|
||||
|
||||
{if $return_form.type == "return"}
|
||||
<span style="font-size: 12px;color: #404040;margin: 0;padding: 0;font-family: Arial, sans-serif;">{__ text="Rezygnacja"}</span><br style="margin: 0;padding: 0;font-family: Arial, sans-serif;">
|
||||
{/if}
|
||||
|
||||
{if $return_form.type == "complaint"}
|
||||
<span style="font-size: 12px;color: #404040;margin: 0;padding: 0;font-family: Arial, sans-serif;">{__ text="Reklamacja"}</span><br style="margin: 0;padding: 0;font-family: Arial, sans-serif;">
|
||||
{/if}
|
||||
|
||||
<br style="margin: 0;padding: 0;font-family: Arial, sans-serif;">
|
||||
|
||||
<span style="font-size: 12px;color: #576278;margin: 0;padding: 0;font-family: Arial, sans-serif;">{__ text="Produkty do zwrotu"}: </span><br style="margin: 0;padding: 0;font-family: Arial, sans-serif;">
|
||||
|
||||
<div style="margin: 0;padding: 0;font-family: Arial, sans-serif;">
|
||||
<table cellpadding="0" cellspacing="0" border="0" width="600" style="margin: 0;padding: 0;font-family: Arial, sans-serif;width: 100%;">
|
||||
|
||||
<tbody style="margin: 0;padding: 0;font-family: Arial, sans-serif;">
|
||||
{foreach key=row item=product from=$results}
|
||||
<tr style="margin: 0;padding: 0;font-family: Arial, sans-serif;">
|
||||
<td style="font-size: 12px;color: #404040;margin: 0;padding: 10px 0px 4px 0px;font-family: Arial, sans-serif; text-align: left;" colspan="2" valign="bottom">
|
||||
{$product.code} <strong style="margin: 0;padding: 0;font-family: Arial, sans-serif;">{$product.name_show}</strong>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="70%" style="font-size: 12px;color: #404040;border-bottom: 1px solid #cccccc;margin: 0;padding: 0 0 5px 0;font-family: Arial, sans-serif;" valign="bottom">{$product.quantity} {$product.uom} x {$product.brutto} ( {$product.netto} x {$product.vat} % )</td>
|
||||
<td width="30%" style="font-size: 12px;color: #404040;border-bottom: 1px solid #cccccc;margin: 0;padding: 0 0 5px 0;font-family: Arial, sans-serif; text-align: right" valign="bottom">
|
||||
{if $product.is_item_by_points} {$product.points_value} {else} {$product.total_amount} {/if}
|
||||
</td>
|
||||
</tr>
|
||||
{/foreach}
|
||||
|
||||
<tr>
|
||||
<td colspan="2" style="font-size: 12px; color: #404040; margin: 0; padding: 0 0 5px 0; font-family: Arial, sans-serif; text-align: right;" valign="bottom">{__ text="Kwota zwrotu"}: <strong>{$total_amount_return}</strong></td>
|
||||
</tr>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<br style="margin: 0;padding: 0;font-family: Arial, sans-serif;">
|
||||
|
||||
<table class="user_data" width="100%" cellpadding="0" cellspacing="0" style="margin: 0;padding: 0;font-family: Arial, sans-serif;width: 100%;">
|
||||
<tr style="margin: 0;padding: 0;font-family: Arial, sans-serif;">
|
||||
<td style="margin: 0;padding: 0;font-family: Arial, sans-serif;">
|
||||
|
||||
<!-- column 1 -->
|
||||
<table align="left" class="column" cellpadding="0" cellspacing="0" style="margin: 0;padding: 0;font-family: Arial, sans-serif;width: 280px;float: left;min-width: 279px;">
|
||||
<tr style="margin: 0;padding: 0;font-family: Arial, sans-serif;">
|
||||
<td style="margin: 0;padding: 0;font-family: Arial, sans-serif;padding-bottom: 15px;">
|
||||
<span style="font-size: 12px;color: #576278;margin: 0;padding: 0;font-family: Arial, sans-serif;">{__ text="Dane zwrotu"}: </span><br style="margin: 0;padding: 0;font-family: Arial, sans-serif;">
|
||||
|
||||
|
||||
{if $return_form.fullname != ""}
|
||||
<span style="font-size: 12px;color: #404040;margin: 0;padding: 0;font-family: Arial, sans-serif;">{$return_form.fullname}</span><br style="margin: 0;padding: 0;font-family: Arial, sans-serif;">
|
||||
{/if}
|
||||
|
||||
{if $return_form.email != ""}
|
||||
<span style="font-size: 12px;color: #404040;margin: 0;padding: 0;font-family: Arial, sans-serif;">{$return_form.email}</span><br style="margin: 0;padding: 0;font-family: Arial, sans-serif;">
|
||||
{/if}
|
||||
|
||||
{if $return_form.phone != ""}
|
||||
<span style="font-size: 12px;color: #404040;margin: 0;padding: 0;font-family: Arial, sans-serif;">{$return_form.phone}</span><br style="margin: 0;padding: 0;font-family: Arial, sans-serif;">
|
||||
{/if}
|
||||
|
||||
{if $return_form.bank_account != ""}
|
||||
<span style="font-size: 12px;color: #404040;margin: 0;padding: 0;font-family: Arial, sans-serif;">{$return_form.bank_account}</span><br style="margin: 0;padding: 0;font-family: Arial, sans-serif;">
|
||||
{/if}
|
||||
|
||||
<span style="font-size: 12px;color: #404040;margin: 0;padding: 0;font-family: Arial, sans-serif;">{$billing_full_phone}</span>
|
||||
</td>
|
||||
</tr>
|
||||
</table><!-- /column 1 -->
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
</table><!-- /social & contact -->
|
||||
|
||||
{if $return_form.description_complaint != ""}
|
||||
<span style="font-size: 12px;color: #576278;margin: 0;padding: 0;font-family: Arial, sans-serif;">{__ text="Opis reklamacji"}: </span><br style="margin: 0;padding: 0;font-family: Arial, sans-serif;">
|
||||
<span style="font-size: 12px;color: #404040;margin: 0;padding: 0;font-family: Arial, sans-serif;">{$return_form.description_complaint}</span><br style="margin: 0;padding: 0;font-family: Arial, sans-serif;">
|
||||
<br style="margin: 0;padding: 0;font-family: Arial, sans-serif;">
|
||||
{/if}
|
||||
|
||||
{if $return_form.description_return != ""}
|
||||
<span style="font-size: 12px;color: #576278;margin: 0;padding: 0;font-family: Arial, sans-serif;">{__ text="Uwagi do zwrotu"}: </span><br style="margin: 0;padding: 0;font-family: Arial, sans-serif;">
|
||||
<span style="font-size: 12px;color: #404040;margin: 0;padding: 0;font-family: Arial, sans-serif;">{$return_form.description_return}</span><br style="margin: 0;padding: 0;font-family: Arial, sans-serif;">
|
||||
<br style="margin: 0;padding: 0;font-family: Arial, sans-serif;">
|
||||
{/if}
|
||||
|
||||
<p style="font-size: 12px;margin: 0;padding: 0;font-family: Arial, sans-serif;margin-bottom: 10px;font-weight: normal;line-height: 1.6;">{$user_content_foot}</p>
|
||||
|
||||
|
||||
<!-- social & contact -->
|
||||
<table class="social" width="100%" style="margin: 0;padding: 0;font-family: Arial, sans-serif;font-size: 12px;background-color: #{$bg_footer_color};width: 100%;">
|
||||
<tr style="margin: 0;padding: 0;font-family: Arial, sans-serif;">
|
||||
<td style="font-size: 12px;margin: 0;padding: 0;font-family: Arial, sans-serif;">
|
||||
{$user_foot}
|
||||
</td>
|
||||
</tr>
|
||||
</table><!-- /social & contact -->
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div><!-- /content -->
|
||||
|
||||
</td>
|
||||
<td style="margin: 0;padding: 0;font-family: Arial, sans-serif;"></td>
|
||||
</tr>
|
||||
</table><!-- /BODY -->
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,156 @@
|
||||
{set layout="one_column"}
|
||||
<div class="user-control">
|
||||
{st_get_component module="stUserData" component="responsiveUserPanelMenu" active_tab="2"}
|
||||
<div id="order-show">
|
||||
|
||||
<h3>{__ text="Zwrot numer"} {$return_form.return_id}</h3>
|
||||
|
||||
<div style="border-top: 2px solid #ddd;"></div>
|
||||
|
||||
|
||||
<div class="row">
|
||||
<div class="col-sm-4 col-lg-4">
|
||||
<h4>{__ text="Status zwrotu"}</h4>
|
||||
|
||||
{if $return_form.status == "stats1"}
|
||||
{__ text="Oczekujemy na przesyłkę"}
|
||||
{/if}
|
||||
|
||||
{if $return_form.status == "stats2"}
|
||||
{__ text="Trwa rozpatrzenie zwrotu"}
|
||||
{/if}
|
||||
|
||||
{if $return_form.status == "stats3"}
|
||||
{__ text="Zwrócono środki na konto"}
|
||||
{/if}
|
||||
|
||||
{if $return_form.status == "stats4"}
|
||||
{__ text="Odrzucono zwrot"}
|
||||
{/if}
|
||||
</div>
|
||||
|
||||
<div class="col-sm-4 col-lg-4">
|
||||
<h4>{__ text="Typ zwrotu"}</h4>
|
||||
|
||||
{if $return_form.type == "return"}
|
||||
{__ text="Rezygnacja"}
|
||||
{/if}
|
||||
|
||||
{if $return_form.type == "complaint"}
|
||||
{__ text="Reklamacja"}
|
||||
{/if}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<br>
|
||||
|
||||
<div class="row">
|
||||
|
||||
<div class="col-sm-12 col-lg-12">
|
||||
|
||||
<h4>{__ text="Wybrane produkty do zwrotu"}</h4>
|
||||
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
|
||||
{if $show_code_in_basket}<th>{__ text="kod"}</th>{/if}
|
||||
<th>{__ text="nazwa"}</th>
|
||||
{if $show_netto_in_basket}<th class="th-td-right">{__ text="netto"}</th>{/if}
|
||||
{if $show_tax_in_basket}<th class="th-td-center">{__ text="vat"}</th>{/if}
|
||||
<th class="th-td-right">{__ text="cena jed. brutto"}</th>
|
||||
<th class="th-td-center">{__ text="ilość"}</th>
|
||||
{if $show_uom_in_basket}<th class="th-td-center">{__ text="j.m."}</th>{/if}
|
||||
<th class="th-td-right">{__ text="suma"}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{foreach key=row item=order_product from=$results}
|
||||
<tr id="row-{$order_product.code}">
|
||||
{if $show_code_in_basket}<td data-th='{__ text="kod"}' class="mobile">{$order_product.code}</td>{/if}
|
||||
<td data-th='{__ text="nazwa"}' class="product-name">{if isset($order_product.product_name)}{$order_product.product_name}{else}{if isset($order_product.validate)}{$order_product.name_show}{else}{$order_product.name}{/if}{/if}</td>
|
||||
{if $show_netto_in_basket}<td data-th='{__ text="netto"}' class="th-td-right mobile" nowrap>{$order_product.price}</td>{/if}
|
||||
{if $show_tax_in_basket}<td data-th='{__ text="vat"}' class="th-td-center mobile" nowrap>{$order_product.vat} %</td>{/if}
|
||||
<td nowrap data-th='{__ text="brutto"}' class="th-td-right mobile">{$order_product.price_true}</td>
|
||||
<td data-th='{__ text="ilość"}' class="th-td-center mobile">{$order_product.quantity}</td>
|
||||
{if $show_uom_in_basket}<td data-th='{__ text="j.m."}' class="th-td-center mobile">{$order_product.uom}</td>{/if}
|
||||
<td data-th='{__ text="suma"}' class="th-td-right">{$order_product.total_amount}</td>
|
||||
</tr>
|
||||
|
||||
{/foreach}
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
{if $return_form.type == "return"}
|
||||
<table class="table">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td class="th-td-right">{__ text="Całkowita kwota zwrotu"}: <b>{$total_amount_return}</b></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
{/if}
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<br>
|
||||
|
||||
<div class="row">
|
||||
|
||||
<div class="col-sm-4 col-lg-4">
|
||||
|
||||
<h4>{__ text="Dane zwrotu"}</h4>
|
||||
|
||||
{$return_form.fullname}<br>
|
||||
{$return_form.email}<br>
|
||||
{$return_form.phone}<br>
|
||||
|
||||
{if $return_form.bank_account != "" && $return_form.type == "return"}
|
||||
{$return_form.bank_account}<br>
|
||||
{/if}
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
{if $return_form.description_complaint != ""}
|
||||
<div class="col-sm-4 col-lg-4">
|
||||
|
||||
<h4>{__ text="Opis reklamacji"}</h4>
|
||||
{$return_form.description_complaint}<br>
|
||||
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
|
||||
{if $return_form.description_return != ""}
|
||||
<div class="col-sm-4 col-lg-4">
|
||||
|
||||
<h4>{__ text="Uwagi do zwrotu"}</h4>
|
||||
{$return_form.description_return}<br>
|
||||
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<br>
|
||||
|
||||
<a class="download btn btn-default pull-right" href="{$pdf_link}" target="_blank" rel="noindex, nofollow">
|
||||
<span class="glyphicon glyphicon-file"></span>
|
||||
{__ text="Pobierz PDF"}
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
@@ -0,0 +1,152 @@
|
||||
<div class="products-returns" style="margin-top: 60px; margin-bottom: 100px;">
|
||||
|
||||
<h3>{__ text="Zwrot numer"} {$return_form.return_id}</h3>
|
||||
|
||||
<div style="border-top: 2px solid #ddd;"></div>
|
||||
|
||||
|
||||
<div class="row">
|
||||
<div class="col-sm-4 col-lg-4">
|
||||
<h4>{__ text="Status zwrotu"}</h4>
|
||||
|
||||
{if $return_form.status == "stats1"}
|
||||
{__ text="Oczekujemy na przesyłkę"}
|
||||
{/if}
|
||||
|
||||
{if $return_form.status == "stats2"}
|
||||
{__ text="Trwa rozpatrzenie zwrotu"}
|
||||
{/if}
|
||||
|
||||
{if $return_form.status == "stats3"}
|
||||
{__ text="Zwrócono środki na konto"}
|
||||
{/if}
|
||||
|
||||
{if $return_form.status == "stats4"}
|
||||
{__ text="Odrzucono zwrot"}
|
||||
{/if}
|
||||
</div>
|
||||
|
||||
<div class="col-sm-4 col-lg-4">
|
||||
<h4>{__ text="Typ zwrotu"}</h4>
|
||||
|
||||
{if $return_form.type == "return"}
|
||||
{__ text="Rezygnacja"}
|
||||
{/if}
|
||||
|
||||
{if $return_form.type == "complaint"}
|
||||
{__ text="Reklamacja"}
|
||||
{/if}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<br>
|
||||
|
||||
<div class="row">
|
||||
|
||||
<div class="col-sm-12 col-lg-12">
|
||||
|
||||
<h4>{__ text="Wybrane produkty do zwrotu"}</h4>
|
||||
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
|
||||
{if $show_code_in_basket}<th>{__ text="kod"}</th>{/if}
|
||||
<th>{__ text="nazwa"}</th>
|
||||
{if $show_netto_in_basket}<th class="th-td-right">{__ text="netto"}</th>{/if}
|
||||
{if $show_tax_in_basket}<th class="th-td-center">{__ text="vat"}</th>{/if}
|
||||
<th class="th-td-right">{__ text="cena jed. brutto"}</th>
|
||||
<th class="th-td-center">{__ text="ilość"}</th>
|
||||
{if $show_uom_in_basket}<th class="th-td-center">{__ text="j.m."}</th>{/if}
|
||||
<th class="th-td-right">{__ text="suma"}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{foreach key=row item=order_product from=$results}
|
||||
<tr id="row-{$order_product.code}">
|
||||
{if $show_code_in_basket}<td data-th='{__ text="kod"}' class="mobile">{$order_product.code}</td>{/if}
|
||||
<td data-th='{__ text="nazwa"}' class="product-name">{if isset($order_product.product_name)}{$order_product.product_name}{else}{if isset($order_product.validate)}{$order_product.name_show}{else}{$order_product.name}{/if}{/if}</td>
|
||||
{if $show_netto_in_basket}<td data-th='{__ text="netto"}' class="th-td-right mobile" nowrap>{$order_product.price}</td>{/if}
|
||||
{if $show_tax_in_basket}<td data-th='{__ text="vat"}' class="th-td-center mobile" nowrap>{$order_product.vat} %</td>{/if}
|
||||
<td nowrap data-th='{__ text="brutto"}' class="th-td-right mobile">{$order_product.price_true}</td>
|
||||
<td data-th='{__ text="ilość"}' class="th-td-center mobile">{$order_product.quantity}</td>
|
||||
{if $show_uom_in_basket}<td data-th='{__ text="j.m."}' class="th-td-center mobile">{$order_product.uom}</td>{/if}
|
||||
<td data-th='{__ text="suma"}' class="th-td-right">{$order_product.total_amount}</td>
|
||||
</tr>
|
||||
|
||||
{/foreach}
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
{if $return_form.type == "return"}
|
||||
|
||||
<table class="table">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td class="th-td-right">{__ text="Całkowita kwota zwrotu"}: <b>{$total_amount_return}</b></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
{/if}
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
|
||||
<div class="col-sm-4 col-lg-4">
|
||||
|
||||
<h4>{__ text="Dane zwrotu"}</h4>
|
||||
|
||||
{$return_form.fullname}<br>
|
||||
{$return_form.email}<br>
|
||||
{$return_form.phone}<br>
|
||||
|
||||
{if $return_form.bank_account != "" && $return_form.type == "return"}
|
||||
{$return_form.bank_account}<br>
|
||||
{/if}
|
||||
|
||||
</div>
|
||||
|
||||
{if $return_form.description_complaint != ""}
|
||||
<div class="col-sm-4 col-lg-4">
|
||||
|
||||
<h4>{__ text="Opis reklamacji"}</h4>
|
||||
{$return_form.description_complaint}<br>
|
||||
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
|
||||
{if $return_form.description_return != ""}
|
||||
<div class="col-sm-4 col-lg-4">
|
||||
|
||||
<h4>{__ text="Uwagi do zwrotu"}</h4>
|
||||
{$return_form.description_return}<br>
|
||||
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<br>
|
||||
|
||||
{if $show_back != ""}
|
||||
<a class="btn btn-default pull-left" href="{$return_link}" rel="noindex, nofollow">
|
||||
{__ text="Wróć do zamówienia"}
|
||||
</a>
|
||||
{/if}
|
||||
|
||||
<a class="download btn btn-default pull-right" href="{$pdf_link}" target="_blank" rel="noindex, nofollow">
|
||||
<span class="glyphicon glyphicon-file"></span>
|
||||
{__ text="Pobierz PDF"}
|
||||
</a>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
{set layout="one_column"}
|
||||
<div class="user-control">
|
||||
{st_get_component module="stUserData" component="responsiveUserPanelMenu" active_tab="2"}
|
||||
<div id="order-show">
|
||||
|
||||
|
||||
|
||||
{if $return_form_type == "return"}
|
||||
<h3>{__ text="Potwierdzenie rezygnacji"}</h3>
|
||||
{/if}
|
||||
|
||||
{if $return_form_type == "complaint"}
|
||||
<h3>{__ text="Potwierdzenie reklamacji"}</h3>
|
||||
{/if}
|
||||
|
||||
|
||||
{$text_summary}
|
||||
|
||||
|
||||
|
||||
{st_get_component module="stProductReturnsFrontend" component="show" return_id=$return_id show_back=true}
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
@@ -0,0 +1,67 @@
|
||||
<?php
|
||||
/**
|
||||
* SOTESHOP/stInvoicePlugin
|
||||
*
|
||||
* Ten plik należy do aplikacji stInvoicePlugin opartej na licencji (Professional License SOTE).
|
||||
* Nie zmieniaj tego pliku, jeśli chcesz korzystać z automatycznych aktualizacji oprogramowania.
|
||||
* Jeśli chcesz wprowadzać swoje modyfikacje do programu, zapoznaj się z dokumentacją, jak zmieniać
|
||||
* oprogramowanie bez zmiany kodu bazowego http://www.sote.pl/modifications
|
||||
*
|
||||
* @package stInvoicePlugin
|
||||
* @subpackage actions
|
||||
* @copyright SOTE (www.sote.pl)
|
||||
* @license http://www.sote.pl/license/sote (Professional License SOTE)
|
||||
* @version $Id: actions.class.php 665 2009-04-16 07:43:27Z michal $
|
||||
* @author Bartosz Alejski <bartosz.alejski@sote.pl>
|
||||
*/
|
||||
|
||||
/**
|
||||
* Klasa stInvoiceFrontendActions.
|
||||
*
|
||||
* @package stInvoicePlugin
|
||||
* @subpackage actions
|
||||
*/
|
||||
class stProductReturnsPdfActions extends stActions
|
||||
{
|
||||
|
||||
//soteshop1/frontend_dev.php/productReturnsPdf/show?id=128&hash_code=450e8ec6de3f0c4a5868bb1bf2e261ff
|
||||
|
||||
public function executeShow() {
|
||||
|
||||
sfLoader::loadHelpers('Helper');
|
||||
sfLoader::loadHelpers('Partial');
|
||||
sfLoader::loadHelpers('stPartial');
|
||||
|
||||
$product_returns_id = $this->getRequestParameter('id',null);
|
||||
$download = $this->getRequestParameter('download',false);
|
||||
$hash_code = $this->getRequestParameter('hash_code',false);
|
||||
$culture = $this->getRequestParameter('culture',null);
|
||||
|
||||
$pdf = new stProductReturnsPdf($product_returns_id);
|
||||
$pdf->forceDownload($download);
|
||||
$productReturns = $pdf->getProductReturns();
|
||||
|
||||
/*echo $productReturns->getOrder()->getHashCode();
|
||||
die();*/
|
||||
|
||||
if (SF_APP == 'frontend' && $productReturns->getOrder()->getHashCode() != $hash_code)
|
||||
{
|
||||
return $this->forward404();
|
||||
}
|
||||
|
||||
if(!$culture){
|
||||
$culture = $productReturns->getOrder()->getclientCulture();
|
||||
}
|
||||
|
||||
$filename = 'product_returns_'.$productReturns->getId().'.pdf';
|
||||
|
||||
$response = $this->getResponse();
|
||||
$response->clearHttpHeaders();
|
||||
$response->setHttpHeader('Content-Type', 'application/pdf');
|
||||
$response->setHttpHeader('Content-Disposition', 'attachment;filename="'.$filename);
|
||||
$response->setHttpHeader('X-Robots-Tag', 'noindex');
|
||||
|
||||
return $this->renderText($pdf->renderProductReturns($culture,$hash_code));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
<?php
|
||||
/**
|
||||
* SOTESHOP/stInvoicePlugin
|
||||
*
|
||||
* Ten plik należy do aplikacji stInvoicePlugin opartej na licencji (Professional License SOTE).
|
||||
* Nie zmieniaj tego pliku, jeśli chcesz korzystać z automatycznych aktualizacji oprogramowania.
|
||||
* Jeśli chcesz wprowadzać swoje modyfikacje do programu, zapoznaj się z dokumentacją, jak zmieniać
|
||||
* oprogramowanie bez zmiany kodu bazowego http://www.sote.pl/modifications
|
||||
*
|
||||
* @package stInvoicePlugin
|
||||
* @subpackage actions
|
||||
* @copyright SOTE (www.sote.pl)
|
||||
* @license http://www.sote.pl/license/sote (Professional License SOTE)
|
||||
* @version $Id: components.class.php 2285 2009-07-23 12:50:05Z bartek $
|
||||
* @author Bartosz Alejski <bartosz.alejski@sote.pl>
|
||||
*/
|
||||
|
||||
/**
|
||||
* Komponent stInvoiceFrontendComponents
|
||||
*
|
||||
* @package stInvoicePlugin
|
||||
* @subpackage actions
|
||||
*/
|
||||
class stProductReturnsPdfComponents extends sfComponents
|
||||
{
|
||||
|
||||
public function executeReturnsNumber()
|
||||
{
|
||||
$this->config = stConfig::getInstance('stInvoiceBackend');
|
||||
}
|
||||
|
||||
public function executeReturnsItems()
|
||||
{
|
||||
$this->config = stConfig::getInstance('stInvoiceBackend');
|
||||
}
|
||||
|
||||
public function executeReturnsInfo()
|
||||
{
|
||||
$this->config = stConfig::getInstance('stInvoiceBackend');
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
<br />
|
||||
<table cellpadding="0" cellspacing="0" border="0" width="100%">
|
||||
|
||||
<tr>
|
||||
<td style="text-align:left;"><font size="12"><?php echo __('Dane zwrotu') ?></font><br />
|
||||
<font size="8"><?php echo $productReturns->getUserFullname(); ?></font><br />
|
||||
<font size="8"><?php echo $productReturns->getUserEmail(); ?></font><br />
|
||||
<font size="8"><?php echo $productReturns->getUserPhone(); ?></font><br />
|
||||
<font size="8"><?php echo $productReturns->getUserBankAccount(); ?></font><br />
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
</table>
|
||||
<br />
|
||||
|
||||
<?php if($productReturns->getDescriptionComplaint() != ""): ?>
|
||||
<table cellpadding="0" cellspacing="0" border="0" width="100%">
|
||||
|
||||
<tr>
|
||||
<td style="text-align:left;"><font size="12"><?php echo __('Opis reklamacji') ?></font><br />
|
||||
<font size="8"><?php echo $productReturns->getDescriptionComplaint(); ?></font>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
</table>
|
||||
<br />
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if($productReturns->getDescriptionReturn() != ""): ?>
|
||||
<table cellpadding="0" cellspacing="0" border="0" width="100%">
|
||||
|
||||
<tr>
|
||||
<td style="text-align:left;"><font size="12"><?php echo __('Uwagi do zwrotu') ?></font><br />
|
||||
<font size="8"><?php echo $productReturns->getDescriptionReturn(); ?></font>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
</table>
|
||||
<br />
|
||||
<?php endif; ?>
|
||||
@@ -0,0 +1,66 @@
|
||||
<?php
|
||||
/**
|
||||
* @var Invoice $invoice
|
||||
*/
|
||||
use_helper('stCurrency');
|
||||
|
||||
?>
|
||||
|
||||
<font size="11"><?php echo __('Wybrane produkty do zwrotu') ?></font>
|
||||
<br/>
|
||||
<table border="0" cellpadding="3" cellspacing="0" width="100%">
|
||||
<thead>
|
||||
<tr>
|
||||
|
||||
<th bgcolor="#eee" style="text-align:left;" width="88"><font size="8"><?php echo __('kod'); ?></font></th>
|
||||
<th bgcolor="#eee" style="text-align:left;" width="170"><font size="8"><?php echo __('nazwa'); ?></font></th>
|
||||
<th bgcolor="#eee" style="text-align:right;"><font size="8"><?php echo __('netto'); ?></font></th>
|
||||
<th bgcolor="#eee" style="text-align:center;" width="30"><font size="8"><?php echo __('vat'); ?></font></th>
|
||||
<th bgcolor="#eee" style="text-align:right;" ><font size="8"><?php echo __('cena jed. brutto'); ?></font></th>
|
||||
<th bgcolor="#eee" style="text-align:center;" width="30" ><font size="8"><?php echo __('ilość'); ?></font></th>
|
||||
<th bgcolor="#eee" style="text-align:center;" width="30" ><font size="8"><?php echo __('j.m.'); ?></font></th>
|
||||
<th bgcolor="#eee" style="text-align:right;" ><font size="8"><?php echo __('suma'); ?></font></th>
|
||||
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
</table>
|
||||
|
||||
<table border="0" cellpadding="3" cellspacing="0" width="100%">
|
||||
<tbody>
|
||||
|
||||
<?php foreach($results as $order_product): ?>
|
||||
|
||||
<tr>
|
||||
<td style="text-align:left;" width="88"><font size="8"><?php echo $order_product['code']; ?></font></td>
|
||||
|
||||
<td style="text-align:left;" width="170"><font size="8"><?php echo $order_product['name_show']; ?></font></td>
|
||||
|
||||
<td style="text-align:right;"><font size="8"><?php echo $order_product['price']; ?></font></td>
|
||||
|
||||
<td style="text-align:center;" width="30"><font size="8"><?php echo $order_product['vat']; ?> %</font></td>
|
||||
|
||||
<td style="text-align:right;" ><font size="8"><?php echo $order_product['price_true']; ?></font></td>
|
||||
|
||||
<td style="text-align:center;" width="30"><font size="8"><?php echo $order_product['quantity']; ?></font></td>
|
||||
|
||||
<td style="text-align:center;" width="30"><font size="8"><?php echo $order_product['uom']; ?></font></td>
|
||||
|
||||
<td style="text-align:right;" ><font size="8"><?php echo $order_product['total_amount']; ?></font></td>
|
||||
</tr>
|
||||
|
||||
<?php endforeach; ?>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
|
||||
<?php if($productReturns->getReturnType() == "return"): ?>
|
||||
<table border="0" cellpadding="3" cellspacing="0" width="100%">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td style="text-align:right;"><font size="11"><?php echo __('Całkowita kwota zwrotu'); ?> <b><?php echo $total_amount_return; ?></b></font></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<?php endif; ?>
|
||||
@@ -0,0 +1,21 @@
|
||||
<br />
|
||||
<table cellpadding="0" cellspacing="0" border="0" width="100%">
|
||||
|
||||
<tr>
|
||||
<td style="text-align:left;"><font size="12"><?php echo __('Zwrot numer') ?> <br /> <b>#<?php echo $productReturns->getId(); ?></b></font></td>
|
||||
|
||||
<td style="text-align:left;"><font size="12"><?php echo __('Typ zwrotu') ?> <br />
|
||||
|
||||
<?php if($productReturns->getReturnType() == "return"): ?>
|
||||
<b><?php echo __('Rezygnacja') ?></b>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if($productReturns->getReturnType() == "complaint"): ?>
|
||||
<b><?php echo __('Reklamacja') ?></b>
|
||||
<?php endif; ?>
|
||||
|
||||
</font></td>
|
||||
</tr>
|
||||
|
||||
</table>
|
||||
<br />
|
||||
Reference in New Issue
Block a user