public System.Collections.IEnumerable PrintReport(PXAdapter adapter)
        {
            if (this.Details.Current != null && this.Filter.Current != null)
            {
                if (this.Filter.Current.CustomerID.HasValue)
                {
                    Customer customer = PXSelect <Customer,
                                                  Where <Customer.bAccountID, Equal <Required <Customer.bAccountID> > > >
                                        .Select(this, Filter.Current.CustomerID);

                    if (customer != null)
                    {
                        Dictionary <string, string> parameters = new Dictionary <string, string>();

                        Export(parameters, this.Details.Current);
                        parameters[ARStatementReportParams.Parameters.CustomerID] = customer.AcctCD;

                        parameters[ARStatementReportParams.Parameters.PrintOnPaper] =
                            customer.PrintStatements == true ?
                            ARStatementReportParams.BoolValues.True :
                            ARStatementReportParams.BoolValues.False;
                        parameters[ARStatementReportParams.Parameters.SendByEmail] =
                            customer.SendStatementByEmail == true ?
                            ARStatementReportParams.BoolValues.True:
                            ARStatementReportParams.BoolValues.False;

                        string reportID = (customer.PrintCuryStatements ?? false) ? ARStatementReportParams.CS_CuryStatementReportID : ARStatementReportParams.CS_StatementReportID;

                        var reportRequired = PXReportRequiredException.CombineReport(null,
                                                                                     ARStatementPrint.GetCustomerReportID(this, reportID, customer.BAccountID, this.Details.Current.BranchID), parameters);
                        if (reportRequired != null)
                        {
                            throw reportRequired;
                        }
                    }
                }
            }
            return(Filter.Select());
        }
示例#2
0
        public static string ReportIDForCustomer(PXGraph graph, Customer customer, int?branchID)
        {
            var reportID = customer.PrintCuryStatements == true ? ARStatementReportParams.CS_CuryStatementReportID : ARStatementReportParams.CS_StatementReportID;

            return(ARStatementPrint.GetCustomerReportID(graph, reportID, customer.BAccountID, branchID));
        }