2018-05-28 17:09:31 +03:00
|
|
|
<?php
|
|
|
|
|
|
|
|
class RetailcrmTestHelper
|
|
|
|
{
|
|
|
|
public static function createOrderPayment($order_reference)
|
|
|
|
{
|
|
|
|
$orderPayment = new OrderPayment();
|
|
|
|
$orderPayment->order_reference = $order_reference;
|
2021-11-03 16:19:39 +07:00
|
|
|
$orderPayment->id_currency = (int) Configuration::get('PS_CURRENCY_DEFAULT');
|
2018-05-28 17:09:31 +03:00
|
|
|
$orderPayment->conversion_rate = 1.000000;
|
|
|
|
$orderPayment->amount = 100;
|
|
|
|
$orderPayment->payment_method = 'Bank wire';
|
|
|
|
$orderPayment->date_add = date('Y-m-d H:i:s');
|
|
|
|
|
|
|
|
$orderPayment->save();
|
|
|
|
|
|
|
|
return $orderPayment;
|
|
|
|
}
|
|
|
|
|
|
|
|
public static function deleteOrderPayment($id)
|
|
|
|
{
|
|
|
|
$orderPayment = new OrderPayment($id);
|
|
|
|
|
|
|
|
return $orderPayment->delete();
|
|
|
|
}
|
2018-10-05 17:50:20 +03:00
|
|
|
|
|
|
|
public static function getMaxOrderId()
|
|
|
|
{
|
|
|
|
return Db::getInstance()->getValue(
|
|
|
|
'SELECT MAX(id_order) FROM `' . _DB_PREFIX_ . 'orders`'
|
|
|
|
);
|
|
|
|
}
|
2020-07-08 16:09:45 +03:00
|
|
|
|
|
|
|
public static function getMaxCustomerId()
|
|
|
|
{
|
|
|
|
return Db::getInstance()->getValue(
|
|
|
|
'SELECT MAX(id_customer) FROM `' . _DB_PREFIX_ . 'customer`'
|
|
|
|
);
|
|
|
|
}
|
2018-05-28 17:09:31 +03:00
|
|
|
}
|