You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ofbiz.apache.org by Iain Fogg <ia...@westnet.com.au> on 2006/10/26 18:27:54 UTC

POS and GoodIdentification

I finding that the GoodIdentification lookup code in POS is not working 
as intended, but I'm not sure what's wrong.

Scenario:

I have a product with product_id A in table product
I have three records in good_identification that map product_id A to 
id_values B, C, D
When I run POS and enter one of the good_ids (B, C, or D), the lookup 
code fails. The snippet from PosTransaction.java is

    public List lookupItem(String sku) throws GeneralException {
        // first check for the product
        GenericValue product = 
session.getDelegator().findByPrimaryKey("Product", 
UtilMisc.toMap("productId", sku));
        if (product != null) {
            return UtilMisc.toList(product);
        } else {
            // not found; so we move on to GoodIdentification
           return 
session.getDelegator().findByAnd("GoodIdentificationAndProduct",
                   UtilMisc.toMap("idValue", sku), 
UtilMisc.toList("productId"));
        }
    }

The "Product" lookup fails as expected, returning null. Then we take a 
crack at querying the view GoodIdentificationAndProduct, but that seems 
to return zippo as well.

Anyone know what might be happening?

This is pretty important for me - I cannot change the requirement to 
lookup on good_ids...

Tips appreciated.

Cheers, Iain


-- 
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.408 / Virus Database: 268.13.11/497 - Release Date: 25/10/2006