Skip to content

Commit

Permalink
Fix for Bug 5391 (#197)
Browse files Browse the repository at this point in the history
  • Loading branch information
Prashanthi-Sivanarayana authored Jul 25, 2024
1 parent c88e554 commit 205133e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using HandlebarsDotNet;

using HandlebarsDotNet;
using Microsoft.Extensions.Options;
using OFM.Infrastructure.WebAPI.Extensions;
using OFM.Infrastructure.WebAPI.Messages;
Expand Down Expand Up @@ -88,6 +89,7 @@ public string RequestPaymentLineUri
<attribute name="ofm_supplierid" />
<attribute name="ofm_invoice_received_date" />
<attribute name="ofm_invoice_date" />
<attribute name="ofm_organization" />
<order attribute="ofm_name" descending="false" />
<filter type="and">
<condition attribute="statuscode" operator="eq" value="{(int)ofm_payment_StatusCode.ApprovedforPayment}" />
Expand Down Expand Up @@ -261,7 +263,7 @@ public async Task<JsonObject> RunProcessAsync(ID365AppUserService appUserService
lineAmount = (lineitem.item.ofm_amount < 0 ? "-" : "") + Math.Abs(lineitem.item.ofm_amount.Value).ToString("0.00", System.Globalization.CultureInfo.InvariantCulture).PadLeft(line.FieldLength("lineAmount") - (lineitem.item.ofm_amount < 0 ? 1 : 0), '0'),// come from split funding amount per facility
lineCode = (lineitem.item.ofm_amount > 0 ? "D" : "C"),//if it is positive then line code is Debit otherwise credit
distributionACK = _BCCASApi.InvoiceLines.distributionACK.PadRight(line.FieldLength("distributionACK")),// using test data shared by CAS,should be changed for prod
lineDescription = string.Concat(lineitem.item?.ofm_application?.ofm_Application, " ", lineitem.item.ofm_payment_type).PadRight(line.FieldLength("lineDescription")), // Pouplate extra info from facility/funding amount
lineDescription = (lineitem.item.ofm_payment_type).ToString().PadRight(line.FieldLength("lineDescription")), // Pouplate extra info from facility/funding amount
effectiveDate = lineitem.item.ofm_effective_date?.ToString("yyyyMMdd"), //2 days after invoice posting
quantity = _BCCASApi.InvoiceLines.quantity,//Static Value:0000000.00 not used by feeder
unitPrice = _BCCASApi.InvoiceLines.unitPrice,//Static Value:000000000000.00 not used by feeder
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ public async Task<JsonObject> RunProcessAsync(ID365AppUserService appUserService
var businessclosuresdata = await GetBusinessClosuresDataAsync();
serializedPayData?.ForEach(async pay =>
{
var line = headers.SelectMany(p => p.feedbackLine).SingleOrDefault(pl => pl.ILInvoice == pay.ofm_invoice_number && pl.ILDescription.StartsWith(string.Concat(pay?.ofm_application?.ofm_Application, " ", pay.ofm_payment_type)));
var line = headers.SelectMany(p => p.feedbackLine).FirstOrDefault(pl => pl.ILInvoice == pay.ofm_invoice_number && pl.ILDescription.Contains(pay?.ofm_payment_type.ToString()));
var header = headers.Where(p => p.IHInvoice == pay.ofm_invoice_number).FirstOrDefault();

List<DateTime> holidaysList = GetStartTimes(businessclosuresdata.Data.ToString());
Expand All @@ -267,7 +267,7 @@ public async Task<JsonObject> RunProcessAsync(ID365AppUserService appUserService
{
var subject = pay.ofm_name;
//create Integration log with an error message.
createIntregrationLogTasks.Add(CreateIntegrationErrorLog(subject, pay.ofm_application.ofm_applicationid.GetValueOrDefault(), casResponse, "CFS Integration Error", appUserService, d365WebApiService));
createIntregrationLogTasks.Add(CreateIntegrationErrorLog(subject, pay.ofm_application.ofm_applicationid.GetValueOrDefault(), casResponse, "CFS Integration Error", appUserService, d365WebApiService));
}

//Update it with latest cas response.
Expand Down

0 comments on commit 205133e

Please sign in to comment.