Merge remote-tracking branch 'origin/master'

This commit is contained in:
M_Kececi
2026-03-10 17:51:31 +03:00
parent d590732f38
commit aba71341b9
24 changed files with 299 additions and 160 deletions

View File

@@ -26,7 +26,7 @@ func GetAccounts(ctx context.Context) ([]models.Account, error) {
;WITH VendorPiyasa AS
(
SELECT
Cari8 = LEFT(P.CurrAccCode, 8),
Cari8 = LEFT(REPLACE(P.CurrAccCode, ' ', ''), 8),
VendorAtt01 = MAX(P.VendorAtt01)
FROM
(
@@ -53,7 +53,7 @@ func GetAccounts(ctx context.Context) ([]models.Account, error) {
) pvt
GROUP BY CurrAccTypeCode, CurrAccCode
) P
GROUP BY LEFT(P.CurrAccCode, 8)
GROUP BY LEFT(REPLACE(P.CurrAccCode, ' ', ''), 8)
)
SELECT
x.AccountCode,
@@ -71,7 +71,7 @@ func GetAccounts(ctx context.Context) ([]models.Account, error) {
ON f2.CurrAccTypeCode = b.CurrAccTypeCode
AND f2.CurrAccCode = b.CurrAccCode
LEFT JOIN VendorPiyasa vp
ON vp.Cari8 = LEFT(b.CurrAccCode, 8)
ON vp.Cari8 = LEFT(REPLACE(b.CurrAccCode, ' ', ''), 8)
WHERE b.CurrAccTypeCode IN (1,3)
AND %s
) x

View File

@@ -104,10 +104,17 @@ func GetStatementAging(params models.StatementAgingParams) ([]map[string]interfa
tutar := asFloat64(row["EslesenTutar"])
usdTutar := toUSD(tutar, curr, usdTry, rateMap)
currTry := rateMap[curr]
usdToCurr := 0.0
if currTry > 0 && usdTry > 0 {
usdToCurr = usdTry / currTry
}
row["CariDetay"] = cariDetailMap[cari8]
row["UsdTutar"] = round2(usdTutar)
row["CurrencyTryRate"] = round6(rateMap[curr])
row["CurrencyTryRate"] = round6(currTry)
row["UsdTryRate"] = round6(usdTry)
row["CurrencyUsdRate"] = round6(usdToCurr)
}
return result, nil