diff --git a/lib/core/redux/actions/sell_actions.dart b/lib/core/redux/actions/sell_actions.dart index 18e5d1e..9dbe791 100644 --- a/lib/core/redux/actions/sell_actions.dart +++ b/lib/core/redux/actions/sell_actions.dart @@ -36,17 +36,17 @@ ThunkAction addSellItem({Good good, String excise}) { Transaction transaction; - if (uuid != null && good !=null) { + if (uuid != null && good != null) { List> set = await _dbService.queryRowsWithWhere( TransactionTableName, '$TransactionColumnAppCompanyId = ? and $TransactionColumnStatus = ? and ${TransactionColumnType} = ?', [appCompanyId, TransactionStatusPrepare, TransactionTypeSell], orderBy: '$TransactionColumnCreatedAt desc'); if (set.isNotEmpty) { - for(Map map in set) { + for (Map map in set) { Transaction _transaction = Transaction.fromMap(map); ProductDao _product = ProductDao.fromMap(jsonDecode(_transaction.data)); - if(_product.id == good.id) { + if (_product.id == good.id && _product.excise == excise) { transaction = _transaction; break; } @@ -54,7 +54,7 @@ ThunkAction addSellItem({Good good, String excise}) { } } - if(transaction !=null) { + if (transaction != null) { ProductDao item = ProductDao.fromMap(jsonDecode(transaction.data)); item..count = item.count + 1; transaction.data = jsonEncode(item.toMap());