<?xml version="1.0" encoding="utf-8"?>
<root>
  <!-- 
    Microsoft ResX Schema 
    
    Version 2.0
    
    The primary goals of this format is to allow a simple XML format 
    that is mostly human readable. The generation and parsing of the 
    various data types are done through the TypeConverter classes 
    associated with the data types.
    
    Example:
    
    ... ado.net/XML headers & schema ...
    <resheader name="resmimetype">text/microsoft-resx</resheader>
    <resheader name="version">2.0</resheader>
    <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
    <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
    <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
    <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
    <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
        <value>[base64 mime encoded serialized .NET Framework object]</value>
    </data>
    <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
        <comment>This is a comment</comment>
    </data>
                
    There are any number of "resheader" rows that contain simple 
    name/value pairs.
    
    Each data row contains a name, and value. The row also contains a 
    type or mimetype. Type corresponds to a .NET class that support 
    text/value conversion through the TypeConverter architecture. 
    Classes that don't support this are serialized and stored with the 
    mimetype set.
    
    The mimetype is used for serialized objects, and tells the 
    ResXResourceReader how to depersist the object. This is currently not 
    extensible. For a given mimetype the value must be set accordingly:
    
    Note - application/x-microsoft.net.object.binary.base64 is the format 
    that the ResXResourceWriter will generate, however the reader can 
    read any of the formats listed below.
    
    mimetype: application/x-microsoft.net.object.binary.base64
    value   : The object must be serialized with 
            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
            : and then encoded with base64 encoding.
    
    mimetype: application/x-microsoft.net.object.soap.base64
    value   : The object must be serialized with 
            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
            : and then encoded with base64 encoding.

    mimetype: application/x-microsoft.net.object.bytearray.base64
    value   : The object must be serialized into a byte array 
            : using a System.ComponentModel.TypeConverter
            : and then encoded with base64 encoding.
    -->
  <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
    <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
    <xsd:element name="root" msdata:IsDataSet="true">
      <xsd:complexType>
        <xsd:choice maxOccurs="unbounded">
          <xsd:element name="metadata">
            <xsd:complexType>
              <xsd:sequence>
                <xsd:element name="value" type="xsd:string" minOccurs="0" />
              </xsd:sequence>
              <xsd:attribute name="name" use="required" type="xsd:string" />
              <xsd:attribute name="type" type="xsd:string" />
              <xsd:attribute name="mimetype" type="xsd:string" />
              <xsd:attribute ref="xml:space" />
            </xsd:complexType>
          </xsd:element>
          <xsd:element name="assembly">
            <xsd:complexType>
              <xsd:attribute name="alias" type="xsd:string" />
              <xsd:attribute name="name" type="xsd:string" />
            </xsd:complexType>
          </xsd:element>
          <xsd:element name="data">
            <xsd:complexType>
              <xsd:sequence>
                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
                <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
              </xsd:sequence>
              <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
              <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
              <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
              <xsd:attribute ref="xml:space" />
            </xsd:complexType>
          </xsd:element>
          <xsd:element name="resheader">
            <xsd:complexType>
              <xsd:sequence>
                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
              </xsd:sequence>
              <xsd:attribute name="name" type="xsd:string" use="required" />
            </xsd:complexType>
          </xsd:element>
        </xsd:choice>
      </xsd:complexType>
    </xsd:element>
  </xsd:schema>
  <resheader name="resmimetype">
    <value>text/microsoft-resx</value>
  </resheader>
  <resheader name="version">
    <value>2.0</value>
  </resheader>
  <resheader name="reader">
    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
  </resheader>
  <resheader name="writer">
    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
  </resheader>
  <data name="Card" xml:space="preserve">
    <value>SELECT CardNumber, CardName, Group1 AS CardGroupNo1, Group2 AS CardGroupNo2, CardGroup AS CardGroupNo3, CardStatus AS CardGroupNo4, SugName AS CardType, Street, StreetToSend, City, Mikud AS ZipCode, Tel1 AS Phone1, Tel2 AS Phone2, Tel3 AS Phone3, Fax AS FaxNo, Zehut AS ID, Mark AS Remark, Email, CDbl(Makor) AS Makor, DateMakor, IIF(AsraiType1='רגיל',1,2) AS CreditType, Asrai AS Credit, Obligo, SugObligo AS ObligoType, Cbool(ObligoHaz) AS ObligoOrder, Cbool(ObligoPeraon) AS ObligoRepay, Sochen AS Agent, Cbool(IIF(ChkMerakez='',0,-1)) AS IsLink, CardLink, CardCondition, TamhirLak AS PriceList, RegDateTime FROM Card WHERE RegDateTime &gt;= @date</value>
  </data>
  <data name="Contacts" xml:space="preserve">
    <value>SELECT CardNumber, KeserName AS ContactName, KeserType AS ContactType, Tel1 AS Phone, Mark AS Remark FROM Keser</value>
  </data>
  <data name="CustomFieldsDetailsOld" xml:space="preserve">
    <value>SELECT fieldKot1, fieldVal1, FieldNus1
FROM shagmain, ShivukIndex2
WHERE shagmain.MainIndexNo = 1 AND ShivukIndex2.CardNumber = @ItemNo
UNION ALL
SELECT fieldKot2, fieldVal2, FieldNus2
FROM shagmain, ShivukIndex2
WHERE MainIndexNo = 1 AND ShivukIndex2.CardNumber = @ItemNo
UNION ALL
SELECT fieldKot3, fieldVal3, FieldNus3
FROM shagmain, ShivukIndex2
WHERE MainIndexNo = 1 AND ShivukIndex2.CardNumber = @ItemNo
UNION ALL
SELECT fieldKot4, fieldVal4, FieldNus4
FROM shagmain, ShivukIndex2
WHERE MainIndexNo = 1 AND ShivukIndex2.CardNumber = @ItemNo
UNION ALL
SELECT fieldKot5, fieldVal5, FieldNus5
FROM shagmain, ShivukIndex2
WHERE MainIndexNo = 1 AND ShivukIndex2.CardNumber = @ItemNo
UNION ALL
SELECT fieldKot6, fieldVal6, FieldNus6
FROM shagmain, ShivukIndex2
WHERE MainIndexNo = 1 AND ShivukIndex2.CardNumber = @ItemNo
UNION ALL
SELECT fieldKot7, fieldVal7, FieldNus7
FROM shagmain, ShivukIndex2
WHERE MainIndexNo = 1 AND ShivukIndex2.CardNumber = @ItemNo
UNION ALL
SELECT fieldKot8, fieldVal8, FieldNus8
FROM shagmain, ShivukIndex2
WHERE MainIndexNo = 1 AND ShivukIndex2.CardNumber = @ItemNo
UNION ALL
SELECT fieldKot9, fieldVal9, FieldNus9
FROM shagmain, ShivukIndex2
WHERE MainIndexNo = 1 AND ShivukIndex2.CardNumber = @ItemNo
UNION ALL
SELECT fieldKot10, fieldVal10, FieldNus10
FROM shagmain, ShivukIndex2
WHERE MainIndexNo = 1 AND ShivukIndex2.CardNumber = @ItemNo</value>
  </data>
  <data name="CustomFieldsItemsOld" xml:space="preserve">
    <value>SELECT ShivukIndex2.CardNumber, fieldVal1, fieldVal2, fieldVal3, fieldVal4, fieldVal5, fieldVal6, fieldVal7, fieldVal8, fieldVal9, fieldVal10
FROM ShivukIndex2
LEFT JOIN ShivukIndex ON ShivukIndex.CardNumber = ShivukIndex2.CardNumber
WHERE ShivukIndex.RegDateTime &gt;= @date
ORDER BY ShivukIndex2.CardNumber</value>
  </data>
  <data name="CustomFieldsDetailsTemp" xml:space="preserve">
    <value>SELECT ShivukMismahMore.*, SHag.FieldsKot FROM ShivukMismahMore
WHERE MismahNumber = @DocNo AND MismahType = @DocType AND YearNo = @Year AND ShuraNumber = @LineNo</value>
  </data>
  <data name="CustomFieldsSum" xml:space="preserve">
    <value>SELECT IIF(FieldKot10 &lt;&gt; '', 10,
    IIF(FieldKot9 &lt;&gt; '', 9,
   IIF(FieldKot8 &lt;&gt; '', 8,
    IIF(FieldKot7 &lt;&gt; '', 7,
    IIF(FieldKot6 &lt;&gt; '', 6,
    IIF(FieldKot5 &lt;&gt; '', 5,
    IIF(FieldKot4 &lt;&gt; '', 4,
    IIF(FieldKot3 &lt;&gt; '', 3,
  IIF(FieldKot2 &lt;&gt; '', 2,
   IIF(FieldKot1 &lt;&gt; '', 1, 0))))))))))
   FROM SHagMain
    WHERE MainIndexNo = @IndexNo</value>
  </data>
  <data name="DocsDetailsOld" xml:space="preserve">
    <value>SELECT ShivukMismah.*, IIF(ParitPatur = 0, TRUE, FALSE) AS ItemMustVat, CINT(MatNumber) AS Currency_Type, MatCash AS Currency_Gate FROM ShivukMismah LEFT JOIN MainMismah ON MainMismah.MismahNumber = ShivukMismah.MismahNumber AND MainMismah.MismahType = ShivukMismah.MismahType AND MainMismah.YearNo = ShivukMismah.YearNo WHERE MainMismah.MismahNumber = @DocNo AND MainMismah.MismahType = @DocType AND MainMismah.YearNo = @Year</value>
  </data>
  <data name="Group1" xml:space="preserve">
    <value>SELECT CardNumber AS GroupNo, CardName AS GroupName FROM Group1</value>
  </data>
  <data name="Group2" xml:space="preserve">
    <value>SELECT CardNumber AS GroupNo, CardName AS GroupName FROM Group2</value>
  </data>
  <data name="HagRikoz" xml:space="preserve">
    <value>SELECT CardNumber AS GroupNo, CardName AS GroupName FROM HagRikoz</value>
  </data>
  <data name="HagStatus" xml:space="preserve">
    <value>SELECT CardNumber AS GroupNo, CardName AS GroupName FROM HagStatus</value>
  </data>
  <data name="ItemIndexByPriceList" xml:space="preserve">
    <value>SELECT 
    IIF(MakatLak&lt;&gt;'', MakatLak, ShivukIndex.Cardnumber) AS ItemNo,
    IIF(LakName&lt;&gt;'', LakName, ShivukIndex.CardName) AS ItemName,
    Loazi AS ForeignName,
    LongName,
    BarcodeX AS Barcode,
    KvuAm AS ItemGroup1,
    Group2 AS ItemGroup2,
    Group3 AS ItemGroup3,
    Group4 AS ItemGroup4,
    Mida AS MeasureUnit,
    CDbl(BuyCash) AS BuyPrice,
    CDbl(IIF(MheirLak&lt;&gt;0, MheirLak, ShivukIndex.SelCash * (1 - AhuzLak / 100))) AS SalePrice,
    Warehouse,
    Remark,
    WarePos AS WarehousePos,
    CBool(IIF(IdkunMlay = 'כן', 'TRUE', 'FALSE')) AS InventoryUpdate,
    CBool(IIF(MaamPatur = 0, 0, -1)) AS VatExempt,
    CBool(IIF(NotActive = 0, -1, 0)) AS Active,
    Mehiron.RegDateTime
FROM 
    Mehiron
LEFT JOIN 
    ShivukIndex 
    ON Mehiron.CardNumber = ShivukIndex.CardNumber
WHERE 
    Mehiron.RegDateTime &gt;= @Date
    AND Mehiron.LakNumber = @PriceList;</value>
  </data>
  <data name="ItemsIndex" xml:space="preserve">
    <value>SELECT CardNumber AS ItemNo, CardName AS ItemName, Loazi AS ForeignName, LongName, BarcodeX AS Barcode, KvuAm AS ItemGroup1, Group2 AS ItemGroup2, Group3 AS ItemGroup3, Group4 AS ItemGroup4, Mida AS MeasureUnit, CDbl(BuyCash) AS BuyPrice, CDbl(SelCash) AS SalePrice, WareHouse AS Warehouse, Remark, WarePos AS WarehousePos, Cbool(IIF(IdkunMlay = 'כן', 'TRUE', 'FALSE')) AS InventoryUpdate, Cbool(IIF(MaamPatur = 0, 0, -1)) AS VatExempt, Cbool(IIF(NotActive = 0, -1, 0)) AS Active, RegDateTime
FROM ShivukIndex
WHERE RegDateTime &gt;= @date
ORDER BY CardNumber</value>
  </data>
  <data name="ItemsIndex2" xml:space="preserve">
    <value>SELECT ShivukIndex.CardNumber AS ItemNo, ShivukIndex.CardName AS ItemName, ShivukIndex.Loazi AS ForeignName, ShivukIndex.LongName, ShivukIndex.BarcodeX AS Barcode, ShivukIndex.KvuAm AS ItemGroup1, ShivukIndex.Group2 AS ItemGroup2, ShivukIndex.Group3 AS ItemGroup3, ShivukIndex.Group4 AS ItemGroup4, ShivukIndex.Mida AS MeasureUnit, CDbl(BuyCash) AS BuyPrice, CDbl(SelCash) AS SalePrice, ShivukIndex.WareHouse AS Warehouse, ShivukIndex.Remark, ShivukIndex.WarePos AS WarehousePos, CBool(IIF(IdkunMlay = 'כן', 'TRUE', 'FALSE')) AS InventoryUpdate, CBool(IIF(MaamPatur = 0, 0, -1)) AS VatExempt, CBool(IIF(NotActive = 0, -1, 0)) AS Active, ShivukIndex.RegDateTime, ShivukIndex2.FieldVal1 AS CustomFields_1, ShivukIndex2.FieldVal2 AS CustomFields_2, ShivukIndex2.FieldVal3 AS CustomFields_3, ShivukIndex2.FieldVal4, ShivukIndex2.FieldVal5, ShivukIndex2.FieldVal6, ShivukIndex2.FieldVal7, ShivukIndex2.FieldVal8, ShivukIndex2.FieldVal9, ShivukIndex2.FieldVal10
FROM ShivukIndex LEFT JOIN ShivukIndex2 ON ShivukIndex.CardNumber = ShivukIndex2.CardNumber
WHERE RegDateTime &gt;= @date</value>
  </data>
  <data name="MainDocs" xml:space="preserve">
    <value>SELECT *,
     Format(HafakaDate &amp; ' ' &amp; Hafakatime, 'MM/dd/yyyy hh:mm:ss') AS ProductionDate,
     IIF(MismahLocked = 'סגור', 1, 0) AS isLocked,
     IIF(CancelMismah = 1, 3, IIF(MismahCondition = 'מקור', 1 ,2)) AS Status,
     MatbehNumber AS Currency_Type,
     MatbehCash AS Currency_Gate
     FROM MainMismah
         WHERE MismahNumber = @DocNo AND MismahType = @DocType AND Year = @Year</value>
  </data>
  <data name="PriceList" xml:space="preserve">
    <value>SELECT LakNumber AS CustomerNo, CardNumber AS ItemNo, MakatLak AS ItemNoExchange, LakName AS ItemNameExchange, AhuzLak AS CustomerPercent, MheirLak AS CustomerPrice, CInt(MatNo) AS CurrencyNo, RegDateTime FROM Mehiron WHERE RegDateTime&gt;=@date</value>
  </data>
  <data name="Inventory" xml:space="preserve">
    <value>SELECT ShivukMismah.WareHouse, ShivukMismah.ParitNumber AS ItemNo, ShivukIndex.Mida as MeasureUnit,
CDBL(SUM(iif(NOT(ShivukMismah.MismahIDNumber = 500 AND ShivukMismah.Transfer = 0), ShivukMismah.MlayValueIN, 0))) as InventoryIn,
CDBL(SUM(iif(NOT(ShivukMismah.MismahIDNumber = 100 AND ShivukMismah.Transfer = 0), ShivukMismah.MlayValueOUT, 0))) as InventoryOut ,
CDBL(SUM(iif(ShivukMismah.MismahIDNumber = 500 AND ShivukMismah.Transfer = 0, ShivukMismah.MlayValueIN2, 0))) as FutureInventoryIn,
CDBL(SUM(iif(ShivukMismah.MismahIDNumber = 100 AND ShivukMismah.Transfer = 0, ShivukMismah.MlayValueOUT2, 0))) as FutureInventoryOut
FROM ((ShivukMismah
LEFT JOIN ShivukIndex
ON ShivukMismah.ParitNumber = ShivukIndex.CardNumber)
LEFT JOIN MainMismah
ON (ShivukMismah.MismahNumber = MainMismah.MismahNumber) AND (ShivukMismah.MismahType = MainMismah.MismahType) AND (ShivukMismah.YearNo = MainMismah.YearNo))
{WHERE}
{GROUPBY}
{ORDERBY}</value>
  </data>
  <data name="Round" xml:space="preserve">
    <value>SELECT MismahID AS DocumentName, MismahIDNumber AS DocumentNumber, FormatDisplay AS tmpAmountFormat, FormatCash AS tmpSumFormat, Hagala AS tmpDocFormat FROM HgdarotMismah WHERE MismahID = @docName</value>
  </data>
  <data name="DateCredit" xml:space="preserve">
    <value>SELECT DateValue(Str(IIF(CreditDay = 0, 1, CreditDay)) &amp; Str(IIF(CurMonth &lt;&gt; 0,  Month(Now()) + 1, IIF(Month(Now()) + 1 = 13, 1, Month(Now())))) &amp; Str(IIF(Month(Now()) = 12 , IIF(CurMonth = 0, Year(Now()) + 1, Year(Now())), Year(Now())))) AS CreditDate FROM CreditDay WHERE CreditNumber = @SolekNo AND FirstDay &lt;= @Day AND EndDay &gt;= @Day</value>
  </data>
  <data name="ShivukGroupParit" xml:space="preserve">
    <value>SELECT CardNumber AS GroupNo, CardName AS GroupName FROM ShivukGroupParit</value>
  </data>
  <data name="ShivukGroup2" xml:space="preserve">
    <value>SELECT GroupNo, GroupName FROM ShivukGroup2</value>
  </data>
  <data name="ShivukGroup3" xml:space="preserve">
    <value>SELECT GroupNo, GroupName FROM ShivukGroup3</value>
  </data>
  <data name="ShivukGroup4" xml:space="preserve">
    <value>SELECT GroupNo, GroupName FROM ShivukGroup4</value>
  </data>
  <data name="GetMainDocs" xml:space="preserve">
    <value>SELECT
    MainMismah.MismahNumber AS DocNo,
    MainMismah.MismahIDNumber AS DocType,
    MainMismah.MismahType AS DocTypeName,
    MainMismah.DateAspaka AS DeliveryDate,
    MainMismah.MismahDate AS DocDate,
    MainMismah.MisloahYad AS ManualNo,
    MainMismah.LakouahCod AS CustomerNo,
    MainMismah.LakouahName AS CustomerName,
    MainMismah.Street AS CustomerStreet,
    MainMismah.City AS CustomerCity,
    MainMismah.Mikud AS CustomerZipCode,
    MainMismah.Tel1 AS CustomerPhone,
    MainMismah.MaamAhuz AS VatPercent,
    MainMismah.TotalMismah AS Price,
    MainMismah.DocPercent AS DiscountPercent,
    MainMismah.MatbehCash AS Currency_Gate,
    MainMismah.MatbehNumber AS Currency_Type,
    IIF(MainMismah.MismahLocked = 'סגור', 1, 0) AS isLocked,
    IIF(MainMismah.CancelMismah = 1, 3, IIF(MainMismah.MismahCondition = 'מקור', 1 ,2)) AS Status,
    MainMismah.MefikName AS ProduceName,
    MainMismah.ReMark1 AS Remark,
    MainMismah.FreeText1 AS FreeTxt,
    MainMismah.Freelbl1 AS FreeLbl,    
    MainMismah.LakouahNumber AS SortingNo,    
    MainMismah.MisloahName AS DeliveryTo,
    MainMismah.DriverNumber AS DriverNo,
    MainMismah.DocPath AS AttachmentPath,
    MainMismah.Sochen AS Agent,
    MainMismah.PaidWithHoraatKeva AS PaidWithDirectDebit,
    MainMismah.HoraatKevaMismah AS DirectDebitDoc,
    MainMismah.KodCity AS BudgetCityNo,
    MainMismah.KodTakziv AS BudgetNo
FROM
    MainMismah
{JOIN}
WHERE 
    MainMismah.MismahType = @DocTypeName AND
    MainMismah.YearNo  = @Year AND
    MainMismah.MismahDate BETWEEN @FromDate AND @ToDate
    {WHERE}
ORDER BY 
    MainMismah.MismahNumber</value>
  </data>
  <data name="Receipt" xml:space="preserve">
    <value>SELECT
MismahNumber AS DocNo,
ShuraNumber AS LineNo,
(CashMezuman + CashShek + CashCredit) AS [Sum],
DateChk AS [Date],
MadNumber AS Currency_Type,
MadCash AS Currency_Gate,
ShekNumber AS [Number],
Snif AS Branch,
HenNumber AS Account,
CreditType AS [TransactionType],
BankHafkada AS Bank,
IIf(ShuraType = 'מ', 'Receipt', IIf(ShuraType = 'ש', 'Cheque', IIf(ShuraType = 'א', 'Credit', IIf(ShuraType = 'ה', 'EFT', '')))) AS Type
FROM 
ShekINF
WHERE
SugMismah = @DocType AND MismahNumber = @DocNo</value>
  </data>
  <data name="GetDocsDetails" xml:space="preserve">
    <value>SELECT 
    MismahNumber AS DocNo,
    ShuraNumber AS LineNo,
    Amount,
    ParitNumber AS ItemNo,
    ParitName AS ItemName,
    Cash AS PriceUnit,
    HanahaAhuz AS DiscountPercent,
    TotalShura AS Price,
    WareHouse,
    IIf(ParitPatur = 0, True, False) AS ItemMustVat,
    MatCash AS Currency_Gate,
    MatNumber AS Currency_Type
FROM 
    ShivukMismah
WHERE
    MismahType = @DocTypeName AND YearNo = @Year</value>
  </data>
  <data name="ReceiptDoc" xml:space="preserve">
    <value>SELECT 
MismahNumber AS DocNo,
SugMismah,
HafkadaDate AS ProductionDate,
HafakaDate AS DocDate,
MismahYad AS ManualNo,
CardNumber AS CustomerNo,
CardName AS CustomerName,
Street AS CustomerStreet,
City AS CustomerCity,
Mikud AS CustomerZipCode,
Tel1 AS CustomerPhone,
CashTotal AS Price,
HafakaName AS ProduceName,
ReMark1 AS Remark,
FreeText1 AS FreeTxt,
Freelbl1 AS FreeLbl,
SPKupaNumber AS SpNo,
SPZCloseNumber AS SpZCloseNo,
Sochen AS Agent
FROM
MainShek
WHERE
SugMismah = @DocType AND
MismahNumber = @DocNo</value>
  </data>
  <data name="CustomFieldsDetails" xml:space="preserve">
    <value>SELECT MismahNumber AS DocNo, ShuraNumber AS LineNo,
    IIf(fieldKot1 IS NOT NULL AND fieldKot1 &lt;&gt; '', fieldKot1, NULL) AS Kot1,
    fieldVal1 AS Val1,
    FieldNus1 AS Nus1,    
    IIf(fieldKot2 IS NOT NULL AND fieldKot2 &lt;&gt; '', fieldKot2, NULL) AS Kot2,
    fieldVal2 AS Val2,
    FieldNus2 AS Nus2,    
    IIf(fieldKot3 IS NOT NULL AND fieldKot3 &lt;&gt; '', fieldKot3, NULL) AS Kot3,
    fieldVal3 AS Val3,
    FieldNus3 AS Nus3,    
    IIf(fieldKot4 IS NOT NULL AND fieldKot4 &lt;&gt; '', fieldKot4, NULL) AS Kot4,
    fieldVal4 AS Val4,
    FieldNus4 AS Nus4,    
    IIf(fieldKot5 IS NOT NULL AND fieldKot5 &lt;&gt; '', fieldKot5, NULL) AS Kot5,
    fieldVal5 AS Val5,
    FieldNus5 AS Nus5,    
    IIf(fieldKot6 IS NOT NULL AND fieldKot6 &lt;&gt; '', fieldKot6, NULL) AS Kot6,
    fieldVal6 AS Val6,
    FieldNus6 AS Nus6,    
    IIf(fieldKot7 IS NOT NULL AND fieldKot7 &lt;&gt; '', fieldKot7, NULL) AS Kot7,
    fieldVal7 AS Val7,
    FieldNus7 AS Nus7,    
    IIf(fieldKot8 IS NOT NULL AND fieldKot8 &lt;&gt; '', fieldKot8, NULL) AS Kot8,
    fieldVal8 AS Val8,
    FieldNus8 AS Nus8,    
    IIf(fieldKot9 IS NOT NULL AND fieldKot9 &lt;&gt; '', fieldKot9, NULL) AS Kot9,
    fieldVal9 AS Val9,
    FieldNus9 AS Nus9,    
    IIf(fieldKot10 IS NOT NULL AND fieldKot10 &lt;&gt; '', fieldKot10, NULL) AS Kot10,
    fieldVal10 AS Val10,
    FieldNus10 AS Nus10
FROM shagmain, ShivukMismahMore
WHERE SHagMain.MainIndexNo = @IndexNo
  AND MismahType = @DocTypeName 
  AND YearNo = @Year;</value>
    <comment>שדות נוספים בפריטים - DocsDetails.AddFld הטבלה - ShivukMismahMore</comment>
  </data>
  <data name="CustomFieldsMain" xml:space="preserve">
    <value>SELECT MismahNumber AS DocNo,
    IIf(fieldKot1 IS NOT NULL AND fieldKot1 &lt;&gt; '', fieldKot1, NULL) AS Kot1,
    {{PREFIX}}FieldVal1 AS Val1,
    {{PREFIX}}FieldNus1 AS Nus1,  
    IIf(fieldKot2 IS NOT NULL AND fieldKot2 &lt;&gt; '', fieldKot2, NULL) AS Kot2,
    {{PREFIX}}FieldVal2 AS Val2,
    {{PREFIX}}FieldNus2 AS Nus2,    
    IIf(fieldKot3 IS NOT NULL AND fieldKot3 &lt;&gt; '', fieldKot3, NULL) AS Kot3,
    {{PREFIX}}FieldVal3 AS Val3,
    {{PREFIX}}FieldNus3 AS Nus3,    
    IIf(fieldKot4 IS NOT NULL AND fieldKot4 &lt;&gt; '', fieldKot4, NULL) AS Kot4,
    {{PREFIX}}FieldVal4 AS Val4,
    {{PREFIX}}FieldNus4 AS Nus4,    
    IIf(fieldKot5 IS NOT NULL AND fieldKot5 &lt;&gt; '', fieldKot5, NULL) AS Kot5,
    {{PREFIX}}FieldVal5 AS Val5,
    {{PREFIX}}FieldNus5 AS Nus5,    
    IIf(fieldKot6 IS NOT NULL AND fieldKot6 &lt;&gt; '', fieldKot6, NULL) AS Kot6,
    {{PREFIX}}FieldVal6 AS Val6,
    {{PREFIX}}FieldNus6 AS Nus6,    
    IIf(fieldKot7 IS NOT NULL AND fieldKot7 &lt;&gt; '', fieldKot7, NULL) AS Kot7,
    {{PREFIX}}FieldVal7 AS Val7,
    {{PREFIX}}FieldNus7 AS Nus7,    
    IIf(fieldKot8 IS NOT NULL AND fieldKot8 &lt;&gt; '', fieldKot8, NULL) AS Kot8,
    {{PREFIX}}FieldVal8 AS Val8,
    {{PREFIX}}FieldNus8 AS Nus8,    
    IIf(fieldKot9 IS NOT NULL AND fieldKot9 &lt;&gt; '', fieldKot9, NULL) AS Kot9,
    {{PREFIX}}FieldVal9 AS Val9,
    {{PREFIX}}FieldNus9 AS Nus9,    
    IIf(fieldKot10 IS NOT NULL AND fieldKot10 &lt;&gt; '', fieldKot10, NULL) AS Kot10,
    {{PREFIX}}FieldVal10 AS Val10,
    {{PREFIX}}FieldNus10 AS Nus10
FROM SHagMain, MainMismahMore2
WHERE shagmain.MainIndexNo = @IndexNo 
  AND MainMismahMore2.MismahType = @DocTypeName 
  AND MainMismahMore2.YearNo = @Year;</value>
    <comment>שדות נוספים במסמך - MainDocs.CustomFields | CustomFieldsPrint | CustomFieldsCard הטבלה - MainMismahMore2</comment>
  </data>
  <data name="DocsDetails" xml:space="preserve">
    <value>SELECT ShivukMismah.*, IIF(ParitPatur = 0, True, False) AS ItemMustVat, CINT(MatNumber) AS Currency_Type, MatCash AS Currency_Gate FROM ShivukMismah WHERE MismahNumber = @DocNo AND MismahType = @DocType AND YearNo = @Year</value>
  </data>
  <data name="TreeSubDetailsWithPrices" xml:space="preserve">
    <value>SELECT ShivukIndex.CardNumber AS ItemNo, ShivukIndex.CardName AS ItemName, ProdactionINF.Kamut AS Amount, ShivukIndex.SelCash AS PriceUnit, ProdactionINF.Kamut * ShivukIndex.BuyCash AS Price, ProdactionINF.AhuzRevach AS DiscountPercent, ProdactionINF.Warehouse, IIF(RootParit = 'כ', 1, 0) AS ItemTree
FROM ShivukIndex
INNER JOIN ProdactionINF
ON ShivukIndex.CardNumber = ProdactionINF.ParitNumber
WHERE ProdactionINF.MainParitNumber = @ItemNo</value>
    <comment>בנים בעץ מוצר כולל מחירים</comment>
  </data>
  <data name="TreeSubDetails" xml:space="preserve">
    <value>SELECT ShivukIndex.CardNumber AS ItemNo, ShivukIndex.CardName AS ItemName, ProdactionINF.Kamut AS Amount, IIF(ShivukIndex.RootParit = 'כ', 1, 0) AS ItemTree
FROM ShivukIndex
INNER JOIN ProdactionINF
ON ShivukIndex.CardNumber = ProdactionINF.ParitNumber
WHERE ProdactionINF.MainParitNumber = @ItemNo</value>
    <comment>בנים בעץ מוצר</comment>
  </data>
  <data name="tmp" xml:space="preserve">
    <value>SELECT MainMismah.*,  MismahNumber AS DocNo,
    IIf(fieldKot1 IS NOT NULL AND fieldKot1 &lt;&gt; '', fieldKot1, NULL) AS Kot1,
    {{PREFIX}}FieldVal1 AS Val1,
    {{PREFIX}}FieldNus1 AS Nus1,  
    IIf(fieldKot2 IS NOT NULL AND fieldKot2 &lt;&gt; '', fieldKot2, NULL) AS Kot2,
    {{PREFIX}}FieldVal2 AS Val2,
    {{PREFIX}}FieldNus2 AS Nus2,    
    IIf(fieldKot3 IS NOT NULL AND fieldKot3 &lt;&gt; '', fieldKot3, NULL) AS Kot3,
    {{PREFIX}}FieldVal3 AS Val3,
    {{PREFIX}}FieldNus3 AS Nus3,    
    IIf(fieldKot4 IS NOT NULL AND fieldKot4 &lt;&gt; '', fieldKot4, NULL) AS Kot4,
    {{PREFIX}}FieldVal4 AS Val4,
    {{PREFIX}}FieldNus4 AS Nus4,    
    IIf(fieldKot5 IS NOT NULL AND fieldKot5 &lt;&gt; '', fieldKot5, NULL) AS Kot5,
    {{PREFIX}}FieldVal5 AS Val5,
    {{PREFIX}}FieldNus5 AS Nus5,    
    IIf(fieldKot6 IS NOT NULL AND fieldKot6 &lt;&gt; '', fieldKot6, NULL) AS Kot6,
    {{PREFIX}}FieldVal6 AS Val6,
    {{PREFIX}}FieldNus6 AS Nus6,    
    IIf(fieldKot7 IS NOT NULL AND fieldKot7 &lt;&gt; '', fieldKot7, NULL) AS Kot7,
    {{PREFIX}}FieldVal7 AS Val7,
    {{PREFIX}}FieldNus7 AS Nus7,    
    IIf(fieldKot8 IS NOT NULL AND fieldKot8 &lt;&gt; '', fieldKot8, NULL) AS Kot8,
    {{PREFIX}}FieldVal8 AS Val8,
    {{PREFIX}}FieldNus8 AS Nus8,    
    IIf(fieldKot9 IS NOT NULL AND fieldKot9 &lt;&gt; '', fieldKot9, NULL) AS Kot9,
    {{PREFIX}}FieldVal9 AS Val9,
    {{PREFIX}}FieldNus9 AS Nus9,    
    IIf(fieldKot10 IS NOT NULL AND fieldKot10 &lt;&gt; '', fieldKot10, NULL) AS Kot10,
    {{PREFIX}}FieldVal10 AS Val10,
    {{PREFIX}}FieldNus10 AS Nus10
FROM SHagMain, MainMismahMore2
LEFT JOIN MainMismah
ON MainMismah.MismahNumber = MainMismahMore2.MismahNumber
WHERE shagmain.MainIndexNo = @IndexNo 
  AND MainMismahMore2.MismahType = @DocTypeName 
  AND MainMismahMore2.YearNo = @Yea</value>
    <comment>ניסיון לקבלת המסמכים לפי תנאי על השדות הנוספים</comment>
  </data>
  <data name="CustomFieldsItems" xml:space="preserve">
    <value>SELECT 
    ShivukIndex2.CardNumber,
    ShivukIndex2.fieldVal1,
    ShivukIndex2.fieldVal2,
    ShivukIndex2.fieldVal3,
    ShivukIndex2.fieldVal4,
    ShivukIndex2.fieldVal5,
    ShivukIndex2.fieldVal6,
    ShivukIndex2.fieldVal7,
    ShivukIndex2.fieldVal8,
    ShivukIndex2.fieldVal9,
    ShivukIndex2.fieldVal10
FROM 
    ShivukIndex2
LEFT JOIN 
    Mehiron 
    ON Mehiron.CardNumber = ShivukIndex2.CardNumber
WHERE 
    Mehiron.RegDateTime &gt;= @Date
    AND Mehiron.LakNumber = @PriceList
ORDER BY 
    ShivukIndex2.CardNumber;</value>
    <comment>קבלת שדות נוספים לפריטים לפי מחירון בשימוש דרך ItemsByPriceList. (אחרי באג בשאלתה Old שעבדה עם RegDateTime של אינדקס פריטים במקום של מחירון)</comment>
  </data>
</root>