This commit is contained in:
Patrick Alvin Alcala 2025-03-11 10:41:04 +08:00
parent 55de28532f
commit ff619ac88a
13 changed files with 192 additions and 145 deletions

View file

@ -10,14 +10,15 @@ class Stocks {
try {
final data = await _supabase
.from('stocks')
.select('ref_medicines(medicine_name), expiration_date, quantity, price')
.select('ref_medicines(medicine_name, ref_generic_names(generic_name)), expiration_date, quantity, price')
.order('ref_medicines(medicine_name)', ascending: true);
for (var item in data) {
stockData.add({
'medicine_name': item['ref_medicines']['medicine_name'],
'quantity': item['quantity'],
'generic_name': item['ref_medicines']['ref_generic_names']['generic_name'],
'expiration_date': item['expiration_date'],
'quantity': item['quantity'],
'price': item['price'],
});
}