Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
Y
ypt_mgw_local
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
苏星豪
ypt_mgw_local
Commits
47d08bb3
提交
47d08bb3
authored
9月 05, 2024
作者:
李思鑫
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
经销商库存表加仓库
上级
4d763f20
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
10 行增加
和
6 行删除
+10
-6
views.py
inventory/views.py
+8
-6
agents_stock.html
templates/inventory/stock/agents_stock.html
+2
-0
没有找到文件。
inventory/views.py
浏览文件 @
47d08bb3
...
@@ -6958,6 +6958,7 @@ def children_stock(request):
...
@@ -6958,6 +6958,7 @@ def children_stock(request):
# 2022-10-29 stkdetail分表
# 2022-10-29 stkdetail分表
aid
=
str
(
c
.
ancestor_id
)
aid
=
str
(
c
.
ancestor_id
)
tb_stk
=
"stkdetails.c"
+
aid
tb_stk
=
"stkdetails.c"
+
aid
print
(
'tb_stk'
,
tb_stk
)
s
=
"select (select name from company_company where id=b.company_id) company,"
+
\
s
=
"select (select name from company_company where id=b.company_id) company,"
+
\
"(select name from product_product where id=b.product_id) product,"
+
\
"(select name from product_product where id=b.product_id) product,"
+
\
...
@@ -6982,9 +6983,10 @@ def children_stock(request):
...
@@ -6982,9 +6983,10 @@ def children_stock(request):
s
=
"select (select name from company_company where id=b.company_id) company,"
+
\
s
=
"select (select name from company_company where id=b.company_id) company,"
+
\
"(select name from product_product where id=b.product_id) product,"
+
\
"(select name from product_product where id=b.product_id) product,"
+
\
"b.x,b.h,b.p,b.company_id,b.product_id,"
+
\
"b.x,b.h,b.p,b.company_id,b.product_id,"
+
\
"(select name from company_level where id=(select level_id from company_company where id=b.company_id)) "
+
\
"(select name from company_level where id=(select level_id from company_company where id=b.company_id)),"
+
\
" from (select a.product_id,a.company_id,sum(a.x) x,sum(a.h) h,sum(a.p) p from "
+
\
"(select name from inventory_storehouse where id=b.store_id) store"
+
\
"(select product_id,company_id,"
+
\
" from (select a.product_id,a.company_id,a.store_id, sum(a.x) x,sum(a.h) h,sum(a.p) p from "
+
\
"(select product_id,company_id,store_id,"
+
\
"case when label_pkg in (3,4) then "
+
\
"case when label_pkg in (3,4) then "
+
\
"(select direction FROM inventory_voucher where id=vtype_id) "
+
\
"(select direction FROM inventory_voucher where id=vtype_id) "
+
\
"else 0 end x,"
+
\
"else 0 end x,"
+
\
...
@@ -6996,7 +6998,7 @@ def children_stock(request):
...
@@ -6996,7 +6998,7 @@ def children_stock(request):
"else 0 end p "
+
\
"else 0 end p "
+
\
"from "
+
tb_stk
+
" "
+
sWhere
+
\
"from "
+
tb_stk
+
" "
+
sWhere
+
\
") a "
+
\
") a "
+
\
"group by a.product_id,a.company_id) b "
+
\
"group by a.product_id,a.company_id
,a.store_id
) b "
+
\
"order by company,product"
"order by company,product"
...
@@ -7014,10 +7016,10 @@ def children_stock(request):
...
@@ -7014,10 +7016,10 @@ def children_stock(request):
if
r
[
4
]:
if
r
[
4
]:
a
.
append
(
str
(
r
[
4
])
+
package_units
[
0
])
a
.
append
(
str
(
r
[
4
])
+
package_units
[
0
])
if
a
:
if
a
:
qty
=
","
.
join
(
a
)
qty
=
","
.
join
(
a
)
data
[
'stock'
]
.
append
([
data
[
'stock'
]
.
append
([
"<a href='/inventory/stock/agent/"
+
str
(
r
[
5
])
+
"/'>"
+
r
[
0
]
+
"</a>"
,
#agent
"<a href='/inventory/stock/agent/"
+
str
(
r
[
5
])
+
"/'>"
+
r
[
0
]
+
"</a>"
,
#agent
r
[
8
]
if
r
[
8
]
else
'/'
,
r
[
7
],
#level
r
[
7
],
#level
r
[
1
],
#product
r
[
1
],
#product
qty
#qty
qty
#qty
...
...
templates/inventory/stock/agents_stock.html
浏览文件 @
47d08bb3
...
@@ -51,6 +51,7 @@
...
@@ -51,6 +51,7 @@
<thead>
<thead>
<tr>
<tr>
<th
style=
'width:20%'
>
{% trans "经销商名称" %}
</th>
<th
style=
'width:20%'
>
{% trans "经销商名称" %}
</th>
<th
style=
'width:8%'
>
{% trans "仓库名称" %}
</th>
<th
style=
'width:8%'
>
{% trans "层级" %}
</th>
<th
style=
'width:8%'
>
{% trans "层级" %}
</th>
<th
style=
'width:20%'
>
{% trans "产品名称" %}
</th>
<th
style=
'width:20%'
>
{% trans "产品名称" %}
</th>
<th
style=
'width:10%'
>
{% trans "库存数量" %}
</th>
<th
style=
'width:10%'
>
{% trans "库存数量" %}
</th>
...
@@ -59,6 +60,7 @@
...
@@ -59,6 +60,7 @@
<tbody></tbody>
<tbody></tbody>
<tfoot>
<tfoot>
<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
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论