Project

General

Profile

Revision f4a16f5b src/libs/plugins/imexporters/ofx/parser/g_stmtrs.c

View differences:

src/libs/plugins/imexporters/ofx/parser/g_stmtrs.c
259 259
    }
260 260
  }
261 261
  else if (strcasecmp(s, "LEDGERBAL")==0) {
262
    const GWEN_TIME *ti;
262
    const GWEN_DATE *dt;
263 263
    const AB_VALUE *v;
264 264

  
265
    ti=AIO_OfxGroup_BAL_GetDate(sg);
265
    dt=AIO_OfxGroup_BAL_GetDate(sg);
266 266
    v=AIO_OfxGroup_BAL_GetValue(sg);
267 267
    if (v) {
268
      AB_ACCOUNT_STATUS *ast;
269 268
      AB_BALANCE *bal;
270 269

  
271
      ast=AB_AccountStatus_new();
272
      AB_AccountStatus_SetTime(ast, ti);
273

  
274 270
      bal=AB_Balance_new();
275
      AB_Balance_SetTime(bal, ti);
271
      AB_Balance_SetType(bal, AB_Balance_TypeBooked);
272
      AB_Balance_SetDate(bal, dt);
276 273
      AB_Balance_SetValue(bal, v);
277 274
      if (xg->currency && AB_Value_GetCurrency(v)==NULL) {
278 275
	AB_VALUE *v2;
......
282 279
	AB_Balance_SetValue(bal, v2);
283 280
	AB_Value_free(v2);
284 281
      }
285
      AB_AccountStatus_SetBookedBalance(ast, bal);
286
      AB_Balance_free(bal);
287

  
288
      DBG_INFO(AQBANKING_LOGDOMAIN, "Adding account status");
289
      AB_ImExporterAccountInfo_AddAccountStatus(xg->accountInfo, ast);
282
      DBG_INFO(AQBANKING_LOGDOMAIN, "Adding balance");
283
      AB_ImExporterAccountInfo_AddBalance(xg->accountInfo, bal);
290 284
    }
291 285
  }
292 286
  else if (strcasecmp(s, "AVAILBAL")==0) {
293
    const GWEN_TIME *ti;
287
    const GWEN_DATE *dt;
294 288
    const AB_VALUE *v;
295 289

  
296
    ti=AIO_OfxGroup_BAL_GetDate(sg);
290
    dt=AIO_OfxGroup_BAL_GetDate(sg);
297 291
    v=AIO_OfxGroup_BAL_GetValue(sg);
298 292
    if (v) {
299
      AB_ACCOUNT_STATUS *ast;
300 293
      AB_BALANCE *bal;
301 294

  
302
      ast=AB_AccountStatus_new();
303
      AB_AccountStatus_SetTime(ast, ti);
304

  
305 295
      bal=AB_Balance_new();
306
      AB_Balance_SetTime(bal, ti);
296
      AB_Balance_SetType(bal, AB_Balance_TypeNoted);
297
      AB_Balance_SetDate(bal, dt);
307 298
      AB_Balance_SetValue(bal, v);
308 299
      if (xg->currency && AB_Value_GetCurrency(v)==NULL) {
309
	AB_VALUE *v2;
300
        AB_VALUE *v2;
310 301

  
311
	v2=AB_Value_dup(v);
312
	AB_Value_SetCurrency(v2, xg->currency);
313
	AB_Balance_SetValue(bal, v2);
314
	AB_Value_free(v2);
302
        v2=AB_Value_dup(v);
303
        AB_Value_SetCurrency(v2, xg->currency);
304
        AB_Balance_SetValue(bal, v2);
305
        AB_Value_free(v2);
315 306
      }
316
      AB_AccountStatus_SetNotedBalance(ast, bal);
317
      AB_Balance_free(bal);
318 307

  
319
      DBG_INFO(AQBANKING_LOGDOMAIN, "Adding account status");
320
      AB_ImExporterAccountInfo_AddAccountStatus(xg->accountInfo, ast);
308
      DBG_INFO(AQBANKING_LOGDOMAIN, "Adding balance");
309
      AB_ImExporterAccountInfo_AddBalance(xg->accountInfo, bal);
321 310
    }
322 311
  }
323 312

  

Also available in: Unified diff