更新密码找回uniapp
This commit is contained in:
1 parent
7f9a66da0f
commit
3fdda89833
1304 files changed
+3503
-26132
No files matched your search
@@ -12,22 +12,17 @@ import (
|
||||
"github.com/beego/beego/v2/client/orm"
|
||||
)
|
||||
|
||||
// ERP 往来账/收付款核心(两端共用):/backend/erp/finance* 与 /api/erp/finance* 都调这里,
|
||||
// 未收未付、账龄、核销余额等口径只算一次,手机端不会看到与 Web 端不一致的应收应付。
|
||||
|
||||
// erpBillFilter 往来账查询条件
|
||||
type erpBillFilter struct {
|
||||
BillType string
|
||||
PartnerID uint64
|
||||
PartnerType string
|
||||
SourceDocID uint64
|
||||
SettleState string // open|part|done
|
||||
SettleState string
|
||||
Keyword string
|
||||
DateFrom string
|
||||
DateTo string
|
||||
}
|
||||
|
||||
// erpBillListCore 往来账列表 + 未结余额合计
|
||||
func erpBillListCore(a erpActor, f erpBillFilter, page, pageSize int) ([]map[string]interface{}, int64, map[string]float64, int, string) {
|
||||
qs := models.Orm.QueryTable(new(models.ErpPartnerBill)).Filter("tenant_id", a.Tid)
|
||||
if f.BillType != "" {
|
||||
@@ -73,7 +68,6 @@ func erpBillListCore(a erpActor, f erpBillFilter, page, pageSize int) ([]map[str
|
||||
if _, err := qs.OrderBy("-bill_date", "-id").Limit(pageSize, (page-1)*pageSize).All(&rows); err != nil {
|
||||
return nil, 0, nil, 500, "查询失败: " + err.Error()
|
||||
}
|
||||
// 摘要区合计:未收/未付总额与本页余额
|
||||
var openRecv, openPay float64
|
||||
var allRows []models.ErpPartnerBill
|
||||
_, _ = models.Orm.QueryTable(new(models.ErpPartnerBill)).
|
||||
@@ -108,7 +102,6 @@ func erpBillListCore(a erpActor, f erpBillFilter, page, pageSize int) ([]map[str
|
||||
}, 200, ""
|
||||
}
|
||||
|
||||
// erpBillDetailCore 往来账详情(含核销记录与原单据)
|
||||
func erpBillDetailCore(a erpActor, id uint64) (map[string]interface{}, int, string) {
|
||||
if id == 0 {
|
||||
return nil, 400, "无效的ID"
|
||||
@@ -144,7 +137,6 @@ func erpBillDetailCore(a erpActor, id uint64) (map[string]interface{}, int, stri
|
||||
}, 200, ""
|
||||
}
|
||||
|
||||
// erpPartnerAging 单个往来单位的账龄分布
|
||||
type erpPartnerAging struct {
|
||||
PartnerID uint64 `json:"partner_id"`
|
||||
PartnerName string `json:"partner_name"`
|
||||
@@ -153,7 +145,6 @@ type erpPartnerAging struct {
|
||||
Buckets map[string]float64 `json:"buckets"`
|
||||
}
|
||||
|
||||
// erpAgingCore 账龄分析(按未结余额分桶)
|
||||
func erpAgingCore(a erpActor) (map[string]interface{}, int, string) {
|
||||
buckets := []struct {
|
||||
Label string `json:"label"`
|
||||
@@ -171,8 +162,6 @@ func erpAgingCore(a erpActor) (map[string]interface{}, int, string) {
|
||||
now := time.Now()
|
||||
sum := map[string]map[string]float64{}
|
||||
for _, b := range bills {
|
||||
// 分组必须带上 bill_type:同一客商既挂应收又挂应付时,只按 partner 归并
|
||||
// 会把两种账期混进行里,导致 list 合计与 summary(按单据类型分)对不上。
|
||||
key := b.PartnerType + ":" + fmt.Sprintf("%d:%d", b.PartnerID, b.BillType)
|
||||
pa := agg[key]
|
||||
if pa == nil {
|
||||
@@ -213,7 +202,6 @@ func erpAgingCore(a erpActor) (map[string]interface{}, int, string) {
|
||||
return map[string]interface{}{"list": list, "summary": sum, "buckets": buckets}, 200, ""
|
||||
}
|
||||
|
||||
// erpFundFilter 收付款单查询条件
|
||||
type erpFundFilter struct {
|
||||
FundType string
|
||||
Status string
|
||||
@@ -223,7 +211,6 @@ type erpFundFilter struct {
|
||||
DateTo string
|
||||
}
|
||||
|
||||
// erpFundListCore 收付款单列表
|
||||
func erpFundListCore(a erpActor, f erpFundFilter, page, pageSize int) ([]models.ErpFundBill, int64, int, string) {
|
||||
qs := models.Orm.QueryTable(new(models.ErpFundBill)).
|
||||
Filter("tenant_id", a.Tid).Filter("delete_time__isnull", true)
|
||||
@@ -261,7 +248,6 @@ func erpFundListCore(a erpActor, f erpFundFilter, page, pageSize int) ([]models.
|
||||
return rows, total, 200, ""
|
||||
}
|
||||
|
||||
// erpFundDetailCore 收付款单详情(含核销明细与对应往来账)
|
||||
func erpFundDetailCore(a erpActor, id uint64) (map[string]interface{}, int, string) {
|
||||
if id == 0 {
|
||||
return nil, 400, "无效的ID"
|
||||
@@ -288,7 +274,6 @@ func erpFundDetailCore(a erpActor, id uint64) (map[string]interface{}, int, stri
|
||||
return map[string]interface{}{"fund": fund, "bills": bills}, 200, ""
|
||||
}
|
||||
|
||||
// erpFundSaveCore 新建/修改收付款草稿(草稿态才可改,确认后只能作废重开)
|
||||
func erpFundSaveCore(a erpActor, p erpFundPayload) (uint64, string, int, string) {
|
||||
tid := a.Tid
|
||||
if p.FundType < models.ErpFundReceive || p.FundType > models.ErpFundExpense {
|
||||
@@ -361,7 +346,6 @@ func erpFundSaveCore(a erpActor, p erpFundPayload) (uint64, string, int, string)
|
||||
return uint64(id), no, 200, ""
|
||||
}
|
||||
|
||||
// erpFundConfirmCore 确认收付款并核销;settles 为空时按到期日自动 FIFO
|
||||
func erpFundConfirmCore(a erpActor, id uint64, settles []erp.SettleItem) (int, string) {
|
||||
if id == 0 {
|
||||
return 400, "无效的ID"
|
||||
@@ -372,7 +356,6 @@ func erpFundConfirmCore(a erpActor, id uint64, settles []erp.SettleItem) (int, s
|
||||
return 200, ""
|
||||
}
|
||||
|
||||
// erpFundVoidCore 作废收付款单(已核销的往来账余额同步回滚)
|
||||
func erpFundVoidCore(a erpActor, id uint64) (int, string) {
|
||||
if id == 0 {
|
||||
return 400, "无效的ID"
|
||||
@@ -383,7 +366,6 @@ func erpFundVoidCore(a erpActor, id uint64) (int, string) {
|
||||
return 200, ""
|
||||
}
|
||||
|
||||
// erpFundDeleteCore 删除收付款单,仅草稿可删
|
||||
func erpFundDeleteCore(a erpActor, id uint64) (int, string) {
|
||||
if id == 0 {
|
||||
return 400, "无效的ID"
|
||||
@@ -405,7 +387,6 @@ func erpFundDeleteCore(a erpActor, id uint64) (int, string) {
|
||||
return 200, ""
|
||||
}
|
||||
|
||||
// erpFundOpenBillsCore 收款/付款时可核销的往来账(前端据此勾选)
|
||||
func erpFundOpenBillsCore(a erpActor, fundType int8, partnerID uint64) ([]map[string]interface{}, int, string) {
|
||||
billType := int8(models.ErpBillReceivable)
|
||||
if fundType == 2 {
|
||||
@@ -430,7 +411,6 @@ func erpFundOpenBillsCore(a erpActor, fundType int8, partnerID uint64) ([]map[st
|
||||
return out, 200, ""
|
||||
}
|
||||
|
||||
// erpCashDayRow 按日汇总的资金流水
|
||||
type erpCashDayRow struct {
|
||||
Date string `json:"date"`
|
||||
In float64 `json:"in"`
|
||||
@@ -438,7 +418,6 @@ type erpCashDayRow struct {
|
||||
Net float64 `json:"net"`
|
||||
}
|
||||
|
||||
// erpCashFlowCore 资金流水(只统计实际收付,不含单据生成的往来账)
|
||||
func erpCashFlowCore(a erpActor, from, to time.Time) (map[string]interface{}, int, string) {
|
||||
var rows []models.ErpFundBill
|
||||
_, _ = models.Orm.QueryTable(new(models.ErpFundBill)).
|
||||
@@ -478,7 +457,6 @@ func erpCashFlowCore(a erpActor, from, to time.Time) (map[string]interface{}, in
|
||||
}, 200, ""
|
||||
}
|
||||
|
||||
// erpPartnerSumRow 往来单位对账汇总行
|
||||
type erpPartnerSumRow struct {
|
||||
PartnerID uint64 `json:"partner_id"`
|
||||
PartnerType string `json:"partner_type"`
|
||||
@@ -490,7 +468,6 @@ type erpPartnerSumRow struct {
|
||||
LastBillDate string `json:"last_bill_date"`
|
||||
}
|
||||
|
||||
// erpPartnerSummaryCore 往来单位对账汇总(partnerType 为空=不限)
|
||||
func erpPartnerSummaryCore(a erpActor, partnerType string) (map[string]interface{}, int, string) {
|
||||
var bills []models.ErpPartnerBill
|
||||
_, _ = models.Orm.QueryTable(new(models.ErpPartnerBill)).
|
||||
|
||||
Reference in new issue
Block a user