parent
b269c780e7
commit
af22647320
|
|
@ -5,9 +5,10 @@ class TransactionData {
|
|||
TransactionData();
|
||||
|
||||
TransactionData.fromMap(dynamic map) {
|
||||
contragentName = map['contragentName'] as String;
|
||||
card = map['card'] as double;
|
||||
nal = map['nal'] as double;
|
||||
contragentName = cast<String>(map['contragentName']) ?? '';
|
||||
card = cast<double>(map['card']) ?? 0;
|
||||
nal = cast<double>(map['nal']) ?? 0;
|
||||
total = cast<double>(map['total']) ?? 0;
|
||||
sellResponse = map['sellResponse'] != null
|
||||
? SellResponse.fromMap(map['sellResponse'])
|
||||
: null;
|
||||
|
|
@ -24,6 +25,7 @@ class TransactionData {
|
|||
'contragentName': contragentName,
|
||||
'card': card,
|
||||
'nal': nal,
|
||||
'total' : total,
|
||||
'sellResponse': sellResponse
|
||||
};
|
||||
return map;
|
||||
|
|
|
|||
|
|
@ -48,10 +48,10 @@ Future<void> loadJournalData(Store<AppState> store) async {
|
|||
final List<Map<String, dynamic>> set = await _dbService.queryRowsWithWhere(
|
||||
transactionTableName,
|
||||
'$transactionColumnAppCompanyId = ?'
|
||||
' and $transactionColumnStatus = ?'
|
||||
' and $transactionColumnStatus = ?'
|
||||
' and $transactionColumnType = ?',
|
||||
[appCompanyId, transactionStatusFinish, transactionTypeSell],
|
||||
orderBy: '$transactionColumnCreatedAt desc');
|
||||
orderBy: '$transactionColumnCreatedAt asc');
|
||||
log.i(set.length);
|
||||
final List<TransactionDao> list = [];
|
||||
|
||||
|
|
|
|||
|
|
@ -81,6 +81,7 @@ class DataService extends BaseService {
|
|||
data.nal = nal;
|
||||
data.total = total;
|
||||
transaction.data = jsonEncode(data.toMap());
|
||||
log.i(jsonEncode(data.toMap()));
|
||||
await _db.update(transactionTableName, transaction.toMap());
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue