Ejemplo n.º 1
0
 public virtual bool IsPrintingAllowed(POPrintOrderFilter filter)
 {
     return(PXAccess.FeatureInstalled <FeaturesSet.deviceHub>() &&
            (filter != null && !String.IsNullOrEmpty(filter.Action) && POReports.GetReportIDByName(Records, filter.Action) == POReports.PurchaseOrderReportID));
 }
        protected virtual void POPrintOrderFilter_RowSelected(PXCache sender, PXRowSelectedEventArgs e)
        {
            POPrintOrderFilter filter = (POPrintOrderFilter)e.Row;

            PXUIFieldAttribute.SetEnabled <POPrintOrderFilter.ownerID>(sender, filter, filter == null || filter.MyOwner == false);
            PXUIFieldAttribute.SetEnabled <POPrintOrderFilter.workGroupID>(sender, filter, filter == null || filter.MyWorkGroup == false);

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

                bool showPrintSettings = PXAccess.FeatureInstalled <FeaturesSet.deviceHub>() &&
                                         (filter != null && !String.IsNullOrEmpty(filter.Action) && POReports.GetReportIDByName(Records, filter.Action) == POReports.PurchaseOrderReportID);

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

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

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