|
@ -73,11 +73,10 @@ namespace Swift.web.Remit.Transaction.Reports.TransactionNew |
|
|
{ |
|
|
{ |
|
|
string currentPayoutPartner = string.Empty; |
|
|
string currentPayoutPartner = string.Empty; |
|
|
bool isFirstRow = true; |
|
|
bool isFirstRow = true; |
|
|
int[] totalAmountIndexes = { 14, 16, 18, 20, 22 }; |
|
|
|
|
|
|
|
|
int[] totalAmountIndexes = { 13, 15, 16,17, 19, 21}; |
|
|
|
|
|
|
|
|
decimal[] totalAmounts = new decimal[cols]; |
|
|
decimal[] totalAmounts = new decimal[cols]; |
|
|
Array.Clear(totalAmounts, 0, totalAmounts.Length); |
|
|
Array.Clear(totalAmounts, 0, totalAmounts.Length); |
|
|
|
|
|
|
|
|
foreach (DataRow dr in dt.Rows) |
|
|
foreach (DataRow dr in dt.Rows) |
|
|
{ |
|
|
{ |
|
|
string payoutPartner = dr["PAYOUT_PARTNER"].ToString(); |
|
|
string payoutPartner = dr["PAYOUT_PARTNER"].ToString(); |
|
@ -87,15 +86,13 @@ namespace Swift.web.Remit.Transaction.Reports.TransactionNew |
|
|
if (!isFirstRow) |
|
|
if (!isFirstRow) |
|
|
{ |
|
|
{ |
|
|
str.Append("<tr>"); |
|
|
str.Append("<tr>"); |
|
|
|
|
|
|
|
|
str.Append("<td align=\"left\"><b>Total</b></td>"); |
|
|
str.Append("<td align=\"left\"><b>Total</b></td>"); |
|
|
|
|
|
|
|
|
for (int i = 1; i < cols; i++) |
|
|
for (int i = 1; i < cols; i++) |
|
|
{ |
|
|
{ |
|
|
if (totalAmountIndexes.Contains(i)) |
|
|
if (totalAmountIndexes.Contains(i)) |
|
|
{ |
|
|
{ |
|
|
str.Append("<td align=\"left\">" + totalAmounts[i] + "</td>"); |
|
|
str.Append("<td align=\"left\">" + totalAmounts[i] + "</td>"); |
|
|
totalAmounts[i] = 0; |
|
|
|
|
|
|
|
|
totalAmounts[i] = 0; // Reset totalAmount for the new partner
|
|
|
} |
|
|
} |
|
|
else |
|
|
else |
|
|
{ |
|
|
{ |
|
@ -104,7 +101,6 @@ namespace Swift.web.Remit.Transaction.Reports.TransactionNew |
|
|
} |
|
|
} |
|
|
str.Append("</tr>"); |
|
|
str.Append("</tr>"); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
str.Append("<h3><b>Payout Partner: " + payoutPartner + "</b></h3>"); |
|
|
str.Append("<h3><b>Payout Partner: " + payoutPartner + "</b></h3>"); |
|
|
|
|
|
|
|
|
str.Append("<table class='table table-responsive table-bordered'>"); |
|
|
str.Append("<table class='table table-responsive table-bordered'>"); |
|
@ -115,31 +111,26 @@ namespace Swift.web.Remit.Transaction.Reports.TransactionNew |
|
|
currentPayoutPartner = payoutPartner; |
|
|
currentPayoutPartner = payoutPartner; |
|
|
isFirstRow = false; |
|
|
isFirstRow = false; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
str.AppendLine("<tr class=\"" + GetPayStatus(dr["PAYSTATUS"].ToString()) + "\">"); |
|
|
str.AppendLine("<tr class=\"" + GetPayStatus(dr["PAYSTATUS"].ToString()) + "\">"); |
|
|
|
|
|
|
|
|
for (int i = 0; i < cols; i++) |
|
|
for (int i = 0; i < cols; i++) |
|
|
{ |
|
|
{ |
|
|
str.Append("<td align=\"left\">" + dr[i] + "</td>"); |
|
|
str.Append("<td align=\"left\">" + dr[i] + "</td>"); |
|
|
|
|
|
|
|
|
if (totalAmountIndexes.Contains(i)) |
|
|
if (totalAmountIndexes.Contains(i)) |
|
|
{ |
|
|
{ |
|
|
decimal currentAmount; |
|
|
decimal currentAmount; |
|
|
if (decimal.TryParse(dr[i].ToString(), out currentAmount)) |
|
|
if (decimal.TryParse(dr[i].ToString(), out currentAmount)) |
|
|
{ |
|
|
{ |
|
|
totalAmounts[i] += currentAmount; |
|
|
|
|
|
|
|
|
totalAmounts[i] += currentAmount; // Accumulate total amount for each specific column index
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
str.Append("</tr>"); |
|
|
str.Append("</tr>"); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
if (!isFirstRow) |
|
|
if (!isFirstRow) |
|
|
{ |
|
|
{ |
|
|
str.Append("<tr>"); |
|
|
str.Append("<tr>"); |
|
|
|
|
|
|
|
|
str.Append("<td align=\"left\"><b>Total</b></td>"); |
|
|
str.Append("<td align=\"left\"><b>Total</b></td>"); |
|
|
|
|
|
|
|
|
for (int i = 1; i < cols; i++) |
|
|
for (int i = 1; i < cols; i++) |
|
|
{ |
|
|
{ |
|
|
if (totalAmountIndexes.Contains(i)) |
|
|
if (totalAmountIndexes.Contains(i)) |
|
@ -177,7 +168,6 @@ namespace Swift.web.Remit.Transaction.Reports.TransactionNew |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
protected void ExportToExcel(DataTable table, string fileName) |
|
|
protected void ExportToExcel(DataTable table, string fileName) |
|
|
{ |
|
|
{ |
|
|
HttpContext.Current.Response.Clear(); |
|
|
HttpContext.Current.Response.Clear(); |
|
@ -223,6 +213,5 @@ namespace Swift.web.Remit.Transaction.Reports.TransactionNew |
|
|
HttpContext.Current.Response.Flush(); |
|
|
HttpContext.Current.Response.Flush(); |
|
|
HttpContext.Current.Response.End(); |
|
|
HttpContext.Current.Response.End(); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |