249 lines
14 KiB
Plaintext
249 lines
14 KiB
Plaintext
@page "/Offers"
|
|
|
|
@if (EditRecord != null)
|
|
{
|
|
<div class="card shadow">
|
|
<div class="card-header">
|
|
<div class="card-title mb-0">
|
|
<div class="d-flex justify-content-between align-items-center fs-4">
|
|
<div class="px-0 fs-3">
|
|
<b>@EditRecord.OfferCode</b>
|
|
</div>
|
|
<div class="px-4">
|
|
<div class="d-flex">
|
|
<div class="px-0 row">
|
|
<div class="col px-0">
|
|
<span @onclick="() => AdvStep(CompileStep.Header)">
|
|
<StepArrow ObjId="1" StepText="Testata" BlockStyle="@(ArrowBackCol(CompileStep.Header))" StrokeWidth="4" ObjW="360" ObjH="60" StrokeColors="@listBord01" TipAngle="90" TextStyle="@txtStyle"></StepArrow>
|
|
</span>
|
|
</div>
|
|
<div class="col px-0">
|
|
<span @onclick="() => AdvStep(CompileStep.General)">
|
|
<StepArrow ObjId="2" StepText="Generale" BlockStyle="@(ArrowBackCol(CompileStep.General))" StrokeWidth="4" ObjW="360" ObjH="60" StrokeColors="@listBord01" TipAngle="90" TextStyle="@txtStyle"></StepArrow>
|
|
</span>
|
|
</div>
|
|
<div class="col px-0">
|
|
<span @onclick="() => AdvStep(CompileStep.Rows)">
|
|
<StepArrow ObjId="3" StepText="Righe" BlockStyle="@(ArrowBackCol(CompileStep.Rows))" StrokeWidth="4" ObjW="360" ObjH="60" StrokeColors="@listBord01" TipAngle="90" TextStyle="@txtStyle"></StepArrow>
|
|
</span>
|
|
</div>
|
|
<div class="col px-0">
|
|
<span @onclick="() => AdvStep(CompileStep.Delivery)">
|
|
<StepArrow ObjId="4" StepText="Consegna" BlockStyle="@(ArrowBackCol(CompileStep.Delivery))" StrokeWidth="4" ObjW="360" ObjH="60" StrokeColors="@listBord01" TipAngle="90" TextStyle="@txtStyle"></StepArrow>
|
|
</span>
|
|
</div>
|
|
<div class="col px-0">
|
|
<span @onclick="() => AdvStep(CompileStep.FinalCheck)">
|
|
<StepArrow ObjId="5" StepText="Controlli" BlockStyle="@(ArrowBackCol(CompileStep.FinalCheck))" StrokeWidth="4" ObjW="360" ObjH="60" StrokeColors="@listBord01" TipAngle="90" TextStyle="@txtStyle"></StepArrow>
|
|
</span>
|
|
</div>
|
|
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="px-0">
|
|
<button type="button" class="btn-close" data-bs-dismiss="card" aria-label="Close" @onclick="() => DoEsc(EditRecord)">
|
|
</button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="card-body">
|
|
|
|
@if (currStep == CompileStep.Header)
|
|
{
|
|
<OfferMan CurrRecord="EditRecord" EC_Close="DoClose" EC_Updated="DoSave"></OfferMan>
|
|
}
|
|
else if (currStep == CompileStep.General)
|
|
{
|
|
<OfferCommonPar CurrRecord="EditRecord" EC_Close="DoClose" EC_Updated="DoSave"></OfferCommonPar>
|
|
}
|
|
else if (currStep == CompileStep.Rows)
|
|
{
|
|
<OfferRowMan CurrRecord="EditRecord" DisplayMode="EgwCoreLib.Lux.Core.Enums.DisplayMode.Edit"></OfferRowMan>
|
|
}
|
|
else if (currStep == CompileStep.Delivery)
|
|
{
|
|
<OfferDelivery CurrRecord="EditRecord" EC_Close="DoClose" EC_Updated="DoSave"></OfferDelivery>
|
|
}
|
|
else if (currStep == CompileStep.FinalCheck)
|
|
{
|
|
<OfferCheck CurrRecord="EditRecord" EC_Close="DoClose"></OfferCheck>
|
|
}
|
|
</div>
|
|
</div>
|
|
}
|
|
else
|
|
{
|
|
if (EditStateRec != null)
|
|
{
|
|
<div class="modal" tabindex="-1" style="display:block; background-color: rgba(10,10,10,.6);" role="dialog">
|
|
<div class="modal-dialog modal-lg">
|
|
<div class="modal-content">
|
|
<div class="modal-header text-bg-info bg-gradient bg-opacity-50">
|
|
<div class="modal-title fs-3">Imposta Stato Offerta</div>
|
|
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close" @onclick="() => EditState(null)">
|
|
</button>
|
|
</div>
|
|
<div class="modal-body">
|
|
<div class="row">
|
|
@foreach (var itemState in Enum.GetValues(typeof(Enums.OfferStates)).Cast<Enums.OfferStates>())
|
|
{
|
|
<div class="col">
|
|
<button class="btn btn-sm btn-primary w-100 m-1" @onclick="() => SetState(EditStateRec, itemState)">@itemState</button>
|
|
</div>
|
|
}
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
}
|
|
<div class="card shadow">
|
|
<div class="card-header">
|
|
<div class=" d-flex justify-content-between">
|
|
<div class="px-0 fs-3">
|
|
<b>Offerte</b> <button class="btn btn-success" @onclick="DoAdd"><i class="fa-solid fa-cart-plus"></i> Nuova</button>
|
|
</div>
|
|
<div class="px-0">
|
|
<div class="d-flex">
|
|
<div class="px-1">
|
|
<div class="input-group input-group-sm">
|
|
@* <span class="input-group-text">Stato</span> *@
|
|
<div class="form-control ">
|
|
<div class="form-check form-switch align-content-center">
|
|
<input class="form-check-input" type="checkbox" @bind="@AllStates">
|
|
<label class="form-check-label">@txtState</label>
|
|
</div>
|
|
</div>
|
|
<input type="text" class="form-control" placeholder="ctrl-/" accesskey="/">
|
|
<button class="btn btn-outline-secondary" type="button"><i class="fa-solid fa-rotate-right"></i></button>
|
|
</div>
|
|
</div>
|
|
<div class="px-1">
|
|
<PeriodoSel E_PeriodoSel="SetPeriodo" CurrPeriodo="PeriodoSel"></PeriodoSel>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
</div>
|
|
<div class="card-body">
|
|
@if (isLoading)
|
|
{
|
|
<LoadingData></LoadingData>
|
|
}
|
|
else if (totalCount == 0)
|
|
{
|
|
<div class="alert alert-info text-center display-4">Nessun record trovato</div>
|
|
}
|
|
else
|
|
{
|
|
<div class="row">
|
|
<div class="@DivMainCss">
|
|
<table class="table table-sm table-striped">
|
|
<thead>
|
|
<tr>
|
|
<th>
|
|
<button class="btn btn-sm btn-primary" title="Reset selezione" @onclick="()=>DoEsc(EditRecord)"><i class="fa-solid fa-arrow-rotate-right"></i></button>
|
|
</th>
|
|
<th>ID</th>
|
|
<th>Date</th>
|
|
<th>Stato</th>
|
|
<th>Codice</th>
|
|
<th>Agente/Riv</th>
|
|
<th>Cliente</th>
|
|
@if (SelRecord == null)
|
|
{
|
|
<th>Descrizione</th>
|
|
}
|
|
<th class="text-end" title="# Righe"><i class="fa-solid fa-list"></i></th>
|
|
<th class="text-end" title="# Articoli"><i class="fa-regular fa-file-lines"></i></th>
|
|
<th class="text-end" title="# Componenti Ordine"><i class="fa-solid fa-folder-tree"></i></th>
|
|
<th class="text-end">Importo</th>
|
|
<th class="text-end">Marg.</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
@foreach (var item in ListRecords)
|
|
{
|
|
<tr class="@CheckSelect(item)">
|
|
<td>
|
|
<button class="btn btn-sm btn-primary" @onclick="() => DoSelect(item)"><i class="fa-solid fa-magnifying-glass"></i></button>
|
|
<button class="btn btn-sm btn-info" @onclick="() => DoEdit(item)"><i class="fa-solid fa-pencil"></i></button>
|
|
<button class="btn btn-sm btn-warning" @onclick="() => DoClone(item)" title="Duplica Offerta"><i class="fa-solid fa-wand-magic"></i></button>
|
|
</td>
|
|
<td>@item.OfferID</td>
|
|
<td>
|
|
<div class="small" title="Inserita"><i class="fa-solid fa-circle"></i> @($"{item.Inserted:yyyy-MM-dd}")</div>
|
|
<div class="small text-secondary" title="Scadenza"><i class="fa-solid fa-hourglass-half"></i> @($"{item.ValidUntil:yyyy-MM-dd}")</div>
|
|
</td>
|
|
<td>
|
|
<button class="btn btn-sm btn-outline-dark" @onclick="() => EditState(item)">@item.OffertState</button>
|
|
</td>
|
|
<td>
|
|
@item.OfferCode
|
|
<div class="small text-secondary">@item.Envir</div>
|
|
</td>
|
|
<td>
|
|
@if (item.DealerNav != null)
|
|
{
|
|
<div class=""><b>@item.DealerNav.FirstName</b> @item.DealerNav.LastName</div>
|
|
<div class="small">@item.DealerNav.VAT</div>
|
|
}
|
|
</td>
|
|
<td>
|
|
@if (item.CustomerNav != null)
|
|
{
|
|
<div class=""><b>@item.CustomerNav.FirstName</b> @item.CustomerNav.LastName</div>
|
|
<div class="small">@item.CustomerNav.VAT</div>
|
|
}
|
|
</td>
|
|
@if (SelRecord == null)
|
|
{
|
|
<td>@item.Description</td>
|
|
}
|
|
<td class="text-end">
|
|
@item.NumRows
|
|
</td>
|
|
<td class="text-end">
|
|
@item.NumItems
|
|
</td>
|
|
<td class="text-end">
|
|
@item.NumProdItems
|
|
</td>
|
|
<td class="text-end">
|
|
<div class="fw-bold" title="Prezzo Finito">@item.TotalPrice.ToString("C2")</div>
|
|
<div class="small text-secondary" title="RockBottom Price">(@item.TotalCost.ToString("C2"))</div>
|
|
</td>
|
|
<td class="text-end" title="Margine / Sconto MAX applicabile">
|
|
@item.MaxDiscount.ToString("P2")
|
|
</td>
|
|
</tr>
|
|
}
|
|
</tbody>
|
|
@if (totalCount >= numRecord)
|
|
{
|
|
<tfoot>
|
|
<tr>
|
|
<td colspan="15">
|
|
<EgwCoreLib.Razor.DataPager currPage="@currPage" PageSize="@numRecord" totalCount="@totalCount" numPageChanged="SavePage" numRecordChanged="SaveNumRec"></EgwCoreLib.Razor.DataPager>
|
|
</td>
|
|
</tr>
|
|
</tfoot>
|
|
}
|
|
</table>
|
|
|
|
</div>
|
|
@if (SelRecord != null)
|
|
{
|
|
<div class="col-6">
|
|
<OfferRowMan CurrRecord="@SelRecord" DisplayMode="EgwCoreLib.Lux.Core.Enums.DisplayMode.Preview" EC_Updated="() => ForceReload()"></OfferRowMan>
|
|
</div>
|
|
}
|
|
</div>
|
|
}
|
|
</div>
|
|
</div>
|
|
}
|