@Wahson
2019-11-25T07:55:58.000000Z
字数 3798
阅读 866
周报
Wanbo周报
- 利润核算数据导出excel、折线图完成
- 销售应收逾期明细表
- 操作记录工具化完成,已记录订单领域所有操作
- 其他调整,待上线
- 资源采购单,已支付不能取消
- 非资源采购单,支付记录继承调整
- 交易员、采购员默认为取公司领用人
- 审批前校验子单已绑定采购
用户访问量,本周成交8个线上订单,其中5个询盘,3个实盘,
时间 访问人数(除内部员工) 11-11 22 11-12 17 11-13 23 11-14 11 11-15 11
- 询盘采购绑定流程优化,资源单绑定前可拆单 曹佳林 梁华生
- F_Order_V1.5 测试上线 梁华生
- F_Product_Offer_V1.0 测试上线 梁华生
- 付款指令在线化
- 采购单列表增加【申请付款】 曹佳林
- 付款指令crud 曹佳林
- 微信端付款确认 梁华生
- 发票管理
- crud 曹佳林
- ui 梁华生
- 流水认领增加批量自动匹配,审核提交功能
- 库存管理
- 逾期提醒,资金占用提醒 待定
- 19年4季度、20年1季度开发计划
use payment_db;
create table invoice
(
id bigint auto_increment primary key,
is_deleted smallint(1) default 0 comment '是否已删除',
invoice_no varchar(12) not null comment '发票号码',
type smallint(2) not null comment '发票类型invoiceType, 1:专用发票(special)',
type_code varchar(12) not null comment '类别代码',
classify smallint(2) not null comment '发票种类,1:进项发票(input_invoice);2:销项发票(output_invoice)',
company_id bigint not null comment '公司id',
company_name varchar(100) not null comment '公司名称',
amount decimal(13, 2) not null comment '开票金额',
amount_with_tax decimal(13, 2) not null comment '含税金额',
attachment_id bigint not null comment '发票附件id',
invoice_by int(5) null comment '开票人,进项发票时为null',
invoice_at datetime null comment '开票时间,进项发票时为null',
created_at timestamp default current_timestamp() not null,
created_by int default 0 not null,
updated_at timestamp default current_timestamp() not null on update current_timestamp(),
updated_by int default 0 not null,
remark varchar(128) null
) comment '发票' charset = utf8mb4 engine = innoDb;
create table invoice_detail
(
id bigint auto_increment primary key,
is_deleted smallint(1) default 0 comment '是否已删除',
invoice_id bigint not null comment 'invoice.id',
related_item_id bigint not null comment '关联子单id',
weight decimal(8, 3) not null comment '开票数量',
tax_rate decimal(5, 4) not null comment '税率',
amount decimal(13, 2) not null comment '开票金额',
created_at timestamp default current_timestamp() not null,
created_by int default 0 not null,
updated_at timestamp default current_timestamp() not null on update current_timestamp(),
updated_by int default 0 not null,
remark varchar(128) null,
key ind_invoice(invoice_id),
key idx_related_item(related_item_id)z
) comment '发票详情' charset = utf8mb4 engine = innoDb;
-- 查询采购单已开票金额
select sum(id.amount), id.related_item_id from invoice_detail id left join invoice i on id.invoice_id = i.id
where i.classify = 1 and id.related_item_id in (1,2,3) and id.is_deleted = 0 group by id.related_item_id;
-- 已付款金额
select payed_amount,id from purchase_db.purchase_item where is_deleted = 0 and id in (1,2,3);
-- 已开票金额 <= 已付款金额
-- 查询销售单已开票金额
select sum(id.amount), id.related_item_id from invoice_detail id left join invoice i on id.invoice_id = i.id
where i.classify = 2 and id.related_item_id in (1,2,3) and id.is_deleted = 0 group by id.related_item_id;
-- 已收款金额
select payed_amount, id, purchase_item_id from order_db.order_item where id in (1,2,3);
-- 已开票金额 <= 已收款金额
-- 相互关联的 order_item_id 与 purchase_item_id, 对应的开票金额应 purchase_item_id的开票金额 <= order_item_id的开票金额
-- 单张发票总额 <= 112000.00
-- 可开票单据列表查询
-- 部分付款、已付款,部分签收、已签收, 合同已回签
select oi.* from order_db.order_item oi inner join order_db.order_contract oc using(order_id)
where oi.payment_status in(20, 30) and oi.status in (50, 51) and oc.status = 30 and oc.created_at > '2019-11-01';
alter table purchase_db.purchase_item
add column invoice_status smallint(2) not null default 10 comment '开票状态,10:未开票(invoicing);20:部分开票(partial_invoicing);30:已开票(invoiced)' after payment_status;
alter table purchase_db.purchase
add column invoice_status smallint(2) not null default 10 comment '开票状态,10:未开票(invoicing);20:部分开票(partial_invoicing);30:已开票(invoiced)' after payment_status;
alter table order_db.order_item
add column invoice_status smallint(2) not null default 10 comment '开票状态,10:未开票(invoicing);20:部分开票(partial_invoicing);30:已开票(invoiced)' after payment_status;
alter table order_db.`order`
add column invoice_status smallint(2) not null default 10 comment '开票状态,10:未开票(invoicing);20:部分开票(partial_invoicing);30:已开票(invoiced)' after payment_status;
1. 查询可开票单据
2. 新建发票接口
3. 发票作废
graph TD
A(待确认) -->|总监确认| B(已确认)
B --> C(已制单)
C --> D(支付中)
D --> F(已支付)
A -->|采购撤销| G(已撤销)
B -->|采购撤销| G(已撤销)
C -->|采购撤销| G(已撤销)
D -->|财务撤销| G(已撤销)