ol_supply_w_id = supplierWarehouseIDs[ol_number - 1];
ol_i_id = itemIDs[ol_number - 1];
ol_quantity = orderQuantities[ol_number - 1];
// clause 2.4.2.2 (dot 8.1)
Item i = new Item();
i.setI_id(ol_i_id);
found = i.load(basicCache);
if (!found) throw new ElementNotFoundException("I_ID=" + ol_i_id + " not found!");
itemPrices[ol_number - 1] = i.getI_price();
itemNames[ol_number - 1] = i.getI_name();
// clause 2.4.2.2 (dot 8.2)
Stock s = new Stock();
s.setS_i_id(ol_i_id);
s.setS_w_id(ol_supply_w_id);
found = s.load(basicCache);
if (!found) throw new ElementNotFoundException("I_ID=" + ol_i_id + " not found!");
s_quantity = s.getS_quantity();
stockQuantities[ol_number - 1] = s_quantity;
// clause 2.4.2.2 (dot 8.2)
if (s_quantity - ol_quantity >= 10) {
s_quantity -= ol_quantity;
} else {
s_quantity += -ol_quantity + 91;
}
if (ol_supply_w_id == w_id) {
s_remote_cnt_increment = 0;
} else {
s_remote_cnt_increment = 1;
}
// clause 2.4.2.2 (dot 8.2)
s.setS_quantity(s_quantity);
s.setS_ytd(s.getS_ytd() + ol_quantity);
s.setS_remote_cnt(s.getS_remote_cnt() + s_remote_cnt_increment);
s.setS_order_cnt(s.getS_order_cnt() + 1);
s.store(basicCache);
// clause 2.4.2.2 (dot 8.3)
ol_amount = ol_quantity * i.getI_price();
orderLineAmounts[ol_number - 1] = ol_amount;
total_amount += ol_amount;
// clause 2.4.2.2 (dot 8.4)
i_data = i.getI_data();
s_data = s.getS_data();
if (i_data.contains(TpccTools.ORIGINAL) && s_data.contains(TpccTools.ORIGINAL)) {
brandGeneric[ol_number - 1] = 'B';
} else {
brandGeneric[ol_number - 1] = 'G';