Widok dodawania / edycji faktury
This commit is contained in:
@@ -1,4 +1,7 @@
|
||||
<?php include 'header.php'; ?>
|
||||
<?php
|
||||
$enablePrototypeComments = true;
|
||||
include '../../header-invoice.php';
|
||||
?>
|
||||
|
||||
|
||||
<div class="container-fluid flex-grow-1 container-p-y">
|
||||
@@ -507,7 +510,7 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php include 'footer.php'; ?>
|
||||
<?php include '../../footer.php'; ?>
|
||||
|
||||
<script>
|
||||
document.addEventListener('DOMContentLoaded', function () {
|
||||
|
||||
370
prototype/invoice/app-purchase-add.php
Normal file
370
prototype/invoice/app-purchase-add.php
Normal file
@@ -0,0 +1,370 @@
|
||||
<?php
|
||||
$enablePrototypeComments = true;
|
||||
include '../../header-invoice.php';
|
||||
?>
|
||||
|
||||
<div class="container-fluid flex-grow-1 container-p-y">
|
||||
|
||||
<div
|
||||
class="d-flex flex-column flex-md-row justify-content-between align-items-start align-items-md-center mb-4 gap-3">
|
||||
<div class="d-flex flex-column justify-content-center">
|
||||
<h4 class="mb-1 text-body">Nowa Faktura Zakupowa</h4>
|
||||
<p class="text-muted mb-0">Wprowadź koszt firmowy</p>
|
||||
</div>
|
||||
<div class="d-flex align-content-center flex-wrap gap-2">
|
||||
<a href="app-purchase-list.php" class="btn btn-label-secondary">Anuluj</a>
|
||||
<button type="submit" form="invoiceForm" class="btn btn-primary"><i class="bx bx-save me-1"></i> Zapisz
|
||||
fakturę</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<form id="invoiceForm" onsubmit="return false">
|
||||
|
||||
<div class="row mb-4">
|
||||
|
||||
<div class="col-lg-2 col-md-12 mb-3 mb-lg-0">
|
||||
<div class="card h-100 bg-label-secondary border-0">
|
||||
<div class="card-body p-3 d-flex flex-column justify-content-center text-center">
|
||||
<div class="avatar mx-auto mb-2">
|
||||
<span class="avatar-initial rounded bg-white text-secondary"><i
|
||||
class="bx bx-building-house fs-4"></i></span>
|
||||
</div>
|
||||
<h6 class="card-title mb-1 text-nowrap">Nabywca (My)</h6>
|
||||
<small class="d-block fw-bold text-truncate">Magico Software</small>
|
||||
<small class="text-muted text-truncate">NIP: 8652582386</small>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-lg-5 col-md-6 mb-3 mb-lg-0">
|
||||
<div class="card h-100">
|
||||
<div class="card-header border-bottom py-3">
|
||||
<h6 class="card-title m-0"><i class="bx bx-store-alt me-2"></i>Sprzedawca</h6>
|
||||
</div>
|
||||
<div class="card-body pt-3">
|
||||
<div class="card shadow-none border mb-3 position-relative">
|
||||
<div class="card-body p-3 d-flex justify-content-between align-items-center"
|
||||
style="min-height: 80px;">
|
||||
<i class="text-muted">Wybierz dostawcę z listy...</i>
|
||||
<button class="btn btn-outline-primary btn-sm position-absolute end-0 top-0 m-2"><i
|
||||
class="bx bx-search"></i></button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="d-flex flex-column gap-2">
|
||||
<label class="form-check form-switch m-0">
|
||||
<input class="form-check-input" type="checkbox" id="descToggle">
|
||||
<span class="form-check-label text-muted">Dodatkowy opis dostawcy</span>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-lg-5 col-12">
|
||||
<div class="card h-100">
|
||||
<div class="card-header border-bottom py-3">
|
||||
<h6 class="card-title m-0"><i class="bx bx-file me-2"></i>Dane Dokumentu</h6>
|
||||
</div>
|
||||
<div class="card-body pt-3">
|
||||
|
||||
<div class="row g-2 mb-3">
|
||||
<div class="col-md-6">
|
||||
<label class="form-label fw-bold">Numer faktury</label>
|
||||
<input type="text" class="form-control" placeholder="np. FV/2026/02/105">
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<label class="form-label small text-uppercase fw-bold text-muted">Data zakupu</label>
|
||||
<input type="text" class="form-control date-picker" value="2026-02-17">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row g-2 mb-3">
|
||||
<div class="col-6">
|
||||
<label class="form-label small text-uppercase fw-bold text-muted">Data wyst.</label>
|
||||
<input type="text" class="form-control date-picker" value="2026-02-17">
|
||||
</div>
|
||||
<div class="col-6">
|
||||
<label class="form-label small text-uppercase fw-bold text-muted">Termin płat.</label>
|
||||
<input type="text" class="form-control date-picker" value="2026-02-24">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row g-2 align-items-end">
|
||||
<div class="col-5">
|
||||
<label class="form-label small text-uppercase fw-bold text-muted">Metoda</label>
|
||||
<select class="form-select">
|
||||
<option value="przelew">Przelew</option>
|
||||
<option value="gotowka">Gotówka</option>
|
||||
<option value="karta">Karta</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-7">
|
||||
<label class="form-label fw-bold">Zapłacono</label>
|
||||
<div class="input-group">
|
||||
<input type="number" id="paidInput" class="form-control" value="0.00">
|
||||
<button class="btn btn-outline-primary px-2" type="button" id="payFullBtn"
|
||||
data-bs-toggle="tooltip" title="Przepisz pełną kwotę">
|
||||
Całość
|
||||
</button>
|
||||
<span class="input-group-text">PLN</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card mb-4">
|
||||
<div
|
||||
class="card-header bg-label-primary py-2 d-flex flex-wrap justify-content-between align-items-center gap-3">
|
||||
<span class="fw-bold">Pozycje faktury</span>
|
||||
|
||||
<div class="d-flex align-items-center flex-wrap gap-3">
|
||||
|
||||
<div class="d-flex align-items-center">
|
||||
<label class="text-muted small me-2 text-nowrap d-flex align-items-center">
|
||||
Kategoria kosztu
|
||||
<i class="bx bx-info-circle ms-1 text-primary cursor-pointer" data-bs-toggle="tooltip"
|
||||
title="Listę kategorii możesz zdefiniować w: Ustawienia -> Słowniki"></i>
|
||||
</label>
|
||||
<select class="form-select form-select-sm" style="min-width: 150px;">
|
||||
<option value="towary">Towary handlowe</option>
|
||||
<option value="paliwo">Paliwo i eksploatacja</option>
|
||||
<option value="biuro">Koszty biurowe</option>
|
||||
<option value="uslugi">Usługi obce</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="vr h-100 my-auto text-muted"></div>
|
||||
|
||||
<div class="d-flex align-items-center">
|
||||
<label class="text-muted small me-2 text-nowrap">Licz od:</label>
|
||||
<select class="form-select form-select-sm" style="width: auto;">
|
||||
<option value="brutto">Brutto</option>
|
||||
<option value="netto">Netto</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card-body p-0">
|
||||
<div class="table-responsive">
|
||||
<table class="table table-bordered mb-0">
|
||||
<thead class="table-light">
|
||||
<tr>
|
||||
<th style="width: 40px;" class="text-center">Lp</th>
|
||||
<th style="min-width: 250px;">Nazwa kosztu / Towaru</th>
|
||||
<th style="width: 120px;">Kod / PKWiU</th>
|
||||
<th style="width: 90px;">JM</th>
|
||||
<th style="width: 100px;">Ilość</th>
|
||||
<th style="width: 130px;">Cena Netto</th>
|
||||
<th style="width: 100px;">VAT</th>
|
||||
<th style="width: 130px;" class="text-end">Wartość Netto</th>
|
||||
<th style="width: 130px;" class="text-end">Wartość Brutto</th>
|
||||
<th style="width: 50px;"></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td class="align-middle text-center text-muted">1</td>
|
||||
<td class="p-2">
|
||||
<input type="text" class="form-control border-0 shadow-none fw-medium"
|
||||
placeholder="Np. Usługa księgowa, Paliwo...">
|
||||
</td>
|
||||
<td class="p-2">
|
||||
<input type="text" class="form-control border-0 shadow-none text-muted"
|
||||
placeholder="-">
|
||||
</td>
|
||||
<td class="p-2">
|
||||
<select class="form-select border-0 shadow-none px-1">
|
||||
<option value="szt">szt.</option>
|
||||
<option value="usl">usł.</option>
|
||||
<option value="m3">m3</option>
|
||||
<option value="litr">litr</option>
|
||||
</select>
|
||||
</td>
|
||||
<td class="p-2">
|
||||
<input type="number" class="form-control border-0 shadow-none text-center fw-bold"
|
||||
value="1" step="0.01">
|
||||
</td>
|
||||
<td class="p-2">
|
||||
<input type="number" class="form-control border-0 shadow-none text-end" value="0.00"
|
||||
step="0.01">
|
||||
</td>
|
||||
<td class="p-2">
|
||||
<select class="form-select border-0 shadow-none px-1">
|
||||
<option value="23">23%</option>
|
||||
<option value="8">8%</option>
|
||||
<option value="5">5%</option>
|
||||
<option value="0">0%</option>
|
||||
<option value="zw">ZW</option>
|
||||
</select>
|
||||
</td>
|
||||
<td class="align-middle text-end pe-3 bg-lighter">0,00 zł</td>
|
||||
<td class="align-middle text-end pe-3 bg-lighter fw-bold">0,00 zł</td>
|
||||
<td class="align-middle text-center p-2">
|
||||
<button class="btn btn-icon btn-sm btn-label-danger"><i
|
||||
class="bx bx-trash"></i></button>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div class="border-top p-3 text-end bg-light">
|
||||
<button class="btn btn-primary btn-sm"><i class="bx bx-plus me-1"></i> Dodaj kolejną
|
||||
pozycję</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="row">
|
||||
|
||||
<div class="col-lg-7 mb-4 mb-lg-0">
|
||||
<div class="card h-100">
|
||||
<div class="card-body">
|
||||
|
||||
<label class="form-label">Uwagi do dokumentu (wewnętrzne)</label>
|
||||
<textarea class="form-control bg-lighter" rows="3"
|
||||
placeholder="Wpisz uwagi widoczne tylko dla nas..."></textarea>
|
||||
|
||||
<div class="row g-2 mb-3 mt-3">
|
||||
<div class="col-md-4">
|
||||
<label class="form-label d-flex align-items-center">
|
||||
Waluta dokumentu
|
||||
<i class="bx bx-info-circle ms-1 fs-6 text-muted" data-bs-toggle="tooltip"
|
||||
data-bs-placement="top"
|
||||
title="Waluta w jakiej została wystawiona faktura przez dostawcę.">
|
||||
</i>
|
||||
</label>
|
||||
<select class="form-select">
|
||||
<option value="PLN">PLN</option>
|
||||
<option value="EUR">EUR</option>
|
||||
<option value="USD">USD</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="col-md-5">
|
||||
<label class="form-label d-flex align-items-center">
|
||||
Przelicznik (Kurs)
|
||||
<i class="bx bx-info-circle ms-1 fs-6 text-muted" data-bs-toggle="tooltip"
|
||||
data-bs-placement="top"
|
||||
title="Kurs waluty z dnia poprzedzającego wystawienie faktury.">
|
||||
</i>
|
||||
</label>
|
||||
<div class="input-group">
|
||||
<input type="number" id="exchangeRateInput" class="form-control" value="1.0000"
|
||||
disabled>
|
||||
<button class="btn btn-outline-secondary" type="button" id="unlockRateBtn"
|
||||
data-bs-toggle="tooltip" title="Odblokuj edycję kursu">
|
||||
<i class="bx bx-lock-open-alt"></i>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="d-flex align-items-center mt-3">
|
||||
<label class="form-check form-switch m-0">
|
||||
<input class="form-check-input" type="checkbox" checked>
|
||||
<span class="form-check-label">Podzielona płatność (MPP)</span>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-lg-5">
|
||||
<div class="card h-100">
|
||||
<div class="card-body">
|
||||
<h6 class="card-title mb-4">Podsumowanie</h6>
|
||||
|
||||
<div class="d-flex justify-content-between mb-2">
|
||||
<span class="text-muted">Suma Netto:</span>
|
||||
<span class="fw-semibold">0,00 zł</span>
|
||||
</div>
|
||||
<div class="d-flex justify-content-between mb-3 border-bottom pb-2">
|
||||
<span class="text-muted">Suma VAT:</span>
|
||||
<span class="fw-semibold">0,00 zł</span>
|
||||
</div>
|
||||
|
||||
<div class="d-flex justify-content-between align-items-center mb-4">
|
||||
<span class="h5 mb-0">Do zapłaty:</span>
|
||||
<span class="h4 mb-0 text-primary" id="finalTotal">0,00 zł</span>
|
||||
</div>
|
||||
|
||||
<div class="alert alert-warning d-flex align-items-start align-items-sm-center mb-0"
|
||||
role="alert">
|
||||
<i class="bx bx-bell-ring me-2 fs-4 mt-1 mt-sm-0"></i>
|
||||
<div class="small">
|
||||
<strong>Status: Nierozliczona.</strong>
|
||||
Faktura zostanie dodana do kalendarza płatności.
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
|
||||
</div>
|
||||
<div class="content-backdrop fade"></div>
|
||||
|
||||
|
||||
<?php include '../../footer.php'; ?>
|
||||
|
||||
<script>
|
||||
document.addEventListener('DOMContentLoaded', function () {
|
||||
// Inicjalizacja Datepickerów
|
||||
if (typeof flatpickr !== 'undefined') {
|
||||
document.querySelectorAll('.date-picker').forEach(picker => {
|
||||
flatpickr(picker, { dateFormat: 'Y-m-d' });
|
||||
});
|
||||
}
|
||||
|
||||
// Tooltipy
|
||||
var tooltipTriggerList = [].slice.call(document.querySelectorAll('[data-bs-toggle="tooltip"]'))
|
||||
var tooltipList = tooltipTriggerList.map(function (tooltipTriggerEl) {
|
||||
return new bootstrap.Tooltip(tooltipTriggerEl)
|
||||
});
|
||||
|
||||
// Obsługa odblokowania kursu waluty
|
||||
const unlockBtn = document.getElementById('unlockRateBtn');
|
||||
const rateInput = document.getElementById('exchangeRateInput');
|
||||
if (unlockBtn && rateInput) {
|
||||
unlockBtn.addEventListener('click', function () {
|
||||
rateInput.disabled = !rateInput.disabled;
|
||||
if (!rateInput.disabled) {
|
||||
rateInput.focus();
|
||||
unlockBtn.classList.remove('btn-outline-secondary');
|
||||
unlockBtn.classList.add('btn-primary');
|
||||
unlockBtn.innerHTML = '<i class="bx bx-lock-open-alt"></i>';
|
||||
} else {
|
||||
unlockBtn.classList.add('btn-outline-secondary');
|
||||
unlockBtn.classList.remove('btn-primary');
|
||||
unlockBtn.innerHTML = '<i class="bx bx-lock-alt"></i>';
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// Obsługa przycisku "Całość"
|
||||
const payFullBtn = document.getElementById('payFullBtn');
|
||||
const paidInput = document.getElementById('paidInput');
|
||||
// Tutaj symulujemy pobranie kwoty z podsumowania (normalnie z logiki JS liczącej tabelę)
|
||||
// Zakładamy, że user klika, a my bierzemy '0.00' lub cokolwiek tam jest
|
||||
if (payFullBtn && paidInput) {
|
||||
payFullBtn.addEventListener('click', function () {
|
||||
// W prawdziwej aplikacji pobrałbyś sumę z obiektu calculateTotal()
|
||||
// Tutaj dla przykładu wpiszemy placeholder, bo tabela jest pusta
|
||||
paidInput.value = "1230.00"; // Przykładowa wartość
|
||||
paidInput.focus();
|
||||
});
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
</body>
|
||||
|
||||
</html>
|
||||
@@ -451,9 +451,9 @@ include '../../header-invoice.php';
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="d-grid gap-2">
|
||||
<button class="btn btn-primary">Filtruj</button>
|
||||
<button class="btn btn-outline-secondary">Wyczyść</button>
|
||||
<div class="text-end gap-2">
|
||||
<button class="btn btn-outline-secondary">Wyczyść filtry</button>
|
||||
<button class="btn btn-primary">Wyszukaj</button>
|
||||
</div>
|
||||
|
||||
<div class="mt-4 pt-3 border-top text-center">
|
||||
|
||||
Reference in New Issue
Block a user