This commit is contained in:
hero920103 committed 2026-11-14 07:54:01 +08:00
1 parent 4ab63e77ed
commit eb9b7beff5
16 files changed
+1031 -91

No files matched your search

+5
View File
@@ -578,6 +578,11 @@ func erpDocExecutableCore(a erpActor, id uint64) (map[string]interface{}, int, s
if e != nil {
return nil, 404, "单据未找到"
}
// 只有已生效单据可作为下推来源;作废、草稿、审批中、驳回都直接拒绝,
// 与保存时 erpValidateDocHead 的来源状态校验保持一致,避免绕过前端菜单
if doc.Status != models.ErpDocStatusApproved {
return nil, 400, "来源单据未生效,不能下推"
}
isReturn := doc.DocType == models.ErpDocPurchaseReturn || doc.DocType == models.ErpDocSalesReturn
items := erpDocItems(models.Orm, doc.ID)
out := make([]map[string]interface{}, 0, len(items))