金蝶eas税率更新为16%相关功能点

第一点、数据库的调整

主要涉及到的表有Customer客户和Supplier供应商表,然后物料销售属性MaterialSales 表

--金蝶eas税率更新(17->16,11->10,13->11)
update T_BD_Customer set FTAXRATE = 16 where FTAXRATE = 17;
update T_BD_Supplier set FTAXRATE = 16 where FTAXRATE = 17'
update T_BD_Supplier set FTAXRATE = 10 where FTAXRATE = 11'
update T_BD_Supplier set FTAXRATE = 11 where FTAXRATE = 13'
update T_BD_MaterialSales set  FTAXRATE = 16 where FTAXRATE = 17'

第二点,统一全局变量

public class BizUIHelper
{
    /** 税率(%)默认值 */
    public static BigDecimal DefaultTaxRate = new BigDecimal("17.00");
    /**
     * 获取供应商税率 for beanEx
     */
    public static BigDecimal getTaxRateBySupplier(Context ctx,String customerId) throws BOSException, EASBizException
    {
        FilterInfo filter = new FilterInfo();
        FilterItemCollection fic = filter.getFilterItems();
        fic.add(new FilterItemInfo("id", customerId));
        SelectorItemCollection sic = new SelectorItemCollection();
        sic.add("id");
        sic.add("number");
        sic.add("name");
        sic.add("taxRate");
        EntityViewInfo view = new EntityViewInfo();
        view.setFilter(filter);
        view.setSelector(sic);
        ISupplier ic = SupplierFactory.getLocalInstance(ctx);
        SupplierCollection customerCol = ic.getSupplierCollection(view);
        if (customerCol == null || customerCol.isEmpty()) {
            return DefaultTaxRate;
        }
        SupplierInfo customer = customerCol.get(0);
        if(customer.getTaxRate()==null){return DefaultTaxRate;}
        BigDecimal taxRate = getBigDecimal(customer.getTaxRate());
        return taxRate;
    }
    /**
     * 检测是否关联方客户relatedCustomer
     * @author zhengkai
     */
    public static boolean checkIsRelatedCustomer(CustomerInfo cusInfo){
        boolean isRelatedCustomer=false;
        CtrlUnitInfo ctrInfo = SysContext.getSysContext().getCurrentCtrlUnit();
        if (ctrInfo != null && cusInfo != null &&cusInfo.getId()!=null ) {
            SelectorItemCollection sic = new SelectorItemCollection();
            sic.add("id");
            sic.add("number");
            sic.add("name");
            sic.add("relatedCustomer");

            EntityViewInfo view = new EntityViewInfo();
            view.setSelector(sic);
            FilterInfo filter = new FilterInfo();
            filter.getFilterItems().add(new FilterItemInfo("id",cusInfo.getId().toString(),CompareType.INCLUDE));
            view.setFilter(filter);
            CustomerCollection customerList=null;
            try {
                customerList = CustomerFactory.getRemoteInstance().getCustomerCollection(view);
            } catch (BOSException e) {
                e.printStackTrace();
            }
            if(customerList!=null&&customerList.size()>0){
                isRelatedCustomer = customerList.get(0).getBoolean("relatedCustomer");
            }
        }
        return isRelatedCustomer;
    }
}

第三步,在所有单据beanEx里面调用方法

/** 提交 */
protected IObjectPK _submit(Context ctx, IObjectValue model) throws BOSException, EASBizException
{
    SaleOrderInfo orderInfo = (SaleOrderInfo) model;
    try {
        //2018-01-10 zhengkai 优化税率获取计算
        if(orderInfo.getOrderCustomer()!=null){
        BigDecimal customerTaxRate = BizUIHelper.getTaxRateByCustomer2(ctx,orderInfo.getOrderCustomer().getId()+"");
            for (int i = 0; i < orderInfo.getEntries().size(); i++) {
                orderInfo.getEntries().get(i).setTaxRate(customerTaxRate);
            }
        }
    } catch (Exception e) {
        e.printStackTrace();
    }
}

第四步、检查缺漏的地方

例如是否有外围单据导入,设置为默认税率等

//分录设置默认税率
entry.setTaxRate(taxRate);

以后有什么修改的地方,可以统一修改工具类就可以了。至于税率的获取逻辑各个公司各不相同,根据实际情况设置即可。

已标记关键词 清除标记
相关推荐
<p> <b><span style="background-color:#FFE500;">【超实用课程内容】</span></b> </p> <p> <br /> </p> <p> <br /> </p> <p> 本课程内容包含讲解<span>解读Nginx的基础知识,</span><span>解读Nginx的核心知识、带领学员进行</span>高并发环境下的Nginx性能优化实战,让学生能够快速将所学融合到企业应用中。 </p> <p> <br /> </p> <p style="font-family:Helvetica;color:#3A4151;font-size:14px;background-color:#FFFFFF;"> <b><br /> </b> </p> <p style="font-family:Helvetica;color:#3A4151;font-size:14px;background-color:#FFFFFF;"> <b><span style="background-color:#FFE500;">【课程如何观看?】</span></b> </p> <p style="font-family:Helvetica;color:#3A4151;font-size:14px;background-color:#FFFFFF;"> PC端:<a href="https://edu.csdn.net/course/detail/26277"><span id="__kindeditor_bookmark_start_21__"></span></a><a href="https://edu.csdn.net/course/detail/27216">https://edu.csdn.net/course/detail/27216</a> </p> <p style="font-family:Helvetica;color:#3A4151;font-size:14px;background-color:#FFFFFF;"> 移动端:CSDN 学院APP(注意不是CSDN APP哦) </p> <p style="font-family:Helvetica;color:#3A4151;font-size:14px;background-color:#FFFFFF;"> 本课程为录播课,课程永久有效观看时长,大家可以抓紧时间学习后一起讨论哦~ </p> <p style="font-family:"color:#3A4151;font-size:14px;background-color:#FFFFFF;"> <br /> </p> <p class="ql-long-24357476" style="font-family:"color:#3A4151;font-size:14px;background-color:#FFFFFF;"> <strong><span style="background-color:#FFE500;">【学员专享增值服务】</span></strong> </p> <p class="ql-long-24357476" style="font-family:"color:#3A4151;font-size:14px;background-color:#FFFFFF;"> <b>源码开放</b> </p> <p class="ql-long-24357476" style="font-family:"color:#3A4151;font-size:14px;background-color:#FFFFFF;"> 课件、课程案例代码完全开放给你,你可以根据所学知识,自行修改、优化 </p> <p class="ql-long-24357476" style="font-family:"color:#3A4151;font-size:14px;background-color:#FFFFFF;"> 下载方式:电脑登录<a href="https://edu.csdn.net/course/detail/26277"></a><a href="https://edu.csdn.net/course/detail/27216">https://edu.csdn.net/course/detail/27216</a>,播放页面右侧点击课件进行资料打包下载 </p> <p> <br /> </p> <p> <br /> </p> <p> <br /> </p>
©️2020 CSDN 皮肤主题: 博客之星2020 设计师:CY__ 返回首页