294 lines
16 KiB
Plaintext
294 lines
16 KiB
Plaintext
@page "/docs"
|
|
|
|
@using SHERPA.BBM.UI.Components
|
|
|
|
<div class="card">
|
|
<div class="card-header">
|
|
<div class="d-flex justify-content-between">
|
|
<div class="px-1">
|
|
<div class="d-flex">
|
|
<div class="px-1">
|
|
<h4><span class="oi oi-document" aria-hidden="true"></span> Documenti</h4>
|
|
</div>
|
|
<div class="px-1 py-1">
|
|
<div class="custom-control custom-switch text-center">
|
|
<input type="checkbox" class="custom-control-input" id="swtopenNewTab" @bind="@OpenNewTab">
|
|
<label class="custom-control-label" for="swtopenNewTab">@OpenNewTabMsg</label>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="px-1">
|
|
<div class="d-flex">
|
|
<div class="px-2">
|
|
<button class="btn btn-block btn-success btn-sm" @onclick="CreateNew" hidden="@btnNewHidden">NUOVO</button>
|
|
</div>
|
|
<div class="px-2">
|
|
<div class="custom-control custom-switch">
|
|
<input type="checkbox" class="custom-control-input" id="togAttivi" title="Mostra tutti / Solo senza Ordini" @bind-value="@ShowAllDoc" />
|
|
<label class="custom-control-label" for="togAttivi">Tutti</label>
|
|
</div>
|
|
</div>
|
|
<div class="px-2">
|
|
<div class="input-group input-group-sm">
|
|
<div class="input-group-prepend">
|
|
<span class="input-group-text">
|
|
<span class="oi oi-basket" aria-hidden="true"></span>
|
|
</span>
|
|
</div>
|
|
<select @bind="@SelBasketId" class="form-control form-control-sm">
|
|
<option value="1">--- Tutti ---</option>
|
|
@if (BasketList != null)
|
|
{
|
|
@foreach (var item in BasketList)
|
|
{
|
|
<option value="@item.BasketId">@item.CodBasket | @TrimTxt(item.Descript, 20)</option>
|
|
}
|
|
}
|
|
</select>
|
|
<div class="input-group-append">
|
|
<button class="@cssBtnResBask" @onclick="ResetBasket"><i class="fas fa-undo"></i></button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="px-2">
|
|
<div class="input-group input-group-sm">
|
|
<div class="input-group-prepend">
|
|
<span class="input-group-text">
|
|
<span class="oi oi-cart" aria-hidden="true"></span>
|
|
</span>
|
|
</div>
|
|
<select @bind="@SelNegotiationId" class="form-control form-control-sm">
|
|
<option value="1">--- Tutti ---</option>
|
|
@if (NegotiationList != null)
|
|
{
|
|
@foreach (var item in NegotiationList)
|
|
{
|
|
<option value="@item.NegotiationId" class="max10Char">@item.CodNegotiation | @TrimTxt(item.Descript, 25)</option>
|
|
}
|
|
}
|
|
</select>
|
|
<div class="input-group-append">
|
|
<button class="@cssBtnResNegot" @onclick="ResetNegot"><i class="fas fa-undo"></i></button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="px-2">
|
|
<div class="input-group input-group-sm">
|
|
<div class="input-group-prepend">
|
|
<span class="input-group-text">
|
|
<span class="oi oi-calendar" aria-hidden="true"></span>
|
|
</span>
|
|
</div>
|
|
<select @bind="@SelYear" class="form-control form-control-sm">
|
|
<option value="0">--- Tutti ---</option>
|
|
@foreach (var item in YearsList)
|
|
{
|
|
<option value="@item">@item</option>
|
|
}
|
|
</select>
|
|
<div class="input-group-append">
|
|
<button class="@cssBtnResYear" @onclick="ResetYear"><i class="fas fa-undo"></i></button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="card-body">
|
|
@if (currItem != null)
|
|
{
|
|
<DocsEditor currItem="@currItem" DataReset="ResetData" DataUpdated="UpdateData"></DocsEditor>
|
|
}
|
|
@if (isLoading || ListRecords == null)
|
|
{
|
|
<div class="w-100">
|
|
<LoadingData DisplayMode="LoadingData.SpinMode.Normal" DisplaySize="LoadingData.CtrlSize.Large"></LoadingData>
|
|
</div>
|
|
}
|
|
else if (totalCount == 0)
|
|
{
|
|
<div class="alert alert-warning text-center display-4">Nessun record trovato</div>
|
|
}
|
|
else
|
|
{
|
|
<table class="table table-sm table-striped ">
|
|
<thead>
|
|
<tr>
|
|
<th>
|
|
Cliente
|
|
<Sorter ParamName="Cliente" IsAsc="@SortAsc" CurrParam="@SortField" sortReq="SortRequested"></Sorter>
|
|
</th>
|
|
<th>
|
|
<Sorter ParamName="CodNegotiation" IsAsc="@SortAsc" CurrParam="@SortField" sortReq="SortRequested"></Sorter>
|
|
Trattativa
|
|
</th>
|
|
<th class="text-nowrap">
|
|
<Sorter ParamName="DocType" IsAsc="@SortAsc" CurrParam="@SortField" sortReq="SortRequested"></Sorter>
|
|
Tipo
|
|
</th>
|
|
<th title="Tipo di record: Draft / Offerta Economica" class="text-nowrap">A/<i class="fas fa-pen-nib"></i>/<i class="fas fa-euro-sign"></i></th>
|
|
<th>
|
|
<Sorter ParamName="CodDoc" IsAsc="@SortAsc" CurrParam="@SortField" sortReq="SortRequested"></Sorter>
|
|
Cod
|
|
</th>
|
|
<th>Descrizione</th>
|
|
<th class="text-right text-nowrap">
|
|
Importo
|
|
<Sorter ParamName="Importo" IsAsc="@SortAsc" CurrParam="@SortField" sortReq="SortRequested"></Sorter>
|
|
</th>
|
|
<th class="text-right text-nowrap">
|
|
Fatturazione
|
|
<Sorter ParamName="Fatturato" IsAsc="@SortAsc" CurrParam="@SortField" sortReq="SortRequested"></Sorter>
|
|
</th>
|
|
<th class="text-right"></th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
@foreach (var record in ListRecords)
|
|
{
|
|
<tr class="@checkSelect(@record.DocId)">
|
|
<td class="text-nowrap">
|
|
<div title="@record.RagSoc">
|
|
<b>@TrimTxt(record.RagSoc,40)</b>
|
|
</div>
|
|
<div class="d-flex mt-1">
|
|
<div class="pr-1">
|
|
@if (!record.IsLocked)
|
|
{
|
|
<button class="btn btn-sm btn-info" @onclick="() => Edit(record)" title="Edit record"><i class="fas fa-pen"></i></button>
|
|
}
|
|
else
|
|
{
|
|
<button class="btn btn-sm btn-dark" @onclick="() => UnlockRecord(record)" title="Documento Locked"><i class="fas fa-lock"></i></button>
|
|
}
|
|
</div>
|
|
<div class="pr-1">
|
|
<button class="btn btn-sm btn-warning" @onclick="() => NewRelease(record)" title="Clona"><span class="oi oi-fork"></span></button>
|
|
</div>
|
|
<div class="pr-1">
|
|
<button class="btn btn-sm btn-success" @onclick="() => ShowResources(record)" title="Vai al dettaglio Risorse"><span class="oi oi-puzzle-piece"></span></button>
|
|
</div>
|
|
<div class="pr-1">
|
|
<button class="btn btn-sm btn-primary" @onclick="() => ShowNegot(record)" title="Vai alla Trattativa"><span class="oi oi-cart"></span></button>
|
|
</div>
|
|
<div class="pr-1">
|
|
@if (record.OrdQty > 0)
|
|
{
|
|
<button class="btn btn-sm btn-orange" @onclick="() => ShowOrder(record)" title="Ordine associato"><i class="fas fa-cart-arrow-down"></i></button>
|
|
}
|
|
else
|
|
{
|
|
@if (!record.IsLocked)
|
|
{
|
|
<button class="btn btn-sm btn-pink" @onclick="() => CreateOrder(record)" title="Crea Ordine dal documento"><i class="fas fa-cart-plus"></i></button>
|
|
}
|
|
else
|
|
{
|
|
<button class="btn btn-sm btn-secondary disabled"><i class="fas fa-cart-plus"></i></button>
|
|
}
|
|
}
|
|
</div>
|
|
<div class="pr-1">
|
|
<button class="btn btn-sm btn-dark" @onclick="() => CreateDoc(record)" title="Refresh docx"><i class="fas fa-file-word"></i></button>
|
|
</div>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<div title="@record.NegotDescript">@record.CodNegotiation</div>
|
|
|
|
<div class="small max10Char" title="@record.NegotDescript">
|
|
@record.NegotDescript
|
|
</div>
|
|
</td>
|
|
<td class="small">
|
|
@record.DocType
|
|
<div clas="small">
|
|
<b>@record.Anno</b>
|
|
</div>
|
|
</td>
|
|
<td class="text-center">
|
|
<button class="btn btn-sm @btnFromState(record.IsActive)" @onclick="() => SetActive(record)" title="@tooltipFromState(record.IsActive)" disabled=@record.IsActive>
|
|
<span class="oi oi-power-standby"></span>
|
|
</button>
|
|
<div>
|
|
@if (record.IsDraft)
|
|
{
|
|
<i class="fas fa-pen-nib"></i>
|
|
}
|
|
else
|
|
{
|
|
<i class="fas fa-euro-sign"></i>
|
|
}
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<div>@record.CodDoc</div>
|
|
<div class="small">@record.DataIns.ToString("ddd yyyy.MM.dd HH:mm")</div>
|
|
</td>
|
|
<td>
|
|
<div title="@record.Descript">@TrimTxt(record.Descript, 70)</div>
|
|
<div class="small" title="@record.Note">@TrimTxt(@record.Note, 160)</div>
|
|
</td>
|
|
<td class="text-right" title="Importo">
|
|
@if (record.IsDraft || record.IsReversed)
|
|
{
|
|
<del>@record.Importo.ToString("C2")</del>
|
|
|
|
}
|
|
else
|
|
{
|
|
<b>@record.Importo.ToString("C2")</b>
|
|
}
|
|
</td>
|
|
<td class="text-right text-nowrap">
|
|
@if (record.DocType == BbmDocType.Ordine || record.DocType == BbmDocType.ConfermaOrdine || record.DocType >= BbmDocType.Licenza)
|
|
{
|
|
string fatCss = "text-success";
|
|
string incCss = "text-success";
|
|
if (@record.ImportoReq != record.Fatturato)
|
|
{
|
|
if (record.Incassato == 0)
|
|
{
|
|
fatCss = "text-warning";
|
|
}
|
|
else
|
|
{
|
|
fatCss = "text-danger";
|
|
}
|
|
}
|
|
<div title="Fatturato" class="@fatCss">
|
|
<b>@record.Fatturato.ToString("C2")</b> [F]
|
|
</div>
|
|
if (@record.Fatturato != record.Incassato)
|
|
{
|
|
if (record.Incassato == 0)
|
|
{
|
|
incCss = "text-danger";
|
|
}
|
|
else
|
|
{
|
|
incCss = "text-warning";
|
|
}
|
|
}
|
|
<div title="Incassato" class="small @incCss">@record.Incassato.ToString("C2") [I]</div>
|
|
}
|
|
</td>
|
|
<td class="text-right">
|
|
@if (record.OrdQty == 0 && !(record.IsLocked || record.IsReversed))
|
|
{
|
|
<button class="btn btn-sm btn-danger" @onclick="() => Delete(record)"><span class="oi oi-trash"></span></button>
|
|
}
|
|
</td>
|
|
</tr>
|
|
}
|
|
</tbody>
|
|
</table>
|
|
}
|
|
</div>
|
|
<div class="card-footer py-1">
|
|
<DataPager PageSize="numRecord" currPage="currPage" numRecordChanged="ForceReload" numPageChanged="ForceReloadPage" totalCount="totalCount" showLoading="isLoading" />
|
|
</div>
|
|
</div>
|