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8BE,8EAC9BC,IAAuB,oOAfhCF,uGAAiBA,uCAAiC,eAAjCA,CAAiC,8BAAjCA,CAAiC,gCAAjCA,CAAiC,qCAAjCA,CAAiC,iCAAjCA,CAAiC,6BAAjCA,CAAiC,6BAAjCA,CAAiC,iCAAjCA,CAAiC,4EAczCD,GAAb,GDpIII,YAAa,CAACC,KACdxP,KAAM,CACJyP,OAAO,EACPC,OAAQC,kBAWP,IAAMC,GAAb,MAAM,sDAAOA,4DALF,CACPC,cAAsBtT,KAEdsT,QAECD,GAAb,+BEMO,IAAME,GAAb,MAAM,sDAAOA,6DAFA,GAAEC,SAZJ,CACPC,KACAJ,GACAK,IACAC,KACAC,IACAC,IACAC,IACAC,KACAC,KACAC,SAISV,GAAb","names":["routes","path","component","constructor","mapViewStore","campaignYearStore","cropRotationStore","fieldStore","languageStore","roundNumericPipe","roundNumericService","settingsStore","permissionPipe","rbStore","elementService","cropService","nFertilizationService","nFertilizationStore","basicFertilisationSummariesStore","nutrientService","nutrientDistributionStore","soilGroupFormatPipe","dateService","translationStore","driverStore","machineStore","fertilizerStore","fertilizerService","nutrientStatisticService","instrumentStore","nCommonService","tooltipContentService","baseFertilizationService","nutrientManagementService","this","of","ApDynGridPagerConfig","ApPermissions","ngOnInit","hideMapView","recordsLoadingOrSaving$","combineLatest","Listen","s","loading","planBooksLoading","pipe","map","loadingItems","some","x","columns$","_getBaseGrid","details$","_getDetailsGrid","ngAfterContentInit","_postLoadFieldActions","data","getValue","_subscriptions","push","selectedYear","subscribe","LoadNFertilizationPlanningSummaries","skip","fields","_loadStoreData","items$","_getItems","ngOnDestroy","forEach","d","unsubscribe","t","_onSelectionChanged","_a","loadBasicFertilisationSummaries","history","rb","Distributions$","Summaries$","Bookings$","logfiles","filter","cropRotation","_","bFS","nPlanBooks","_1","length","Object","keys","nutrientDistribution","_logFiles","v","BasicFertilisationPlanBooks","flat","distributions","bfSummaries","bfPlanBooks","logFiles","field","geom","getCurrentFieldGeom","adminArea","Create","p","AdminArea","area","alreadyApplied","calculateAlreadyAppliedFromContentNPlanBooks","fieldCrop","mainCrop","parseMainCrop","getFieldCrop","nutrientDist","find","FieldGeomId","Id","rbResult","FirstOrDefault","details","pb","FieldId","a","BookedAt","isDateInSelectedCampaignYear","ApplicationDate","h","PlanIds","includes","planBook","bfSummary","bfs","Summary_Id","duration","_calculateDuration","TStart","TEnd","Add","getDateMidnight","User_Appl_Date","Duration","DurationText","ToString","ModuleText","FindTranslationForSelectedLanguage","Driver","getDriverById","ExportDriver","Instrument","getInstrumentById","ExportInstrument","Machine","getMachineById","ExportMachine","DetailsText","_getBaseFertilizationDetailsText","Notes","Title","nPlanBookAll","u","FindAll","firstPlanBook","ECStage","ECValue","_getNFertilizationDetailsText","Summary","SourceItem","NrSNr","getFieldNumberAndSubNumber","Area","undefined","roundAsNumber","FirstSetting","DigitsAfterDecimalPoint","AreaOriginal","toString","MainCrop","SecondCrop","parseSecondCrop","MainCropExpectedYield","parseMainCropExpectedYield","SecondCropExpectedYield","parseSecondCropExpectedYield","StrawHarvested","parseStrawHarvested","AlreadyApplied","SoilGroup","ObjectFactory","SoilGroups","Sort","DetailsRecords","EcValue","g","CropNote","Note","selectedLanguage","transform","language","settings","permission","setting","ApDynGridPropertyColumnConfig","title","width","hide","headerFilterable","filterType","FilterType","cssClass","filterable","ApDynGridColumnHideConfig","mapHide","selfHide","mode","m","MapViewMode","sortIndex","sortDesc","tooltip","dataItem","pipes","args","generateCropNoteTooltip","headerExtraLines","template","PropertyTemplate","ApDynGridEditColumnConfig","options","text","callback","_onPrint","disabled","loadFieldNutrientDistributions","_readFieldGeomsOfCurrentLoadedFields","tmp","FieldGeoms","ApDynGridDetailsGridConfig","checkboxDisabled","columns","format","CurrentDateFormat","_avgContentColumnWidth","multiline","summary","fertilizer","getFertilizer","Product_Id","element","User_Operation_Mode","ApOperationMode","Operation_Mode","_b","getFertilizerLeadingElement","Element","_c","amount","round","convertNutrientToGoods","Appl_Rate","amountUnitHa","getFertilizerUnit","amountUnit","product","getFertilizerProductName","bandIdX0","getAverageNutrientFromStatistic","Statistic","bandIdX1","bandIdX2","bandIdX3","textPValue","_getValueWithElementPrefix","ApElementType","textKValue","textMgValue","textCaOValue","nValue","c","calculateNElementByLeadElement","_d","Average","_e","allTextCombined","StringFactory","replaceAll","getCalculateSumFertilizerBySinglePlanBook","bandId","elementType","value","CalculateToElementByGivenValue","GetElementStringByString","ProductId","calculateProductAmountFromPlanBooks","getProductUnit","getFertilizerStatusDescription","ApplicationMode","TimeSpan","TotalMilliseconds","ApFarmRecordsOverviewComponent","i0","selectors","ApDynComponentComponent","canActivate","ApPermissionGuard","login","layout","PageMode","ApFarmRecordsRoutes","RouterModule","ApFarmRecordsModule","imports","CommonModule","ApDynComponentModule","PDFExportModule","ApIconModule","ApTranslationModule","ApMapModule","ApUtilsModule","ApSectionHeaderModule","ApPermissionModule"],"sources":["./src/app/ap-farm-records/ap-farm-records.routes.ts","./src/app/ap-farm-records/components/ap-farm-records-overview.component.ts","./src/app/ap-farm-records/ap-farm-records.module.ts"],"sourcesContent":["import {Route, RouterModule} from '@angular/router';\nimport {PageMode} from '../ap-interface';\nimport {NgModule} from '@angular/core';\nimport {ApPermissionGuard} from '../guards/ap-permission-guard.service';\nimport {ApFarmRecordsOverviewComponent} from './components/ap-farm-records-overview.component';\n\nexport const routes: Route[] = [\n {\n path: 'overview',\n component: ApFarmRecordsOverviewComponent,\n canActivate: [ApPermissionGuard],\n data: {\n login: true,\n layout: PageMode.HALFSCREEN\n }\n }\n];\n\n@NgModule({\n imports: [\n RouterModule.forChild(routes)\n ],\n exports: [RouterModule]\n})\nexport class ApFarmRecordsRoutes {\n}\n","import {AfterContentInit, Component, OnDestroy, OnInit, ViewChild} from '@angular/core';\nimport {MapViewStore} from '../../stores/layout/mapview.store';\nimport {ApPermissions} from 'invoker-transport';\nimport {combineLatest, Observable, of, Subscription} from 'rxjs';\nimport {\n IFieldGridData\n} from '../../factories/field-grid-data-factory.service';\nimport {\n ApDynGridColumnConfigBase,\n ApDynGridColumnHideConfig\n} from '../../ap-dyngrids/config/ap-dyn-grid-column-config-base';\nimport {\n ApDynGridPagerConfigBase\n} from '../../ap-dyngrids/config/ap-dyn-grid-pager-config-base';\nimport {CropRotationStore, FieldCropRotationHistory} from '../../stores/farm/crop.rotation.store';\nimport {CampaignYearStore} from '../../stores/login/campaignyear.store';\nimport {FieldStore} from '../../stores/farm/field.store';\nimport {LanguageStore} from '../../stores/translation/language.store';\nimport {GetRoundNumericPipe} from '../../ap-utils';\nimport {SettingsStore} from '../../stores/base-data/settings.store';\nimport {\n GetPermissionPipe\n} from '../../ap-permission/pipes/get-permission.pipe';\nimport {RbStore} from '../../stores/nutrients/rb.store';\nimport {\n BasicFertilisationSummariesStore\n} from '../../stores/taskmanagement/basic.fertilisation.summaries.store';\nimport {filter, map, skip} from 'rxjs/operators';\nimport {\n ApDynGridPropertyColumnConfig,\n FilterType,\n PropertyTemplate\n} from '../../ap-dyngrids/config/ap-dyn-grid-property-column-config';\nimport {MapViewMode} from '../../ap-interface';\nimport {\n ApDynGridEditColumnConfig\n} from '../../ap-dyngrids/config/ap-dyn-grid-edit-column-config';\nimport {\n GetElementService\n} from '../../ap-utils/service/ap-get-element.service';\nimport {Create, ObjectFactory, StringFactory, TimeSpan} from 'ts-tooling';\nimport {\n GetRoundNumericService\n} from '../../ap-utils/service/get-round-numeric.service';\nimport {ApGetCropService} from '../../stores/services/ap-get-crop.service';\nimport {NFertilizationService} from '../../services/data/n-fertilization.service';\nimport {\n NFertilizationStore\n} from '../../stores/n-fertilization/n-fertilization.store';\nimport {ApNutrientService} from '../../ap-utils/service/ap-nutrient.service';\nimport {\n FieldNutrientDistributionStore\n} from '../../stores/nutrients/field-nutrient-distributions.store';\nimport {\n ApDynGridDetailsGridConfig\n} from '../../ap-dyngrids/config/details/ap-dyn-grid-details-grid-config';\nimport {SoilGroupFormatPipe} from '../../ap-utils/pipes/soil-group-format.pipe';\nimport {ApDateService} from '../../ap-core/services/ap-date-service';\nimport {TranslationStore} from '../../stores/translation/translation.store';\nimport {DriverStore} from '../../stores/docu/driver.store';\nimport {MachineStore} from '../../stores/docu/machine.store';\nimport {InstrumentStore} from '../../stores/docu/instrument.store';\nimport {FertilizerService} from '../../services/data/fertilizer.service';\nimport {FertilizerStore} from '../../stores/base-data/fertilizer.store';\nimport {\n ApNutrientStatisticService\n} from '../../nutrient-management/service/ap-nutrient-statistic.service';\nimport {\n ApDynGridPagerConfig\n} from '../../ap-dyngrids/config/ap-dyn-grid-pager-config';\nimport {\n ApDynComponentComponent\n} from '../../ap-dyncomponent/ap-dyncomponent.component';\nimport {\n ApNFertilizationCommonService\n} from '../../n-fertilization/services/ap-n-fertilization.common.service';\nimport {\n ApTooltipContentService\n} from '../../ap-utils/service/ap-tooltip-content.service';\nimport {\n ApOperationMode\n} from '../../ap-interface/enums/ap-operation-mode.enum';\nimport {\n BaseFertilizationService\n} from '../../services/data/base-fertilization.service';\nimport {\n NutrientManagementService\n} from '../../nutrient-management/service/nutrient-management.service';\nimport {\n ApElementType\n} from '../../ap-interface/enums/ap-elements-type.enum';\nimport IInstrument = Data.DocuContext.Instrument.IInstrument;\nimport IMachine = Data.DocuContext.Machine.IMachine;\nimport IDriver = Data.DocuContext.Driver.IDriver;\nimport IBasicFertilisationSummaries = Data.TaskManagement.IBasicFertilisationSummaries;\nimport IBasicFertilisationPlanBooks = Data.TaskManagement.IBasicFertilisationPlanBooks;\nimport INFertilizationPlanBook = Data.TaskManagement.INFertilizationPlanBook;\nimport IField = Data.FieldManagement.IField;\nimport IRbStatistic = Data.Nutrients.IRbStatistic;\nimport IFieldNutrientsDistribution = Data.Nutrients.IFieldNutrientsDistribution;\nimport IDatasetFieldMap = Data.Sensor.IDatasetFieldMap;\n\nexport interface IFarmRecordOverviewData extends IFieldGridData {\n NrSNr: string;\n AlreadyApplied: number;\n EcValue: number | null;\n CropNote: string | null;\n NewestSampleDate: Date;\n SoilGroup: number[];\n DetailsRecords: IFarmRecordOverviewDetailsData[];\n}\n\nexport interface IFarmRecordOverviewDetailsData {\n ApplicationDate: Date;\n ModuleText: string;\n ECStage?: number;\n Duration?: TimeSpan;\n DurationText?: string;\n Driver: IDriver;\n Machine: IMachine;\n Instrument: IInstrument;\n DetailsText: string;\n Notes: string;\n}\n\n@Component({\n selector: 'ap-farm-records-overview',\n template: `\n \n \n `,\n styles: []\n})\nexport class ApFarmRecordsOverviewComponent implements OnInit, AfterContentInit, OnDestroy {\n @ViewChild(ApDynComponentComponent, {static: true}) dynComponent: ApDynComponentComponent;\n public recordsLoadingOrSaving$ = of(false);\n public items$: Observable = of([]);\n public details$: Observable;\n public columns$: Observable = of([]);\n public pager$: Observable = of(new ApDynGridPagerConfig());\n\n protected readonly ApPermissions = ApPermissions;\n\n private _onPrint: any;\n private _avgContentColumnWidth = 60;\n private _onSelectionChanged: Subscription;\n private _subscriptions: Array = [];\n\n constructor(private mapViewStore: MapViewStore,\n private campaignYearStore: CampaignYearStore,\n private cropRotationStore: CropRotationStore,\n private fieldStore: FieldStore,\n private languageStore: LanguageStore,\n private roundNumericPipe: GetRoundNumericPipe,\n private roundNumericService: GetRoundNumericService,\n private settingsStore: SettingsStore,\n private permissionPipe: GetPermissionPipe,\n private rbStore: RbStore,\n private elementService: GetElementService,\n private cropService: ApGetCropService,\n private nFertilizationService: NFertilizationService,\n private nFertilizationStore: NFertilizationStore,\n private basicFertilisationSummariesStore: BasicFertilisationSummariesStore,\n private nutrientService: ApNutrientService,\n private nutrientDistributionStore: FieldNutrientDistributionStore,\n private soilGroupFormatPipe: SoilGroupFormatPipe,\n private dateService: ApDateService,\n private translationStore: TranslationStore,\n private driverStore: DriverStore,\n private machineStore: MachineStore,\n private fertilizerStore: FertilizerStore,\n private fertilizerService: FertilizerService,\n private nutrientStatisticService: ApNutrientStatisticService,\n private instrumentStore: InstrumentStore,\n private nCommonService: ApNFertilizationCommonService,\n private tooltipContentService: ApTooltipContentService,\n private baseFertilizationService: BaseFertilizationService,\n private nutrientManagementService: NutrientManagementService) {\n }\n\n public ngOnInit(): void {\n this.mapViewStore.hideMapView();\n this.recordsLoadingOrSaving$ = combineLatest([\n this.fieldStore.Listen(s => s.loading),\n this.cropRotationStore.Listen(s => s.loading),\n this.basicFertilisationSummariesStore.Listen(s => s.loading),\n this.nFertilizationStore.Listen(s => s.planBooksLoading),\n this.nutrientDistributionStore.Listen(s => s.loading),\n this.rbStore.Listen(s => s.loading)\n ]).pipe(\n map(loadingItems => loadingItems.some(x => x))\n );\n this.columns$ = this._getBaseGrid();\n this.details$ = this._getDetailsGrid();\n }\n\n public ngAfterContentInit(): void {\n this._postLoadFieldActions(this.fieldStore.Listen(s => s.data).getValue());\n // TODO: Remove after implementation of https://agriconde.atlassian.net/browse/APV49-3414\n this._subscriptions.push(this.campaignYearStore.Listen(s => s.selectedYear).subscribe(() => {\n this.nFertilizationStore.LoadNFertilizationPlanningSummaries();\n }));\n this._subscriptions.push(this.fieldStore.Listen(s => s.data).pipe(skip(1)).subscribe(fields => {\n if (fields == null) {\n return;\n }\n this._postLoadFieldActions(fields);\n this._loadStoreData();\n }));\n this.items$ = this._getItems();\n }\n\n public ngOnDestroy(): void {\n this._subscriptions.forEach(d => d.unsubscribe());\n this._onSelectionChanged?.unsubscribe();\n }\n\n private _loadStoreData(): void {\n this.basicFertilisationSummariesStore.loadBasicFertilisationSummaries();\n this.nFertilizationStore.LoadNFertilizationPlanningSummaries();\n }\n\n private _getItems(): Observable {\n return combineLatest([\n this.fieldStore.Listen(s => s.data),\n this.cropRotationStore.Listen(s => s.history),\n this.rbStore.Listen(s => s.rb),\n this.nutrientDistributionStore.Distributions$,\n this.basicFertilisationSummariesStore.Summaries$,\n this.nFertilizationStore.Bookings$(),\n this.nFertilizationStore.Listen(x => x.logfiles)\n ]).pipe(\n filter(([fields, cropRotation, rb, _, bFS, nPlanBooks, _1]) =>\n fields.length !== 0 &&\n Object.keys(cropRotation).length !== 0 && !!rb && !!bFS && !!nPlanBooks),\n map(([fields, cropRotation, rb, nutrientDistribution, bFS, nPlanBooks, _logFiles]) => {\n return [\n fields, cropRotation, rb, nutrientDistribution,\n bFS,\n bFS.map(x => x?.BasicFertilisationPlanBooks).flat(),\n nPlanBooks, _logFiles\n ] as [IField[], FieldCropRotationHistory, IRbStatistic[], IFieldNutrientsDistribution[], IBasicFertilisationSummaries[], IBasicFertilisationPlanBooks[], INFertilizationPlanBook[], IDatasetFieldMap[]];\n }),\n map(([fields, _1, rb, distributions, bfSummaries, bfPlanBooks, nPlanBooks, logFiles]) =>\n fields.map((field) => {\n // TODO: FR: Farm Records loading performance https://agriconde.atlassian.net/browse/APV49-4557\n // TODO: Refactor extract and similar places as well?\n const geom = this.fieldStore.getCurrentFieldGeom(field);\n const adminArea = Create(geom?.AdminArea, 0);\n const area = adminArea > 0 ? adminArea / 10000 : '-';\n const alreadyApplied = this.nFertilizationService.calculateAlreadyAppliedFromContentNPlanBooks(field, nPlanBooks, logFiles, bfPlanBooks);\n const mainCrop = this.cropService.parseMainCrop(field);\n const fieldCrop = mainCrop ? this.cropService.getFieldCrop(field) : null;\n const nutrientDist = distributions.find(d => d && d.FieldGeomId === geom.Id);\n const rbResult = rb.FirstOrDefault(x => x.FieldGeomId === geom?.Id);\n const details: IFarmRecordOverviewDetailsData[] = [];\n\n bfPlanBooks?.filter(pb => pb.FieldId === field?.Id && pb.BookedAt != null &&\n this.campaignYearStore.isDateInSelectedCampaignYear(pb.ApplicationDate) &&\n ((rbResult?.PlanIds != null && rbResult?.PlanIds.length > 0) ? rbResult?.PlanIds.includes(pb.Id) : true))\n .forEach(planBook => {\n const bfSummary = bfSummaries.find(bfs => bfs.Id === planBook.Summary_Id);\n const duration = this._calculateDuration(planBook.TStart, planBook.TEnd);\n details.Add({\n ApplicationDate: this.dateService.getDateMidnight(bfSummary.User_Appl_Date),\n Duration: duration,\n DurationText: duration.ToString('HH:mm'),\n ModuleText: this.translationStore.FindTranslationForSelectedLanguage('Task_Mgmt_GD'),\n Driver: planBook ? this.driverStore.getDriverById(planBook.ExportDriver) : null,\n Instrument: planBook ? this.instrumentStore.getInstrumentById(planBook.ExportInstrument) : null,\n Machine: planBook ? this.machineStore.getMachineById(planBook.ExportMachine) : null,\n DetailsText: this._getBaseFertilizationDetailsText(bfSummary, planBook),\n Notes: bfSummary.Title\n });\n });\n\n // N Records\n const nPlanBookAll = nPlanBooks?.FindAll(x => x.FieldId === field?.Id && this.campaignYearStore.isDateInSelectedCampaignYear(x.ApplicationDate));\n if (nPlanBookAll && nPlanBookAll.length > 0) {\n const firstPlanBook = nPlanBookAll[0];\n details.Add({\n ApplicationDate: this.dateService.getDateMidnight(firstPlanBook.ApplicationDate),\n ECStage: firstPlanBook.ECValue,\n ModuleText: this.translationStore.FindTranslationForSelectedLanguage('Task_Mgmt_ND'),\n Driver: firstPlanBook ? this.driverStore.getDriverById(firstPlanBook.ExportDriver) : null,\n Instrument: firstPlanBook ? this.instrumentStore.getInstrumentById(firstPlanBook.ExportInstrument) : null,\n Machine: firstPlanBook ? this.machineStore.getMachineById(firstPlanBook.ExportMachine) : null,\n DetailsText: this._getNFertilizationDetailsText(nPlanBookAll),\n Notes: firstPlanBook.Summary.Title\n });\n }\n return {\n Id: field.Id,\n SourceItem: field,\n NrSNr: this.fieldStore.getFieldNumberAndSubNumber(field),\n Area: area === '-' ? undefined :\n this.roundNumericService.roundAsNumber(area, this.settingsStore.FirstSetting.DigitsAfterDecimalPoint),\n AreaOriginal: area === '-' ? undefined : area.toString(10),\n MainCrop: this.cropService.parseMainCrop(field),\n SecondCrop: this.cropService.parseSecondCrop(field),\n MainCropExpectedYield: this.cropService.parseMainCropExpectedYield(field),\n SecondCropExpectedYield: this.cropService.parseSecondCropExpectedYield(field),\n StrawHarvested: this.cropService.parseStrawHarvested(field),\n AlreadyApplied: alreadyApplied ?? 0,\n SoilGroup: nutrientDist ? ObjectFactory.Copy(nutrientDist).SoilGroups.Sort() : [],\n DetailsRecords: details,\n EcValue: fieldCrop?.EcValue,\n CropNote: fieldCrop?.Note\n } as IFarmRecordOverviewData;\n })\n )\n );\n }\n\n private _getBaseGrid(): Observable {\n return combineLatest([\n this.languageStore.Listen(s => s.selectedLanguage),\n this.settingsStore.Listen(s => s.data),\n this.permissionPipe.transform(ApPermissions.EDIT_FIELDS)\n ]).pipe(\n filter(([language, settings, _]) => !!language && !!settings[0]),\n map(([language, settings, permission]) => ({\n language,\n setting: settings[0],\n permission\n })),\n map((p) => [\n new ApDynGridPropertyColumnConfig({\n title: 'Docu_Ini__Number',\n field: 'SourceItem.FieldNumber',\n width: 40,\n hide: true,\n headerFilterable: true,\n filterType: FilterType.NUMBER,\n cssClass: 'right',\n filterable: true\n }),\n new ApDynGridPropertyColumnConfig({\n title: 'Docu_Ini_Subnumber',\n field: 'SourceItem.FieldSubnumber',\n width: 40,\n hide: true,\n filterType: FilterType.NUMBER,\n cssClass: 'right',\n filterable: true\n }),\n new ApDynGridPropertyColumnConfig({\n title: 'Global__NumberAbbr',\n field: 'NrSNr',\n filterable: true,\n hide: new ApDynGridColumnHideConfig({\n mapHide: false,\n selfHide: this.mapViewStore.Listen(s => s.mode).pipe(map((m) => m !== MapViewMode.NORMAL)),\n }),\n width: 75,\n headerFilterable: true\n }),\n new ApDynGridPropertyColumnConfig({\n title: 'Global__FieldName',\n field: 'SourceItem.FieldName',\n filterable: true,\n headerFilterable: true,\n sortIndex: 0,\n sortDesc: false,\n width: 100,\n cssClass: 'left'\n }),\n new ApDynGridPropertyColumnConfig({\n title: 'Global__Area_Unit',\n field: 'Area',\n headerFilterable: true,\n width: 60,\n tooltip: (dataItem) => dataItem['AreaOriginal'],\n filterType: FilterType.NUMBER,\n cssClass: 'right',\n pipes: [{\n pipe: this.roundNumericPipe,\n args: [p.setting.DigitsAfterDecimalPoint]\n }]\n }),\n new ApDynGridPropertyColumnConfig({\n title: 'MainCrop',\n field: 'MainCrop',\n filterable: true,\n headerFilterable: true,\n width: 100\n }),\n new ApDynGridPropertyColumnConfig({\n field: 'MainCropExpectedYield',\n title: 'Global__YieldUnit',\n headerFilterable: true,\n width: 60,\n cssClass: 'right',\n filterType: FilterType.NUMBER,\n pipes: [{\n pipe: this.roundNumericPipe,\n args: [p.setting.DigitsAfterDecimalPoint]\n }]\n }),\n new ApDynGridPropertyColumnConfig({\n title: 'ECStageShort',\n field: 'EcValue',\n filterable: true,\n headerFilterable: true,\n width: 40,\n cssClass: 'right',\n filterType: FilterType.NUMBER\n }),\n new ApDynGridPropertyColumnConfig({\n field: 'CropNote',\n title: 'Global__Fieldcrop_Notes',\n tooltip: (dataItem) => this.tooltipContentService.generateCropNoteTooltip(dataItem['CropNote']),\n width: 120\n }),\n new ApDynGridPropertyColumnConfig({\n field: 'AlreadyApplied',\n title: 'Nutrients__already_applied',\n headerExtraLines: ['Nutrients__kg_N_per_ha'],\n width: 60,\n cssClass: 'right',\n filterType: FilterType.NUMBER,\n template: PropertyTemplate.NUMBER,\n filterable: true,\n tooltip: dataItem => dataItem.AlreadyApplied,\n pipes: [{\n pipe: this.roundNumericPipe,\n args: [0]\n }]\n }),\n new ApDynGridPropertyColumnConfig({\n field: 'SoilGroup',\n title: 'Nutrients__Soilgroup',\n width: 60,\n hide: true,\n filterable: true,\n filterType: FilterType.NUMBER_LIST,\n headerFilterable: true,\n pipes: [{\n pipe: this.soilGroupFormatPipe,\n args: [0]\n }]\n }),\n new ApDynGridEditColumnConfig({\n data: (() => {\n const options = [];\n options.Add({\n text: 'Print',\n callback: this._onPrint,\n disabled: true\n });\n return options;\n })(),\n disabled: !p.permission,\n }\n )\n ])\n );\n }\n\n private _postLoadFieldActions(fields: Data.FieldManagement.IField[]): void {\n if (!fields || fields.length === 0) {\n return;\n }\n this.nutrientDistributionStore.loadFieldNutrientDistributions(this._readFieldGeomsOfCurrentLoadedFields(fields));\n }\n\n public _readFieldGeomsOfCurrentLoadedFields(fields: IField[]): string[] {\n const tmp = [];\n for (const field of fields) {\n if (!field.FieldGeoms || typeof field.FieldGeoms !== typeof [] || field.FieldGeoms.length < 1) {\n // skip Fields without Geometry\n continue;\n }\n for (const geom of field.FieldGeoms) {\n tmp.push(geom.Id);\n }\n }\n return tmp;\n }\n\n private _getDetailsGrid(): Observable {\n return combineLatest([\n this.languageStore.Listen(s => s.selectedLanguage),\n this.settingsStore.Listen(s => s.data),\n ]).pipe(\n map(([language, settings]) => ({language, setting: settings[0]})),\n filter((p) => !!p.language && !!p.setting),\n map((_) =>\n new ApDynGridDetailsGridConfig({\n field: 'DetailsRecords',\n checkboxDisabled: true,\n hide: (dataItem) => dataItem.DetailsRecords.length === 0,\n columns: [\n new ApDynGridPropertyColumnConfig({\n field: 'ApplicationDate',\n title: 'Nutrients__FertilizationDate',\n width: 80,\n filterable: true,\n sortIndex: 1,\n sortDesc: true,\n format: this.languageStore.CurrentDateFormat\n }),\n new ApDynGridPropertyColumnConfig({\n title: 'Docu_Ini__Duration',\n field: 'DurationText',\n width: 60,\n filterable: true\n }),\n new ApDynGridPropertyColumnConfig({\n title: 'Global__EC',\n field: 'ECStage',\n width: 40,\n headerFilterable: true,\n filterable: true\n }),\n new ApDynGridPropertyColumnConfig({\n title: 'Global__Module',\n field: 'ModuleText',\n headerFilterable: true,\n width: this._avgContentColumnWidth,\n filterable: true\n }),\n new ApDynGridPropertyColumnConfig({\n field: 'Machine.NameWithSign',\n title: 'Base__Engine',\n width: 100,\n headerFilterable: true,\n filterable: true\n }),\n new ApDynGridPropertyColumnConfig({\n field: 'Instrument.Name',\n title: 'AgriConnect_Ini__Tool',\n width: 100,\n headerFilterable: true,\n filterable: true\n }),\n new ApDynGridPropertyColumnConfig({\n field: 'Driver.ShortFullName',\n title: 'Docu_Ini__Workers',\n width: 100,\n headerFilterable: true,\n filterable: true\n }),\n new ApDynGridPropertyColumnConfig({\n field: 'DetailsText',\n title: 'Global__Details',\n multiline: true,\n width: 300,\n headerFilterable: true,\n filterable: true\n }),\n new ApDynGridPropertyColumnConfig({\n title: 'Global__Note',\n field: 'Notes',\n cssClass: 'left',\n multiline: true,\n width: 100,\n headerFilterable: true,\n filterable: true\n })\n ]\n })\n )\n );\n }\n\n private _getBaseFertilizationDetailsText(summary: IBasicFertilisationSummaries, planBook: IBasicFertilisationPlanBooks): string {\n const fertilizer = this.fertilizerStore.getFertilizer(planBook.Product_Id);\n const element = summary.User_Operation_Mode?.Id === ApOperationMode.Const && planBook.Operation_Mode?.Id === ApOperationMode.Const ?\n this.nutrientService.getFertilizerLeadingElement(planBook.Product_Id) :\n planBook.Element?.Id;\n const amount = this.roundNumericService.round(this.nutrientService.convertNutrientToGoods(planBook.Product_Id, element, planBook.Appl_Rate), 0);\n const amountUnitHa = this.fertilizerService.getFertilizerUnit(fertilizer, true);\n const amountUnit = this.fertilizerService.getFertilizerUnit(fertilizer, false);\n const product = this.fertilizerService.getFertilizerProductName(fertilizer);\n const bandIdX0 = this.nutrientStatisticService.getAverageNutrientFromStatistic(0, planBook.Statistic);\n const bandIdX1 = this.nutrientStatisticService.getAverageNutrientFromStatistic(1, planBook.Statistic);\n const bandIdX2 = this.nutrientStatisticService.getAverageNutrientFromStatistic(2, planBook.Statistic);\n const bandIdX3 = this.nutrientStatisticService.getAverageNutrientFromStatistic(3, planBook.Statistic);\n const textPValue = this._getValueWithElementPrefix(bandIdX0, ApElementType.P);\n const textKValue = this._getValueWithElementPrefix(bandIdX1, ApElementType.K);\n const textMgValue = this._getValueWithElementPrefix(bandIdX2, ApElementType.Mg);\n const textCaOValue = this._getValueWithElementPrefix(bandIdX3);\n const nValue = this.baseFertilizationService.calculateNElementByLeadElement(planBook.Product_Id, planBook.Statistic)?.Average ?? '';\n const textNValue = (nValue === 0 || nValue == null) ? '' : `N: ${this.roundNumericService.round(nValue)}`;\n\n const allTextCombined = `${textPValue} ${textKValue} ${textMgValue} ${textCaOValue} ${textNValue}`;\n const finalAmountElementsText = StringFactory.IsNullOrEmpty(allTextCombined) ? '' : `[${allTextCombined}]`.replaceAll('[ ', '[').replaceAll(' ]', ']').replaceAll(' ', ' ');\n\n const amountSum = this.roundNumericService.round(this.nutrientManagementService.getCalculateSumFertilizerBySinglePlanBook(planBook));\n return `${amount} ${amountUnitHa} ${product} ${finalAmountElementsText}\\n${amountSum} ${amountUnit}`;\n }\n\n private _getValueWithElementPrefix(bandId: any, elementType?: ApElementType): string {\n if (elementType) {\n // No need to convert to oxide here because values are already in correct form\n const value = this.elementService.CalculateToElementByGivenValue(bandId, elementType, false, true);\n return (value === 0 || value == null) ? '' : `${this.elementService.GetElementStringByString(elementType)}: ${this.roundNumericService.round(value)}`;\n } else {\n return (bandId === 0 || bandId == null) ? ''\n : `${this.translationStore.FindTranslationForSelectedLanguage('Nutrients__CaO')}: ${this.roundNumericService.round(bandId)}`;\n }\n }\n\n private _getNFertilizationDetailsText(nPlanBooks: INFertilizationPlanBook[]): string {\n const firstPlanBook = nPlanBooks[0];\n const fertilizer = this.fertilizerStore.getFertilizer(firstPlanBook.ProductId);\n const amount = this.roundNumericService.roundAsNumber(this.nFertilizationService.calculateProductAmountFromPlanBooks(nPlanBooks), 0);\n const amountUnit = this.nCommonService.getProductUnit(firstPlanBook);\n const product = this.fertilizerService.getFertilizerProductName(fertilizer);\n const applicationMode = this.nutrientService.getFertilizerStatusDescription(firstPlanBook.ApplicationMode, false);\n return `${amount ?? 0} ${amountUnit} ${product}, ${applicationMode}`;\n }\n\n private _calculateDuration(TStart: System.ITimeSpan, TEnd: System.ITimeSpan): TimeSpan {\n return TimeSpan.FromMilliseconds((TStart != null && TEnd != null) ? TEnd.TotalMilliseconds - TStart.TotalMilliseconds : 0);\n }\n}\n","import {NgModule} from '@angular/core';\nimport {CommonModule} from '@angular/common';\nimport {ApDynComponentModule} from '../ap-dyncomponent/ap-dyncomponent.module';\nimport {PDFExportModule} from '@progress/kendo-angular-pdf-export';\nimport {ApIconModule} from '../icons/ap-icon.module';\nimport {ApTranslationModule} from '../translation/ap-translation.module';\nimport {ApMapModule} from '../map/ap-map.module';\nimport {ApUtilsModule} from '../ap-utils';\nimport {ApFarmRecordsOverviewComponent} from './components/ap-farm-records-overview.component';\nimport {ApFarmRecordsRoutes} from './ap-farm-records.routes';\nimport {ApSectionHeaderModule} from '../ap-section-header/ap-section-header.module';\nimport {ApPermissionModule} from '../ap-permission/ap-permission.module';\n\n@NgModule({\n declarations: [ApFarmRecordsOverviewComponent],\n exports: [ApFarmRecordsOverviewComponent],\n imports: [\n CommonModule,\n ApFarmRecordsRoutes,\n ApDynComponentModule,\n PDFExportModule,\n ApIconModule,\n ApTranslationModule,\n ApMapModule,\n ApUtilsModule,\n ApSectionHeaderModule,\n ApPermissionModule\n ],\n providers: []\n})\nexport class ApFarmRecordsModule {\n}\n"],"sourceRoot":"webpack:///","file":"804.5e17a68a18e839e3.js"}