void warehouses::sFillList() { QString whss = "SELECT warehous_id, warehous_code," " formatBoolYN(warehous_active), sitetype_name," " warehous_descrip, warehous_addr1 " "FROM warehous " "<? if exists(\"selectedOnly\") ?>" "JOIN usrsite ON (warehous_id=usrsite_warehous_id) " "<? endif ?>" " LEFT OUTER JOIN sitetype ON (sitetype_id=warehous_sitetype_id) " "WHERE ((TRUE) " "<? if not exists(\"showInactive\") ?>" " AND (warehous_active) " "<? endif ?>" "<? if exists(\"selectedOnly\") ?>" " AND (usrsite_username=current_user) " "<? endif ?>" ") ORDER BY warehous_code;" ; ParameterList whsp; setParams(whsp); MetaSQLQuery whsm(whss); XSqlQuery whsq = whsm.toQuery(whsp); _warehouse->populate(whsq); }
void WComboBox::setType(WComboBoxTypes pType) { _type = pType; int warehousid = ((_x_preferences) ? _x_preferences->value("PreferredWarehouse").toInt() : -1); QString whss("SELECT warehous_id, warehous_code, warehous_code " "FROM site() " "WHERE (true" "<? if exists(\"active\") ?> AND (warehous_active) <? endif ?>" "<? if exists(\"shipping\") ?>AND (warehous_shipping)<? endif ?>" "<? if exists(\"transit\") ?>" " AND (warehous_transit) " "<? elseif exists(\"nottransit\") ?>" " AND (NOT warehous_transit)" "<? endif ?>" ") " "ORDER BY warehous_code;" ); ParameterList whsp; switch (_type) { case AllActive: whsp.append("active"); break; case Sold: case NonTransit: whsp.append("nottransit"); whsp.append("active"); break; case Shipping: whsp.append("shipping"); whsp.append("active"); break; case Supply: clear(); return; // yes, the previous version just had "clear(); return;" break; case Transit: whsp.append("transit"); whsp.append("active"); break; case All: default: break; } MetaSQLQuery whsm(whss); XSqlQuery whsq = whsm.toQuery(whsp); populate(whsq, warehousid); }
void warehouses::sFillList() { QString whss = "SELECT warehous_id, warehous_code," " formatBoolYN(warehous_active)," " warehous_descrip, warehous_addr1 " "FROM warehous " "<? if not exists(\"showInactive\") ?>" "WHERE (warehous_active) " "<? endif ?>" "ORDER BY warehous_code;" ; ParameterList whsp; setParams(whsp); MetaSQLQuery whsm(whss); XSqlQuery whsq = whsm.toQuery(whsp); _warehouse->populate(whsq); }
void warehouses::sFillList() { QString whss = "SELECT warehous_id, warehous_code," " warehous_active, sitetype_name," " warehous_descrip, addr_line1 " "FROM site() LEFT OUTER JOIN addr ON (addr_id=warehous_addr_id) " " LEFT OUTER JOIN sitetype ON (sitetype_id=warehous_sitetype_id) " "WHERE ((TRUE) " "<? if not exists(\"showInactive\") ?>" " AND (warehous_active) " "<? endif ?>" ") ORDER BY warehous_code;" ; ParameterList whsp; setParams(whsp); MetaSQLQuery whsm(whss); XSqlQuery whsq = whsm.toQuery(whsp); _warehouse->populate(whsq); }