Merge 'origin/develop' into gli-1076-clone and reference field from hidden fields in order webservice parameters
This commit is contained in:
@@ -71,6 +71,9 @@ class OrderCore extends ObjectModel
|
||||
/** @var string Payment method */
|
||||
public $payment;
|
||||
|
||||
/** @var string Payment type */
|
||||
public $payment_type;
|
||||
|
||||
/** @var string Payment module */
|
||||
public $module;
|
||||
|
||||
@@ -190,6 +193,11 @@ class OrderCore extends ObjectModel
|
||||
*/
|
||||
public $advance_paid_amount;
|
||||
|
||||
/**
|
||||
* @var int is occupancy provided in this order
|
||||
*/
|
||||
public $with_occupancy;
|
||||
|
||||
/**
|
||||
* @see ObjectModel::$definition
|
||||
*/
|
||||
@@ -210,6 +218,7 @@ class OrderCore extends ObjectModel
|
||||
'current_state' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId'),
|
||||
'secure_key' => array('type' => self::TYPE_STRING, 'validate' => 'isMd5'),
|
||||
'payment' => array('type' => self::TYPE_STRING, 'validate' => 'isGenericName', 'required' => true),
|
||||
'payment_type' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedInt'),
|
||||
'module' => array('type' => self::TYPE_STRING, 'validate' => 'isModuleName', 'required' => true),
|
||||
'recyclable' => array('type' => self::TYPE_BOOL, 'validate' => 'isBool'),
|
||||
'gift' => array('type' => self::TYPE_BOOL, 'validate' => 'isBool'),
|
||||
@@ -242,8 +251,9 @@ class OrderCore extends ObjectModel
|
||||
'source' => array('type' => self::TYPE_STRING),
|
||||
'valid' => array('type' => self::TYPE_BOOL),
|
||||
'reference' => array('type' => self::TYPE_STRING),
|
||||
'is_advance_payment' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId', 'default' => 0),
|
||||
'advance_paid_amount' => array('type' => self::TYPE_FLOAT, 'validate' => 'isPrice'),
|
||||
'is_advance_payment' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId', 'default' => 0),
|
||||
'advance_paid_amount' => array('type' => self::TYPE_FLOAT, 'validate' => 'isPrice'),
|
||||
'with_occupancy' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId', 'default' => 0),
|
||||
'date_add' => array('type' => self::TYPE_DATE, 'validate' => 'isDate'),
|
||||
'date_upd' => array('type' => self::TYPE_DATE, 'validate' => 'isDate'),
|
||||
),
|
||||
@@ -296,7 +306,6 @@ class OrderCore extends ObjectModel
|
||||
'mobile_theme',
|
||||
'round_mode',
|
||||
'round_type',
|
||||
'reference',
|
||||
),
|
||||
'associations' => array(
|
||||
'bookings' => array(
|
||||
@@ -890,7 +899,7 @@ class OrderCore extends ObjectModel
|
||||
|
||||
public function isInPreparation()
|
||||
{
|
||||
return count($this->getHistory((int)$this->id_lang, Configuration::get('PS_OS_PREPARATION')));
|
||||
return count($this->getHistory((int)$this->id_lang, Configuration::get('PS_OS_PROCESSING')));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1618,7 +1627,7 @@ class OrderCore extends ObjectModel
|
||||
$extraVars['transaction_id'] = $this->transaction_id;
|
||||
|
||||
if ($this->total_paid_real > 0) {
|
||||
$orderStatus = Configuration::get('PS_OS_WS_PAYMENT');
|
||||
$orderStatus = Configuration::get('PS_OS_REMOTE_PAYMENT_ACCEPTED');
|
||||
} else {
|
||||
$orderStatus = Configuration::get('PS_OS_AWAITING_REMOTE_PAYMENT');
|
||||
}
|
||||
@@ -1766,7 +1775,7 @@ class OrderCore extends ObjectModel
|
||||
* @param bool $update_payment_detail :: if false, be sure to add payment detail in payment detail table
|
||||
* @return bool
|
||||
*/
|
||||
public function addOrderPayment($amount_paid, $payment_method = null, $payment_transaction_id = null, $currency = null, $date = null, $order_invoice = null, $update_payment_detail = true)
|
||||
public function addOrderPayment($amount_paid, $payment_method = null, $payment_transaction_id = null, $currency = null, $date = null, $order_invoice = null, $payment_type = null, $update_payment_detail = true)
|
||||
{
|
||||
$order_payment = new OrderPayment();
|
||||
$order_payment->order_reference = $this->reference;
|
||||
@@ -1775,6 +1784,7 @@ class OrderCore extends ObjectModel
|
||||
$order_payment->conversion_rate = ($currency ? $currency->conversion_rate : 1);
|
||||
// if payment_method is define, we used this
|
||||
$order_payment->payment_method = ($payment_method ? $payment_method : $this->payment);
|
||||
$order_payment->payment_type = ($payment_type ? $payment_type : $this->payment_type);
|
||||
$order_payment->transaction_id = $payment_transaction_id;
|
||||
$order_payment->amount = $amount_paid;
|
||||
$order_payment->date_add = ($date ? $date : null);
|
||||
|
||||
Reference in New Issue
Block a user