Ejemplo n.º 1
0
        public ResultsModel GetIPRReport(DateTime from, DateTime to)
        {
            var iprImpbooks = this.impbookRepository.FilterBy(
                x =>

                // x.IprCpcNumber.HasValue && x.IprCpcNumber.Value == 13 &&
                // todo check if I can just use that ^, not sure it'll be populated reliably
                x.OrderDetails.Any(z => z.CpcNumber.HasValue && z.CpcNumber.Value == this.IprCpcNumberId) &&
                x.CustomsEntryCodeDate.HasValue && from < x.CustomsEntryCodeDate.Value &&
                x.CustomsEntryCodeDate.Value < to);

            var reportLayout = new SimpleGridLayout(
                this.reportingHelper,
                CalculationValueModelType.TextValue,
                null,
                this.GenerateReportTitle(from, to));

            reportLayout.AddColumnComponent(
                null,
                new List <AxisDetailsModel>
            {
                new AxisDetailsModel("RsnNo", "Unique RSN No", GridDisplayType.TextValue)
                {
                    AllowWrap = false
                },
                new AxisDetailsModel("Currency", GridDisplayType.TextValue)
                {
                    AllowWrap = false
                },
                new AxisDetailsModel(
                    "CustomsEntryCodeDate",
                    "Date of Entry (customs)",
                    GridDisplayType.TextValue),
                new AxisDetailsModel("TariffCode", "Commodity (tariff) code", GridDisplayType.TextValue)
                {
                    AllowWrap = false
                },
            });

            var values = new List <CalculationValueModel>();

            foreach (var impbook in iprImpbooks)
            {
                foreach (var orderDetail in impbook.OrderDetails.Where(
                             x => x.CpcNumber.HasValue && x.CpcNumber.Value == this.IprCpcNumberId))
                {
                    this.ExtractDetails(values, impbook, orderDetail);
                }
            }

            reportLayout.SetGridData(values);
            var model = reportLayout.GetResultsModel();

            model.RowDrillDownTemplates.Add(new DrillDownModel("Id", "/logistics/import-books/{textValue}"));
            model.RowHeader = "Import Book Number/Ref";

            return(model);
        }
Ejemplo n.º 2
0
        public ResultsModel GetAssemblyFailsDetailsReportExport(DateTime fromDate, DateTime toDate)
        {
            var weeks = this.linnWeekService.GetWeeks(fromDate, toDate).ToList();

            var reportLayout = new SimpleGridLayout(
                this.reportingHelper,
                CalculationValueModelType.TextValue,
                null,
                this.GenerateDetailsReportTitle(null, fromDate, toDate, null, null, null, null));

            reportLayout.AddColumnComponent(
                null,
                new List <AxisDetailsModel>
            {
                new AxisDetailsModel("Week", GridDisplayType.TextValue),
                new AxisDetailsModel("Date Found", GridDisplayType.TextValue)
                {
                    AllowWrap = false
                },
                new AxisDetailsModel("PartNumber", "Part Number", GridDisplayType.TextValue)
                {
                    AllowWrap = false
                },
                new AxisDetailsModel("BoardPartNumber", "Board Part Number", GridDisplayType.TextValue)
                {
                    AllowWrap = false
                },
                new AxisDetailsModel("Fails", GridDisplayType.TextValue),
                new AxisDetailsModel("CircuitPartNumber", "Circuit Part Number", GridDisplayType.TextValue)
                {
                    AllowWrap = false
                },
                new AxisDetailsModel("FaultCode", "Fault Code", GridDisplayType.TextValue),
                new AxisDetailsModel("ReportedFault", "Reported Fault", GridDisplayType.TextValue),
                new AxisDetailsModel("Analysis", GridDisplayType.TextValue),
                new AxisDetailsModel("Cit", GridDisplayType.TextValue),
                new AxisDetailsModel("Entered By", GridDisplayType.TextValue),
                new AxisDetailsModel("Completed By", GridDisplayType.TextValue)
            });

            var filterQueries = this.GetAssemblyFailDataQueries(
                fromDate,
                toDate,
                null,
                null,
                null,
                null,
                null,
                null);
            var fails = this.GetFails(filterQueries);

            var values = new List <CalculationValueModel>();

            foreach (var assemblyFail in fails)
            {
                this.ExtractExportDetails(values, assemblyFail, weeks);
            }

            reportLayout.SetGridData(values);
            var model = reportLayout.GetResultsModel();

            model.RowHeader = "Id";

            return(model);
        }
Ejemplo n.º 3
0
        public ResultsModel GetAssemblyFailsDetailsReport(
            DateTime fromDate,
            DateTime toDate,
            string boardPartNumber,
            string circuitPartNumber,
            string faultCode,
            string citCode,
            string board,
            int?person)
        {
            var weeks = this.linnWeekService.GetWeeks(fromDate, toDate).ToList();

            var reportLayout = new SimpleGridLayout(
                this.reportingHelper,
                CalculationValueModelType.TextValue,
                null,
                this.GenerateDetailsReportTitle(boardPartNumber, fromDate, toDate, circuitPartNumber, faultCode, citCode, board));

            reportLayout.AddColumnComponent(
                null,
                new List <AxisDetailsModel>
            {
                new AxisDetailsModel("Week", GridDisplayType.TextValue),
                new AxisDetailsModel("PartNumber", "Part Number", GridDisplayType.TextValue)
                {
                    AllowWrap = false
                },
                new AxisDetailsModel("BoardPartNumber", "Board Part Number", GridDisplayType.TextValue)
                {
                    AllowWrap = false
                },
                new AxisDetailsModel("Fails", GridDisplayType.TextValue),
                new AxisDetailsModel("CircuitPartNumber", "Circuit Part Number", GridDisplayType.TextValue)
                {
                    AllowWrap = false
                },
                new AxisDetailsModel("FaultCode", "Fault Code", GridDisplayType.TextValue),
                new AxisDetailsModel("ReportedFault", "Reported Fault", GridDisplayType.TextValue),
                new AxisDetailsModel("Analysis", GridDisplayType.TextValue),
                new AxisDetailsModel("Cit", GridDisplayType.TextValue)
            });

            var filterQueries = this.GetAssemblyFailDataQueries(
                fromDate,
                toDate,
                boardPartNumber,
                circuitPartNumber,
                faultCode,
                citCode,
                board,
                person);
            var fails = this.GetFails(filterQueries);

            var values = new List <CalculationValueModel>();

            foreach (var assemblyFail in fails)
            {
                this.ExtractDetails(values, assemblyFail, weeks);
            }

            reportLayout.SetGridData(values);
            var model = reportLayout.GetResultsModel();

            model.RowDrillDownTemplates.Add(new DrillDownModel("Id", "/production/quality/assembly-fails/{rowId}"));
            model.RowHeader = "Id";

            return(model);
        }