提交 78c638b9 authored 作者: 张颂恩's avatar 张颂恩

调整经销商出入库查询

上级 b2ebeaa3
......@@ -7701,8 +7701,6 @@ def query_label(request):
return JsonResponse(dt_data)
# 2020/7/24 经销商出入库查询
# 2022/9/28 Jonathan 重写查询逻辑
@tj_login_required
......@@ -7742,7 +7740,9 @@ def agent_stk_query(request):
h,
P,
b.remark,
b.company_id
b.company_id,
coalesce((select name from company_salesdivision where id = c.division_id and is_delete=false),''),
coalesce((select name from company_subsaldivision where id = c.sub_division_id and is_delete=false),'')
FROM
(
SELECT
......@@ -7780,13 +7780,13 @@ def agent_stk_query(request):
vtype_id
) A
LEFT JOIN logistics.inventory_batch b ON A.batch_id = b.id
LEFT JOIN logistics.company_company c ON b.company_id = c.id
order by batch_id
"""
cur.execute(s)
data=[]
for r in cur.fetchall():
#南海球杆
if cid==194378:
data.append([
"<a href='inventory/agent/details/" + str(r[0]) + "/'>" + r[1] + "</a>", # 日期
......@@ -7800,21 +7800,13 @@ def agent_stk_query(request):
r[11], # 备注
])
else:
company_id = r[12]
cur.execute(f"""
select
coalesce((select name from company_salesdivision where id = c.division_id and is_delete=false),''),
coalesce((select name from company_subsaldivision where id = c.sub_division_id and is_delete=false),'')
from logistics.company_company c where id= {company_id}
""")
row=cur.fetchone()
data.append([
"<a href='inventory/agent/details/" + str(r[0]) + "/'>" + r[1] + "</a>", # 日期
r[2], # 单据类别
r[3], # 单据编号
r[4], # 产品名称
row[0],# 战区
row[1],#分区
r[13], # 战区
r[14], # 分区
r[5], # 操作方
r[6], # 客户名称
r[7], # 操作人
......
......@@ -125,9 +125,9 @@
<th style='width:10%'>{% trans "日期时间" %}</th>
<th style='width:10%'>{% trans "单据类别" %}</th>
<th style='width:6%'>{% trans "单据编号" %}</th>
<th style='width:10%'>{% trans "产品名称" %}</th>
<th>{% trans "所属战区" %}</th>
<th>{% trans "所属分区" %}</th>
<th style='width:20%'>{% trans "产品名称" %}</th>
<th>{% trans "战区" %}</th>
<th>{% trans "分区" %}</th>
<th>{% trans "操作商" %}</th>
<th>{% trans "客户名称" %}</th>
<th style='width:6%'>{% trans "操作人" %}</th>
......@@ -143,8 +143,8 @@
<th><input type="text" placeholder="{% trans "单据类别" %}"></th>
<th><input type="text" placeholder="{% trans "单据编号" %}"></th>
<th><input type="text" placeholder="{% trans "产品名称" %}"></th>
<th><input type="text" placeholder="{% trans "所属战区" %}"></th>
<th><input type="text" placeholder="{% trans "所属分区" %}"></th>
<th><input type="text" placeholder="{% trans "战区" %}"></th>
<th><input type="text" placeholder="{% trans "分区" %}"></th>
<th><input type="text" placeholder="{% trans "操作商" %}"></th>
<th><input type="text" placeholder="{% trans "客户名称" %}"></th>
<th><input type="text" placeholder="{% trans "操作人" %}"></th>
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论