Commit d244664d authored by neo's avatar neo

[dev] use period tax rule setting projectid in vat logic

parent 5d382a4d
......@@ -69,11 +69,11 @@ public class GZSD extends FunctionBase implements FreeRefFunction {
List<PeriodTaxRuleSetting> taxRuleSettings =
SpringContextUtil.periodTaxRuleSettingMapper.getTaxRuleSetting(formulaContext.getOrganizationId(),
taxName, formulaContext.getPeriod());
taxName, formulaContext.getPeriod(), formulaContext.getProjectId());
Optional<PeriodTaxRuleSetting> matchedRule = taxRuleSettings.stream().filter(a -> a.getIsDefault() != Constant.IsDefault.Yes).findFirst();
if (!matchedRule.isPresent()) {
matchedRule = Optional.ofNullable(taxRuleSettings.size()>0?taxRuleSettings.get(0):null);
matchedRule = Optional.ofNullable(taxRuleSettings.size() > 0 ? taxRuleSettings.get(0) : null);
if (!matchedRule.isPresent()) {
NumberFormat nf = NumberFormat.getPercentInstance();
......
......@@ -109,5 +109,6 @@ public interface PeriodTaxRuleSettingMapper extends MyVatMapper {
List<PeriodTaxRuleSetting> getTaxRuleSetting(@Param("organizationId") String organizationId,
@Param("taxName") String taxName, @Param("period") int period);
@Param("taxName") String taxName, @Param("period") int period,
@Param("projectId") String projectId);
}
\ No newline at end of file
......@@ -20,6 +20,7 @@
)
AND TRS.NAME = #{taxName,jdbcType=VARCHAR}
AND TRS.PERIOD = #{period,jdbcType=INTEGER}
AND TRS.PROJECT_ID = #{projectId,jdbcType=INTEGER}
</select>
</mapper>
\ No newline at end of file
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