1
0
mirror of synced 2024-11-22 21:36:10 +03:00

Merge branch 'purchase-price' of github.com:intarocrm/bitrix-module into 1.0.3a

This commit is contained in:
Grisha Pomadchin 2014-04-16 11:31:49 +04:00
commit f73a4feeb9
5 changed files with 80 additions and 54 deletions

11
.gitignore vendored Normal file
View File

@ -0,0 +1,11 @@
.DS_Store
*~
/nbproject/*
/.idea/*
/*tags*
.idea
.idea/*
/.idea
/.idea/*
.travis.yml

View File

@ -14,6 +14,7 @@ class ICMLLoader {
public $application; public $application;
public $encoding = 'utf-8'; public $encoding = 'utf-8';
public $encodingDefault = 'utf-8'; public $encodingDefault = 'utf-8';
public $loadPurchasePrice = false;
protected $fp; protected $fp;
protected $mainSection = 1000000; protected $mainSection = 1000000;
@ -394,6 +395,7 @@ class ICMLLoader {
$offer['PRODUCT_NAME'] = $product["NAME"]; $offer['PRODUCT_NAME'] = $product["NAME"];
$offer['PRODUCT_ACTIVE'] = $product["ACTIVE"]; $offer['PRODUCT_ACTIVE'] = $product["ACTIVE"];
$offer['PRICE'] = $offer['CATALOG_PRICE_1']; $offer['PRICE'] = $offer['CATALOG_PRICE_1'];
$offer['PURCHASE_PRICE'] = $offer['CATALOG_PURCHASING_PRICE'];
$offer['QUANTITY'] = $offer["CATALOG_QUANTITY"]; $offer['QUANTITY'] = $offer["CATALOG_QUANTITY"];
// Get properties of product // Get properties of product
@ -432,6 +434,7 @@ class ICMLLoader {
$product['PRODUCT_NAME'] = $product["NAME"]; $product['PRODUCT_NAME'] = $product["NAME"];
$product['PRODUCT_ACTIVE'] = $product["ACTIVE"]; $product['PRODUCT_ACTIVE'] = $product["ACTIVE"];
$product['PRICE'] = $product['CATALOG_PRICE_1']; $product['PRICE'] = $product['CATALOG_PRICE_1'];
$product['PURCHASE_PRICE'] = $product['CATALOG_PURCHASING_PRICE'];
$product['QUANTITY'] = $product["CATALOG_QUANTITY"]; $product['QUANTITY'] = $product["CATALOG_QUANTITY"];
foreach ($resPropertiesProduct as $key => $propProduct) { foreach ($resPropertiesProduct as $key => $propProduct) {
@ -494,6 +497,9 @@ class ICMLLoader {
$offer .= "<url>" . ($_SERVER["HTTPS"] == 'on' ? "https://" : "http://") . $_SERVER['SERVER_NAME'] . $this->PrepareValue($arOffer['DETAIL_PAGE_URL']) . "</url>\n"; $offer .= "<url>" . ($_SERVER["HTTPS"] == 'on' ? "https://" : "http://") . $_SERVER['SERVER_NAME'] . $this->PrepareValue($arOffer['DETAIL_PAGE_URL']) . "</url>\n";
$offer .= "<price>" . $this->PrepareValue($arOffer['PRICE']) . "</price>\n"; $offer .= "<price>" . $this->PrepareValue($arOffer['PRICE']) . "</price>\n";
if ($arOffer['PURCHASE_PRICE'] && $this->loadPurchasePrice) {
$offer .= "<purchasePrice>" . $this->PrepareValue($arOffer['PURCHASE_PRICE']) . "</purchasePrice>\n";
}
foreach ($categories as $category) foreach ($categories as $category)
$offer .= "<categoryId>" . $category['ID'] . "</categoryId>\n"; $offer .= "<categoryId>" . $category['ID'] . "</categoryId>\n";

View File

@ -70,4 +70,5 @@ $loader->propertiesProduct = $IBLOCK_PROPERTY_PRODUCT;
$loader->propertiesUnitProduct = $IBLOCK_PROPERTY_UNIT_PRODUCT; $loader->propertiesUnitProduct = $IBLOCK_PROPERTY_UNIT_PRODUCT;
$loader->filename = $SETUP_FILE_NAME; $loader->filename = $SETUP_FILE_NAME;
$loader->application = $APPLICATION; $loader->application = $APPLICATION;
$loader->loadPurchasePrice = $LOAD_PURCHASE_PRICE == 'Y';
$loader->Load(); $loader->Load();

View File

@ -20,6 +20,8 @@ if (($ACTION == 'EXPORT' || $ACTION == 'EXPORT_EDIT' || $ACTION == 'EXPORT_COPY'
if (isset($arOldSetupVars['SETUP_FILE_NAME'])) if (isset($arOldSetupVars['SETUP_FILE_NAME']))
$SETUP_FILE_NAME = $arOldSetupVars['SETUP_FILE_NAME']; $SETUP_FILE_NAME = $arOldSetupVars['SETUP_FILE_NAME'];
if (isset($arOldSetupVars['LOAD_PURCHASE_PRICE']))
$LOAD_PURCHASE_PRICE = $arOldSetupVars['LOAD_PURCHASE_PRICE'];
if (isset($arOldSetupVars['SETUP_PROFILE_NAME'])) if (isset($arOldSetupVars['SETUP_PROFILE_NAME']))
$SETUP_PROFILE_NAME = $arOldSetupVars['SETUP_PROFILE_NAME']; $SETUP_PROFILE_NAME = $arOldSetupVars['SETUP_PROFILE_NAME'];
if (isset($arOldSetupVars['IBLOCK_EXPORT'])) if (isset($arOldSetupVars['IBLOCK_EXPORT']))
@ -538,6 +540,11 @@ if ($STEP==1)
'/bitrix/catalog_export/')) '/bitrix/catalog_export/'))
.'intarocrm'/* .mt_rand(0, 999999) */.'.xml' .'intarocrm'/* .mt_rand(0, 999999) */.'.xml'
); ?>" size="50"> ); ?>" size="50">
<br>
<br>
<font class="text"><?=GetMessage("LOAD_PURCHASE_PRICE");?>&nbsp;</font>
<input type="checkbox" name="LOAD_PURCHASE_PRICE" value="Y" <?= $LOAD_PURCHASE_PRICE == 'Y' ? 'checked' : '' ?>>
<br> <br>
<br> <br>
@ -637,7 +644,7 @@ if ($STEP==1)
<?=bitrix_sessid_post();?> <?=bitrix_sessid_post();?>
<? <?
$vals = "SETUP_FILE_NAME,IBLOCK_EXPORT"; $vals = "LOAD_PURCHASE_PRICE,SETUP_FILE_NAME,IBLOCK_EXPORT";
foreach ($iblockProperties as $val) { foreach ($iblockProperties as $val) {
$vals .= ",IBLOCK_PROPERTY_SKU_" . $val; $vals .= ",IBLOCK_PROPERTY_SKU_" . $val;
$vals .= ",IBLOCK_PROPERTY_UNIT_SKU_" . $val; $vals .= ",IBLOCK_PROPERTY_UNIT_SKU_" . $val;

View File

@ -5,6 +5,7 @@ $MESS["EXPORT_CATALOGS"] = "Выберите каталоги для выгру
$MESS["CATALOG"] = "Каталог"; $MESS["CATALOG"] = "Каталог";
$MESS["EXPORT2INTAROCML"] = "Выгрузить в ICML"; $MESS["EXPORT2INTAROCML"] = "Выгрузить в ICML";
$MESS["FILENAME"] = "Укажите имя файла данных:"; $MESS["FILENAME"] = "Укажите имя файла данных:";
$MESS["LOAD_PURCHASE_PRICE"] = "Выгружать закупочную цену";
$MESS["PROPERTY"] = "Свойство, содержащее артикул товара"; $MESS["PROPERTY"] = "Свойство, содержащее артикул товара";
$MESS["ALL_CATALOG"] = "Все каталоги"; $MESS["ALL_CATALOG"] = "Все каталоги";
$MESS["CET_EXPORT"] = "Экспортировать"; $MESS["CET_EXPORT"] = "Экспортировать";