Ali Mercan

Controller aktarımlarında setPrice metodunun override problemi

  j-Platform/Genel Diğer

Controller aktarımlarında irsaliye ve fatura formlarındaki otomatik birim fiyat atama işlemi kapatılamadığı için setPrice metodunu eziyor. Benim set ettiğim değer olan 30 değilde öndeğer olan 50 geliyor.

Controller Kod aşağıdadır.


package com.LogoPlatformTailor.customization;

import com.lbs.controllers.ILbsControllerTask;
import com.lbs.controllers.menu.LbsMenuController;
import com.lbs.data.objects.BusinessObject;
import com.lbs.remoteclient.IClientContext;
import com.lbs.unity.lo.bo.LOBOInvoice;
import com.lbs.unity.mm.bo.MMEOSlipMaster;

import java.math.BigDecimal;

import com.lbs.control.interfaces.ILbsController;
import com.lbs.controllers.gen.am.AMXFSlipBrowserController;
import com.lbs.controllers.gen.am.AMXFSlipController;
import com.lbs.controllers.gen.am.AMXFSlipController.LinesGridRowData;
import com.lbs.controllers.gen.lo.LOXFInvoiceController;
import com.lbs.controllers.gen.lo.LOXFInvoiceController.TransactionsGridRowData;
import com.lbs.controllers.gen.lo.LOXFInvoicesBrowserController;
import com.lbs.controllers.gen.mm.MMXFItemBrowserController;
import com.lbs.controllers.gen.mm.MMXFItemController;

public class aliGuvenbasOrnek implements ILbsControllerTask {

	public void execute(final LbsMenuController menu, final IClientContext context)
	{
		try
		{
			ILbsController controller = menu.launchSalesInvoices();
			if (controller instanceof LOXFInvoicesBrowserController)
			{
				LOXFInvoicesBrowserController controller1 = (LOXFInvoicesBrowserController) controller;
				controller = controller1.createNew_08WholesaleInvoice();
				if (controller instanceof LOXFInvoiceController)
				{
					LOXFInvoiceController controller2 = (LOXFInvoiceController) controller;
					controller2.setOrgUnit("01");
					controller2.setWarehouse("01.01.02");
					controller2.setAR_APCode("1111");
					TransactionsGridRowData rowData1 = controller2.getTransactionsGridRowData(0);
					rowData1.setCode("9876");
					rowData1.setUnitPrice(30);
					rowData1.setQuantity(new BigDecimal(6.0));
					rowData1.setPaymentPlan("1234");
					controller2.clickSave();
				}
			}
		}
		catch (Exception e)
		{
			//TODO handle your exceptions
		}
	}
}






Ali Mercan

Onaylanmış Cevap
LOBOInvoice formData = (LOBOInvoice) controller.getFormData();
MMEOSlipMaster masterData = (MMEOSlipMaster) formData.getMasterData();
masterData.setParamAutoUpdatePriceControl(0);
Java


Yukarıdaki kod bloğunda bulunan satırları kendi controller kodunuza entegre etmeniz gerekmektedir. Amaç faturanın master data'sına erişerek default değeri 1 olan ParamAutoUpdatePriceControl parametresini 0 yapmaktır.

Kodun yeni hali aşağıda görülebilir.


package com.LogoPlatformTailor.customization;

import com.lbs.controllers.ILbsControllerTask;
import com.lbs.controllers.menu.LbsMenuController;
import com.lbs.data.objects.BusinessObject;
import com.lbs.remoteclient.IClientContext;
import com.lbs.unity.lo.bo.LOBOInvoice;
import com.lbs.unity.mm.bo.MMEOSlipMaster;

import java.math.BigDecimal;

import com.lbs.control.interfaces.ILbsController;
import com.lbs.controllers.gen.am.AMXFSlipBrowserController;
import com.lbs.controllers.gen.am.AMXFSlipController;
import com.lbs.controllers.gen.am.AMXFSlipController.LinesGridRowData;
import com.lbs.controllers.gen.lo.LOXFInvoiceController;
import com.lbs.controllers.gen.lo.LOXFInvoiceController.TransactionsGridRowData;
import com.lbs.controllers.gen.lo.LOXFInvoicesBrowserController;
import com.lbs.controllers.gen.mm.MMXFItemBrowserController;
import com.lbs.controllers.gen.mm.MMXFItemController;

public class aliGuvenbasOrnek implements ILbsControllerTask {

	public void execute(final LbsMenuController menu, final IClientContext context)
	{
		try
		{
			ILbsController controller = menu.launchSalesInvoices();
			if (controller instanceof LOXFInvoicesBrowserController)
			{
				LOXFInvoicesBrowserController controller1 = (LOXFInvoicesBrowserController) controller;
				controller = controller1.createNew_08WholesaleInvoice();
				if (controller instanceof LOXFInvoiceController)
				{
					LOBOInvoice formData = (LOBOInvoice) controller.getFormData();
					MMEOSlipMaster masterData = (MMEOSlipMaster) formData.getMasterData();
					masterData.setParamAutoUpdatePriceControl(0);
					LOXFInvoiceController controller2 = (LOXFInvoiceController) controller;
					controller2.setOrgUnit("01");
					controller2.setWarehouse("01.01.02");
					controller2.setAR_APCode("1111");
					TransactionsGridRowData rowData1 = controller2.getTransactionsGridRowData(0);
					rowData1.setCode("9876");
					rowData1.setUnitPrice(30);
					rowData1.setQuantity(new BigDecimal(6.0));
					rowData1.setPaymentPlan("1234");
					controller2.clickSave();
				}
			}
		}
		catch (Exception e)
		{
			//TODO handle your exceptions
		}
	}
}
Java






04/02/19 13:35

Cevap vermek için giriş yapmanız gerekmektedir.