File: D:/MariaDB Data/hyperflight/reports.MYD
� ^�B�,�
Stock Listing � # (SS,CGPT,27/5/26) modified to add supplier, also to allow blank product code to select all
SELECT
p.*,
s.SupplierName,
REVERSE(LPAD(CAST(p.ProductID AS CHAR), GREATEST(LENGTH(p.ProductID), 4), "0")) AS PickID
FROM products p
LEFT JOIN suppliers s
ON s.SupplierID = p.SupplierID
WHERE
p.ProductDisabled = FALSE
AND (
("[STARTCODE]" = "" AND "[ENDCODE]" = "")
OR ("[STARTCODE]" = "" AND p.ProductCode <= "[ENDCODE]")
OR ("[ENDCODE]" = "" AND p.ProductCode >= "[STARTCODE]")
OR (p.ProductCode >= "[STARTCODE]" AND p.ProductCode <= "[ENDCODE]")
)
AND (
"[SUPPLIER]" = ""
OR s.SupplierName = "[SUPPLIER]"
)
ORDER BY
p.Location, p.ProductCode;� <?xml version="1.0" encoding="utf-8"?>
<TfrxReport Version="4.15.13" DotMatrixReport="False" IniFile="\Software\Fast Reports" PreviewOptions.AllowEdit="False" PreviewOptions.Buttons="1465" PreviewOptions.Zoom="1" PrintOptions.Printer="Default" PrintOptions.PrintOnSheet="0" ReportOptions.Compressed="True" ReportOptions.CreateDate="39024.4955783102" ReportOptions.Description.Text="" ReportOptions.LastChange="46169.7347486458" ScriptLanguage="PascalScript" ScriptText.Text="begin end." PropData="044C656674022C03546F70021408446174617365747301010C1E00000020446174615365743D2264732220446174615365744E616D653D226473220000095661726961626C657301010C16000000204E616D653D2220495450207661726961626C65732200010C21000000204E616D653D227374725265706F72745469746C65222056616C75653D2227272200010C24000000204E616D653D227374725265706F72745375627469746C65222056616C75653D2227272200010C29000000204E616D653D22737472557365724E616D65222056616C75653D22276879706572666C69676874272200010C1E000000204E616D653D227374724D65737361676531222056616C75653D2227272200010C1E000000204E616D653D227374724D65737361676532222056616C75653D2227272200010C1F000000204E616D653D22746B6E5354415254434F4445222056616C75653D2227272200010C1D000000204E616D653D22746B6E454E44434F4445222056616C75653D2227272200010C24000000204E616D653D22737472456D61696C5369676E6174757265222056616C75653D2227272200010C28000000204E616D653D22737472456D61696C5369676E617475726548544D4C222056616C75653D2227272200010C1E000000204E616D653D22746B6E535550504C494552222056616C75653D222727220000055374796C650100">
<TfrxDataPage Name="Data" Height="1000" Left="0" Top="0" Width="1000"/>
<TfrxReportPage Name="Page1" PaperWidth="210" PaperHeight="297" PaperSize="9" LeftMargin="5" RightMargin="5" TopMargin="5" BottomMargin="5" ColumnWidth="0" ColumnPositions.Text="" HGuides.Text="" VGuides.Text="">
<TfrxPageHeader Name="PageHeader1" Height="64.25201" Left="0" Top="18.89765" Width="755.906">
<TfrxMemoView Name="Memo7" Left="0" Top="0" Width="396.40167" Height="27.77953" ShowHint="False" DisplayFormat.DecimalSeparator="." DisplayFormat.Kind="fkDateTime" Font.Charset="1" Font.Color="0" Font.Height="-21" Font.Name="Arial" Font.Style="1" ParentFont="False" Text="HyperFlight Stock List"/>
<TfrxMemoView Name="Memo1" Left="52.91342" Top="34.01577" Width="173.85838" Height="18.89765" ShowHint="False" DisplayFormat.DecimalSeparator="." Font.Charset="1" Font.Color="-16777208" Font.Height="-13" Font.Name="Arial" Font.Style="1" Frame.Typ="8" ParentFont="False" Text="Product Code"/>
<TfrxMemoView Name="Memo2" Left="445.98454" Top="34.01577" Width="309.92146" Height="18.89765" ShowHint="False" DisplayFormat.DecimalSeparator="." Font.Charset="1" Font.Color="-16777208" Font.Height="-13" Font.Name="Arial" Font.Style="1" Frame.Typ="8" ParentFont="False" Text="Product Name"/>
<TfrxMemoView Name="Memo3" Left="234.33086" Top="34.01577" Width="79.37013" Height="18.89765" ShowHint="False" Font.Charset="1" Font.Color="-16777208" Font.Height="-13" Font.Name="Arial" Font.Style="1" Frame.Typ="8" HAlign="haCenter" ParentFont="False" Text="Location"/>
<TfrxMemoView Name="Memo6" Left="321.26005" Top="34.01577" Width="60.47248" Height="18.89765" ShowHint="False" DisplayFormat.DecimalSeparator="." Font.Charset="1" Font.Color="-16777208" Font.Height="-13" Font.Name="Arial" Font.Style="1" Frame.Typ="8" HAlign="haCenter" ParentFont="False" Text="Stock"/>
<TfrxMemoView Name="Memo13" Left="0" Top="34.01577" Width="49.13389" Height="18.89765" ShowHint="False" DisplayFormat.DecimalSeparator="." Font.Charset="1" Font.Color="-16777208" Font.Height="-13" Font.Name="Arial" Font.Style="1" Frame.Typ="8" ParentFont="False" Text="Pick ID"/>
<TfrxMemoView Name="tknSUPPLIER" Left="415.7483" Top="0" Width="340.1577" Height="22.67718" ShowHint="False" Font.Charset="1" Font.Color="-16777208" Font.Height="-19" Font.Name="Arial" Font.Style="1" HAlign="haRight" ParentFont="False" Text="[tknSUPPLIER]"/>
<TfrxMemoView Name="Memo4" Left="389.29159" Top="34.01577" Width="49.13389" Height="18.89765" ShowHint="False" Font.Charset="1" Font.Color="-16777208" Font.Height="-11" Font.Name="Arial Narrow" Font.Style="1" Frame.Typ="8" HAlign="haRight" ParentFont="False" Text="Correction"/>
</TfrxPageHeader>
<TfrxMasterData Name="MasterData1" Height="26.45671" Left="0" Top="143.62214" Width="755.906" ColumnWidth="0" ColumnGap="0" DataSet="ds" DataSetName="ds" RowCount="0">
<TfrxMemoView Name="dsProductCode" Left="52.91342" Top="0" Width="188.9765" Height="18.89765" ShowHint="False" DataField="ProductCode" DataSet="ds" DataSetName="ds" Font.Charset="1" Font.Color="-16777208" Font.Height="-13" Font.Name="Arial" Font.Style="0" ParentFont="False" Text="[ds."ProductCode"]"/>
<TfrxMemoView Name="dsSalePrice" Left="234.33086" Top="0" Width="79.37013" Height="18.89765" ShowHint="False" DataSet="ds" DataSetName="ds" DisplayFormat.DecimalSeparator="." Font.Charset="1" Font.Color="-16777208" Font.Height="-13" Font.Name="Arial" Font.Style="0" HAlign="haCenter" ParentFont="False" Text="[ds."Location"]"/>
<TfrxMemoView Name="Memo10" Left="321.26005" Top="0" Width="60.47248" Height="18.89765" ShowHint="False" DataField="NumInStock" DataSet="ds" DataSetName="ds" DisplayFormat.DecimalSeparator="." DisplayFormat.FormatStr="%g" DisplayFormat.Kind="fkNumeric" Font.Charset="1" Font.Color="-16777208" Font.Height="-13" Font.Name="Arial" Font.Style="1" HAlign="haCenter" ParentFont="False" Text="[ds."NumInStock"]"/>
<TfrxMemoView Name="dsProductName" Left="445.98454" Top="0" Width="309.92146" Height="18.89765" ShowHint="False" DataField="ProductName" DataSet="ds" DataSetName="ds" Font.Charset="1" Font.Color="-16777208" Font.Height="-13" Font.Name="Arial" Font.Style="0" ParentFont="False" Text="[ds."ProductName"]"/>
<TfrxMemoView Name="Memo8" Left="0" Top="0" Width="49.13389" Height="18.89765" ShowHint="False" DataField="PickID" DataSet="ds" DataSetName="ds" Font.Charset="1" Font.Color="-16777208" Font.Height="-13" Font.Name="Arial" Font.Style="1" ParentFont="False" Text="[ds."PickID"]"/>
<TfrxLineView Name="Line1" Left="0" Top="22.67718" Width="755.906" Height="0" ShowHint="False" Frame.Color="10789024" Frame.Typ="4"/>
</TfrxMasterData>
<TfrxPageFooter Name="PageFooter1" Height="16.22047" Left="0" Top="230.55133" Width="755.906">
<TfrxMemoView Name="Memo9" Left="616.06339" Top="0" Width="141" Height="16.22047" ShowHint="False" StretchMode="smMaxHeight" Font.Charset="1" Font.Color="0" Font.Height="-13" Font.Name="Times New Roman" Font.Style="2" HAlign="haRight" ParentFont="False" Text="Page [Page#] of [TotalPages#]"/>
<TfrxMemoView Name="Memo12" Left="0" Top="0&�@�,� Stock Valuation
� SELECT * FROM products p
LEFT JOIN suppliers s ON s.SupplierID = p.SupplierID
WHERE ProductDisabled = FALSE AND NumInStock <> 0
ORDER BY SupplierName, ProductCode�% <?xml version="1.0" encoding="utf-8"?>
<TfrxReport Version="4.9" DotMatrixReport="False" IniFile="\Software\Fast Reports" PreviewOptions.AllowEdit="False" PreviewOptions.Buttons="4087" PreviewOptions.Zoom="1" PrintOptions.Printer="Default" PrintOptions.PrintOnSheet="0" ReportOptions.Compressed="True" ReportOptions.CreateDate="39024.4955783102" ReportOptions.Description.Text="" ReportOptions.LastChange="40527.5752611343" ScriptLanguage="PascalScript" ScriptText.Text="begin end." PropData="044C656674022C03546F70021408446174617365747301010C1E00000020446174615365743D2264732220446174615365744E616D653D226473220000095661726961626C657301010C16000000204E616D653D2220495450207661726961626C65732200010C21000000204E616D653D227374725265706F72745469746C65222056616C75653D2227272200010C24000000204E616D653D227374725265706F72745375627469746C65222056616C75653D2227272200010C29000000204E616D653D22737472557365724E616D65222056616C75653D22276879706572666C69676874272200010C1E000000204E616D653D227374724D65737361676531222056616C75653D2227272200010C1E000000204E616D653D227374724D65737361676532222056616C75653D2227272200010C22000000204E616D653D22746B6E5354415254434F4445222056616C75653D2227415641272200010C2D000000204E616D653D22746B6E454E44434F4445222056616C75653D22274156412D42414C4C4153542D5455424527220000055374796C650100">
<TfrxDataPage Name="Data" Height="1000" Left="0" Top="0" Width="1000"/>
<TfrxReportPage Name="Page1" PaperWidth="210" PaperHeight="297" PaperSize="9" LeftMargin="15" RightMargin="10" TopMargin="10" BottomMargin="10" ColumnWidth="0" ColumnPositions.Text="" HGuides.Text="" VGuides.Text="">
<TfrxPageHeader Name="PageHeader1" Height="75.5906" Left="0" Top="18.89765" Width="699.21305">
<TfrxMemoView Name="Memo7" Left="0" Top="0" Width="672.30736" Height="42.89765" ShowHint="False" DisplayFormat.DecimalSeparator="." DisplayFormat.Kind="fkDateTime" Font.Charset="1" Font.Color="0" Font.Height="-32" Font.Name="@Arial Unicode MS" Font.Style="1" ParentFont="False" Text="HyperFlight Stock Valuation"/>
<TfrxMemoView Name="Memo1" Left="0" Top="49.13389" Width="143.62214" Height="18.89765" ShowHint="False" DisplayFormat.DecimalSeparator="." Font.Charset="1" Font.Color="-16777208" Font.Height="-13" Font.Name="Arial" Font.Style="1" Frame.Typ="8" ParentFont="False" Text="Product Code"/>
<TfrxMemoView Name="Memo2" Left="143.62214" Top="49.13389" Width="257.00804" Height="18.89765" ShowHint="False" DisplayFormat.DecimalSeparator="." Font.Charset="1" Font.Color="-16777208" Font.Height="-13" Font.Name="Arial" Font.Style="1" Frame.Typ="8" ParentFont="False" Text="Product Name"/>
<TfrxMemoView Name="Memo3" Left="480.00031" Top="49.13389" Width="79.37013" Height="18.89765" ShowHint="False" DisplayFormat.DecimalSeparator="." Font.Charset="1" Font.Color="-16777208" Font.Height="-13" Font.Name="Arial" Font.Style="1" Frame.Typ="8" HAlign="haRight" ParentFont="False" Text="Price"/>
<TfrxMemoView Name="Memo4" Left="616.06339" Top="49.13389" Width="71.81107" Height="18.89765" ShowHint="False" DisplayFormat.DecimalSeparator="." Font.Charset="1" Font.Color="-16777208" Font.Height="-13" Font.Name="Arial" Font.Style="1" Frame.Typ="8" HAlign="haRight" ParentFont="False" Text="Valuation"/>
<TfrxMemoView Name="Memo6" Left="559.37044" Top="49.13389" Width="56.69295" Height="18.89765" ShowHint="False" DisplayFormat.DecimalSeparator="." Font.Charset="1" Font.Color="-16777208" Font.Height="-13" Font.Name="Arial" Font.Style="1" Frame.Typ="8" HAlign="haRight" ParentFont="False" Text="Stock"/>
<TfrxMemoView Name="Memo8" Left="400.63018" Top="49.13389" Width="79.37013" Height="18.89765" ShowHint="False" DisplayFormat.DecimalSeparator="." Font.Charset="1" Font.Color="-16777208" Font.Height="-13" Font.Name="Arial" Font.Style="1" Frame.Typ="8" HAlign="haRight" ParentFont="False" Text="Cost Price"/>
</TfrxPageHeader>
<TfrxMasterData Name="MasterData1" Height="22.67718" Left="0" Top="207.87415" Width="699.21305" ColumnWidth="0" ColumnGap="0" DataSet="ds" DataSetName="ds" RowCount="0" Stretched="True">
<TfrxMemoView Name="dsProductCode" Left="0" Top="0" Width="143.62214" Height="18.89765" ShowHint="False" DataField="ProductCode" DataSet="ds" DataSetName="ds" Font.Charset="1" Font.Color="-16777208" Font.Height="-11" Font.Name="Arial" Font.Style="0" ParentFont="False" Text="[ds."ProductCode"]"/>
<TfrxMemoView Name="dsSalePrice" Left="480.00031" Top="0" Width="79.37013" Height="18.89765" ShowHint="False" DataSet="ds" DataSetName="ds" DisplayFormat.DecimalSeparator="." DisplayFormat.FormatStr="%2.2m" DisplayFormat.Kind="fkNumeric" Font.Charset="1" Font.Color="-16777208" Font.Height="-13" Font.Name="Arial" Font.Style="0" HAlign="haRight" ParentFont="False" Text="[IIF(<ds."SalePrice"> > 0,<ds."SalePrice">,<ds."StdPrice">)]"/>
<TfrxMemoView Name="dsNumInStock" Left="616.06339" Top="0" Width="75.5906" Height="18.89765" ShowHint="False" DataSet="ds" DataSetName="ds" DisplayFormat.DecimalSeparator="." DisplayFormat.FormatStr="%2.2m" DisplayFormat.Kind="fkNumeric" Font.Charset="1" Font.Color="-16777208" Font.Height="-13" Font.Name="Arial" Font.Style="0" HAlign="haRight" ParentFont="False" Text="[<ds."NumInStock">*<ds."CostPrice">]"/>
<TfrxMemoView Name="Memo10" Left="559.37044" Top="0" Width="56.69295" Height="18.89765" ShowHint="False" DataField="NumInStock" DataSet="ds" DataSetName="ds" DisplayFormat.DecimalSeparator="." DisplayFormat.FormatStr="%g" DisplayFormat.Kind="fkNumeric" Font.Charset="1" Font.Color="-16777208" Font.Height="-13" Font.Name="Arial" Font.Style="0" HAlign="haRight" ParentFont="False" Text="[ds."NumInStock"]"/>
<TfrxMemoView Name="dsProductName" Left="143.62214" Top="0" Width="257.00804" Height="18.89765" ShowHint="False" StretchMode="smActualHeight" DataField="ProductName" DataSet="ds" DataSetName="ds" Font.Charset="1" Font.Color="-16777208" Font.Height="-11" Font.Name="Arial" Font.Style="0" ParentFont="False" Text="[ds."ProductName"]"/>
<TfrxMemoView Name="Memo5" Left="400.63018" Top="0" Width="79.37013" Height="18.89765" ShowHint="False" DataField="CostPrice" DataSet="ds" DataSetName="ds" DisplayFormat.DecimalSeparator="." DisplayFormat.FormatStr="%2.2m" DisplayFormat.Kind="fkNumeric" Font.Charset="1" Font.Color="-16777208" Font.Height="-13" Font.Name="Arial" Font.Style="0" HAlign="haRight" ParentFont="False" Text="[ds."CostPrice"]"/>
</TfrxMasterData>
<TfrxPageFooter Name="PageFooter1" Height="24" Left="0" Top="400.63018" Width="699.21305">
<TfrxMemoView Name="Memo9" Left="551.81138" Top="0" Width="141" Height="20" ShowHint="False" StretchMode="smMaxHeight" Font.Charset="1" Font.Color="0" Font.Height="-13" Font.Name="Times New Roman" Font.Style="2" HAlign="haRight" ParentFont="False" Text="Page [Page#] of [TotalPages#]"/>
<TfrxMemoView Name="Memo12" Left="0" Top="0" Width="156.96846" Height="20" ShowHint="False" StretchMode="smMaxHeight" Font.Charset="1" Font.Color="0" Font.Height="-13" Font.Name="Times New Roman" Font.Style="2" ParentFont="False" Text="[<DATE>] [FORMATDATETIME('h:mm am/pm', <TIME>)]"/>
</TfrxPageFooter>
<TfrxReportSummary Name="ReportSummary1" Height="37.7953" Left="0" Top="340.1577" Width="699.21305">
<TfrxMemoView Name="Memo11" Left="612.28386" Top="18.89765" Width="79.37013" Height="18.89765" ShowHint="False" DataSet="ds" DataSetName="ds" DisplayFormat.DecimalSeparator="." DisplayFormat.FormatStr="%2.2m" DisplayFormat.Kind="fkNumeric" Font.Charset="1" Font.Color="-16777208" Font.Height="-13" Font.Name="Arial" Font.Style="2" HAlign="haRight" ParentFont="False" Text="[sum(<ds."NumInStock">*<ds."CostPrice">)]"/>
<TfrxMemoView Name="Memo15" Left="317.48052" Top="18.89765" Width="294.80334" Height="18.89765" ShowHint="False" DataSet="ds" DataSetName="ds" Font.Charset="1" Font.Color="-16777208" Font.Height="-13" Font.Name="Arial" Font.Style="2" HAlign="haRight" ParentFont="False" Text="Report Total"/>
</TfrxReportSummary>
<TfrxGroupHeader Name="GroupHeader1" Height="30.23624" Left="0" Top="154.96073" Width="699.21305" Condition="ds."s.SupplierID"">
<TfrxMemoView Name="dsSupplierName" Left="0" Top="7.55906" Width="888.18955" Height="18.89765" ShowHint="False" DataField="SupplierName" DataSet="ds" DataSetName="ds" Font.Charset="1" Font.Color="-16777208" Font.Height="-13" Font.Name="Arial" Font.Style="1" ParentFont="False" Text="[ds."SupplierName"]"/>
</TfrxGroupHeader>
<TfrxGroupFooter Name="GroupFooter1" Height="26.45671" Left="0" Top="253.22851" Width="699.21305">
<TfrxLineView Name="Line1" Left="0" Top="26.45671" Width="691.65399" Height="0" ShowHint="False" Frame.Typ="4"/>
<TfrxMemoView Name="Memo13" Left="612.28386" Top="3.77953" Width="79.37013" Height="18.89765" ShowHint="False" DataSet="ds" DataSetName="ds" DisplayFormat.DecimalSeparator="." DisplayFormat.FormatStr="%2.2m" DisplayFormat.Kind="fkNumeric" Font.Charset="1" Font.Color="-16777208" Font.Height="-13" Font.Name="Arial" Font.Style="2" HAlign="haRight" ParentFont="False" Text="[sum(<ds."NumInStock">*<ds."CostPrice">)]"/>
<TfrxMemoView Name="Memo14" Left="313.70099" Top="3.77953" Width="298.58287" Height="18.89765" ShowHint="False" DataSet="ds" DataSetName="ds" Font.Charset="1" Font.Color="-16777208" Font.Height="-13" Font.Name="Arial" Font.Style="2" HAlign="haRight" ParentFont="False" Text="Supplier Total"/>
</TfrxGroupFooter>
</TfrxReportPage>
</TfrxReport>
M�!!" � T�@�,� Sales by Country2 O
#SELECT Country, COUNT(*) AS NoOrders, SUM(Subtotal) AS Total FROM orders WHERE (Status = "COMPLETED" OR Status = "PAYMENT RECEIVED")
#AND DateTimeOrdered >= 20100418
#GROUP BY Country
#ORDER BY Total DESC
# (SS,31/1/22) modified above to following
# (SS,16/12/25) added AND IsInvoice
SET @startdate = "[STARTDATE]";
SET @enddate = "[ENDDATE]";
SELECT Country, COUNT(*) AS NoOrders, SUM(Subtotal) AS Total
FROM orders
WHERE PaymentReceived = TRUE AND IsInvoice
AND DATE(DateTimePaid) >= @startdate AND DATE(DateTimePaid) <= @enddate
GROUP BY Country
ORDER BY Total DESC� <?xml version="1.0" encoding="utf-8"?>
<TfrxReport Version="4.15.13" DotMatrixReport="False" IniFile="\Software\Fast Reports" PreviewOptions.AllowEdit="False" PreviewOptions.Buttons="1465" PreviewOptions.Zoom="1" PrintOptions.Printer="Default" PrintOptions.PrintOnSheet="0" ReportOptions.Compressed="True" ReportOptions.CreateDate="39024.4955783102" ReportOptions.Description.Text="" ReportOptions.LastChange="44592.6666311574" ScriptLanguage="PascalScript" ScriptText.Text="function GetSubtitle: String; var LStartDate, LEndDate: TDateTime; begin LStartDate := GetDateFromTokenVar(<tknSTARTDATE>); LEndDate := GetDateFromTokenVar(<tknENDDATE>); Result := 'From ' + DateToStr(LStartDate) + ' to ' + DateToStr(LEndDate) end; // converts string in 2013-03-14 format to datetime function GetDateFromTokenVar(const ADateStr: String): TDateTime; begin Result := StrToDate(Copy(ADateStr, 9, 2) + '/' + Copy(ADateStr, 6, 2) + '/' + Copy(ADateStr, 1, 4)); end; begin end." PropData="044C656674022C03546F70021408446174617365747301010C1E00000020446174615365743D2264732220446174615365744E616D653D226473220000095661726961626C657301010C16000000204E616D653D2220495450207661726961626C65732200010C21000000204E616D653D227374725265706F72745469746C65222056616C75653D2227272200010C24000000204E616D653D227374725265706F72745375627469746C65222056616C75653D2227272200010C29000000204E616D653D22737472557365724E616D65222056616C75653D22276879706572666C69676874272200010C24000000204E616D653D22737472456D61696C5369676E6174757265222056616C75653D2227272200010C28000000204E616D653D22737472456D61696C5369676E617475726548544D4C222056616C75653D2227272200010C1E000000204E616D653D227374724D65737361676531222056616C75653D2227272200010C1E000000204E616D653D227374724D65737361676532222056616C75653D2227272200010C29000000204E616D653D22746B6E535441525444415445222056616C75653D2227323032312D30312D3331272200010C27000000204E616D653D22746B6E454E4444415445222056616C75653D2227323032322D30312D333027220000055374796C650100">
<TfrxDataPage Name="Data" Height="1000" Left="0" Top="0" Width="1000"/>
<TfrxReportPage Name="Page1" PaperWidth="210" PaperHeight="297" PaperSize="9" LeftMargin="15" RightMargin="10" TopMargin="10" BottomMargin="10" ColumnWidth="0" ColumnPositions.Text="" HGuides.Text="" VGuides.Text="">
<TfrxPageHeader Name="PageHeader1" Font.Charset="1" Font.Color="0" Font.Height="-13" Font.Name="Arial" Font.Style="4" Height="71.81107" Left="0" ParentFont="False" Top="18.89765" Width="699.21305">
<TfrxMemoView Name="Memo7" Left="0" Top="0" Width="158.29128" Height="27.77953" ShowHint="False" AutoWidth="True" Font.Charset="1" Font.Color="0" Font.Height="-19" Font.Name="@Arial Unicode MS" Font.Style="1" Frame.Typ="8" ParentFont="False" Text="Sales by Country"/>
<TfrxMemoView Name="Memo5" Left="226.7718" Top="49.13389" Width="102.04731" Height="18.89765" ShowHint="False" Font.Charset="1" Font.Color="-16777208" Font.Height="-13" Font.Name="Arial Narrow" Font.Style="1" Frame.Typ="8" HAlign="haRight" ParentFont="False" Text="No. of Orders"/>
<TfrxMemoView Name="Memo6" Left="347.71676" Top="49.13389" Width="120.94496" Height="18.89765" ShowHint="False" Font.Charset="1" Font.Color="-16777208" Font.Height="-13" Font.Name="Arial Narrow" Font.Style="1" Frame.Typ="8" HAlign="haRight" ParentFont="False" Text="Total"/>
<TfrxMemoView Name="mvSubtitle" Left="162.51979" Top="8.88188" Width="257.00804" Height="18.89765" ShowHint="False" AutoWidth="True" DisplayFormat.DecimalSeparator="." Font.Charset="1" Font.Color="-16777208" Font.Height="-13" Font.Name="Arial" Font.Style="3" Frame.Typ="8" ParentFont="False" Text="[GetSubtitle]"/>
</TfrxPageHeader>
<TfrxMasterData Name="MasterData1" Height="22.67718" Left="0" Top="151.1812" Width="699.21305" ColumnWidth="0" ColumnGap="0" DataSet="ds" DataSetName="ds" RowCount="0">
<TfrxMemoView Name="dsCountry" Left="0" Top="0" Width="219.21274" Height="18.89765" ShowHint="False" DataField="Country" DataSet="ds" DataSetName="ds" Font.Charset="1" Font.Color="-16777208" Font.Height="-13" Font.Name="Arial" Font.Style="0" ParentFont="False" Text="[ds."Country"]"/>
<TfrxMemoView Name="dsNoOrders" Left="226.7718" Top="0" Width="102.04731" Height="18.89765" ShowHint="False" DataField="NoOrders" DataSet="ds" DataSetName="ds" DisplayFormat.ThousandSeparator="," DisplayFormat.FormatStr="%2.0n" DisplayFormat.Kind="fkNumeric" Font.Charset="1" Font.Color="-16777208" Font.Height="-13" Font.Name="Arial" Font.Style="0" HAlign="haRight" ParentFont="False" Text="[ds."NoOrders"]"/>
<TfrxMemoView Name="Memo1" Left="347.71676" Top="0" Width="120.94496" Height="18.89765" ShowHint="False" DataField="Total" DataSet="ds" DataSetName="ds" DisplayFormat.FormatStr="%2.0m" DisplayFormat.Kind="fkNumeric" Font.Charset="1" Font.Color="-16777208" Font.Height="-13" Font.Name="Arial" Font.Style="0" HAlign="haRight" ParentFont="False" Text="[ds."Total"]"/>
</TfrxMasterData>
<TfrxPageFooter Name="PageFooter1" Height="22.67718" Left="0" Top="287.24428" Width="699.21305">
<TfrxMemoView Name="Memo8" Left="0" Top="0" Width="225" Height="20" ShowHint="False" StretchMode="smMaxHeight" Font.Charset="1" Font.Color="0" Font.Height="-13" Font.Name="Times New Roman" Font.Style="2" ParentFont="False" Text="[<DATE>] [FORMATDATETIME('h:mm am/pm', <TIME>)]"/>
<TfrxMemoView Name="Memo9" Left="574.48856" Top="0" Width="144.77953" Height="20" ShowHint="False" StretchMode="smMaxHeight" Font.Charset="1" Font.Color="0" Font.Height="-13" Font.Name="Times New Roman" Font.Style="2" HAlign="haRight" ParentFont="False" Text="Page [Page#] of [TotalPages#]"/>
</TfrxPageFooter>
<TfrxReportSummary Name="ReportSummary1" Height="30.23624" Left="0" Top="234.33086" Width="699.21305">
<TfrxMemoView Name="Memo2" Left="226.7718" Top="3.77953" Width="102.04731" Height="18.89765" ShowHint="False" DataSet="ds" DataSetName="ds" DisplayFormat.ThousandSeparator="," DisplayFormat.FormatStr="%2.0n" DisplayFormat.Kind="fkNumeric" Font.Charset="1" Font.Color="-16777208" Font.Height="-13" Font.Name="Arial" Font.Style="0" Frame.Typ="4" HAlign="haRight" ParentFont="False" Text="[SUM(<ds."NoOrders">)]"/>
<TfrxMemoView Name="Memo3" Left="347.71676" Top="3.77953" Width="120.94496" Height="18.89765" ShowHint="False" DataSet="ds" DataSetName="ds" DisplayFormat.FormatStr="%2.0m" DisplayFormat.Kind="fkNumeric" Font.Charset="1" Font.Color="-16777208" Font.Height="-13" Font.Name="Arial" Font.Style="0" Frame.Typ="4" HAlign="haRight" ParentFont="False" Text="[SUM(<ds."Total">)]"/>
<TfrxMemoView Name="Memo4" Left="0" Top="3.77953" Width="102.04731" Height="18.89765" ShowHint="False" DataSet="ds" DataSetName="ds" Font.Charset="1" Font.Color="-16777208" Font.Height="-13" Font.Name="Arial" Font.Style="0" ParentFont="False" Text="Totals"/>
</TfrxRL @�,�
Stock Taked � SELECT *, REVERSE(LPAD(CAST(ProductID AS CHAR), GREATEST(LENGTH(ProductID), 4), "0")) AS PickID FROM products p
LEFT JOIN suppliers s ON s.SupplierID = p.SupplierID
WHERE ProductDisabled = FALSE
ORDER BY p.SupplierID, ProductCode1 <?xml version="1.0" encoding="utf-8"?>
<TfrxReport Version="4.10.1" DotMatrixReport="False" IniFile="\Software\Fast Reports" PreviewOptions.AllowEdit="False" PreviewOptions.Buttons="1465" PreviewOptions.Zoom="1" PrintOptions.Printer="Default" PrintOptions.PrintOnSheet="0" ReportOptions.Compressed="True" ReportOptions.CreateDate="39024.4955783102" ReportOptions.Description.Text="" ReportOptions.LastChange="42426.637369838" ScriptLanguage="PascalScript" ScriptText.Text="begin end." PropData="044C656674022C03546F70021408446174617365747301010C1E00000020446174615365743D2264732220446174615365744E616D653D226473220000095661726961626C657301010C16000000204E616D653D2220495450207661726961626C65732200010C21000000204E616D653D227374725265706F72745469746C65222056616C75653D2227272200010C24000000204E616D653D227374725265706F72745375627469746C65222056616C75653D2227272200010C29000000204E616D653D22737472557365724E616D65222056616C75653D22276879706572666C69676874272200010C1E000000204E616D653D227374724D65737361676531222056616C75653D2227272200010C1E000000204E616D653D227374724D65737361676532222056616C75653D2227272200010C22000000204E616D653D22746B6E5354415254434F4445222056616C75653D2227415641272200010C2D000000204E616D653D22746B6E454E44434F4445222056616C75653D22274156412D42414C4C4153542D54554245272200010C24000000204E616D653D22737472456D61696C5369676E6174757265222056616C75653D2227272200010C28000000204E616D653D22737472456D61696C5369676E617475726548544D4C222056616C75653D222727220000055374796C650100">
<TfrxDataPage Name="Data" Height="1000" Left="0" Top="0" Width="1000"/>
<TfrxReportPage Name="Page1" PaperWidth="210" PaperHeight="297" PaperSize="9" LeftMargin="15" RightMargin="10" TopMargin="10" BottomMargin="10" ColumnWidth="0" ColumnPositions.Text="" HGuides.Text="" VGuides.Text="">
<TfrxPageHeader Name="PageHeader1" Height="75.5906" Left="0" Top="18.89765" Width="699.21305">
<TfrxMemoView Name="Memo7" Left="0" Top="0" Width="672.30736" Height="42.89765" ShowHint="False" DisplayFormat.DecimalSeparator="." DisplayFormat.Kind="fkDateTime" Font.Charset="1" Font.Color="0" Font.Height="-32" Font.Name="@Arial Unicode MS" Font.Style="1" ParentFont="False" Text="HyperFlight Stock Take Sheet"/>
<TfrxMemoView Name="Memo1" Left="75.5906" Top="52.91342" Width="143.62214" Height="18.89765" ShowHint="False" DisplayFormat.DecimalSeparator="." Font.Charset="1" Font.Color="-16777208" Font.Height="-13" Font.Name="Arial" Font.Style="1" Frame.Typ="8" ParentFont="False" Text="Product Code"/>
<TfrxMemoView Name="Memo2" Left="222.99227" Top="52.91342" Width="268.34663" Height="18.89765" ShowHint="False" DisplayFormat.DecimalSeparator="." Font.Charset="1" Font.Color="-16777208" Font.Height="-13" Font.Name="Arial" Font.Style="1" Frame.Typ="8" ParentFont="False" Text="Product Name"/>
<TfrxMemoView Name="Memo6" Left="495.11843" Top="52.91342" Width="60.47248" Height="18.89765" ShowHint="False" DisplayFormat.DecimalSeparator="." Font.Charset="1" Font.Color="-16777208" Font.Height="-13" Font.Name="Arial" Font.Style="1" Frame.Typ="8" HAlign="haRight" ParentFont="False" Text="Stock"/>
<TfrxMemoView Name="Memo5" Left="559.37044" Top="52.91342" Width="113.3859" Height="18.89765" ShowHint="False" DisplayFormat.DecimalSeparator="." Font.Charset="1" Font.Color="-16777208" Font.Height="-13" Font.Name="Arial" Font.Style="1" Frame.Typ="8" HAlign="haRight" ParentFont="False" Text="Actual Number"/>
<TfrxMemoView Name="Memo3" Left="0" Top="52.91342" Width="71.81107" Height="18.89765" ShowHint="False" DisplayFormat.DecimalSeparator="." Font.Charset="1" Font.Color="-16777208" Font.Height="-13" Font.Name="Arial" Font.Style="1" Frame.Typ="8" ParentFont="False" Text="Pick ID"/>
</TfrxPageHeader>
<TfrxMasterData Name="MasterData1" Height="18.89765" Left="0" Top="207.87415" Width="699.21305" ColumnWidth="0" ColumnGap="0" DataSet="ds" DataSetName="ds" RowCount="0" Stretched="True">
<TfrxMemoView Name="dsProductCode" Left="64.25201" Top="0" Width="143.62214" Height="18.89765" ShowHint="False" DataField="ProductCode" DataSet="ds" DataSetName="ds" Font.Charset="1" Font.Color="-16777208" Font.Height="-11" Font.Name="Arial" Font.Style="0" Frame.Typ="8" ParentFont="False" Text="[ds."ProductCode"]"/>
<TfrxMemoView Name="Memo10" Left="495.11843" Top="0" Width="68.03154" Height="18.89765" ShowHint="False" DataField="NumInStock" DataSet="ds" DataSetName="ds" DisplayFormat.DecimalSeparator="." DisplayFormat.FormatStr="%g" DisplayFormat.Kind="fkNumeric" Font.Charset="1" Font.Color="-16777208" Font.Height="-13" Font.Name="Arial" Font.Style="1" Frame.Typ="8" HAlign="haRight" ParentFont="False" Text="[ds."NumInStock"]"/>
<TfrxMemoView Name="dsProductName" Left="211.65368" Top="0" Width="279.68522" Height="18.89765" ShowHint="False" StretchMode="smActualHeight" DataField="ProductName" DataSet="ds" DataSetName="ds" Font.Charset="1" Font.Color="-16777208" Font.Height="-11" Font.Name="Arial" Font.Style="0" Frame.Typ="8" ParentFont="False" WordWrap="False" Text="[ds."ProductName"]"/>
<TfrxMemoView Name="Memo4" Left="566.9295" Top="0" Width="132.28355" Height="18.89765" ShowHint="False" Font.Charset="1" Font.Color="-16777208" Font.Height="-13" Font.Name="Arial" Font.Style="0" Frame.Typ="8" HAlign="haRight" ParentFont="False" Text="|"/>
<TfrxMemoView Name="dsPickID" Left="0" Top="0" Width="60.47248" Height="18.89765" ShowHint="False" DataField="PickID" DataSet="ds" DataSetName="ds" Font.Charset="1" Font.Color="-16777208" Font.Height="-13" Font.Name="Arial" Font.Style="1" Frame.Typ="8" HAlign="haCenter" ParentFont="False" Text="[ds."PickID"]"/>
<TfrxMemoView Name="Memo8" Left="536.69326" Top="0" Width="30.23624" Height="18.89765" ShowHint="False" Font.Charset="1" Font.Color="-16777208" Font.Height="-13" Font.Name="Arial" Font.Style="0" HAlign="haRight" ParentFont="False" Text="|"/>
</TfrxMasterData>
<TfrxPageFooter Name="PageFooter1" Height="24" Left="0" Top="287.24428" Width="699.21305">
<TfrxMemoView Name="Memo9" Left="551.81138" Top="0" Width="141" Height="20" ShowHint="False" StretchMode="smMaxHeight" Font.Charset="1" Font.Color="0" Font.Height="-13" Font.Name="Times New Roman" Font.Style="2" HAlign="haRight" ParentFont="False" Text="Page [Page#] of [TotalPages#]"/>
<TfrxMemoView Name="Memo12" Left="0" Top="0" Width="156.96846" Height="20" ShowHint="False" StretchMode="smMaxHeight" Font.Charset="1" Font.Color="0" Font.Height="-13" Font.Name="Times New Roman" Font.Style="2" ParentFont="False" Text="[<DATE>] [FORMATDATETIME('h:mm am/pm', <TIME>)]"/>
</TfrxPageFooter>
<TfrxGroupHeader Name="GroupHeader1" Height="30.23624" Left="0" Top="154.96073" Width="699.21305" Condition="ds."s.SupplierID"">
<TfrxMemoView Name="dsSupplierName" Left="0" Top="7.55906" Width="888.18955" Height="18.89765" ShowHint="False" DataField="SupplierName" DataSet="ds" DataSetName="ds" Font.Charset="1" Font.Color="-16777208" Font.Height="-13" Font.Name="Arial" Font.Style="1" ParentFont="False" Text="[ds."SupplierName"]"/>
</TfrxGroupHeader>
</TfrxReportPage>
</TfrxReport>
M��q�R�� Account Totals SELECT orders.*, IF(VATIncluded <> 0, "VATable", "Non VATable") AS VATable, countries.PostalArea,
IF(COALESCE(orders.DeliveryCountry, "") = "", orders.Country, orders.DeliveryCountry) AS DeliveryCountry2
FROM orders
LEFT JOIN countries ON countries.Country = IF(COALESCE(orders.DeliveryCountry, "") = "", orders.Country, orders.DeliveryCountry)
WHERE DATE_FORMAT(DateTimePaid, "%M %Y") = "[MONTH]" AND PaymentReceived = TRUE
ORDER BY IF(PostalArea = "UK", 1, IF(PostalArea = "EU", 2, 3)), VATable DESC, PaymentMethod, OrderNo& SELECT orders.*, IF(VATIncluded > 0, "VATable", "Non VATable") AS VATable, countries.PostalArea,
IF(COALESCE(orders.DeliveryCountry, "") = "", orders.Country, orders.DeliveryCountry) AS DeliveryCountry2
FROM orders
LEFT JOIN countries ON countries.Country = IF(COALESCE(orders.DeliveryCountry, "") = "", orders.Country, orders.DeliveryCountry)
WHERE DATE_FORMAT(RefundDate, "%M %Y") = "[MONTH]" AND PaymentReceived = TRUE AND RefundAmount <> 0
ORDER BY IF(PostalArea = "UK", 1, IF(PostalArea = "EU", 2, 3)), VATable DESC, PaymentMethod, OrderNom <?xml version="1.0" encoding="utf-8"?>
<TfrxReport Version="4.15.13" DotMatrixReport="False" IniFile="\Software\Fast Reports" PreviewOptions.AllowEdit="False" PreviewOptions.Buttons="1465" PreviewOptions.Zoom="1" PrintOptions.Printer="Default" PrintOptions.PrintOnSheet="0" ReportOptions.Compressed="True" ReportOptions.CreateDate="39024.4955783102" ReportOptions.Description.Text="" ReportOptions.LastChange="42797.6363692708" ScriptLanguage="PascalScript" ScriptText.Text="procedure Page1OnBeforePrint(Sender: TfrxComponent); begin // (SS,13/4/12) show the refunds note in the orders report only (not refunds) if <tknTYPE> = 'Orders' then mmRefundsNote.Visible := True else mmRefundsNote.Visible := False; end; begin end." PropData="044C656674022C03546F70021408446174617365747301010C1E00000020446174615365743D2264732220446174615365744E616D653D226473220000095661726961626C657301010C16000000204E616D653D2220495450207661726961626C65732200010C21000000204E616D653D227374725265706F72745469746C65222056616C75653D2227272200010C24000000204E616D653D227374725265706F72745375627469746C65222056616C75653D2227272200010C29000000204E616D653D22737472557365724E616D65222056616C75653D22276879706572666C69676874272200010C24000000204E616D653D22737472456D61696C5369676E6174757265222056616C75653D2227272200010C28000000204E616D653D22737472456D61696C5369676E617475726548544D4C222056616C75653D2227272200010C1E000000204E616D653D227374724D65737361676531222056616C75653D2227272200010C1E000000204E616D653D227374724D65737361676532222056616C75653D2227272200010C28000000204E616D653D22746B6E4D4F4E5448222056616C75653D222746656272756172792032303137272200010C20000000204E616D653D22746B6E54595045222056616C75653D22274F726465727327220000055374796C650100">
<TfrxDataPage Name="Data" Height="1000" Left="0" Top="0" Width="1000"/>
<TfrxReportPage Name="Page1" Orientation="poLandscape" PaperWidth="297" PaperHeight="210" PaperSize="9" LeftMargin="10" RightMargin="15" TopMargin="10" BottomMargin="10" ColumnWidth="0" ColumnPositions.Text="" HGuides.Text="" VGuides.Text="" OnBeforePrint="Page1OnBeforePrint">
<TfrxPageHeader Name="PageHeader1" Height="60.47248" Left="0" Top="18.89765" Width="1028.03216">
<TfrxMemoView Name="Memo7" Left="0" Top="0" Width="490.88992" Height="24" ShowHint="False" AutoWidth="True" Font.Charset="1" Font.Color="0" Font.Height="-19" Font.Name="Times New Roman" Font.Style="1" Frame.Typ="8" ParentFont="False" Text="[IIF(<strReportTitle> <> '', <strReportTitle>, 'Account Totals - ' + <tknTYPE> + ' - ' + <tknMONTH>)]"/>
<TfrxMemoView Name="Memo1" Left="0" Top="34.01577" Width="52.91342" Height="18.89765" ShowHint="False" DisplayFormat.DecimalSeparator="." Font.Charset="1" Font.Color="-16777208" Font.Height="-13" Font.Name="Arial Narrow" Font.Style="1" Frame.Typ="8" ParentFont="False" Text="Order No"/>
<TfrxMemoView Name="Memo2" Left="124.72449" Top="34.01577" Width="98.2677165354331" Height="18.89765" ShowHint="False" DisplayFormat.DecimalSeparator="." Font.Charset="1" Font.Color="-16777208" Font.Height="-13" Font.Name="Arial Narrow" Font.Style="1" Frame.Typ="8" ParentFont="False" Text="Name"/>
<TfrxMemoView Name="Memo3" Left="226.77165354" Top="34.01577" Width="83.1496062992126" Height="18.89765" ShowHint="False" Font.Charset="1" Font.Color="-16777208" Font.Height="-13" Font.Name="Arial Narrow" Font.Style="1" Frame.Typ="8" ParentFont="False" Text="Inv. Country"/>
<TfrxMemoView Name="Memo4" Left="313.70099" Top="34.01577" Width="83.1496063" Height="18.89765" ShowHint="False" Font.Charset="1" Font.Color="-16777208" Font.Height="-13" Font.Name="Arial Narrow" Font.Style="1" Frame.Typ="8" ParentFont="False" Text="Del. Country"/>
<TfrxMemoView Name="Memo5" Left="56.69295" Top="34.01577" Width="64.25201" Height="18.89765" ShowHint="False" DisplayFormat.DecimalSeparator="." Font.Charset="1" Font.Color="-16777208" Font.Height="-13" Font.Name="Arial Narrow" Font.Style="1" Frame.Typ="8" ParentFont="False" Text="Order Date"/>
<TfrxMemoView Name="Memo10" Left="400.63018" Top="34.01577" Width="71.81102362" Height="18.89765" ShowHint="False" DisplayFormat.DecimalSeparator="." Font.Charset="1" Font.Color="-16777208" Font.Height="-13" Font.Name="Arial Narrow" Font.Style="1" Frame.Typ="8" HAlign="haRight" ParentFont="False" Text="Grand Total"/>
<TfrxMemoView Name="Memo11" Left="476.22078" Top="34.01577" Width="64.25196118" Height="18.89765" ShowHint="False" DisplayFormat.DecimalSeparator="." Font.Charset="1" Font.Color="-16777208" Font.Height="-11" Font.Name="Arial Narrow" Font.Style="1" Frame.Typ="8" HAlign="haRight" ParentFont="False" Text="VAT Included"/>
<TfrxMemoView Name="Memo12" Left="544.25232" Top="34.01577" Width="64.2519685" Height="18.89765" ShowHint="False" DisplayFormat.DecimalSeparator="." Font.Charset="1" Font.Color="-16777208" Font.Height="-11" Font.Name="Arial Narrow" Font.Style="1" Frame.Typ="8" HAlign="haRight" ParentFont="False" Text="VAT Deducted"/>
<TfrxMemoView Name="Memo13" Left="612.28386" Top="34.01577" Width="60.4724385" Height="18.89765" ShowHint="False" DisplayFormat.DecimalSeparator="." Font.Charset="1" Font.Color="-16777208" Font.Height="-13" Font.Name="Arial Narrow" Font.Style="1" Frame.Typ="8" ParentFont="False" Text="Date Paid"/>
<TfrxMemoView Name="Memo14" Left="676.53587" Top="34.01577" Width="120.9449185" Height="18.89765" ShowHint="False" DisplayFormat.DecimalSeparator="." Font.Charset="1" Font.Color="-16777208" Font.Height="-13" Font.Name="Arial Narrow" Font.Style="1" Frame.Typ="8" ParentFont="False" Text="Payment Reference"/>
<TfrxMemoView Name="Memo15" Left="888.18955" Top="34.01577" Width="68.0314985" Height="18.89765" ShowHint="False" DisplayFormat.DecimalSeparator="." Font.Charset="1" Font.Color="-16777208" Font.Height="-13" Font.Name="Arial Narrow" Font.Style="1" Frame.Typ="8" ParentFont="False" Text="Refund Date"/>
<TfrxMemoView Name="Memo16" Left="960.00062" Top="34.01577" Width="68.0314985" Height="18.89765" ShowHint="False" DisplayFormat.DecimalSeparator="." Font.Charset="1" Font.Color="-16777208" Font.Height="-13" Font.Name="Arial Narrow" Font.Style="1" Frame.Typ="8" HAlign="haRight" ParentFont="False" Text="Refnd Amnt"/>
<TfrxMemoView Name="Memo28" Left="801.26036" Top="34.01577" Width="83.1496185" Height="18.89765" ShowHint="False" DisplayFormat.DecimalSeparator="." Font.Charset="1" Font.Color="-16777208" Font.Height="-13" Font.Name="Arial Narrow" Font.Style="1" Frame.Typ="8" ParentFont="False" Text="Status"/>
</TfrxPageHeader>
<TfrxMasterData Name="MasterData1" Height="22.67718" Left="0" Top="275.90569" Width="1028.03216" ColumnWidth="0" ColumnGap="0" DataSet="ds" DataSetName="ds" RowCount="0">
<TfrxMemoView Name="dsOrderNo" Left="0" Top="0" Width="52.91342" Height="18.89765" ShowHint="False" Color="16777215" DataField="OrderNo" DataSet="ds" DataSetName="ds" Font.Charset="1" Font.Color="-16777208" Font.Height="-13" Font.Name="Arial Narrow" Font.Style="0" Highlight.Font.Charset="1" Highlight.Font.Color="255" Highlight.Font.Height="-13" Highlight.Font.Name="Arial Narrow" Highlight.Font.Style="0" Highlight.Condition="<ds."Status"> = 'CANCELLED'" ParentFont="False" Text="[ds."OrderNo"]"/>
<TfrxMemoView Name="dsFirstName" Left="124.72449" Top="0" Width="98.2677165354331" Height="18.89765" ShowHint="False" StretchMode="smMaxHeight" Color="16777215" DataSet="ds" DataSetName="ds" Font.Charset="1" Font.Color="-16777208" Font.Height="-13" Font.Name="Arial Narrow" Font.Style="0" Highlight.Font.Charset="1" Highlight.Font.Color="255" Highlight.Font.Height="-13" Highlight.Font.Name="Arial Narrow" Highlight.Font.Style="0" Highlight.Condition="<ds."Status"> = 'CANCELLED'" ParentFont="False" WordWrap="False" Text="[<ds."FirstName"> + ' ' + <ds."Surname">]"/>
<TfrxMemoView Name="dsPostcode" Left="226.77165354" Top="0" Width="83.1496063" Height="18.89765" ShowHint="False" Color="16777215" DataField="Country" DataSet="ds" DataSetName="ds" Font.Charset="1" Font.Color="-16777208" Font.Height="-13" Font.Name="Arial Narrow" Font.Style="0" Highlight.Font.Charset="1" Highlight.Font.Color="255" Highlight.Font.Height="-13" Highlight.Font.Name="Arial Narrow" Highlight.Font.Style="0" Highlight.Condition="<ds."Status"> = 'CANCELLED'" ParentFont="False" WordWrap="False" Text="[ds."Country"]"/>
<TfrxMemoView Name="dsCountry" Left="313.70099" Top="0" Width="83.1496063" Height="18.89765" ShowHint="False" StretchMode="smMaxHeight" Color="16777215" DataField="DeliveryCountry2" DataSet="ds" DataSetName="ds" Font.Charset="1" Font.Color="-16777208" Font.Height="-13" Font.Name="Arial Narrow" Font.Style="0" Highlight.Font.Charset="1" Highlight.Font.Color="255" Highlight.Font.Height="-13" Highlight.Font.Name="Arial Narrow" Highlight.Font.Style="0" Highlight.Condition="<ds."Status"> = 'CANCELLED'" ParentFont="False" WordWrap="False" Text="[ds."DeliveryCountry2"]"/>
<TfrxMemoView Name="dsDateTimeOrdered" Left="60.47248" Top="0" Width="60.47248" Height="18.89765" ShowHint="False" Color="16777215" DataField="DateTimeOrdered" DataSet="ds" DataSetName="ds" DisplayFormat.FormatStr="dd/mm/yyyy" DisplayFormat.Kind="fkDateTime" Font.Charset="1" Font.Color="-16777208" Font.Height="-13" Font.Name="Arial Narrow" Font.Style="0" Highlight.Font.Charset="1" Highlight.Font.Color="255" Highlight.Font.Height="-13" Highlight.Font.Name="Arial Narrow" Highlight.Font.Style="0" Highlight.Condition="<ds."Status"> = 'CANCELLED'" ParentFont="False" Text="[ds."DateTimeOrdered"]"/>
<TfrxMemoView Name="dsGrandTotal" Left="400.63018" Top="0" Width="71.81107" Height="18.89765" ShowHint="False" Color="16777215" DataField="GrandTotal" DataSet="ds" DataSetName="ds" DisplayFormat.FormatStr="%2.2m" DisplayFormat.Kind="fkNumeric" Font.Charset="1" Font.Color="-16777208" Font.Height="-13" Font.Name="Arial Narrow" Font.Style="0" HAlign="haRight" Highlight.Font.Charset="1" Highlight.Font.Color="255" Highlight.Font.Height="-13" Highlight.Font.Name="Arial Narrow" Highlight.Font.Style="0" Highlight.Condition="<ds."Status"> = 'CANCELLED'" ParentFont="False" Text="[ds."GrandTotal"]"/>
<TfrxMemoView Name="dsVATIncluded" Left="476.22078" Top="0" Width="64.2519685" Height="18.89765" ShowHint="False" Color="16777215" DataField="VATIncluded" DataSet="ds" DataSetName="ds" DisplayFormat.FormatStr="%2.2m" DisplayFormat.Kind="fkNumeric" Font.Charset="1" Font.Color="-16777208" Font.Height="-13" Font.Name="Arial Narrow" Font.Style="0" HAlign="haRight" HideZeros="True" Highlight.Font.Charset="1" Highlight.Font.Color="255" Highlight.Font.Height="-13" Highlight.Font.Name="Arial Narrow" Highlight.Font.Style="0" Highlight.Condition="<ds."Status"> = 'CANCELLED'" ParentFont="False" Text="[ds."VATIncluded"]"/>
<TfrxMemoView Name="dsVATDeducted" Left="544.25232" Top="0" Width="64.2519685" Height="18.89765" ShowHint="False" Color="16777215" DataField="VATDeducted" DataSet="ds" DataSetName="ds" DisplayFormat.FormatStr="%2.2m" DisplayFormat.Kind="fkNumeric" Font.Charset="1" Font.Color="-16777208" Font.Height="-13" Font.Name="Arial Narrow" Font.Style="0" HAlign="haRight" HideZeros="True" Highlight.Font.Charset="1" Highlight.Font.Color="255" Highlight.Font.Height="-13" Highlight.Font.Name="Arial Narrow" Highlight.Font.Style="0" Highlight.Condition="<ds."Status"> = 'CANCELLED'" ParentFont="False" Text="[ds."VATDeducted"]"/>
<TfrxMemoView Name="dsDateTimePaid" Left="612.28386" Top="0" Width="60.4724385" Height="18.89765" ShowHint="False" Color="16777215" DataField="DateTimePaid" DataSet="ds" DataSetName="ds" DisplayFormat.FormatStr="dd/mm/yyyy" DisplayFormat.Kind="fkDateTime" Font.Charset="1" Font.Color="-16777208" Font.Height="-13" Font.Name="Arial Narrow" Font.Style="0" Highlight.Font.Charset="1" Highlight.Font.Color="255" Highlight.Font.Height="-13" Highlight.Font.Name="Arial Narrow" Highlight.Font.Style="0" Highlight.Condition="<ds."Status"> = 'CANCELLED'" ParentFont="False" Text="[ds."DateTimePaid"]"/>
<TfrxMemoView Name="dsPaymentReference" Left="676.53587" Top="0" Width="120.94487457" Height="18.89765" ShowHint="False" Color="16777215" DataField="PaymentReference" DataSet="ds" DataSetName="ds" Font.Charset="1" Font.Color="-16777208" Font.Height="-13" Font.Name="Arial Narrow" Font.Style="0" Highlight.Font.Charset="1" Highlight.Font.Color="255" Highlight.Font.Height="-13" Highlight.Font.Name="Arial Narrow" Highlight.Font.Style="0" Highlight.Condition="<ds."Status"> = 'CANCELLED'" ParentFont="False" WordWrap="False" Text="[ds."PaymentReference"]"/>
<TfrxMemoView Name="dsRefundDate" Left="891.96908" Top="0" Width="64.2519685" Height="18.89765" ShowHint="False" Color="16777215" DataField="RefundDate" DataSet="ds" DataSetName="ds" DisplayFormat.FormatStr="dd/mm/yyyy" DisplayFormat.Kind="fkDateTime" Font.Charset="1" Font.Color="-16777208" Font.Height="-13" Font.Name="Arial Narrow" Font.Style="0" HAlign="haRight" Highlight.Font.Charset="1" Highlight.Font.Color="255" Highlight.Font.Height="-13" Highlight.Font.Name="Arial Narrow" Highlight.Font.Style="0" Highlight.Condition="<ds."Status"> = 'CANCELLED'" ParentFont="False" Text="[ds."RefundDate"]"/>
<TfrxMemoView Name="dsRefundAmount" Left="960.00062" Top="0" Width="68.03154" Height="18.89765" ShowHint="False" Color="16777215" DataSet="ds" DataSetName="ds" DisplayFormat.FormatStr="%2.2m" DisplayFormat.Kind="fkNumeric" Font.Charset="1" Font.Color="-16777208" Font.Height="-13" Font.Name="Arial Narrow" Font.Style="0" HAlign="haRight" HideZeros="True" Highlight.Font.Charset="1" Highlight.Font.Color="255" Highlight.Font.Height="-13" Highlight.Font.Name="Arial Narrow" Highlight.Font.Style="0" Highlight.Condition="<ds."Status"> = 'CANCELLED'" ParentFont="False" Text="[ds."RefundAmount"]"/>
<TfrxMemoView Name="Memo29" Left="801.26036" Top="0" Width="90.70863457" Height="18.89765" ShowHint="False" Color="16777215" DataSet="ds" DataSetName="ds" Font.Charset="1" Font.Color="-16777208" Font.Height="-9" Font.Name="Arial Narrow" Font.Style="0" Highlight.Font.Charset="1" Highlight.Font.Color="255" Highlight.Font.Height="-11" Highlight.Font.Name="Arial Narrow" Highlight.Font.Style="0" Highlight.Condition="<ds."Status"> = 'CANCELLED'" ParentFont="False" WordWrap="False" Text="[ds."Status"]"/>
</TfrxMasterData>
<TfrxPageFooter Name="PageFooter1" Height="22.67718" Left="0" Top="642.5201" Width="1028.03216">
<TfrxMemoView Name="Memo8" Left="0" Top="0" Width="225" Height="20" ShowHint="False" StretchMode="smMaxHeight" Font.Charset="1" Font.Color="0" Font.Height="-13" Font.Name="Times New Roman" Font.Style="2" ParentFont="False" Text="[<DATE>] [FORMATDATETIME('h:mm am/pm', <TIME>)]"/>
<TfrxMemoView Name="Memo9" Left="884.41002" Top="0" Width="144.77953" Height="20" ShowHint="False" StretchMode="smMaxHeight" Font.Charset="1" Font.Color="0" Font.Height="-13" Font.Name="Times New Roman" Font.Style="2" HAlign="haRight" ParentFont="False" Text="Page [Page#] of [TotalPages#]"/>
</TfrxPageFooter>
<TfrxGroupHeader Name="GroupHeader1" Height="34.01577" Left="0" Top="219.21274" Width="1028.03216" Condition="ds."PaymentMethod"" KeepTogether="True">
<TfrxLineView Name="Line1" Left="0" Top="30.23624" Width="1028.03149606299" Height="0" ShowHint="False" Frame.Typ="4"/>
<TfrxMemoView Name="Memo30" Left="0" Top="7.55906" Width="340.1577" Height="18.89765" ShowHint="False" DataSet="ds" DataSetName="ds" Font.Charset="1" Font.Color="-16777208" Font.Height="-13" Font.Name="Arial Narrow" Font.Style="1" ParentFont="False" Text="[ds."PostalArea"] / [ds."VATable"] / [ds."PaymentMethod"]"/>
</TfrxGroupHeader>
<TfrxGroupFooter Name="GroupFooter1" Height="30.23624" Left="0" Top="321.26005" Width="1028.03216">
<TfrxMemoView Name="Memo6" Left="0" Top="3.77953" Width="389.29159" Height="18.89765" ShowHint="False" DataSet="ds" DataSetName="ds" Font.Charset="1" Font.Color="-16777208" Font.Height="-13" Font.Name="Arial Narrow" Font.Style="1" ParentFont="False" Text="Totals for [ds."PostalArea"] / [ds."VATable"] / [ds."PaymentMethod"]"/>
<TfrxLineView Name="Line2" Left="0" Top="0" Width="1028.03149606299" Height="0" ShowHint="False" Frame.Typ="4"/>
<TfrxMemoView Name="Memo17" Left="400.63018" Top="3.77953" Width="71.81107" Height="18.89765" ShowHint="False" DataSet="ds" DataSetName="ds" DisplayFormat.FormatStr="%2.2m" DisplayFormat.Kind="fkNumeric" Font.Charset="1" Font.Color="-16777208" Font.Height="-13" Font.Name="Arial Narrow" Font.Style="0" HAlign="haRight" ParentFont="False" Text="[SUM(<ds."GrandTotal">)]"/>
<TfrxMemoView Name="Memo18" Left="476.22078" Top="3.77953" Width="64.251968503937" Height="18.89765" ShowHint="False" DataSet="ds" DataSetName="ds" DisplayFormat.FormatStr="%2.2m" DisplayFormat.Kind="fkNumeric" Font.Charset="1" Font.Color="-16777208" Font.Height="-13" Font.Name="Arial Narrow" Font.Style="0" HAlign="haRight" HideZeros="True" ParentFont="False" Text="[SUM(<ds."VATIncluded">)]"/>
<TfrxMemoView Name="Memo19" Left="544.25232" Top="3.77953" Width="64.2519685" Height="18.89765" ShowHint="False" DataSet="ds" DataSetName="ds" DisplayFormat.FormatStr="%2.2m" DisplayFormat.Kind="fkNumeric" Font.Charset="1" Font.Color="-16777208" Font.Height="-13" Font.Name="Arial Narrow" Font.Style="0" HAlign="haRight" HideZeros="True" ParentFont="False" Text="[SUM(<ds."VATDeducted">)]"/>
<TfrxMemoView Name="Memo20" Left="941.10297" Top="3.77953" Width="86.92919" Height="18.89765" ShowHint="False" DataSet="ds" DataSetName="ds" DisplayFormat.FormatStr="%2.2m" DisplayFormat.Kind="fkNumeric" Font.Charset="1" Font.Color="-16777208" Font.Height="-13" Font.Name="Arial Narrow" Font.Style="0" HAlign="haRight" HideZeros="True" ParentFont="False" Text="[SUM(<ds."RefundAmount">)]"/>
<TfrxMemoView Name="Memo27" Left="801.26036" Top="3.77953" Width="71.81107" Height="18.89765" ShowHint="False" DataSet="ds" DataSetName="ds" DisplayFormat.FormatStr="%g" DisplayFormat.Kind="fkNumeric" Font.Charset="1" Font.Color="-16777208" Font.Height="-13" Font.Name="Arial Narrow" Font.Style="0" ParentFont="False" Text="Orders: [COUNT()]"/>
</TfrxGroupFooter>
<TfrxFooter Name="Footer1" Height="49.13389" Left="0" Top="480.00031" Width="1028.03216">
<TfrxMemoView Name="Memo21" Left="0" Top="18.89765" Width="234.33086" Height="18.89765" ShowHint="False" DataSet="ds" DataSetName="ds" Font.Charset="1" Font.Color="-16777208" Font.Height="-13" Font.Name="Arial Narrow" Font.Style="1" ParentFont="False" Text="Overall Totals"/>
<TfrxLineView Name="Line4" Left="0" Top="41.57483" Width="1028.03149606299" Height="0" ShowHint="False" Frame.Typ="4"/>
<TfrxMemoView Name="Memo22" Left="400.63018" Top="18.89765" Width="71.81107" Height="18.89765" ShowHint="False" DataSet="ds" DataSetName="ds" DisplayFormat.FormatStr="%2.2m" DisplayFormat.Kind="fkNumeric" Font.Charset="1" Font.Color="-16777208" Font.Height="-13" Font.Name="Arial Narrow" Font.Style="0" HAlign="haRight" ParentFont="False" Text="[SUM(<ds."GrandTotal">)]"/>
<TfrxMemoView Name="Memo23" Left="476.22078" Top="18.89765" Width="64.251968503937" Height="18.89765" ShowHint="False" DataSet="ds" DataSetName="ds" DisplayFormat.FormatStr="%2.2m" DisplayFormat.Kind="fkNumeric" Font.Charset="1" Font.Color="-16777208" Font.Height="-13" Font.Name="Arial Narrow" Font.Style="0" HAlign="haRight" HideZeros="True" ParentFont="False" Text="[SUM(<ds."VATIncluded">)]"/>
<TfrxMemoView Name="Memo24" Left="544.25232" Top="18.89765" Width="64.2519685" Height="18.89765" ShowHint="False" DataSet="ds" DataSetName="ds" DisplayFormat.FormatStr="%2.2m" DisplayFormat.Kind="fkNumeric" Font.Charset="1" Font.Color="-16777208" Font.Height="-13" Font.Name="Arial Narrow" Font.Style="0" HAlign="haRight" HideZeros="True" ParentFont="False" Text="[SUM(<ds."VATDeducted">)]"/>
<TfrxMemoView Name="Memo25" Left="941.10297" Top="18.89765" Width="86.92919" Height="18.89765" ShowHint="False" DataSet="ds" DataSetName="ds" DisplayFormat.FormatStr="%2.2m" DisplayFormat.Kind="fkNumeric" Font.Charset="1" Font.Color="-16777208" Font.Height="-13" Font.Name="Arial Narrow" Font.Style="0" HAlign="haRight" HideZeros="True" ParentFont="False" Text="[SUM(<ds."RefundAmount">)]"/>
<TfrxLineView Name="Line5" Left="0" Top="15.11812" Width="1028.03149606" Height="0" ShowHint="False" Frame.Typ="4"/>
<TfrxMemoView Name="Memo26" Left="801.26036" Top="18.89765" Width="71.81107" Height="18.89765" ShowHint="False" DataSet="ds" DataSetName="ds" DisplayFormat.FormatStr="%g" DisplayFormat.Kind="fkNumeric" Font.Charset="1" Font.Color="-16777208" Font.Height="-13" Font.Name="Arial Narrow" Font.Style="0" ParentFont="False" Text="Orders: [COUNT()]"/>
</TfrxFooter>
<TfrxReportSummary Name="ReportSummary1" Height="30.23624" Left="0" Top="589.60668" Width="1028.03216">
<TfrxMemoView Name="mmRefundsNote" Left="0" Top="3.77953" Width="1028.03149606299" Height="18.89765" ShowHint="False" DataSet="ds" DataSetName="ds" Font.Charset="1" Font.Color="-16777208" Font.Height="-13" Font.Name="Arial Narrow" Font.Style="1" ParentFont="False" Text="N.B. The refund figures shown in this report are for information purposes only. To obtain correct refund figures for accounting purposes in the correct period please see the Refunds report."/>
</TfrxReportSummary>
<TfrxGroupHeader Name="GroupHeader2" Height="2.197E-5" Left="0" Top="139.84261" Width="1028.03216" Condition="ds."PostalArea"" StartNewPage="True"/>
<TfrxGroupFooter Name="GroupFooter2" Height="30.23622047" Left="0" Top="427.08689" Width="1028.03216">
<TfrxMemoView Name="Memo31" Left="0" Top="3.77953" Width="389.29159" Height="18.89765" ShowHint="False" DataSet="ds" DataSetName="ds" Font.Charset="1" Font.Color="-16777208" Font.Height="-13" Font.Name="Arial Narrow" Font.Style="1" ParentFont="False" Text="Totals for [ds."PostalArea"]"/>
<TfrxLineView Name="Line6" Left="0" Top="0" Width="1028.03149606" Height="0" ShowHint="False" Frame.Typ="4"/>
<TfrxMemoView Name="Memo32" Left="400.63018" Top="3.77953" Width="71.81107" Height="18.89765" ShowHint="False" DataSet="ds" DataSetName="ds" DisplayFormat.FormatStr="%2.2m" DisplayFormat.Kind="fkNumeric" Font.Charset="1" Font.Color="-16777208" Font.Height="-13" Font.Name="Arial Narrow" Font.Style="0" HAlign="haRight" ParentFont="False" Text="[SUM(<ds."GrandTotal">)]"/>
<TfrxMemoView Name="Memo33" Left="476.22078" Top="3.77953" Width="64.2519685" Height="18.89765" ShowHint="False" DataSet="ds" DataSetName="ds" DisplayFormat.FormatStr="%2.2m" DisplayFormat.Kind="fkNumeric" Font.Charset="1" Font.Color="-16777208" Font.Height="-13" Font.Name="Arial Narrow" Font.Style="0" HAlign="haRight" HideZeros="True" ParentFont="False" Text="[SUM(<ds."VATIncluded">)]"/>
<TfrxMemoView Name="Memo34" Left="544.25232" Top="3.77953" Width="64.2519685" Height="18.89765" ShowHint="False" DataSet="ds" DataSetName="ds" DisplayFormat.FormatStr="%2.2m" DisplayFormat.Kind="fkNumeric" Font.Charset="1" Font.Color="-16777208" Font.Height="-13" Font.Name="Arial Narrow" Font.Style="0" HAlign="haRight" HideZeros="True" ParentFont="False" Text="[SUM(<ds."VATDeducted">)]"/>
<TfrxMemoView Name="Memo35" Left="941.10297" Top="3.77953" Width="86.92919" Height="18.89765" ShowHint="False" DataSet="ds" DataSetName="ds" DisplayFormat.FormatStr="%2.2m" DisplayFormat.Kind="fkNumeric" Font.Charset="1" Font.Color="-16777208" Font.Height="-13" Font.Name="Arial Narrow" Font.Style="0" HAlign="haRight" HideZeros="True" ParentFont="False" Text="[SUM(<ds."RefundAmount">)]"/>
<TfrxMemoView Name="Memo36" Left="801.26036" Top="3.77953" Width="71.81107" Height="18.89765" ShowHint="False" DataSet="ds" DataSetName="ds" DisplayFormat.FormatStr="%g" DisplayFormat.Kind="fkNumeric" Font.Charset="1" Font.Color="-16777208" Font.Height="-13" Font.Name="Arial Narrow" Font.Style="0" ParentFont="False" Text="Orders: [COUNT()]"/>
<TfrxLineView Name="Line3" Left="0" Top="26.45671" Width="1028.03149606299" Height="0" ShowHint="False" Frame.Typ="4"/>
</TfrxGroupFooter>
<TfrxGroupHeader Name="GroupHeader3" Height="34.01574803" Left="0" Top="162.51979" Visible="False" Width="1028.03216" Condition="ds."VATable""/>
<TfrxGroupFooter Name="GroupFooter3" Height="30.23622047" Left="0" Top="374.17347" Width="1028.03216">
<TfrxMemoView Name="Memo37" Left="0" Top="3.77953" Width="389.29159" Height="18.89765" ShowHint="False" DataSet="ds" DataSetName="ds" Font.Charset="1" Font.Color="-16777208" Font.Height="-13" Font.Name="Arial Narrow" Font.Style="1" ParentFont="False" Text="Totals for [ds."PostalArea"] / [ds."VATable"]"/>
<TfrxLineView Name="Line7" Left="0" Top="0" Width="1028.03149606299" Height="0" ShowHint="False" Frame.Typ="4"/>
<TfrxMemoView Name="Memo38" Left="400.63018" Top="3.77953" Width="71.81107" Height="18.89765" ShowHint="False" DataSet="ds" DataSetName="ds" DisplayFormat.FormatStr="%2.2m" DisplayFormat.Kind="fkNumeric" Font.Charset="1" Font.Color="-16777208" Font.Height="-13" Font.Name="Arial Narrow" Font.Style="0" HAlign="haRight" ParentFont="False" Text="[SUM(<ds."GrandTotal">)]"/>
<TfrxMemoView Name="Memo39" Left="476.22078" Top="3.77953" Width="64.2519685" Height="18.89765" ShowHint="False" DataSet="ds" DataSetName="ds" DisplayFormat.FormatStr="%2.2m" DisplayFormat.Kind="fkNumeric" Font.Charset="1" Font.Color="-16777208" Font.Height="-13" Font.Name="Arial Narrow" Font.Style="0" HAlign="haRight" HideZeros="True" ParentFont="False" Text="[SUM(<ds."VATIncluded">)]"/>
<TfrxMemoView Name="Memo40" Left="544.25232" Top="3.77953" Width="64.2519685" Height="18.89765" ShowHint="False" DataSet="ds" DataSetName="ds" DisplayFormat.FormatStr="%2.2m" DisplayFormat.Kind="fkNumeric" Font.Charset="1" Font.Color="-16777208" Font.Height="-13" Font.Name="Arial Narrow" Font.Style="0" HAlign="haRight" HideZeros="True" ParentFont="False" Text="[SUM(<ds."VATDeducted">)]"/>
<TfrxMemoView Name="Memo41" Left="941.10297" Top="3.77953" Width="86.92919" Height="18.89765" ShowHint="False" DataSet="ds" DataSetName="ds" DisplayFormat.FormatStr="%2.2m" DisplayFormat.Kind="fkNumeric" Font.Charset="1" Font.Color="-16777208" Font.Height="-13" Font.Name="Arial Narrow" Font.Style="0" HAlign="haRight" HideZeros="True" ParentFont="False" Text="[SUM(<ds."RefundAmount">)]"/>
<TfrxMemoView Name="Memo42" Left="801.26036" Top="3.77953" Width="71.81107" Height="18.89765" ShowHint="False" DataSet="ds" DataSetName="ds" DisplayFormat.FormatStr="%g" DisplayFormat.Kind="fkNumeric" Font.Charset="1" Font.Color="-16777208" Font.Height="-13" Font.Name="Arial Narrow" Font.Style="0" ParentFont="False" Text="Orders: [COUNT()]"/>
</TfrxGroupFooter>
</TfrxReportPage>
</TfrxReport>
N���* B�,� Weeks Stock DROP TEMPORARY TABLE IF EXISTS tmp_1month;
CREATE TEMPORARY TABLE tmp_1month
SELECT ProductCode, SUM(Qty) AS QtySold1Month FROM orderdetails
INNER JOIN orders ON orders.OrderNo = orderdetails.OrderNo
WHERE Status <> "CANCELLED" AND Status <> "ORDER PLACED" AND DATE(DateTimeOrdered) >= CURRENT_DATE - INTERVAL 30 DAY
GROUP BY ProductCode;
DROP TEMPORARY TABLE IF EXISTS tmp_3months;
CREATE TEMPORARY TABLE tmp_3months
SELECT ProductCode, SUM(Qty) AS QtySold3Months FROM orderdetails
INNER JOIN orders ON orders.OrderNo = orderdetails.OrderNo
WHERE Status <> "CANCELLED" AND Status <> "ORDER PLACED" AND DATE(DateTimeOrdered) >= CURRENT_DATE - INTERVAL 91 DAY
GROUP BY ProductCode;
DROP TEMPORARY TABLE IF EXISTS tmp_6months;
CREATE TEMPORARY TABLE tmp_6months
SELECT ProductCode, SUM(Qty) AS QtySold6Months FROM orderdetails
INNER JOIN orders ON orders.OrderNo = orderdetails.OrderNo
WHERE Status <> "CANCELLED" AND Status <> "ORDER PLACED" AND DATE(DateTimeOrdered) >= CURRENT_DATE - INTERVAL 182 DAY
GROUP BY ProductCode;
DROP TEMPORARY TABLE IF EXISTS tmp_12months;
CREATE TEMPORARY TABLE tmp_12months
SELECT ProductCode, SUM(Qty) AS QtySold12Months FROM orderdetails
INNER JOIN orders ON orders.OrderNo = orderdetails.OrderNo
WHERE Status <> "CANCELLED" AND Status <> "ORDER PLACED" AND DATE(DateTimeOrdered) >= CURRENT_DATE - INTERVAL 365 DAY
GROUP BY ProductCode;
SELECT p.ProductCode, ProductName, NumInStock, SupplierName,
NumInStock / (t1.QtySold1Month / (30 / 7)) AS WeeksStock1,
NumInStock / (t3.QtySold3Months / (91 / 7)) AS WeeksStock3,
NumInStock / (t6.QtySold6Months / (182 / 7)) AS WeeksStock6,
NumInStock / (t12.QtySold12Months / (365 / 7)) AS WeeksStock12,
t1.QtySold1Month, t3.QtySold3Months, t12.QtySold12Months
FROM products p
LEFT JOIN tmp_1month t1 ON t1.ProductCode = p.ProductCode
LEFT JOIN tmp_3months t3 ON t3.ProductCode = p.ProductCode
LEFT JOIN tmp_6months t6 ON t6.ProductCode = p.ProductCode
LEFT JOIN tmp_12months t12 ON t12.ProductCode = p.ProductCode
INNER JOIN suppliers ON suppliers.SupplierID = p.SupplierID
WHERE NOT ProductDisabled AND NumInStock IS NOT NULL
ORDER BY [SORTBY]P! <?xml version="1.0" encoding="utf-8"?>
<TfrxReport Version="4.10.1" DotMatrixReport="False" IniFile="\Software\Fast Reports" PreviewOptions.AllowEdit="False" PreviewOptions.Buttons="1465" PreviewOptions.Zoom="1" PrintOptions.Printer="Default" PrintOptions.PrintOnSheet="0" ReportOptions.Compressed="True" ReportOptions.CreateDate="39024.4955783102" ReportOptions.Description.Text="" ReportOptions.LastChange="40949.7820562269" ScriptLanguage="PascalScript" ScriptText.Text="begin end." PropData="044C656674022C03546F70021408446174617365747301010C1E00000020446174615365743D2264732220446174615365744E616D653D226473220000095661726961626C657301010C16000000204E616D653D2220495450207661726961626C65732200010C21000000204E616D653D227374725265706F72745469746C65222056616C75653D2227272200010C24000000204E616D653D227374725265706F72745375627469746C65222056616C75653D2227272200010C29000000204E616D653D22737472557365724E616D65222056616C75653D22276879706572666C69676874272200010C24000000204E616D653D22737472456D61696C5369676E6174757265222056616C75653D2227272200010C28000000204E616D653D22737472456D61696C5369676E617475726548544D4C222056616C75653D2227272200010C1E000000204E616D653D227374724D65737361676531222056616C75653D2227272200010C1E000000204E616D653D227374724D65737361676532222056616C75653D2227272200010C27000000204E616D653D22746B6E534F52544259222056616C75653D22275765656B7353746F636B3127220000055374796C650100">
<TfrxDataPage Name="Data" Height="1000" Left="0" Top="0" Width="1000"/>
<TfrxReportPage Name="Page1" Orientation="poLandscape" PaperWidth="297" PaperHeight="210" PaperSize="9" LeftMargin="15" RightMargin="10" TopMargin="10" BottomMargin="10" ColumnWidth="0" ColumnPositions.Text="" HGuides.Text="" VGuides.Text="">
<TfrxPageHeader Name="PageHeader1" Height="68.03154" Left="0" Top="18.89765" Width="1028.03216">
<TfrxMemoView Name="Memo7" Left="0" Top="0" Width="109.15739" Height="24" ShowHint="False" Font.Charset="1" Font.Color="0" Font.Height="-19" Font.Name="Times New Roman" Font.Style="1" Frame.Typ="8" ParentFont="False" Text="Weeks Stock"/>
<TfrxMemoView Name="Memo1" Left="0" Top="37.7953" Width="188.9765" Height="18.89765" ShowHint="False" DisplayFormat.DecimalSeparator="." Font.Charset="1" Font.Color="-16777208" Font.Height="-13" Font.Name="Arial" Font.Style="1" Frame.Typ="8" ParentFont="False" Text="Product Code"/>
<TfrxMemoView Name="Memo2" Left="192.75603" Top="37.7953" Width="260.78757" Height="18.89765" ShowHint="False" DisplayFormat.DecimalSeparator="." Font.Charset="1" Font.Color="-16777208" Font.Height="-13" Font.Name="Arial" Font.Style="1" Frame.Typ="8" ParentFont="False" Text="Product Name"/>
<TfrxMemoView Name="Memo3" Left="563.14997" Top="37.7953" Width="83.14966" Height="18.89765" ShowHint="False" DisplayFormat.DecimalSeparator="." Font.Charset="1" Font.Color="-16777208" Font.Height="-13" Font.Name="Arial" Font.Style="1" Frame.Typ="8" HAlign="haRight" ParentFont="False" Text="Stock"/>
<TfrxMemoView Name="Memo4" Left="657.63822" Top="7.55906" Width="83.14966" Height="49.13389" ShowHint="False" DisplayFormat.DecimalSeparator="." Font.Charset="1" Font.Color="-16777208" Font.Height="-13" Font.Name="Arial" Font.Style="1" Frame.Typ="8" HAlign="haRight" ParentFont="False" Text="Weeks Stock (1 month)"/>
<TfrxMemoView Name="Memo5" Left="752.12647" Top="7.55906" Width="83.14966" Height="49.13389" ShowHint="False" DisplayFormat.DecimalSeparator="." Font.Charset="1" Font.Color="-16777208" Font.Height="-13" Font.Name="Arial" Font.Style="1" Frame.Typ="8" HAlign="haRight" ParentFont="False" Text="Weeks Stock (3 months)"/>
<TfrxMemoView Name="Memo6" Left="846.61472" Top="7.55906" Width="83.14966" Height="49.13389" ShowHint="False" DisplayFormat.DecimalSeparator="." Font.Charset="1" Font.Color="-16777208" Font.Height="-13" Font.Name="Arial" Font.Style="1" Frame.Typ="8" HAlign="haRight" ParentFont="False" Text="Weeks Stock (6 months)"/>
<TfrxMemoView Name="Memo10" Left="941.10297" Top="7.55906" Width="83.14966" Height="49.13389" ShowHint="False" DisplayFormat.DecimalSeparator="." Font.Charset="1" Font.Color="-16777208" Font.Height="-13" Font.Name="Arial" Font.Style="1" Frame.Typ="8" HAlign="haRight" ParentFont="False" Text="Weeks Stock (12 months)"/>
<TfrxMemoView Name="Memo11" Left="461.10266" Top="37.7953" Width="83.14966" Height="18.89765" ShowHint="False" DisplayFormat.DecimalSeparator="." Font.Charset="1" Font.Color="-16777208" Font.Height="-13" Font.Name="Arial" Font.Style="1" Frame.Typ="8" ParentFont="False" Text="Supplier"/>
</TfrxPageHeader>
<TfrxMasterData Name="MasterData1" Height="22.67718" Left="0" Top="147.40167" Width="1028.03216" ColumnWidth="0" ColumnGap="0" DataSet="ds" DataSetName="ds" RowCount="0">
<TfrxMemoView Name="dsProductCode" Left="0" Top="0" Width="188.9765" Height="18.89765" ShowHint="False" DataField="ProductCode" DataSet="ds" DataSetName="ds" Font.Charset="1" Font.Color="-16777208" Font.Height="-13" Font.Name="Arial" Font.Style="0" ParentFont="False" Text="[ds."ProductCode"]"/>
<TfrxMemoView Name="dsProductName" Left="192.75603" Top="0" Width="260.78757" Height="18.89765" ShowHint="False" DataField="ProductName" DataSet="ds" DataSetName="ds" Font.Charset="1" Font.Color="-16777208" Font.Height="-13" Font.Name="Arial" Font.Style="0" ParentFont="False" Text="[ds."ProductName"]"/>
<TfrxMemoView Name="dsNumInStock" Left="566.9295" Top="0" Width="79.37013" Height="18.89765" ShowHint="False" DataField="NumInStock" DataSet="ds" DataSetName="ds" DisplayFormat.FormatStr="%2.2f" Font.Charset="1" Font.Color="-16777208" Font.Height="-13" Font.Name="Arial" Font.Style="0" HAlign="haRight" ParentFont="False" Text="[ds."NumInStock"]"/>
<TfrxMemoView Name="dsWeeksStock1" Left="657.63822" Top="0" Width="83.14966" Height="18.89765" ShowHint="False" DataField="WeeksStock1" DataSet="ds" DataSetName="ds" DisplayFormat.FormatStr="%2.2f" DisplayFormat.Kind="fkNumeric" Font.Charset="1" Font.Color="-16777208" Font.Height="-13" Font.Name="Arial" Font.Style="0" HAlign="haRight" ParentFont="False" Text="[ds."WeeksStock1"]"/>
<TfrxMemoView Name="dsWeeksStock3" Left="752.12647" Top="0" Width="83.14966" Height="18.89765" ShowHint="False" DataField="WeeksStock3" DataSet="ds" DataSetName="ds" DisplayFormat.FormatStr="%2.2f" DisplayFormat.Kind="fkNumeric" Font.Charset="1" Font.Color="-16777208" Font.Height="-13" Font.Name="Arial" Font.Style="0" HAlign="haRight" ParentFont="False" Text="[ds."WeeksStock3"]"/>
<TfrxMemoView Name="dsWeeksStock6" Left="846.61472" Top="0" Width="83.1496063" Height="18.89765" ShowHint="False" DataField="WeeksStock6" DataSet="ds" DataSetName="ds" DisplayFormat.FormatStr="%2.2f" DisplayFormat.Kind="fkNumeric" Font.Charset="1" Font.Color="-16777208" Font.Height="-13" Font.Name="Arial" Font.Style="0" HAlign="haRight" ParentFont="False" Text="[ds."WeeksStock6"]"/>
<TfrxMemoView Name="dsWeeksStock12" Left="941.10297" Top="0" Width="83.1496063" Height="18.89765" ShowHint="False" DataField="WeeksStock12" DataSet="ds" DataSetName="ds" DisplayFormat.FormatStr="%2.2f" DisplayFormat.Kind="fkNumeric" Font.Charset="1" Font.Color="-16777208" Font.Height="-13" Font.Name="Arial" Font.Style="0" HAlign="haRight" ParentFont="False" Text="[ds."WeeksStock12"]"/>
<TfrxMemoView Name="dsSupplierName" Left="461.10266" Top="0" Width="105.82684" Height="18.89765" ShowHint="False" DataField="SupplierName" DataSet="ds" DataSetName="ds" Font.Charset="1" Font.Color="-16777208" Font.Height="-13" Font.Name="Arial" Font.Style="0" ParentFont="False" Text="[ds."SupplierName"]"/>
</TfrxMasterData>
<TfrxPageFooter Name="PageFooter1" Height="22.67718" Left="0" Top="230.55133" Width="1028.03216">
<TfrxMemoView Name="Memo8" Left="0" Top="0" Width="225" Height="20" ShowHint="False" StretchMode="smMaxHeight" Font.Charset="1" Font.Color="0" Font.Height="-13" Font.Name="Times New Roman" Font.Style="2" ParentFont="False" Text="[<DATE>] [FORMATDATETIME('h:mm am/pm', <TIME>)]"/>
<TfrxMemoView Name="Memo9" Left="880.63049" Top="0" Width="144.77953" Height="20" ShowHint="False" StretchMode="smMaxHeight" Font.Charset="1" Font.Color="0" Font.Height="-13" Font.Name="Times New Roman" Font.Style="2" HAlign="haRight" ParentFont="False" Text="Page [Page#] of [TotalPages#]"/>
</TfrxPageFooter>
</TfrxReportPage>
</TfrxReport>
O5T�E�@�,� Profit Analysis� p SELECT od.ProductID, p.ProductCode, p.ProductName, SUM(Qty) AS QtySold,
p.CostPrice * SUM(Qty) AS CostOfSales, SUM(PriceEach * Qty) AS Sales,
SUM(PriceEach * Qty) - (p.CostPrice * SUM(Qty)) AS GrossProfit,
ROUND((SUM(PriceEach * Qty) - (p.CostPrice * SUM(Qty))) / (p.CostPrice * SUM(Qty)) * 100, 2) AS AveMarkup
FROM orderdetails od
INNER JOIN products p ON p.ProductID = od.ProductID
INNER JOIN orders o ON o.OrderNo = od.OrderNo
WHERE Status <> "CANCELLED" AND Status <> "ORDER PLACED"
AND DATE(DateTimeOrdered) >= "[STARTDATE]" AND DATE(DateTimeOrdered) <= "[ENDDATE]"
GROUP BY ProductID
ORDER BY [SORTBY] DESCWC <?xml version="1.0" encoding="utf-8"?>
<TfrxReport Version="4.10.1" DotMatrixReport="False" EngineOptions.DoublePass="True" IniFile="\Software\Fast Reports" PreviewOptions.AllowEdit="False" PreviewOptions.Buttons="1465" PreviewOptions.Zoom="1" PrintOptions.Printer="Default" PrintOptions.PrintOnSheet="0" ReportOptions.Compressed="True" ReportOptions.CreateDate="39024.4955783102" ReportOptions.Description.Text="" ReportOptions.LastChange="41347.8371038889" ScriptLanguage="PascalScript" ScriptText.Text="// (SS,8/3/2013) & (SS,14/3/2013) const VATFACTOR = 1.2; // i.e. 20% VAT ((100 + 20)/100) var FTotalProfit: Double; procedure MasterData1OnBeforePrint(Sender: TfrxComponent); begin // add up profit on first pass if not Engine.FinalPass then FTotalProfit := FTotalProfit + <ds."GrossProfit"> ; end; // From [<tknSTARTDATE>] to [<tknENDDATE>] sorted by [<tknSORTBY>] with VAT [<tknVAT>] function GetSubtitle: String; var LStartDate, LEndDate: TDateTime; LDays: Double; begin LStartDate := GetDateFromTokenVar(<tknSTARTDATE>); LEndDate := GetDateFromTokenVar(<tknENDDATE>); LDays := LEndDate - LStartDate + 1; Result := 'From ' + DateToStr(LStartDate) + ' to ' + DateToStr(LEndDate) + ' (' + FloatToStr(LDays) + ' days). Sorted by ' + <tknSORTBY> + ' with VAT ' + <tknVAT> + '.'; end; // converts string in 2013-03-14 format to datetime function GetDateFromTokenVar(const ADateStr: String): TDateTime; begin Result := StrToDate(Copy(ADateStr, 9, 2) + '/' + Copy(ADateStr, 6, 2) + '/' + Copy(ADateStr, 1, 4)); end; // [IIf(VarType(<ds."CostPrice">) = varDouble, IIF(<tknVAT> = 'Included', <ds."CostPrice">, <ds."CostPrice"> / <VATFACTOR>), '')] // function used to simplify the above, returning a string rather than Variant would also work function VATAdjust(const AValue: Variant): Variant; begin if VarType(AValue) = varDouble then begin if <tknVAT> = 'Included' then Result := AValue else Result := AValue / VATFACTOR; end else Result := Null; end; // [IIf(VarType(<ds."StockRotationRatio">) = varDouble, <ds."StockRotationRatio">, 0)] // simplifies the above function NullAsZero(const AValue: Variant): Double; begin if VarType(AValue) = varDouble then Result := AValue else Result := 0; end; // [IIf(VarType(<ds."AveMarkup">) = varDouble, <ds."AveMarkup">, '')][IIf(VarType(<ds."AveMarkup">) = varDouble, '%', '')] // used to simplify the above, returns value with % at the end if not null function PctSuffix(const AValue: Variant): String; begin if VarType(AValue) = varDouble then Result := Format('%0.1n', [AValue]) + '%' else Result := ''; end; // [IIF(SUM(<ds."CostOfSales">) = 0, 0, SUM(<ds."GrossProfit">) / SUM(<ds."CostOfSales">)) * 100]% // does a divide by zero without error, dividing by zero results in 0 function SafeDivide(const ADividend, ADivisor: Variant): Double; begin if ADivisor = 0 then Result := 0 else Result := ADividend / ADivisor; end; begin FTotalProfit := 0; end." PropData="044C656674022C03546F70021408446174617365747301010C1E00000020446174615365743D2264732220446174615365744E616D653D226473220000095661726961626C657301010C16000000204E616D653D2220495450207661726961626C65732200010C21000000204E616D653D227374725265706F72745469746C65222056616C75653D2227272200010C24000000204E616D653D227374725265706F72745375627469746C65222056616C75653D2227272200010C29000000204E616D653D22737472557365724E616D65222056616C75653D22276879706572666C69676874272200010C24000000204E616D653D22737472456D61696C5369676E6174757265222056616C75653D2227272200010C28000000204E616D653D22737472456D61696C5369676E617475726548544D4C222056616C75653D2227272200010C1E000000204E616D653D227374724D65737361676531222056616C75653D2227272200010C1E000000204E616D653D227374724D65737361676532222056616C75653D2227272200010C25000000204E616D653D22746B6E534F52544259222056616C75653D22274176654D61726B7570272200010C29000000204E616D653D22746B6E535441525444415445222056616C75653D2227323031322D30332D3134272200010C27000000204E616D653D22746B6E454E4444415445222056616C75653D2227323031332D30332D3133272200010C21000000204E616D653D22746B6E564154222056616C75653D22274578636C7564656427220000055374796C650100">
<TfrxDataPage Name="Data" Height="1000" Left="0" Top="0" Width="1000"/>
<TfrxReportPage Name="Page1" Orientation="poLandscape" PaperWidth="297" PaperHeight="210" PaperSize="9" LeftMargin="15" RightMargin="15" TopMargin="15" BottomMargin="15" ColumnWidth="0" ColumnPositions.Text="" HGuides.Text="" VGuides.Text="" OnBeforePrint="Page1OnBeforePrint">
<TfrxPageHeader Name="PageHeader1" Height="75.5906" Left="0" Top="18.89765" Width="1009.13451">
<TfrxMemoView Name="Memo7" Left="0" Top="0" Width="139.39363" Height="24" ShowHint="False" Font.Charset="1" Font.Color="0" Font.Height="-19" Font.Name="Arial" Font.Style="1" Frame.Typ="8" ParentFont="False" Text="Profit Analysis"/>
<TfrxMemoView Name="Memo1" Left="0" Top="45.35436" Width="188.9765" Height="18.89765" ShowHint="False" DisplayFormat.DecimalSeparator="." Font.Charset="1" Font.Color="-16777208" Font.Height="-13" Font.Name="Arial" Font.Style="1" Frame.Typ="8" ParentFont="False" Text="Product Code"/>
<TfrxMemoView Name="Memo2" Left="196.53556" Top="45.35436" Width="260.78757" Height="18.89765" ShowHint="False" DisplayFormat.DecimalSeparator="." Font.Charset="1" Font.Color="-16777208" Font.Height="-13" Font.Name="Arial" Font.Style="1" Frame.Typ="8" ParentFont="False" Text="Product Name"/>
<TfrxMemoView Name="Memo3" Left="464.88219" Top="45.35436" Width="79.37013" Height="18.89765" ShowHint="False" DisplayFormat.DecimalSeparator="." Font.Charset="1" Font.Color="-16777208" Font.Height="-13" Font.Name="Arial" Font.Style="1" Frame.Typ="8" HAlign="haRight" ParentFont="False" Text="Qty Sold"/>
<TfrxMemoView Name="Memo4" Left="555.59091" Top="30.23624" Width="83.14966" Height="34.01577" ShowHint="False" DisplayFormat.DecimalSeparator="." Font.Charset="1" Font.Color="-16777208" Font.Height="-13" Font.Name="Arial" Font.Style="1" Frame.Typ="8" HAlign="haRight" ParentFont="False" Text="Cost of Sales"/>
<TfrxMemoView Name="Memo5" Left="650.07916" Top="45.35436" Width="83.14966" Height="18.89765" ShowHint="False" DisplayFormat.DecimalSeparator="." Font.Charset="1" Font.Color="-16777208" Font.Height="-13" Font.Name="Arial" Font.Style="1" Frame.Typ="8" HAlign="haRight" ParentFont="False" Text="Sales"/>
<TfrxMemoView Name="Memo6" Left="744.56741" Top="30.23624" Width="83.14966" Height="34.01577" ShowHint="False" DisplayFormat.DecimalSeparator="." Font.Charset="1" Font.Color="-16777208" Font.Height="-13" Font.Name="Arial" Font.Style="1" Frame.Typ="8" HAlign="haRight" ParentFont="False" Text="Gross Profit"/>
<TfrxMemoView Name="Memo10" Left="839.05566" Top="30.23624" Width="83.14966" Height="34.01577" ShowHint="False" DisplayFormat.DecimalSeparator="." Font.Charset="1" Font.Color="-16777208" Font.Height="-13" Font.Name="Arial" Font.Style="1" Frame.Typ="8" HAlign="haRight" ParentFont="False" Text="% Average Markup"/>
<TfrxMemoView Name="Memo17" Left="143.62214" Top="5.66929134" Width="480.00031" Height="18.89765" ShowHint="False" AutoWidth="True" DisplayFormat.DecimalSeparator="." Font.Charset="1" Font.Color="-16777208" Font.Height="-13" Font.Name="Arial" Font.Style="3" Frame.Typ="8" ParentFont="False" Text="[GetSubtitle]"/>
<TfrxMemoView Name="Memo18" Left="933.54391" Top="30.23624" Width="64.25201" Height="34.01577" ShowHint="False" DisplayFormat.DecimalSeparator="." Font.Charset="1" Font.Color="-16777208" Font.Height="-13" Font.Name="Arial" Font.Style="1" Frame.Typ="8" HAlign="haRight" ParentFont="False" Text="% Gross Profit"/>
</TfrxPageHeader>
<TfrxMasterData Name="MasterData1" Height="22.67718" Left="0" Top="154.96073" Width="1009.13451" OnBeforePrint="MasterData1OnBeforePrint" ColumnWidth="0" ColumnGap="0" DataSet="ds" DataSetName="ds" RowCount="0" OnMasterDetail="MasterData1OnMasterDetail">
<TfrxMemoView Name="dsProductCode" Left="0" Top="0" Width="188.9765" Height="18.89765" ShowHint="False" DataField="ProductCode" DataSet="ds" DataSetName="ds" Font.Charset="1" Font.Color="-16777208" Font.Height="-13" Font.Name="Arial" Font.Style="0" ParentFont="False" Text="[ds."ProductCode"]"/>
<TfrxMemoView Name="dsProductName" Left="196.53556" Top="0" Width="260.78757" Height="18.89765" ShowHint="False" DataField="ProductName" DataSet="ds" DataSetName="ds" Font.Charset="1" Font.Color="-16777208" Font.Height="-13" Font.Name="Arial" Font.Style="0" ParentFont="False" Text="[ds."ProductName"]"/>
<TfrxMemoView Name="dsNumInStock" Left="468.66172" Top="0" Width="75.5906" Height="18.89765" ShowHint="False" DataField="QtySold" DataSet="ds" DataSetName="ds" DisplayFormat.FormatStr="%2.0n" DisplayFormat.Kind="fkNumeric" Font.Charset="1" Font.Color="-16777208" Font.Height="-13" Font.Name="Arial" Font.Style="0" HAlign="haRight" ParentFont="False" Text="[ds."QtySold"]"/>
<TfrxMemoView Name="dsWeeksStock1" Left="555.59091" Top="0" Width="83.14966" Height="18.89765" ShowHint="False" DataSet="ds" DataSetName="ds" DisplayFormat.FormatStr="%2.2m" DisplayFormat.Kind="fkNumeric" Font.Charset="1" Font.Color="-16777208" Font.Height="-13" Font.Name="Arial" Font.Style="0" HAlign="haRight" ParentFont="False" Text="[VATAdjust(<ds."CostOfSales">)]"/>
<TfrxMemoView Name="dsWeeksStock3" Left="650.07916" Top="0" Width="83.14966" Height="18.89765" ShowHint="False" DataSet="ds" DataSetName="ds" DisplayFormat.FormatStr="%2.2m" DisplayFormat.Kind="fkNumeric" Font.Charset="1" Font.Color="-16777208" Font.Height="-13" Font.Name="Arial" Font.Style="0" HAlign="haRight" ParentFont="False" Text="[VATAdjust(<ds."Sales">)]"/>
<TfrxMemoView Name="dsWeeksStock6" Left="744.56741" Top="0" Width="83.1496063" Height="18.89765" ShowHint="False" DataSet="ds" DataSetName="ds" DisplayFormat.FormatStr="%2.2m" DisplayFormat.Kind="fkNumeric" Font.Charset="1" Font.Color="-16777208" Font.Height="-13" Font.Name="Arial" Font.Style="0" HAlign="haRight" ParentFont="False" Text="[VATAdjust(<ds."GrossProfit">)]"/>
<TfrxMemoView Name="Memo11" Left="839.05566" Top="0" Width="83.1496063" Height="18.89765" ShowHint="False" DataSet="ds" DataSetName="ds" DisplayFormat.FormatStr="%2.1n" DisplayFormat.Kind="fkNumeric" Font.Charset="1" Font.Color="-16777208" Font.Height="-13" Font.Name="Arial" Font.Style="0" HAlign="haRight" HideZeros="True" ParentFont="False" Text="[PctSuffix(<ds."AveMarkup">)]"/>
<TfrxMemoView Name="Memo15" Left="933.54391" Top="0" Width="64.2519563" Height="18.89765" ShowHint="False" DataSet="ds" DataSetName="ds" DisplayFormat.FormatStr="%2.2n" DisplayFormat.Kind="fkNumeric" Font.Charset="1" Font.Color="-16777208" Font.Height="-13" Font.Name="Arial" Font.Style="0" HAlign="haRight" ParentFont="False" Text="[IIf(VarType(<ds."GrossProfit">) = varDouble, <ds."GrossProfit"> / <FTotalProfit> * 100, '')][IIf(VarType(<ds."GrossProfit">) = varDouble, '%', '')]"/>
</TfrxMasterData>
<TfrxPageFooter Name="PageFooter1" Height="22.67718" Left="0" Top="317.48052" Width="1009.13451">
<TfrxMemoView Name="Memo8" Left="0" Top="0" Width="225" Height="20" ShowHint="False" StretchMode="smMaxHeight" Font.Charset="1" Font.Color="0" Font.Height="-13" Font.Name="Arial" Font.Style="2" ParentFont="False" Text="[<DATE>] [FORMATDATETIME('h:mm am/pm', <TIME>)]"/>
<TfrxMemoView Name="Memo9" Left="861.73284" Top="0" Width="144.77953" Height="20" ShowHint="False" StretchMode="smMaxHeight" Font.Charset="1" Font.Color="0" Font.Height="-13" Font.Name="Arial" Font.Style="2" HAlign="haRight" ParentFont="False" Text="Page [Page#] of [TotalPages#]"/>
</TfrxPageFooter>
<TfrxReportSummary Name="ReportSummary1" Height="56.69295" Left="0" Top="238.11039" Width="1009.13451">
<TfrxMemoView Name="Memo12" Left="468.66172" Top="3.77953" Width="75.5906" Height="18.89765" ShowHint="False" DataSet="ds" DataSetName="ds" DisplayFormat.FormatStr="%2.0n" DisplayFormat.Kind="fkNumeric" Font.Charset="1" Font.Color="-16777208" Font.Height="-13" Font.Name="Arial" Font.Style="0" Frame.Typ="4" HAlign="haRight" ParentFont="False" Text="[SUM(<ds."QtySold">)]"/>
<TfrxMemoView Name="Memo13" Left="555.59091" Top="3.77953" Width="83.14966" Height="18.89765" ShowHint="False" DataSet="ds" DataSetName="ds" DisplayFormat.FormatStr="%2.2m" DisplayFormat.Kind="fkNumeric" Font.Charset="1" Font.Color="-16777208" Font.Height="-13" Font.Name="Arial" Font.Style="0" Frame.Typ="4" HAlign="haRight" ParentFont="False" Text="[VATAdjust(SUM(<ds."CostOfSales">))]"/>
<TfrxMemoView Name="Memo14" Left="650.07916" Top="3.77953" Width="83.14966" Height="18.89765" ShowHint="False" DataSet="ds" DataSetName="ds" DisplayFormat.FormatStr="%2.2m" DisplayFormat.Kind="fkNumeric" Font.Charset="1" Font.Color="-16777208" Font.Height="-13" Font.Name="Arial" Font.Style="0" Frame.Typ="4" HAlign="haRight" ParentFont="False" Text="[VATAdjust(SUM(<ds."Sales">))]"/>
<TfrxMemoView Name="mvTotalProfit" Left="744.56741" Top="3.77953" Width="83.14966" Height="18.89765" ShowHint="False" DataSet="ds" DataSetName="ds" DisplayFormat.FormatStr="%2.2m" DisplayFormat.Kind="fkNumeric" Font.Charset="1" Font.Color="-16777208" Font.Height="-13" Font.Name="Arial" Font.Style="0" Frame.Typ="4" HAlign="haRight" ParentFont="False" Text="[VATAdjust(SUM(<ds."GrossProfit">))]"/>
<TfrxMemoView Name="Memo16" Left="839.05566" Top="3.77953" Width="83.14966" Height="18.89765" ShowHint="False" DataSet="ds" DataSetName="ds" DisplayFormat.FormatStr="%2.1n" DisplayFormat.Kind="fkNumeric" Font.Charset="1" Font.Color="-16777208" Font.Height="-13" Font.Name="Arial" Font.Style="0" Frame.Typ="4" HAlign="haRight" ParentFont="False" Text="[SUM(<ds."GrossProfit">) / SUM(<ds."CostOfSales">) * 100]%"/>
<TfrxMemoView Name="Memo19" Left="937.32344" Top="3.77953" Width="60.4724263" Height="18.89765" ShowHint="False" DataSet="ds" DataSetName="ds" DisplayFormat.FormatStr="%2.2n" DisplayFormat.Kind="fkNumeric" Font.Charset="1" Font.Color="-16777208" Font.Height="-13" Font.Name="Arial" Font.Style="0" Frame.Typ="4" HAlign="haRight" ParentFont="False" Text="[100]%"/>
</TfrxReportSummary>
</TfrxReportPage>
</TfrxReport>
Q9 yP�,�
Rate of Return v1 (old)� O DROP TEMPORARY TABLE IF EXISTS tmp_avestock;
CREATE TEMPORARY TABLE tmp_avestock
SELECT ProductID,
# "Av Stock Level". Calc this by totalling the [stock snapshot->No in Stock] for the date range,
# and dividing this by the number of days between start date and end date.
AVG(NumInStock) AS AveStock
FROM stock_snapshots
WHERE DateOfStock >= "[STARTDATE]" AND DateOfStock <= "[ENDDATE]"
GROUP BY ProductID;
DROP TEMPORARY TABLE IF EXISTS tmp_instock;
CREATE TEMPORARY TABLE tmp_instock
SELECT ProductID,
# In-stock %, Number of days when the stock snapshot >0 / date range * 100
COUNT(*) AS DaysInStock,
COUNT(*) / (DATEDIFF("[ENDDATE]", "[STARTDATE]") + 1) * 100 AS InStockPct
FROM stock_snapshots
WHERE NumInStock > 0
AND DateOfStock >= "[STARTDATE]" AND DateOfStock <= "[ENDDATE]"
GROUP BY ProductID;
DROP TEMPORARY TABLE IF EXISTS tmp_soldstock;
CREATE TEMPORARY TABLE tmp_soldstock
SELECT od.ProductID, SUM(Qty) AS QtySold,
p.CostPrice * SUM(Qty) AS CostOfSales, SUM(PriceEach * Qty) AS Sales,
SUM(PriceEach * Qty) - (p.CostPrice * SUM(Qty)) AS GrossProfit,
ROUND((SUM(PriceEach * Qty) - (p.CostPrice * SUM(Qty))) / (p.CostPrice * SUM(Qty)) * 100, 2) AS AveMarkup
FROM orderdetails od
INNER JOIN products p ON p.ProductID = od.ProductID
INNER JOIN orders o ON o.OrderNo = od.OrderNo
WHERE Status <> "CANCELLED" AND Status <> "ORDER PLACED"
AND DATE(DateTimeOrdered) >= "[STARTDATE]" AND DATE(DateTimeOrdered) <= "[ENDDATE]"
GROUP BY ProductID;
SELECT p.ProductID, ProductCode, ProductName, p.SupplierID, s.SupplierName, p.ProductDisabled,
p.CostPrice, p.NumInStock AS CurrentStock, tas.AveStock,
# weeks stock
p.NumInStock / tss.QtySold * ((DATEDIFF("[ENDDATE]", "[STARTDATE]") + 1) / 7) AS WeeksStock,
# In Stock % (also Days in stock which might be useful)
tis.DaysInStock, tis.InStockPct,
# Stock Rotation Ratio: Average Stock / Qty Sold
tss.QtySold / tas.AveStock AS StockRotationRatio,
# "Av Investment". Calc this from [Av Stock Level] * [Cost Price]
tas.AveStock * p.CostPrice AS AveInvestment,
# following helps in the group and report totals
tas.AveStock * p.CostPrice * (DATEDIFF("[ENDDATE]", "[STARTDATE]") + 1) / 365 AS Investment,
tss.QtySold, tss.CostOfSales, tss.Sales, tss.GrossProfit, tss.AveMarkup,
DATEDIFF("[ENDDATE]", "[STARTDATE]") + 1 AS NoOfDays,
# ROR%, Calc this from (100*[gross profit]*365)/([ Av investment]* No_of_days) -- I think!
# (100 * tss.GrossProfit * 365) / (tas.AveStock * p.CostPrice * (DATEDIFF("[ENDDATE]", "[STARTDATE]") + 1)) AS ROR
tss.GrossProfit / (tas.AveStock * p.CostPrice * (DATEDIFF("[ENDDATE]", "[STARTDATE]") + 1) / 365) * 100 AS ROR
FROM products p
LEFT JOIN tmp_avestock tas ON tas.ProductID = p.ProductID
LEFT JOIN tmp_soldstock tss ON tss.ProductID = p.ProductID
LEFT JOIN tmp_instock tis ON tis.ProductID = p.ProductID
LEFT JOIN suppliers s ON s.SupplierID = p.SupplierID
# only include if enabled or entry found in avestock or soldstock
WHERE p.ProductDisabled = FALSE OR (tas.ProductID IS NOT NULL AND tas.AveStock <> 0) OR tss.ProductID IS NOT NULL
ORDER BY SupplierName, SupplierID, [SORTBY];
�l <?xml version="1.0" encoding="utf-8"?>
<TfrxReport Version="4.10.1" DotMatrixReport="False" EngineOptions.DoublePass="True" IniFile="\Software\Fast Reports" PreviewOptions.AllowEdit="False" PreviewOptions.Buttons="1465" PreviewOptions.Zoom="1" PrintOptions.Printer="Default" PrintOptions.PrintOnSheet="0" ReportOptions.Compressed="True" ReportOptions.CreateDate="39024.4955783102" ReportOptions.Description.Text="" ReportOptions.LastChange="41348.6769091898" ScriptLanguage="PascalScript" ScriptText.Text="// (SS,8/3/2013) and (SS,14/3/13) const VATFACTOR = 1.2; // i.e. 20% VAT ((100 + 20)/100) procedure Page1OnBeforePrint(Sender: TfrxComponent); begin if <tknWeeksStockAlert> <> '' then mvLowStockAlert.Text := 'Low Stock Alert: Weeks Stock <= ' + <tknWeeksStockAlert> else mvLowStockAlert.Text := ''; end; // From [<tknSTARTDATE>] to [<tknENDDATE>] sorted by [<tknSORTBY>] with VAT [<tknVAT>] function GetSubtitle: String; var LStartDate, LEndDate: TDateTime; LDays: Double; begin LStartDate := GetDateFromTokenVar(<tknSTARTDATE>); LEndDate := GetDateFromTokenVar(<tknENDDATE>); LDays := LEndDate - LStartDate + 1; Result := 'From ' + DateToStr(LStartDate) + ' to ' + DateToStr(LEndDate) + ' (' + FloatToStr(LDays) + ' days). Sorted by ' + <tknSORTBY> + ' with VAT ' + <tknVAT> + '.'; end; // converts string in 2013-03-14 format to datetime function GetDateFromTokenVar(const ADateStr: String): TDateTime; begin Result := StrToDate(Copy(ADateStr, 9, 2) + '/' + Copy(ADateStr, 6, 2) + '/' + Copy(ADateStr, 1, 4)); end; // [IIf(VarType(<ds."CostPrice">) = varDouble, IIF(<tknVAT> = 'Included', <ds."CostPrice">, <ds."CostPrice"> / <VATFACTOR>), '')] // function used to simplify the above, returning a string rather than Variant would also work function VATAdjust(const AValue: Variant): Variant; begin if not IsNull(AValue) then begin if <tknVAT> = 'Included' then Result := AValue else Result := AValue / VATFACTOR; end else Result := Null; end; // [IIf(VarType(<ds."StockRotationRatio">) = varDouble, <ds."StockRotationRatio">, 0)] // simplifies the above function NullAsZero(const AValue: Variant): Double; begin if not IsNull(AValue) then Result := AValue else Result := 0; end; // [IIf(VarType(<ds."AveMarkup">) = varDouble, <ds."AveMarkup">, '')][IIf(VarType(<ds."AveMarkup">) = varDouble, '%', '')] // used to simplify the above, returns value with % at the end if not null function PctSuffix(const AValue: Variant): String; begin if not IsNull(AValue) then Result := Format('%0.1n', [AValue]) + '%' else Result := ''; end; // [IIF(SUM(<ds."CostOfSales">) = 0, 0, SUM(<ds."GrossProfit">) / SUM(<ds."CostOfSales">)) * 100]% // does a divide by zero without error, dividing by zero results in 0 function SafeDivide(const ADividend, ADivisor: Variant): Double; begin if ADivisor = 0 then Result := 0 else Result := ADividend / ADivisor; end; // a way that worked for check for a null where there's normally a double, not double means it's a null function IsNull(const AValue: Variant): Boolean; begin Result := VarType(AValue) <> varDouble; end; // used to highlight in red font if true, currently fields CurrentStock, QtySold and ROR are shown in red if true // (SS,15/3/13) changed to WeeksStock function LowStockAlert: Boolean; begin if <tknWeeksStockAlert> <> '' then begin //Result := (<ds."ProductDisabled"> = False) and (<ds."CurrentStock"> <= 0) and (<ds."QtySold"> >= 10) and (<ds."ROR"> >= 200); Result := (<ds."ProductDisabled"> = False) and not IsNull(<ds."WeeksStock">) and (Round(<ds."WeeksStock">) <= <tknWeeksStockAlert>); end else Result := False; end; begin end." PropData="044C656674022C03546F70021408446174617365747301010C1E00000020446174615365743D2264732220446174615365744E616D653D226473220000095661726961626C657301010C16000000204E616D653D2220495450207661726961626C65732200010C21000000204E616D653D227374725265706F72745469746C65222056616C75653D2227272200010C24000000204E616D653D227374725265706F72745375627469746C65222056616C75653D2227272200010C29000000204E616D653D22737472557365724E616D65222056616C75653D22276879706572666C69676874272200010C24000000204E616D653D22737472456D61696C5369676E6174757265222056616C75653D2227272200010C28000000204E616D653D22737472456D61696C5369676E617475726548544D4C222056616C75653D2227272200010C1E000000204E616D653D227374724D65737361676531222056616C75653D2227272200010C1E000000204E616D653D227374724D65737361676532222056616C75653D2227272200010C27000000204E616D653D22746B6E534F52544259222056616C75653D222750726F64756374436F6465272200010C29000000204E616D653D22746B6E535441525444415445222056616C75653D2227323031322D30332D3135272200010C27000000204E616D653D22746B6E454E4444415445222056616C75653D2227323031332D30332D3134272200010C21000000204E616D653D22746B6E564154222056616C75653D22274578636C75646564272200010C26000000204E616D653D22746B6E5745454B5353544F434B414C455254222056616C75653D22273227220000055374796C650100">
<TfrxDataPage Name="Data" Height="1000" Left="0" Top="0" Width="1000"/>
<TfrxReportPage Name="Page1" Orientation="poLandscape" PaperWidth="297" PaperHeight="210" PaperSize="9" LeftMargin="5" RightMargin="5" TopMargin="5" BottomMargin="5" ColumnWidth="0" ColumnPositions.Text="" HGuides.Text="" VGuides.Text="" OnBeforePrint="Page1OnBeforePrint">
<TfrxPageHeader Name="PageHeader1" Height="86.92919" Left="0" Top="18.89765" Width="1084.72511">
<TfrxMemoView Name="Memo7" Left="0" Top="0" Width="135.6141" Height="24" ShowHint="False" AutoWidth="True" Font.Charset="1" Font.Color="0" Font.Height="-19" Font.Name="Arial" Font.Style="1" Frame.Typ="8" ParentFont="False" Text="Rate of Return"/>
<TfrxMemoView Name="Memo1" Left="0" Top="60.47248" Width="151.1812" Height="18.89765" ShowHint="False" DisplayFormat.DecimalSeparator="." Font.Charset="1" Font.Color="-16777208" Font.Height="-13" Font.Name="Arial Narrow" Font.Style="1" Frame.Typ="8" ParentFont="False" Text="Product Code"/>
<TfrxMemoView Name="Memo2" Left="158.74026" Top="60.47248" Width="215.43321" Height="18.89765" ShowHint="False" DisplayFormat.DecimalSeparator="." Font.Charset="1" Font.Color="-16777208" Font.Height="-13" Font.Name="Arial Narrow" Font.Style="1" Frame.Typ="8" ParentFont="False" Text="Product Name"/>
<TfrxMemoView Name="Memo5" Left="820.15801" Top="45.35436" Width="56.69291339" Height="34.01577" ShowHint="False" DisplayFormat.DecimalSeparator="." Font.Charset="1" Font.Color="-16777208" Font.Height="-13" Font.Name="Arial Narrow" Font.Style="1" Frame.Typ="8" HAlign="haRight" ParentFont="False" Text="£ Sales"/>
<TfrxMemoView Name="Memo6" Left="884.41002" Top="30.23624" Width="56.69291339" Height="49.13389" ShowHint="False" DisplayFormat.DecimalSeparator="." Font.Charset="1" Font.Color="-16777208" Font.Height="-13" Font.Name="Arial Narrow" Font.Style="1" Frame.Typ="8" HAlign="haRight" ParentFont="False" Text="£ Gross Profit"/>
<TfrxMemoView Name="Memo10" Left="948.66203" Top="30.23624" Width="64.25196118" Height="49.13389" ShowHint="False" DisplayFormat.DecimalSeparator="." Font.Charset="1" Font.Color="-16777208" Font.Height="-13" Font.Name="Arial Narrow" Font.Style="1" Frame.Typ="8" HAlign="haRight" ParentFont="False" Text="% Average Markup"/>
<TfrxMemoView Name="Memo20" Left="582.04762" Top="30.23624" Width="45.35436" Height="49.13389" ShowHint="False" DisplayFormat.DecimalSeparator="." Font.Charset="1" Font.Color="-16777208" Font.Height="-13" Font.Name="Arial Narrow" Font.Style="1" Frame.Typ="8" HAlign="haRight" ParentFont="False" Text="Ave. Stock Level"/>
<TfrxMemoView Name="Memo15" Left="748.34694" Top="30.23624" Width="64.2519685" Height="49.13389" ShowHint="False" DisplayFormat.DecimalSeparator="." Font.Charset="1" Font.Color="-16777208" Font.Height="-13" Font.Name="Arial Narrow" Font.Style="1" Frame.Typ="8" HAlign="haRight" ParentFont="False" Text="£ Average Investment"/>
<TfrxMemoView Name="Memo23" Left="1020.4731" Top="30.23624" Width="64.25196118" Height="49.13389" ShowHint="False" DisplayFormat.DecimalSeparator="." Font.Charset="1" Font.Color="-16777208" Font.Height="-13" Font.Name="Arial Narrow" Font.Style="1" Frame.Typ="8" HAlign="haRight" ParentFont="False" Text="% Rate of Return"/>
<TfrxMemoView Name="mvSubtitle" Left="139.84261" Top="5.66929134" Width="555.59091" Height="18.89765" ShowHint="False" AutoWidth="True" DisplayFormat.DecimalSeparator="." Font.Charset="1" Font.Color="-16777208" Font.Height="-13" Font.Name="Arial" Font.Style="3" Frame.Typ="8" ParentFont="False" Text="[GetSubtitle]"/>
<TfrxMemoView Name="Memo4" Left="638.74057" Top="30.23624" Width="45.35436" Height="49.13389" ShowHint="False" DisplayFormat.DecimalSeparator="." Font.Charset="1" Font.Color="-16777208" Font.Height="-13" Font.Name="Arial Narrow" Font.Style="1" Frame.Typ="8" HAlign="haRight" ParentFont="False" Text="% In Stock"/>
<TfrxMemoView Name="Memo28" Left="691.65399" Top="30.23624" Width="49.13389" Height="49.13389" ShowHint="False" DisplayFormat.DecimalSeparator="." Font.Charset="1" Font.Color="-16777208" Font.Height="-13" Font.Name="Arial Narrow" Font.Style="1" Frame.Typ="8" HAlign="haRight" ParentFont="False" Text="Stock Rotation Ratio"/>
<TfrxMemoView Name="Memo37" Left="487.55937" Top="30.23624" Width="41.57483" Height="49.13389" ShowHint="False" DisplayFormat.DecimalSeparator="." Font.Charset="1" Font.Color="-16777208" Font.Height="-13" Font.Name="Arial Narrow" Font.Style="1" Frame.Typ="8" HAlign="haRight" ParentFont="False" Text="Cur- rent Stock"/>
<TfrxMemoView Name="Memo39" Left="381.73253" Top="30.23624" Width="45.35436" Height="49.13389" ShowHint="False" DisplayFormat.DecimalSeparator="." Font.Charset="1" Font.Color="-16777208" Font.Height="-13" Font.Name="Arial Narrow" Font.Style="1" Frame.Typ="8" HAlign="haRight" ParentFont="False" Text="Current Cost Price £"/>
<TfrxMemoView Name="Memo3" Left="434.64595" Top="45.35436" Width="45.35436" Height="34.01577" ShowHint="False" DisplayFormat.DecimalSeparator="." Font.Charset="1" Font.Color="-16777208" Font.Height="-13" Font.Name="Arial Narrow" Font.Style="1" Frame.Typ="8" HAlign="haRight" ParentFont="False" Text="Qty Sold"/>
<TfrxMemoView Name="mvLowStockAlert" Align="baRight" Left="714.33117" Top="5.66929134" Width="370.39394" Height="18.89765" ShowHint="False" AutoWidth="True" DisplayFormat.DecimalSeparator="." Font.Charset="1" Font.Color="255" Font.Height="-11" Font.Name="Arial" Font.Style="0" ParentFont="False" Text="Low Stock Alert: Weeks Stock <= X"/>
<TfrxMemoView Name="Memo22" Left="536.69291339" Top="30.23624" Width="37.79527559" Height="49.13389" ShowHint="False" DisplayFormat.DecimalSeparator="." Font.Charset="1" Font.Color="-16777208" Font.Height="-13" Font.Name="Arial Narrow" Font.Style="1" Frame.Typ="8" HAlign="haRight" ParentFont="False" Text=" Wks Stock"/>
</TfrxPageHeader>
<TfrxMasterData Name="MasterData1" Height="22.67718" Left="0" Top="219.21274" Width="1084.72511" ColumnWidth="0" ColumnGap="0" DataSet="ds" DataSetName="ds" RowCount="0">
<TfrxMemoView Name="dsProductCode" Left="0" Top="0" Width="151.1812" Height="18.89765" ShowHint="False" DataField="ProductCode" DataSet="ds" DataSetName="ds" Font.Charset="1" Font.Color="-16777208" Font.Height="-13" Font.Name="Arial Narrow" Font.Style="0" Highlight.Font.Charset="1" Highlight.Font.Color="12632256" Highlight.Font.Height="-13" Highlight.Font.Name="Arial Narrow" Highlight.Font.Style="0" Highlight.Condition="<ds."ProductDisabled"> = True" ParentFont="False" Text="[ds."ProductCode"]"/>
<TfrxMemoView Name="dsProductName" Left="158.74026" Top="0" Width="215.43306598" Height="18.89765" ShowHint="False" DataField="ProductName" DataSet="ds" DataSetName="ds" Font.Charset="1" Font.Color="-16777208" Font.Height="-13" Font.Name="Arial Narrow" Font.Style="0" Highlight.Font.Charset="1" Highlight.Font.Color="12632256" Highlight.Font.Height="-13" Highlight.Font.Name="Arial Narrow" Highlight.Font.Style="0" Highlight.Condition="<ds."ProductDisabled"> = True" ParentFont="False" Text="[ds."ProductName"]"/>
<TfrxMemoView Name="dsWeeksStock6" Left="884.41002" Top="0" Width="56.69291339" Height="18.89765" ShowHint="False" DataSet="ds" DataSetName="ds" DisplayFormat.FormatStr="%2.0n" DisplayFormat.Kind="fkNumeric" Font.Charset="1" Font.Color="-16777208" Font.Height="-13" Font.Name="Arial" Font.Style="0" HAlign="haRight" ParentFont="False" Text="[VATAdjust(<ds."GrossProfit">)]"/>
<TfrxMemoView Name="Memo11" Left="948.66203" Top="0" Width="64.25196118" Height="18.89765" ShowHint="False" DataSet="ds" DataSetName="ds" DisplayFormat.FormatStr="%2.1n" DisplayFormat.Kind="fkNumeric" Font.Charset="1" Font.Color="-16777208" Font.Height="-13" Font.Name="Arial" Font.Style="0" HAlign="haRight" HideZeros="True" ParentFont="False" Text="[PctSuffix(<ds."AveMarkup">)]"/>
<TfrxMemoView Name="Memo21" Left="578.26809" Top="0" Width="49.13389" Height="18.89765" ShowHint="False" DataField="AveStock" DataSet="ds" DataSetName="ds" DisplayFormat.FormatStr="%2.1f" DisplayFormat.Kind="fkNumeric" Font.Charset="1" Font.Color="-16777208" Font.Height="-13" Font.Name="Arial" Font.Style="0" HAlign="haRight" ParentFont="False" Text="[ds."AveStock"]"/>
<TfrxMemoView Name="Memo18" Left="748.34694" Top="0" Width="64.2519685" Height="18.89765" ShowHint="False" DataSet="ds" DataSetName="ds" DisplayFormat.FormatStr="%2.0n" DisplayFormat.Kind="fkNumeric" Font.Charset="1" Font.Color="-16777208" Font.Height="-13" Font.Name="Arial" Font.Style="0" HAlign="haRight" ParentFont="False" Text="[VATAdjust(<ds."AveInvestment">)]"/>
<TfrxMemoView Name="Memo17" Left="820.15801" Top="0" Width="56.69291339" Height="18.89765" ShowHint="False" DataSet="ds" DataSetName="ds" DisplayFormat.FormatStr="%2.0n" DisplayFormat.Kind="fkNumeric" Font.Charset="1" Font.Color="-16777208" Font.Height="-13" Font.Name="Arial" Font.Style="0" HAlign="haRight" ParentFont="False" Text="[VATAdjust(<ds."Sales">)]"/>
<TfrxMemoView Name="Memo13" Left="634.96104" Top="0" Width="49.13389" Height="18.89765" ShowHint="False" DataSet="ds" DataSetName="ds" DisplayFormat.FormatStr="%2.1f" DisplayFormat.Kind="fkNumeric" Font.Charset="1" Font.Color="-16777208" Font.Height="-13" Font.Name="Arial" Font.Style="0" HAlign="haRight" ParentFont="False" Text="[PctSuffix(<ds."InStockPct">)]"/>
<TfrxMemoView Name="Memo36" Left="687.87446" Top="0" Width="52.91342" Height="18.89765" ShowHint="False" DataSet="ds" DataSetName="ds" DisplayFormat.FormatStr="%2.2f" DisplayFormat.Kind="fkNumeric" Font.Charset="1" Font.Color="-16777208" Font.Height="-13" Font.Name="Arial" Font.Style="0" HAlign="haRight" ParentFont="False" Text="[NullAsZero(<ds."StockRotationRatio">)]"/>
<TfrxMemoView Name="Memo38" Left="487.55937" Top="0" Width="41.57483" Height="18.89765" ShowHint="False" DataField="CurrentStock" DataSet="ds" DataSetName="ds" DisplayFormat.FormatStr="%g" DisplayFormat.Kind="fkNumeric" Font.Charset="1" Font.Color="-16777208" Font.Height="-13" Font.Name="Arial" Font.Style="0" HAlign="haRight" Highlight.Font.Charset="1" Highlight.Font.Color="255" Highlight.Font.Height="-13" Highlight.Font.Name="Arial" Highlight.Font.Style="0" Highlight.Condition="LowStockAlert" ParentFont="False" Text="[ds."CurrentStock"]"/>
<TfrxMemoView Name="Memo24" Left="1012.91404" Top="0" Width="71.81102118" Height="18.89765" ShowHint="False" DataSet="ds" DataSetName="ds" DisplayFormat.FormatStr="%2.1n" DisplayFormat.Kind="fkNumeric" Font.Charset="1" Font.Color="-16777208" Font.Height="-13" Font.Name="Arial" Font.Style="0" HAlign="haRight" HideZeros="True" ParentFont="False" Text="[PctSuffix(<ds."ROR">)]"/>
<TfrxMemoView Name="Memo40" Left="374.17347" Top="0" Width="52.91342" Height="18.89765" ShowHint="False" DataSet="ds" DataSetName="ds" DisplayFormat.FormatStr="%2.2f" DisplayFormat.Kind="fkNumeric" Font.Charset="1" Font.Color="-16777208" Font.Height="-13" Font.Name="Arial" Font.Style="0" HAlign="haRight" ParentFont="False" Text="[VATAdjust(<ds."CostPrice">)]"/>
<TfrxMemoView Name="dsNumInStock" Left="434.64595" Top="0" Width="45.35436" Height="18.89765" ShowHint="False" DataField="QtySold" DataSet="ds" DataSetName="ds" DisplayFormat.FormatStr="%2.0n" DisplayFormat.Kind="fkNumeric" Font.Charset="1" Font.Color="-16777208" Font.Height="-13" Font.Name="Arial" Font.Style="0" HAlign="haRight" Highlight.Font.Charset="1" Highlight.Font.Color="255" Highlight.Font.Height="-13" Highlight.Font.Name="Arial" Highlight.Font.Style="0" Highlight.Condition="LowStockAlert" ParentFont="False" Text="[ds."QtySold"]"/>
<TfrxMemoView Name="Memo12" Left="532.91373" Top="0" Width="41.57483" Height="18.89765" ShowHint="False" DataField="WeeksStock" DataSet="ds" DataSetName="ds" DisplayFormat.FormatStr="%2.0f" DisplayFormat.Kind="fkNumeric" Font.Charset="1" Font.Color="-16777208" Font.Height="-13" Font.Name="Arial" Font.Style="0" HAlign="haRight" Highlight.Font.Charset="1" Highlight.Font.Color="255" Highlight.Font.Height="-13" Highlight.Font.Name="Arial" Highlight.Font.Style="0" Highlight.Condition="LowStockAlert" ParentFont="False" Text="[ds."WeeksStock"]"/>
</TfrxMasterData>
<TfrxPageFooter Name="PageFooter1" Height="22.67718" Left="0" Top="438.42548" Width="1084.72511">
<TfrxMemoView Name="Memo8" Left="0" Top="0" Width="225" Height="20" ShowHint="False" StretchMode="smMaxHeight" Font.Charset="1" Font.Color="0" Font.Height="-13" Font.Name="Arial" Font.Style="2" ParentFont="False" Text="[<DATE>] [FORMATDATETIME('h:mm am/pm', <TIME>)]"/>
<TfrxMemoView Name="Memo9" Left="941.10297" Top="0" Width="144.77953" Height="20" ShowHint="False" StretchMode="smMaxHeight" Font.Charset="1" Font.Color="0" Font.Height="-13" Font.Name="Arial" Font.Style="2" HAlign="haRight" ParentFont="False" Text="Page [Page#] of [TotalPages#]"/>
</TfrxPageFooter>
<TfrxReportSummary Name="ReportSummary1" Height="56.69295" Left="0" Top="359.05535" Width="1084.72511">
<TfrxMemoView Name="Memo14" Left="820.15801" Top="3.77953" Width="56.69291339" Height="18.89765" ShowHint="False" DataSet="ds" DataSetName="ds" DisplayFormat.FormatStr="%2.0n" DisplayFormat.Kind="fkNumeric" Font.Charset="1" Font.Color="-16777208" Font.Height="-13" Font.Name="Arial" Font.Style="0" Frame.Typ="4" HAlign="haRight" ParentFont="False" Text="[VATAdjust(SUM(<ds."Sales">))]"/>
<TfrxMemoView Name="mvTotalProfit" Left="884.41002" Top="3.77953" Width="56.69291339" Height="18.89765" ShowHint="False" DataSet="ds" DataSetName="ds" DisplayFormat.FormatStr="%2.0n" DisplayFormat.Kind="fkNumeric" Font.Charset="1" Font.Color="-16777208" Font.Height="-13" Font.Name="Arial" Font.Style="0" Frame.Typ="4" HAlign="haRight" ParentFont="False" Text="[VATAdjust(SUM(<ds."GrossProfit">))]"/>
<TfrxMemoView Name="Memo16" Left="948.66203" Top="3.77953" Width="64.25196118" Height="18.89765" ShowHint="False" DataSet="ds" DataSetName="ds" DisplayFormat.FormatStr="%2.1n" DisplayFormat.Kind="fkNumeric" Font.Charset="1" Font.Color="-16777208" Font.Height="-13" Font.Name="Arial" Font.Style="0" Frame.Typ="4" HAlign="haRight" ParentFont="False" Text="[SafeDivide(SUM(<ds."GrossProfit">), SUM(<ds."CostOfSales">)) * 100]%"/>
<TfrxMemoView Name="Memo19" Left="748.34694" Top="3.77953" Width="64.2519685" Height="18.89765" ShowHint="False" DataSet="ds" DataSetName="ds" DisplayFormat.FormatStr="%2.0n" DisplayFormat.Kind="fkNumeric" Font.Charset="1" Font.Color="-16777208" Font.Height="-13" Font.Name="Arial" Font.Style="0" Frame.Typ="4" HAlign="haRight" ParentFont="False" Text="[VATAdjust(SUM(<ds."AveInvestment">))]"/>
<TfrxMemoView Name="Memo25" Left="1020.4731" Top="3.77953" Width="64.25196118" Height="18.89765" ShowHint="False" DataSet="ds" DataSetName="ds" DisplayFormat.FormatStr="%2.1n" DisplayFormat.Kind="fkNumeric" Font.Charset="1" Font.Color="-16777208" Font.Height="-13" Font.Name="Arial" Font.Style="0" Frame.Typ="4" HAlign="haRight" ParentFont="False" Text="[SafeDivide(SUM(<ds."GrossProfit">), SUM(<ds."Investment">)) * 100]%"/>
<TfrxMemoView Name="Memo34" Left="0" Top="3.77953" Width="389.29159" Height="18.89765" ShowHint="False" DisplayFormat.DecimalSeparator="." Font.Charset="1" Font.Color="-16777208" Font.Height="-13" Font.Name="Arial" Font.Style="1" ParentFont="False" Text="Overall Totals"/>
</TfrxReportSummary>
<TfrxGroupHeader Name="GroupHeader1" Height="30.23624" Left="0" Top="166.29932" Width="1084.72511" Condition="ds."SupplierID"" KeepTogether="True">
<TfrxMemoView Name="Memo26" Left="0" Top="3.77953" Width="491.3389" Height="18.89765" ShowHint="False" DisplayFormat.DecimalSeparator="." Font.Charset="1" Font.Color="-16777208" Font.Height="-13" Font.Name="Arial" Font.Style="1" ParentFont="False" Text="Supplier: [IIF(<ds."SupplierName"> = '', 'UNKNOWN', <ds."SupplierName">)]"/>
<TfrxLineView Name="Line1" Left="0" Top="26.45671" Width="1084.72511" Height="0" ShowHint="False" Frame.Typ="4"/>
</TfrxGroupHeader>
<TfrxGroupFooter Name="GroupFooter1" Height="34.01577" Left="0" Top="264.5671" Width="1084.72511">
<TfrxMemoView Name="Memo27" Left="0" Top="3.77953" Width="389.29159" Height="18.89765" ShowHint="False" DisplayFormat.DecimalSeparator="." Font.Charset="1" Font.Color="-16777208" Font.Height="-13" Font.Name="Arial" Font.Style="1" ParentFont="False" Text="Totals for [IIF(<ds."SupplierName"> = '', 'Unknown', <ds."SupplierName">)]"/>
<TfrxMemoView Name="Memo29" Left="820.15801" Top="3.77953" Width="56.69291339" Height="18.89765" ShowHint="False" DataSet="ds" DataSetName="ds" DisplayFormat.FormatStr="%2.0n" DisplayFormat.Kind="fkNumeric" Font.Charset="1" Font.Color="-16777208" Font.Height="-13" Font.Name="Arial" Font.Style="0" Frame.Typ="4" HAlign="haRight" ParentFont="False" Text="[VATAdjust(SUM(<ds."Sales">))]"/>
<TfrxMemoView Name="Memo30" Left="884.41002" Top="3.77953" Width="56.69291339" Height="18.89765" ShowHint="False" DataSet="ds" DataSetName="ds" DisplayFormat.FormatStr="%2.0n" DisplayFormat.Kind="fkNumeric" Font.Charset="1" Font.Color="-16777208" Font.Height="-13" Font.Name="Arial" Font.Style="0" Frame.Typ="4" HAlign="haRight" ParentFont="False" Text="[VATAdjust(SUM(<ds."GrossProfit">))]"/>
<TfrxMemoView Name="Memo32" Left="748.34694" Top="3.77953" Width="64.2519685" Height="18.89765" ShowHint="False" DataSet="ds" DataSetName="ds" DisplayFormat.FormatStr="%2.0n" DisplayFormat.Kind="fkNumeric" Font.Charset="1" Font.Color="-16777208" Font.Height="-13" Font.Name="Arial" Font.Style="0" Frame.Typ="4" HAlign="haRight" ParentFont="False" Text="[VATAdjust(SUM(<ds."AveInvestment">))]"/>
<TfrxMemoView Name="Memo31" Left="948.66203" Top="3.77953" Width="64.25196118" Height="18.89765" ShowHint="False" DataSet="ds" DataSetName="ds" DisplayFormat.FormatStr="%2.1n" DisplayFormat.Kind="fkNumeric" Font.Charset="1" Font.Color="-16777208" Font.Height="-13" Font.Name="Arial" Font.Style="0" Frame.Typ="4" HAlign="haRight" ParentFont="False" Text="[SafeDivide(SUM(<ds."GrossProfit">), SUM(<ds."CostOfSales">)) * 100]%"/>
<TfrxMemoView Name="Memo33" Left="1020.4731" Top="3.77953" Width="64.25196118" Height="18.89765" ShowHint="False" DataSet="ds" DataSetName="ds" DisplayFormat.FormatStr="%2.1n" DisplayFormat.Kind="fkNumeric" Font.Charset="1" Font.Color="-16777208" Font.Height="-13" Font.Name="Arial" Font.Style="0" Frame.Typ="4" HAlign="haRight" ParentFont="False" Text="[SafeDivide(SUM(<ds."GrossProfit">), SUM(<ds."Investment">)) * 100]%"/>
</TfrxGroupFooter>
</TfrxReportPage>
</TfrxReport>
Q@�y 1@�,� KIntra-Community Supplies (for checking only, see EC export in Sales Totals), ~ # (SS,17/10/18) changed from DateTimeOrdered to DateTimePaid, and added refunds
# (SS,16/4/19) new version where field can be chosen either DateTimeOrdered or DateTimePaid
SELECT " " AS Type, OrderNo, [DATEFIELD] AS DateField, FirstName, Surname, Country, VATNumber, GrandTotal, VATDeducted FROM orders
WHERE DATE([DATEFIELD]) >= "[STARTDATE]" AND DATE([DATEFIELD]) <= "[ENDDATE]" AND PaymentReceived = TRUE
AND IntraCommunitySupply = TRUE
UNION ALL
SELECT "R" AS Type, OrderNo, RefundDate, FirstName, Surname, Country, VATNumber, -RefundAmount,
-IF(RefundAmount = GrandTotal, VATDeducted, RefundAmount - ROUND(RefundAmount / (1 + ROUND((VATDeducted / (GrandTotal - VATDeducted)), 2)), 2)) AS RefundVAT
FROM orders
WHERE DATE(RefundDate) >= "[STARTDATE]" AND DATE(RefundDate) <= "[ENDDATE]" AND PaymentReceived = TRUE
AND IntraCommunitySupply = TRUE
ORDER BY Type, OrderNo;
- <?xml version="1.0" encoding="utf-8"?>
<TfrxReport Version="4.15.13" DotMatrixReport="False" IniFile="\Software\Fast Reports" PreviewOptions.AllowEdit="False" PreviewOptions.Buttons="1465" PreviewOptions.Zoom="1" PrintOptions.Printer="Default" PrintOptions.PrintOnSheet="0" ReportOptions.Compressed="True" ReportOptions.CreateDate="39024.4955783102" ReportOptions.Description.Text="" ReportOptions.LastChange="43571.4674635648" ScriptLanguage="PascalScript" ScriptText.Text="// From [<tknSTARTDATE>] to [<tknENDDATE>] sorted by [<tknSORTBY>] with VAT [<tknVAT>] function GetSubtitle: String; var LStartDate, LEndDate: TDateTime; begin LStartDate := GetDateFromTokenVar(<tknSTARTDATE>); LEndDate := GetDateFromTokenVar(<tknENDDATE>); Result := 'From ' + DateToStr(LStartDate) + ' to ' + DateToStr(LEndDate) end; // converts string in 2013-03-14 format to datetime function GetDateFromTokenVar(const ADateStr: String): TDateTime; begin Result := StrToDate(Copy(ADateStr, 9, 2) + '/' + Copy(ADateStr, 6, 2) + '/' + Copy(ADateStr, 1, 4)); end; // (SS,16/4/19) procedure PageHeader1OnBeforePrint(Sender: TfrxComponent); begin if <tknDATEFIELD> = 'DateTimeOrdered' then mmDateField.Memo.Text := 'Date Invoiced' else mmDateField.Memo.Text := #13 + 'Date Paid'; end; begin end." PropData="044C656674022C03546F70021408446174617365747301010C1E00000020446174615365743D2264732220446174615365744E616D653D226473220000095661726961626C657301010C16000000204E616D653D2220495450207661726961626C65732200010C21000000204E616D653D227374725265706F72745469746C65222056616C75653D2227272200010C24000000204E616D653D227374725265706F72745375627469746C65222056616C75653D2227272200010C29000000204E616D653D22737472557365724E616D65222056616C75653D22276879706572666C69676874272200010C24000000204E616D653D22737472456D61696C5369676E6174757265222056616C75653D2227272200010C28000000204E616D653D22737472456D61696C5369676E617475726548544D4C222056616C75653D2227272200010C1E000000204E616D653D227374724D65737361676531222056616C75653D2227272200010C1E000000204E616D653D227374724D65737361676532222056616C75653D2227272200010C29000000204E616D653D22746B6E535441525444415445222056616C75653D2227323031382D30342D3136272200010C27000000204E616D653D22746B6E454E4444415445222056616C75653D2227323031392D30342D3136272200010C2B000000204E616D653D22746B6E444154454649454C44222056616C75653D22274461746554696D655061696427220000055374796C650100">
<TfrxDataPage Name="Data" Height="1000" Left="0" Top="0" Width="1000"/>
<TfrxReportPage Name="Page1" PaperWidth="210" PaperHeight="297" PaperSize="9" LeftMargin="10" RightMargin="5" TopMargin="10" BottomMargin="10" ColumnWidth="0" ColumnPositions.Text="" HGuides.Text="" VGuides.Text="">
<TfrxPageHeader Name="PageHeader1" Height="71.81107" Left="0" Top="18.89765" Width="737.00835" OnBeforePrint="PageHeader1OnBeforePrint">
<TfrxMemoView Name="Memo7" Left="0" Top="0" Width="241.44094" Height="24" ShowHint="False" Font.Charset="1" Font.Color="0" Font.Height="-19" Font.Name="Arial" Font.Style="1" Frame.Typ="8" ParentFont="False" Text="Intra-Community Supplies"/>
<TfrxMemoView Name="Memo1" Left="0" Top="45.35436" Width="64.25201" Height="18.89765" ShowHint="False" DisplayFormat.DecimalSeparator="." Font.Charset="1" Font.Color="-16777208" Font.Height="-13" Font.Name="Arial" Font.Style="1" Frame.Typ="8" ParentFont="False" Text="Order No"/>
<TfrxMemoView Name="mvSubtitle" Left="249.44898" Top="5.10235" Width="328.81911" Height="18.89765" ShowHint="False" AutoWidth="True" DisplayFormat.DecimalSeparator="." Font.Charset="1" Font.Color="-16777208" Font.Height="-13" Font.Name="Arial" Font.Style="3" Frame.Typ="8" ParentFont="False" Text="[GetSubtitle]"/>
<TfrxMemoView Name="Memo2" Left="272.12616" Top="45.35436" Width="128.50402" Height="18.89765" ShowHint="False" DisplayFormat.DecimalSeparator="." Font.Charset="1" Font.Color="-16777208" Font.Height="-13" Font.Name="Arial" Font.Style="1" Frame.Typ="8" ParentFont="False" Text="Country"/>
<TfrxMemoView Name="Memo3" Left="408.18924" Top="45.35436" Width="143.62214" Height="18.89765" ShowHint="False" DisplayFormat.DecimalSeparator="." Font.Charset="1" Font.Color="-16777208" Font.Height="-13" Font.Name="Arial" Font.Style="1" Frame.Typ="8" ParentFont="False" Text="VAT Number"/>
<TfrxMemoView Name="Memo4" Left="653.85869" Top="30.23624" Width="79.37013" Height="34.01577" ShowHint="False" DisplayFormat.DecimalSeparator="." Font.Charset="1" Font.Color="-16777208" Font.Height="-13" Font.Name="Arial" Font.Style="1" Frame.Typ="8" HAlign="haRight" ParentFont="False" Text="VAT Deducted"/>
<TfrxMemoView Name="Memo5" Left="154.96073" Top="45.35436" Width="109.60637" Height="18.89765" ShowHint="False" DisplayFormat.DecimalSeparator="." Font.Charset="1" Font.Color="-16777208" Font.Height="-13" Font.Name="Arial" Font.Style="1" Frame.Typ="8" ParentFont="False" Text="Name"/>
<TfrxMemoView Name="mmDateField" Left="71.81107" Top="30.23624" Width="75.5906" Height="34.01577" ShowHint="False" Font.Charset="1" Font.Color="-16777208" Font.Height="-13" Font.Name="Arial" Font.Style="1" Frame.Typ="8" ParentFont="False" Text="Date"/>
<TfrxMemoView Name="Memo14" Left="559.37044" Top="30.23624" Width="86.92919" Height="34.01577" ShowHint="False" DisplayFormat.DecimalSeparator="." Font.Charset="1" Font.Color="-16777208" Font.Height="-13" Font.Name="Arial" Font.Style="1" Frame.Typ="8" HAlign="haRight" ParentFont="False" Text="Grand Total"/>
</TfrxPageHeader>
<TfrxMasterData Name="MasterData1" Height="22.67718" Left="0" Top="151.1812" Width="737.00835" ColumnWidth="0" ColumnGap="0" DataSet="ds" DataSetName="ds" RowCount="0">
<TfrxMemoView Name="dsOrderNo" Left="0" Top="0" Width="49.13389" Height="18.89765" ShowHint="False" DataField="OrderNo" DataSet="ds" DataSetName="ds" Font.Charset="1" Font.Color="-16777208" Font.Height="-13" Font.Name="Arial" Font.Style="0" ParentFont="False" Text="[ds."OrderNo"]"/>
<TfrxMemoView Name="dsordersCountry" Left="272.12616" Top="0" Width="128.50402" Height="18.89765" ShowHint="False" DataField="Country" DataSet="ds" DataSetName="ds" Font.Charset="1" Font.Color="-16777208" Font.Height="-13" Font.Name="Arial" Font.Style="0" ParentFont="False" Text="[ds."Country"]"/>
<TfrxMemoView Name="dsVATDeducted" Left="653.85869" Top="0" Width="79.37013" Height="18.89765" ShowHint="False" DataField="VATDeducted" DataSet="ds" DataSetName="ds" DisplayFormat.FormatStr="%2.2m" DisplayFormat.Kind="fkNumeric" Font.Charset="1" Font.Color="-16777208" Font.Height="-13" Font.Name="Arial" Font.Style="0" HAlign="haRight" ParentFont="False" Text="[ds."VATDeducted"]"/>
<TfrxMemoView Name="dsVATNumber" Left="408.18924" Top="0" Width="143.62214" Height="18.89765" ShowHint="False" DataField="VATNumber" DataSet="ds" DataSetName="ds" Font.Charset="1" Font.Color="-16777208" Font.Height="-13" Font.Name="Arial" Font.Style="0" ParentFont="False" Text="[ds."VATNumber"]"/>
<TfrxMemoView Name="Memo12" Left="71.81107" Top="0" Width="75.5906" Height="18.89765" ShowHint="False" DataField="DateField" DataSet="ds" DataSetName="ds" DisplayFormat.FormatStr="dd/mm/yyyy" DisplayFormat.Kind="fkDateTime" Font.Charset="1" Font.Color="-16777208" Font.Height="-13" Font.Name="Arial" Font.Style="0" ParentFont="False" Text="[ds."DateField"]"/>
<TfrxMemoView Name="Memo13" Left="154.96073" Top="0" Width="109.60637" Height="18.89765" ShowHint="False" DataSet="ds" DataSetName="ds" Font.Charset="1" Font.Color="-16777208" Font.Height="-13" Font.Name="Arial Narrow" Font.Style="0" ParentFont="False" Text="[ds."FirstName"] [ds."Surname"]"/>
<TfrxMemoView Name="Memo15" Left="559.37044" Top="0" Width="86.92919" Height="18.89765" ShowHint="False" DataField="GrandTotal" DataSet="ds" DataSetName="ds" DisplayFormat.FormatStr="%2.2m" DisplayFormat.Kind="fkNumeric" Font.Charset="1" Font.Color="-16777208" Font.Height="-13" Font.Name="Arial" Font.Style="0" HAlign="haRight" ParentFont="False" Text="[ds."GrandTotal"]"/>
<TfrxMemoView Name="Memo17" Left="49.13389" Top="0" Width="15.11812" Height="18.89765" ShowHint="False" DataField="Type" DataSet="ds" DataSetName="ds" Font.Charset="1" Font.Color="-16777208" Font.Height="-13" Font.Name="Arial" Font.Style="0" ParentFont="False" Text="[ds."Type"]"/>
</TfrxMasterData>
<TfrxPageFooter Name="PageFooter1" Height="22.67718" Left="0" Top="287.24428" Width="737.00835">
<TfrxMemoView Name="Memo8" Left="0" Top="0" Width="225" Height="20" ShowHint="False" StretchMode="smMaxHeight" Font.Charset="1" Font.Color="0" Font.Height="-13" Font.Name="Times New Roman" Font.Style="2" ParentFont="False" Text="[<DATE>] [FORMATDATETIME('h:mm am/pm', <TIME>)]"/>
<TfrxMemoView Name="Memo9" Left="574.48856" Top="0" Width="144.77953" Height="20" ShowHint="False" StretchMode="smMaxHeight" Font.Charset="1" Font.Color="0" Font.Height="-13" Font.Name="Times New Roman" Font.Style="2" HAlign="haRight" ParentFont="False" Text="Page [Page#] of [TotalPages#]"/>
</TfrxPageFooter>
<TfrxReportSummary Name="ReportSummary1" Height="30.23624" Left="0" Top="234.33086" Width="737.00835">
<TfrxMemoView Name="Memo10" Left="653.85869" Top="3.77953" Width="79.37013" Height="18.89765" ShowHint="False" DataSet="ds" DataSetName="ds" DisplayFormat.FormatStr="%2.2m" DisplayFormat.Kind="fkNumeric" Font.Charset="1" Font.Color="-16777208" Font.Height="-13" Font.Name="Arial" Font.Style="1" Frame.Typ="4" HAlign="haRight" ParentFont="False" Text="[SUM(<ds."VATDeducted">)]"/>
<TfrxMemoView Name="Memo11" Left="408.18924" Top="3.77953" Width="139.84261" Height="18.89765" ShowHint="False" DisplayFormat.DecimalSeparator="." Font.Charset="1" Font.Color="-16777208" Font.Height="-13" Font.Name="Arial" Font.Style="1" ParentFont="False" Text="Totals"/>
<TfrxMemoView Name="Memo16" Left="563.14997" Top="3.77953" Width="83.14966" Height="18.89765" ShowHint="False" DataSet="ds" DataSetName="ds" DisplayFormat.FormatStr="%2.2m" DisplayFormat.Kind="fkNumeric" Font.Charset="1" Font.Color="-16777208" Font.Height="-13" Font.Name="Arial" Font.Style="1" Frame.Typ="4" HAlign="haRight" ParentFont="False" Text="[SUM(<ds."GrandTotal">)]"/>
</TfrxReportSummary>
</TfrxReportPage>
</TfrxReport>
Q]��2�@�,� Refunds� . # (SS,4/2/22) modified to use new refunds table with join to orders
SELECT r.OrderNo, DateTimeOrdered, DateTimePaid, Subtotal, VATIncluded, GrandTotal,
ROUND(VATIncluded/(GrandTotal-VATIncluded), 2) AS VATRate,
RefundNo, RefundDate, RefundNet, RefundVAT, RefundAmount
# (SS,4/2/22) following replaced by new RefundNet, RefundVAT fields
#ROUND(RefundAmount/(1 + ROUND(VATIncluded / (GrandTotal - VATIncluded), 2)), 2) AS GoodsRefunded,
#ROUND(RefundAmount - ROUND(RefundAmount/(1 + ROUND(VATIncluded / (GrandTotal - VATIncluded), 2)), 2), 2) AS VATRefunded
FROM refunds r
INNER JOIN orders o ON o.OrderNo = r.OrderNo
WHERE RefundDate >= "[STARTDATE]" AND RefundDate <= "[ENDDATE]" AND RefundAmount <> 0
# (SS,4/2/22) removed LIMIT 1000 (accidentally left behind?)
ORDER BY RefundDate, OrderNo =/ <?xml version="1.0" encoding="utf-8"?>
<TfrxReport Version="4.15.13" DotMatrixReport="False" IniFile="\Software\Fast Reports" PreviewOptions.AllowEdit="False" PreviewOptions.Buttons="1465" PreviewOptions.Zoom="1" PrintOptions.Printer="Default" PrintOptions.PrintOnSheet="0" ReportOptions.Compressed="True" ReportOptions.CreateDate="39024.4955783102" ReportOptions.Description.Text="" ReportOptions.LastChange="44596.4385409954" ScriptLanguage="PascalScript" ScriptText.Text="procedure Page1OnBeforePrint(Sender: TfrxComponent); begin end; begin end." PropData="044C656674022C03546F70021408446174617365747301010C1E00000020446174615365743D2264732220446174615365744E616D653D226473220000095661726961626C657301010C16000000204E616D653D2220495450207661726961626C65732200010C21000000204E616D653D227374725265706F72745469746C65222056616C75653D2227272200010C24000000204E616D653D227374725265706F72745375627469746C65222056616C75653D2227272200010C2C000000204E616D653D22737472557365724E616D65222056616C75653D22276361737469726F6E72616463656E272200010C24000000204E616D653D22737472456D61696C5369676E6174757265222056616C75653D2227272200010C28000000204E616D653D22737472456D61696C5369676E617475726548544D4C222056616C75653D2227272200010C1E000000204E616D653D227374724D65737361676531222056616C75653D2227272200010C1E000000204E616D653D227374724D65737361676532222056616C75653D2227272200010C25000000204E616D653D22746B6E4D4F4E5448222056616C75653D2227417072696C2032303137272200010C20000000204E616D653D22746B6E54595045222056616C75653D22274F7264657273272200010C29000000204E616D653D22746B6E535441525444415445222056616C75653D2227323032322D30312D3031272200010C27000000204E616D653D22746B6E454E4444415445222056616C75653D2227323032322D31322D333127220000055374796C650100">
<TfrxDataPage Name="Data" Height="1000" Left="0" Top="0" Width="1000"/>
<TfrxReportPage Name="Page1" PaperWidth="210" PaperHeight="297" PaperSize="9" LeftMargin="15" RightMargin="10" TopMargin="10" BottomMargin="10" ColumnWidth="0" ColumnPositions.Text="" HGuides.Text="" VGuides.Text="" OnBeforePrint="Page1OnBeforePrint">
<TfrxPageHeader Name="PageHeader1" Height="79.37013" Left="0" Top="18.89765" Width="699.21305">
<TfrxMemoView Name="Memo7" Left="0" Top="0" Width="490.88992" Height="24" ShowHint="False" AutoWidth="True" Font.Charset="1" Font.Color="0" Font.Height="-19" Font.Name="Arial" Font.Style="1" Frame.Typ="8" ParentFont="False" Text="[IIF(<strReportTitle> <> '', <strReportTitle>, 'Refunds from ' + <tknSTARTDATE> + ' to ' + <tknENDDATE>)]"/>
<TfrxMemoView Name="Memo1" Left="0" Top="52.91342" Width="64.25201" Height="18.89765" ShowHint="False" DisplayFormat.DecimalSeparator="." Font.Charset="1" Font.Color="-16777208" Font.Height="-13" Font.Name="Arial" Font.Style="1" Frame.Typ="8" ParentFont="False" Text="Order No"/>
<TfrxMemoView Name="Memo5" Left="71.81107" Top="52.91342" Width="75.5906" Height="18.89765" ShowHint="False" DisplayFormat.DecimalSeparator="." Font.Charset="1" Font.Color="-16777208" Font.Height="-13" Font.Name="Arial" Font.Style="1" Frame.Typ="8" ParentFont="False" Text="Order Date"/>
<TfrxMemoView Name="Memo10" Left="234.33086" Top="52.91342" Width="94.48820362" Height="18.89765" ShowHint="False" DisplayFormat.DecimalSeparator="." Font.Charset="1" Font.Color="-16777208" Font.Height="-13" Font.Name="Arial" Font.Style="1" Frame.Typ="8" HAlign="haRight" ParentFont="False" Text="Grand Total"/>
<TfrxMemoView Name="Memo11" Left="154.96073" Top="52.91342" Width="71.81102118" Height="18.89765" ShowHint="False" Font.Charset="1" Font.Color="-16777208" Font.Height="-13" Font.Name="Arial" Font.Style="1" Frame.Typ="8" HAlign="haRight" ParentFont="False" Text="VAT"/>
<TfrxMemoView Name="Memo15" Left="377.953" Top="37.7953" Width="71.81102118" Height="34.01577" ShowHint="False" Font.Charset="1" Font.Color="-16777208" Font.Height="-13" Font.Name="Arial" Font.Style="1" Frame.Typ="8" HAlign="haRight" ParentFont="False" Text="Refund Date"/>
<TfrxMemoView Name="Memo16" Left="616.06339" Top="37.7953" Width="79.3700885" Height="34.01577" ShowHint="False" Font.Charset="1" Font.Color="-16777208" Font.Height="-13" Font.Name="Arial" Font.Style="1" Frame.Typ="8" HAlign="haRight" ParentFont="False" Text="Refund Amount"/>
<TfrxMemoView Name="Memo2" Left="457.32313" Top="37.7953" Width="79.3700885" Height="34.01577" ShowHint="False" Font.Charset="1" Font.Color="-16777208" Font.Height="-13" Font.Name="Arial" Font.Style="1" Frame.Typ="8" HAlign="haRight" ParentFont="False" Text="Refund Net"/>
<TfrxMemoView Name="Memo6" Left="544.25232" Top="37.7953" Width="64.2519685" Height="34.01577" ShowHint="False" Font.Charset="1" Font.Color="-16777208" Font.Height="-13" Font.Name="Arial" Font.Style="1" Frame.Typ="8" HAlign="haRight" ParentFont="False" Text="Refund VAT"/>
<TfrxMemoView Name="Memo14" Left="336.37817" Top="37.7953" Width="34.01572118" Height="34.01577" ShowHint="False" Font.Charset="1" Font.Color="-16777208" Font.Height="-13" Font.Name="Arial" Font.Style="1" Frame.Typ="8" HAlign="haRight" ParentFont="False" Text="Rfnd No"/>
</TfrxPageHeader>
<TfrxMasterData Name="MasterData1" Height="22.67718" Left="0" Top="158.74026" Width="699.21305" ColumnWidth="0" ColumnGap="0" DataSet="ds" DataSetName="ds" RowCount="0">
<TfrxMemoView Name="dsOrderNo" Left="0" Top="0" Width="52.91342" Height="18.89765" ShowHint="False" Color="16777215" DataField="OrderNo" DataSet="ds" DataSetName="ds" Font.Charset="1" Font.Color="-16777208" Font.Height="-13" Font.Name="Arial" Font.Style="0" ParentFont="False" Text="[ds."OrderNo"]"/>
<TfrxMemoView Name="dsDateTimeOrdered" Left="71.81107" Top="0" Width="71.81107" Height="18.89765" ShowHint="False" Color="16777215" DataField="DateTimeOrdered" DataSet="ds" DataSetName="ds" DisplayFormat.FormatStr="dd/mm/yyyy" DisplayFormat.Kind="fkDateTime" Font.Charset="1" Font.Color="-16777208" Font.Height="-13" Font.Name="Arial" Font.Style="0" ParentFont="False" Text="[ds."DateTimeOrdered"]"/>
<TfrxMemoView Name="dsGrandTotal" Left="234.33086" Top="0" Width="94.48825" Height="18.89765" ShowHint="False" Color="16777215" DataField="GrandTotal" DataSet="ds" DataSetName="ds" DisplayFormat.FormatStr="%2.2m" DisplayFormat.Kind="fkNumeric" Font.Charset="1" Font.Color="-16777208" Font.Height="-13" Font.Name="Arial" Font.Style="0" HAlign="haRight" ParentFont="False" Text="[ds."GrandTotal"]"/>
<TfrxMemoView Name="dsVATIncluded" Left="154.96073" Top="0" Width="71.8110285" Height="18.89765" ShowHint="False" Color="16777215" DataField="VATIncluded" DataSet="ds" DataSetName="ds" DisplayFormat.FormatStr="%2.2m" DisplayFormat.Kind="fkNumeric" Font.Charset="1" Font.Color="-16777208" Font.Height="-13" Font.Name="Arial" Font.Style="0" HAlign="haRight" HideZeros="True" ParentFont="False" Text="[ds."VATIncluded"]"/>
<TfrxMemoView Name="dsRefundDate" Left="377.953" Top="0" Width="71.81102118" Height="18.89765" ShowHint="False" Color="16777215" DataField="RefundDate" DataSet="ds" DataSetName="ds" DisplayFormat.FormatStr="dd/mm/yyyy" DisplayFormat.Kind="fkDateTime" Font.Charset="1" Font.Color="-16777208" Font.Height="-13" Font.Name="Arial" Font.Style="0" ParentFont="False" Text="[ds."RefundDate"]"/>
<TfrxMemoView Name="dsRefundAmount" Left="616.06339" Top="0" Width="79.37013" Height="18.89765" ShowHint="False" Color="16777215" DataSet="ds" DataSetName="ds" DisplayFormat.FormatStr="%2.2m" DisplayFormat.Kind="fkNumeric" Font.Charset="1" Font.Color="-16777208" Font.Height="-13" Font.Name="Arial" Font.Style="0" HAlign="haRight" HideZeros="True" ParentFont="False" Text="[ds."RefundAmount"]"/>
<TfrxMemoView Name="Memo3" Left="457.32313" Top="0" Width="79.37013" Height="18.89765" ShowHint="False" Color="16777215" DataField="RefundNet" DataSet="ds" DataSetName="ds" DisplayFormat.FormatStr="%2.2m" DisplayFormat.Kind="fkNumeric" Font.Charset="1" Font.Color="-16777208" Font.Height="-13" Font.Name="Arial" Font.Style="0" HAlign="haRight" HideZeros="True" ParentFont="False" Text="[ds."RefundNet"]"/>
<TfrxMemoView Name="Memo12" Left="544.25232" Top="0" Width="64.25201" Height="18.89765" ShowHint="False" Color="16777215" DataField="RefundVAT" DataSet="ds" DataSetName="ds" DisplayFormat.FormatStr="%2.2m" DisplayFormat.Kind="fkNumeric" Font.Charset="1" Font.Color="-16777208" Font.Height="-13" Font.Name="Arial" Font.Style="0" HAlign="haRight" HideZeros="True" ParentFont="False" Text="[ds."RefundVAT"]"/>
<TfrxMemoView Name="Memo17" Left="336.37817" Top="0" Width="34.01572118" Height="18.89765" ShowHint="False" Color="16777215" DataSet="ds" DataSetName="ds" Font.Charset="1" Font.Color="-16777208" Font.Height="-13" Font.Name="Arial" Font.Style="0" HAlign="haRight" ParentFont="False" Text="[ds."RefundNo"]"/>
</TfrxMasterData>
<TfrxPageFooter Name="PageFooter1" Height="22.67718" Left="0" Top="359.05535" Width="699.21305">
<TfrxMemoView Name="Memo8" Left="0" Top="0" Width="225" Height="20" ShowHint="False" StretchMode="smMaxHeight" Font.Charset="1" Font.Color="0" Font.Height="-13" Font.Name="Arial" Font.Style="2" ParentFont="False" Text="[<DATE>] [FORMATDATETIME('h:mm am/pm', <TIME>)]"/>
<TfrxMemoView Name="Memo9" Left="551.81138" Top="0" Width="144.77953" Height="20" ShowHint="False" StretchMode="smMaxHeight" Font.Charset="1" Font.Color="0" Font.Height="-13" Font.Name="Arial" Font.Style="2" HAlign="haRight" ParentFont="False" Text="Page [Page#] of [TotalPages#]"/>
</TfrxPageFooter>
<TfrxFooter Name="Footer1" Height="41.57483" Left="0" Top="204.09462" Width="699.21305">
<TfrxMemoView Name="Memo21" Left="0" Top="11.33859" Width="234.33086" Height="18.89765" ShowHint="False" DataSet="ds" DataSetName="ds" Font.Charset="1" Font.Color="-16777208" Font.Height="-13" Font.Name="Arial" Font.Style="1" ParentFont="False" Text="Totals"/>
<TfrxLineView Name="Line4" Left="0" Top="34.01577" Width="699.212598425197" Height="0" ShowHint="False" Frame.Typ="4"/>
<TfrxMemoView Name="Memo25" Left="616.06339" Top="11.33859" Width="79.37013" Height="18.89765" ShowHint="False" DataSet="ds" DataSetName="ds" DisplayFormat.FormatStr="%2.2m" DisplayFormat.Kind="fkNumeric" Font.Charset="1" Font.Color="-16777208" Font.Height="-13" Font.Name="Arial" Font.Style="0" HAlign="haRight" HideZeros="True" ParentFont="False" Text="[SUM(<ds."RefundAmount">)]"/>
<TfrxLineView Name="Line5" Left="0" Top="7.55906" Width="699.212598425197" Height="0" ShowHint="False" Frame.Typ="4"/>
<TfrxMemoView Name="Memo26" Left="340.1577" Top="11.33859" Width="98.26778" Height="18.89765" ShowHint="False" DataSet="ds" DataSetName="ds" DisplayFormat.FormatStr="%g" DisplayFormat.Kind="fkNumeric" Font.Charset="1" Font.Color="-16777208" Font.Height="-13" Font.Name="Arial" Font.Style="0" ParentFont="False" Text="Refunds: [COUNT()]"/>
<TfrxMemoView Name="Memo4" Left="457.32313" Top="11.33859" Width="79.37013" Height="18.89765" ShowHint="False" DataSet="ds" DataSetName="ds" DisplayFormat.FormatStr="%2.2m" DisplayFormat.Kind="fkNumeric" Font.Charset="1" Font.Color="-16777208" Font.Height="-13" Font.Name="Arial" Font.Style="0" HAlign="haRight" HideZeros="True" ParentFont="False" Text="[SUM(<ds."RefundNet">)]"/>
<TfrxMemoView Name="Memo13" Left="544.25232" Top="11.33859" Width="64.25201" Height="18.89765" ShowHint="False" DataSet="ds" DataSetName="ds" DisplayFormat.FormatStr="%2.2m" DisplayFormat.Kind="fkNumeric" Font.Charset="1" Font.Color="-16777208" Font.Height="-13" Font.Name="Arial" Font.Style="0" HAlign="haRight" HideZeros="True" ParentFont="False" Text="[SUM(<ds."RefundVAT">)]"/>
</TfrxFooter>
<TfrxReportSummary Name="ReportSummary1" Height="30.23624" Left="0" Top="306.14193" Width="699.21305"/>
</TfrxReportPage>
</TfrxReport>
X��h %�@�,� Timesheet� SELECT PCName, LogOn, LogOff, DAYNAME(LogOn) AS Day, TIMESTAMPDIFF(MINUTE, LogOn, LogOff) / 60 AS Hours
FROM audit
WHERE (PCName = "[PCNAME]" OR PCName = "[PCNAME2]")
AND DATE(LogOn) >= "[STARTDATE]" AND DATE(LogOn) <= "[ENDDATE]"
ORDER BY PCName, LogOnx$ <?xml version="1.0" encoding="utf-8"?>
<TfrxReport Version="4.15.13" DotMatrixReport="False" IniFile="\Software\Fast Reports" PreviewOptions.AllowEdit="False" PreviewOptions.Buttons="1465" PreviewOptions.Zoom="1" PrintOptions.Printer="Default" PrintOptions.PrintOnSheet="0" ReportOptions.Compressed="True" ReportOptions.CreateDate="39024.4955783102" ReportOptions.Description.Text="" ReportOptions.LastChange="43560.4452069676" ScriptLanguage="PascalScript" ScriptText.Text="// From [<tknSTARTDATE>] to [<tknENDDATE>] function GetSubtitle: String; var LStartDate, LEndDate: TDateTime; begin LStartDate := GetDateFromTokenVar(<tknSTARTDATE>); LEndDate := GetDateFromTokenVar(<tknENDDATE>); Result := 'From ' + DateToStr(LStartDate) + ' to ' + DateToStr(LEndDate) end; // converts string in 2013-03-14 format to datetime function GetDateFromTokenVar(const ADateStr: String): TDateTime; begin Result := StrToDate(Copy(ADateStr, 9, 2) + '/' + Copy(ADateStr, 6, 2) + '/' + Copy(ADateStr, 1, 4)); end; begin end." PropData="044C656674022C03546F70021408446174617365747301010C1E00000020446174615365743D2264732220446174615365744E616D653D226473220000095661726961626C657301010C16000000204E616D653D2220495450207661726961626C65732200010C21000000204E616D653D227374725265706F72745469746C65222056616C75653D2227272200010C24000000204E616D653D227374725265706F72745375627469746C65222056616C75653D2227272200010C29000000204E616D653D22737472557365724E616D65222056616C75653D22276879706572666C69676874272200010C24000000204E616D653D22737472456D61696C5369676E6174757265222056616C75653D2227272200010C28000000204E616D653D22737472456D61696C5369676E617475726548544D4C222056616C75653D2227272200010C1E000000204E616D653D227374724D65737361676531222056616C75653D2227272200010C1E000000204E616D653D227374724D65737361676532222056616C75653D2227272200010C29000000204E616D653D22746B6E535441525444415445222056616C75653D2227323031392D30342D3031272200010C27000000204E616D653D22746B6E454E4444415445222056616C75653D2227323031392D30342D3330272200010C23000000204E616D653D22746B6E50434E414D45222056616C75653D22274445424F524148272200010C2B000000204E616D653D22746B6E50434E414D4532222056616C75653D22274859504552464C494748542D504327220000055374796C650100">
<TfrxDataPage Name="Data" Height="1000" Left="0" Top="0" Width="1000"/>
<TfrxReportPage Name="Page1" Font.Charset="1" Font.Color="0" Font.Height="-13" Font.Name="Arial" Font.Style="1" PaperWidth="210" PaperHeight="297" PaperSize="9" LeftMargin="15" RightMargin="10" TopMargin="10" BottomMargin="10" ColumnWidth="0" ColumnPositions.Text="" HGuides.Text="" VGuides.Text="">
<TfrxPageHeader Name="PageHeader1" Height="34.01577" Left="0" Top="18.89765" Width="699.21305">
<TfrxMemoView Name="Memo7" Left="0" Top="0" Width="105.37786" Height="24" ShowHint="False" AutoWidth="True" Font.Charset="1" Font.Color="0" Font.Height="-19" Font.Name="Arial" Font.Style="1" Frame.Typ="8" ParentFont="False" Text="Timesheet"/>
<TfrxMemoView Name="mvSubtitle" Left="117.16543" Top="5.10235" Width="328.81911" Height="18.89765" ShowHint="False" AutoWidth="True" DisplayFormat.DecimalSeparator="." Font.Charset="1" Font.Color="-16777208" Font.Height="-13" Font.Name="Arial" Font.Style="3" Frame.Typ="8" ParentFont="False" Text="[GetSubtitle]"/>
</TfrxPageHeader>
<TfrxMasterData Name="MasterData1" Height="22.67718" Left="0" Top="173.85838" Width="699.21305" ColumnWidth="0" ColumnGap="0" DataSet="ds" DataSetName="ds" RowCount="0">
<TfrxMemoView Name="Memo1" Left="222.99227" Top="0" Width="143.62214" Height="18.89765" ShowHint="False" DataField="LogOn" DataSet="ds" DataSetName="ds" Font.Charset="1" Font.Color="0" Font.Height="-13" Font.Name="Arial" Font.Style="0" ParentFont="False" Text="[ds."LogOn"]"/>
<TfrxMemoView Name="dsLogOff" Left="381.73253" Top="0" Width="143.62214" Height="18.89765" ShowHint="False" DataField="LogOff" DataSet="ds" DataSetName="ds" Font.Charset="1" Font.Color="0" Font.Height="-13" Font.Name="Arial" Font.Style="0" ParentFont="False" Text="[ds."LogOff"]"/>
<TfrxMemoView Name="Memo2" Left="536.69326" Top="0" Width="83.14966" Height="18.89765" ShowHint="False" DataField="Day" DataSet="ds" DataSetName="ds" Font.Charset="1" Font.Color="0" Font.Height="-13" Font.Name="Arial" Font.Style="0" ParentFont="False" Text="[ds."Day"]"/>
<TfrxMemoView Name="Memo3" Left="627.40198" Top="0" Width="68.03154" Height="18.89765" ShowHint="False" DataField="Hours" DataSet="ds" DataSetName="ds" DisplayFormat.FormatStr="%2.2n" DisplayFormat.Kind="fkNumeric" Font.Charset="1" Font.Color="0" Font.Height="-13" Font.Name="Arial" Font.Style="0" HAlign="haRight" ParentFont="False" Text="[ds."Hours"]"/>
</TfrxMasterData>
<TfrxPageFooter Name="PageFooter1" Height="22.67718" Left="0" Top="370.39394" Width="699.21305">
<TfrxMemoView Name="Memo8" Left="0" Top="0" Width="225" Height="20" ShowHint="False" StretchMode="smMaxHeight" Font.Charset="1" Font.Color="0" Font.Height="-13" Font.Name="Arial" Font.Style="2" ParentFont="False" Text="[<DATE>] [FORMATDATETIME('h:mm am/pm', <TIME>)]"/>
<TfrxMemoView Name="Memo9" Left="574.48856" Top="0" Width="144.77953" Height="20" ShowHint="False" StretchMode="smMaxHeight" Font.Charset="1" Font.Color="0" Font.Height="-13" Font.Name="Arial" Font.Style="2" HAlign="haRight" ParentFont="False" Text="Page [Page#] of [TotalPages#]"/>
</TfrxPageFooter>
<TfrxGroupHeader Name="GroupHeader1" Height="37.7953" Left="0" Top="113.3859" Width="699.21305" Condition="ds."PCName"" KeepTogether="True">
<TfrxMemoView Name="dsPCName" Left="0" Top="11.33859" Width="192.75603" Height="18.89765" ShowHint="False" DataField="PCName" DataSet="ds" DataSetName="ds" Font.Charset="1" Font.Color="0" Font.Height="-13" Font.Name="Arial" Font.Style="5" ParentFont="False" Text="[ds."PCName"]"/>
<TfrxMemoView Name="Memo5" Left="222.99227" Top="11.33859" Width="143.62214" Height="18.89765" ShowHint="False" DisplayFormat.DecimalSeparator="." Font.Charset="1" Font.Color="-16777208" Font.Height="-13" Font.Name="Arial" Font.Style="1" Frame.Typ="8" ParentFont="False" Text="Log On Date/Time"/>
<TfrxMemoView Name="Memo6" Left="381.73253" Top="11.33859" Width="143.62214" Height="18.89765" ShowHint="False" DisplayFormat.DecimalSeparator="." Font.Charset="1" Font.Color="-16777208" Font.Height="-13" Font.Name="Arial" Font.Style="1" Frame.Typ="8" ParentFont="False" Text="Log Off Date/Time"/>
<TfrxMemoView Name="Memo10" Left="536.69326" Top="11.33859" Width="83.14966" Height="18.89765" ShowHint="False" DisplayFormat.DecimalSeparator="." Font.Charset="1" Font.Color="-16777208" Font.Height="-13" Font.Name="Arial" Font.Style="1" Frame.Typ="8" ParentFont="False" Text="Day"/>
<TfrxMemoView Name="Memo11" Left="627.40198" Top="11.33859" Width="68.03154" Height="18.89765" ShowHint="False" DisplayFormat.DecimalSeparator="." Font.Charset="1" Font.Color="-16777208" Font.Height="-13" Font.Name="Arial" Font.Style="1" Frame.Typ="8" HAlign="haRight" ParentFont="False" Text="Hours"/>
</TfrxGroupHeader>
<TfrxGroupFooter Name="GroupFooter1" Height="22.67718" Left="0" Top="219.21274" Width="699.21305">
<TfrxMemoView Name="Memo4" Left="627.40198" Top="0" Width="68.03154" Height="18.89765" ShowHint="False" DataSet="ds" DataSetName="ds" DisplayFormat.FormatStr="%2.2n" DisplayFormat.Kind="fkNumeric" Font.Charset="1" Font.Color="0" Font.Height="-13" Font.Name="Arial" Font.Style="1" Frame.Typ="4" HAlign="haRight" ParentFont="False" Text="[SUM(<ds."Hours">)]"/>
</TfrxGroupFooter>
<TfrxReportSummary Name="ReportSummary1" Height="45.35436" Left="0" Top="302.3624" Width="699.21305">
<TfrxMemoView Name="Memo12" Left="627.40198" Top="11.33859" Width="68.03154" Height="18.89765" ShowHint="False" DataSet="ds" DataSetName="ds" DisplayFormat.FormatStr="%2.2n" DisplayFormat.Kind="fkNumeric" Font.Charset="1" Font.Color="0" Font.Height="-13" Font.Name="Arial" Font.Style="1" Frame.Typ="12" HAlign="haRight" ParentFont="False" Text="[SUM(<ds."Hours">)]"/>
<TfrxMemoView Name="Memo13" Left="536.69326" Top="11.33859" Width="83.14966" Height="18.89765" ShowHint="False" DataSet="ds" DataSetName="ds" Font.Charset="1" Font.Color="0" Font.Height="-13" Font.Name="Arial" Font.Style="0" ParentFont="False" Text="Total"/>
</TfrxReportSummary>
</TfrxReportPage>
</TfrxReport>
Q� %B�,� Purchase Order 0 SELECT pol.*, p.ProductCode, s.ContactName FROM purchase_orders po
INNER JOIN purchase_order_lines pol ON pol.PurchaseOrderNo = po.PurchaseOrderNo
INNER JOIN suppliers s ON s.SupplierID = po.SupplierID
LEFT JOIN products p ON p.ProductID = pol.ProductID
WHERE po.PurchaseOrderNo = "[PURCHASEORDERNO]"> <?xml version="1.0" encoding="utf-8"?>
<TfrxReport Version="4.10.1" DotMatrixReport="False" IniFile="\Software\Fast Reports" PreviewOptions.AllowEdit="False" PreviewOptions.Buttons="1465" PreviewOptions.Zoom="1" PrintOptions.Printer="Default" PrintOptions.PrintOnSheet="0" ReportOptions.Compressed="True" ReportOptions.CreateDate="39024.4955783102" ReportOptions.Description.Text="" ReportOptions.LastChange="41725.8400818866" ScriptLanguage="PascalScript" ScriptText.Text="procedure Page1OnBeforePrint(Sender: TfrxComponent); var LContactName: String; LFirstName: String; LPos: Integer; begin // (SS,27/3/14) parse contact name to obtain the first name i.e. the word before the first space LContactName := Trim(<ds."ContactName">); LPos := Pos(' ', LContactName); if LPos = 0 then LFirstName := LContactName else LFirstName := Copy(LContactName, 1, LPos - 1); // pass values to email SetEmailVar('evContactFirstName', LFirstName); end; begin end." PropData="044C656674022C03546F70021408446174617365747301010C1E00000020446174615365743D2264732220446174615365744E616D653D226473220000095661726961626C657301010C16000000204E616D653D2220495450207661726961626C65732200010C21000000204E616D653D227374725265706F72745469746C65222056616C75653D2227272200010C24000000204E616D653D227374725265706F72745375627469746C65222056616C75653D2227272200010C29000000204E616D653D22737472557365724E616D65222056616C75653D22276879706572666C69676874272200010C24000000204E616D653D22737472456D61696C5369676E6174757265222056616C75653D2227272200010C28000000204E616D653D22737472456D61696C5369676E617475726548544D4C222056616C75653D2227272200010C1E000000204E616D653D227374724D65737361676531222056616C75653D2227272200010C1E000000204E616D653D227374724D65737361676532222056616C75653D2227272200010C26000000204E616D653D22746B6E50555243484153454F524445524E4F222056616C75653D22273127220000055374796C650100">
<TfrxDataPage Name="Data" Height="1000" Left="0" Top="0" Width="1000"/>
<TfrxReportPage Name="Page1" PaperWidth="210" PaperHeight="297" PaperSize="9" LeftMargin="15" RightMargin="10" TopMargin="10" BottomMargin="10" ColumnWidth="0" ColumnPositions.Text="" HGuides.Text="" VGuides.Text="" OnBeforePrint="Page1OnBeforePrint">
<TfrxPageHeader Name="PageHeader1" Height="71.81107" Left="0" Top="18.89765" Width="699.21305">
<TfrxMemoView Name="Memo7" Left="0" Top="0" Width="135.6141" Height="24" ShowHint="False" Font.Charset="1" Font.Color="0" Font.Height="-19" Font.Name="Times New Roman" Font.Style="1" Frame.Typ="8" ParentFont="False" Text="Purchase Order"/>
<TfrxMemoView Name="Memo3" Left="0" Top="49.13389" Width="90.70872" Height="18.89765" ShowHint="False" DisplayFormat.DecimalSeparator="." Font.Charset="1" Font.Color="-16777208" Font.Height="-13" Font.Name="Arial" Font.Style="1" Frame.Typ="8" ParentFont="False" Text="Product Code"/>
<TfrxMemoView Name="Memo4" Left="253.22851" Top="49.13389" Width="173.85838" Height="18.89765" ShowHint="False" DisplayFormat.DecimalSeparator="." Font.Charset="1" Font.Color="-16777208" Font.Height="-13" Font.Name="Arial" Font.Style="1" Frame.Typ="8" ParentFont="False" Text="Options"/>
<TfrxMemoView Name="Memo5" Left="98.26778" Top="49.13389" Width="151.1812" Height="18.89765" ShowHint="False" DisplayFormat.DecimalSeparator="." Font.Charset="1" Font.Color="-16777208" Font.Height="-13" Font.Name="Arial" Font.Style="1" Frame.Typ="8" ParentFont="False" Text="Product Name"/>
<TfrxMemoView Name="Memo6" Left="434.64595" Top="49.13389" Width="79.37013" Height="18.89765" ShowHint="False" DisplayFormat.DecimalSeparator="." Font.Charset="1" Font.Color="-16777208" Font.Height="-13" Font.Name="Arial" Font.Style="1" Frame.Typ="8" ParentFont="False" Text="Units"/>
<TfrxMemoView Name="Memo10" Left="521.57514" Top="49.13389" Width="79.37013" Height="18.89765" ShowHint="False" DisplayFormat.DecimalSeparator="." Font.Charset="1" Font.Color="-16777208" Font.Height="-13" Font.Name="Arial" Font.Style="1" Frame.Typ="8" HAlign="haRight" ParentFont="False" Text="Qty"/>
<TfrxMemoView Name="Memo11" Left="608.50433" Top="49.13389" Width="79.37013" Height="18.89765" ShowHint="False" DisplayFormat.DecimalSeparator="." Font.Charset="1" Font.Color="-16777208" Font.Height="-13" Font.Name="Arial" Font.Style="1" Frame.Typ="8" HAlign="haRight" ParentFont="False" Text="Cost"/>
</TfrxPageHeader>
<TfrxMasterData Name="MasterData1" Height="34.01577" Left="0" Top="151.1812" Width="699.21305" ColumnWidth="0" ColumnGap="0" DataSet="ds" DataSetName="ds" RowCount="0">
<TfrxMemoView Name="dsProductCode" Left="0" Top="0" Width="83.14966" Height="18.89765" ShowHint="False" DataField="ProductCode" DataSet="ds" DataSetName="ds" Font.Charset="1" Font.Color="-16777208" Font.Height="-13" Font.Name="Arial" Font.Style="0" ParentFont="False" Text="[ds."ProductCode"]"/>
<TfrxMemoView Name="dsProductName" Left="98.26778" Top="0" Width="154.96073" Height="18.89765" ShowHint="False" DataField="ProductName" DataSet="ds" DataSetName="ds" Font.Charset="1" Font.Color="-16777208" Font.Height="-13" Font.Name="Arial" Font.Style="0" ParentFont="False" Text="[ds."ProductName"]"/>
<TfrxMemoView Name="dsProductOptions" Left="253.22851" Top="0" Width="173.85838" Height="18.89765" ShowHint="False" DataField="ProductOptions" DataSet="ds" DataSetName="ds" Font.Charset="1" Font.Color="-16777208" Font.Height="-13" Font.Name="Arial" Font.Style="0" ParentFont="False" Text="[ds."ProductOptions"]"/>
<TfrxMemoView Name="dsQtyOrdered" Left="521.57514" Top="0" Width="79.37013" Height="18.89765" ShowHint="False" DataField="QtyOrdered" DataSet="ds" DataSetName="ds" Font.Charset="1" Font.Color="-16777208" Font.Height="-13" Font.Name="Arial" Font.Style="0" HAlign="haRight" ParentFont="False" Text="[ds."QtyOrdered"]"/>
<TfrxMemoView Name="Memo1" Left="434.64595" Top="0" Width="79.37013" Height="18.89765" ShowHint="False" DataField="Units" DataSet="ds" DataSetName="ds" Font.Charset="1" Font.Color="-16777208" Font.Height="-13" Font.Name="Arial" Font.Style="0" ParentFont="False" Text="[ds."Units"]"/>
<TfrxMemoView Name="Memo2" Left="608.50433" Top="0" Width="79.37013" Height="18.89765" ShowHint="False" DataField="UnitCost" DataSet="ds" DataSetName="ds" DisplayFormat.FormatStr="%2.2n" DisplayFormat.Kind="fkNumeric" Font.Charset="1" Font.Color="-16777208" Font.Height="-13" Font.Name="Arial" Font.Style="0" HAlign="haRight" ParentFont="False" Text="[ds."UnitCost"]"/>
</TfrxMasterData>
<TfrxPageFooter Name="PageFooter1" Height="22.67718" Left="0" Top="245.66945" Width="699.21305">
<TfrxMemoView Name="Memo8" Left="0" Top="0" Width="225" Height="20" ShowHint="False" StretchMode="smMaxHeight" Font.Charset="1" Font.Color="0" Font.Height="-13" Font.Name="Times New Roman" Font.Style="2" ParentFont="False" Text="[<DATE>] [FORMATDATETIME('h:mm am/pm', <TIME>)]"/>
<TfrxMemoView Name="Memo9" Left="574.48856" Top="0" Width="144.77953" Height="20" ShowHint="False" StretchMode="smMaxHeight" Font.Charset="1" Font.Color="0" Font.Height="-13" Font.Name="Times New Roman" Font.Style="2" HAlign="haRight" ParentFont="False" Text="Page [Page#] of [TotalPages#]"/>
</TfrxPageFooter>
</TfrxReportPage>
</TfrxReport>
%HyperFlight Order HF{PurchaseOrderNo}7 <html>
<title>HyperFlight Order</title>
<style>
html, body, h1, h2, p {
font-family: Arial, Helvetica, sans-serif;
}
img {
border: 0;
}
table {
border-collapse: collapse;
}
table, th, td {
border: 1px solid black;
}
td, th {
padding: 5px;
}
</style>
<body>
<p>
Hi {evContactFirstName},
</p>
<p>
Please supply:
</p>
<table>
{strMessage1}
</table>
<p>
{strMessage2}
</p>
<p>Please confirm order receipt and give an estimated despatch date.
</p>
<p>Please quote our EORI number on the parcel and documentation: GB116294226000
</p>
<p>We can supply you with a suitable commercial invoice if required.
</p>
<p>
Kind regards,
</p>
<p>
Neil.
</p>
---------------------------<br>
Neil Stainton<br>
HyperFlight Ltd<br>
Drybank Farm<br>
Fosse Way, Ettington<br>
Stratford-upon-Avon<br>
UK CV37 7PD<br>
<br>
Tel: +44 (0)1789 336166<br>
Mob: +44 (0)7821 351341<br>
Email: sales@hyperflight.co.uk<br>
Web : www.hyperflight.co.uk<br>
Skype: neil.stainton<br>
VAT ID: GB 116 2942 26<br>
EORI: GB116294226000
</body>
</html>