<?xml version="1.0" encoding="utf-8"?>
<Entity 
Schema="STOR" 
Name="SUPPLIER_APPLICATION_ITEMS" 
Description="Элементы заявки поставщику" 
PrimaryKey="SupplierApplicationItemsID">
  <Fields>
    <Attribute Name="SupplierApplicationItemsID" Index="1" Type="guid" Description="Идентификатор" />
    <Attribute Name="Amount" Index="2" Type="float" DefaultFormat="{0:0.#####}" Description="Количество" NumericPrecision="20" NumericScale="6" Required="1" />
    <Attribute Name="Price" Index="3" Type="float" DefaultFormat="{0:G0}" Description="Цена" NumericPrecision="12" NumericScale="2" Required="1" />
    <Attribute Name="Sum" Index="4" Type="float" DefaultFormat="{0:G0}" Description="Сумма" NumericPrecision="12" NumericScale="2" />
    <Attribute Name="Comment" Index="11" Type="string" Description="Комментарий" />
    <Parent Name="SupplierApplication" Index="5" Type="STOR.SUPPLIER_APPLICATION" Description="Заявка поставщику" Required="1" />
    <Parent Name="SupplierContract" Index="6" Type="STOR.SUPPLIER_CONTRACT" Description="Договор от поставщика" Required="1" />
    <Parent Name="SupplierContractAbr" Index="7" Type="STOR.SUPPLIER_CONTRACT_ABR" Description="Аббревиатура договора" CharacterMaximumLength="20" Required="1" />
    <Parent Name="PackageType" Index="8" Type="PHARM.PACKAGE_TYPE" Description="Вид упаковки" Required="1" />
    <Parent Name="BillOfGoods" Index="9" Type="PHARM.BILL_OF_GOODS" Description="Номенклатура товаров" Required="1" />
    <Choice Name="VAT" Index="10" 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>
  </Fields>
  <DbMapping>
    <Table name="T_SUPPLIER_APPLICATION_ITEMS">
      <Map Name="SupplierApplicationItemsID" Column="SupplierApplicationItemsID" />
      <Map Name="Amount" Column="Amount" />
      <Map Name="Price" Column="Price" />
      <Map Name="Comment" Column="Comment" />
      <Map Name="SupplierApplication" Column="SupplierApplication" />
      <Map Name="SupplierContract" Column="SupplierContract" />
      <Map Name="SupplierContractAbr" Column="SupplierContractAbr" />
      <Map Name="PackageType" Column="PackageType" />
      <Map Name="BillOfGoods" Column="BillOfGoods" />
      <Map Name="VAT" Column="VAT" />
    </Table>
    <Lexem>
      <Map Name="Sum">
        <lx:MathOperator sign="*" xmlns:lx="lexem">
          <lx:Path OwnerQueryLevel="0">
            <lx:StepInt index="2" />
          </lx:Path>
          <lx:Path OwnerQueryLevel="0">
            <lx:StepInt index="3" />
          </lx:Path>
        </lx:MathOperator>
      </Map>
    </Lexem>
  </DbMapping>
</Entity>