Project

General

Profile

Revision f4a16f5b src/libs/plugins/backends/aqhbci/ajobs/jobgettransactions.c

View differences:

src/libs/plugins/backends/aqhbci/ajobs/jobgettransactions.c
265 265
      dbT=GWEN_DB_FindFirstGroup(dbDay, "endSaldo");
266 266
      while (dbT) {
267 267
	GWEN_DB_NODE *dbX;
268
	GWEN_TIME *ti=0;
269
  
270
	dbX=GWEN_DB_GetGroup(dbT, GWEN_PATH_FLAGS_NAMEMUSTEXIST, "date");
271
	if (dbX)
272
	  ti=GWEN_Time_fromDb(dbX);
268
        const char *s;
269
	GWEN_DATE *dt=0;
270

  
271
        /* read date */
272
        s=GWEN_DB_GetCharValue(dbT, "date", 0, NULL);
273
        if (s && *s) {
274
          dt=GWEN_Date_fromString(s);
275
          if (dt==NULL) {
276
            DBG_ERROR(AQBANKING_LOGDOMAIN, "Bad date in saldo");
277
          }
278
        }
279

  
280
        /* read value */
273 281
	dbX=GWEN_DB_GetGroup(dbT, GWEN_PATH_FLAGS_NAMEMUSTEXIST, "value");
274 282
	if (dbX) {
275 283
	  AB_VALUE *v;
......
277 285
	  v=AB_Value_fromDb(dbX);
278 286
	  if (v) {
279 287
	    AB_BALANCE *bal;
280
	    AB_ACCOUNT_STATUS *as;
281 288
  
282 289
            bal=AB_Balance_new();
283
            AB_Balance_SetTime(bal, ti);
290
            AB_Balance_SetType(bal, AB_Balance_TypeNoted);
291
            AB_Balance_SetDate(bal, dt);
284 292
            AB_Balance_SetValue(bal, v);
285
	    AB_Value_free(v);
286
	    as=AB_AccountStatus_new();
287
	    if (ti)
288
	      AB_AccountStatus_SetTime(as, ti);
289
	    AB_AccountStatus_SetNotedBalance(as, bal);
290
	    AB_Balance_free(bal);
291
	    AB_ImExporterAccountInfo_AddAccountStatus(ai, as);
293
            AB_Value_free(v);
294
	    AB_ImExporterAccountInfo_AddBalance(ai, bal);
292 295
	  }
293 296
	}
294
	GWEN_Time_free(ti);
297
        GWEN_Date_free(dt);
295 298
  
296 299
	dbT=GWEN_DB_FindNextGroup(dbT, "endSaldo");
297 300
      } /* while */

Also available in: Unified diff