Exemple #1
0
        protected virtual bool IsPrintingAllowed(SOShipmentFilter filter)
        {
            int?action = GetActionIDByName(filter.Action);

            return(PXAccess.FeatureInstalled <FeaturesSet.deviceHub>() &&
                   (action == SOShipmentEntryActionsAttribute.PrintLabels ||
                    action == SOShipmentEntryActionsAttribute.PrintPickList ||
                    (filter != null && !String.IsNullOrEmpty(filter.Action) && SOReports.GetReportIDByName(Orders, filter.Action) == SOReports.PrintShipmentConfirmation)));
        }
Exemple #2
0
        public virtual void SOShipmentFilter_RowUpdated(PXCache sender, PXRowUpdatedEventArgs e)
        {
            _ActionChanged = !sender.ObjectsEqual <SOShipmentFilter.action>(e.Row, e.OldRow);
            if (_ActionChanged)
            {
                ((SOShipmentFilter)e.Row).PackagingType = SOShipmentFilter.Both;
            }

            if ((_ActionChanged || !sender.ObjectsEqual <SOShipmentFilter.definePrinterManually>(e.Row, e.OldRow) || !sender.ObjectsEqual <SOShipmentFilter.printWithDeviceHub>(e.Row, e.OldRow)) &&
                Filter.Current != null && PXAccess.FeatureInstalled <FeaturesSet.deviceHub>() && Filter.Current.PrintWithDeviceHub == true && Filter.Current.DefinePrinterManually == true)
            {
                string actualReportID = SOReports.GetReportID(GetActionIDByName(Filter.Current.Action), null) ?? SOReports.GetReportIDByName(Orders, Filter.Current.Action);
                Filter.Current.PrinterName = new NotificationUtility(this).SearchPrinter(ARNotificationSource.Customer, actualReportID, Accessinfo.BranchID);
            }
        }
        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;
                }
            }
        }
Exemple #4
0
 public virtual bool IsPrintingAllowed(SOProcessFilter filter)
 {
     return(PXAccess.FeatureInstalled <FeaturesSet.deviceHub>() &&
            (filter != null && !String.IsNullOrEmpty(filter.Action) && SOReports.GetReportIDByName(Records, filter.Action) == SOReports.PrintSalesOrder));
 }
Exemple #5
0
        public virtual void SOProcessFilter_RowSelected(PXCache sender, PXRowSelectedEventArgs e)
        {
            SOProcessFilter filter = e.Row as SOProcessFilter;

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

                PXUIFieldAttribute.SetVisible <SOProcessFilter.printerID>(sender, filter,
                                                                          PXAccess.FeatureInstalled <FeaturesSet.deviceHub>() &&
                                                                          (filter != null && !String.IsNullOrEmpty(filter.Action) && SOReports.GetReportIDByName(Records, filter.Action) == SOReports.PrintSalesOrder));
                bool showPrintSettings = IsPrintingAllowed(filter);

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

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

                if (filter.PrintWithDeviceHub != true || filter.DefinePrinterManually != true)
                {
                    filter.PrinterID = null;
                }
            }
        }
 public virtual bool IsPrintingAllowed(SOInvoiceFilter filter)
 {
     return(PXAccess.FeatureInstalled <FeaturesSet.deviceHub>() &&
            (filter != null && !String.IsNullOrEmpty(filter.Action) && SOReports.GetReportIDByName(SOInvoiceList, filter.Action) == SOReports.PrintInvoiceReport));
 }
Exemple #7
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.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 = PXAccess.FeatureInstalled <FeaturesSet.deviceHub>() &&
                                     (action == SOShipmentEntryActionsAttribute.PrintLabels ||
                                      action == SOShipmentEntryActionsAttribute.PrintPickList ||
                                      (filter != null && !String.IsNullOrEmpty(filter.Action) && SOReports.GetReportIDByName(Orders, filter.Action) == SOReports.PrintShipmentConfirmation));

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

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

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