QString StoreLookup::lookupById(Id store_id) { Store loc; if (store_id != INVALID_ID && _quasar->db()->lookup(store_id, loc)) return loc.name(); return ""; }
void RecurringMaster::setGltx(Id gltx_id) { Gltx gltx; _quasar->db()->lookup(gltx_id, gltx); Store store; _quasar->db()->lookup(gltx.storeId(), store); _type->setText(gltx.dataTypeName()); _number->setText(gltx.number()); _store->setText(store.name()); _date->setText(DateValcon().format(gltx.postDate())); Card card; _quasar->db()->lookup(gltx.cardId(), card); _card->setText(card.nameFL()); if (_curr.cardGroup() == INVALID_ID) { _cardLabel->setChecked(true); } else { _groupLabel->setChecked(true); } if (_lastPost->getDate().isNull()) { _lastPost->setDate(gltx.postDate()); slotRefresh(); } switch (gltx.dataType()) { case DataObject::INVOICE: _cardLabel->setText(tr("Customer:")); _groupLabel->setEnabled(true); _group->setEnabled(true); _groupLookup->type->setCurrentItem(Group::typeName(Group::CUSTOMER)); break; case DataObject::RECEIVE: _cardLabel->setText(tr("Vendor:")); _groupLabel->setEnabled(true); _group->setEnabled(true); _groupLookup->type->setCurrentItem(Group::typeName(Group::VENDOR)); break; default: _cardLabel->setText(tr("Card:")); _groupLabel->setEnabled(false); _group->setEnabled(false); } _curr.setGltxId(gltx_id); }