//$debug .= 'sales_tax = ' . $prices['sales_tax'] . ' and purch tax = ' . $prices['purch_tax'] . ' and price = ' . $sales_price . chr(10);
// Load default tax to use
if ($cID) {
}
// load sku stock status and open orders
switch ($jID) {
    case '9':
    case '10':
    case '12':
    case '19':
        // check for stock available for SO, Customer Quote and Sales
        if ($qty > $inventory_array['branch_qty_in_stock'] && strpos(COG_ITEM_TYPES, $inventory_array['inventory_type']) !== false) {
            $stock_note[] = ORD_INV_STOCK_LOW;
            $stock_note[] = ORD_INV_STOCK_BAL . $inventory_array['branch_qty_in_stock'];
            // fetch open orders
            $sku_history = gather_history($inventory_array['sku']);
            if (is_array($sku_history['open_po'])) {
                $stock_note[] = ORD_INV_OPEN_POS;
                foreach ($sku_history['open_po'] as $value) {
                    $store = $value['store_id'] ? gen_get_contact_name($value['store_id']) : COMPANY_NAME;
                    // get name from id
                    $stock_note[] = sprintf(ORD_INV_STOCK_STATUS, $store, $value['purchase_invoice_id'], $value['qty'], gen_locale_date($value['date_1']));
                }
            }
        }
        break;
    default:
}
if ($jID == 4) {
    $inventory_array['item_cost'] = $inventory_array['item_cost'] * $inventory_array['purch_package_quantity'];
    // build the sales price
switch ($jID) {
    case '3':
    case '4':
    case '6':
        //  case '21':
        break;
    case '9':
    case '10':
    case '12':
        //  case  '19':
        // check for stock available for SO, Customer Quote and Sales
        if ($qty > $inventory->fields['branch_qty_in_stock'] && strpos(COG_ITEM_TYPES, $inventory->fields['inventory_type']) !== false) {
            $stock_note = array(ORD_INV_STOCK_LOW);
            $stock_note[] = ORD_INV_STOCK_BAL . $inventory->fields['branch_qty_in_stock'];
            // fetch open orders
            $sku_history = gather_history($inventory->fields['sku']);
            if (is_array($sku_history['open_po'])) {
                $stock_note[] = ORD_INV_OPEN_POS;
                foreach ($sku_history['open_po'] as $value) {
                    $store = $value['store_id'] ? gen_get_account_name($value['store_id']) : COMPANY_NAME;
                    // get name from id
                    $stock_note[] = sprintf(ORD_INV_STOCK_STATUS, $store, $value['purchase_invoice_id'], $value['qty'], gen_spiffycal_db_date_short($value['date_1']));
                }
            }
        }
        break;
    case '7':
    case '13':
    default:
}
//put it all together