예제 #1
0
        public virtual void SOShipmentFilter_RowSelected(PXCache sender, PXRowSelectedEventArgs e)
        {
            if (e.Row == null)
            {
                return;
            }

            SOShipmentFilter filter = e.Row as SOShipmentFilter;

            if (filter != null && !String.IsNullOrEmpty(filter.Action))
            {
                Dictionary <string, object> parameters = Filter.Cache.ToDictionary(filter);
                Orders.SetProcessTarget(null, null, null, filter.Action, parameters);
            }
            string actionID = (string)Orders.GetTargetFill(null, null, null, filter.Action, "@actionID");

            PXUIFieldAttribute.SetEnabled <SOShipmentFilter.invoiceDate>(sender, filter, actionID == "2" || actionID == "6");
            PXUIFieldAttribute.SetEnabled <SOShipmentFilter.packagingType>(sender, filter, actionID != "6");
            PXUIFieldAttribute.SetVisible <SOShipmentFilter.showPrinted>(sender, filter, actionID == "7");

            if (sosetup.Current.UseShipDateForInvoiceDate == true)
            {
                sender.RaiseExceptionHandling <SOShipmentFilter.invoiceDate>(filter, null, new PXSetPropertyException(Messages.UseInvoiceDateFromShipmentDateWarning, PXErrorLevel.Warning));
                PXUIFieldAttribute.SetEnabled <SOShipmentFilter.invoiceDate>(sender, filter, false);
            }
        }
        public virtual void SOInvoiceFilter_RowSelected(PXCache sender, PXRowSelectedEventArgs e)
        {
            SOInvoiceFilter filter = e.Row as SOInvoiceFilter;

            if (filter != null && !String.IsNullOrEmpty(filter.Action))
            {
                Dictionary <string, object> parameters = Filter.Cache.ToDictionary(filter);
                SOInvoiceList.SetProcessTarget(null, null, null, filter.Action, parameters);

                string actionID = (string)SOInvoiceList.GetTargetFill(null, null, null, Filter.Current.Action, "@ActionName");
                PXUIFieldAttribute.SetVisible <SOInvoiceFilter.showFailedCCCapture>(sender, e.Row, actionID == "CaptureCCPayment");

                bool showPrintSettings = PXAccess.FeatureInstalled <FeaturesSet.deviceHub>() &&
                                         (filter != null && !String.IsNullOrEmpty(filter.Action) && SOReports.GetReportIDByName(SOInvoiceList, filter.Action) == SOReports.PrintInvoiceReport);

                PXUIFieldAttribute.SetVisible <SOInvoiceFilter.printWithDeviceHub>(sender, filter, showPrintSettings);
                PXUIFieldAttribute.SetVisible <SOInvoiceFilter.definePrinterManually>(sender, filter, showPrintSettings);
                PXUIFieldAttribute.SetVisible <SOInvoiceFilter.printerName>(sender, filter, showPrintSettings);

                PXUIFieldAttribute.SetEnabled <SOInvoiceFilter.definePrinterManually>(sender, filter, filter.PrintWithDeviceHub == true);
                PXUIFieldAttribute.SetEnabled <SOInvoiceFilter.printerName>(sender, filter, filter.PrintWithDeviceHub == true && filter.DefinePrinterManually == true);

                if (filter.PrintWithDeviceHub != true || filter.DefinePrinterManually != true)
                {
                    filter.PrinterName = null;
                }
            }
        }
예제 #3
0
        public virtual void SOShipmentFilter_RowSelected(PXCache sender, PXRowSelectedEventArgs e)
        {
            if (e.Row == null)
            {
                return;
            }

            SOShipmentFilter filter = e.Row as SOShipmentFilter;

            if (filter != null && !String.IsNullOrEmpty(filter.Action))
            {
                Dictionary <string, object> parameters = Filter.Cache.ToDictionary(filter);
                Orders.SetProcessTarget(null, null, null, filter.Action, parameters);
            }
            string actionID = (string)Orders.GetTargetFill(null, null, null, filter.Action, "@actionID");
            int    action   = 0;

            int.TryParse(actionID, out action);

            PXUIFieldAttribute.SetEnabled <SOShipmentFilter.invoiceDate>(sender, filter, action == SOShipmentEntryActionsAttribute.CreateInvoice || action == SOShipmentEntryActionsAttribute.CreateDropshipInvoice);
            PXUIFieldAttribute.SetEnabled <SOShipmentFilter.packagingType>(sender, filter, action != SOShipmentEntryActionsAttribute.CreateDropshipInvoice);
            PXUIFieldAttribute.SetVisible <SOShipmentFilter.showPrinted>(sender, filter, action == SOShipmentEntryActionsAttribute.PrintLabels || action == SOShipmentEntryActionsAttribute.PrintPickList);
            PXUIFieldAttribute.SetDisplayName <SOShipment.shipmentNbr>(Orders.Cache, action == SOShipmentEntryActionsAttribute.CreateDropshipInvoice ? Messages.GetLocal(POReceipt.receiptNbr.DisplayName) : Messages.GetLocal(SOShipment.shipmentNbr.DisplayName));
            PXUIFieldAttribute.SetDisplayName <SOShipment.shipDate>(Orders.Cache, action == SOShipmentEntryActionsAttribute.CreateDropshipInvoice ? Messages.GetLocal(POReceipt.receiptDate.DisplayName) : Messages.GetLocal(SOShipment.shipDate.DisplayName));


            if (sosetup.Current.UseShipDateForInvoiceDate == true)
            {
                sender.RaiseExceptionHandling <SOShipmentFilter.invoiceDate>(filter, null, new PXSetPropertyException(Messages.UseInvoiceDateFromShipmentDateWarning, PXErrorLevel.Warning));
                PXUIFieldAttribute.SetEnabled <SOShipmentFilter.invoiceDate>(sender, filter, false);
            }
        }
예제 #4
0
        public virtual void SOInvoiceFilter_RowSelected(PXCache sender, PXRowSelectedEventArgs e)
        {
            SOInvoiceFilter filter = e.Row as SOInvoiceFilter;

            if (filter != null && !String.IsNullOrEmpty(filter.Action))
            {
                Dictionary <string, object> parameters = Filter.Cache.ToDictionary(filter);
                SOInvoiceList.SetProcessTarget(null, null, null, filter.Action, parameters);

                string actionID = (string)SOInvoiceList.GetTargetFill(null, null, null, Filter.Current.Action, "@ActionName");
                PXUIFieldAttribute.SetVisible <SOInvoiceFilter.showFailedCCCapture>(sender, e.Row, actionID == "CaptureCCPayment");
                bool showPrintSettings = IsPrintingAllowed(filter);

                PXUIFieldAttribute.SetVisible <SOInvoiceFilter.printWithDeviceHub>(sender, filter, showPrintSettings);
                PXUIFieldAttribute.SetVisible <SOInvoiceFilter.definePrinterManually>(sender, filter, showPrintSettings);
                PXUIFieldAttribute.SetVisible <SOInvoiceFilter.printerID>(sender, filter, showPrintSettings);
                PXUIFieldAttribute.SetVisible <SOInvoiceFilter.numberOfCopies>(sender, filter, showPrintSettings);

                PXUIFieldAttribute.SetEnabled <SOInvoiceFilter.definePrinterManually>(sender, filter, filter.PrintWithDeviceHub == true);
                PXUIFieldAttribute.SetEnabled <SOInvoiceFilter.numberOfCopies>(sender, filter, filter.PrintWithDeviceHub == true);
                PXUIFieldAttribute.SetEnabled <SOInvoiceFilter.printerID>(sender, filter, filter.PrintWithDeviceHub == true && filter.DefinePrinterManually == true);

                if (filter.PrintWithDeviceHub != true || filter.DefinePrinterManually != true)
                {
                    filter.PrinterID = null;
                }
            }
        }
예제 #5
0
        public virtual void SOShipmentFilter_RowSelected(PXCache sender, PXRowSelectedEventArgs e)
        {
            if (e.Row == null)
            {
                return;
            }

            SOShipmentFilter filter = e.Row as SOShipmentFilter;

            if (filter != null && !String.IsNullOrEmpty(filter.Action))
            {
                Dictionary <string, object> parameters = Filter.Cache.ToDictionary(filter);
                Orders.SetProcessTarget(null, null, null, filter.Action, parameters);
            }
            int?action = GetActionIDByName(filter.Action);

            PXUIFieldAttribute.SetEnabled <SOShipmentFilter.invoiceDate>(sender, filter, action == SOShipmentEntryActionsAttribute.CreateInvoice || action == SOShipmentEntryActionsAttribute.CreateDropshipInvoice);
            PXUIFieldAttribute.SetEnabled <SOShipmentFilter.packagingType>(sender, filter, action != SOShipmentEntryActionsAttribute.CreateDropshipInvoice);
            PXUIFieldAttribute.SetEnabled <SOShipmentFilter.siteID>(sender, filter, action != SOShipmentEntryActionsAttribute.CreateDropshipInvoice);
            PXUIFieldAttribute.SetVisible <SOShipmentFilter.showPrinted>(sender, filter, action == SOShipmentEntryActionsAttribute.PrintLabels || action == SOShipmentEntryActionsAttribute.PrintPickList);

            PXUIFieldAttribute.SetDisplayName <SOShipment.shipmentNbr>(Orders.Cache, action == SOShipmentEntryActionsAttribute.CreateDropshipInvoice ? Messages.ReceiptNbr : Messages.ShipmentNbr);
            PXUIFieldAttribute.SetDisplayName <SOShipment.shipDate>(Orders.Cache, action == SOShipmentEntryActionsAttribute.CreateDropshipInvoice ? Messages.ReceiptDate : Messages.ShipmentDate);

            if (sosetup.Current.UseShipDateForInvoiceDate == true)
            {
                sender.RaiseExceptionHandling <SOShipmentFilter.invoiceDate>(filter, null, new PXSetPropertyException(Messages.UseInvoiceDateFromShipmentDateWarning, PXErrorLevel.Warning));
                PXUIFieldAttribute.SetEnabled <SOShipmentFilter.invoiceDate>(sender, filter, false);
            }

            bool warnShipNotInvoiced = (action == SOShipmentEntryActionsAttribute.PostInvoiceToIN &&
                                        (string)Orders.GetTargetFill(null, null, null, filter.Action, nameof(SOShipment.status)) != SOShipmentStatus.Completed &&
                                        sosetup.Current.UseShippedNotInvoiced != true && sosetup.Current.UseShipDateForInvoiceDate != true);
            Exception warnShipNotInvoicedExc = warnShipNotInvoiced ? new PXSetPropertyException(Messages.ShipNotInvoicedWarning, PXErrorLevel.Warning) : null;

            sender.RaiseExceptionHandling <SOShipmentFilter.action>(filter, null, warnShipNotInvoicedExc);
            bool showPrintSettings = IsPrintingAllowed(filter);

            PXUIFieldAttribute.SetVisible <SOShipmentFilter.printWithDeviceHub>(sender, filter, showPrintSettings);
            PXUIFieldAttribute.SetVisible <SOShipmentFilter.definePrinterManually>(sender, filter, showPrintSettings);
            PXUIFieldAttribute.SetVisible <SOShipmentFilter.printerID>(sender, filter, showPrintSettings);
            PXUIFieldAttribute.SetVisible <SOShipmentFilter.numberOfCopies>(sender, filter, showPrintSettings);

            PXUIFieldAttribute.SetEnabled <SOShipmentFilter.definePrinterManually>(sender, filter, filter.PrintWithDeviceHub == true);
            PXUIFieldAttribute.SetEnabled <SOShipmentFilter.numberOfCopies>(sender, filter, filter.PrintWithDeviceHub == true);
            PXUIFieldAttribute.SetEnabled <SOShipmentFilter.printerID>(sender, filter, filter.PrintWithDeviceHub == true && filter.DefinePrinterManually == true);

            if (filter.PrintWithDeviceHub != true || filter.DefinePrinterManually != true)
            {
                filter.PrinterID = null;
            }

            bool showInvoiceSeparately = action.IsIn(SOShipmentEntryActionsAttribute.CreateInvoice, SOShipmentEntryActionsAttribute.CreateDropshipInvoice);

            PXUIFieldAttribute.SetEnabled <SOShipment.billSeparately>(Orders.Cache, null, showInvoiceSeparately &&
                                                                      PXLongOperation.GetStatus(this.UID) == PXLongRunStatus.NotExists);
            PXUIFieldAttribute.SetVisible <SOShipment.billSeparately>(Orders.Cache, null, showInvoiceSeparately);
        }
예제 #6
0
        protected virtual Type GetBQLStatement()
        {
            Type where = PX.TM.OwnedFilter.ProjectionAttribute.ComposeWhere(
                typeof(PrintInvoicesFilter),
                typeof(ARInvoice.workgroupID),
                typeof(ARInvoice.ownerID));

            Type printWhere =
                typeof(Where <ARInvoice.hold, Equal <False>, And <ARInvoice.scheduled, Equal <False>, And <ARInvoice.voided, Equal <False>,
                                                                                                           And <ARInvoice.dontPrint, Equal <False>,
                                                                                                                And <ARInvoice.printed, NotEqual <True> > > > > >);
            Type emailWhere =
                typeof(Where <ARInvoice.hold, Equal <False>, And <ARInvoice.scheduled, Equal <False>, And <ARInvoice.voided, Equal <False>,
                                                                                                           And <ARInvoice.dontEmail, Equal <False>,
                                                                                                                And <ARInvoice.emailed, NotEqual <True> > > > > >);

            Type dateWhere =
                typeof(Where <ARInvoice.docDate, LessEqual <Current <PrintInvoicesFilter.endDate> >,
                              And <ARInvoice.docDate, GreaterEqual <Current <PrintInvoicesFilter.beginDate> > > >);

            Type whereAnd;

            if (Filter.Current.ShowAll == true)
            {
                dateWhere = typeof(Where <True, Equal <True> >);
                whereAnd  = Filter.Current.Action == "<SELECT>" ? typeof(Where <True, Equal <False> >) : typeof(Where <ARInvoice.hold, Equal <False>, And <ARInvoice.scheduled, Equal <False>, And <ARInvoice.voided, Equal <False> > > >);
            }
            else
            {
                whereAnd = Filter.Current.Action == "<SELECT>" ? typeof(Where <True, Equal <False> >) : typeof(Where <True, Equal <True> >);

                string onlyNotPrinted = (string)ARDocumentList.GetTargetFill(null, null, null, Filter.Current.Action, "@OnlyNotPrinted");
                string onlyNotEmailed = (string)ARDocumentList.GetTargetFill(null, null, null, Filter.Current.Action, "@OnlyNotEmailed");

                if (onlyNotEmailed != null)
                {
                    whereAnd = emailWhere;
                }

                if (onlyNotPrinted != null)
                {
                    whereAnd = printWhere;
                }
            }


            Type select =
                BqlCommand.Compose(
                    typeof(Select2 <, ,>), typeof(ARInvoice),
                    typeof(InnerJoinSingleTable <Customer, On <Customer.bAccountID, Equal <ARInvoice.customerID> > >),
                    typeof(Where2 <,>),
                    typeof(Match <Customer, Current <AccessInfo.userName> >),
                    typeof(And2 <,>), whereAnd,
                    typeof(And2 <,>), dateWhere,
                    typeof(And <>), where);

            return(select);
        }
예제 #7
0
        public virtual void SOInvoiceFilter_RowSelected(PXCache sender, PXRowSelectedEventArgs e)
        {
            SOInvoiceFilter filter = e.Row as SOInvoiceFilter;

            if (filter != null && !String.IsNullOrEmpty(filter.Action))
            {
                Dictionary <string, object> parameters = Filter.Cache.ToDictionary(filter);
                SOInvoiceList.SetProcessTarget(null, null, null, filter.Action, parameters);

                string actionID = (string)SOInvoiceList.GetTargetFill(null, null, null, Filter.Current.Action, "@ActionName");
                PXUIFieldAttribute.SetVisible <SOInvoiceFilter.showFailedCCCapture>(sender, e.Row, actionID == "CaptureCCPayment");
            }
        }
예제 #8
0
        public virtual void SOOrderFilter_RowSelected(PXCache sender, PXRowSelectedEventArgs e)
        {
            SOOrderFilter filter = e.Row as SOOrderFilter;

            if (filter == null)
            {
                return;
            }
            string actionID = (string)Orders.GetTargetFill(null, null, null, filter.Action, "@actionID");

            PXUIFieldAttribute.SetVisible <SOOrderFilter.shipmentDate>(sender, null, actionID == "1");
            PXUIFieldAttribute.SetVisible <SOOrderFilter.siteID>(sender, null, actionID == "1");
            if (!String.IsNullOrEmpty(filter.Action))
            {
                string siteCD = Filter.GetValueExt <SOOrderFilter.siteID>(filter) as string;
                Orders.SetProcessTarget(null, null, null, filter.Action, null, actionID == "1" ? filter.ShipmentDate : filter.EndDate, siteCD);
            }
        }
예제 #9
0
        public virtual IEnumerable ardocumentlist(PXAdapter adapter)
        {
            Type where = PX.TM.OwnedFilter.ProjectionAttribute.ComposeWhere(
                typeof(PrintInvoicesFilter),
                typeof(ARInvoice.workgroupID),
                typeof(ARInvoice.ownerID));

            Type printWhere =
                typeof(Where <ARInvoice.hold, Equal <False>, And <ARInvoice.scheduled, Equal <False>, And <ARInvoice.voided, Equal <False>,
                                                                                                           And <ARInvoice.dontPrint, Equal <boolFalse>,
                                                                                                                And <ARInvoice.printed, NotEqual <True> > > > > >);
            Type emailWhere =
                typeof(Where <ARInvoice.hold, Equal <False>, And <ARInvoice.scheduled, Equal <False>, And <ARInvoice.voided, Equal <False>,
                                                                                                           And <ARInvoice.dontEmail, Equal <boolFalse>,
                                                                                                                And <ARInvoice.emailed, NotEqual <True> > > > > >);


            string onlyNotPrinted = (string)ARDocumentList.GetTargetFill(null, null, null, Filter.Current.Action, "@OnlyNotPrinted");
            string onlyNotEmailed = (string)ARDocumentList.GetTargetFill(null, null, null, Filter.Current.Action, "@OnlyNotEmailed");

            Type whereAnd = Filter.Current.Action == "<SELECT>" ? typeof(Where <True, Equal <False> >) : typeof(Where <True, Equal <True> >);

            if (onlyNotEmailed != null)
            {
                whereAnd = emailWhere;
            }

            if (onlyNotPrinted != null)
            {
                whereAnd = printWhere;
            }

            Type select =
                BqlCommand.Compose(
                    typeof(Select2 <, ,>), typeof(ARInvoice),
                    typeof(InnerJoin <Customer, On <Customer.bAccountID, Equal <ARInvoice.customerID> > >),
                    typeof(Where <>), whereAnd);

            PXView view = new PXView(this, false, BqlCommand.CreateInstance(select));

            return(view.SelectMulti());
        }
        public virtual void SOShipmentFilter_RowSelected(PXCache sender, PXRowSelectedEventArgs e)
        {
            if (e.Row == null)
            {
                return;
            }

            SOShipmentFilter filter = e.Row as SOShipmentFilter;

            if (filter != null && !String.IsNullOrEmpty(filter.Action))
            {
                Dictionary <string, object> parameters = Filter.Cache.ToDictionary(filter);
                Orders.SetProcessTarget(null, null, null, filter.Action, parameters);
            }
            int?action = GetActionIDByName(filter.Action);

            PXUIFieldAttribute.SetEnabled <SOShipmentFilter.invoiceDate>(sender, filter, action == SOShipmentEntryActionsAttribute.CreateInvoice || action == SOShipmentEntryActionsAttribute.CreateDropshipInvoice);
            PXUIFieldAttribute.SetEnabled <SOShipmentFilter.packagingType>(sender, filter, action != SOShipmentEntryActionsAttribute.CreateDropshipInvoice);
            PXUIFieldAttribute.SetVisible <SOShipmentFilter.showPrinted>(sender, filter, action == SOShipmentEntryActionsAttribute.PrintLabels || action == SOShipmentEntryActionsAttribute.PrintPickList);

            PXUIFieldAttribute.SetDisplayName <SOShipment.shipmentNbr>(Orders.Cache, action == SOShipmentEntryActionsAttribute.CreateDropshipInvoice ? Messages.ReceiptNbr : Messages.ShipmentNbr);
            PXUIFieldAttribute.SetDisplayName <SOShipment.shipDate>(Orders.Cache, action == SOShipmentEntryActionsAttribute.CreateDropshipInvoice ? Messages.ReceiptDate : Messages.ShipmentDate);

            if (sosetup.Current.UseShipDateForInvoiceDate == true)
            {
                sender.RaiseExceptionHandling <SOShipmentFilter.invoiceDate>(filter, null, new PXSetPropertyException(Messages.UseInvoiceDateFromShipmentDateWarning, PXErrorLevel.Warning));
                PXUIFieldAttribute.SetEnabled <SOShipmentFilter.invoiceDate>(sender, filter, false);
            }

            bool warnShipNotInvoiced = (action == SOShipmentEntryActionsAttribute.PostInvoiceToIN &&
                                        (string)Orders.GetTargetFill(null, null, null, filter.Action, nameof(SOShipment.status)) != SOShipmentStatus.Completed &&
                                        sosetup.Current.UseShippedNotInvoiced != true && sosetup.Current.UseShipDateForInvoiceDate != true);
            Exception warnShipNotInvoicedExc = warnShipNotInvoiced ? new PXSetPropertyException(Messages.ShipNotInvoicedWarning, PXErrorLevel.Warning) : null;

            sender.RaiseExceptionHandling <SOShipmentFilter.action>(filter, null, warnShipNotInvoicedExc);
        }