当前位置: 首页>>代码示例>>Python>>正文


Python MethodUtil.getProperties方法代码示例

本文整理汇总了Python中base.utils.MethodUtil.getProperties方法的典型用法代码示例。如果您正苦于以下问题:Python MethodUtil.getProperties方法的具体用法?Python MethodUtil.getProperties怎么用?Python MethodUtil.getProperties使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在base.utils.MethodUtil的用法示例。


在下文中一共展示了MethodUtil.getProperties方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: applySave

# 需要导入模块: from base.utils import MethodUtil [as 别名]
# 或者: from base.utils.MethodUtil import getProperties [as 别名]
def applySave(request):
    """保存结算申请单"""
    paytypeid = request.session.get("s_paytypeid")
    s_ucode = request.session.get("s_ucode")
    venderid = request.session.get("s_suppcode")
    pstart = mtu.getReqVal(request,"pstart",None)
    pend = mtu.getReqVal(request,"pend",None)
    cstart = mtu.getReqVal(request,"cstart",None)
    cend = mtu.getReqVal(request,"cend",None)
    refsheetids = mtu.getReqList(request,"refsheetid",None)
    balancePlaceId = mtu.getReqVal(request,"balancePlaceId")

    params = {}
    result = {}

    #判断是否可以提交结算单
    islimit = mtu.getProperties(Constants.SCM_CONFIG_MODULE,Constants.SCM_CONFIG_BILL_ISLIMIT)
    if islimit == 'True':
        sequence = allowCommit(paytypeid,venderid)
    else:
        sequence = "0"

    if sequence=="0":
        planpaydate = datetime.date.today().strftime("%Y-%m-%d")
        params["pstart"]=pstart
        params["pend"]=pend
        params["cstart"]=cstart
        params["cend"]=cend
        params["planpaydate"]=planpaydate
        params["editor"]=s_ucode
        params["editdate"]=datetime.date.today().strftime("%Y-%m-%d")
        # params["sheetid"] = sheetId
        params["venderid"] = venderid
        try:
            conn2 = mtu.get_MssqlConn()
            errors = 0
            try:
                blist = []
                for row in refsheetids:
                    ric = eval(row)
                    blist.append(ric)

                payableamt = findPayableCostValue(conn2,balancePlaceId,venderid)
                if not payableamt:
                    payableamt = decimal.Decimal(0.0)

                costvalue = findCostValue(conn2,venderid)
                if not costvalue:
                    costvalue = decimal.Decimal(0.0)

                unjsvalue = unbalancedCostValue(conn2,venderid,pstart)
                if not unjsvalue:
                    unjsvalue = decimal.Decimal(0.0)

                undqvalue = undueCostValue(conn2,venderid,pend)
                if not undqvalue:
                    undqvalue = decimal.Decimal(0.0)

                advance = findAdvance(conn2,venderid)
                if not advance:
                    advance = decimal.Decimal(0.0)

                payablemoney = sum([float(row["costvalue"]) for row in blist])
                if not payablemoney:
                    payablemoney = decimal.Decimal(0.0)

                params["payablemoney"]=float(payablemoney)   #应付金额
                params["advance"]=float(advance)        #预付款余额,预付款应扣金额(promoney)默认0 (写表billhead0)
                params["costvalue"]=float(costvalue)    #库存金额 (写表billhead0)
                params["undqvalue"]=float(undqvalue)    #未到期金额 (写表billhead0) 取不为空数据
                params["payableamt"]=float(payableamt)  #应付账款金额 (写表billhead0)
                params["unjsvalue"]=float(unjsvalue)    #应结未结金额 (写表billhead0) 取不为空数据

                #新增
                type=0
                typeStr = "新增"
                sheetId = getSheetId(conn2)

                conn = mtu.getMssqlConn()
                conn.autocommit(False)

                klist = findKxsum(conn,venderid,pend)
                kxmoney = sum([row["kmoney"] for row in klist])
                if not kxmoney:
                    kxmoney = decimal.Decimal(0.0)

                cashlist = filter(lambda row:row["kkflag"]==0,[row for row in klist])
                invoicelist =  filter(lambda row:row["kkflag"]==1,[row for row in klist])

                kxcash = sum([row["kmoney"] for row in cashlist])
                if not kxcash:
                    kxcash = decimal.Decimal(0.0)

                kxinvoice = sum([row["kmoney"] for row in invoicelist])
                if not kxinvoice:
                    kxinvoice = decimal.Decimal(0.0)

                #应付金额=实付金额+帐扣金额
                #应开票金额=实付金额
                params["kxmoney"]=float(kxmoney)    #扣项金额合计
#.........这里部分代码省略.........
开发者ID:KGPython,项目名称:scm,代码行数:103,代码来源:views.py


注:本文中的base.utils.MethodUtil.getProperties方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。