<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[FrontAccounting forum — new report]]></title>
		<link>https://frontaccounting.com/punbb/viewtopic.php?id=8401</link>
		<atom:link href="https://frontaccounting.com/punbb/extern.php?action=feed&amp;tid=8401&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[The most recent posts in new report.]]></description>
		<lastBuildDate>Sat, 14 Sep 2019 21:28:02 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: new report]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=36005#p36005</link>
			<description><![CDATA[<p>Can you attach file after modification report and steps to run<br />I try but not work <br />Thanks</p>]]></description>
			<author><![CDATA[null@example.com (Mahmoud Ali)]]></author>
			<pubDate>Sat, 14 Sep 2019 21:28:02 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=36005#p36005</guid>
		</item>
		<item>
			<title><![CDATA[Re: new report]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=36000#p36000</link>
			<description><![CDATA[<p>You will either need to use a user defined <strong>Pivot</strong> function / procedure or make a php function to assemble a sql like it and then create a FA report to display it.</p><p>You want Item Category, User Sum for each user across the page.</p><p>A nice report indeed - An Item category Wise Customer Sales listing. Start by modifying Item Sales Summary Report - rep309.php.</p><p>Specify if you want Qty, Inv Amount or both to be summed.</p><p>Raw SQL (<strong>ST_SALESINVOICE=10</strong> as defined in <strong>includes/types.inc</strong>):<br /></p><div class="codebox"><pre><code>SELECT dd.stock_id
     , dd.description
     , dt.debtor_no
     , dm.`name` AS debtor
     , SUM(dd.quantity) AS TotQty
     , SUM(dd.quantity * dd.unit_price) AS TotAmount
FROM 1_debtor_trans_details dd LEFT JOIN 1_debtor_trans dt
     ON (dd.debtor_trans_no = dt.trans_no AND dd.debtor_trans_type = dt.`type`)
   LEFT JOIN 1_debtors_master dm USING (debtor_no)
WHERE dd.debtor_trans_type=10
GROUP BY dd.stock_id, dt.debtor_no;</code></pre></div><p>Sample output (debtor name omitted for space, date filters can be incorporated in the WHERE clause, adjust table prefix as appropriate):<br /></p><div class="codebox"><pre><code>stock_id    description    debtor_no    TotQty    TotAmount
101         iPad Air 2 16GB     1          21    6300
102         iPhone 6 64GB       1           5    1250
102         iPhone 6 64GB       2           1    222.62
103         iPhone Cover Case   2           1    44.52
202         Maintenance         1           5    0
26138763    Bucket              1           3    18
301         Support             1           3    240
95006000    Billiard Balls      1           5    54</code></pre></div><p>The real PIVOT sample SQL for the training company will be:<br /></p><div class="codebox"><pre><code>SELECT IFNULL(stock_id, &#039;Totals&#039;) AS stock_id
     , description
     , IF(debtor_no=1, TotQty, 0) AS `Qty - Donald Easter LLC`
     , IF(debtor_no=1, TotAmount, 0) AS `Amt - Donald Easter LLC`
     , IF(debtor_no=2, TotQty, 0) AS `Qty - MoneyMaker Ltd.`
     , IF(debtor_no=2, TotAmount, 0) AS `Amt - MoneyMaker Ltd.`
FROM ( 
SELECT dd.stock_id
     , dd.description
     , dt.debtor_no
     , dm.`name` AS debtor
     , SUM(dd.quantity) AS TotQty
     , ROUND(SUM(dd.quantity * dd.unit_price),0) AS TotAmount
FROM 1_debtor_trans_details dd LEFT JOIN 1_debtor_trans dt
     ON (dd.debtor_trans_no = dt.trans_no AND dd.debtor_trans_type = dt.`type`)
   LEFT JOIN 1_debtors_master dm USING (debtor_no)
WHERE dd.debtor_trans_type=10
--  AND dt.trans_date between &#039;2018-05-10&#039; and &#039;2019-01-21&#039;
GROUP BY dd.stock_id, dt.debtor_no
) a GROUP BY stock_id
WITH ROLLUP;</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (apmuthu)]]></author>
			<pubDate>Sat, 14 Sep 2019 06:22:51 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=36000#p36000</guid>
		</item>
		<item>
			<title><![CDATA[new report]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=35992#p35992</link>
			<description><![CDATA[<p>i need this report in FA same like in img<br />is explain sale total by category users </p><p>https://cdn1.imggmi.com/uploads/2019/9/13/138334b0240f403521831a9774642dbf-full.png</p><p>can you help me for this report<br />Thanks</p>]]></description>
			<author><![CDATA[null@example.com (Mahmoud Ali)]]></author>
			<pubDate>Fri, 13 Sep 2019 13:35:54 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=35992#p35992</guid>
		</item>
	</channel>
</rss>
