protected virtual void LocationAPPaymentInfo_VCashAccountID_FieldDefaulting(PXCache sender, PXFieldDefaultingEventArgs e) 
		{
			//LocationAPPaymentInfo row = (LocationAPPaymentInfo)e.Row;
			e.NewValue = null;
			e.Cancel = true;			
		}
		protected virtual void Location_CBranchID_FieldDefaulting(PXCache sender, PXFieldDefaultingEventArgs e)
		{
			e.NewValue = null;
			e.Cancel = true;
		}
		protected override void Location_VBranchID_FieldDefaulting(PXCache sender, PXFieldDefaultingEventArgs e)
		{
		}
示例#4
0
			public void FieldDefaulting(PXCache sender, PXFieldDefaultingEventArgs e)
			{
				CurrencyInfo info = e.Row as CurrencyInfo;
				if (info != null && !String.IsNullOrEmpty(info.ModuleCode))
				{
					CMSetup CMSetup = info.getCMSetup(sender);
					if (CMSetup != null && CMSetup.MCActivated == true)
					{
						string rateType;
						switch (info.ModuleCode)
						{
							case "CA":
								rateType = CMSetup.CARateTypeDflt;
								break;
							case "AP":
								rateType = CMSetup.APRateTypeDflt;
								break;
							case "AR":
								rateType = CMSetup.ARRateTypeDflt;
								break;
							case "GL":
								rateType = CMSetup.GLRateTypeDflt;
								break;
							default:
								rateType = null;
								break;
						}
						if (!string.IsNullOrEmpty(rateType))
						{
							e.NewValue = rateType;
						}
					}
				}
			}
示例#5
0
		protected virtual void Customer_AcctCD_FieldDefaulting(PXCache sender, PXFieldDefaultingEventArgs e)
		{
			e.Cancel = true;
		}
示例#6
0
		protected virtual void ARInvoice_OrigModule_FieldDefaulting(PXCache sender, PXFieldDefaultingEventArgs e)
		{
			e.NewValue = GL.BatchModule.SO;
			e.Cancel = true;
		}
示例#7
0
        public override void FieldDefaulting(PXCache sender, PXFieldDefaultingEventArgs e)
        {
            base.FieldDefaulting(sender, e);

			PXSelectBase<FinPeriod> select = new PXSelect<FinPeriod, 
				Where<FinPeriod.finYear, Equal<Required<FinPeriod.finYear>>,
				And<FinPeriod.startDate, NotEqual<FinPeriod.endDate>>>, OrderBy<Desc<FinPeriod.periodNbr>>>(sender.Graph);

            FinPeriod fp = select.SelectWindowed(0, 1, DateTime.Now.Year);
            if (fp != null)
            {
                e.NewValue = FinPeriodIDFormattingAttribute.FormatForDisplay(fp.FinPeriodID);
            }
        }
示例#8
0
		protected override void ARTran_SubID_FieldDefaulting(PXCache sender, PXFieldDefaultingEventArgs e)
		{
			if (e.Row != null && string.IsNullOrEmpty(((ARTran)e.Row).SOOrderType) == false)
			{
                ARTran tran = (ARTran)e.Row;

                if (tran != null && tran.AccountID != null)
                {
                    PXResult<InventoryItem, INPostClass, INSite> item = (PXResult<InventoryItem, INPostClass, INSite>)PXSelectJoin<InventoryItem, LeftJoin<INPostClass, On<INPostClass.postClassID, Equal<InventoryItem.postClassID>>, CrossJoin<INSite>>, Where<InventoryItem.inventoryID, Equal<Required<ARTran.inventoryID>>, And<INSite.siteID, Equal<Required<ARTran.siteID>>>>>.Select(this, tran.InventoryID, tran.SiteID);
                    ReasonCode reasoncode = PXSelectJoin<ReasonCode, InnerJoin<SOLine, On<SOLine.reasonCode, Equal<ReasonCode.reasonCodeID>>>, Where<SOLine.orderNbr, Equal<Required<ARTran.sOOrderNbr>>, And<SOLine.lineNbr, Equal<Required<ARTran.sOOrderLineNbr>>>>>.Select(this, tran.SOOrderNbr, tran.SOOrderLineNbr);
                    EPEmployee employee = (EPEmployee)PXSelectJoin<EPEmployee, InnerJoin<SOOrder, On<EPEmployee.userID, Equal<SOOrder.ownerID>>>,Where<SOOrder.orderNbr, Equal<Required<ARTran.sOOrderNbr>>>>.Select(this, tran.SOOrderNbr);
                    Location companyloc =
                        (Location)PXSelectJoin<Location, InnerJoin<BAccountR, On<Location.bAccountID, Equal<BAccountR.bAccountID>, And<Location.locationID, Equal<BAccountR.defLocationID>>>, InnerJoin<Branch, On<BAccountR.bAccountID, Equal<Branch.bAccountID>>>>, Where<Branch.branchID, Equal<Required<ARTran.branchID>>>>.Select(this, tran.BranchID);
                    Location customerloc = location.Current;
                    SalesPerson salesperson = (SalesPerson)PXSelect<SalesPerson, Where<SalesPerson.salesPersonID, Equal<Current<ARTran.salesPersonID>>>>.Select(this);

                    object item_SubID = GetValue<InventoryItem.salesSubID>((InventoryItem)item);
                    object site_SubID = GetValue<INSite.salesSubID>((INSite)item);
                    object postclass_SubID = GetValue<INPostClass.salesSubID>((INPostClass)item);
                    object customer_SubID = GetValue<Location.cSalesSubID>(customerloc);
                    object employee_SubID = GetValue<EPEmployee.salesSubID>(employee);
                    object company_SubID = GetValue<Location.cMPSalesSubID>(companyloc);
                    object salesperson_SubID = GetValue<SalesPerson.salesSubID>(salesperson);
                    object reasoncode_SubID = GetValue<ReasonCode.salesSubID>(reasoncode);

                    object value = null;

                    try
                    {
                        value = SOSalesSubAccountMaskAttribute.MakeSub<SOOrderType.salesSubMask>(this, soordertype.Current.SalesSubMask,
                                                                                                 new object[] 
                                                                                             { 
                                                                                                 item_SubID, 
                                                                                                 site_SubID, 
                                                                                                 postclass_SubID, 
                                                                                                 customer_SubID, 
                                                                                                 employee_SubID, 
                                                                                                 company_SubID, 
                                                                                                 salesperson_SubID, 
                                                                                                 reasoncode_SubID 
                                                                                             },
                                                                                                 new Type[] 
                                                                                             { 
                                                                                                 typeof(InventoryItem.salesSubID), 
                                                                                                 typeof(INSite.salesSubID), 
                                                                                                 typeof(INPostClass.salesSubID), 
                                                                                                 typeof(Location.cSalesSubID), 
                                                                                                 typeof(EPEmployee.salesSubID), 
                                                                                                 typeof(Location.cMPSalesSubID), 
                                                                                                 typeof(SalesPerson.salesSubID), 
                                                                                                 typeof(ReasonCode.subID) 
                                                                                             });

                        sender.RaiseFieldUpdating<ARTran.subID>(tran, ref value);
                    }
                    catch (PXMaskArgumentException ex)
                    {
                        sender.RaiseExceptionHandling<ARTran.subID>(e.Row, null, new PXSetPropertyException(ex.Message));
                        value = null;
                    }
                    catch (PXSetPropertyException ex)
                    {
                        sender.RaiseExceptionHandling<ARTran.subID>(e.Row, value, ex);
                        value = null;
                    }

                    e.NewValue = (int?)value;
                    e.Cancel = true;
                }
			}
			else
			{
				base.ARTran_SubID_FieldDefaulting(sender, e);
			}
		}
示例#9
0
		protected override void ARTran_AccountID_FieldDefaulting(PXCache sender, PXFieldDefaultingEventArgs e)
		{
			if (e.Row != null && string.IsNullOrEmpty(((ARTran)e.Row).SOOrderType) == false)
			{
                ARTran tran = (ARTran)e.Row;

                if (tran != null)
                {
                    PXResult<InventoryItem, INPostClass, INSite> item = (PXResult<InventoryItem, INPostClass, INSite>)PXSelectJoin<InventoryItem, LeftJoin<INPostClass, On<INPostClass.postClassID, Equal<InventoryItem.postClassID>>, CrossJoin<INSite>>, Where<InventoryItem.inventoryID, Equal<Required<ARTran.inventoryID>>, And<INSite.siteID, Equal<Required<ARTran.siteID>>>>>.Select(this, tran.InventoryID, tran.SiteID);
                    Location customerloc = location.Current;

                    if (item == null)
                    {
                        return;
                    }

                    ReasonCode reasoncode = PXSelectJoin<ReasonCode, InnerJoin<SOLine, On<SOLine.reasonCode, Equal<ReasonCode.reasonCodeID>>>, Where<SOLine.orderNbr, Equal<Required<ARTran.sOOrderNbr>>, And<SOLine.lineNbr, Equal<Required<ARTran.sOOrderLineNbr>>>>>.Select(this, tran.SOOrderNbr, tran.SOOrderLineNbr);

                    switch (soordertype.Current.SalesAcctDefault)
                    {
                        case SOSalesAcctSubDefault.MaskItem:
                            e.NewValue = GetValue<InventoryItem.salesAcctID>((InventoryItem)item);
                            e.Cancel = true;
                            break;
                        case SOSalesAcctSubDefault.MaskSite:
                            e.NewValue = GetValue<INSite.salesAcctID>((INSite)item);
                            e.Cancel = true;
                            break;
                        case SOSalesAcctSubDefault.MaskClass:
                            e.NewValue = GetValue<INPostClass.salesAcctID>((INPostClass)item);
                            e.Cancel = true;
                            break;
                        case SOSalesAcctSubDefault.MaskLocation:
                            e.NewValue = GetValue<Location.cSalesAcctID>(customerloc);
                            e.Cancel = true;
                            break;
                        case SOSalesAcctSubDefault.MaskReasonCode:
                            e.NewValue = GetValue<ReasonCode.salesAcctID>(reasoncode);
                            e.Cancel = true;
                            break;
                    }
                }
			}
			else
			{
				base.ARTran_AccountID_FieldDefaulting(sender, e);
			}
		}
示例#10
0
		protected virtual void ARTran_SalesPersonID_FieldDefaulting(PXCache sender, PXFieldDefaultingEventArgs e)
		{
			if (e.Row != null && string.IsNullOrEmpty(((ARTran)e.Row).SOOrderNbr) == false)
			{
				//salesperson is taken from invoice lines
				e.NewValue = null;
				e.Cancel = true;
			}
		}
示例#11
0
		protected override void ARTran_TaxCategoryID_FieldDefaulting(PXCache sender, PXFieldDefaultingEventArgs e)
		{
			if (e.Row != null && string.IsNullOrEmpty(((ARTran)e.Row).SOOrderNbr) == false)
			{
				//tax category is taken from invoice lines
				e.NewValue = null;
				e.Cancel = true;
			}
		}
示例#12
0
		protected virtual void ARTran_LineType_FieldDefaulting(PXCache sender, PXFieldDefaultingEventArgs e)
		{
			if (e.Row != null && ((ARTran)e.Row).SOOrderNbr == null && ((ARTran)e.Row).InventoryID != null)
			{
				InventoryItem item = (InventoryItem)PXSelectorAttribute.Select<ARTran.inventoryID>(sender, e.Row);

				if (item != null)
				{
					e.NewValue = item.NonStockShip == true ? SOLineType.NonInventory : SOLineType.MiscCharge;
					e.Cancel = true;
				}
			}
		}