天翎MyApps技术社区 - 低代码平台 | 流程管理系统 | BPM软件

 找回密码
 注册成为天翎用户
查看: 1819|回复: 0

[Iscript] 获取上一年某个客户信息【查询上一年指定用户的指定信息】

[复制链接]
purple 发表于 2011-11-29 11:37:00 | 显示全部楼层 |阅读模式
本帖最后由 purple 于 2012-12-17 10:15 编辑

函数格式:
getContractCustomer (customername, varlue, contractdate)
函数说明:
customername: 客户名称
varlue: 要获取的客户信息
contractdate:
示例:
实现getContractCustomer(customername, varlue, contractdate)函数的应用

  1. function getContractCustomer(customername, varlue, contractdate) {
  2.         var name = "";
  3.         name = getItemValueAsString(customername);
  4.         var strDate = "";
  5.         var iyear = 0;
  6.         if (contractdate != null) {
  7.                 strDate = format(contractdate, "yyyy");
  8.                 iyear = parseInt(strDate) - 1;
  9.         }
  10.         var sql = "select * from tlk_tm_contract_customer where datepart(yy ,item_contractdate) =" + iyear + " and item_customername ='" + name + "'";
  11.         var doc = findBySQL(sql);
  12.         var value = doc.getItemValueAsDouble(varlue);
  13.         return value;
  14. }
复制代码
调用

  1. #include " businesslib";
  2. getContractCustomer ("customername", " varlue", " contractdate");
复制代码

本版积分规则

QQ|手机版|天翎MyApps技术社区 ( 粤ICP备11093750号 )

GMT+8, 2026-8-12 14:11

Powered by Discuz! X3.4

Copyright © 2001-2020, Tencent Cloud.

快速回复 返回顶部 返回列表