| | |
| | | <!-- and a.month = #{month}--> |
| | | <!-- </if>--> |
| | | <!-- </where>--> |
| | | select * from ( |
| | | SELECT |
| | | month, |
| | | SUM(sales_tax_amount) AS sales_tax_amount, |
| | | SUM(purchase_tax_amount) AS purchase_tax_amount |
| | | SUM(sales_tax_amount) AS j_tax_amount, |
| | | SUM(purchase_tax_amount) AS x_tax_amount |
| | | FROM ( |
| | | SELECT |
| | | DATE_FORMAT(entry_date, '%Y-%m') AS month, |
| | |
| | | 0 AS sales_tax_amount, |
| | | ROUND(SUM(contract_amount * 0.26), 2) AS purchase_tax_amount |
| | | FROM purchase_ledger |
| | | <where> |
| | | |
| | | a.month is not null |
| | | <if test="month != null"> |
| | | and a.month = #{month} |
| | | </if> |
| | | </where> |
| | | WHERE entry_date IS NOT NULL |
| | | GROUP BY DATE_FORMAT(entry_date, '%Y-%m') |
| | | ) t |
| | | GROUP BY month |
| | | ORDER BY month; |
| | | ORDER BY month |
| | | ) a |
| | | <where> |
| | | a.month is not null |
| | | <if test="month != null and month != ''"> |
| | | and a.month = #{month} |
| | | </if> |
| | | </where> |
| | | |
| | | </select> |
| | | <select id="listVat1" resultType="com.ruoyi.purchase.dto.VatDto"> |