cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Extending a Java function

Former Member
0 Likes
1,479

As far as i know i can extend a function by using @pluginAt if i used a POSITION = Before i can trigger a function just before the target function.

So what i want to do is to use this way so i can edit the bar code readed from the bar code reader before it goes to the database but, still i don't know which function or which class is responsible for fetching data from database.
***************
TEST CASE : Bar code readed : 1234567890

Item Real Bar Code : 1234567
Quantity : 890
i just need to change the barcode from 1234567890 to 1234567 before searching in the database.

******************

And if i am going the wrong way please tell me

View Entire Topic
0 Likes

Hi everyone,

We are trying to read an Item from the database using MaterialManager but it sends us an error when executed in the console.

Thanks

@PluginAt(method="updateSalesItemTypeMaterial",pluginClass=ISalesI
temManager.class,where=POSITION.AFTER)
public void updateSalesItem(Object proxy, Object[] args,
Object ret, StackTraceElement caller) throws
InconsistentReceiptStateException {
logger.info("@PluginAt public void");
SalesItemEntity salesItem = (SalesItemEntity)args[0];
MaterialEntity mat = salesItem.getMaterial();(This is the poblem)
(We need to get this information from articles)
MaterialManager matMgr = (MaterialManager)proxy;
SalesItemEntity sie = new SalesItemEntity();
sie.setDescription(mat.getDescription());
sie.setTaxRateTypeCode(mat.getTaxRateTypeCode());
sie.setQuantityTypeCode(mat.getDefaultQuantityTypeCode());
sie.setPriceListId(receipt.getPriceListId());

ERROR