if([%主合同名称%] = "" , msgbox("主合同名称不能为空", 0),RecalcGrid(GridName) and showallrows() and if(LocateFor("合同名称"," = ",[%主合同名称%]) > 0,SetVariable("%个总%",CountFor("合同表","主合同名称"," = ",[%主合同名称%],"附属合同","= ",- 1)) and SetVariable("%金总%",SumFor("合同表","合同总金额","主合同名称"," = ",[%主合同名称%],"附属合同","= ",- 1))and SetVariable("%项目金额%",SumFor("合同表","合同总金额","主合同名称"," = ",[%主合同名称%],"合同分类_三级"," = ","收入")) and SetVariable("%个材%",CountFor("合同表","主合同名称"," = ",[%主合同名称%],"合同分类_三级"," = ","材料采购")) and SetVariable("%金材%",SumFor("合同表","合同总金额","主合同名称"," = ",[%主合同名称%],"合同分类_三级"," = ","材料采购")) and SetVariable("%个安%",CountFor("合同表","主合同名称"," = ",[%主合同名称%],"合同分类_三级"," = ","安装合同")) and SetVariable("%金安%",SumFor("合同表","合同总金额","主合同名称"," = ",[%主合同名称%],"合同分类_三级"," = ","安装合同")) and SetVariable("%个分%",CountFor("合同表","主合同名称"," = ",[%主合同名称%],"合同分类_三级"," = ","分包")) and SetVariable("%金分%",SumFor("合同表","合同总金额","主合同名称"," = ",[%主合同名称%],"合同分类_三级"," = ","分包")) and SetVariable("%个管%",CountFor("合同表","主合同名称"," = ",[%主合同名称%],"合同分类_三级"," = ","项目管理")) and SetVariable("%金管%",SumFor("合同表","合同总金额","主合同名称"," = ",[%主合同名称%],"合同分类_三级"," = ","项目管理")) and SetVariable("%个其%",CountFor("合同表","主合同名称"," = ",[%主合同名称%],"合同分类_三级"," = ","其它")) and SetVariable("%金其%",SumFor("合同表","合同总金额","主合同名称"," = ",[%主合同名称%],"合同分类_三级"," = ","其它"))and SetVariable("%个挂%",CountFor("合同表","主合同名称"," = ",[%主合同名称%],"合同分类_三级"," = ","挂靠成本")) and SetVariable("%金挂%",SumFor("合同表","合同总金额","主合同名称"," = ",[%主合同名称%],"合同分类_三级"," = ","挂靠成本")),MsgBox("没有找到符合条件的行!",0)))
|