Compare commits
5 Commits
3da90baf4a
...
144aa81358
| Author | SHA1 | Date | |
|---|---|---|---|
| 144aa81358 | |||
| da4d77a808 | |||
| bed52bdcbd | |||
| bb114ced7b | |||
| c9845b2df9 |
@@ -449,7 +449,7 @@
|
||||
pop.className = 'comment-popover';
|
||||
|
||||
// Budowanie listy komentarzy
|
||||
let html = '<div style="max-height: 200px; overflow-y: auto;">';
|
||||
let html = '<div style="max-height: 600px; overflow-y: auto;">';
|
||||
|
||||
commentsList.forEach(data => {
|
||||
// Escape (chociaż API to robi, warto mieć warstwę w JS w razie czego, ale API już robi htmlspecialchars)
|
||||
@@ -496,12 +496,29 @@
|
||||
});
|
||||
});
|
||||
|
||||
// Obsługa interakcji (np. scrollbar)
|
||||
pop.addEventListener('mousedown', () => {
|
||||
pop._isInteracting = true;
|
||||
});
|
||||
|
||||
// Obsługa zamykania przy wyjechaniu z popovera
|
||||
pop.addEventListener('mouseleave', () => {
|
||||
if (activePopover === pop) {
|
||||
activePopover.remove();
|
||||
activePopover = null;
|
||||
}
|
||||
pop._leaveTimeout = setTimeout(() => {
|
||||
if (activePopover === pop) {
|
||||
// Jeśli user trzyma przycisk myszy (np. na scrollbarze), nie zamykaj
|
||||
if (pop._isInteracting) return;
|
||||
|
||||
if (!activePopover.matches(':hover') && !marker.matches(':hover')) {
|
||||
activePopover.remove();
|
||||
activePopover = null;
|
||||
}
|
||||
}
|
||||
}, 500); // Zwiększono do 500ms
|
||||
});
|
||||
|
||||
pop.addEventListener('mouseenter', () => {
|
||||
if (pop._leaveTimeout) clearTimeout(pop._leaveTimeout);
|
||||
if (marker._leaveTimeout) clearTimeout(marker._leaveTimeout);
|
||||
});
|
||||
|
||||
// Pozycjonowanie
|
||||
@@ -585,8 +602,11 @@
|
||||
} else {
|
||||
marker.style.display = 'none';
|
||||
if (activePopover && activePopover._associatedMarker === marker) {
|
||||
activePopover.remove();
|
||||
activePopover = null;
|
||||
// Jeśli element zniknął (np. scroll), ale user trzyma myszkę na popoverze - nie usuwaj
|
||||
if (!activePopover.matches(':hover') && !activePopover._isInteracting) {
|
||||
activePopover.remove();
|
||||
activePopover = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (e) { }
|
||||
@@ -604,6 +624,26 @@
|
||||
}
|
||||
}
|
||||
|
||||
// Global mouseup do resetowania flagi interakcji
|
||||
document.addEventListener('mouseup', () => {
|
||||
if (activePopover) {
|
||||
activePopover._isInteracting = false;
|
||||
// Opcjonalnie: sprawdź czy zamknąć, jeśli myszka jest poza
|
||||
if (activePopover && !activePopover.matches(':hover') && (!activePopover._associatedMarker || !activePopover._associatedMarker.matches(':hover'))) {
|
||||
// Możemy wywołać logikę zamykania, ale ona jest w mouseleave.
|
||||
// Jeśli user puścił myszkę POZA popoverem, mouseleave już dawno poszło (i timeout mógł zostać zablokowany przez flagę).
|
||||
// Więc tutaj warto sprawdzić.
|
||||
setTimeout(() => {
|
||||
// Sprawdź ponownie (bezpiecznik)
|
||||
if (activePopover && !activePopover._isInteracting && !activePopover.matches(':hover')) {
|
||||
activePopover.remove();
|
||||
activePopover = null;
|
||||
}
|
||||
}, 200);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
// START
|
||||
initUI();
|
||||
loadComments();
|
||||
|
||||
61
footer.php
Normal file
61
footer.php
Normal file
@@ -0,0 +1,61 @@
|
||||
<!-- Footer -->
|
||||
<footer class="content-footer footer bg-footer-theme">
|
||||
<div class="container-xxl d-flex flex-wrap justify-content-between py-2 flex-md-row flex-column">
|
||||
<div class="mb-2 mb-md-0">
|
||||
©
|
||||
<script>
|
||||
document.write(new Date().getFullYear());
|
||||
</script>
|
||||
, made with ❤️ by
|
||||
<a href="https://themeselection.com" target="_blank" class="footer-link fw-medium">ThemeSelection</a>
|
||||
</div>
|
||||
<div class="d-none d-lg-inline-block">
|
||||
<a href="https://demos.themeselection.com/sneat-bootstrap-html-admin-template/documentation/"
|
||||
target="_blank" class="footer-link me-4">Documentation</a>
|
||||
</div>
|
||||
</div>
|
||||
</footer>
|
||||
<!-- / Footer -->
|
||||
|
||||
<div class="content-backdrop fade"></div>
|
||||
</div>
|
||||
<!-- Content wrapper -->
|
||||
</div>
|
||||
<!-- / Layout page -->
|
||||
</div>
|
||||
|
||||
<!-- Overlay -->
|
||||
<div class="layout-overlay layout-menu-toggle"></div>
|
||||
|
||||
<!-- Drag Target Area To SlideIn Menu On Small Screens -->
|
||||
<div class="drag-target"></div>
|
||||
</div>
|
||||
<!-- / Layout wrapper -->
|
||||
|
||||
<!-- Core JS -->
|
||||
<!-- build:js assets/vendor/js/core.js -->
|
||||
|
||||
<script src="<?= $basePath ?>/assets/vendor/libs/jquery/jquery.js"></script>
|
||||
<script src="<?= $basePath ?>/assets/vendor/libs/popper/popper.js"></script>
|
||||
<script src="<?= $basePath ?>/assets/vendor/js/bootstrap.js"></script>
|
||||
<script src="<?= $basePath ?>/assets/vendor/libs/perfect-scrollbar/perfect-scrollbar.js"></script>
|
||||
<script src="<?= $basePath ?>/assets/vendor/libs/hammer/hammer.js"></script>
|
||||
|
||||
<script src="<?= $basePath ?>/assets/vendor/js/menu.js"></script>
|
||||
|
||||
<!-- endbuild -->
|
||||
|
||||
<!-- Vendors JS -->
|
||||
|
||||
<!-- Main JS -->
|
||||
<script src="<?= $basePath ?>/assets/js/main.js"></script>
|
||||
|
||||
<script>
|
||||
// Przekazujemy ścieżkę z PHP do globalnej zmiennej JS
|
||||
// Używamy json_encode dla bezpieczeństwa typów
|
||||
const MAGICO_BASE_URL = <?= json_encode($basePath); ?>;
|
||||
</script>
|
||||
|
||||
<?php if (!empty($enablePrototypeComments) && $enablePrototypeComments): ?>
|
||||
<script src="<?= $basePath ?>/assets/js/comments.js"></script>
|
||||
<?php endif; ?>
|
||||
80
header-invoice.php
Normal file
80
header-invoice.php
Normal file
@@ -0,0 +1,80 @@
|
||||
<?php
|
||||
$basePath = '';
|
||||
if ($_SERVER['HTTP_HOST'] === 'localhost' || $_SERVER['HTTP_HOST'] === '127.0.0.1') {
|
||||
$basePath = '/magico-prototype';
|
||||
}
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
|
||||
<html lang="en" class="light-style layout-navbar-fixed layout-menu-fixed layout-compact" dir="ltr"
|
||||
data-theme="theme-default" data-assets-path="<?= $basePath ?>/assets/"
|
||||
data-template="vertical-menu-template-no-customizer-starter">
|
||||
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport"
|
||||
content="width=device-width, initial-scale=1.0, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0" />
|
||||
|
||||
<title>invoice.magico</title>
|
||||
|
||||
<meta name="description" content="" />
|
||||
|
||||
<!-- Favicon -->
|
||||
<link rel="icon" type="image/x-icon" href="<?= $basePath ?>/assets/img/favicon/favicon.ico" />
|
||||
|
||||
<!-- Fonts -->
|
||||
<link rel="preconnect" href="https://fonts.googleapis.com" />
|
||||
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
|
||||
<link
|
||||
href="https://fonts.googleapis.com/css2?family=Public+Sans:ital,wght@0,300;0,400;0,500;0,600;0,700;1,300;1,400;1,500;1,600;1,700&display=swap"
|
||||
rel="stylesheet" />
|
||||
|
||||
<link rel="stylesheet" href="<?= $basePath ?>/assets/vendor/fonts/boxicons.css" />
|
||||
<!-- <link rel="stylesheet" href="<?= $basePath ?>/assets/vendor/fonts/fontawesome.css" /> -->
|
||||
<!-- <link rel="stylesheet" href="<?= $basePath ?>/assets/vendor/fonts/flag-icons.css" /> -->
|
||||
|
||||
<!-- Core CSS -->
|
||||
<link rel="stylesheet" href="<?= $basePath ?>/assets/vendor/css/rtl/core.css" />
|
||||
<link rel="stylesheet" href="<?= $basePath ?>/assets/vendor/css/rtl/theme-default.css" />
|
||||
<link rel="stylesheet" href="<?= $basePath ?>/assets/css/demo.css" />
|
||||
|
||||
<!-- Vendors CSS -->
|
||||
<link rel="stylesheet" href="<?= $basePath ?>/assets/vendor/libs/perfect-scrollbar/perfect-scrollbar.css" />
|
||||
|
||||
<!-- Page CSS -->
|
||||
|
||||
<!-- Helpers -->
|
||||
<script src="<?= $basePath ?>/assets/vendor/js/helpers.js"></script>
|
||||
<!--! Template customizer & Theme config files MUST be included after core stylesheets and helpers.js in the <head> section -->
|
||||
<!--? Config: Mandatory theme config file contain global vars & default theme options, Set your preferred theme option in this file. -->
|
||||
<script src="<?= $basePath ?>/assets/js/config.js"></script>
|
||||
|
||||
<?php if (!empty($enablePrototypeComments) && $enablePrototypeComments): ?>
|
||||
<link rel="stylesheet" href="<?= $basePath ?>/assets/css/comments.css">
|
||||
<?php endif; ?>
|
||||
|
||||
<style>
|
||||
@media (min-width: 1200px) {
|
||||
|
||||
.layout-menu-fixed .layout-menu,
|
||||
.layout-menu-fixed-offcanvas .layout-menu {
|
||||
padding-top: 50px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<!-- Layout wrapper -->
|
||||
<div class="layout-wrapper layout-content-navbar">
|
||||
<div class="layout-container">
|
||||
<!-- Menu -->
|
||||
|
||||
<?php include 'menu.php'; ?>
|
||||
<!-- / Menu -->
|
||||
|
||||
<!-- Layout container -->
|
||||
<div class="layout-page pt-0" style="padding-top: 0 !important;">
|
||||
|
||||
<!-- Content wrapper -->
|
||||
<div class="content-wrapper">
|
||||
552
prototype/invoice/app-invoice-add.php
Normal file
552
prototype/invoice/app-invoice-add.php
Normal file
@@ -0,0 +1,552 @@
|
||||
<?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</h4>
|
||||
<p class="text-muted mb-0">Wypełnij dane dokumentu</p>
|
||||
</div>
|
||||
<div class="d-flex align-content-center flex-wrap gap-2">
|
||||
<a href="app-invoice-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-4 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 me-2"></i>Sprzedawca</h6>
|
||||
</div>
|
||||
<div class="card-body pt-3">
|
||||
<div class="card shadow-none bg-lighter border mb-3">
|
||||
<div class="card-body p-3">
|
||||
<p class="mb-1 fw-bold">Magico Software sp. z o.o.</p>
|
||||
<p class="mb-1">Przemysłowa 11</p>
|
||||
<p class="mb-1">37-450 Stalowa Wola</p>
|
||||
<p class="mb-0">NIP: PL 865 258 23 86</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label class="form-label">Miejscowość</label>
|
||||
<input type="text" class="form-control" value="Stalowa Wola">
|
||||
</div>
|
||||
<div class="mb-0">
|
||||
<label class="form-label">Wystawił</label>
|
||||
<input type="text" class="form-control" value="Bartłomiej Banaczyk">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-lg-4 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-user me-2"></i>Kontrahent</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: 105px;">
|
||||
<i class="text-muted">Wybierz kontrahenta 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 mb-3">
|
||||
<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 kontrahenta</span>
|
||||
</label>
|
||||
<label class="form-check form-switch m-0">
|
||||
<input class="form-check-input" type="checkbox" id="recipientToggle">
|
||||
<span class="form-check-label text-muted">Odbiorca</span>
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<div class="mb-0">
|
||||
<label class="form-label">Odebrał</label>
|
||||
<input type="text" class="form-control" placeholder="Imię i nazwisko">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-lg-4 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-cog me-2"></i>Ustawienia Dokumentu</h6>
|
||||
</div>
|
||||
<div class="card-body pt-3">
|
||||
<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">Data dostawy</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">Termin</label>
|
||||
<input type="text" class="form-control date-picker" value="2026-02-24">
|
||||
</div>
|
||||
<div class="col-6">
|
||||
<label class="form-label small text-uppercase fw-bold text-muted"> </label>
|
||||
<select class="form-select">
|
||||
<option value="7">7 dni</option>
|
||||
<option value="14">14 dni</option>
|
||||
<option value="30">30 dni</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row g-2 mb-3">
|
||||
<div class="col-6">
|
||||
<label class="form-label">Płatność</label>
|
||||
<select class="form-select">
|
||||
<option value="przelew">Przelew</option>
|
||||
<option value="gotowka">Gotówka</option>
|
||||
<option value="karta">Karta</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="d-flex justify-content-between align-items-center">
|
||||
<label class="form-check form-switch m-0">
|
||||
<input class="form-check-input" type="checkbox" id="odsetki">
|
||||
<span class="form-check-label">Naliczaj odsetki</span>
|
||||
</label>
|
||||
<label class="form-check form-switch m-0">
|
||||
<input class="form-check-input" type="checkbox" checked>
|
||||
<span class="form-check-label">Wyświetl w panelu klienta</span>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card mb-4">
|
||||
<div class="card-header bg-label-primary py-2 d-flex justify-content-between align-items-center">
|
||||
<span class="fw-bold">Pozycje na fakturze</span>
|
||||
|
||||
<div class="d-flex align-items-center gap-3">
|
||||
<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;">Towar / Usługa</th>
|
||||
<th style="width: 120px;">Kod</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 align-middle">
|
||||
<div class="input-group input-group-merge border-0 shadow-none">
|
||||
<input type="text" class="form-control border-0 shadow-none fw-medium ps-0"
|
||||
placeholder="Wpisz nazwę towaru lub usługi..." value="">
|
||||
<span class="input-group-text border-0 ps-1 pe-0"
|
||||
style="background: transparent;">
|
||||
<button type="button" class="btn btn-icon btn-sm btn-label-secondary"
|
||||
data-bs-toggle="modal" data-bs-target="#searchProductModal"
|
||||
data-bs-toggle="tooltip" data-bs-placement="top" title="Wyszukaj">
|
||||
<i class="bx bx-search"></i>
|
||||
</button>
|
||||
</span>
|
||||
</div>
|
||||
</td>
|
||||
<td class="p-2">
|
||||
<input type="text" class="form-control border-0 shadow-none text-muted"
|
||||
placeholder="Kod">
|
||||
</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="godz">godz.</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>
|
||||
<tr>
|
||||
<td class="align-middle text-center text-muted">2</td>
|
||||
<td class="p-2"><input type="text" class="form-control border-0 shadow-none"
|
||||
placeholder="..."></td>
|
||||
<td class="p-2"><input type="text" class="form-control border-0 shadow-none"></td>
|
||||
<td class="p-2"><select class="form-select border-0 shadow-none px-1">
|
||||
<option>szt.</option>
|
||||
</select></td>
|
||||
<td class="p-2"><input type="number"
|
||||
class="form-control border-0 shadow-none text-center" value="1"></td>
|
||||
<td class="p-2"><input type="number" class="form-control border-0 shadow-none text-end"
|
||||
value="0.00"></td>
|
||||
<td class="p-2"><select class="form-select border-0 shadow-none px-1">
|
||||
<option>23%</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">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">
|
||||
<div class="d-flex align-items-end mb-4">
|
||||
<div class="me-3 flex-grow-1" style="max-width: 250px;">
|
||||
<label class="form-label fw-bold">Zapłacono:</label>
|
||||
<div class="input-group">
|
||||
<input type="number" class="form-control" value="0.00">
|
||||
<span class="input-group-text">PLN</span>
|
||||
</div>
|
||||
</div>
|
||||
<button class="btn btn-outline-primary">Rozlicz całość</button>
|
||||
</div>
|
||||
|
||||
<div class="mb-3">
|
||||
<label class="form-label ">Uwagi do dokumentu</label>
|
||||
<textarea class="form-control" rows="3"
|
||||
placeholder="Wpisz uwagi widoczne na fakturze..."></textarea>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="row g-2 mb-3">
|
||||
<div class="col-4">
|
||||
<label class="form-label d-flex align-items-center">
|
||||
Język faktury
|
||||
<i class="bx bx-info-circle ms-1 fs-6 text-muted" data-bs-toggle="tooltip"
|
||||
data-bs-placement="top"
|
||||
title="Określa język wydruku dokumentu. Standardowe nagłówki i etykiety zostaną przetłumaczone automatycznie.">
|
||||
</i>
|
||||
</label>
|
||||
<select class="form-select">
|
||||
<option value="pl">Polski</option>
|
||||
<option value="en">Angielski</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="col-4">
|
||||
<label class="form-label d-flex align-items-center">
|
||||
Waluta podstawowa
|
||||
<i class="bx bx-info-circle ms-1 fs-6 text-muted" data-bs-toggle="tooltip"
|
||||
data-bs-placement="top"
|
||||
title="Główna waluta transakcji i kwoty do zapłaty. Jest to waluta wiążąca dla wysyłki do KSeF.">
|
||||
</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-4">
|
||||
<label class="form-label d-flex align-items-center">
|
||||
Oryginalna waluta
|
||||
<i class="bx bx-info-circle ms-1 fs-6 text-muted" data-bs-toggle="tooltip"
|
||||
data-bs-placement="top"
|
||||
title="Służy do celów księgowych (np. przeliczenie VAT). Jeśli różni się od podstawowej, faktura wyświetli kwoty w dwóch walutach. Do KSeF trafia tylko waluta podstawowa.">
|
||||
</i>
|
||||
</label>
|
||||
<select class="form-select">
|
||||
<option value="PLN">PLN</option>
|
||||
<option value="EUR">EUR</option>
|
||||
</select>
|
||||
</div>
|
||||
</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">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 me-2 fs-4 mt-1 mt-sm-0"></i>
|
||||
<div class="small">
|
||||
<strong>Status: Nierozliczona.</strong> Funkcja automatycznych przypomnień jest aktywna.
|
||||
Twój kontrahent otrzyma powiadomienie, gdy minie termin płatności.
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
|
||||
</div>
|
||||
<div class="content-backdrop fade"></div>
|
||||
|
||||
<!-- Modal Wyszukiwania Produktu -->
|
||||
<div class="modal fade" id="searchProductModal" tabindex="-1" aria-hidden="true">
|
||||
<div class="modal-dialog modal-lg modal-dialog-centered" role="document">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title" id="modalCenterTitle">Wyszukaj towar lub usługę</h5>
|
||||
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div class="row mb-3">
|
||||
<div class="col-12 text-center">
|
||||
<div class="btn-group" role="group" aria-label="Database toggle">
|
||||
<button type="button" class="btn btn-label-primary active" data-bs-toggle="button"
|
||||
aria-pressed="true">Towary i usługi</button>
|
||||
<button type="button" class="btn btn-label-primary active" data-bs-toggle="button"
|
||||
aria-pressed="true">sync.magico</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row mb-4">
|
||||
<div class="col-12">
|
||||
<div class="input-group input-group-merge">
|
||||
<span class="input-group-text" id="basic-addon-search31"><i class="bx bx-search"></i></span>
|
||||
<input type="text" class="form-control form-control-lg" id="productSearchInput"
|
||||
placeholder="Wpisz szukaną frazę..." aria-label="Search..."
|
||||
aria-describedby="basic-addon-search31">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="table-responsive" style="max-height: 400px; overflow-y: auto;">
|
||||
<table class="table table-hover" id="productSearchTable">
|
||||
<thead class="table-light sticky-top">
|
||||
<tr>
|
||||
<th>Nazwa</th>
|
||||
<th style="width: 100px;">Jednostka</th>
|
||||
<th style="width: 120px;" class="text-end">Cena netto</th>
|
||||
<th style="width: 80px;"></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<!-- Mock Data -->
|
||||
<tr>
|
||||
<td>
|
||||
<span class="fw-medium">Usługa programistyczna</span>
|
||||
<small class="text-muted d-block">Kod: O-001</small>
|
||||
</td>
|
||||
<td>godz.</td>
|
||||
<td class="text-end">150,00 zł</td>
|
||||
<td class="text-end">
|
||||
<button class="btn btn-sm btn-primary" data-bs-dismiss="modal">Wybierz</button>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<span class="fw-medium">Hosting WWW - Pakiet Standard</span>
|
||||
<small class="text-muted d-block">Kod: U-002</small>
|
||||
</td>
|
||||
<td>szt.</td>
|
||||
<td class="text-end">300,00 zł</td>
|
||||
<td class="text-end">
|
||||
<button class="btn btn-sm btn-primary" data-bs-dismiss="modal">Wybierz</button>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<span class="fw-medium">Domena .pl (odnowienie)</span>
|
||||
<small class="text-muted d-block">Kod: D-003</small>
|
||||
</td>
|
||||
<td>szt.</td>
|
||||
<td class="text-end">100,00 zł</td>
|
||||
<td class="text-end">
|
||||
<button class="btn btn-sm btn-primary" data-bs-dismiss="modal">Wybierz</button>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<span class="fw-medium">Certyfikat SSL (roczny)</span>
|
||||
<small class="text-muted d-block">Kod: S-004</small>
|
||||
</td>
|
||||
<td>szt.</td>
|
||||
<td class="text-end">150,00 zł</td>
|
||||
<td class="text-end">
|
||||
<button class="btn btn-sm btn-primary" data-bs-dismiss="modal">Wybierz</button>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<span class="fw-medium">Audyt bezpieczeństwa aplikacji</span>
|
||||
<small class="text-muted d-block">Kod: A-005</small>
|
||||
</td>
|
||||
<td>usł.</td>
|
||||
<td class="text-end">2 500,00 zł</td>
|
||||
<td class="text-end">
|
||||
<button class="btn btn-sm btn-primary" data-bs-dismiss="modal">Wybierz</button>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<span class="fw-medium">Konsultacje techniczne</span>
|
||||
<small class="text-muted d-block">Kod: K-006</small>
|
||||
</td>
|
||||
<td>godz.</td>
|
||||
<td class="text-end">200,00 zł</td>
|
||||
<td class="text-end">
|
||||
<button class="btn btn-sm btn-primary" data-bs-dismiss="modal">Wybierz</button>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<span class="fw-medium">Projekt graficzny strony www</span>
|
||||
<small class="text-muted d-block">Kod: P-007</small>
|
||||
</td>
|
||||
<td>usł.</td>
|
||||
<td class="text-end">3 000,00 zł</td>
|
||||
<td class="text-end">
|
||||
<button class="btn btn-sm btn-primary" data-bs-dismiss="modal">Wybierz</button>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<span class="fw-medium">Administracja serwerem (abonament)</span>
|
||||
<small class="text-muted d-block">Kod: M-008</small>
|
||||
</td>
|
||||
<td>m-c</td>
|
||||
<td class="text-end">500,00 zł</td>
|
||||
<td class="text-end">
|
||||
<button class="btn btn-sm btn-primary" data-bs-dismiss="modal">Wybierz</button>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<!-- <div class="modal-footer">
|
||||
<button type="button" class="btn btn-label-secondary" data-bs-dismiss="modal">Zamknij</button>
|
||||
</div> -->
|
||||
</div>
|
||||
</div>
|
||||
</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' });
|
||||
});
|
||||
}
|
||||
});
|
||||
</script>
|
||||
<script>
|
||||
document.addEventListener('DOMContentLoaded', function () {
|
||||
// Search Filter
|
||||
const searchInput = document.getElementById('productSearchInput');
|
||||
const table = document.getElementById('productSearchTable');
|
||||
const rows = table.getElementsByTagName('tr');
|
||||
|
||||
searchInput.addEventListener('keyup', function () {
|
||||
const filter = searchInput.value.toLowerCase();
|
||||
for (let i = 1; i < rows.length; i++) {
|
||||
const row = rows[i];
|
||||
const cells = row.getElementsByTagName('td');
|
||||
let found = false;
|
||||
if (cells.length > 0) {
|
||||
const name = cells[0].textContent.toLowerCase();
|
||||
if (name.indexOf(filter) > -1) {
|
||||
found = true;
|
||||
}
|
||||
}
|
||||
row.style.display = found ? '' : 'none';
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
</body>
|
||||
|
||||
</html>
|
||||
617
prototype/invoice/app-invoice-list.php
Normal file
617
prototype/invoice/app-invoice-list.php
Normal file
@@ -0,0 +1,617 @@
|
||||
<?php
|
||||
$enablePrototypeComments = true;
|
||||
include '../../header-invoice.php';
|
||||
?>
|
||||
|
||||
<div class="container-fluid flex-grow-1 container-p-y">
|
||||
|
||||
<h4 class="py-3 mb-4">
|
||||
<span class="text-muted fw-light">Sprzedaż /</span> Faktury VAT
|
||||
</h4>
|
||||
|
||||
<div class="d-flex mb-3 gap-2 align-items-center flex-nowrap overflow-auto pb-2">
|
||||
<a href="app-invoice-list.php" class="btn btn-label-primary text-nowrap">
|
||||
<i class="bx bx-check-circle me-1"></i> Faktury VAT
|
||||
</a>
|
||||
<a href="app-invoice-list-vat-margin.php" class="btn btn-label-secondary text-nowrap">
|
||||
Faktura VAT marża
|
||||
</a>
|
||||
<a href="#" class="btn btn-label-secondary text-nowrap">
|
||||
Proformy
|
||||
</a>
|
||||
<a href="#" class="btn btn-label-secondary text-nowrap">
|
||||
Zaliczkowe
|
||||
</a>
|
||||
<a href="#" class="btn btn-label-secondary text-nowrap">
|
||||
Korekty
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
|
||||
<div class="col-lg-9" id="invoice-list-col">
|
||||
<div class="card">
|
||||
<div
|
||||
class="card-header border-bottom d-flex justify-content-between align-items-center flex-wrap gap-2">
|
||||
|
||||
<div class="me-2">
|
||||
<div class="input-group input-group-merge">
|
||||
<span class="input-group-text" id="basic-addon-search31"><i class="bx bx-search"></i></span>
|
||||
<input type="text" class="form-control" placeholder="Wpisz aby wyszukać"
|
||||
aria-label="Search..." aria-describedby="basic-addon-search31">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="d-flex align-items-center gap-2">
|
||||
|
||||
<div class="dropdown">
|
||||
<button type="button" class="btn btn-label-secondary p-2" data-bs-toggle="dropdown"
|
||||
aria-expanded="false">
|
||||
<i class="bx bx-cog"></i>
|
||||
</button>
|
||||
|
||||
<ul class="dropdown-menu dropdown-menu-end">
|
||||
<li>
|
||||
<h6 class="dropdown-header">Widoczność kolumn</h6>
|
||||
</li>
|
||||
<li>
|
||||
<div class="dropdown-item">
|
||||
<div class="form-check"><input class="form-check-input" type="checkbox" checked>
|
||||
<label class="form-check-label">Numer faktury</label>
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
<li>
|
||||
<div class="dropdown-item">
|
||||
<div class="form-check"><input class="form-check-input" type="checkbox" checked>
|
||||
<label class="form-check-label">Kontrahent</label>
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
<li>
|
||||
<div class="dropdown-item">
|
||||
<div class="form-check"><input class="form-check-input" type="checkbox" checked>
|
||||
<label class="form-check-label">Kwota Netto</label>
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<button type="button" class="btn btn-label-secondary d-flex align-items-center gap-2"
|
||||
id="filter-toggle-btn">
|
||||
<i class="bx bx-filter-alt"></i> Filtry (2)
|
||||
</button>
|
||||
|
||||
<select class="form-select" style="width: 80px;">
|
||||
<option value="40">40</option>
|
||||
<option value="60">60</option>
|
||||
<option value="100">100</option>
|
||||
</select>
|
||||
|
||||
<a href="app-invoice-add.php" class="btn btn-primary">
|
||||
<i class="bx bx-plus me-1"></i> <span class="d-none d-sm-inline-block">Utwórz fakturę</span>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="table-responsive text-nowrap" style="min-height: 400px;">
|
||||
<table class="table table-hover table-striped">
|
||||
<thead class="table-light">
|
||||
<tr>
|
||||
<th style="width: 50px;">#</th>
|
||||
<th>Numer faktury</th>
|
||||
<th>Kontrahent</th>
|
||||
<th>Data wyst.</th>
|
||||
<th>Termin</th>
|
||||
<th class="text-end">Netto</th>
|
||||
<th class="text-end">Brutto</th>
|
||||
<th class="text-end">Do zapłaty</th>
|
||||
<th class="text-center">Akcje</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody class="table-border-bottom-0">
|
||||
|
||||
<tr>
|
||||
<td>1</td>
|
||||
<td><a href="app-invoice-preview.php">FV/18/02/2026/MS</a></td>
|
||||
<td>
|
||||
<div class="d-flex justify-content-start align-items-center">
|
||||
<div class="d-flex flex-column">
|
||||
<span class="text-heading text-truncate fw-medium"
|
||||
style="max-width: 200px;">Adam Malicki</span>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
<td>2026-02-16</td>
|
||||
<td>2026-02-16</td>
|
||||
<td class="text-end">900,00 zł</td>
|
||||
<td class="text-end">1107,00 zł</td>
|
||||
<td class="text-end">0,00 zł</td>
|
||||
<td class="text-center">
|
||||
<div class="d-flex justify-content-center align-items-center gap-1">
|
||||
<span class="badge badge-dot bg-secondary me-1"
|
||||
title="KSeF: Nie wysłano"></span> <a href="#"
|
||||
class="btn btn-icon btn-sm text-success" title="Wyślij e-mail"><i
|
||||
class="bx bx-send"></i></a>
|
||||
<a href="app-invoice-preview.php" class="btn btn-icon btn-sm text-secondary"
|
||||
title="Podgląd"><i class="bx bx-show"></i></a>
|
||||
<div class="dropdown">
|
||||
<button type="button" class="btn p-0 dropdown-toggle hide-arrow"
|
||||
data-bs-toggle="dropdown">
|
||||
<i class="bx bx-dots-vertical-rounded"></i>
|
||||
</button>
|
||||
<div class="dropdown-menu dropdown-menu-end">
|
||||
|
||||
<a class="dropdown-item" href="app-invoice-edit.php">
|
||||
<i class="bx bx-edit-alt me-1"></i> Edytuj
|
||||
</a>
|
||||
<a class="dropdown-item" href="#">
|
||||
<i class="bx bx-show me-1"></i> Podgląd
|
||||
</a>
|
||||
<a class="dropdown-item" href="#" target="_blank">
|
||||
<i class="bx bx-printer me-1"></i> Drukuj (PDF)
|
||||
</a>
|
||||
|
||||
<div class="dropdown-divider"></div>
|
||||
|
||||
<h6 class="dropdown-header text-uppercase ps-3">Finanse</h6>
|
||||
<a class="dropdown-item" href="#">
|
||||
<i class="bx bx-money me-1"></i> Rozlicz fakturę
|
||||
</a>
|
||||
<a class="dropdown-item" href="#">
|
||||
<i class="bx bx-revision me-1"></i> Wystaw korektę
|
||||
</a>
|
||||
|
||||
<div class="dropdown-divider"></div>
|
||||
|
||||
<h6 class="dropdown-header text-uppercase ps-3">Wysyłka</h6>
|
||||
<a class="dropdown-item d-flex justify-content-between align-items-center"
|
||||
href="#">
|
||||
<span>
|
||||
<i class="bx bx-cloud-upload me-1"></i> Wyślij do KSeF
|
||||
</span>
|
||||
</a>
|
||||
|
||||
<!-- Przykład, kiedy pozycja jest już wysłana -->
|
||||
<a class="dropdown-item d-flex justify-content-between align-items-center"
|
||||
href="#">
|
||||
<span><i class="bx bx-envelope me-1"></i> Wyślij fakturę</span>
|
||||
<span data-bs-toggle="tooltip" data-bs-placement="top"
|
||||
title="Wysłano: 2026-02-16 10:30" class="ms-2">
|
||||
<i class="bx bx-check-circle text-success"></i>
|
||||
</span>
|
||||
</a>
|
||||
|
||||
<a class="dropdown-item d-flex justify-content-between align-items-center"
|
||||
href="#">
|
||||
<span>
|
||||
<i class="bx bx-check-shield me-1"></i> Wyślij potwierdzenie
|
||||
</span>
|
||||
<span data-bs-toggle="tooltip" data-bs-placement="top"
|
||||
title="Wysłano: 2026-02-16 10:30" class="ms-2">
|
||||
<i class="bx bx-check-circle text-success"></i>
|
||||
</span>
|
||||
</a>
|
||||
<a class="dropdown-item d-flex justify-content-between align-items-center"
|
||||
href="#">
|
||||
<span>
|
||||
<i class="bx bx-bell me-1 text-warning"></i> Wyślij ponaglenie
|
||||
</span>
|
||||
</a>
|
||||
|
||||
<div class="dropdown-divider"></div>
|
||||
|
||||
<a class="dropdown-item" href="#">
|
||||
<i class="bx bx-duplicate me-1"></i> Duplikuj jako nową
|
||||
</a>
|
||||
<a class="dropdown-item text-danger" href="#">
|
||||
<i class="bx bx-trash me-1"></i> Usuń fakturę
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>2</td>
|
||||
<td><a href="app-invoice-preview.php">FV/17/02/2026/MS</a></td>
|
||||
<td>
|
||||
<span class="text-heading text-truncate fw-medium" style="max-width: 200px;">Gmina
|
||||
Nowa Sarzyna</span>
|
||||
</td>
|
||||
<td>2026-02-14</td>
|
||||
<td><span class="text-danger">2026-03-01</span></td>
|
||||
<td class="text-end">400,00 zł</td>
|
||||
<td class="text-end">492,00 zł</td>
|
||||
<td class="text-end text-danger">492,00 zł</td>
|
||||
<td class="text-center">
|
||||
<div class="d-flex justify-content-center align-items-center gap-1">
|
||||
<span class="badge badge-dot bg-secondary me-1"
|
||||
title="KSeF: Nie wysłano"></span>
|
||||
<a href="#" class="btn btn-icon btn-sm text-secondary" title="Wyślij e-mail"><i
|
||||
class="bx bx-send"></i></a>
|
||||
<a href="app-invoice-preview.php" class="btn btn-icon btn-sm text-secondary"
|
||||
title="Podgląd"><i class="bx bx-show"></i></a>
|
||||
<div class="dropdown">
|
||||
<button type="button" class="btn btn-sm p-0 dropdown-toggle hide-arrow"
|
||||
data-bs-toggle="dropdown"><i
|
||||
class="bx bx-dots-vertical-rounded"></i></button>
|
||||
<div class="dropdown-menu dropdown-menu-end">
|
||||
<a class="dropdown-item" href="javascript:void(0);"><i
|
||||
class="bx bx-money me-1"></i> Rozlicz</a>
|
||||
<a class="dropdown-item" href="javascript:void(0);"><i
|
||||
class="bx bx-envelope me-1"></i> Wyślij ponaglenie</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>3</td>
|
||||
<td><a href="app-invoice-preview.php">FV/16/02/2026/MS</a></td>
|
||||
<td>
|
||||
<i class="bx bx-note text-warning me-1" title="Adres spoza bazy (custom)"></i>
|
||||
<span class="text-heading text-truncate fw-medium"
|
||||
style="max-width: 200px;">PROFIMED GABINET...</span>
|
||||
</td>
|
||||
<td>2026-02-13</td>
|
||||
<td>2026-02-20</td>
|
||||
<td class="text-end">960,00 zł</td>
|
||||
<td class="text-end">1180,80 zł</td>
|
||||
<td class="text-end text-danger">1180,80 zł</td>
|
||||
<td class="text-center">
|
||||
<div class="d-flex justify-content-center align-items-center gap-1">
|
||||
<span class="badge badge-dot bg-success me-1" title="KSeF: Wysłano"></span>
|
||||
<a href="#" class="btn btn-icon btn-sm text-secondary"><i
|
||||
class="bx bx-send"></i></a>
|
||||
<a href="app-invoice-preview.php" class="btn btn-icon btn-sm text-secondary"><i
|
||||
class="bx bx-show"></i></a>
|
||||
<div class="dropdown">
|
||||
<button type="button" class="btn btn-sm p-0 dropdown-toggle hide-arrow"
|
||||
data-bs-toggle="dropdown"><i
|
||||
class="bx bx-dots-vertical-rounded"></i></button>
|
||||
<div class="dropdown-menu dropdown-menu-end">
|
||||
<a class="dropdown-item" href="javascript:void(0);"><i
|
||||
class="bx bx-edit-alt me-1"></i> Edytuj</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>4</td>
|
||||
<td><a href="app-invoice-preview.php">FV/15/02/2026/MS</a></td>
|
||||
<td>
|
||||
<div class="d-flex justify-content-start align-items-center">
|
||||
<div class="d-flex flex-column">
|
||||
<span class="text-heading text-truncate fw-medium"
|
||||
style="max-width: 200px;">TechSolutions Sp. z o.o.</span>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
<td>2026-02-12</td>
|
||||
<td>2026-02-26</td>
|
||||
<td class="text-end">2 500,00 zł</td>
|
||||
<td class="text-end">3 075,00 zł</td>
|
||||
<td class="text-end text-danger">3 075,00 zł</td>
|
||||
<td class="text-center">
|
||||
<div class="d-flex justify-content-center align-items-center gap-1">
|
||||
<span class="badge badge-dot bg-secondary me-1"
|
||||
title="KSeF: Nie wysłano"></span> <a href="#"
|
||||
class="btn btn-icon btn-sm text-success" title="Wyślij e-mail"><i
|
||||
class="bx bx-send"></i></a>
|
||||
<a href="app-invoice-preview.php" class="btn btn-icon btn-sm text-secondary"
|
||||
title="Podgląd"><i class="bx bx-show"></i></a>
|
||||
<div class="dropdown">
|
||||
<button type="button" class="btn btn-sm p-0 dropdown-toggle hide-arrow"
|
||||
data-bs-toggle="dropdown"><i
|
||||
class="bx bx-dots-vertical-rounded"></i></button>
|
||||
<div class="dropdown-menu dropdown-menu-end">
|
||||
<a class="dropdown-item" href="app-invoice-edit.php"><i
|
||||
class="bx bx-edit-alt me-1"></i> Edytuj</a>
|
||||
<a class="dropdown-item" href="javascript:void(0);"><i
|
||||
class="bx bx-printer me-1"></i> Drukuj</a>
|
||||
<div class="dropdown-divider"></div>
|
||||
<a class="dropdown-item text-danger" href="javascript:void(0);"><i
|
||||
class="bx bx-trash me-1"></i> Usuń</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>5</td>
|
||||
<td><a href="app-invoice-preview.php">FV/14/02/2026/MS</a></td>
|
||||
<td>
|
||||
<span class="text-heading text-truncate fw-medium" style="max-width: 200px;">Jan
|
||||
Kowalski Usługi</span>
|
||||
</td>
|
||||
<td>2026-02-10</td>
|
||||
<td>2026-02-24</td>
|
||||
<td class="text-end">150,00 zł</td>
|
||||
<td class="text-end">184,50 zł</td>
|
||||
<td class="text-end">0,00 zł</td>
|
||||
<td class="text-center">
|
||||
<div class="d-flex justify-content-center align-items-center gap-1">
|
||||
<span class="badge badge-dot bg-success me-1" title="KSeF: Wysłano"></span>
|
||||
<a href="#" class="btn btn-icon btn-sm text-secondary" title="Wyślij e-mail"><i
|
||||
class="bx bx-send"></i></a>
|
||||
<a href="app-invoice-preview.php" class="btn btn-icon btn-sm text-secondary"
|
||||
title="Podgląd"><i class="bx bx-show"></i></a>
|
||||
<div class="dropdown">
|
||||
<button type="button" class="btn btn-sm p-0 dropdown-toggle hide-arrow"
|
||||
data-bs-toggle="dropdown"><i
|
||||
class="bx bx-dots-vertical-rounded"></i></button>
|
||||
<div class="dropdown-menu dropdown-menu-end">
|
||||
<a class="dropdown-item" href="javascript:void(0);"><i
|
||||
class="bx bx-edit-alt me-1"></i> Edytuj</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>6</td>
|
||||
<td><a href="app-invoice-preview.php">FV/12/02/2026/MS</a></td>
|
||||
<td>
|
||||
<span class="text-heading text-truncate fw-medium" style="max-width: 200px;">Global
|
||||
Trans Logistics</span>
|
||||
</td>
|
||||
<td>2026-02-08</td>
|
||||
<td>2026-02-22</td>
|
||||
<td class="text-end">12 000,00 zł</td>
|
||||
<td class="text-end">14 760,00 zł</td>
|
||||
<td class="text-end text-danger">5 000,00 zł</td>
|
||||
<td class="text-center">
|
||||
<div class="d-flex justify-content-center align-items-center gap-1">
|
||||
<span class="badge badge-dot bg-warning me-1"
|
||||
title="KSeF: Przetwarzanie"></span>
|
||||
<a href="#" class="btn btn-icon btn-sm text-secondary"><i
|
||||
class="bx bx-send"></i></a>
|
||||
<a href="app-invoice-preview.php" class="btn btn-icon btn-sm text-secondary"><i
|
||||
class="bx bx-show"></i></a>
|
||||
<div class="dropdown">
|
||||
<button type="button" class="btn btn-sm p-0 dropdown-toggle hide-arrow"
|
||||
data-bs-toggle="dropdown"><i
|
||||
class="bx bx-dots-vertical-rounded"></i></button>
|
||||
<div class="dropdown-menu dropdown-menu-end">
|
||||
<a class="dropdown-item" href="javascript:void(0);"><i
|
||||
class="bx bx-money me-1"></i> Rozlicz</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>7</td>
|
||||
<td><a href="app-invoice-preview.php">FV/11/02/2026/MS</a></td>
|
||||
<td>
|
||||
<i class="bx bx-store-alt text-info me-1" title="Sklep stacjonarny"></i>
|
||||
<span class="text-heading text-truncate fw-medium"
|
||||
style="max-width: 200px;">Kwiaciarnia "Stokrotka"</span>
|
||||
</td>
|
||||
<td>2026-01-15</td>
|
||||
<td><span class="text-danger">2026-01-29</span></td>
|
||||
<td class="text-end">300,00 zł</td>
|
||||
<td class="text-end">324,00 zł</td>
|
||||
<td class="text-end text-danger">324,00 zł</td>
|
||||
<td class="text-center">
|
||||
<div class="d-flex justify-content-center align-items-center gap-1">
|
||||
<span class="badge badge-dot bg-danger me-1" title="KSeF: Błąd"></span>
|
||||
<a href="#" class="btn btn-icon btn-sm text-secondary"><i
|
||||
class="bx bx-send"></i></a>
|
||||
<a href="app-invoice-preview.php" class="btn btn-icon btn-sm text-secondary"><i
|
||||
class="bx bx-show"></i></a>
|
||||
<div class="dropdown">
|
||||
<button type="button" class="btn btn-sm p-0 dropdown-toggle hide-arrow"
|
||||
data-bs-toggle="dropdown"><i
|
||||
class="bx bx-dots-vertical-rounded"></i></button>
|
||||
<div class="dropdown-menu dropdown-menu-end">
|
||||
<a class="dropdown-item" href="javascript:void(0);"><i
|
||||
class="bx bx-envelope me-1"></i> Wyślij ponaglenie</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>8</td>
|
||||
<td><a href="app-invoice-preview.php">FV/10/02/2026/MS</a></td>
|
||||
<td>
|
||||
<span class="text-heading text-truncate fw-medium" style="max-width: 200px;">SoftDev
|
||||
Inc.</span>
|
||||
</td>
|
||||
<td>2026-02-01</td>
|
||||
<td>2026-02-15</td>
|
||||
<td class="text-end">5 000,00 zł</td>
|
||||
<td class="text-end">6 150,00 zł</td>
|
||||
<td class="text-end">0,00 zł</td>
|
||||
<td class="text-center">
|
||||
<div class="d-flex justify-content-center align-items-center gap-1">
|
||||
<span class="badge badge-dot bg-success me-1" title="KSeF: Wysłano"></span>
|
||||
<a href="#" class="btn btn-icon btn-sm text-secondary"><i
|
||||
class="bx bx-send"></i></a>
|
||||
<a href="app-invoice-preview.php" class="btn btn-icon btn-sm text-secondary"><i
|
||||
class="bx bx-show"></i></a>
|
||||
<div class="dropdown">
|
||||
<button type="button" class="btn btn-sm p-0 dropdown-toggle hide-arrow"
|
||||
data-bs-toggle="dropdown"><i
|
||||
class="bx bx-dots-vertical-rounded"></i></button>
|
||||
<div class="dropdown-menu dropdown-menu-end">
|
||||
<a class="dropdown-item" href="javascript:void(0);"><i
|
||||
class="bx bx-download me-1"></i> Pobierz</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr class="bg-label-secondary">
|
||||
<td colspan="5" class="text-end fw-bold">Suma (PLN):</td>
|
||||
<td class="text-end fw-bold">254 275,93 zł</td>
|
||||
<td class="text-end fw-bold">312 759,36 zł</td>
|
||||
<td class="text-end text-danger">32 958,12 zł</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div class="card-footer d-flex justify-content-center border-top">
|
||||
<nav aria-label="Page navigation">
|
||||
<ul class="pagination pagination-sm mb-0">
|
||||
<li class="page-item prev"><a class="page-link" href="javascript:void(0);"><i
|
||||
class="tf-icon bx bx-chevron-left"></i></a></li>
|
||||
<li class="page-item active"><a class="page-link" href="javascript:void(0);">1</a></li>
|
||||
<li class="page-item"><a class="page-link" href="javascript:void(0);">2</a></li>
|
||||
<li class="page-item"><a class="page-link" href="javascript:void(0);">3</a></li>
|
||||
<li class="page-item"><a class="page-link" href="javascript:void(0);">4</a></li>
|
||||
<li class="page-item next"><a class="page-link" href="javascript:void(0);"><i
|
||||
class="tf-icon bx bx-chevron-right"></i></a></li>
|
||||
</ul>
|
||||
</nav>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-lg-3" id="invoice-filters-col">
|
||||
<div class="card sticky-top" style="top: 20px;">
|
||||
<div class="card-header border-bottom">
|
||||
<h5 class="card-title mb-0">Filtry</h5>
|
||||
</div>
|
||||
<div class="card-body pt-4">
|
||||
|
||||
<div class="mb-3">
|
||||
<label class="form-label">Kontrahent</label>
|
||||
<select class="select2 form-select" data-allow-clear="true" placeholder="Wybierz kontrahenta">
|
||||
<option value="">Wszyscy</option>
|
||||
<option value="1">MCreo Mateusz Łada</option>
|
||||
<option value="2">"AUTO-CARS" Kołodziej Krzysztof</option>
|
||||
<option value="3">GMINA STALOWA WOLA</option>
|
||||
<option value="4">Majami Mateusz Szczoczarz</option>
|
||||
<option value="5">"GRABOWSKI" PIOTR GRABOWSKI</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="mb-3">
|
||||
<label class="form-label">Status rozliczenia</label>
|
||||
<div class="d-flex flex-column gap-2">
|
||||
<div class="form-check">
|
||||
<input name="status-radio" class="form-check-input" type="radio" value="" id="statusAll"
|
||||
checked>
|
||||
<label class="form-check-label" for="statusAll"> Wszystkie </label>
|
||||
</div>
|
||||
<div class="form-check">
|
||||
<input name="status-radio" class="form-check-input" type="radio" value=""
|
||||
id="statusUnpaid">
|
||||
<label class="form-check-label" for="statusUnpaid"> Nierozliczone </label>
|
||||
</div>
|
||||
<div class="form-check">
|
||||
<input name="status-radio" class="form-check-input" type="radio" value=""
|
||||
id="statusPaid">
|
||||
<label class="form-check-label" for="statusPaid"> Rozliczone </label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="mb-3">
|
||||
<label class="form-label">Data utworzenia</label>
|
||||
<input type="text" class="form-control flatpickr-range"
|
||||
placeholder="RRRR-MM-DD do RRRR-MM-DD" />
|
||||
</div>
|
||||
|
||||
<div class="mb-3">
|
||||
<label class="form-label">Numer faktury</label>
|
||||
<input type="text" class="form-control" placeholder="np. FV/12/2026">
|
||||
</div>
|
||||
|
||||
<div class="mb-3">
|
||||
<label class="form-label">Termin płatności</label>
|
||||
<div class="d-flex flex-column gap-2">
|
||||
<div class="form-check">
|
||||
<input name="term-radio" class="form-check-input" type="radio" value="" id="termAll"
|
||||
checked>
|
||||
<label class="form-check-label" for="termAll"> Wszystkie </label>
|
||||
</div>
|
||||
<div class="form-check">
|
||||
<input name="term-radio" class="form-check-input" type="radio" value=""
|
||||
id="termOverdue">
|
||||
<label class="form-check-label" for="termOverdue"> Po terminie </label>
|
||||
</div>
|
||||
<div class="form-check">
|
||||
<input name="term-radio" class="form-check-input" type="radio" value="" id="termIntime">
|
||||
<label class="form-check-label" for="termIntime"> W terminie </label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="text-end gap-2">
|
||||
<button class="btn btn-outline-secondary">Wyczyść filtry</button>
|
||||
<button class="btn btn-primary">Wyszukaj</button>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="content-backdrop fade"></div>
|
||||
|
||||
|
||||
<?php include '../../footer.php'; ?>
|
||||
|
||||
<script>
|
||||
document.addEventListener('DOMContentLoaded', function () {
|
||||
// Inicjalizacja Select2 dla filtrów (jeśli dodasz jQuery w footerze)
|
||||
if ($('.select2').length) {
|
||||
$('.select2').select2({
|
||||
minimumResultsForSearch: 5 // Pokaż szukajkę dopiero przy 5 opcjach
|
||||
});
|
||||
}
|
||||
|
||||
// Inicjalizacja Flatpickr dla dat
|
||||
if (typeof flatpickr !== 'undefined') {
|
||||
document.querySelectorAll('.flatpickr-range').forEach(function (element) {
|
||||
flatpickr(element, {
|
||||
mode: 'range',
|
||||
dateFormat: 'Y-m-d'
|
||||
});
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
// Obsługa przycisku filtrów
|
||||
document.addEventListener('DOMContentLoaded', function () {
|
||||
const filterBtn = document.getElementById('filter-toggle-btn');
|
||||
const filtersCol = document.getElementById('invoice-filters-col');
|
||||
const listCol = document.getElementById('invoice-list-col');
|
||||
|
||||
if (filterBtn && filtersCol && listCol) {
|
||||
filterBtn.addEventListener('click', function () {
|
||||
filtersCol.classList.toggle('d-none');
|
||||
|
||||
if (filtersCol.classList.contains('d-none')) {
|
||||
listCol.classList.remove('col-lg-9');
|
||||
listCol.classList.add('col-lg-12');
|
||||
} else {
|
||||
listCol.classList.remove('col-lg-12');
|
||||
listCol.classList.add('col-lg-9');
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
</body>
|
||||
|
||||
</html>
|
||||
534
prototype/invoice/app-purchase-add.php
Normal file
534
prototype/invoice/app-purchase-add.php
Normal file
@@ -0,0 +1,534 @@
|
||||
<?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">
|
||||
|
||||
<!-- Left Column: Seller & Buyer -->
|
||||
<div class="col-lg-5 col-md-12 mb-3 mb-lg-0">
|
||||
|
||||
<!-- Buyer Card -->
|
||||
<div class="card bg-label-secondary border-0 mb-3">
|
||||
<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</h6>
|
||||
<small class="d-block fw-bold text-truncate">Magico Software</small>
|
||||
<small class="text-muted text-truncate">NIP: 8652582386</small>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Seller Card -->
|
||||
<div class="card mb-3">
|
||||
<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>
|
||||
|
||||
<!-- Right Column: Document Data -->
|
||||
<div class="col-lg-7 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">
|
||||
|
||||
<!-- OCR Dropzone -->
|
||||
<div class="dropzone p-4 border-dashed border-2 rounded text-center mb-3 d-flex flex-column justify-content-center align-items-center"
|
||||
style="border-color: #d9dee3; background-color: #f8f9fa; cursor: pointer; transition: 0.2s;"
|
||||
onmouseover="this.style.borderColor='#696cff'; this.style.backgroundColor='#f0f2ff';"
|
||||
onmouseout="this.style.borderColor='#d9dee3'; this.style.backgroundColor='#f8f9fa';">
|
||||
<i class="bx bx-cloud-upload fs-2 text-muted mb-2"></i>
|
||||
<span class="text-muted fw-bold">Przeciągnij fakturę tutaj lub kliknij</span>
|
||||
<span class="small text-muted">(PDF, JPG, PNG)</span>
|
||||
</div>
|
||||
<button type="button" class="btn btn-label-primary w-100 mb-4" id="btn-ocr-read-page">
|
||||
<i class="bx bx-scan me-1"></i> Odczytaj dane z pliku (OCR)
|
||||
</button>
|
||||
|
||||
<!-- KSeF Info Block -->
|
||||
<div class="mb-4 p-3 bg-label-secondary rounded border-dashed border-2">
|
||||
<div class="d-flex align-items-center mb-2 justify-content-between">
|
||||
<div class="d-flex align-items-center">
|
||||
<i class="bx bx-shield-quarter me-2 text-success"></i>
|
||||
<span class="fw-bold small">DANE SYSTEMU KSeF</span>
|
||||
</div>
|
||||
<span class="badge bg-white text-success shadow-sm">ZWERYFIKOWANA</span>
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label class="small text-muted d-block mb-1">Numer identyfikacyjny:</label>
|
||||
<code class="p-2 bg-white border rounded d-block text-dark small fw-bold"
|
||||
style="word-break: break-all;">8652582386-20260120-0C7F00A11237-B1</code>
|
||||
</div>
|
||||
<div class="row align-items-center gx-2">
|
||||
<div class="col-auto">
|
||||
<img src="https://api.qrserver.com/v1/create-qr-code/?size=90x90&data=KSEF_VERIFY_URL"
|
||||
class="border p-1 bg-white rounded" alt="QR KSeF" width="60">
|
||||
</div>
|
||||
<div class="col">
|
||||
<div class="d-flex gap-2 mb-2">
|
||||
<button class="btn btn-sm btn-outline-primary w-100"><i
|
||||
class="bx bx-download me-1"></i>PDF</button>
|
||||
<button class="btn btn-sm btn-outline-primary w-100"><i
|
||||
class="bx bx-download me-1"></i>UPO</button>
|
||||
<button class="btn btn-sm btn-outline-secondary w-100"><i
|
||||
class="bx bx-copy me-1"></i>Numer</button>
|
||||
</div>
|
||||
<small class="text-muted d-block" style="font-size: 0.7rem;">Faktura została pobrana
|
||||
z KSeF i zweryfikowana poprawnie.</small>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<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();
|
||||
});
|
||||
}
|
||||
|
||||
// --- OCR Simulation Logic for Page ---
|
||||
const ocrBtnPage = document.getElementById('btn-ocr-read-page');
|
||||
if (ocrBtnPage) {
|
||||
ocrBtnPage.addEventListener('click', function () {
|
||||
const btn = this;
|
||||
|
||||
// 1. Loader
|
||||
btn.disabled = true;
|
||||
btn.innerHTML = '<span class="spinner-border spinner-border-sm me-1" role="status" aria-hidden="true"></span> Przetwarzanie obrazu...';
|
||||
|
||||
// 2. Delay
|
||||
setTimeout(() => {
|
||||
// 3. Fill Data
|
||||
|
||||
// Vendor (Find the card body with select placeholder)
|
||||
const vendorCardBody = document.querySelector('.card.shadow-none .card-body');
|
||||
if (vendorCardBody) {
|
||||
vendorCardBody.innerHTML = `
|
||||
<div>
|
||||
<h6 class="mb-0">Tauron Polska Energia S.A.</h6>
|
||||
<small class="text-muted d-block">ul. Ks. Piotra Ściegiennego 3</small>
|
||||
<small class="text-muted d-block">40-114 Katowice</small>
|
||||
<small class="text-muted d-block">NIP: 551-102-12-34</small>
|
||||
</div>
|
||||
<button class="btn btn-outline-secondary btn-sm position-absolute end-0 top-0 m-2"><i class="bx bx-x"></i></button>
|
||||
`;
|
||||
}
|
||||
|
||||
// Invoice Data
|
||||
const invNum = document.querySelector('input[placeholder="np. FV/2026/02/105"]');
|
||||
if (invNum) invNum.value = 'FV/KAT/2026/02/552';
|
||||
|
||||
const dates = document.querySelectorAll('.date-picker');
|
||||
if (dates.length >= 3) {
|
||||
dates[0].value = '2026-02-15'; // Purchase
|
||||
dates[1].value = '2026-02-15'; // Issue
|
||||
dates[2].value = '2026-02-29'; // Payment
|
||||
}
|
||||
|
||||
// Items - Row 1
|
||||
const row1 = document.querySelector('table tbody tr:first-child');
|
||||
if (row1) {
|
||||
const inputs = row1.querySelectorAll('input');
|
||||
if (inputs.length >= 5) { // Name, Code, Qty, Price, VAT (select is not input)
|
||||
inputs[0].value = 'Energia elektryczna - taryfa C11'; // Name
|
||||
inputs[1].value = 'PKW-2026'; // Code
|
||||
// inputs[2] is select in some tables, here it is unit select (col 4, idx 3)
|
||||
// wait, let's look at table structure.
|
||||
// td 2: input name [0]
|
||||
// td 3: input code [1]
|
||||
// td 4: select unit
|
||||
// td 5: input qty [2]
|
||||
// td 6: input price [3]
|
||||
|
||||
// Let's use specific selector for safety
|
||||
}
|
||||
|
||||
const nameInput = row1.querySelector('input[placeholder="Np. Usługa księgowa, Paliwo..."]');
|
||||
if (nameInput) nameInput.value = 'Energia elektryczna - taryfa C11';
|
||||
|
||||
const codeInput = row1.querySelector('input[placeholder="-"]');
|
||||
if (codeInput) codeInput.value = 'PKW-2026';
|
||||
|
||||
const qtyInput = row1.querySelector('td:nth-child(5) input');
|
||||
if (qtyInput) qtyInput.value = '1.00';
|
||||
|
||||
const priceInput = row1.querySelector('td:nth-child(6) input');
|
||||
if (priceInput) priceInput.value = '450.00';
|
||||
|
||||
// Update totals in row (td 8 and 9)
|
||||
const netCell = row1.querySelector('td:nth-child(8)');
|
||||
if (netCell) netCell.innerText = '450,00 zł';
|
||||
|
||||
const grossCell = row1.querySelector('td:nth-child(9)');
|
||||
if (grossCell) grossCell.innerText = '553,50 zł';
|
||||
}
|
||||
|
||||
// Summary
|
||||
const summaries = document.querySelectorAll('.card-body .d-flex.justify-content-between span.fw-semibold');
|
||||
if (summaries.length >= 2) {
|
||||
summaries[0].innerText = '450,00 zł'; // Netto
|
||||
summaries[1].innerText = '103,50 zł'; // VAT
|
||||
}
|
||||
|
||||
const totalEl = document.getElementById('finalTotal');
|
||||
if (totalEl) totalEl.innerText = '553,50 zł';
|
||||
|
||||
// 4. Restore Button
|
||||
btn.disabled = false;
|
||||
btn.innerHTML = '<i class="bx bx-check me-1"></i> Dane odczytane poprawnie';
|
||||
btn.classList.remove('btn-label-primary');
|
||||
btn.classList.add('btn-label-success');
|
||||
|
||||
// Animation
|
||||
const allInputs = document.querySelectorAll('input');
|
||||
allInputs.forEach(input => {
|
||||
if (input.value && input.value !== '0.00' && input.type !== 'text' && input.type !== 'hidden') {
|
||||
// Filter a bit to avoid everything flashing
|
||||
}
|
||||
if (input.value && input.value !== '0.00' && input.type !== 'hidden') {
|
||||
input.classList.add('animate__animated', 'animate__flash');
|
||||
setTimeout(() => input.classList.remove('animate__animated', 'animate__flash'), 1000);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
}, 2000);
|
||||
});
|
||||
}
|
||||
|
||||
});
|
||||
</script>
|
||||
|
||||
</body>
|
||||
|
||||
</html>
|
||||
162
prototype/invoice/app-purchase-calendar.php
Normal file
162
prototype/invoice/app-purchase-calendar.php
Normal file
@@ -0,0 +1,162 @@
|
||||
<?php
|
||||
$enablePrototypeComments = true;
|
||||
include '../../header-invoice.php';
|
||||
?>
|
||||
|
||||
<link rel="stylesheet" href="../../assets/vendor/libs/fullcalendar/fullcalendar.css" />
|
||||
|
||||
<div class="container-fluid flex-grow-1 container-p-y">
|
||||
|
||||
<h4 class="py-3 mb-4">
|
||||
<span class="text-muted fw-light">Faktury i sprzedaż /</span> Kalendarz płatności
|
||||
</h4>
|
||||
|
||||
<div class="card app-calendar-wrapper">
|
||||
<div class="row g-0">
|
||||
<!-- Calendar Sidebar -->
|
||||
<div class="col app-calendar-sidebar" id="app-calendar-sidebar" style="display:none;">
|
||||
<!-- Hide sidebar/filter for now, we use tabs -->
|
||||
</div>
|
||||
<!-- /Calendar Sidebar -->
|
||||
|
||||
<!-- Calendar & Tabs -->
|
||||
<div class="col app-calendar-content">
|
||||
<div class="card shadow-none border-0">
|
||||
<div class="card-header border-bottom d-flex justify-content-between align-items-center">
|
||||
<h5 class="mb-0">Kalendarz płatności</h5>
|
||||
<ul class="nav nav-pills" role="tablist">
|
||||
<li class="nav-item">
|
||||
<button type="button" class="nav-link active" role="tab" data-bs-toggle="tab"
|
||||
data-filter="all">Wszystkie</button>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<button type="button" class="nav-link" role="tab" data-bs-toggle="tab"
|
||||
data-filter="paid">Zapłacone</button>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<button type="button" class="nav-link" role="tab" data-bs-toggle="tab"
|
||||
data-filter="unpaid">Do zapłaty</button>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="card-body pb-0">
|
||||
<div id="calendar"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /Calendar & Tabs -->
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<?php include '../../footer.php'; ?>
|
||||
|
||||
<script src="../../assets/vendor/libs/fullcalendar/fullcalendar.js"></script>
|
||||
|
||||
<script>
|
||||
document.addEventListener('DOMContentLoaded', function () {
|
||||
const calendarEl = document.getElementById('calendar');
|
||||
const today = new Date();
|
||||
const y = today.getFullYear();
|
||||
const m = today.getMonth(); // 0-indexed
|
||||
|
||||
// Mock Data
|
||||
// Paid: Green, use payment date
|
||||
// Unpaid: Red/Orange, use due date
|
||||
const allEvents = [
|
||||
// PAID (Past)
|
||||
{
|
||||
id: 1,
|
||||
title: 'FV/2026/01/001 - Comarch',
|
||||
start: new Date(y, m, 5),
|
||||
allDay: true,
|
||||
extendedProps: { status: 'paid', amount: '1230.00 PLN' },
|
||||
className: 'bg-label-success'
|
||||
},
|
||||
{
|
||||
id: 2,
|
||||
title: 'FV/2026/01/015 - Google Cloud',
|
||||
start: new Date(y, m, 10),
|
||||
allDay: true,
|
||||
extendedProps: { status: 'paid', amount: '50.00 USD' },
|
||||
className: 'bg-label-success'
|
||||
},
|
||||
|
||||
// UNPAID (Future / Current)
|
||||
{
|
||||
id: 3,
|
||||
title: 'FV/2026/02/105 - Tauron',
|
||||
start: new Date(y, m, 24), // Due date
|
||||
allDay: true,
|
||||
extendedProps: { status: 'unpaid', amount: '553.50 PLN' },
|
||||
className: 'bg-label-danger'
|
||||
},
|
||||
{
|
||||
id: 4,
|
||||
title: 'FV/2026/02/110 - Orange',
|
||||
start: new Date(y, m, 28), // Due date
|
||||
allDay: true,
|
||||
extendedProps: { status: 'unpaid', amount: '120.00 PLN' },
|
||||
className: 'bg-label-warning'
|
||||
},
|
||||
{
|
||||
id: 5,
|
||||
title: 'FV/2026/02/115 - Biurorach',
|
||||
start: new Date(y, m + 1, 5), // Next month
|
||||
allDay: true,
|
||||
extendedProps: { status: 'unpaid', amount: '1500.00 PLN' },
|
||||
className: 'bg-label-warning'
|
||||
}
|
||||
];
|
||||
|
||||
let calendar = new Calendar(calendarEl, {
|
||||
plugins: [dayGridPlugin, interactionPlugin, listPlugin, timegridPlugin],
|
||||
initialView: 'dayGridMonth',
|
||||
headerToolbar: {
|
||||
left: 'prev,next today',
|
||||
center: 'title',
|
||||
right: 'dayGridMonth,listMonth'
|
||||
},
|
||||
events: allEvents,
|
||||
locale: 'pl',
|
||||
firstDay: 1, // Start week on Monday
|
||||
eventDidMount: function (info) {
|
||||
// Add tooltip using Bootstrap
|
||||
if (info.event.extendedProps.amount) {
|
||||
new bootstrap.Tooltip(info.el, {
|
||||
title: info.event.title + ' (' + info.event.extendedProps.amount + ')',
|
||||
placement: 'top',
|
||||
trigger: 'hover',
|
||||
container: 'body'
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
calendar.render();
|
||||
|
||||
// Tabs Filtering
|
||||
const tabBtns = document.querySelectorAll('[data-bs-toggle="tab"]');
|
||||
tabBtns.forEach(btn => {
|
||||
btn.addEventListener('shown.bs.tab', function (e) {
|
||||
const filter = e.target.getAttribute('data-filter');
|
||||
console.log("Filtering by:", filter);
|
||||
|
||||
// Remove all events first
|
||||
calendar.removeAllEvents();
|
||||
|
||||
// Filter and add back
|
||||
let filteredEvents = [];
|
||||
if (filter === 'all') {
|
||||
filteredEvents = allEvents;
|
||||
} else {
|
||||
filteredEvents = allEvents.filter(ev => ev.extendedProps.status === filter);
|
||||
}
|
||||
|
||||
filteredEvents.forEach(ev => calendar.addEvent(ev));
|
||||
});
|
||||
});
|
||||
|
||||
});
|
||||
</script>
|
||||
880
prototype/invoice/app-purchase-list.php
Normal file
880
prototype/invoice/app-purchase-list.php
Normal file
@@ -0,0 +1,880 @@
|
||||
<?php
|
||||
$enablePrototypeComments = true;
|
||||
include '../../header-invoice.php';
|
||||
?>
|
||||
|
||||
<div class="container-fluid flex-grow-1 container-p-y">
|
||||
|
||||
<h4 class="py-3 mb-4">
|
||||
<span class="text-muted fw-light">Zakupy /</span> Faktury zakupowe
|
||||
</h4>
|
||||
|
||||
<div class="d-flex mb-3 gap-2 align-items-center flex-nowrap overflow-auto pt-2 pb-2">
|
||||
|
||||
<a href="#" class="btn btn-primary text-nowrap">
|
||||
<i class="bx bx-list-ul me-1"></i> Wszystkie
|
||||
</a>
|
||||
<a href="#" class="btn btn-label-primary text-nowrap">
|
||||
<i class="bx bx-check-circle me-1"></i> Zapłacone
|
||||
</a>
|
||||
<a href="#" class="btn btn-label-primary text-nowrap">
|
||||
<i class="bx bx-error-circle me-1"></i> Do zapłaty
|
||||
</a>
|
||||
|
||||
<div class="vr mx-2"></div>
|
||||
|
||||
<a href="#" class="btn btn-label-secondary text-nowrap position-relative overflow-visible me-3">
|
||||
Tauron
|
||||
<span
|
||||
class="position-absolute top-0 start-100 translate-middle badge rounded-pill bg-danger border border-light p-1"
|
||||
style="font-size: 0.6rem;">
|
||||
2
|
||||
</span>
|
||||
</a>
|
||||
|
||||
<a href="#" class="btn btn-label-secondary text-nowrap position-relative overflow-visible me-3">
|
||||
DrutexPol
|
||||
<span
|
||||
class="position-absolute top-0 start-100 translate-middle badge rounded-pill bg-danger border border-light p-1"
|
||||
style="font-size: 0.6rem;">
|
||||
4
|
||||
</span>
|
||||
</a>
|
||||
|
||||
<button class="btn btn-icon btn-label-secondary" type="button" data-bs-toggle="modal"
|
||||
data-bs-target="#manageTabsModal" title="Zarządzaj zakładkami">
|
||||
<i class="bx bx-cog"></i>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
|
||||
<div class="col-lg-9 transition-width" id="invoice-list-col">
|
||||
<div class="card">
|
||||
<div
|
||||
class="card-header border-bottom d-flex justify-content-between align-items-center flex-wrap gap-2">
|
||||
|
||||
<div class="me-2">
|
||||
<div class="input-group input-group-merge">
|
||||
<span class="input-group-text" id="basic-addon-search31"><i class="bx bx-search"></i></span>
|
||||
<input type="text" class="form-control" placeholder="Szukaj po numerze, dostawcy..."
|
||||
aria-label="Search..." aria-describedby="basic-addon-search31">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="d-flex align-items-center gap-2">
|
||||
|
||||
<div class="dropdown">
|
||||
<button type="button" class="btn btn-label-secondary p-2" data-bs-toggle="dropdown"
|
||||
aria-expanded="false">
|
||||
<i class="bx bx-cog"></i>
|
||||
</button>
|
||||
|
||||
<ul class="dropdown-menu dropdown-menu-end">
|
||||
<li>
|
||||
<h6 class="dropdown-header">Widoczność kolumn</h6>
|
||||
</li>
|
||||
<li>
|
||||
<div class="dropdown-item">
|
||||
<div class="form-check"><input class="form-check-input" type="checkbox" checked>
|
||||
<label class="form-check-label">Numer dokumentu</label>
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
<li>
|
||||
<div class="dropdown-item">
|
||||
<div class="form-check"><input class="form-check-input" type="checkbox" checked>
|
||||
<label class="form-check-label">Dostawca</label>
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
<li>
|
||||
<div class="dropdown-item">
|
||||
<div class="form-check"><input class="form-check-input" type="checkbox" checked>
|
||||
<label class="form-check-label">Data zakupu</label>
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
<li>
|
||||
<div class="dropdown-item">
|
||||
<div class="form-check"><input class="form-check-input" type="checkbox" checked>
|
||||
<label class="form-check-label">Termin płatności</label>
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
<li>
|
||||
<div class="dropdown-item">
|
||||
<div class="form-check"><input class="form-check-input" type="checkbox" checked>
|
||||
<label class="form-check-label">Kwota Brutto</label>
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
<li>
|
||||
<div class="dropdown-item">
|
||||
<div class="form-check"><input class="form-check-input" type="checkbox" checked>
|
||||
<label class="form-check-label">Status</label>
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<button type="button" class="btn btn-label-secondary d-flex align-items-center gap-2"
|
||||
id="filter-toggle-btn">
|
||||
<i class="bx bx-filter-alt"></i> Filtry
|
||||
</button>
|
||||
|
||||
<select class="form-select" style="width: 80px;">
|
||||
<option value="40">40</option>
|
||||
<option value="60">60</option>
|
||||
<option value="100">100</option>
|
||||
</select>
|
||||
|
||||
<button class="btn btn-label-secondary me-2">
|
||||
<i class="bx bx-sync me-1"></i> <span class="d-none d-sm-inline-block">Synchronizuj z
|
||||
KSeF</span>
|
||||
</button>
|
||||
|
||||
<div class="btn-group">
|
||||
<button type="button" class="btn btn-primary dropdown-toggle" data-bs-toggle="dropdown"
|
||||
aria-expanded="false">
|
||||
<i class="bx bx-plus me-1"></i> Dodaj koszt
|
||||
</button>
|
||||
<ul class="dropdown-menu dropdown-menu-end">
|
||||
<li>
|
||||
<a class="dropdown-item" href="app-purchase-add.php">
|
||||
<i class="bx bx-file-plus me-2"></i> Dodaj fakturę
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<button class="dropdown-item" type="button" data-bs-toggle="modal"
|
||||
data-bs-target="#quickAddModal">
|
||||
<i class="bx bx-lightning me-2"></i> Szybkie dodawanie
|
||||
</button>
|
||||
</li>
|
||||
<li>
|
||||
<hr class="dropdown-divider">
|
||||
</li>
|
||||
<li>
|
||||
<a class="dropdown-item" href="app-purchase-ocr.php">
|
||||
<i class="bx bx-scan me-2"></i> Import masowy OCR
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Modal Szybkie dodawanie (Placeholder) -->
|
||||
<div class="modal fade" id="quickAddModal" tabindex="-1" aria-hidden="true">
|
||||
<div class="modal-dialog modal-lg modal-dialog-centered" role="document">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header border-bottom">
|
||||
<h5 class="modal-title fs-5">Szybkie dodawanie kosztu</h5>
|
||||
<button type="button" class="btn-close" data-bs-dismiss="modal"
|
||||
aria-label="Close"></button>
|
||||
</div>
|
||||
|
||||
<form id="quickAddForm" onsubmit="return false">
|
||||
<div class="modal-body pb-3">
|
||||
<!-- Dropzone & OCR -->
|
||||
<div class="dropzone p-4 border-dashed border-2 rounded text-center mb-3 d-flex flex-column justify-content-center align-items-center"
|
||||
style="border-color: #d9dee3; background-color: #f8f9fa; cursor: pointer; transition: 0.2s;"
|
||||
onmouseover="this.style.borderColor='#696cff'; this.style.backgroundColor='#f0f2ff';"
|
||||
onmouseout="this.style.borderColor='#d9dee3'; this.style.backgroundColor='#f8f9fa';">
|
||||
<i class="bx bx-cloud-upload fs-2 text-muted mb-2"></i>
|
||||
<span class="text-muted fw-bold">Przeciągnij fakturę tutaj lub kliknij</span>
|
||||
<span class="small text-muted">(PDF, JPG, PNG)</span>
|
||||
</div>
|
||||
|
||||
<button type="button" class="btn btn-label-primary w-100 mb-4" id="btn-ocr-read">
|
||||
<i class="bx bx-scan me-1"></i> Odczytaj dane z pliku (OCR)
|
||||
</button>
|
||||
|
||||
<h6 class="mb-3 text-muted small text-uppercase fw-bold border-bottom pb-2">Dane z faktury</h6>
|
||||
|
||||
<div class="row g-3 mb-3">
|
||||
<div class="col-md-7">
|
||||
<label class="form-label">Dostawca</label>
|
||||
<div class="input-group">
|
||||
<select class="form-select select2-modal"
|
||||
data-placeholder="Wybierz lub wpisz nazwę...">
|
||||
<option></option>
|
||||
<option value="1">Tauron Polska</option>
|
||||
<option value="2">Orange Polska</option>
|
||||
<option value="3">Orlen S.A.</option>
|
||||
<option value="4">Google Ireland</option>
|
||||
</select>
|
||||
<button class="btn btn-outline-primary" type="button"
|
||||
title="Dodaj nowego"><i class="bx bx-plus"></i></button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-5">
|
||||
<label class="form-label">Numer dokumentu</label>
|
||||
<input type="text" class="form-control" placeholder="np. FV/2026/02/10">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row g-3 mb-4">
|
||||
<div class="col-md-4">
|
||||
<label class="form-label">Data wystawienia</label>
|
||||
<input type="text" class="form-control date-picker-modal"
|
||||
value="<?php echo date('Y-m-d'); ?>">
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<label class="form-label">Data zakupu / dostawy</label>
|
||||
<input type="text" class="form-control date-picker-modal"
|
||||
value="<?php echo date('Y-m-d'); ?>">
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<label class="form-label">Termin płatności</label>
|
||||
<input type="text" class="form-control date-picker-modal"
|
||||
value="<?php echo date('Y-m-d', strtotime('+7 days')); ?>">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="bg-label-secondary p-3 rounded mb-4">
|
||||
<div class="d-flex justify-content-between align-items-center mb-2">
|
||||
<h6 class="mb-0 small text-uppercase text-muted fw-bold">Wartości faktury
|
||||
</h6>
|
||||
<div class="form-check form-switch">
|
||||
<input class="form-check-input" type="checkbox" id="calcFromGross">
|
||||
<label class="form-check-label small" for="calcFromGross">Licz od
|
||||
brutto</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row g-3 align-items-end">
|
||||
<div class="col-md-3">
|
||||
<label class="form-label">Netto</label>
|
||||
<div class="input-group input-group-merge bg-white">
|
||||
<input type="number" class="form-control" id="qa_netto" step="0.01"
|
||||
placeholder="0.00">
|
||||
<span class="input-group-text">zł</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<label class="form-label">Stawka VAT</label>
|
||||
<select class="form-select" id="qa_vat_rate">
|
||||
<option value="0.23" selected>23%</option>
|
||||
<option value="0.08">8%</option>
|
||||
<option value="0.05">5%</option>
|
||||
<option value="0">0%</option>
|
||||
<option value="zw">ZW</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<label class="form-label text-muted">Kwota VAT</label>
|
||||
<input type="number" class="form-control bg-white" id="qa_vat_amount"
|
||||
disabled placeholder="0.00">
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<label class="form-label fw-bold">Brutto</label>
|
||||
<div class="input-group input-group-merge bg-white">
|
||||
<input type="number" class="form-control fw-bold text-heading"
|
||||
id="qa_brutto" step="0.01" placeholder="0.00">
|
||||
<span class="input-group-text fw-bold">zł</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row g-3 mb-4">
|
||||
<div class="col-md-6">
|
||||
<label class="form-label d-flex justify-content-between">
|
||||
Kategoria kosztu
|
||||
</label>
|
||||
<select class="form-select">
|
||||
<option value="towary">Towary handlowe</option>
|
||||
<option value="materialy">Materiały podstawowe</option>
|
||||
<option value="paliwo" selected>Paliwo i eksploatacja</option>
|
||||
<option value="biuro">Koszty biurowe</option>
|
||||
<option value="uslugi">Usługi obce</option>
|
||||
<option value="media">Media i energia</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<label class="form-label">Opis zdarzenia (opcjonalne)</label>
|
||||
<input type="text" class="form-control"
|
||||
placeholder="np. Paliwo Ford Mondeo">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="border-top pt-3">
|
||||
<div class="d-flex align-items-center mb-3">
|
||||
<div class="form-check form-switch me-4">
|
||||
<input class="form-check-input" type="checkbox" id="qa_is_paid">
|
||||
<label class="form-check-label fw-bold" for="qa_is_paid">Faktura
|
||||
opłacona</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="qa_payment_details"
|
||||
class="row g-3 d-none animate__animated animate__fadeIn">
|
||||
<div class="col-md-4">
|
||||
<label class="form-label">Data zapłaty</label>
|
||||
<input type="text" class="form-control date-picker-modal"
|
||||
value="<?php echo date('Y-m-d'); ?>">
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<label class="form-label">Metoda płatności</label>
|
||||
<select class="form-select">
|
||||
<option value="karta">Karta płatnicza</option>
|
||||
<option value="przelew">Przelew</option>
|
||||
<option value="gotowka">Gotówka</option>
|
||||
<option value="blik">BLIK</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<label class="form-label">Z rachunku</label>
|
||||
<select class="form-select">
|
||||
<option value="1">Konto Główne (mBank)</option>
|
||||
<option value="2">Konto VAT</option>
|
||||
<option value="3">Kasa gotówkowa</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="modal-footer bg-light">
|
||||
<button type="button" class="btn btn-outline-secondary"
|
||||
data-bs-dismiss="modal">Anuluj</button>
|
||||
<button type="submit" class="btn btn-primary">
|
||||
<i class="bx bx-save me-1"></i> Zapisz koszt
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="table-responsive text-nowrap" style="min-height: 400px;">
|
||||
<table class="table table-hover table-striped align-middle">
|
||||
<thead class="table-light">
|
||||
<tr>
|
||||
<th style="width: 50px;">#</th>
|
||||
<th>Nr dokumentu</th>
|
||||
<th>Dostawca</th>
|
||||
<th>Data zakupu</th>
|
||||
<th>Termin</th>
|
||||
<th class="text-end">Kwota Brutto</th>
|
||||
<th class="text-center">Status</th>
|
||||
<th class="text-center">Akcje</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody class="table-border-bottom-0">
|
||||
|
||||
<tr>
|
||||
<td>1</td>
|
||||
<td>
|
||||
<span class="fw-medium">FZ/2026/02/001</span>
|
||||
<br><small class="text-muted">Hosting i domeny</small>
|
||||
</td>
|
||||
<td>
|
||||
<span class="text-heading text-truncate fw-medium">OVH Sp. z o.o.</span>
|
||||
</td>
|
||||
<td>2026-02-15</td>
|
||||
<td>2026-02-22</td>
|
||||
<td class="text-end">123,00 zł</td>
|
||||
<td class="text-center">
|
||||
<span class="badge bg-label-success">Opłacona</span>
|
||||
</td>
|
||||
<td class="text-center">
|
||||
<div class="d-flex justify-content-center align-items-center gap-1">
|
||||
<div class="dropdown">
|
||||
<button type="button" class="btn p-0 dropdown-toggle hide-arrow"
|
||||
data-bs-toggle="dropdown">
|
||||
<i class="bx bx-dots-vertical-rounded"></i>
|
||||
</button>
|
||||
<div class="dropdown-menu dropdown-menu-end">
|
||||
<a class="dropdown-item" href="javascript:void(0);"><i
|
||||
class="bx bx-show me-1"></i> Podgląd</a>
|
||||
<a class="dropdown-item" href="javascript:void(0);"><i
|
||||
class="bx bx-download me-1"></i> Pobierz skan</a>
|
||||
<div class="dropdown-divider"></div>
|
||||
<a class="dropdown-item" href="javascript:void(0);"><i
|
||||
class="bx bx-edit-alt me-1"></i> Edytuj</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>2</td>
|
||||
<td>
|
||||
<span class="fw-medium">FV/TAURON/22/05</span>
|
||||
<br><small class="text-muted">Energia elektryczna</small>
|
||||
</td>
|
||||
<td>
|
||||
<span class="text-heading text-truncate fw-medium">Tauron Polska</span>
|
||||
</td>
|
||||
<td>2026-02-10</td>
|
||||
<td><span class="text-danger">2026-02-24</span></td>
|
||||
<td class="text-end">1 450,20 zł</td>
|
||||
<td class="text-center">
|
||||
<span class="badge bg-label-danger">Do zapłaty</span>
|
||||
</td>
|
||||
<td class="text-center">
|
||||
<div class="d-flex justify-content-center align-items-center gap-1">
|
||||
<button class="btn btn-sm btn-icon btn-label-success" data-bs-toggle="tooltip"
|
||||
title="Oznacz jako opłaconą">
|
||||
<i class="bx bx-check"></i>
|
||||
</button>
|
||||
|
||||
<div class="dropdown">
|
||||
<button type="button" class="btn p-0 dropdown-toggle hide-arrow"
|
||||
data-bs-toggle="dropdown">
|
||||
<i class="bx bx-dots-vertical-rounded"></i>
|
||||
</button>
|
||||
<div class="dropdown-menu dropdown-menu-end">
|
||||
<a class="dropdown-item" href="javascript:void(0);"><i
|
||||
class="bx bx-money me-1"></i> Dodaj płatność</a>
|
||||
<div class="dropdown-divider"></div>
|
||||
<a class="dropdown-item" href="javascript:void(0);"><i
|
||||
class="bx bx-show me-1"></i> Podgląd</a>
|
||||
<a class="dropdown-item" href="javascript:void(0);"><i
|
||||
class="bx bx-download me-1"></i> Pobierz skan</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>3</td>
|
||||
<td>
|
||||
<span class="fw-medium">102/K/2026</span>
|
||||
<br><small class="text-muted">Materiały biurowe</small>
|
||||
</td>
|
||||
<td>
|
||||
<span class="text-heading text-truncate fw-medium">Papierniczy S.A.</span>
|
||||
</td>
|
||||
<td>2026-01-15</td>
|
||||
<td>
|
||||
<span class="text-danger">2026-01-29</span>
|
||||
</td>
|
||||
<td class="text-end ">320,00 zł</td>
|
||||
<td class="text-center">
|
||||
<span class="badge bg-label-danger">Do zapłaty</span>
|
||||
</td>
|
||||
<td class="text-center">
|
||||
<div class="d-flex justify-content-center align-items-center gap-1">
|
||||
<button class="btn btn-sm btn-icon btn-label-success" data-bs-toggle="tooltip"
|
||||
title="Oznacz jako opłaconą">
|
||||
<i class="bx bx-check"></i>
|
||||
</button>
|
||||
<div class="dropdown">
|
||||
<button type="button" class="btn p-0 dropdown-toggle hide-arrow"
|
||||
data-bs-toggle="dropdown">
|
||||
<i class="bx bx-dots-vertical-rounded"></i>
|
||||
</button>
|
||||
<div class="dropdown-menu dropdown-menu-end">
|
||||
<a class="dropdown-item" href="javascript:void(0);"><i
|
||||
class="bx bx-money me-1"></i> Dodaj płatność</a>
|
||||
<a class="dropdown-item" href="javascript:void(0);"><i
|
||||
class="bx bx-show me-1"></i> Podgląd</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>4</td>
|
||||
<td>
|
||||
<span class="fw-medium">FV/22/09/2026</span>
|
||||
<br><small class="text-muted">Usługi programistyczne</small>
|
||||
</td>
|
||||
<td>
|
||||
<span class="text-heading text-truncate fw-medium">DevHouse Sp. z o.o.</span>
|
||||
</td>
|
||||
<td>2026-02-01</td>
|
||||
<td>2026-02-15</td>
|
||||
<td class="text-end">
|
||||
<span class="text-decoration-line-through text-muted"
|
||||
style="font-size:0.8em">5000,00 zł</span><br>
|
||||
<span class="text-warning">2 500,00 zł</span>
|
||||
</td>
|
||||
<td class="text-center">
|
||||
<span class="badge bg-label-warning">Częściowo</span>
|
||||
</td>
|
||||
<td class="text-center">
|
||||
<div class="d-flex justify-content-center align-items-center gap-1">
|
||||
<div class="dropdown">
|
||||
<button type="button" class="btn p-0 dropdown-toggle hide-arrow"
|
||||
data-bs-toggle="dropdown">
|
||||
<i class="bx bx-dots-vertical-rounded"></i>
|
||||
</button>
|
||||
<div class="dropdown-menu dropdown-menu-end">
|
||||
<a class="dropdown-item" href="javascript:void(0);"><i
|
||||
class="bx bx-money me-1"></i> Rozlicz resztę</a>
|
||||
<a class="dropdown-item" href="javascript:void(0);"><i
|
||||
class="bx bx-history me-1"></i> Historia wpłat</a>
|
||||
<div class="dropdown-divider"></div>
|
||||
<a class="dropdown-item" href="javascript:void(0);"><i
|
||||
class="bx bx-show me-1"></i> Podgląd</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr class="bg-label-secondary">
|
||||
<td colspan="5" class="text-end fw-bold">Suma (PLN):</td>
|
||||
<td class="text-end fw-bold">6 893,20 zł</td>
|
||||
<td colspan="2"></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div class="card-footer d-flex justify-content-center border-top">
|
||||
<nav aria-label="Page navigation">
|
||||
<ul class="pagination pagination-sm mb-0">
|
||||
<li class="page-item prev"><a class="page-link" href="javascript:void(0);"><i
|
||||
class="tf-icon bx bx-chevron-left"></i></a></li>
|
||||
<li class="page-item active"><a class="page-link" href="javascript:void(0);">1</a></li>
|
||||
<li class="page-item"><a class="page-link" href="javascript:void(0);">2</a></li>
|
||||
<li class="page-item next"><a class="page-link" href="javascript:void(0);"><i
|
||||
class="tf-icon bx bx-chevron-right"></i></a></li>
|
||||
</ul>
|
||||
</nav>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-lg-3" id="invoice-filters-col">
|
||||
<div class="card sticky-top" style="top: 20px;">
|
||||
<div class="card-header border-bottom">
|
||||
<h5 class="card-title mb-0">Filtry</h5>
|
||||
</div>
|
||||
<div class="card-body pt-4">
|
||||
|
||||
<div class="mb-3">
|
||||
<label class="form-label">Dostawca</label>
|
||||
<select class="select2 form-select" data-allow-clear="true" placeholder="Wybierz dostawcę">
|
||||
<option value="">Wszyscy</option>
|
||||
<option value="1">Tauron Polska</option>
|
||||
<option value="2">Orange Polska</option>
|
||||
<option value="3">Hurtownia Biurowa</option>
|
||||
<option value="4">Google Ireland</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="mb-3">
|
||||
<label class="form-label">Status płatności</label>
|
||||
<div class="d-flex flex-column gap-2">
|
||||
<div class="form-check">
|
||||
<input name="status-radio" class="form-check-input" type="radio" value="" id="statusAll"
|
||||
checked>
|
||||
<label class="form-check-label" for="statusAll"> Wszystkie </label>
|
||||
</div>
|
||||
<div class="form-check">
|
||||
<input name="status-radio" class="form-check-input" type="radio" value=""
|
||||
id="statusUnpaid">
|
||||
<label class="form-check-label" for="statusUnpaid"> Do zapłaty </label>
|
||||
</div>
|
||||
<div class="form-check">
|
||||
<input name="status-radio" class="form-check-input" type="radio" value=""
|
||||
id="statusPaid">
|
||||
<label class="form-check-label" for="statusPaid"> Opłacone </label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="mb-3">
|
||||
<label class="form-label">Data zakupu</label>
|
||||
<input type="text" class="form-control flatpickr-range" placeholder="Zakres dat" />
|
||||
</div>
|
||||
|
||||
<div class="mb-3">
|
||||
<label class="form-label">Termin płatności</label>
|
||||
<div class="d-flex flex-column gap-2">
|
||||
<div class="form-check">
|
||||
<input name="term-radio" class="form-check-input" type="radio" value="" id="termAll"
|
||||
checked>
|
||||
<label class="form-check-label" for="termAll"> Wszystkie </label>
|
||||
</div>
|
||||
<div class="form-check">
|
||||
<input name="term-radio" class="form-check-input" type="radio" value=""
|
||||
id="termOverdue">
|
||||
<label class="form-check-label text-danger" for="termOverdue"> Przeterminowane </label>
|
||||
</div>
|
||||
<div class="form-check">
|
||||
<input name="term-radio" class="form-check-input" type="radio" value=""
|
||||
id="termUpcoming">
|
||||
<label class="form-check-label" for="termUpcoming"> Nadchodzące (7 dni) </label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<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">
|
||||
<small class="text-muted">Zapisz obecne filtry jako:</small>
|
||||
<button class="btn btn-sm btn-label-primary w-100 mt-2" data-bs-toggle="modal"
|
||||
data-bs-target="#saveViewModal">
|
||||
<i class="bx bx-save me-1"></i> Nowy widok (Tab)
|
||||
</button>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Modale -->
|
||||
<div class="modal fade" id="saveViewModal" tabindex="-1" aria-hidden="true">
|
||||
<div class="modal-dialog modal-dialog-centered" role="document">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title">Zapisz nowy widok</h5>
|
||||
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div class="alert alert-label-info mb-3 d-flex">
|
||||
<i class="bx bx-info-circle me-2 fs-4"></i>
|
||||
<span>Bieżące ustawienia filtrów (Dostawca, Status, Termin) zostaną zapisane jako nowa zakładka na
|
||||
pasku powyżej.</span>
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label for="viewName" class="form-label">Nazwa widoku (zakładki)</label>
|
||||
<input type="text" id="viewName" class="form-control" placeholder="np. Tauron (Do zapłaty)">
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-outline-secondary" data-bs-dismiss="modal">Anuluj</button>
|
||||
<button type="button" class="btn btn-primary">Zapisz</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="modal fade" id="manageTabsModal" tabindex="-1" aria-hidden="true">
|
||||
<div class="modal-dialog modal-dialog-centered" role="document">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title">Zarządzaj zakładkami</h5>
|
||||
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div class="alert alert-label-info mb-3 d-flex">
|
||||
<i class="bx bx-info-circle me-2 fs-4"></i>
|
||||
<span>Przeciągnij, aby zmienić kolejność zakładek. Możesz też zmienić ich nazwę lub je
|
||||
usunąć.</span>
|
||||
</div>
|
||||
|
||||
<ul class="list-group list-group-flush" id="tabs-sortable-list">
|
||||
<!-- Statyczne zakładki (nieedytowalne) -->
|
||||
<li class="list-group-item d-flex align-items-center justify-content-between static">
|
||||
<div class="d-flex align-items-center">
|
||||
<i class="bx bx-lock-alt text-muted me-2" title="Zakładka systemowa"></i>
|
||||
<span class="fw-medium">Wszystkie</span>
|
||||
</div>
|
||||
</li>
|
||||
<li class="list-group-item d-flex align-items-center justify-content-between static">
|
||||
<div class="d-flex align-items-center">
|
||||
<i class="bx bx-lock-alt text-muted me-2" title="Zakładka systemowa"></i>
|
||||
<span class="fw-medium">Zapłacone</span>
|
||||
</div>
|
||||
</li>
|
||||
<li class="list-group-item d-flex align-items-center justify-content-between static">
|
||||
<div class="d-flex align-items-center">
|
||||
<i class="bx bx-lock-alt text-muted me-2" title="Zakładka systemowa"></i>
|
||||
<span class="fw-medium">Do zapłaty</span>
|
||||
</div>
|
||||
</li>
|
||||
|
||||
<!-- Zakładki użytkownika (edytowalne) -->
|
||||
<li class="list-group-item d-flex align-items-center justify-content-between" data-id="1">
|
||||
<div class="d-flex align-items-center gap-2">
|
||||
<div class="drag-handle cursor-move text-muted">
|
||||
<i class="bx bx-grid-vertical"></i>
|
||||
</div>
|
||||
<input type="text" class="form-control form-control-sm" value="Tauron"
|
||||
style="max-width: 200px;">
|
||||
</div>
|
||||
<div class="d-flex align-items-center gap-1">
|
||||
|
||||
<button class="btn btn-icon btn-sm btn-label-danger"><i class="bx bx-trash"></i></button>
|
||||
</div>
|
||||
</li>
|
||||
|
||||
<li class="list-group-item d-flex align-items-center justify-content-between" data-id="2">
|
||||
<div class="d-flex align-items-center gap-2">
|
||||
<div class="drag-handle cursor-move text-muted">
|
||||
<i class="bx bx-grid-vertical"></i>
|
||||
</div>
|
||||
<input type="text" class="form-control form-control-sm" value="DrutexPol"
|
||||
style="max-width: 200px;">
|
||||
</div>
|
||||
<div class="d-flex align-items-center gap-1">
|
||||
|
||||
<button class="btn btn-icon btn-sm btn-label-danger"><i class="bx bx-trash"></i></button>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<button class="btn btn-outline-primary w-100 mt-3 dashed-border">
|
||||
<i class="bx bx-plus me-1"></i> Dodaj bieżący widok jako zakładkę
|
||||
</button>
|
||||
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-outline-secondary" data-bs-dismiss="modal">Anuluj</button>
|
||||
<button type="button" class="btn btn-primary" data-bs-dismiss="modal">Zapisz zmiany</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script src="../../assets/vendor/libs/sortablejs/sortable.js"></script>
|
||||
<script>
|
||||
document.addEventListener('DOMContentLoaded', function () {
|
||||
var el = document.getElementById('tabs-sortable-list');
|
||||
if (el && typeof Sortable !== 'undefined') {
|
||||
Sortable.create(el, {
|
||||
handle: '.drag-handle',
|
||||
animation: 150,
|
||||
ghostClass: 'bg-light',
|
||||
onMove: function (evt) {
|
||||
return !evt.related.classList.contains('static');
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
<?php include '../../footer.php'; ?>
|
||||
|
||||
<script>
|
||||
document.addEventListener('DOMContentLoaded', function () {
|
||||
// Obsługa przycisku filtrów (pokaz/ukryj sidebar) - PIERWSZA, żeby działała na pewno
|
||||
const filterBtn = document.getElementById('filter-toggle-btn');
|
||||
const filtersCol = document.getElementById('invoice-filters-col');
|
||||
const listCol = document.getElementById('invoice-list-col');
|
||||
|
||||
if (filterBtn && filtersCol && listCol) {
|
||||
filterBtn.addEventListener('click', function (e) {
|
||||
e.preventDefault();
|
||||
// 1. Przełącz widoczność kolumny filtrów
|
||||
filtersCol.classList.toggle('d-none');
|
||||
|
||||
// 2. Dostosuj szerokość kolumny listy
|
||||
if (filtersCol.classList.contains('d-none')) {
|
||||
// Jeśli filtry ukryte -> lista na pełną szerokość
|
||||
listCol.classList.remove('col-lg-9');
|
||||
listCol.classList.add('col-12');
|
||||
} else {
|
||||
// Jeśli filtry widoczne -> lista na 9/12 szerokości
|
||||
listCol.classList.remove('col-12');
|
||||
listCol.classList.add('col-lg-9');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// Inicjalizacja Select2 (zabezpieczona)
|
||||
if (typeof $ !== 'undefined' && $('.select2').length) {
|
||||
$('.select2').select2({
|
||||
minimumResultsForSearch: 5
|
||||
});
|
||||
}
|
||||
|
||||
// Inicjalizacja Flatpickr (zabezpieczona)
|
||||
if (typeof flatpickr !== 'undefined') {
|
||||
document.querySelectorAll('.flatpickr-range').forEach(function (element) {
|
||||
flatpickr(element, {
|
||||
mode: 'range',
|
||||
dateFormat: 'Y-m-d'
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
// Tooltipy (zabezpieczone)
|
||||
if (typeof bootstrap !== 'undefined' && bootstrap.Tooltip) {
|
||||
var tooltipTriggerList = [].slice.call(document.querySelectorAll('[data-bs-toggle="tooltip"]'))
|
||||
var tooltipList = tooltipTriggerList.map(function (tooltipTriggerEl) {
|
||||
return new bootstrap.Tooltip(tooltipTriggerEl)
|
||||
});
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
<!-- OCR Simulation Script -->
|
||||
<script>
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
const ocrBtn = document.getElementById('btn-ocr-read');
|
||||
if (ocrBtn) {
|
||||
ocrBtn.addEventListener('click', function() {
|
||||
const btn = this;
|
||||
const originalContent = btn.innerHTML;
|
||||
|
||||
// 1. Loader state
|
||||
btn.disabled = true;
|
||||
btn.innerHTML = '<span class="spinner-border spinner-border-sm me-1" role="status" aria-hidden="true"></span> Przetwarzanie obrazu...';
|
||||
|
||||
// 2. Simulate delay
|
||||
setTimeout(() => {
|
||||
// 3. Fill form data
|
||||
// Dostawca: Tauron (value=1)
|
||||
const supplierSelect = document.querySelector('#quickAddModal select.select2-modal');
|
||||
if (supplierSelect) {
|
||||
$(supplierSelect).val('1').trigger('change');
|
||||
}
|
||||
|
||||
// Numer dokumentu
|
||||
document.querySelector('#quickAddModal input[placeholder="np. FV/2026/02/10"]').value = 'FV/AUT/2026/02/194';
|
||||
|
||||
// Daty
|
||||
const dates = document.querySelectorAll('#quickAddModal .date-picker-modal');
|
||||
if (dates.length >= 3) {
|
||||
dates[0].value = '2026-02-15'; // Wystawienia
|
||||
dates[1].value = '2026-02-15'; // Zakupu
|
||||
dates[2].value = '2026-02-22'; // Płatności
|
||||
}
|
||||
|
||||
// Netto
|
||||
document.getElementById('qa_netto').value = '1250.00';
|
||||
// VAT Rate
|
||||
document.getElementById('qa_vat_rate').value = '0.23';
|
||||
// VAT Amount (manual calc for demo or trigger calculation if logic exists)
|
||||
document.getElementById('qa_vat_amount').value = '287.50';
|
||||
// Brutto
|
||||
document.getElementById('qa_brutto').value = '1537.50';
|
||||
|
||||
// Opis
|
||||
document.querySelector('#quickAddModal input[placeholder="np. Paliwo Ford Mondeo"]').value = 'Energia elektryczna - Luty 2026';
|
||||
|
||||
// 4. Restore button
|
||||
btn.disabled = false;
|
||||
btn.innerHTML = '<i class="bx bx-check me-1"></i> Dane odczytane poprawnie';
|
||||
btn.classList.remove('btn-label-primary');
|
||||
btn.classList.add('btn-label-success');
|
||||
|
||||
// Opcjonalnie: animacja pól
|
||||
const inputs = document.querySelectorAll('#quickAddModal input');
|
||||
inputs.forEach(input => {
|
||||
if(input.value) {
|
||||
input.classList.add('animate__animated', 'animate__flash');
|
||||
setTimeout(() => input.classList.remove('animate__animated', 'animate__flash'), 1000);
|
||||
}
|
||||
});
|
||||
|
||||
}, 2000);
|
||||
});
|
||||
}
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
100
prototype/invoice/menu.php
Normal file
100
prototype/invoice/menu.php
Normal file
@@ -0,0 +1,100 @@
|
||||
<?php
|
||||
$currentPage = basename($_SERVER['PHP_SELF']);
|
||||
?>
|
||||
<aside id="layout-menu" class="layout-menu menu-vertical menu bg-menu-theme">
|
||||
<div class="app-brand demo">
|
||||
<a href="index.php" class="app-brand-link">
|
||||
<span class="app-brand-logo demo">
|
||||
<svg width="25" viewBox="0 0 25 42" version="1.1" xmlns="http://www.w3.org/2000/svg">
|
||||
<path
|
||||
d="M13.79,0.35 L3.39,7.44 C0.56,9.69 -0.37,12.47 0.55,15.79 C3.12,19.22 7.65,21.21 7.65,21.21 L2.63,24.54 C0.44,26.3 0.08,28.5 1.56,31.17 C7.09,32.53 16.41,26.37 18.4,20.23 C13.04,14.37 18.61,7.98 13.79,0.35 Z"
|
||||
fill="#696cff" />
|
||||
</svg>
|
||||
</span>
|
||||
<span class="app-brand-text demo menu-text fw-bold ms-2">invoice.magico</span>
|
||||
</a>
|
||||
<a href="javascript:void(0);" class="layout-menu-toggle menu-link text-large ms-auto">
|
||||
<i class="bx bx-chevron-left bx-sm align-middle"></i>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<div class="menu-inner-shadow"></div>
|
||||
|
||||
<ul class="menu-inner py-1">
|
||||
|
||||
<li class="menu-item <?php echo ($currentPage == 'index.php') ? 'active' : ''; ?>">
|
||||
<a href="index.php" class="menu-link">
|
||||
<i class="menu-icon tf-icons bx bx-home-circle"></i>
|
||||
<div class="text-truncate" data-i18n="Kokpit">Kokpit</div>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
<li
|
||||
class="menu-item <?php echo ($currentPage == 'app-invoice-list.php' || $currentPage == 'app-purchase-list.php' || $currentPage == 'app-purchase-calendar.php' || $currentPage == 'app-products.php') ? 'active open' : ''; ?>">
|
||||
<a href="javascript:void(0);" class="menu-link menu-toggle">
|
||||
<i class="menu-icon tf-icons bx bx-cart-alt"></i>
|
||||
<div class="text-truncate" data-i18n="Faktury i sprzedaż">Faktury i sprzedaż</div>
|
||||
</a>
|
||||
<ul class="menu-sub">
|
||||
<li class="menu-item <?php echo ($currentPage == 'app-invoice-list.php') ? 'active' : ''; ?>">
|
||||
<a href="app-invoice-list.php" class="menu-link">
|
||||
<div class="text-truncate" data-i18n="Faktury sprzedaż">Faktury sprzedaż</div>
|
||||
</a>
|
||||
</li>
|
||||
<li class="menu-item <?php echo ($currentPage == 'app-purchase-list.php') ? 'active' : ''; ?>">
|
||||
<a href="app-purchase-list.php" class="menu-link">
|
||||
<div class="text-truncate" data-i18n="Faktury zakupy">Faktury zakupy</div>
|
||||
</a>
|
||||
</li>
|
||||
<li class="menu-item <?php echo ($currentPage == 'app-purchase-calendar.php') ? 'active' : ''; ?>">
|
||||
<a href="app-purchase-calendar.php" class="menu-link">
|
||||
<div class="text-truncate" data-i18n="Kalendarz płatności">Kalendarz płatności</div>
|
||||
</a>
|
||||
</li>
|
||||
<li class="menu-item <?php echo ($currentPage == 'app-products.php') ? 'active' : ''; ?>">
|
||||
<a href="app-products.php" class="menu-link">
|
||||
<div class="text-truncate" data-i18n="Towary">Towary i usługi</div>
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
<li class="menu-item <?php echo ($currentPage == 'app-contractors-list.php') ? 'active' : ''; ?>">
|
||||
<a href="app-contractors-list.php" class="menu-link">
|
||||
<i class="menu-icon tf-icons bx bx-group"></i>
|
||||
<div class="text-truncate" data-i18n="Kontrahenci">Kontrahenci</div>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
<li
|
||||
class="menu-item <?php echo ($currentPage == 'sys-export.php' || $currentPage == 'sys-dictionaries.php' || $currentPage == 'sys-settings.php' || $currentPage == 'sys-logs.php') ? 'active open' : ''; ?>">
|
||||
<a href="javascript:void(0);" class="menu-link menu-toggle">
|
||||
<i class="menu-icon tf-icons bx bx-cog"></i>
|
||||
<div class="text-truncate" data-i18n="System">System</div>
|
||||
</a>
|
||||
<ul class="menu-sub">
|
||||
<li class="menu-item <?php echo ($currentPage == 'sys-export.php') ? 'active' : ''; ?>">
|
||||
<a href="sys-export.php" class="menu-link">
|
||||
<div class="text-truncate" data-i18n="Eksport dokumentów">Eksport dokumentów</div>
|
||||
</a>
|
||||
</li>
|
||||
<li class="menu-item <?php echo ($currentPage == 'sys-dictionaries.php') ? 'active' : ''; ?>">
|
||||
<a href="sys-dictionaries.php" class="menu-link">
|
||||
<div class="text-truncate" data-i18n="Słowniki">Słowniki</div>
|
||||
</a>
|
||||
</li>
|
||||
<li class="menu-item <?php echo ($currentPage == 'sys-settings.php') ? 'active' : ''; ?>">
|
||||
<a href="sys-settings.php" class="menu-link">
|
||||
<div class="text-truncate" data-i18n="Ustawienia">Ustawienia</div>
|
||||
</a>
|
||||
</li>
|
||||
<li class="menu-item <?php echo ($currentPage == 'sys-logs.php') ? 'active' : ''; ?>">
|
||||
<a href="sys-logs.php" class="menu-link">
|
||||
<div class="text-truncate" data-i18n="Logi zdarzeń">Logi zdarzeń</div>
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</aside>
|
||||
Reference in New Issue
Block a user