Commit 98532849 by Volkan Uygun

refs #3494 Kasa hareket raporu pdf türünde hata düzeltmesi

- Kasa gider fişlerinden gelen tutarların toplam yerine satır tutarı olarak raporlanması 
- Kasa dönem toplamlarında değişikliklik
- SQL iyileştirmesi
- Bu rapor önce Döviz sonra Kasa kırılımı olarak gösterilir. 
parent 517fc306
......@@ -4,7 +4,7 @@
<property name="ireport.encoding" value="UTF-8"/>
<property name="ireport.zoom" value="1.0"/>
<property name="ireport.x" value="0"/>
<property name="ireport.y" value="6"/>
<property name="ireport.y" value="0"/>
<import value="net.sf.jasperreports.engine.*"/>
<import value="java.util.*"/>
<import value="net.sf.jasperreports.engine.data.*"/>
......@@ -52,7 +52,6 @@
select
(
select sum(CCYVAL * case when acct.FINANCE_ACTION = 1 then -1 else 1 end) as TOTAL from ACCOUNT_TXN act1
inner join ACCOUNT ac1 on ac1.ID = act1.ACCOUNT_ID
where
(act1.ACCOUNT_ID = acct.ACCOUNT_ID)
and ((acct.SERIAL is null) or (act1.SERIAL = acct.SERIAL))
......@@ -70,7 +69,6 @@ and ((acct.ADVERSE_CODE is null) or (act1.ADVERSE_CODE = acct.ADVERSE_CODE))
acct.DOCUMENT_TYPE as DOCUMENT_TYPE,
(select sum(LCYVAL * case when acct.FINANCE_ACTION = 1 then -1 else 1 end) as LCYVAL from ACCOUNT_TXN act2
inner join ACCOUNT ac2 on ac2.ID = act2.ACCOUNT_ID
where
(act2.ACCOUNT_ID = acct.ACCOUNT_ID)
and ((acct.SERIAL is null) or (act2.SERIAL = acct.SERIAL))
......@@ -98,7 +96,10 @@ and ((acct.WORK_BUNCH_ID is null) or (act2.WORK_BUNCH_ID = acct.WORK_BUNCH_ID))
acc.NAME as KASA, acct.SERIAL, acct.REFERENCE,
acct.TXN_DATE, acct.CODE, acct.INFO, acct.FINANCE_ACTION,
acct.ADVERSE_CODE as KARSIKOD,acct.ADVERSE_NAME as KARSIAD,
acct.CCY, wb.CODE as WBCODE, wb.NAME as WBNAME
acct.CCY,
(acct.LCYVAL * case when acct.FINANCE_ACTION = 1 then -1 else 1 end) as ROWL,
(acct.CCYVAL * case when acct.FINANCE_ACTION = 1 then -1 else 1 end) as ROWC,
wb.CODE as WBCODE, wb.NAME as WBNAME
from ACCOUNT_TXN acct
inner join ACCOUNT acc on acc.ID = acct.ACCOUNT_ID
left outer join WORK_BUNCH wb on wb.ID = acct.WORK_BUNCH_ID
......@@ -112,9 +113,9 @@ and (($P{pDocu} = 0) or (acct.DOCUMENT_TYPE = $P{pDocu}))
and (($P{pProcessType} is null) or (acct.PROCESS_TYPE = $P{pProcessType}))
and (($P{pAdvName} is null) or (lower(acct.ADVERSE_NAME) like concat(lower($P{pAdvName}),'%') ))
and (($P{pAdvCode} is null) or (lower(acct.ADVERSE_CODE) like concat(lower($P{pAdvCode}),'%') ))
and ( ( acct.TXN_DATE >= $P{pBDate} and acct.TXN_DATE <= $P{pEDate} ) )
) as HAREKET
order by HAREKET.KASA, HAREKET.TXN_DATE, HAREKET.CODE, HAREKET.DOCUMENT_TYPE]]>
</queryString>
<field name="TOTAL" class="java.math.BigDecimal"/>
......@@ -131,6 +132,8 @@ order by HAREKET.KASA, HAREKET.TXN_DATE, HAREKET.CODE, HAREKET.DOCUMENT_TYPE]]>
<field name="KARSIKOD" class="java.lang.String"/>
<field name="KARSIAD" class="java.lang.String"/>
<field name="CCY" class="java.lang.String"/>
<field name="ROWL" class="java.math.BigDecimal"/>
<field name="ROWC" class="java.math.BigDecimal"/>
<field name="WBCODE" class="java.lang.String"/>
<field name="WBNAME" class="java.lang.String"/>
<variable name="sumBakiye" class="java.math.BigDecimal">
......@@ -138,7 +141,10 @@ order by HAREKET.KASA, HAREKET.TXN_DATE, HAREKET.CODE, HAREKET.DOCUMENT_TYPE]]>
<initialValueExpression><![CDATA[($F{oncekiBakiye} == null) ? BigDecimal.ZERO : $F{oncekiBakiye}]]></initialValueExpression>
</variable>
<variable name="generalTotal" class="java.math.BigDecimal" calculation="Sum">
<variableExpression><![CDATA[(($F{TOTAL} != null && ($F{TXN_DATE}.after($P{pBDate}) || $F{TXN_DATE}.equals( $P{pBDate} )) && ($F{TXN_DATE}.before($P{pEDate}) || $F{TXN_DATE}.equals( $P{pEDate} ))) ? $F{TOTAL} : BigDecimal.ZERO).add(($V{subReportValue} == null) ? BigDecimal.ZERO : $V{subReportValue})]]></variableExpression>
<variableExpression><![CDATA[(($F{ROWC} != null && ($F{TXN_DATE}.after($P{pBDate}) || $F{TXN_DATE}.equals( $P{pBDate} ))
&& ($F{TXN_DATE}.before($P{pEDate}) || $F{TXN_DATE}.equals( $P{pEDate} ))) ?
$F{ROWC} : BigDecimal.ZERO).add(($V{subReportValue} == null) ?
BigDecimal.ZERO : $V{subReportValue})]]></variableExpression>
<initialValueExpression><![CDATA[BigDecimal.ZERO]]></initialValueExpression>
</variable>
<variable name="subReportValue" class="java.math.BigDecimal">
......@@ -146,32 +152,22 @@ order by HAREKET.KASA, HAREKET.TXN_DATE, HAREKET.CODE, HAREKET.DOCUMENT_TYPE]]>
</variable>
<variable name="sumLCYVAL" class="java.math.BigDecimal" calculation="Sum">
<variableExpression><![CDATA[($F{TXN_DATE}.after($P{pBDate}) || $F{TXN_DATE}.equals( $P{pBDate} )) && ($F{TXN_DATE}.before($P{pEDate}) || $F{TXN_DATE}.equals( $P{pEDate} ))
? $F{TOTAL}.add(($V{subReportValue} == null) ? BigDecimal.ZERO : $V{subReportValue}) : BigDecimal.ZERO]]></variableExpression>
<initialValueExpression><![CDATA[BigDecimal.ZERO]]></initialValueExpression>
</variable>
<variable name="kasaDeviri" class="java.math.BigDecimal" resetType="Group" resetGroup="ACCOUNT" calculation="Sum">
<variableExpression><![CDATA[($F{TXN_DATE}.after($P{pBDate}) || $F{TXN_DATE}.equals( $P{pBDate} )) && ($F{TXN_DATE}.before($P{pEDate}) || $F{TXN_DATE}.equals( $P{pEDate} ))
? $F{TOTAL} : BigDecimal.ZERO]]></variableExpression>
? $F{ROWC}.add(($V{subReportValue} == null) ? BigDecimal.ZERO : $V{subReportValue}) : BigDecimal.ZERO]]></variableExpression>
<initialValueExpression><![CDATA[BigDecimal.ZERO]]></initialValueExpression>
</variable>
<variable name="kasaDovizDevir" class="java.math.BigDecimal" resetType="Group" resetGroup="ACCOUNT" calculation="Sum">
<variableExpression><![CDATA[($F{FINANCE_ACTION}.intValue()==1) ? $F{TOTAL}.negate() : $F{TOTAL}]]></variableExpression>
<variableExpression><![CDATA[($F{FINANCE_ACTION}.intValue()==1) ? $F{ROWC}.negate() : $F{ROWC}]]></variableExpression>
<initialValueExpression><![CDATA[BigDecimal.ZERO]]></initialValueExpression>
</variable>
<variable name="tediyeTop" class="java.math.BigDecimal" resetType="Group" resetGroup="ACCOUNT" calculation="Sum">
<variableExpression><![CDATA[($F{TXN_DATE}.after($P{pBDate}) || $F{TXN_DATE}.equals( $P{pBDate} )) && ($F{TXN_DATE}.before($P{pEDate}) || $F{TXN_DATE}.equals( $P{pEDate} ))
&& ($F{FINANCE_ACTION}.intValue()==1) ? $F{TOTAL}.negate() : BigDecimal.ZERO]]></variableExpression>
<variableExpression><![CDATA[(($F{TXN_DATE}.after($P{pBDate}) || $F{TXN_DATE}.equals( $P{pBDate} )) &&
($F{TXN_DATE}.before($P{pEDate}) || $F{TXN_DATE}.equals( $P{pEDate} )) &&
($F{FINANCE_ACTION}.intValue()==1)) ? $F{ROWC}.negate() : BigDecimal.ZERO]]></variableExpression>
<initialValueExpression><![CDATA[BigDecimal.ZERO]]></initialValueExpression>
</variable>
<variable name="tahsilatTop" class="java.math.BigDecimal" resetType="Group" resetGroup="ACCOUNT" calculation="Sum">
<variableExpression><![CDATA[($F{TXN_DATE}.after($P{pBDate}) || $F{TXN_DATE}.equals( $P{pBDate} )) && ($F{TXN_DATE}.before($P{pEDate}) || $F{TXN_DATE}.equals( $P{pEDate} ))
&& ($F{FINANCE_ACTION}.intValue()==0) ? $F{TOTAL} : BigDecimal.ZERO]]></variableExpression>
<initialValueExpression><![CDATA[BigDecimal.ZERO]]></initialValueExpression>
</variable>
<variable name="sonrakiDonemeDevir" class="java.math.BigDecimal" resetType="Group" resetGroup="ACCOUNT">
<variableExpression><![CDATA[( ($F{oncekiBakiye} != null )
? $F{oncekiBakiye}.add($V{kasaDeviri})
: ($V{kasaDeviri}))]]></variableExpression>
&& ($F{FINANCE_ACTION}.intValue()==0) ? $F{ROWC} : BigDecimal.ZERO]]></variableExpression>
<initialValueExpression><![CDATA[BigDecimal.ZERO]]></initialValueExpression>
</variable>
<variable name="oncekiBakiye" class="java.math.BigDecimal" resetType="Group" resetGroup="ACCOUNT">
......@@ -181,6 +177,15 @@ order by HAREKET.KASA, HAREKET.TXN_DATE, HAREKET.CODE, HAREKET.DOCUMENT_TYPE]]>
<variable name="devirToplami" class="java.math.BigDecimal" calculation="Sum">
<variableExpression><![CDATA[$F{TOTAL}]]></variableExpression>
</variable>
<variable name="kasaDeviri" class="java.math.BigDecimal" resetType="Group" resetGroup="ACCOUNT" calculation="Sum">
<variableExpression><![CDATA[($F{TXN_DATE}.after($P{pBDate}) || $F{TXN_DATE}.equals( $P{pBDate} )) && ($F{TXN_DATE}.before($P{pEDate}) || $F{TXN_DATE}.equals( $P{pEDate} ))
? $F{ROWC} : BigDecimal.ZERO]]></variableExpression>
<initialValueExpression><![CDATA[BigDecimal.ZERO]]></initialValueExpression>
</variable>
<variable name="sonrakiDonemeDevir" class="java.math.BigDecimal">
<variableExpression><![CDATA[($F{oncekiBakiye} != null) ? $V{kasaDeviri}.add( $F{oncekiBakiye} ) : $V{kasaDeviri}]]></variableExpression>
<initialValueExpression><![CDATA[new BigDecimal( 0 )]]></initialValueExpression>
</variable>
<group name="ACCOUNT">
<groupExpression><![CDATA[$F{KASA}]]></groupExpression>
<groupHeader>
......@@ -753,7 +758,7 @@ order by HAREKET.KASA, HAREKET.TXN_DATE, HAREKET.CODE, HAREKET.DOCUMENT_TYPE]]>
<textElement textAlignment="Right">
<font fontName="Lucida Sans" size="8" isBold="false" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfEncoding="Cp1254" isPdfEmbedded="false"/>
</textElement>
<textFieldExpression class="java.math.BigDecimal"><![CDATA[$F{TOTAL}]]></textFieldExpression>
<textFieldExpression class="java.math.BigDecimal"><![CDATA[$F{ROWC}]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="true" pattern="" isBlankWhenNull="true">
<reportElement key="textField-11" stretchType="RelativeToBandHeight" x="140" y="0" width="60" height="16" forecolor="#000000"/>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment