2b4cad4234
- Inserito filtro in offerte in base allo stato
304 lines
18 KiB
Plaintext
304 lines
18 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(Enums.CompileStep.Header)">
|
|
<StepArrow ObjId="1" StepText="Testata" BlockStyle="@(ArrowBackCol(Enums.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(Enums.CompileStep.General)">
|
|
<StepArrow ObjId="2" StepText="Generale" BlockStyle="@(ArrowBackCol(Enums.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(Enums.CompileStep.Rows)">
|
|
<StepArrow ObjId="3" StepText="Righe" BlockStyle="@(ArrowBackCol(Enums.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(Enums.CompileStep.Delivery)">
|
|
<StepArrow ObjId="4" StepText="Consegna" BlockStyle="@(ArrowBackCol(Enums.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(Enums.CompileStep.FinalCheck)">
|
|
<StepArrow ObjId="5" StepText="Controlli" BlockStyle="@(ArrowBackCol(Enums.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" title="Close" @onclick="() => DoEsc()">
|
|
</button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="card-body">
|
|
|
|
@if (currStep == Enums.CompileStep.Header)
|
|
{
|
|
<OfferMan CurrRecord="EditRecord" EC_Cancel="DoCancel" EC_Updated="DoSave" EC_Changed="SetDirty"></OfferMan>
|
|
}
|
|
else if (currStep == Enums.CompileStep.General)
|
|
{
|
|
<OfferCommonPar CurrRecord="EditRecord" EC_Cancel="DoCancel" EC_Updated="DoSave"></OfferCommonPar>
|
|
}
|
|
else if (currStep == Enums.CompileStep.Rows)
|
|
{
|
|
<OfferRowMan CurrRecord="EditRecord" DisplayMode="EgwCoreLib.Lux.Core.Enums.DisplayMode.Edit"></OfferRowMan>
|
|
}
|
|
else if (currStep == Enums.CompileStep.Delivery)
|
|
{
|
|
<OfferDelivery CurrRecord="EditRecord" EC_Cancel="DoCancel" EC_Updated="DoSave"></OfferDelivery>
|
|
}
|
|
@* else if (currStep == Enums.CompileStep.FinalCheck)
|
|
{
|
|
<OfferCheck CurrRecord="EditRecord" EC_Cancel="DoCancel"></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>
|
|
<a href="/Test" class="btn btn-primary">
|
|
<i class="fa-solid fa-chart-area"></i>
|
|
Stats
|
|
</a>
|
|
</div>
|
|
<div class="px-0">
|
|
<div class="d-flex align-items-center">
|
|
<div class="px-2">
|
|
<div class="input-group input-group-sm" title="ricerca">
|
|
<span class="input-group-text"><i class="fas fa-search"></i></span>
|
|
<select class="form-select" @bind="@SearchVal">
|
|
<option value="All">All</option>
|
|
@foreach (var item in OfferStateList)
|
|
{
|
|
<option value="@item">@item</option>
|
|
}
|
|
</select>
|
|
</div>
|
|
</div>
|
|
@* <div class="px-2">
|
|
<div class="input-group input-group-sm">
|
|
<span class="input-group-text">Stato</span>
|
|
<div class="form-check form-switch align-items-center">
|
|
<input class="form-check-input" type="checkbox" @bind="@AllStates">
|
|
<label class="form-check-label">@txtState</label>
|
|
</div>
|
|
</div>
|
|
</div> *@
|
|
<div class="px-1">
|
|
<div class="input-group input-group-sm">
|
|
<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="() => DoReset()"><i class="fa-solid fa-arrow-rotate-right"></i></button>
|
|
</th>
|
|
@if (SelRecord == null)
|
|
{
|
|
<th>ID</th>
|
|
}
|
|
<th>Date</th>
|
|
@if (SelRecord == null)
|
|
{
|
|
<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>
|
|
@if (SelRecord == null)
|
|
{
|
|
<th class="text-end">Marg.</th>
|
|
}
|
|
<th class="text-end"> </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>
|
|
@if (SelRecord == null)
|
|
{
|
|
<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>
|
|
@if (SelRecord == null)
|
|
{
|
|
<td>
|
|
<button class="btn btn-sm bg-@ButtonStateCss(item) bg-gradient bg-opacity-25 text-dark rounded-pill" @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>@if (SelRecord == null)
|
|
{
|
|
<td class="text-end" title="Margine / Sconto MAX applicabile">
|
|
@item.MaxDiscount.ToString("P2")
|
|
</td>
|
|
}
|
|
<td class="text-center">
|
|
<div class="btn-group" role="group" >
|
|
<a href="@(DownloadUrl(item.OfferID))" target="_blank" title="Stampa" class="btn btn-sm btn-primary">
|
|
<i class="fa-solid fa-print"></i>
|
|
</a>
|
|
@if (SelRecord == null)
|
|
{
|
|
<button class="btn btn-sm btn-primary" title="Scegli template" @onclick="() => SelectOptPrint(item.OfferID)">
|
|
<i class="fa-solid fa-chevron-down small"></i>
|
|
</button>
|
|
}
|
|
</div>
|
|
</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()" EC_Action="DoAction"></OfferRowMan>
|
|
</div>
|
|
}
|
|
</div>
|
|
}
|
|
</div>
|
|
</div>
|
|
}
|
|
@if (selectOptPrint)
|
|
{
|
|
<PrintModal url="@apiUrl" currId="@currId" repType="Offerta" EC_Close="ClosePrintModal"></PrintModal>
|
|
}
|
|
<BootstrapModal @ref=Modal Title=@mTitle Message=@mMessage Mode="BootstrapModal.ModalMode.Confirm" UserOptions=@modalOpt ></BootstrapModal > |