<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[FrontAccounting forum — new report]]></title>
	<link rel="self" href="https://frontaccounting.com/punbb/extern.php?action=feed&amp;tid=8401&amp;type=atom" />
	<updated>2019-09-14T21:28:02Z</updated>
	<generator>PunBB</generator>
	<id>https://frontaccounting.com/punbb/viewtopic.php?id=8401</id>
		<entry>
			<title type="html"><![CDATA[Re: new report]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=36005#p36005" />
			<content type="html"><![CDATA[<p>Can you attach file after modification report and steps to run<br />I try but not work <br />Thanks</p>]]></content>
			<author>
				<name><![CDATA[Mahmoud Ali]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=44917</uri>
			</author>
			<updated>2019-09-14T21:28:02Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=36005#p36005</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: new report]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=36000#p36000" />
			<content type="html"><![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>]]></content>
			<author>
				<name><![CDATA[apmuthu]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=364</uri>
			</author>
			<updated>2019-09-14T06:22:51Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=36000#p36000</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[new report]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=35992#p35992" />
			<content type="html"><![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>]]></content>
			<author>
				<name><![CDATA[Mahmoud Ali]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=44917</uri>
			</author>
			<updated>2019-09-13T13:35:54Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=35992#p35992</id>
		</entry>
</feed>
