31. August 2016 16:22
public boolean fetch()
{
boolean ret = true;
QueryRun localQuery = new QueryRun(this);
;
localQuery.setRecord(this.populateRecords());
while (localQuery.next())
{
InventTransTemp_1 = localQuery.get(TableNum(IN_InventTransTemp));
element.send(InventTransTemp_1);
}
return ret;
}
IN_InventTransTemp populateRecords()
{
InventTransTemp tmpTable;
InventTrans baseTable;
;
while select baseTable
where baseTable.StatusIssue == StatusIssue::Sold
&& baseTable.TransType == InventTransType::Sales
&& baseTable.DateFinancial>this.startDatum() && baseTable.DateFinancial<this.endDate()
{
tmpTable.ItemId = baseTable.ItemId;
tmpTable.StatusIssue = baseTable.StatusIssue;
tmpTable.Qty = baseTable.Qty;
tmpTable.TransType = baseTable.TransType;
tmpTable.Monat = this.getMonthString(baseTable.DateFinancial);
tmpTable.Jahr = this.getYearString(baseTable.DateFinancial);
tmpTable.doInsert();
}
return tmpTable;
}