From a383f668b751d1e43fe0a0b2125bba0dc77246d4 Mon Sep 17 00:00:00 2001 From: Mazyar Date: Sat, 23 May 2026 22:39:43 +0330 Subject: [PATCH] tender est amount fix --- ted/model.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/ted/model.go b/ted/model.go index 27822f9..0885e4d 100644 --- a/ted/model.go +++ b/ted/model.go @@ -1971,15 +1971,19 @@ func (cn ContractNotice) GetTenderDeadline() string { return "" } -// GetBudget returns the estimated contract amount and currency +// GetBudget returns the estimated contract amount and currency. +// Lot-level BT-27 is preferred; procedure-level BT-27 is used when lots omit RequestedTenderTotal. func (cn ContractNotice) GetBudget() (amount string, currency string) { if cn.firstLot() != nil && cn.firstLot().ProcurementProject != nil && cn.firstLot().ProcurementProject.RequestedTenderTotal != nil { - contractAmount := cn.firstLot().ProcurementProject.RequestedTenderTotal.EstimatedOverallContractAmount return contractAmount.Text, contractAmount.CurrencyID } + if cn.ProcurementProject != nil && cn.ProcurementProject.RequestedTenderTotal != nil { + a := cn.ProcurementProject.RequestedTenderTotal.EstimatedOverallContractAmount + return a.Text, a.CurrencyID + } return "", "" }