Карточка поручения: уведомление НРД GS036 «нет встречного поручения» (по референсу строки) — в статусе, в ответах НРД и в оповещении о просрочке

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014FsEKyJrYF69Cj9ZXzFLRi
This commit is contained in:
zuevav
2026-09-28 19:36:50 +03:00
parent 02e44c9173
commit e123eda691
4 changed files with 143 additions and 12 deletions
+4 -3
View File
@@ -249,7 +249,7 @@ func scanForm16DraftsOpt(store *OutgoingStore, withResponses bool) []*OutgoingDe
d.OrderXML = sub.OrderXML
d.ContrDIDs = sub.ContrDIDs
if withResponses {
d.Responses, d.Done = outgoingResponses(sub.ContrDIDs)
d.Responses, d.Done = outgoingResponses(sub.ContrDIDs, orderWatchRefs(d.GUID)...)
_, d.Rejected, _ = orderRespVerdict(d.Responses)
}
}
@@ -271,11 +271,12 @@ func scanForm16Deal(store *OutgoingStore, guid string) (*OutgoingDeal, bool) {
// outgoingResponses агрегирует ответы НРД (MS010/REORD/…) по всем поручениям сделки.
// done=true, когда MS010 получен хотя бы по одному поручению.
func outgoingResponses(contrDIDs []string) ([]orderResponse, bool) {
func outgoingResponses(contrDIDs []string, refs ...string) ([]orderResponse, bool) {
seen := map[string]bool{}
var out []orderResponse
var done bool
for _, cd := range contrDIDs {
keys := append(append([]string{}, contrDIDs...), refs...) // GS036 «нет встречного» — только по референсу
for _, cd := range keys {
for _, rp := range findOrderResponses(cd) {
if seen[rp.Pkg] {
continue