<?xml version="1.0" encoding="utf-8"?>
<Entity 
Schema="STOR" 
Name="SGTINS" 
Description="Уникальная идентификационная кодовая информация вторичной потребительской упаковки" 
PrimaryKey="SgtinsID" 
DNAttributes="{Sgtin}" 
DisplayName="{0}">
  <Fields>
    <Parent Name="InvoiceItem" Type="STOR.INVOICE_ITEM" Description="Элемент накладной" />
    <Parent Name="StorageInvoice" Type="STOR.STORAGE_INVOICE" Description="Медицинская накладная" Required="1" />
    <Attribute Name="Sgtin" Type="string" Description="Sgtin" CharacterMaximumLength="27" Required="1" />
    <Attribute Name="Price" Type="float" DefaultFormat="{0:F2}" Description="Цена" NumericPrecision="12" NumericScale="2" Required="1" />
    <Choice Name="VAT" Description="НДС" Required="1">
      <Item Name="Без НДС" Index="0" />
      <Item Name="10%" Index="1" />
      <Item Name="18%" Index="2" />
      <Item Name="20%" Index="3" />
      <Item Name="5%" Index="4" />
      <Item Name="7%" Index="5" />
      <Item Name="22%" Index="6" />
    </Choice>
    <Attribute Name="OrderNumber" Type="int" Description="Порядковый номер" Required="1" />
    <Attribute Name="Error" Type="string" Description="Ошибка" CharacterMaximumLength="1000" />
    <Attribute Name="SgtinsID" Type="guid" Description="Идентификатор" />
    <Attribute Name="ProductName" Type="string" Description="Наименование товара" CharacterMaximumLength="1000" />
    <Attribute Name="ProductCode" Type="string" Description="Код товара" CharacterMaximumLength="50" />
    <Attribute Name="ExpirationDate" Type="date" Description="Срок годности" />
    <Attribute Name="Serial" Type="string" Description="Серия" CharacterMaximumLength="50" />
  </Fields>
  <DbMapping>
    <Table name="T_SGTINS">
      <Map Name="InvoiceItem" Column="IdInvoiceItem" />
      <Map Name="StorageInvoice" Column="StorageInvoice" />
      <Map Name="Sgtin" Column="Sgtin" />
      <Map Name="Price" Column="Price" />
      <Map Name="VAT" Column="VAT" />
      <Map Name="OrderNumber" Column="OrderNumber" />
      <Map Name="Error" Column="Error" />
      <Map Name="SgtinsID" Column="SgtinsID" />
      <Map Name="ProductName" Column="ProductName" />
      <Map Name="ProductCode" Column="ProductCode" />
      <Map Name="ExpirationDate" Column="ExpirationDate" />
      <Map Name="Serial" Column="Serial" />
    </Table>
  </DbMapping>
</Entity>