伯俊BOS2.0店铺收入对账功能设计
一、客户需求
通过导入银行POS机流水,将流水与ERP系统的零售付款数据进行对比,统计差异!
二、功能设计
1、新增“POS机号对应表单”,用于维护POS机与erp店仓对应
2、新增“POS机流水导入窗口”,用于记录银行POS流水
3、新增“对账功能”试图,展现结果
4、写试图语句
1 create or replace view store_statements as
2 select rownum id,
3 hs.ad_client_id,
4 hs.ad_org_id,
5 hs.billdate,
6 hs.c_store_id,
7 sum(nvl(tot_amt2,0)) as tot_amt2,
8 sum(nvl(tot_amt9,0)) as tot_amt9,
9 sum(nvl(tot_amt16,0)) as tot_amt16,
10 sum(nvl(tot_amt4,0)) as tot_amt4,
11 sum(nvl(tot_amt11,0)) as tot_amt11,
12 sum(nvl(tot_amt18,0)) as tot_amt18,
13 sum(nvl(tot_amt3,0)) as tot_amt3,
14 sum(nvl(tot_amt17,0)) as tot_amt17,
15 sum(nvl(tot_amt10,0)) as tot_amt10,
16 sum(nvl(tot_amt15,0)) as tot_amt15,
17 sum(nvl(tot_amt13,0)) as tot_amt13,
18 sum(nvl(tot_amt6,0)) as tot_amt6,
19 sum(nvl(tot_amt8,0)) as tot_amt8,
20 sum(nvl(tot_amt19,0)) as tot_amt19,
21 sum(nvl(tot_amt24,0)) as tot_amt24,
22 sum(nvl(tot_amt25,0)) as tot_amt25,
23 sum(nvl(tot_amt23,0)) as tot_amt23,
24 sum(nvl(tot_amt21,0)) as tot_amt21,
25 sum(nvl(tot_amt27,0)) as tot_amt27,
26 sum(nvl(tot_amt17,0)) as tot_amt28,
27 sum(nvl(tot_amt22,0)) as tot_amt22
28 from (
29 --零售付款明细
30 select a.ad_client_id,
31 a.ad_org_id,
32 c.billdate,
33 c.c_store_id,
34 sum(decode(a.c_payway_id, 2, nvl(a.payamount, 0))) as tot_amt2,
35 sum(decode(a.c_payway_id, 5, nvl(a.payamount, 0))) as tot_amt9,
36 sum(decode(a.c_payway_id, 4, nvl(a.payamount, 0))) as tot_amt16,
37 sum(decode(a.c_payway_id, 3, nvl(a.payamount, 0))) as tot_amt19,
38 sum(decode(a.c_payway_id, 8, nvl(a.payamount, 0))) as tot_amt24,
39 sum(decode(a.c_payway_id, 7, nvl(a.payamount, 0))) as tot_amt25
40 from m_retailpayitem a, m_retail c
41 where a.m_retail_id = c.id
42 --and c.billdate > '20200331'
43 --and c.c_store_id = 917
44 group by a.ad_client_id, a.ad_org_id, c.billdate, c.c_store_id) hs
45
46 left join
47 --零售其它付款明细
48 (select a.ad_client_id,
49 a.ad_org_id,
50 c.billdate,
51 c.c_store_id,
52 sum(nvl(a.payamount, 0)) as tot_amt22
53 from m_retailpayitem a, m_retail c
54 where a.m_retail_id = c.id
55 and a.c_payway_id not in (2,3,4,5,7,8)
56 --and c.billdate > '20200331'
57 --and c.c_store_id = 917
58 group by a.ad_client_id, a.ad_org_id, c.billdate, c.c_store_id) qt on hs.c_store_id = qt.c_store_id and hs.billdate = qt.billdate
59 left join
60 --充值付款明细
61 (select b.ad_client_id,
62 b.ad_org_id,
63 b.billdate,
64 b.c_store_id,
65 sum(decode(a.c_payway_id, 2, nvl(a.payamount, 0))) as tot_amt4,
66 sum(decode(a.c_payway_id, 5, nvl(a.payamount, 0))) as tot_amt11,
67 sum(decode(a.c_payway_id, 4, nvl(a.payamount, 0))) as tot_amt18,
68 sum( nvl(b.tot_amt_actual, 0)) as tot_amt21
69 from b_vipmoney_payitem a, b_vipmoney b
70 where a.b_vipmoney_id = b.id
71 -- and b.billdate > '20200331'
72 and b.status = 2
73 --and b.c_store_id = 917
74 group by b.ad_client_id, b.ad_org_id, b.billdate, b.c_store_id
75 union all
76 select b.ad_client_id,
77 b.ad_org_id,
78 b.billdate,
79 b.c_store_id,
80 sum(decode(a.c_payway_id, 2, nvl(a.payamount, 0))) as tot_amt4,
81 sum(decode(a.c_payway_id, 5, nvl(a.payamount, 0))) as tot_amt11,
82 sum(decode(a.c_payway_id, 4, nvl(a.payamount, 0))) as tot_amt18,
83 sum( nvl(b.tot_amt_actual, 0)) as tot_amt21
84 from b_vip_money_payitem a, b_vip_money b
85 where a.b_vip_money_id = b.id
86 --and b.billdate > '20200331'
87 and b.status = 2
88 --and b.c_store_id = 917
89 group by b.ad_client_id, b.ad_org_id, b.billdate, b.c_store_id) gs on hs.c_store_id = gs.c_store_id and hs.billdate = gs.billdate
90 left join
91 --订金付款明细
92 (select b.ad_client_id,
93 b.ad_org_id,
94 b.billdate,
95 b.c_store_id,
96 sum(decode(a.c_payway_id, 2, nvl(a.payamount, 0))) as tot_amt3,
97 sum(decode(a.c_payway_id, 5, nvl(a.payamount, 0))) as tot_amt10,
98 sum(decode(a.c_payway_id, 4, nvl(a.payamount, 0))) as tot_amt17,
99 sum(decode(a.c_payway_id, 3, nvl(a.payamount, 0))) as tot_amt23
100 from m_receipts_payitem a, m_receipts b
101 where a.m_receipts_id = b.id
102 -- and b.billdate > '20200331'
103 --and b.c_store_id = 917
104 group by b.ad_client_id, b.ad_org_id, b.billdate, b.c_store_id) ts on hs.c_store_id = ts.c_store_id and hs.billdate = ts.billdate
105
106 left join
107 --订金付款明细
108 (select b.ad_client_id,
109 b.ad_org_id,
110 b.billdate,
111 b.c_store_id,
112 sum( nvl(b.tot_amt, 0)) as tot_amt27
113 from m_receipts_item b
114 where b.type in('退订','订金')
115 -- and b.billdate > '20200331'
116 --and b.c_store_id = 917
117 group by b.ad_client_id, b.ad_org_id, b.billdate, b.c_store_id) ds on hs.c_store_id = ds.c_store_id and hs.billdate = ds.billdate
118 left join
119 --银行流水明细
120 (select 37as ad_client_id,
121 27 as ad_org_id,
122 b.c_store_id,
123 to_number(to_char(to_date(a.trading_hours,
124 'yyyy-mm-dd,hh24:mi:ss'),
125 'yyyymmdd')) as billdate,
126 sum(decode(a.payment_channels,
127 '微信' , nvl(a.total_amount,0))) as TOT_AMT13,
128 sum(decode(a.payment_channels,
129 '微信' , nvl(a.poundage,0))) as TOT_AMT15,
130 sum(decode(a.payment_channels,
131 '刷卡支付' , nvl(a.total_amount,0))) as TOT_AMT6,
132 sum(decode(a.payment_channels,
133 '刷卡支付' , nvl(a.poundage,0))) as TOT_AMT8
134 from merchants_statementsitem a
135 left join shop_pos b
136 on a.terminal_no = b.pos_no
137 group by 37,
138 27,
139 to_char(to_date(a.trading_hours,
140 'yyyy-mm-dd,hh24:mi:ss'),
141 'yyyymmdd'),
142 b.c_store_id) ls on hs.c_store_id = ls.c_store_id and hs.billdate = ls.billdate
143 group by rownum, hs.ad_client_id, hs.ad_org_id, hs.billdate, hs.c_store_id
144 order by hs.c_store_id desc, hs.billdate
145 ;
伯俊BOS2.0店铺收入对账功能设计的更多相关文章
- 伯俊BOS2.0关于订金单的处理方案
订金单功能调整设计 一. 功能确认 BPOS关于订金的使用对应的是"预收单",原"预收单"设置有商品明细,根据客户对订金的需求,取消原有"商品 ...
- 保密数据!泽宝曝光各个主要店铺收入 核心SKU数量少得惊人
今年跨境电商圈的一大并购,上市公司星徽精密并购知名跨境电商大卖家泽宝股份正在进程中.星徽精密在向证监会行政许可项目审查回复中,披露了泽宝股份众多保密数据,揭开了泽宝股份众多经营关键点,值得跨境电商卖家 ...
- 阿里云在云栖大会发布SaaS加速器3.0版最新成果,让天下没有难做的SaaS
2019年杭州·云栖大会顺利落幕,超过6万人次观展,200余位顶尖科学家分享了前沿技术.作为“阿里云不做SaaS”,坚持“被集成”战略的落地体现,阿里云SaaS加速器在云栖大会现场发布了SaaS加速器 ...
- jquery-防多店铺购物车结算全选,单选,及删除,价格计算
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title> ...
- $2015 武汉森果公司web后端开发实习日记----书写是为了更好的思考
找暑期实习,3月份分别投了百度和腾讯的实习简历,都止步于笔试,总结的主要原因有两点:基础知识不扎实,缺乏项目经验.后来到拉勾网等网站上寻找实习,看了很多家,都还是处于观望状态.后来参加了武汉实习吧在大 ...
- Hibernate中用left join(左外连接)查询映射中没有关联关系的两个表记录问题
一.问题背景 分账表split_summary结构如下: create table SPLIT_SUMMARY ( uuid VARCHAR2(32) not null, star_tdate VAR ...
- 新人 记录VUE中分页实现
关于函数传值 this.getPurchaseHistoryData(index, num,timeType);第一位是显示的页数,第二是控制首页4上一页-1下一页是2末页是5 第三是是对昨天是1,今 ...
- mybatis xml <choose>标签使用
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE mapper PUBLIC "-/ ...
- 共享商业&技术红利,阿里云SaaS加速器让天下没有难做的SaaS
9月26日,阿里云在2019杭州云栖大会上发布了SaaS加速器3.0版“一云多端”多个应用平台,展示了阿里云给伙伴带来的多种商业和技术红利.阿里云SaaS加速器将帮助伙伴做好SaaS,卖好SaaS:帮 ...
随机推荐
- 因为一个Docker问题,我顺手整理从安装到常用命令操作手册
今天,自己写了一部分业务代码,是常规代码的另外一种方式,不能在公司的服务器上测试,就自己在PC端搭建了一套和公司集群一样的模板,因为公司的业务模块的测试有单独的服务器(这一块还是我很稀罕的),但是,第 ...
- PyQt(Python+Qt)学习随笔:视图中类QAbstractItemView的dragDropOverwriteMode属性
老猿Python博文目录 老猿Python博客地址 一.属性的作用 dragDropOverwriteMode属性用于控制视图的拖放行为,如果其值为True,则视图中选定的数据将在拖拽数据放下时被覆盖 ...
- Codeforces Round #682 Div2 简要题解
Contest link A.Specific Tastes of Andre Problem link 题意 构造一个长度为 \(n\) 的序列,使得每个非空子序列的和都被其长度整除. 思路 直接每 ...
- 你必须要知道的HTTP协议原理
1 基本概念 HTTP协议:基于TCP协议之上实现的无状态.全文本的标准通信协议. 客户端:例如pc浏览器,移动应用端,第三方服务器等能发起http访问的设备. 服务器:能够接受HTTP协议请求,并且 ...
- redis学习之——CentOS 6 下载安装redis
一.检查当前环境: 安装过程中没有这些,命令,在CentOS 6,最小安装导致..如果执行完命令,Noting to do...字样说明环境正常. yum -y install rpm gcc w ...
- 关于大视频video播放的问题以及解决方案(m3u8的播放)
在HTML5里,提供了<video>标签,可以直接播放视频,video的使用很简单: <video width="320" height="240&qu ...
- 2020-2021 “Orz Panda” Cup Programming Contest
2020-2021 "Orz Panda" Cup Programming Contest 比赛情况 我们一共过了道3题 本场贡献:et3_tsy :过了A,提供了H的关键修改 ...
- celery 原理和组件
Celery介绍 https://www.cnblogs.com/xiaonq/p/11166235.html#i1 1.1 celery应用举例 Celery 是一个 基于python开发的分布式异 ...
- Java 书单
Java 基础 <Head First Java> 有人说这本书不适合编程新手阅读?其实本书还是很适合稍微有一点点经验的新手来阅读的,当然也适合我们用来温故 Java 知识点. ps:刚入 ...
- Linux系统-scp简介&坑
文件请见这里: https://blog.csdn.net/xingxingzhilong/article/details/82909015