package com.gpc.client.pointofsale.invoice.line; // GPC Imports import com.gpc.client.common.ClientApplicationContext; import com.gpc.client.pointofsale.invoice.InvoiceBL; import com.gpc.common.Profile; import com.gpc.common.ResourceBundleReader; import com.gpc.common.TsoConstant; import com.gpc.common.constants.refvalues.RefInvoiceLineItemDescription; import com.gpc.common.exception.ApplicationException; import com.gpc.valueobjects.customer.CustomerVO; import com.gpc.valueobjects.invoice.InvoiceVO; import com.gpc.valueobjects.invoice.line.InvoiceLineItemVO; // Third-Party imports import org.apache.log4j.Logger; /** *

Title: CorePickupLineItemHandler

*

Description: We use this handler for buyouts with core price and negative qty

*

Copyright: Copyright © 2003

*

Company: Genuine Parts Company

* @author Copyright © 2003 Genuine Parts Company * @version 1.0 */ public class CorePickupLineItemHandler extends PickupLineItemHandler { private static final Logger logger = Logger.getLogger(CorePickupLineItemHandler.class); protected CorePickupLineItemHandler() {} protected CorePickupLineItemHandler(InvoiceLineEntryPanel invoiceLineEntryPanel, InvoiceLineItemVO invoiceLineItemVO, CustomerVO customerVO, InvoiceVO invoiceVO) { init(invoiceLineEntryPanel, invoiceLineItemVO, customerVO, invoiceVO); } public void init(InvoiceLineEntryPanel invoiceLineEntryPanel, InvoiceLineItemVO invoiceLineItemVO, CustomerVO customerVO, InvoiceVO invoiceVO) { super.init(invoiceLineEntryPanel, invoiceLineItemVO, customerVO, invoiceVO); } protected void handleDescription() { String storeLanguageCd = clientApplicationContext.getProfile(Profile.POINT_OF_SALE_CLIENT, clientApplicationContext.getLocation()).getStoreProfile().getRefLanguageCd(); String coreDescription = TsoConstant.CORE_DEPOSIT; try { coreDescription = clientApplicationContext.getRefTableDAO().getInvoiceLineDescription( new Integer(RefInvoiceLineItemDescription.CORE_DEPOSIT), storeLanguageCd); } catch (ApplicationException applicationException) { logger.error("Error occured while retreiving invoice line description" + applicationException.toString(), applicationException); } invoiceLineEntryPanel.fldDescription.setText(coreDescription); super.handleDescription(); } protected void enableComponents() { setPartNumberEnabled(false); setLineEnabled(false); setDescriptionEnabled(false); setQuantityEnabled(baseLineItemVO.isCompletedLine()); setListEnabled(false); setPDEnabled(!baseLineItemVO.isCompletedLine(), baseLineItemVO); setPriceEnabled(false); setDCEnabled(false); setTaxEnabled(false); setSecondaryTaxEnabled(false); setOKEnabled(false); invoiceLineEntryPanel.slfSpecialFunctions.setEnabled(false); Profile profile = clientApplicationContext.getProfile( Profile.POINT_OF_SALE_CLIENT, clientApplicationContext .getLocation()); boolean gpcOwned = profile.getStoreProfile().getGpcOwned() .booleanValue(); boolean allowCoreErasure = profile.getInvoicingProfile() .getAllowCoreErasure().booleanValue(); invoiceLineEntryPanel.btnDelete.setEnabled(baseLineItemVO .isCompletedLine() && !gpcOwned && allowCoreErasure); if(!ClientApplicationContext.getClientApplicationContext().isCatalogInUse()){ invoiceLineEntryPanel.btnCheckOtherStores.setVisible(false); invoiceLineEntryPanel.btnBarcode.setVisible(true); } invoiceLineEntryPanel.btnBarcode.setEnabled(false); invoiceLineEntryPanel.btnCheckOtherBalances.setEnabled(false); } }