expanded info pages - working with create activity overlays

- customer products
- customer visits
- customer invoices
This commit is contained in:
Frede Hundewadt 2023-01-20 11:34:48 +01:00
parent baad231113
commit 8216659360
19 changed files with 270 additions and 65 deletions

View file

@ -0,0 +1,47 @@
<h3>Sælger</h3>
<table class="table">
<thead>
<tr>
<th>Symbol</th>
<th>Betydning</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<i class="bi-calendar" style="font-size:1.3rem"></i>
</td>
<td>ToDo liste</td>
</tr>
<tr>
<td>
<i class="bi-file-spreadsheet" style="font-size:1.3rem"></i>
</td>
<td>Pris katalog</td>
</tr>
<tr>
<td>
<i class="bi-building" style="font-size:1.3rem"></i>
</td>
<td>Firmaer/Kunder</td>
</tr>
<tr>
<td>
<i class="bi-calculator" style="font-size:1.3rem"></i>
</td>
<td>Aftaler/Tilbud</td>
</tr>
<tr>
<td>
<i class="bi-activity" style="font-size:1.3rem"></i>
</td>
<td>Aktivitet</td>
</tr>
<tr>
<td>
<i class="bi-file-earmark-spreadsheet" style="font-size:1.3rem"></i>
</td>
<td>Dagsrapporter</td>
</tr>
</tbody>
</table>

View file

@ -0,0 +1,37 @@
<h3>Fælles</h3>
<table class="table">
<thead>
<tr>
<th>Symbol</th>
<th>Betydning</th>
</tr>
<tr>
<td><i class="bi-cloud-arrow-up" style="font-size:1.3rem"></i></td>
<td>Gem data</td>
</tr>
<tr>
<td><i class="bi-search" style="font-size:1.3rem"></i></td>
<td>Søg data</td>
</tr>
<tr>
<td><i class="bi-plus" style="font-size:1.3rem"></i></td>
<td>Opret ny</td>
</tr>
<tr>
<td><i class="bi-printer" style="font-size:1.3rem"></i></td>
<td>Udskrivning</td>
</tr>
<tr>
<td><i class="bi-sliders" style="font-size:1.3rem"></i></td>
<td>Indstillinger</td>
</tr>
<tr>
<td><i class="bi-lock" style="font-size:1.3rem"></i></td>
<td>Log af</td>
</tr>
<tr>
<td><i class="bi-question" style="font-size:1.3rem"></i></td>
<td>Hjælp/Info</td>
</tr>
</thead>
</table>

View file

@ -0,0 +1,23 @@
<h3>Kontor</h3>
<table class="table">
<thead>
<tr>
<th>Symbol</th>
<th>Betydning</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<i class="bi-people" style="font-size:1.3rem"></i>
</td>
<td>Brugere</td>
</tr>
<tr>
<td>
<i class="bi-box" style="font-size:1.3rem"></i>
</td>
<td>Pakning / Forsendelse</td>
</tr>
</tbody>
</table>

View file

@ -0,0 +1,17 @@
<h3>Lager</h3>
<table class="table">
<thead>
<tr>
<th>Symbol</th>
<th>Betydning</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<i class="bi-box" style="font-size:1.3rem"></i>
</td>
<td>Pakning / Forsendelse</td>
</tr>
</tbody>
</table>

View file

@ -1,5 +0,0 @@
<h3>CustomerInvoiceOverlay</h3>
@code {
}

View file

@ -1,6 +0,0 @@
namespace Wonky.Client.Overlays;
public partial class CustomerInvoiceOverlay
{
}

View file

@ -34,7 +34,7 @@
<h4>Ring til kontoret. Denne konto er spærret med kode '@Company.Blocked'</h4>
</div>
}
<div class="row bg-light border-1 border-dark rounded-3 p-3">
<div class="row mb-2 bg-dark text-white rounded-3 p-3">
<div class="col">
<h3>@Activity.Name - @Activity.Account</h3>
</div>
@ -54,7 +54,7 @@ else
<EditForm EditContext="ActivityContext">
<DataAnnotationsValidator/>
<div class="row mb-1 g-2">
<div class="row mb-3 g-2">
<label for="activityType" class="col-sm-2 col-form-label-sm">Ordre Type</label>
<div class="col-sm-4">
<InputSelect id="activityType" class="form-select bg-primary text-bg-primary" @bind-Value="@Activity.ActivityTypeEnum">
@ -124,18 +124,6 @@ else
<ValidationMessage For="@(() => Activity.YourRef)"></ValidationMessage>
</div>
<label for="orderMessage" class="col-sm-2 col-form-label-sm">Note /Kontor</label>
<div class="col-sm-4">
<InputTextArea id="orderMessage" class="form-control" @bind-Value="Activity.OrderMessage"/>
<ValidationMessage For="@(() => Activity.OrderMessage)"></ValidationMessage>
</div>
<label for="crmNote" class="col-sm-2 col-form-label-sm">Note /Selv</label>
<div class="col-sm-4">
<InputTextArea id="crmNote" class="form-control" @bind-Value="Activity.CrmNote"/>
<ValidationMessage For="@(() => Activity.CrmNote)"></ValidationMessage>
</div>
<label for="attention" class="col-sm-2 col-form-label-sm">Att.</label>
<div class="col-sm-4">
<InputText id="attention" class="form-control" @bind-Value="Activity.Attention"/>
@ -148,22 +136,35 @@ else
<ValidationMessage For="@(() => Activity.Phone)"></ValidationMessage>
</div>
<label for="vatNumber" class="col-sm-2 col-form-label-sm">Org.nr.</label>
<label for="orderMessage" class="col-sm-2 col-form-label-sm">Note /Kontor</label>
<div class="col-sm-4">
<InputText hidden="vatNumber" class="form-control" @bind-Value="Activity.VatNumber" />
<InputTextArea id="orderMessage" class="form-control" @bind-Value="Activity.OrderMessage"/>
<ValidationMessage For="@(() => Activity.OrderMessage)"></ValidationMessage>
</div>
<label for="crmNote" class="col-sm-2 col-form-label-sm">Note /Selv</label>
<div class="col-sm-4">
<InputTextArea id="crmNote" class="form-control" @bind-Value="Activity.CrmNote"/>
<ValidationMessage For="@(() => Activity.CrmNote)"></ValidationMessage>
</div>
<div class="col-sm-6"></div>
<label for="vatNumber" class="col-sm-2 col-form-label-sm">Cvr/Org nr.</label>
<div class="col-sm-4">
<InputText id="vatNumber" class="form-control" @bind-Value="Activity.VatNumber" />
<ValidationMessage For="@(() => Activity.VatNumber)" />
</div>
</div>
<div class="row">
<div class="col-sm-4">
<button class="btn btn-danger">Faktura</button>
<div class="row g-2">
<div class="col-sm-4 d-grid mx-auto">
<button class="btn btn-danger" disabled>Faktura</button>
</div>
<div class="cols-sm-3">
<button class="btn btn-warning">Tidl. besøg</button>
<div class="col-sm-4 d-grid mx-auto">
<button class="btn btn-warning" disabled>Tidl. besøg</button>
</div>
<div class="col-sm-4">
<button class="btn btn-success">Produkter</button>
<div class="col-sm-4 d-grid mx-auto">
<button class="btn btn-success" disabled>Produkter</button>
</div>
</div>
@ -330,7 +331,7 @@ else
<a class="btn btn-warning" href="/advisor/customers/@Company.CompanyId">Kundekort <i class="bi-arrow-left"></i></a>
</div>
<div class="col-sm-4 text-end">
<button type="button" class="btn btn-warning" @onclick="CallConfirmProductCheckModel" disabled="@(PoFormInvalid || Working)"><i class="bi-save-fill"></i> @ButtonText</button>
<button type="button" class="btn btn-warning" @onclick="CallConfirmProductCheckModel" disabled="@(PoFormInvalid || Working)"><i class="bi-cloud-arrow-up"></i> @ButtonText</button>
</div>
</div>
}

View file

@ -67,7 +67,6 @@ public partial class AdvisorActivityCreatePage : IDisposable
private UserInfoView SalesRep { get; set; } = new();
private DateTime SelectedDate { get; set; }
private string OldPhone { get; set; } = "";
private string PromptDateConfirm { get; set; } = "";
// MODAL DIALOGS
private PriceCatalogModal PriceCatalogModal { get; set; } = new();
@ -77,6 +76,7 @@ public partial class AdvisorActivityCreatePage : IDisposable
private ConfirmProductCheckModal ConfirmProductCheckModal { get; set; } = new();
private List<ProductInventoryView> CheckList { get; set; } = new();
private string ButtonText { get; set; } = "Gem besøg";
private bool OrgWarning { get; set; }
/// <summary>
@ -152,13 +152,19 @@ public partial class AdvisorActivityCreatePage : IDisposable
PoFormInvalid = false;
}
Working = false;
//StateHasChanged();
if (Company.CountryCode.ToLower() == "se" && VatUtils.SanitizeVatNumber(Activity.VatNumber).Length < 10)
{
Toaster.ShowWarning("Organisationsnummer skal opdateres.");
}
}
private void ShowOrgWarning()
{
if (OrgWarning)
return;
OrgWarning = true;
if (Company.CountryCode.ToLower() == "se" && VatUtils.SanitizeVatNumber(Activity.VatNumber).Length < 10 && Activity.ActivityStatusEnum == "order")
{
Toaster.ShowWarning("Org nummer er ufuldstændig. Skal opdateres før bestilling kan sendes. ", "ADVARSEL");
}
}
private async Task CallConfirmProductCheckModel()
{
// check if new account
@ -464,12 +470,11 @@ public partial class AdvisorActivityCreatePage : IDisposable
DraftProvider.Draft.Items = new List<DraftItem>();
}
ButtonText = Activity.ActivityStatusEnum switch
ButtonText = Activity.ActivityStatusEnum.ToLower() switch
{
"noSale" => "Gem Besøg",
"order" => "Gem Bestilling",
"quote" => "Gem Tilbud",
_ => ButtonText
"nosale" => "Gem Besøg",
"order" => "Send Bestilling",
"quote" => "Send Tilbud"
};
// InvalidCanvas = InvalidActivityType;
@ -499,12 +504,16 @@ public partial class AdvisorActivityCreatePage : IDisposable
PoFormInvalid = true;
return;
}
if (Company.CountryCode.ToLower() == "se" && VatUtils.SanitizeVatNumber(Activity.VatNumber).Length < 10)
if (Activity.ActivityStatusEnum.ToLower() is "order" or "quote"
&& Company.CountryCode.ToLower() == "se"
&& VatUtils.SanitizeVatNumber(Activity.VatNumber).Length < 10)
{
ShowOrgWarning();
PoFormInvalid = true;
return;
}
PoFormInvalid = false;
ActivityContext.OnFieldChanged -= HandleFieldChanged;
ActivityContext.OnValidationStateChanged -= ValidationChanged;

View file

@ -31,7 +31,20 @@
<div class="row g-2">
@* vat lookup *@
<div class="col-sm-12 text-end">
<button type="button" class="btn btn-primary" @onclick="CallVatLookupModal">CVR opslag</button>
<div class="d-grid mx-auto">
@switch (Company.CountryCode)
{
case "dk":
<button type="button" class="btn btn-info" @onclick="CallVatLookupModal"><i class="bi-search"></i> Firma søgning</button>
break;
case "no":
<a class="btn btn-info" href="https://brreg.no/" target="_blank"><i class="bi-search"></i> Firma søgning</a>
break;
case "se":
<a class="btn btn-info" href="https://www.allabolag.se/@(string.IsNullOrWhiteSpace(Company.Name) ? "" : "what/@Company.Name")" target="_blank"><i class="bi-search"></i> Firma søgning</a>
break;
}
</div>
</div>
@* entity name *@
<label for="name" class="col-sm-1 col-form-label-sm">Navn</label>
@ -70,7 +83,7 @@
<ValidationMessage For="@(() => Company.City)"></ValidationMessage>
</div>
@* entity vat number *@
<label for="vatNumber" class="col-sm-1 col-form-label-sm">Moms Nr</label>
<label for="vatNumber" class="col-sm-1 col-form-label-sm">Cvr/Org Nr.</label>
<div class="col-sm-3">
<div class="input-group">
<span class="input-group-text">
@ -100,7 +113,7 @@
</div>
</div>
<hr class="mb-3"/>
<div class="row g-2">
<div class="row g-2 mb-3">
<label for="note" class="col-sm-1 col-form-label-sm">OBS</label>
<div class="col-sm-5">
<InputText id="note" class="form-control" @bind-Value="Company.Note"/>
@ -125,7 +138,7 @@
</div>
</div>
<div class="row mb-3">
<div class="col-sm-12 text-end">
<div class="col-sm-12 d-grid mx-auto">
<button type="submit" class="btn btn-success" disabled="@FormInvalid">Opret</button>
</div>
</div>

View file

@ -23,9 +23,9 @@ public partial class AdvisorCustomerInvoiceListPage : IDisposable
[Inject] private ILogger<AdvisorCustomerInvoiceListPage> Logger { get; set; }
private InvoiceListView CompanyInvoices { get; set; } = new();
private CompanyDto Company { get; set; } = new();
private bool Working { get; set; }
private InvoiceViewModal InvoiceView { get; set; } = new();
private string InvoiceId { get; set; } = "";
private bool Working { get; set; }
private bool AllSet { get; set; }
private string _companyId = "";

View file

@ -95,7 +95,7 @@
<button type="button" class="btn btn-primary d-block" disabled="@(Company.HasFolded == 0 || Company.Name == "ERROR")" onclick="@ForceActivity">Aktiver besøg</button>
</div>
<div class="col-sm-2 d-grid mx-auto">
<button type="button" class="btn btn-primary d-block" onclick="@UpdateErpData" disabled="@(Working || Company.Name == "ERROR")"><i class="bi-save"></i> STAM data </button>
<button type="button" class="btn btn-primary d-block" onclick="@UpdateErpData" disabled="@(Working || Company.Name == "ERROR")"><i class="bi-cloud-arrow-up"></i> STAM data </button>
</div>
@* account *@
@ -104,7 +104,7 @@
<input id="account" type="text" class="form-control" readonly value="@Company.Account"/>
</div>
@* vat number*@
<label for="vatNumber" class="col-sm-1 col-form-label-sm">Moms Nr</label>
<label for="vatNumber" class="col-sm-1 col-form-label-sm">Cvr/Org nr.</label>
<div class="col-sm-4">
<div class="input-group">
<span class="input-group-text">
@ -131,7 +131,7 @@
</div>
@* save vat number *@
<div class="col-sm-2 d-grid mx-auto">
<button type="button" class="btn btn-primary d-block" @onclick="UpdateVatNumber"><i class="bi-save"></i> MOMS Nr.</button>
<button type="button" class="btn btn-primary d-block" @onclick="UpdateVatNumber"><i class="bi-cloud-arrow-up"></i> Moms/Org Nr.</button>
</div>
</div>
@ -173,7 +173,7 @@
</div>
@* Save CRM data button *@
<div class="col-sm-2 d-grid mx-auto">
<button type="button" class="btn btn-primary" disabled="@(Company.Name == "ERROR")" @onclick="UpdateCrmData"><i class="bi-save"></i> CRM data</button>
<button type="button" class="btn btn-primary" disabled="@(Company.Name == "ERROR")" @onclick="UpdateCrmData"><i class="bi-cloud-arrow-up"></i> CRM data</button>
</div>
</div>
@* crm context - contacts *@

View file

@ -39,11 +39,23 @@
<InfoColorPackageComponent/>
</div>
<div class="col-sm-12 col-md-6">
<InfoQuoteToolbarComponent/>
<InfoCommonComponent />
</div>
<div class="col-sm-12 col-md-6">
<InfoProcessStateComponent />
</div>
<div class="col-sm-12 col-md-6">
<InfoAdvisorComponent />
</div>
<div class="col-sm-12 col-md-6">
<InfoQuoteToolbarComponent/>
</div>
<div class="col-sm-12 col-md-6">
<InfoOfficeComponent />
</div>
<div class="col-sm-12 col-md-6">
<InfoWarehouseComponent />
</div>
<div class="col-sm-12 col-md-6">
<InfoBrowserComponent />
</div>

View file

@ -0,0 +1,20 @@
<div class="modal" tabindex="-1" role="dialog" style="display:@_modalDisplay">
<div class="modal-dialog modal-dialog-scrollable modal-fullscreen-lg-down modal-xl modal-lg">
<div class="row pt-2 pb-1 rounded-2 bg-dark text-white">
<div class="col-sm-6">
<h4 class="pt-1">@Company.Name</h4>
</div>
<div class="col-sm-3 align-content-end">
<a class="btn btn-primary d-block" href="/advisor/customers/@Company.CompanyId"><i class="bi-arrow-right"></i> Kundekort</a>
</div>
<div class="col-sm-3 align-content-end">
<a class="btn btn-primary d-block" href="/advisor/customers/@Company.CompanyId/activities/new"><i class="bi-arrow-right"></i> Besøg</a>
</div>
</div>
<CustomerInvoiceListComponent OnShowInvoice="CallInvoiceModal" CompanyId="@Company.CompanyId" InvoiceList="@CompanyInvoices.Invoices"/>
<InvoiceViewModal CompanyId="@Company.CompanyId" InvoiceId="@InvoiceId" @ref="InvoiceView" />
</div>
</div>

View file

@ -0,0 +1,31 @@
using Microsoft.AspNetCore.Components;
using Wonky.Entity.DTO;
using Wonky.Entity.Views;
namespace Wonky.Client.Shared;
public partial class CustomerInvoiceOverlay
{
[Parameter] public InvoiceListView CompanyInvoices { get; set; } = new();
[Parameter] public CompanyDto Company { get; set; } = new();
[Parameter] public InvoiceViewModal InvoiceView { get; set; } = new();
private string InvoiceId { get; set; } = "";
private string _modalDisplay = "";
private bool _showBackdrop;
public void Show()
{
_modalDisplay = "block;";
_showBackdrop = true;
StateHasChanged();
}
private void Hide()
{
_modalDisplay = "none;";
_showBackdrop = false;
StateHasChanged();
}
}

View file

@ -92,14 +92,16 @@
<i class="bi-file-earmark-spreadsheet pe-2" style="font-size:1.3em;" aria-hidden="true"></i> Dagsrapporter
</NavLink>
</div>
<div class="nav-item px-3">
<NavLink class="nav-link ps-2" href="/info">
<i class="bi-question pe-2" style="font-size:1.3em;" aria-hidden="true"></i> Hjælp
</NavLink>
</div>
</Authorized>
</AuthorizeView>
<AuthorizeView Roles="Admin,Advisor,Office,Supervisor,Warehouse">
<div class="nav-item px-3">
<NavLink class="nav-link ps-2" href="/info">
<i class="bi-question pe-2" style="font-size:1.3em;" aria-hidden="true"></i> Hjælp
</NavLink>
</div>
</AuthorizeView>
</nav>
</div>

View file

@ -3795,4 +3795,8 @@
<None Remove="wwwroot\icons\**" />
</ItemGroup>
<ItemGroup>
<Folder Include="Overlays" />
</ItemGroup>
</Project>

View file

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