| | |
| | | <result property="unitname" column="UnitName"/> |
| | | <result property="unitno" column="UnitNo"/> |
| | | <result property="unituserno" column="UnitUserNo"/> |
| | | <result property="isunit" column="IsUnit"/> |
| | | <result property="title" column="Title"/> |
| | | <result property="idcardtype" column="IDCardType"/> |
| | | <result property="idcardno" column="IDCardNo"/> |
| | |
| | | <result property="amount" column="Amount"/> |
| | | <result property="taxamount" column="TaxAmount"/> |
| | | <result property="taxedamount" column="TaxedAmount"/> |
| | | <result property="vatAmount" column="vat_amount"/> |
| | | <result property="cityTaxAmount" column="city_tax_amount"/> |
| | | <result property="laborPretaxAmount" column="labor_pretax_amount"/> |
| | | <result property="taxVersion" column="tax_version"/> |
| | | <result property="prepaidamount" column="PrepaidAmount"/> |
| | | <result property="invoicecount" column="InvoiceCount"/> |
| | | <result property="attachcount" column="AttachCount"/> |
| | |
| | | UnitName, |
| | | UnitNo, |
| | | UnitUserNo, |
| | | IsUnit, |
| | | Title, |
| | | OrderNo, |
| | | ItemCode, |
| | |
| | | TaxAmount, |
| | | InvoiceCount, |
| | | TaxedAmount, |
| | | vat_amount, |
| | | city_tax_amount, |
| | | labor_pretax_amount, |
| | | tax_version, |
| | | AttachCount, |
| | | Quantity, |
| | | Price, |
| | |
| | | a.UnitName, |
| | | a.UnitNo, |
| | | a.UnitUserNo, |
| | | a.IsUnit, |
| | | a.Title, |
| | | a.OrderNo, |
| | | a.ItemCode, |
| | |
| | | a.TaxAmount, |
| | | a.InvoiceCount, |
| | | a.TaxedAmount, |
| | | a.vat_amount, |
| | | a.city_tax_amount, |
| | | a.labor_pretax_amount, |
| | | a.tax_version, |
| | | a.AttachCount, |
| | | a.Quantity, |
| | | a.Price, |
| | |
| | | where fundID = #{fundid} |
| | | </update> |
| | | |
| | | <!-- 2026-12-03:删除个税汇总单时,清空该批次明细的算税时间与顺序号, |
| | | 与汇总单页“删除单行”(updateTaxTime 传 null)的行为保持一致。 |
| | | 注意:本语句依赖 service_fund.fund_tax_id,必须在解绑(clearFundTaxRelationByFundTaxIds)之前执行。 --> |
| | | <update id="clearTaxTimeByFundTaxIds"> |
| | | update service_funddetail d |
| | | join service_fund f on d.FundID = f.id |
| | | set d.tax_time = null, |
| | | d.xh = null |
| | | where f.fund_tax_id in |
| | | <foreach item="item" index="index" collection="fundTaxIds" open="(" separator="," close=")"> |
| | | #{item} |
| | | </foreach> |
| | | </update> |
| | | |
| | | <select id="getTaxSum" parameterType="com.ruoyi.project.domain.vo.TaxMoneyByItemEO" |
| | | resultType="com.ruoyi.project.domain.vo.TaxMoneySumEO"> |
| | | SELECT sum(a.Amount) amounts, sum(a.TaxAmount) taxAmounts, sum(a.TaxedAmount) taxedAmounts, max(a.xh) as xh,a.IDCardNo |
| | | SELECT sum(a.Amount) amounts, |
| | | sum(COALESCE(a.labor_pretax_amount, a.Amount)) laborPretaxAmounts, |
| | | sum(COALESCE(a.TaxAmount, 0)) taxAmounts, |
| | | sum(COALESCE(a.TaxedAmount, 0)) taxedAmounts, |
| | | sum(COALESCE(a.vat_amount, 0)) vatAmounts, |
| | | sum(COALESCE(a.city_tax_amount, 0)) cityTaxAmounts, |
| | | sum(CASE WHEN a.tax_version IS NOT NULL AND a.tax_version <> #{taxVersion} |
| | | THEN 1 ELSE 0 END) otherVersionCount, |
| | | max(CASE WHEN a.tax_version IS NOT NULL AND a.tax_version <> #{taxVersion} |
| | | THEN a.tax_version END) otherVersion, |
| | | max(a.xh) xh, |
| | | a.IDCardNo |
| | | FROM service_funddetail a, |
| | | service_fund b |
| | | where a.FundID = b.id |