Files
everything/EveryThing/Pages/Invoices/Create.cshtml
David Štaleker a7560aa141 + Timeout logout
+ Pred kreiranjem povpraševanja vprašaj za partnerja
+ Prikaz TOP 100 (predolgo nalaga)
+ Dodaj Sorovec na Urejanje Artikla (zadnji surovec)
+ V Urejanju artikla popravi opis v pot dokumentov
+ Kooperant
2025-07-18 08:10:42 +02:00

119 lines
5.2 KiB
Plaintext

@page
@model EveryThing.Pages.Invoices.CreateModel
@{
ViewData["Title"] = "Vnos fakture";
Layout = "~/Pages/Layouts/_Layout.cshtml";
}
<!-- Editor -->
<link rel="stylesheet" href="~/vendor/libs/quill/typography.css" asp-append-version="true" />
<link rel="stylesheet" href="~/vendor/libs/quill/editor.css" asp-append-version="true" />
<form method="post" onsubmit="handleEditors()">
<h4 class="d-flex justify-content-between align-items-center w-100 font-weight-bold py-1 mb-4">
<span>
<span class="text-muted font-weight-light">
@switch (ViewData["Type"])
{
case 1:
<i>Naročila dobaviteljem</i>
break;
case 0:
<i>Računi</i>
break;
case 2:
<i>Dobavnice</i>
break;
case 3:
<i>Naročila kupcev</i>
break;
case 4:
<i>Kooperacije</i>
break;
default:
<i>Fakture</i>
break;
}
/</span> Vnos
</span>
</h4>
<div class="card">
<h6 class="card-header">
Podatki fakture
</h6>
<div class="card-body">
<div class="row">
<div class="col-md-4">
<div asp-validation-summary="ModelOnly" class="text-danger"></div>
<input type="hidden" asp-for="@ViewData["Type"]" name="type"/>
<div class="form-group">
<label asp-for="Invoice.IdPartnerFk" class="control-label"></label>
<select asp-for="Invoice.IdPartnerFk" class="form-control" asp-items="ViewBag.IdPartnerFk"></select>
<span asp-validation-for="Invoice.IdPartnerFk" class="text-danger"></span>
</div>
<div class="form-group">
<label asp-for="Invoice.Date" class="form-label"></label>
<input autocomplete="off" asp-for="Invoice.Date" type="date" class="form-control" />
<span asp-validation-for="Invoice.Date" class="text-danger"></span>
</div>
</div>
</div>
<div class="row">
<div class="col-6">
<div class="form-group mb-0">
<label asp-for="Invoice.PreText" class="form-label"></label>
<input type="hidden" id="value-pretext" asp-for="@Model.Invoice.PreText" />
<div id="editor-pretext" style="height: 250px">
@Html.Raw(Model.Invoice.PreText)
</div>
</div>
</div>
<div class="col-6">
<div class="form-group mb-0">
<label asp-for="Invoice.PostText" class="form-label"></label>
<input type="hidden" id="value-posttext" asp-for="@Model.Invoice.PostText" />
<div id="editor-posttext" style="height: 250px">
@Html.Raw(Model.Invoice.PostText)
</div>
</div>
</div>
</div>
<div class="row" style="margin-top:10px;">
<div class="col-6">
<div class="form-group">
<input type="submit" value="Shrani" class="btn btn-primary" />
<a class="btn btn-default" asp-page="./Index" asp-route-type="@ViewData["Type"]">Nazaj na seznam</a>
</div>
</div>
</div>
</div>
</div>
</form>
@section Scripts {
@{await Html.RenderPartialAsync("_ValidationScriptsPartial");}
<!-- Editor -->
<script src="~/vendor/libs/quill/quill.js" asp-append-version="true"></script>
<script>
var Block = Quill.import('blots/block');
Block.tagName = 'DIV';
Quill.register(Block, true);
let editorPreText = new Quill('#editor-pretext', { modules: { toolbar: [['bold', 'italic', 'underline'], ['color'],[{ 'list': 'ordered' }, { 'list': 'bullet' }],['align'],['clean']] }, theme: 'snow' });
let editorPostText = new Quill('#editor-posttext', { modules: { toolbar: [['bold', 'italic', 'underline'], ['color'],[{ 'list': 'ordered' }, { 'list': 'bullet' }],['align'],['clean']] }, theme: 'snow' });
let editorCargoDescription = new Quill('#editor-cargodescription', { modules: { toolbar: [['bold', 'italic', 'underline'], ['color'], [{ 'list': 'ordered' }, { 'list': 'bullet' }], ['align'], ['clean']] }, theme: 'snow' });
function handleEditors() {
document.getElementById('value-pretext').value = editorPreText.root.innerHTML;
document.getElementById('value-posttext').value = editorPostText.root.innerHTML;
document.getElementById('value-cargodescription').value = editorCargoDescription.root.innerHTML;
}
$(document).ready(function () {
loadPosition();
});
</script>
}