parent
17e3b00dd7
commit
c7cec20c02
@ -1,3 +1,6 @@
|
||||
## 2023-06-30 v.6.3.16
|
||||
- Добавлена передача НДС товаров
|
||||
|
||||
## 2023-06-22 v.6.3.15
|
||||
- Исправлено зависание агента выгрузки заказов
|
||||
|
||||
|
@ -1035,8 +1035,17 @@ class RetailCrmHistory
|
||||
|
||||
if ($item instanceof \Bitrix\Sale\BasketItem) {
|
||||
$elem = self::getInfoElement($product['offer']['externalId']);
|
||||
$vatRate = null;
|
||||
|
||||
$item->setFields(array(
|
||||
if (RetailcrmConfigProvider::getOrderVat() === 'Y') {
|
||||
if ($product['vatRate'] === 0) {
|
||||
$vatRate = 0;
|
||||
} elseif($product['vatRate'] !== null) {
|
||||
$vatRate = $product['vatRate'] / 100;
|
||||
}
|
||||
}
|
||||
|
||||
$item->setFields([
|
||||
'CURRENCY' => $newOrder->getCurrency(),
|
||||
'LID' => $site,
|
||||
'BASE_PRICE' => $collectItems[$product['offer']['externalId']]['initialPrice_max'],
|
||||
@ -1047,8 +1056,10 @@ class RetailCrmHistory
|
||||
'WEIGHT' => $elem['WEIGHT'],
|
||||
'NOTES' => GetMessage('PRICE_TYPE'),
|
||||
'PRODUCT_XML_ID' => $elem["XML_ID"],
|
||||
'CATALOG_XML_ID' => $elem["IBLOCK_XML_ID"]
|
||||
));
|
||||
'CATALOG_XML_ID' => $elem["IBLOCK_XML_ID"],
|
||||
'VAT_INCLUDED' => $vatRate !== null ? 'Y' : 'N',
|
||||
'VAT_RATE' => $vatRate,
|
||||
]);
|
||||
} else {
|
||||
RCrmActions::eventLog(
|
||||
'RetailCrmHistory::orderHistory',
|
||||
|
@ -301,6 +301,14 @@ class RetailCrmOrder
|
||||
$item['initialPrice'] = $product['PRICE'];
|
||||
}
|
||||
|
||||
if (
|
||||
!empty($product['VAT_INCLUDED'])
|
||||
&& $product['VAT_INCLUDED'] === 'Y'
|
||||
&& RetailcrmConfigProvider::getOrderVat() === 'Y'
|
||||
) {
|
||||
$item['vatRate'] = $product['VAT_RATE'] * 100;
|
||||
}
|
||||
|
||||
$order['items'][] = $item;
|
||||
|
||||
if ($send && $dimensionsSetting === 'Y') {
|
||||
|
@ -1 +1 @@
|
||||
- Исправлено зависание агента выгрузки заказов
|
||||
- Добавлена передача НДС товаров
|
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
$arModuleVersion = [
|
||||
'VERSION' => '6.3.15',
|
||||
'VERSION_DATE' => '2023-06-22 15:30:00'
|
||||
'VERSION' => '6.3.16',
|
||||
'VERSION_DATE' => '2023-06-30 18:00:00'
|
||||
];
|
||||
|
@ -62,7 +62,8 @@ $MESS ['ORDER_UPL_START'] = 'Start uploading';
|
||||
$MESS ['UPLOAD_ORDERS_OPTIONS'] = 'Manual uploading';
|
||||
$MESS ['OTHER_OPTIONS'] = 'Other settings';
|
||||
$MESS ['ORDERS_OPTIONS'] = 'Order settings';
|
||||
$MESS ['ORDER_NUMBERS'] = 'Send order numbers to the store for orders created in CRM';
|
||||
$MESS ['ORDER_NUMBERS'] = 'Transferring order numbers to the store for orders created in CRM';
|
||||
$MESS ['ORDER_VAT'] = 'Transfer VAT of goods';
|
||||
$MESS ['CRM_API_VERSION'] = 'API version';
|
||||
$MESS ['CURRENCY'] = 'Currency set in the order when uploading from CRM';
|
||||
$MESS ['ORDER_DIMENSIONS'] = 'Send dimensions and weight of the products in the order';
|
||||
|
@ -76,7 +76,8 @@ $MESS ['LOYALTY_PROGRAM_TITLE'] = 'Программа лояльности';
|
||||
$MESS ['LOYALTY_PROGRAM_TOGGLE_MSG'] = 'Включить программу лояльности';
|
||||
$MESS ['OTHER_OPTIONS'] = 'Прочие настройки';
|
||||
$MESS ['ORDERS_OPTIONS'] = 'Настройки заказов';
|
||||
$MESS ['ORDER_NUMBERS'] = 'Транслировать номера заказов созданных в црм в магазин';
|
||||
$MESS ['ORDER_NUMBERS'] = 'Транслировать номера заказов созданных в CRM в магазин';
|
||||
$MESS ['ORDER_VAT'] = 'Передавать НДС товаров';
|
||||
|
||||
$MESS ['CRM_API_VERSION'] = 'Версия API клиента';
|
||||
$MESS ['CURRENCY'] = 'Валюта, устанавливаемая в заказе при выгрузке из CRM';
|
||||
|
@ -66,6 +66,9 @@ class ConfigProvider
|
||||
/** @var bool|null|string $orderNumbers */
|
||||
protected static $orderNumbers;
|
||||
|
||||
/** @var bool|null|string $orderVat */
|
||||
protected static $orderVat;
|
||||
|
||||
/** @var array $orderTypes */
|
||||
protected static $orderTypes;
|
||||
|
||||
@ -614,6 +617,20 @@ class ConfigProvider
|
||||
return self::$orderNumbers;
|
||||
}
|
||||
|
||||
/**
|
||||
* getOrderVat
|
||||
*
|
||||
* @return bool|string|null
|
||||
*/
|
||||
public static function getOrderVat()
|
||||
{
|
||||
if (self::isEmptyNotZero(self::$orderVat)) {
|
||||
self::$orderVat = static::getOption(Constants::CRM_ORDER_VAT);
|
||||
}
|
||||
|
||||
return self::$orderVat;
|
||||
}
|
||||
|
||||
/**
|
||||
* getOrderHistoryDate
|
||||
*
|
||||
|
@ -43,6 +43,7 @@ class Constants
|
||||
public const CRM_CONTRAGENT_TYPE = 'contragent_type';
|
||||
public const CRM_SITES_LIST_CORPORATE = 'shops-corporate';
|
||||
public const CRM_ORDER_NUMBERS = 'order_numbers';
|
||||
public const CRM_ORDER_VAT = 'order_vat';
|
||||
public const CRM_CANCEL_ORDER = 'cansel_order';
|
||||
public const CRM_INVENTORIES_UPLOAD = 'inventories_upload';
|
||||
public const CRM_STORES = 'stores';
|
||||
|
@ -38,6 +38,7 @@ $CRM_CUSTOM_FIELDS = 'custom_fields';
|
||||
$CRM_CONTRAGENT_TYPE = 'contragent_type';
|
||||
$CRM_SITES_LIST = 'sites_list';
|
||||
$CRM_ORDER_NUMBERS = 'order_numbers';
|
||||
$CRM_ORDER_VAT = 'order_vat';
|
||||
$CRM_CANSEL_ORDER = 'cansel_order';
|
||||
$CRM_INVENTORIES_UPLOAD = 'inventories_upload';
|
||||
$CRM_STORES = 'stores';
|
||||
@ -400,9 +401,10 @@ if (isset($_POST['Update']) && ($_POST['Update'] === 'Y')) {
|
||||
}
|
||||
|
||||
//order numbers
|
||||
$orderNumbers = htmlspecialchars(trim($_POST['order-numbers'])) ? htmlspecialchars(trim($_POST['order-numbers'])) : 'N';
|
||||
$orderDimensions = htmlspecialchars(trim($_POST[$CRM_DIMENSIONS])) ? htmlspecialchars(trim($_POST[$CRM_DIMENSIONS])) : 'N';
|
||||
$sendPaymentAmount = htmlspecialchars(trim($_POST[RetailcrmConstants::SEND_PAYMENT_AMOUNT])) ? htmlspecialchars(trim($_POST[RetailcrmConstants::SEND_PAYMENT_AMOUNT])) : 'N';
|
||||
$orderVat = htmlspecialchars(trim($_POST['order-vat'])) ?: 'N';
|
||||
$orderNumbers = htmlspecialchars(trim($_POST['order-numbers'])) ?: 'N';
|
||||
$orderDimensions = htmlspecialchars(trim($_POST[$CRM_DIMENSIONS])) ?: 'N';
|
||||
$sendPaymentAmount = htmlspecialchars(trim($_POST[RetailcrmConstants::SEND_PAYMENT_AMOUNT])) ?: 'N';
|
||||
|
||||
//stores
|
||||
$bitrixStoresArr = [];
|
||||
@ -805,6 +807,11 @@ if (isset($_POST['Update']) && ($_POST['Update'] === 'Y')) {
|
||||
$CRM_ORDER_NUMBERS,
|
||||
$orderNumbers
|
||||
);
|
||||
COption::SetOptionString(
|
||||
$mid,
|
||||
$CRM_ORDER_VAT,
|
||||
$orderVat
|
||||
);
|
||||
COption::SetOptionString(
|
||||
$mid,
|
||||
$CRM_CANSEL_ORDER,
|
||||
@ -1007,6 +1014,7 @@ if (isset($_POST['Update']) && ($_POST['Update'] === 'Y')) {
|
||||
$optionsLegalDetails = unserialize(COption::GetOptionString($mid, $CRM_LEGAL_DETAILS, 0));
|
||||
$optionsCustomFields = unserialize(COption::GetOptionString($mid, $CRM_CUSTOM_FIELDS, 0));
|
||||
$optionsOrderNumbers = COption::GetOptionString($mid, $CRM_ORDER_NUMBERS, 0);
|
||||
$optionsOrderVat= COption::GetOptionString($mid, $CRM_ORDER_VAT, 0);
|
||||
$canselOrderArr = unserialize(COption::GetOptionString($mid, $CRM_CANSEL_ORDER, 0));
|
||||
|
||||
$optionInventotiesUpload = COption::GetOptionString($mid, $CRM_INVENTORIES_UPLOAD, 0);
|
||||
@ -2138,9 +2146,18 @@ if (isset($_POST['Update']) && ($_POST['Update'] === 'Y')) {
|
||||
<tr>
|
||||
<td colspan="2" class="option-head option-other-top option-other-bottom">
|
||||
<b>
|
||||
<label><input class="addr" type="checkbox" name="order-numbers" value="Y" <?php if ($optionsOrderNumbers === 'Y') {
|
||||
<label><input class="addr" type="checkbox" name="order-vat" value="Y" <?php if ($optionsOrderVat === 'Y') {
|
||||
echo "checked";
|
||||
} ?>> <?php echo GetMessage('ORDER_NUMBERS'); ?></label>
|
||||
} ?>> <?php echo GetMessage('ORDER_VAT'); ?></label>
|
||||
</b>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2" class="option-head option-other-top option-other-bottom">
|
||||
<b>
|
||||
<label>
|
||||
<input class="addr" type="checkbox" name="<?php echo RetailcrmConstants::SEND_PAYMENT_AMOUNT; ?>" value="Y" <?php if(RetailcrmConfigProvider::shouldSendPaymentAmount()) echo "checked"; ?>> <?php echo GetMessage('SEND_PAYMENT_AMOUNT'); ?>
|
||||
</label>
|
||||
</b>
|
||||
</td>
|
||||
</tr>
|
||||
@ -2158,9 +2175,9 @@ if (isset($_POST['Update']) && ($_POST['Update'] === 'Y')) {
|
||||
<tr>
|
||||
<td colspan="2" class="option-head option-other-top option-other-bottom">
|
||||
<b>
|
||||
<label>
|
||||
<input class="addr" type="checkbox" name="<?php echo RetailcrmConstants::SEND_PAYMENT_AMOUNT; ?>" value="Y" <?php if(RetailcrmConfigProvider::shouldSendPaymentAmount()) echo "checked"; ?>> <?php echo GetMessage('SEND_PAYMENT_AMOUNT'); ?>
|
||||
</label>
|
||||
<label><input class="addr" type="checkbox" name="order-numbers" value="Y" <?php if ($optionsOrderNumbers === 'Y') {
|
||||
echo "checked";
|
||||
} ?>> <?php echo GetMessage('ORDER_NUMBERS'); ?></label>
|
||||
</b>
|
||||
</td>
|
||||
</tr>
|
||||
|
Loading…
Reference in New Issue
Block a user