结款
字段可选
M:must 必填
O:optional 选填
C: conditional 某些条件下必选
搜索结款单
接口名
/finance/bill
Method
GET
请求
query_data O string 查询内容,支持客户ID(K001或者1)和结款单ID
offset O int 分页缩进,默认0
limit O int 分页每页数量,默认10
响应
code M int 返回码,0表示成功,其他表示错误
msg M string 错误信息
data M string 返回json数据
[{
"should_pay" M float 应付金额
"create_time" M datetime 创建时间
"end_date" M datetime 结算周期截止日
"customer_name" M string 客户名
"customer_id" M string 客户ID
"real_pay" M float 实付金额
"status" M int 结款单状态(1:未支付;2:已支付;3:已删除)
"id" M string 结款单ID
"difference" M float 应付和实付的差额
"customer_cellphone" M string 客户手机
"flow_id" M string 流水号
}]
示例
request
http://test.guanmai.cn:8888/finance/bill?query_data=K1&offset=0&limit=10
response
{
"data": [{
"should_pay": 1683.5,
"create_time": "2016-09-29",
"end_date": "2016-09-20",
"customer_name": "\u5ba2\u623720",
"customer_id": "K00079",
"real_pay": 0.0,
"status": 1,
"id": "JK00147",
"difference": 1683.5,
"customer_cellphone": "12335435452",
"flow_id": ""
}],
"code": 0,
"pagination": {
"offset": 0,
"count": 62,
"limit": 10
},
"msg": "ok"
}
结款明细
接口名
/finance/bill/detail
Method
GET
请求
id M string 结款单ID
响应
code M int 返回码,0表示成功,其他表示错误
msg M string 错误信息
data M string 返回json数据
"should_pay" M float 应付金额
"freeze_fees": [{ O list 冷藏费
"days" M int 计费天数
"name" M string 商品名
"charge_count" M float 计费数量
"batch_id" M string 批次号
"contract_id" M string 合同ID
"unit_price" M float 单价
"real_count" M float 实际数量
"start_date" M datetime 开始日期
"unit_name" M string 单位
"should_pay" M float 应付金额
"end_date" M datetime 截止日期
}],
"start_date" M datetime 开始日期
"customer_name" M string 客户名
"carrying_fees": [{ O list 搬运费
"name" M string 商品名
"batch_id" M string 批次号
"contract_id" M string 合同ID
"unit_price" M float 单价
"real_count" M float 实际数量
"charge_count" M float 计费数量
"unit_name" M string 单位
"should_pay" M float 应付金额
"operate_date" M datetime 操作日期
}],
"real_pay" M float 实付金额
"storage_fees": [{ O list 处置费
"name" M string 商品名
"batch_id" M string 批次号
"contract_id" M string 合同ID
"unit_price" M float 单价
"real_count" M float 实际数量
"charge_count" M float 计费数量
"unit_name" M string 单位
"should_pay" M float 应付金额
"operate_date" M datetime 操作日期
}],
"customer_cellphone" M string 客户手机
"rent_fees": [{ O list 私库租金
"should_pay" M float 应付金额
"days" M int 计费天数
"start_date" M datetime 开始日期
"contract_id" M string 合同ID
"ware_category_1_name" M string 仓库名
"end_date" M datetime 结束日期
"ware_category_2_name" M 库区名
"ware_category_3_name" M 库位名
"ware_category_4_name" M 通道名
"unit_price" M float 单价
}],
"create_time" M datetime 出账时间
"end_date" M datetime 结束日期
"additional_task_fees": [{ O list 作业单费用
"name" M string 作业费用名
"charge_count" M float 计费数量
"real_count" M float 实际数量
"receipt_id" M string 作业单ID
"unit_name" M string 单位
"unit_price" M float 单价
"should_pay" M float 应付金额
"operate_date" M datetime 作业日期
}],
"customer_id" M string 客户ID
"flow_id" M string 流水号
"status" M int 结款单状态(1:未支付;2:已支付;3:已删除)
"id" M string 结款单ID
"difference" M float 应付和实付的差额
示例
request
http://test.guanmai.cn:8888/finance/bill/detail?id=JK001
response
{
"data": {
"should_pay": 1683.5,
"freeze_fees": [{
"days": 9,
"name": "123",
"charge_count": 1.5,
"batch_id": "100011-1",
"contract_id": "HT00073",
"unit_price": 12.0,
"real_count": 1.5,
"start_date": "2016-09-11",
"unit_name": "吨",
"should_pay": 162.0,
"end_date": "2016-09-19"
}],
"start_date": "2016-09-11",
"customer_name": "客户20",
"carrying_fees": [{
"name": "123",
"batch_id": "100011-1",
"contract_id": "HT00073",
"unit_price": 25.0,
"real_count": 1.5,
"charge_count": 1.5,
"unit_name": "吨",
"should_pay": 37.5,
"operate_date": "2016-09-11"
}],
"real_pay": 0.0,
"storage_fees": [{
"name": "123",
"batch_id": "100011-1",
"contract_id": "HT00073",
"unit_price": 23.0,
"real_count": 1.5,
"charge_count": 1.5,
"unit_name": "吨",
"should_pay": 34.5,
"operate_date": "2016-09-11"
}],
"customer_cellphone": "12335435452",
"rent_fees": [],
"create_time": "2016-09-29",
"end_date": "2016-09-20",
"additional_task_fees": [{
"name": "高温作业费",
"charge_count": 12.0,
"real_count": 12.0,
"receipt_id": "ZY00084",
"unit_name": "吨",
"unit_price": 1.0,
"should_pay": 12.0,
"operate_date": "2016-09-11"
}],
"customer_id": "K00079",
"flow_id": "",
"status": 1,
"id": "JK00147",
"difference": 1683.5
},
"code": 0,
"msg": "ok"
}
可选的结款项
接口名
/finance/bill/choices
Method
GET
请求
customer_id M string 客户ID
响应
code M int 返回码,0表示成功,其他表示错误
msg M string 错误信息
data M string 返回json数据
[{
"additional_task_choices": [{ O list 作业单项
"should_pay" M float 应付金额
"id" M string 作业单ID
}],
"rent_choices": [{ O list 私库租金
"should_pay" M float 应付金额
"ware_category_1_name" M string 仓库名
"ware_category_2_name" M string 库区名
"ware_category_3_name" M string 库位名
"ware_category_4_name" M string 通道名
"ware_category_4_id" M string 通道ID
}],
"batch_choices": [{ O list 批次项
"name" M string 商品名
"batch_id" M string 批次号
"should_pay" M float 应付金额
}],
"date" M datetime 结款日
}]
示例
request
http://test.guanmai.cn:8888/finance/bill/choices?customer_id=K001
response
{
"data": [{
"additional_task_choices": [{
"should_pay": 4.25,
"id": "ZY00112"
}],
"rent_choices": [{
"should_pay": 264.0,
"ware_category_1_name": "mila-b",
"ware_category_2_name": "b1",
"ware_category_3_name": "b11",
"ware_category_4_name": "b112",
"ware_category_4_id": "WD000953"
}],
"batch_choices": [{
"name": "100003a",
"batch_id": "100003-1",
"should_pay": 10480.0
}],
"date": "2016-10-12"
}],
"code": 0,
"msg": "ok"
}
创建结款单
接口名
/finance/bill/create
Method
POST
请求
"customer_id" M string 客户ID
"end_date" M datetime 截止日期
"batch_ids" O list 需要结算的批次
"ware_category_4_ids" O list 需要结算的私库通道
"additional_task_ids" O list 需要结算的作业单
响应
code M int 返回码,0表示成功,其他表示错误
msg M string 错误信息
data M string 结款单ID
示例
request
http://test.guanmai.cn:8888/finance/bill/create
form-data
customer_id: K2
end_date: 2016-10-12
batch_ids: ["1-1"]
ware_category_4_ids: ["WD100"]
additional_task_ids: ["ZY001"]
response
{
"data": "JK0001",
"code": 0,
"msg": "ok"
}
支付结款单
接口名
/finance/bill/pay
Method
POST
请求
"id" M string 结款单ID
"real_pay" M int 实付金额(分)
"flow_id" M string 流水号
"pay_time" M datetime 标记付款时间
响应
code M int 返回码,0表示成功,其他表示错误
msg M string 错误信息
data M string 空
示例
request
http://test.guanmai.cn:8888/finance/bill/pay
form-data
id: JK002
real_pay: 12
flow_id: "12314134"
response
{
"data": "",
"code": 0,
"msg": "ok"
}
取消支付结款单
接口名
/finance/bill/reverse
Method
POST
请求
"id" M string 结款单ID
响应
code M int 返回码,0表示成功,其他表示错误
msg M string 错误信息
data M string 空
示例
request
http://test.guanmai.cn:8888/finance/bill/reverse
form-data
id: JK002
response
{
"data": "",
"code": 0,
"msg": "ok"
}
删除结款单
接口名
/finance/bill/delete
Method
POST
请求
"id" M string 结款单ID
响应
code M int 返回码,0表示成功,其他表示错误
msg M string 错误信息
data M string 空
示例
request
http://test.guanmai.cn:8888/finance/bill/delete
form-data
id: JK002
response
{
"data": "",
"code": 0,
"msg": "ok"
}
结款基础信息
接口名
/finance/bill/base_info
Method
GET
请求
无
响应
code M int 返回码,0表示成功,其他表示错误
msg M string 错误信息
data M string 基础信息
示例
request
127.0.0.1:8888/finance/bill/base_info
response
{
"data": {
"status": {
"UNPAYED": 1,
"DELETED": 3,
"PAYED": 2
}
},
"code": 0,
"msg": "ok"
}