标签:
SQL:
select
(SELECT tenantry_name FROM t_tenantry WHERE tenantry_id = 100) as vc_head,
(SELECT vc_content FROM e_cnfg WHERE vc_category = ‘Wish‘) as vc_foot,
vc_billcode,----凭条编号
vc_sitecode,----货号
e_finance.f_premoney::numeric(10,2),---金额;转成两位小数
e_sitedef.vc_sitename, ----场地名称
e_sitedef.f_price,-----单价
(case when c_closetime is not null and c_opentime is not null
then to_char((c_closetime::time without time zone-c_opentime::time without time zone),‘hh24:mi:ss‘) else ‘‘ end)as shi_chang,--在场时间;时长
---datediff(‘mi‘,c_closetime,c_opentime),
--------‘‘60‘‘ as f_shichang,
e_finance.f_money::numeric(10,2),--" IS ‘收入‘;
e_finance.f_cash::numeric(10,2),--" IS ‘现金金额‘;
e_finance.vc_auser,--" IS ‘操作人‘;
e_finance.c_atime,--" IS ‘操作时间‘;
${fld:f_remark} as f_remark,----备注
(
select string_agg((e_sitedef.vc_sitename|| ‘<br/>‘ || e_siteusedetail.vc_sitecode || ‘ ‘ ||e_sitedef.f_price::numeric(10,2)|| ‘*‘ || ‘60‘ || ‘ ‘||e_finance.f_premoney::numeric(10,2)),‘<br/>‘) ----根据场地编号查出场地名称
from e_siteusedetail
left join e_sitedef on e_siteusedetail.vc_sitecode=e_sitedef.vc_code
inner join e_finance on e_siteusedetail.vc_billcode=e_finance.vc_code
where vc_billcode=${fld:pk_value} 查询出来的结果出来好几条都是一样的是因为没有加where条件这句话
)as gouwu_xiaopiao,
(select count(1) from e_sitedef where vc_code=e_siteusedetail.vc_sitecode) as f_jianshu
from e_siteusedetail
inner join e_finance on e_siteusedetail.vc_billcode=e_finance.vc_code
left join e_sitedef on e_siteusedetail.vc_sitecode=e_sitedef.vc_code
where vc_billcode=${fld:pk_value} 查询出来的结果出来好几条一样的是因为没有加where条件这句话
template.htm:
时长在数据库里查出来了,但是为准成数字,所以就在页面上去了时长的值,再把值传过去。在接受一下。
function prepareprint(){
/***
pk_value 数据主键
print_type 打印类型:contract、ticket,默认为ticket
*/
var vc_billcode=$("#vc_billcode").val();
var shi_chang=$("#shi_chang").val();
var f_remark=$("#ff_price").val();
if(vc_billcode!=‘‘){
var url = "${def:context}/action/project/erpClub/print/ticket/sitereservedetails?pk_value="+vc_billcode+"&shi_chang="+shi_chang+"&f_remark="+f_remark+"&print_type=contract";
ajaxCall(url,{ ---------查询
method : "get",
progress : true,
dataType : "script",
success : function() {
}
});
}else{
ccms.dialog.notice("请先付款!");
}
}
标签:
原文地址:http://www.cnblogs.com/prefect/p/5680194.html