Y
Y
Yuriy2018-12-04 17:29:41
1C-Bitrix
Yuriy, 2018-12-04 17:29:41

Bitrix how to update from 2 different 1C number of goods in treasures?

There are 2 different 1C, the goods are almost the same, but the balance on them is different. Those. 1C works with one warehouse, the other works with another warehouse. These are different legal entities. Site one.
The task is to update the inventory balances of the goods on the site.
1C_FIRST => SKLAD_1 1C_SECOND
=> SKLAD_2

<Остатки>
          <Остаток>

            <Склад>
              <ИдСклада>SKLAD_1</ИдСклада>
              <Ид>SKLAD_1</Ид>
              <Количество>24</Количество>
            </Склад>
          </Остаток>
        </Остатки>

IMPORT 1C_SECOND
<Остатки>
          <Остаток>

            <Склад>
              <ИдСклада>SKLAD_2</ИдСклада>
              <Ид>SKLAD_2</Ид>
              <Количество>100</Количество>
            </Склад>
          </Остаток>
        </Остатки>

But the problem got out as follows, with this logic, Bitrix puts the available balance of the goods according to the last import.
Of course, after both imports, you can write a processing that will sum up both warehouses and update the available quantity, something like this:
$obProduct = new CCatalogProduct(); 
$obProduct->Update(1, ['QUANTITY' => SKLAD_1+SKLAD_2, 'SUBSCRIBE' => 'D']);

But maybe there is a more correct way, how to update stock balances from different 1C?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question