Единицы измерения

Ваш путеводитель по интеграции V5!

The integration of Units of Measure between V5 Traceability and a customer’s ERP system allows for the units of measure used by an ERP/third party system to be sent to V5 Traceability. These units can be then applied to warehousing and formulation/production within the V5 Traceability system.

The flexibility of the V5 Traceability system allows for a fully customised units setup, with the ability to set custom unit conversions for large quantities such as cases and drums, as well as being able to set commodity specific conversion rates. Specific conversion rates are especially useful for items with specific density, as we will see in the example below.

Для классов «WeightUnit» и «UnitCommodity», которые мы здесь рассмотрим, доступен только импорт; экспорт недоступен ни через методологии JSON, ни через CSV.

More information on how units of measure work in V5 Traceability, please see our module guide здесь.

Содержание

1. Схема центра управления

In terms of how we can relate units and commodity specific conversion rates to what we see in Control Center, we can see that the top panel here is for entering our units of measure, with the bottom panel being for commodity specific conversion rates for the unit selected in the top panel.

If an entry in the lower panel is not present for a given commodity, then the system will revert to the conversion rate set in the top panel when a commodity is used with that unit. Once a commodity is added in the lower panel and a conversion rate added to it (the ‘UnitCommodity’) this then overrides the conversion rate in the top panel.

 
  

Using the V5 Gateway we can easily populate both panels.

2. API-ссылки

To find out more about the definitions for the 2 database classes we will be using to add our units please see the following links:

Вес Ед.

Единица

3. Шаблон интеграции

The integration template for WeightUnit (units of measure) can be downloaded здесь.

The integration template for UnitCommodity (commodity specific conversion rates) can be downloaded здесь.

4. Units Field Guide

4.1. Первичные ключи

Primary Keys are the unique identifier for each table within the V5 API.

Для пакетов Вес Ед., это:

код – The unique code for the unit of measure (i.e. g, kg, lb, oz etc.)

Для пакетов Единица, первичные ключи:

unit.code – the unique code for the unit of measure, as above.

и

Код товара – The unique code for the commodity to apply the specific conversion rate to.

4.2. Обязательные поля

Другие поля, которые требуются SG для заполнения действительной записи в Центре управления:

Для пакетов WeightUnit:

конверсияThe conversion rate for this unit, in relation to the unit with ID of 1 in the database.

Для пакетов Единица:

конверсия – the specific conversion rate for the specific commodity.

4.3. Предпочтительные поля

Preferred fields serve to add more information to the unit of measure (Вес Ед.), and while not required, are useful when it comes to functionality within V5 Traceability.

описаниеdescription of the unit (kilos, pounds etc.)

4.4. Дополнительные поля

Additional fields can also be included for Вес Ед., Таких как:

ноты – any additional notes for the unit

5. Методология

Given the relatively simple nature of this class, we can use either JSON or CSV integration to import units to V5. We will look at this from the point of view of doing an initial import to bring any missing units into the system (weightUnit), after which we will then assign commodity specific conversions using the units in the system (UnitCommodity). Note again that no exports are available for either endpoint/class.

6. WeightUnit

6.1. JSON — Импорт

‘’WeightUnit’ import Endpoint/URI –

http://host:port/V5-API/api/integrate/import/unit

Описание конечной точки

Образцы:

For this sample import, we will be using the ‘WeighUnit’ endpoint to add pounds and ounces to the Control Center Units table shown above in the introduction. The JSON file to do this would look like this:

 

Note that the conversion rates will always be calculated from the default unit (i.e. the first unit in the units table), so here we are calculating this against kilograms (kg).

Этот образец файла JSON можно загрузить здесь.

Используя приведенный выше файл, мы видим, что наши новые подразделения были созданы в Центре управления.

  

6.2. JSON — Экспорт

No JSON export is available for the ‘WeightUnit’ class.

6.3. CSV – Импорт

Имя файла определения заголовка/столбца: “weightUnit.csvh”

Готовые заголовочные файлы должны быть размещены в: “ \SG Control Center\gateway\import\column_defs”

Импортировать имя файла CSV: “weightUnit-datetime.csv”

CSV для импорта должны быть размещены в: “ \SG Control Center\шлюз\импорт»

Образцы:

Заголовочный файл:

Header files will generally be compiled by SG Systems prior to CSV integrations taking place, but we can see a basic example of one we can use for units below:

 

Для получения дополнительной информации о том, как мы структурируем эти файлы, см. главная страница интеграции.

Этот образец заголовочного файла можно загрузить здесь.

Файл импорта CSV:

Затем мы можем использовать определенный порядок точек данных в заголовке, чтобы структурировать наш файл импорта. SG Systems может предоставить для этого файл шаблона, в котором перечислены точки данных для каждого столбца, чтобы было понятнее при заполнении списка. Обратите внимание, что эта первая строка может быть проигнорирована Центром управления и поэтому может быть сохранена в файле при отправке на импорт.

 

Здесь мы видим, что мы создаем те же новые единицы, что и в примере JSON выше, но используем строчные буквы для кода единиц, чтобы это было более наглядно отображено в Центре управления.

Этот пример файла импорта можно загрузить здесь.

После завершения импорта мы видим, что эти новые единицы снова были созданы.

   

6.4. CSV — Экспорт

As with JSON exports, no CSV export is available for the ‘WeightUnit’ class.

7. UnitCommodity

7.1. JSON — Импорт

‘UnitCommodity’ import Endpoint/URI –

http://host:port/V5-API/api/integrate/import/unit_commodity

Описание конечной точки

Образцы:

For this sample import, we will be using the ‘UnitCommodity’ endpoint to add a specific unit conversion for litres of milk. We saw can see in Control Center above that litres would usually convert as a 1:1 ratio from litres to kg, i.e. 1 litre of water weighs 1kg. A litre of milk however would weigh slightly more than this (1.035kg), so we will see how we can set this up for a JSON import below.

 

Таким образом, мы сообщаем системе, что при использовании молока будет использоваться коэффициент преобразования 1.035, переопределяющий коэффициент преобразования по умолчанию для единицы измерения «литр».

Этот образец файла JSON можно загрузить здесь.

Используя приведенный выше файл, мы видим, что наш конкретный коэффициент пересчета для молока был добавлен в нижнюю панель «литр».

  

7.2. JSON — Экспорт

No JSON export is available for the ‘UnitCommodity’ class.

7.3. CSV – Импорт

Имя файла определения заголовка/столбца: “unitCommodity.csvh”

Готовые заголовочные файлы должны быть размещены в: “ \SG Control Center\gateway\import\column_defs”

Импортировать имя файла CSV: “unitCommodity-datetime.csv”

CSV для импорта должны быть размещены в: “ \SG Control Center\шлюз\импорт»

Образцы:

Заголовочный файл:

Header files will generally be compiled by SG Systems prior to CSV integrations taking place, but we can see an example of one we can use for commodity specific unit conversion below:

 

Для получения дополнительной информации о том, как мы структурируем эти файлы, см. главная страница интеграции.

Этот образец заголовочного файла можно загрузить здесь.

Файл импорта CSV:

Затем мы можем использовать определенный порядок точек данных в заголовке, чтобы структурировать наш файл импорта. SG Systems может предоставить для этого файл шаблона, в котором перечислены точки данных для каждого столбца, чтобы было понятнее при заполнении списка. Обратите внимание, что эта первая строка может быть проигнорирована Центром управления и поэтому может быть сохранена в файле при отправке на импорт.

 

Здесь мы видим, что мы создаем то же самое преобразование единиц товара, что и в примере JSON выше.

Этот пример файла импорта можно загрузить здесь.

После завершения импорта мы видим, что снова было создано новое преобразование единиц измерения для конкретного товара.

   

7.4. CSV — Экспорт

As with JSON exports, no CSV export is available for the ‘UnitCommodity’ class.

Была ли эта страница полезной?
ДаНет