优化订单搜索和对账的批量取数与索引查询
This commit is contained in:
1 parent
3aebb62252
commit
cf0b0be83f
16 files changed
+671
-186
No files matched your search
@@ -1,6 +1,7 @@
|
||||
'use strict';
|
||||
// 月度业绩只重排原订单与售后利润,不生成结算、转账或新的利润分录。
|
||||
const DailyProfit = require('./daily-profit');
|
||||
const { orderBookRows } = require('../orders/order-book');
|
||||
const TeamMembers = require('../team/team-members'),
|
||||
ShopSettings = require('../team/shop-settings');
|
||||
function share(profit, percent) {
|
||||
@@ -30,12 +31,12 @@ function report(ledger, query = {}, actor = ledger.actor, env) {
|
||||
return ledger.scope(
|
||||
actor,
|
||||
() => {
|
||||
const book = ledger.orderBook({ from, date, status: 'all' });
|
||||
const financialRows = orderBookRows(ledger, from, date);
|
||||
const rows = TeamMembers.members(ledger)
|
||||
.filter(row => row.member !== 'owner')
|
||||
.map(({ member, label }) => {
|
||||
const summary = DailyProfit.project(ledger, {
|
||||
rows: book.rows,
|
||||
rows: financialRows,
|
||||
groups: { [member]: { name: label } },
|
||||
from,
|
||||
date,
|
||||
|
||||
Reference in new issue
Block a user