diff --git a/FarmmapsNbs/NbsApplication.cs b/FarmmapsNbs/NbsApplication.cs
index e621bf4..03dc72b 100644
--- a/FarmmapsNbs/NbsApplication.cs
+++ b/FarmmapsNbs/NbsApplication.cs
@@ -75,7 +75,7 @@ namespace FarmmapsNbs
}
var cropfieldItem = await _generalService.CreateCropfieldItemAsync(myDriveRoot.Code,
- $"VRA NBS cropfield {input.OutputFileName}", DateTime.Now.Year, input.GeometryJson.ToString(Formatting.None));
+ $"VRA NBS cropfield {input.OutputFileName}", plantingDate.Year, input.GeometryJson.ToString(Formatting.None));
var dataPath = Path.Combine("Data", input.IsariaZipFile);
var isariaShapeItem =
@@ -97,7 +97,7 @@ namespace FarmmapsNbs
_logger.LogInformation($"Calculating targetN with targetYield: {input.TargetYield}");
var targetNItem = await _nitrogenService.CreateTargetNItem(cropfieldItem);
var targetNData = await _nitrogenService.CalculateTargetN(cropfieldItem, targetNItem, plantingDate,
- measurementDate, input.PotatoPurposeType, "irmi", input.TargetYield);
+ measurementDate, input.PotatoPurposeType, input.TargetYield);
if (targetNData == null)
{
diff --git a/FarmmapsNbs/NitrogenService.cs b/FarmmapsNbs/NitrogenService.cs
index bc230f2..b6aa837 100644
--- a/FarmmapsNbs/NitrogenService.cs
+++ b/FarmmapsNbs/NitrogenService.cs
@@ -34,24 +34,25 @@ namespace FarmmapsNbs
};
return await _farmmapsApiService.CreateItemAsync(itemRequest);
}
-
+
///
/// Calculates TargetN, makes the assumption the cropfield and user.input(targetn) item have the same parent
///
/// The cropfield to base the calculations on
- /// The target yield input for the TargetN calculation
+ /// The targetN item to save calculations in
/// The date the crop is planted
/// The date the measurements are taken
+ /// The crop purpose
+ /// The target yield input for the TargetN calculation
/// The TargetN
public async Task CalculateTargetN(Item cropfieldItem, Item targetNItem, DateTime plantingDate,
- DateTime measurementDate, string inputType, string purposeType, int targetYield)
+ DateTime measurementDate, string purposeType, int targetYield)
{
var nbsTargetNRequest = new TaskRequest {TaskType = VRANBS_TASK};
nbsTargetNRequest.attributes["operation"] = "targetn";
nbsTargetNRequest.attributes["inputCode"] = targetNItem.Code;
nbsTargetNRequest.attributes["plantingDate"] = plantingDate.ToString();
nbsTargetNRequest.attributes["measurementDate"] = measurementDate.ToString();
- nbsTargetNRequest.attributes["inputType"] = inputType;
nbsTargetNRequest.attributes["purposeType"] = purposeType.ToLower();
nbsTargetNRequest.attributes["targetYield"] = targetYield.ToString();
string itemTaskCode = await _farmmapsApiService.QueueTaskAsync(cropfieldItem.Code, nbsTargetNRequest);