summary on activity list and report activity list

This commit is contained in:
Frede Hundewadt 2023-11-06 14:21:28 +01:00
parent c7e953d874
commit efaf7ec297
10 changed files with 94 additions and 25 deletions

View file

@ -66,6 +66,19 @@
</tr> </tr>
} }
</tbody> </tbody>
<tfoot>
<tr>
<td colspan="5"></td>
<td class="text-end">@(Activities.Sum(x => x.SasAmount))</td>
<td class="text-end">@(Activities.Sum(x => x.OrderAmount))</td>
<td colspan="4"></td>
</tr>
<tr>
<td colspan="6" class="text-end">TOTAL</td>
<td class="text-end">@(Activities.Sum(x => x.SasAmount) + Activities.Sum(x => x.OrderAmount))</td>
<td colspan="4"></td>
</tr>
</tfoot>
</table> </table>

View file

@ -16,7 +16,7 @@
@using Wonky.Client.Helpers @using Wonky.Client.Helpers
@if (ActivityList.Any()) @if (Activities.Any())
{ {
<table class="table table-sm table-bordered table-striped"> <table class="table table-sm table-bordered table-striped">
<thead class="table-light"> <thead class="table-light">
@ -43,7 +43,7 @@
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
@foreach (var activity in ActivityList) @foreach (var activity in Activities)
{ {
<tr class="border-bottom"> <tr class="border-bottom">
<td class="align-middle"> <td class="align-middle">
@ -54,7 +54,7 @@
<td class="align-middle">@activity.Sales</td> <td class="align-middle">@activity.Sales</td>
<td class="align-middle fw-bold">@activity.OfficeNote</td> <td class="align-middle fw-bold">@activity.OfficeNote</td>
<td class="align-middle text-end">@($"{activity.SasAmount:N2}")</td> <td class="align-middle text-end">@($"{activity.SasAmount:N2}")</td>
<td class="align-middle text-end">@(activity.StatusTypeEnum == "Quote" ? $"{0:N2}" : $"{activity.OrderAmount:N2}")</td> <td class="align-middle text-end">@(activity.StatusTypeEnum == "Quote" ? "" : $"{activity.OrderAmount:N2}")</td>
<td class="align-middle text-center"> <td class="align-middle text-center">
@if (activity.OurRef.Contains("T:") || activity.OurRef.Contains("TLF:")) @if (activity.OurRef.Contains("T:") || activity.OurRef.Contains("TLF:"))
{ {
@ -86,6 +86,20 @@
</tr> </tr>
} }
</tbody> </tbody>
<tfoot>
<tr>
<td colspan="5"></td>
<td class="text-end">@(Activities.Sum(x => x.SasAmount))</td>
<td class="text-end">@(Activities.Sum(x => x.OrderAmount))</td>
<td colspan="4"></td>
</tr>
<tr>
<td colspan="6" class="text-end">TOTAL</td>
<td class="text-end">@(Activities.Sum(x => x.SasAmount) + Activities.Sum(x => x.OrderAmount))</td>
<td colspan="4"></td>
</tr>
</tfoot>
</table> </table>
} }
else else

View file

@ -21,7 +21,7 @@ namespace Wonky.Client.Components;
public partial class ReportActivityListOfficeComponent public partial class ReportActivityListOfficeComponent
{ {
[Parameter] public List<ReportItemView> ActivityList { get; set; } = new(); [Parameter] public List<ReportItemView> Activities { get; set; } = new();
[Inject] public NavigationManager Navigator { get; set; } [Inject] public NavigationManager Navigator { get; set; }
private void ShowOrder(string companyId, string orderId) private void ShowOrder(string companyId, string orderId)

View file

@ -121,21 +121,34 @@
<td class="text-center"><i class="bi- @(line.Sas ? "bi-check-square" : "bi-square")"></i></td> <td class="text-center"><i class="bi- @(line.Sas ? "bi-check-square" : "bi-square")"></i></td>
</tr> </tr>
} }
</tbody>
<tfoot>
<tr> <tr>
<td colspan="5"></td> <td colspan="4"></td>
<td>Ordresum</td> <td>SAS</td>
<td class="text-end">@ReportItem.SasAmount</td>
</tr>
<tr>
<td colspan="4"></td>
<td>NORMAL</td>
<td class="text-end">@ReportItem.OrderAmount</td> <td class="text-end">@ReportItem.OrderAmount</td>
</tr> </tr>
<tr>
<td colspan="4"></td>
<td>TOTAL</td>
<td class="text-end">@(ReportItem.SasAmount + ReportItem.OrderAmount)</td>
</tr>
@if (ReportItem.Express) @if (ReportItem.Express)
{ {
<tr> <tr>
<td colspan="4"></td> <td colspan="4"></td>
<td colspan="2"> <td colspan="2">
<h5 class="fw-bold text-end"><i class="bi-lightning-charge the-fast" style="font-size: 1rem;"></i> HASTER</h5> <h5 class="fw-bold text-center"><i class="bi-lightning-charge the-fast" style="font-size: 2rem;"></i> HASTER</h5>
</td> </td>
</tr> </tr>
} }
</tbody> </tfoot>
</table> </table>
@if (!string.IsNullOrWhiteSpace(ReportItem.OfficeNote)) @if (!string.IsNullOrWhiteSpace(ReportItem.OfficeNote))
{ {

View file

@ -113,14 +113,31 @@
<td class="text-end">@($"{line.Price:N2}")</td> <td class="text-end">@($"{line.Price:N2}")</td>
<td class="text-end">@($"{line.Discount:N2}")</td> <td class="text-end">@($"{line.Discount:N2}")</td>
<td class="text-end">@($"{line.LineSum:N2}")</td> <td class="text-end">@($"{line.LineSum:N2}")</td>
<td class="text-center">@if(line.Sas){<i class="bi-check"></i>}</td> <td class="text-center">
@if (line.Sas)
{
<i class="bi-check"></i>
}
</td>
</tr> </tr>
} }
</tbody>
<tfoot>
<tr> <tr>
<td colspan="4"></td> <td colspan="4"></td>
<td>Ordresum</td> <td>SAS</td>
<td class="text-end">@ReportItem.SasAmount</td>
</tr>
<tr>
<td colspan="4"></td>
<td>NORMAL</td>
<td class="text-end">@ReportItem.OrderAmount</td> <td class="text-end">@ReportItem.OrderAmount</td>
</tr> </tr>
<tr>
<td colspan="4"></td>
<td>TOTAL</td>
<td class="text-end">@(ReportItem.SasAmount + ReportItem.OrderAmount)</td>
</tr>
@if (ReportItem.Express) @if (ReportItem.Express)
{ {
<tr> <tr>
@ -130,7 +147,7 @@
</td> </td>
</tr> </tr>
} }
</tbody> </tfoot>
</table> </table>
@* Office Note *@ @* Office Note *@
@if (ReportItem is { ProcessStatusEnum: "None",Express: false } && AllowOfficeNoteUpdate()) @if (ReportItem is { ProcessStatusEnum: "None",Express: false } && AllowOfficeNoteUpdate())

View file

@ -45,6 +45,6 @@
<ReportLedgerDistanceComponent ReportDataView="Report.ReportData"/> <ReportLedgerDistanceComponent ReportDataView="Report.ReportData"/>
</div> </div>
</div> </div>
<ReportActivityListOfficeComponent ActivityList="Report.ReportItems"/> <ReportActivityListOfficeComponent Activities="Report.ReportItems"/>
<ReportLedgerActivityComponent ReportDataView="Report.ReportData"/> <ReportLedgerActivityComponent ReportDataView="Report.ReportData"/>
</div> </div>

View file

@ -54,7 +54,7 @@
<ReportLedgerDistanceComponent ReportDataView="Report.ReportData"/> <ReportLedgerDistanceComponent ReportDataView="Report.ReportData"/>
</div> </div>
</div> </div>
<ReportActivityListOfficeComponent ActivityList="Report.ReportItems"/> <ReportActivityListOfficeComponent Activities="Report.ReportItems"/>
<ReportLedgerActivityComponent ReportDataView="Report.ReportData"/> <ReportLedgerActivityComponent ReportDataView="Report.ReportData"/>
} }
else else

View file

@ -107,6 +107,12 @@ public partial class OfficeCustomerOrderCreatePage : IDisposable
// Initialize date variable // Initialize date variable
SelectedDate = DateTime.Now; SelectedDate = DateTime.Now;
var today = $"{SelectedDate:yyyy-MM-dd}"; var today = $"{SelectedDate:yyyy-MM-dd}";
// assign activity properties
Activity.ActivityVisitEnum = "office";
Activity.ActivityTypeEnum = "phone";
Activity.ActivityStatusEnum = "order";
Activity.Express = true;
Activity.OurRef = $"INNOTEC:{UserInfo.FirstName}";
Activity.ActivityDate = today; Activity.ActivityDate = today;
// initiate a sync to ensure up-to-date product history // initiate a sync to ensure up-to-date product history
if (Company.HistorySync != today) if (Company.HistorySync != today)
@ -149,12 +155,6 @@ public partial class OfficeCustomerOrderCreatePage : IDisposable
Activity.DlvCity = Company.City; Activity.DlvCity = Company.City;
Activity.BcId = Company.BcId; Activity.BcId = Company.BcId;
Activity.CompanyId = Company.CompanyId; Activity.CompanyId = Company.CompanyId;
// assign activity properties
Activity.ActivityVisitEnum = "office";
Activity.ActivityTypeEnum = "phone";
Activity.ActivityStatusEnum = "order";
Activity.Express = true;
Activity.OurRef = $"TLF:{UserInfo.FirstName}";
Working = false; Working = false;
} }

View file

@ -134,11 +134,6 @@
<td class="text-center"><i class="bi- @(line.Sas ? "bi-check-square" : "bi-square")"></i></td> <td class="text-center"><i class="bi- @(line.Sas ? "bi-check-square" : "bi-square")"></i></td>
</tr> </tr>
} }
<tr>
<td colspan="4"></td>
<td>Ordresum</td>
<td class="text-end">@ReportItem.OrderAmount</td>
</tr>
@if (ReportItem.Express) @if (ReportItem.Express)
{ {
<td colspan="4"></td> <td colspan="4"></td>
@ -147,6 +142,23 @@
</td> </td>
} }
</tbody> </tbody>
<tfoot>
<tr>
<td colspan="5" class="text-end">SAS</td>
<td class="text-end">@ReportItem.SasAmount</td>
<td></td>
</tr>
<tr>
<td colspan="5" class="text-end">NORMAL</td>
<td class="text-end">@ReportItem.OrderAmount</td>
<td></td>
</tr>
<tr>
<td colspan="5" class="text-end">TOTAL</td>
<td class="text-end">@(ReportItem.OrderAmount + ReportItem.SasAmount)</td>
<td></td>
</tr>
</tfoot>
</table> </table>
@if (!string.IsNullOrWhiteSpace(ReportItem.OfficeNote)) @if (!string.IsNullOrWhiteSpace(ReportItem.OfficeNote))
{ {

View file

@ -1,7 +1,7 @@
{ {
"appInfo": { "appInfo": {
"name": "Wonky Online", "name": "Wonky Online",
"version": "285.0", "version": "292.0",
"rc": true, "rc": true,
"sandBox": true, "sandBox": true,
"image": "grumpy-coder.png", "image": "grumpy-coder.png",