This commit is contained in:
Frede Hundewadt 2022-07-13 12:54:54 +02:00
parent bd4a7ac080
commit e63b04ec22
9 changed files with 40 additions and 31 deletions

View file

@ -27,14 +27,14 @@ else
<div class="badge text-bg-info mx-3">app version @_app?.Version</div>
}
@if (_app!.IsBeta)
@if (_app!.Rc)
{
<div class="badge text-bg-warning mx-3">Beta version</div>
<div class="badge text-bg-warning mx-3">release candidate</div>
}
@if (_app!.SandBox)
@if (_app!.Sandbox)
{
<div class="badge text-bg-danger mx-3">Sandkasse</div>
<div class="badge text-bg-danger mx-3">sandbox</div>
}
@code
{

View file

@ -50,14 +50,17 @@
</button>
</td>
<td class="align-middle">
<button type="button" class="btn btn-light border-dark position-relative" @onclick="() => TaskCompleted(task.TaskItemId)">
Færdiggør
<button type="button" class="btn btn-light border-dark" @onclick="() => TaskCompleted(task.TaskItemId)">
Check <i class="oi oi-check"></i>
</button>
</td>
<td class="align-middle">
@if (task.TaskTypeEnum is "Recall" or "Revision")
@if (task.TaskTypeEnum is "Recall")
{
<button type="button" class="btn btn-primary position-relative" @onclick="() => CompleteTask(task.TaskItemId)">
<a class="btn btn-light border-dark pe-3" href="/companies/@task.ReferenceId">
Ændre
</a>
<button type="button" class="btn btn-primary" @onclick="() => CompleteTask(task.TaskItemId)">
Besøg
</button>
}

View file

@ -108,11 +108,11 @@ public partial class ActivityNewVisitPage : IDisposable
_ux = await _storage.GetItemAsync<UserInfoView>("_xu");
_company = await _companyRepo.GetCompanyById(CompanyId);
// variable to validate if customer needs update
// variable to validate if customer needs phone number update
_phone = _company.Phone;
if (string.IsNullOrWhiteSpace(_company.Phone)
&& !string.IsNullOrWhiteSpace(_company.Account)
&& _company.Account != "NY")
&& _company.Account != "NY" && _company.Account.Length > 7)
{
_company.Phone = _company.Account[..8];
}
@ -170,7 +170,7 @@ public partial class ActivityNewVisitPage : IDisposable
if (_draft.ActivityStatusEnum == "order" && string.IsNullOrWhiteSpace(_draft.Phone))
{
_toast.ShowError("Ved nye bestillinger skal en kundes telefon nummer angives.");
_toast.ShowError("Ved bestilling til ny kunde skal telefon nummer angives.");
return;
}

View file

@ -106,7 +106,7 @@
<InputDate id="lastVisit" class="form-control" @bind-Value="@_lastVisit"/>
</td>
<td>
<InputDate id="nextVisit" class="form-control" @bind-Value="@(_nextVisit)"/>
<InputDate id="nextVisit" class="form-control" @bind-Value="@(_nextVisit)" readonly />
</td>
<td>
<InputNumber id="interval" class="form-control" @bind-Value="_companyObject.Interval"/>

View file

@ -123,6 +123,9 @@ namespace Wonky.Client.Pages
}
private async Task SubmitCompanyForm()
{
_companyObject.LastVisit = $"{_lastVisit:yyyy-MM-dd}";
_companyObject.NextVisit = $"{_nextVisit:yyyy-MM-dd}";
var newId = await _companyRepo.CreateCompany(_companyObject);
if (!string.IsNullOrWhiteSpace(newId))
@ -138,8 +141,7 @@ namespace Wonky.Client.Pages
private void HandleFieldChanged(object sender, FieldChangedEventArgs e)
{
_companyObject.LastVisit = $"{_lastVisit:yyyy-MM-dd}";
_companyObject.NextVisit = $"{_nextVisit:yyyy-MM-dd}";
_nextVisit = _lastVisit.AddDays(7 * _companyObject.Interval);
if (!_companyObject.ValidDateSpan())
{

View file

@ -163,8 +163,7 @@
</DisplayStateComponent>
</td>
<td>
<InputDate id="nextVisit" class="form-control" @bind-Value="@(_nextVisit)" />
<ValidationMessage For="@(() => _company.NextVisit)">Dato kan ikke vær før sidste besøg</ValidationMessage>
<InputDate id="nextVisit" class="form-control" @bind-Value="@(_nextVisit)" readonly />
</td>
<th>
Besøgt
@ -186,7 +185,8 @@
Historik
</th>
<td>
<button class="btn btn-warning" type="button" @onclick="@RefreshHistory">@_company.HistorySync</button>
<label>@_company.HistorySync</label>
<button class="ms-2 btn btn-light border-dark" type="button" @onclick="@RefreshHistory" disabled="@_working">@_btnUpdateText</button>
</td>
</tr>
</tbody>
@ -195,16 +195,16 @@
<div class="card-footer">
<div class="row">
<div class="col">
<button type="submit" class="btn btn-warning">Gem</button>
<button type="submit" class="btn btn-light border-dark">Gem</button>
</div>
<div class="col">
<a class="btn btn-primary" href="/companies">Til Oversigt</a>
<a class="btn btn-light border-dark" href="/companies">Til Oversigt</a>
</div>
<div class="col">
<a class="btn btn-info" href="/companies/@_company.CompanyId/h/i">Produktkøb</a>
<a class="btn btn-light border-dark" href="/companies/@_company.CompanyId/h/i">Produktkøb</a>
</div>
<div class="col">
<a class="btn btn-info" href="/companies/@_company.CompanyId/h/p">Varelinjer</a>
<a class="btn btn-light border-dark" href="/companies/@_company.CompanyId/h/p">Varelinjer</a>
</div>
<div class="col">
<ActivityButton ActionLink="@_actionLink"

View file

@ -61,6 +61,8 @@ public partial class CustomerViewPage : IDisposable
private int _enableActivity = 1;
private bool _hideButtons = false;
private string _actionLink = "";
private bool _working;
private string _btnUpdateText = "Opdater";
private readonly JsonSerializerOptions _options = new ()
{
@ -69,10 +71,14 @@ public partial class CustomerViewPage : IDisposable
private async Task RefreshHistory()
{
_working = true;
_btnUpdateText = "vent venligst ...";
_toast.ShowInfo("Vent mens data opdateres ...");
_toast.ShowInfo("Der kan gå nogle minuutter inden data er klar ...");
var ts = await _historyRepo.UpdateProductHistory(_company.CompanyId, $"{DateTime.Parse(_company.HistorySync):yyyy-MM-dd}");;
_company.HistorySync = ts.Replace("\"", "");
_btnUpdateText = "Opdater";
_working = false;
}
protected override async Task OnInitializedAsync()
{
@ -135,9 +141,6 @@ public partial class CustomerViewPage : IDisposable
{
_nextVisit = _lastVisit.AddDays(_company.Interval * 7);
_company.LastVisit = $"{_lastVisit:yyyy-MM-dd}";
_company.NextVisit = $"{_nextVisit:yyyy-MM-dd}";
if (!VatUtils.ValidateFormat(_company.CountryCode, _company.VatNumber))
{
_formInvalid = true;

View file

@ -1,13 +1,13 @@
{
"appInfo": {
"name": "Wonky Client",
"version": "0.9.13",
"isBeta": true,
"version": "0.9.15",
"rc": true,
"sandBox": false,
"image": "grumpy-coder.png"
},
"apiConfig": {
"innoBaseUrl": "https://staging.innotec.dk",
"innoBaseUrl": "https://dev.innotec.dk",
"glsTrackUrl": "https://www.gls-group.eu/276-I-PORTAL-WEB/content/GLS/DK01/DA/5004.htm?txtAction=71000&txtRefNo=",
"glsId": "",
"virkUrl": "api/v2/services/virk",
@ -27,7 +27,8 @@
"adminUserUri": "api/v2/admin/users/office",
"adminPasswdUri": "api/v2/admin/users/passwd",
"adminReportUri": "reports",
"adminCompanyUri": "companies"
"adminCompanyUri": "companies",
"warehouseUri": "api/v2/warehouse/orders"
},
"Logging": {
"LogLevel": {

View file

@ -35,10 +35,10 @@ public class AppInfo
/// <summary>
/// Application beta version flag
/// </summary>
public bool IsBeta { get; set; }
public bool Rc { get; set; }
/// <summary>
/// Sandbox version
/// </summary>
public bool SandBox { get; set; }
public bool Sandbox { get; set; }
}