This commit is contained in:
Frede Hundewadt 2022-06-30 13:47:01 +02:00
parent 08963a1d8b
commit 23c492b637
13 changed files with 275 additions and 80 deletions

View file

@ -17,9 +17,9 @@
@if (Activities.Any())
{
<table class="table">
<table class="table table-bordered d-print-table table-striped">
<thead>
<tr class="bg-black opacity-75 text-white">
<tr class="bg-black opacity-75 text-white border-bottom">
<th scope="col">Besøg</th>
<th scope="col">Demo</th>
<th scope="col">Salg</th>

View file

@ -15,9 +15,9 @@
//
*@
<table class="table table-striped">
<table class="table table-bordered table-striped d-print-table">
<thead>
<tr class="bg-dark text-white opacity-75">
<tr class="bg-dark text-white opacity-75 border-bottom">
<th></th>
<th class="text-center" colspan="2" scope="col">Dagens Demo @(Report.NewDemoCount + Report.RecallDemoCount)</th>
<th class="text-center border-end" colspan="2" scope="col">Dagens Resultat</th>
@ -25,7 +25,7 @@
</tr>
</thead>
<tbody>
<tr class="bg-dark bg-opacity-50">
<tr class="bg-dark bg-opacity-50 border-bottom">
<td></td>
<th class="text-end text-white" scope="col">Besøg</th>
<th class="text-end text-white" scope="col">Demo</th>
@ -82,9 +82,9 @@
</tr>
</tbody>
</table>
<table class="table">
<table class="table table-bordered table-striped d-print-table">
<thead>
<tr class="bg-dark text-white opacity-75">
<tr class="bg-dark text-white opacity-75 border-bottom-0">
<th scope="col">
Km Aften
</th>
@ -116,20 +116,18 @@
</tr>
</tbody>
</table>
@if (!string.IsNullOrWhiteSpace(Report.Description) || !string.IsNullOrWhiteSpace(Report.SupervisedBy))
{
<table class="table">
<thead>
<tr class="bg-black text-white opacity-75">
<th class="w-50" scope="col">Tekst</th>
<th class="w-50" scope="col">Medkørende Supervisor</th>
</tr>
</thead>
<tbody>
<tr>
<td>@Report.Description</td>
<td>@Report.SupervisedBy</td>
</tr>
</tbody>
</table>
}
<table class="table table-bordered table-striped d-print-table">
<thead>
<tr class="bg-black text-white opacity-75 border-bottom">
<th class="w-50" scope="col">Beskrivelse</th>
<th scope="col">Medkørende Supervisor</th>
</tr>
</thead>
<tbody>
<tr>
<td>@Report.Description</td>
<td>@Report.SupervisedBy</td>
</tr>
</tbody>
</table>

View file

@ -18,6 +18,8 @@
@using System.Security.Claims
<AuthorizeView>
<Authorized>
@context.User.Identity?.Name
<div class="d-print-none">
@context.User.Identity?.Name
</div>
</Authorized>
</AuthorizeView>

View file

@ -18,7 +18,9 @@
@using System.Security.Claims
<AuthorizeView>
<Authorized>
<a class="btn btn-outline-light" href="logout">LOG AF</a>
<a class="btn btn-outline-light" href="info">HJÆLP</a>
<div class="d-print-none">
<a class="btn btn-outline-light" href="logout">LOG AF</a>
<a class="btn btn-outline-light" href="info">HJÆLP</a>
</div>
</Authorized>
</AuthorizeView>

View file

@ -52,7 +52,7 @@
<div class="col-md-4">
<InputSelect id="statusType" class="form-select" @bind-Value="@_draft.ActivityStatusEnum">
<option value="noSale" selected>Ingen salg</option>
@if (!string.IsNullOrEmpty(_draft.VatNumber))
@if (!string.IsNullOrEmpty(_draft.VatNumber) && string.IsNullOrWhiteSpace(_draft.Address1))
{
<option value="order">Bestilling</option>
<option value="quote">Tilbud</option>
@ -70,43 +70,38 @@
</div>
<label for="email" class="col-md-2 col-form-label">Epost</label>
<div class="col-md-4">
<InputText id="email" class="form-control" @bind-Value="_draft.EMail"/>
<ValidationMessage For="@(() => _draft.EMail)"></ValidationMessage>
<InputText id="email" class="form-control" @bind-Value="_draft.Email"/>
<ValidationMessage For="@(() => _draft.Email)"></ValidationMessage>
</div>
</div>
<div class="row mb-1">
<label for="referenceNumber" class="col-md-2 col-form-label">Rekvisition</label>
<div class="col-md-4">
<InputText id="referenceNumber" class="form-control"
@bind-Value="_draft.ReferenceNumber"v/>
<InputText id="referenceNumber" class="form-control" @bind-Value="_draft.ReferenceNumber"/>
<ValidationMessage For="@(() => _draft.ReferenceNumber)"></ValidationMessage>
</div>
<label for="yourRef" class="col-md-2 col-form-label">Indkøber</label>
<div class="col-md-4">
<InputText id="yourRef" class="form-control"
@bind-Value="_draft.YourRef"/>
<InputText id="yourRef" class="form-control" @bind-Value="_draft.YourRef"/>
<ValidationMessage For="@(() => _draft.YourRef)"></ValidationMessage>
</div>
</div>
<div class="row mb-1">
<label for="orderMessage" class="col-md-2 col-form-label">Note /Kontor</label>
<div class="col-md-4">
<InputTextArea id="orderMessage" class="form-control"
@bind-Value="_draft.OrderMessage"/>
<InputTextArea id="orderMessage" class="form-control" @bind-Value="_draft.OrderMessage"/>
<ValidationMessage For="@(() => _draft.OrderMessage)"></ValidationMessage>
</div>
<label for="crmNote" class="col-md-2 col-form-label">Note /Mig</label>
<label for="crmNote" class="col-md-2 col-form-label">Note /Selv</label>
<div class="col-md-4">
<InputTextArea id="crmNote" class="form-control"
@bind-Value="_draft.CrmNote"/>
<InputTextArea id="crmNote" class="form-control" @bind-Value="_draft.CrmNote"/>
<ValidationMessage For="@(() => _draft.CrmNote)"></ValidationMessage>
</div>
</div>
<div class="row mb-1">
<label for="attention" class="col-md-2 col-form-label">Att.</label>
<div class="col-md-4">
<InputText id="attention" class="form-control"
@bind-Value="_draft.Attention"/>
<InputText id="attention" class="form-control" @bind-Value="_draft.Attention"/>
<ValidationMessage For="@(() => _draft.Attention)"></ValidationMessage>
</div>
</div>

View file

@ -118,7 +118,7 @@ public partial class ActivityVisitNew : IDisposable
_draft.SalesRep = _ux.Adviser;
_draft.Account = _company.Account;
_draft.VatNumber = _company.VatNumber;
_draft.EMail = _company.Email;
_draft.Email = _company.Email;
_draft.Phone = _company.Phone;
_draft.Mobile = _company.Mobile;
@ -146,9 +146,14 @@ public partial class ActivityVisitNew : IDisposable
private async Task CreateActivity()
{
if (string.IsNullOrWhiteSpace(_draft.Address1))
{
_toast.ShowError("Kunde adresse er ufuldstændig.");
return;
}
HideButtons = true;
_draft.ActivityDate = _prefs.WorkDate;
var activityType = _draft.ActivityTypeEnum switch
{
"phone" => "T:",
@ -279,7 +284,7 @@ public partial class ActivityVisitNew : IDisposable
InvalidActivity = InvalidActivityType
|| _poFormInvalid
|| DraftStateProvider.Draft.Items.Count == 0
|| (_draft.ActivityStatusEnum == "offer" && string.IsNullOrWhiteSpace(_draft.EMail));
|| (_draft.ActivityStatusEnum == "offer" && string.IsNullOrWhiteSpace(_draft.Email));
if (InvalidActivity)
{

View file

@ -20,18 +20,23 @@
@page "/admin/users/advisers/{CountryCode}/{UserId}/reports/{ReportDate}"
@attribute [Authorize(Roles = "Admin")]
<PageTitle>@_report.Report.Name</PageTitle>
<div class="card">
<div class="card-header">
<div class="row">
<div class="col">
<div class="col d-print-none">
@if (!string.IsNullOrWhiteSpace(ReportDate))
{
<h3 class="workDate">@DateTime.Parse(ReportDate).ToLongDateString()</h3>
}
</div>
<div class="col">
<div class="col d-print-none">
<WorkDateComponent OnChanged="GetReport"></WorkDateComponent>
</div>
<div class="col d-none d-print-block">
<h3>@_report.Report.Name</h3>
</div>
</div>
</div>
<div class="card-body">

View file

@ -20,18 +20,23 @@
@page "/sales-reports/view/{ReportDate}"
@attribute [Authorize(Roles = "Adviser,Admin,Supervisor")]
<PageTitle>@_report.Report.Name</PageTitle>
<div class="card">
<div class="card-header">
<div class="card-header bg-dark text-white">
<div class="row">
<div class="col">
<div class="col d-print-none">
@if (!string.IsNullOrWhiteSpace(ReportDate))
{
<h3 class="workDate">@DateTime.Parse(ReportDate).ToLongDateString()</h3>
}
</div>
<div class="col">
<div class="col d-print-none">
<WorkDateComponent OnChanged="GetReport"></WorkDateComponent>
</div>
<div class="col d-none d-print-block">
<h3>@_report.Report.Name</h3>
</div>
</div>
</div>
<div class="card-body">

View file

@ -18,16 +18,17 @@
@using Wonky.Client.Components
<div class="page">
<div class="sidebar">
<div class="sidebar d-print-none">
<NavMenu />
</div>
<main>
<div class="top-row px-4">
<div class="top-row px-4 d-print-none">
<TopbarNavigation />
</div>
<div class="content px-4">
<div class="content px-4 d-print-none">
@Body
</div>
<div class="content d-none d-print-block">
@Body
</div>
<BlazoredToasts Position="ToastPosition.BottomCenter" Timeout="2"/>

View file

@ -1,7 +1,7 @@
{
"appInfo": {
"name": "Wonky Client",
"version": "0.8.59",
"version": "0.8.63",
"isBeta": true,
"image": "grumpy-coder.png"
},

View file

@ -0,0 +1,30 @@
@font-face {
font-family: 'Montserrat';
src: url('https://fonts.googleapis.com/css2?family=Montserrat&display=swap');
}
/* printer classes */
@media print {
html, body {
height: 290mm;
width: 210mm;
-webkit-print-color-adjust: exact;
color-adjust: exact;
}
.content {
padding: 0;
}
.page {
font-size: 10px;
border: initial;
border-radius: initial;
box-shadow: initial;
margin: 0;
min-height: initial;
page-break-after: always;
width: initial;
-webkit-print-color-adjust: exact;
color-adjust: exact;
}
}

View file

@ -15,10 +15,11 @@
<meta name="msapplication-TileColor" content="#ffaa00">
<meta name="theme-color" content="#000">
<base href="/" />
<link href="/bootstrap/css/bootstrap.min.css" rel="stylesheet">
<link href="bootstrap/css/bootstrap.min.css" rel="stylesheet">
<link href="css/app.css" rel="stylesheet" />
<link href="Wonky.Client.styles.css" rel="stylesheet" />
<link href="_content/Blazored.Toast/blazored-toast.min.css" rel="stylesheet" />
<link href="css/report-print.css" rel="stylesheet" />
</head>
<body>
<div id="app">

View file

@ -19,39 +19,190 @@ namespace Wonky.Entity.DTO
{
public class ActivityDto
{
/// <summary>
/// Sælger nummer
/// </summary>
public string SalesRep { get; set; } = "";
/// <summary>
/// Sælger Id
/// </summary>
public string SalesRepId { get; set; } = "";
/// <summary>
/// Kunde Id - ej konto
/// </summary>
public string CompanyId { get; set; } = "";
/// <summary>
/// business central Id
/// </summary>
public string BcId { get; set; } = "";
/// <summary>
/// konto
/// </summary>
public string Account { get; set; } = "";
[MaxLength(20, ErrorMessage = "Du kan højst bruge 20 tegn")] public string VatNumber { get; set; } = "";
[MaxLength(100, ErrorMessage = "Du kan højst bruge 100 tegn")] public string Name { get; set; } = "";
[MaxLength(30, ErrorMessage = "Du kan højst bruge 30 tegn")] public string City { get; set; }= "";
[MaxLength(20, ErrorMessage = "Du kan højst bruge 20 tegn")] public string ZipCode { get; set; } = "";
[MaxLength(100, ErrorMessage = "Du kan højst bruge 100 tegn")] public string Address1 { get; set; } = "";
[MaxLength(50, ErrorMessage = "Du kan højst bruge 50 tegn")] public string Address2 { get; set; } = "";
[MaxLength(20, ErrorMessage = "Du kan højst bruge 20 tegn")] public string Phone { get; set; } = "";
[MaxLength(20, ErrorMessage = "Du kan højst bruge 20 tegn")] public string Mobile { get; set; } = "";
[MaxLength(80, ErrorMessage = "Du kan højst bruge 80 tegn")] public string EMail { get; set; } = "";
[MaxLength(100, ErrorMessage = "Du kan højst bruge 100 tegn")] public string Attention { get; set; } = "";
/// <summary>
/// moms nummer
/// </summary>
[MaxLength(20, ErrorMessage = "Du kan højst bruge 20 tegn")]
public string VatNumber { get; set; } = "";
/// <summary>
/// firma navn
/// </summary>
[Required(ErrorMessage = "Navn skal udfyldes")]
[MaxLength(100, ErrorMessage = "Du kan højst bruge 100 tegn")]
public string Name { get; set; } = "";
/// <summary>
/// firma adresse bynavn
/// </summary>
[Required(ErrorMessage = "Byanvn skal udfyldes")]
[MaxLength(30, ErrorMessage = "Du kan højst bruge 30 tegn")]
public string City { get; set; }= "";
/// <summary>
/// firma adresse postnummer
/// </summary>
[Required(ErrorMessage = "Postnr. skal udfyldes")]
[MaxLength(20, ErrorMessage = "Du kan højst bruge 20 tegn")]
public string ZipCode { get; set; } = "";
/// <summary>
/// firma adresse linje 1
/// </summary>
[MaxLength(100, ErrorMessage = "Du kan højst bruge 100 tegn")]
public string Address1 { get; set; } = "";
/// <summary>
/// firma adresse linje 2
/// </summary>
[MaxLength(50, ErrorMessage = "Du kan højst bruge 50 tegn")]
public string Address2 { get; set; } = "";
/// <summary>
/// firma telefon
/// </summary>
[MaxLength(20, ErrorMessage = "Du kan højst bruge 20 tegn")]
public string Phone { get; set; } = "";
/// <summary>
/// firma mobil telefon
/// </summary>
[MaxLength(20, ErrorMessage = "Du kan højst bruge 20 tegn")]
public string Mobile { get; set; } = "";
/// <summary>
/// firma email
/// </summary>
[MaxLength(80, ErrorMessage = "Du kan højst bruge 80 tegn")]
public string Email { get; set; } = "";
/// <summary>
/// firma attention
/// </summary>
[MaxLength(100, ErrorMessage = "Du kan højst bruge 100 tegn")]
public string Attention { get; set; } = "";
// Form entries
[Required(ErrorMessage = "Vælg aktivitetstype")] public string ActivityTypeEnum { get; set; } = "";
[Required(ErrorMessage = "Vælg status for besøg ")] public string ActivityStatusEnum { get; set; } = "";
/// <summary>
/// aktivitetstype
/// </summary>
[Required(ErrorMessage = "Vælg aktivitetstype")]
public string ActivityTypeEnum { get; set; } = "";
/// <summary>
/// acktivitet status
/// </summary>
[Required(ErrorMessage = "Vælg status for besøg ")]
public string ActivityStatusEnum { get; set; } = "";
/// <summary>
/// besøg type
/// </summary>
public string VisitTypeEnum { get; set; } = "recall";
[Required] public string ActivityDate { get; set; } = "";
[MaxLength(50, ErrorMessage = "Du kan højst bruge 50 tegn")] public string Demo { get; set; } = "";
[MaxLength(20, ErrorMessage = "Du kan højst bruge 20 tegn")] public string OurRef { get; set; } = "";
[MaxLength(20, ErrorMessage = "Du kan højst bruge 20 tegn")] public string ReferenceNumber { get; set; } = "";
[MaxLength(35, ErrorMessage = "Du kan højst bruge 35 tegn")] public string YourRef { get; set; } = "";
[MaxLength(255, ErrorMessage = "Du kan højst bruge 255 tegn")] public string OrderMessage { get; set; } = "";
[MaxLength(255, ErrorMessage = "Du kan højst bruge 255 tegn")] public string CrmNote { get; set; } = "";
/// <summary>
/// aktivitet dato
/// </summary>
[Required(ErrorMessage = "Dato skal angives")]
public string ActivityDate { get; set; } = "";
/// <summary>
/// produkt demo
/// </summary>
[MaxLength(50, ErrorMessage = "Du kan højst bruge 50 tegn")]
public string Demo { get; set; } = "";
/// <summary>
/// vores ref sættes til B:Fornavn
/// </summary>
[MaxLength(20, ErrorMessage = "Du kan højst bruge 20 tegn")]
public string OurRef { get; set; } = "";
/// <summary>
/// Rekvisitions nummer
/// </summary>
[MaxLength(20, ErrorMessage = "Du kan højst bruge 20 tegn")]
public string ReferenceNumber { get; set; } = "";
/// <summary>
/// kunde person reference
/// </summary>
[MaxLength(35, ErrorMessage = "Du kan højst bruge 35 tegn")]
public string YourRef { get; set; } = "";
/// <summary>
/// note til kontoret
/// </summary>
[MaxLength(255, ErrorMessage = "Du kan højst bruge 255 tegn")]
public string OrderMessage { get; set; } = "";
/// <summary>
/// crm note
/// </summary>
[MaxLength(255, ErrorMessage = "Du kan højst bruge 255 tegn")]
public string CrmNote { get; set; } = "";
// Delivery address form entries
[MaxLength(100, ErrorMessage = "Du kan højst bruge 100 tegn")] public string DlvName { get; set; } = "";
[MaxLength(100, ErrorMessage = "Du kan højst bruge 100 tegn")] public string DlvAddress1 { get; set; } = "";
[MaxLength(50, ErrorMessage = "Du kan højst bruge 50 tegn")] public string DlvAddress2 { get; set; } = "";
[MaxLength(20, ErrorMessage = "Du kan højst bruge 20 tegn")] public string DlvZipCode { get; set; } = "";
[MaxLength(30, ErrorMessage = "Du kan højst bruge 30 tegn")] public string DlvCity { get; set; } = "";
/// <summary>
/// leveringsnavn
/// </summary>
[MaxLength(100, ErrorMessage = "Du kan højst bruge 100 tegn")]
public string DlvName { get; set; } = "";
/// <summary>
/// levering adresse 1
/// </summary>
[MaxLength(100, ErrorMessage = "Du kan højst bruge 100 tegn")]
public string DlvAddress1 { get; set; } = "";
/// <summary>
/// levering adresse 2
/// </summary>
[MaxLength(50, ErrorMessage = "Du kan højst bruge 50 tegn")]
public string DlvAddress2 { get; set; } = "";
/// <summary>
/// levering postnummer
/// </summary>
[MaxLength(20, ErrorMessage = "Du kan højst bruge 20 tegn")]
public string DlvZipCode { get; set; } = "";
/// <summary>
/// levering bynavn
/// </summary>
[MaxLength(30, ErrorMessage = "Du kan højst bruge 30 tegn")]
public string DlvCity { get; set; } = "";
// Lines
/// <summary>
/// varelinjer
/// </summary>
public List<ActivityLineDto> Lines { get; set; } = new();
}
}