Pdf Changes Done
This commit is contained in:
@@ -1,7 +1,9 @@
|
||||
@extends('admin.layouts.app')
|
||||
|
||||
|
||||
@section('page-title', 'Edit Invoice')
|
||||
|
||||
|
||||
@section('content')
|
||||
<style>
|
||||
:root {
|
||||
@@ -460,11 +462,12 @@
|
||||
</div>
|
||||
|
||||
@php
|
||||
$totalPaid = $invoice->installments()->sum('amount');
|
||||
$remaining = $invoice->final_amount_with_gst - $totalPaid;
|
||||
// आता helpers वापरू: totalPaid() आणि remainingAmount()
|
||||
$totalPaid = $invoice->totalPaid();
|
||||
$remaining = $invoice->remainingAmount();
|
||||
@endphp
|
||||
|
||||
{{-- Amount Breakdown --}}
|
||||
{{-- Amount Breakdown (items + GST + groups) --}}
|
||||
<div class="amount-breakdown-compact">
|
||||
<h6 class="fw-bold mb-3 text-dark">
|
||||
<i class="fas fa-calculator me-2"></i>Amount Breakdown
|
||||
@@ -506,10 +509,17 @@
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<div class="breakdown-row">
|
||||
<span class="breakdown-label">Charge Groups Total</span>
|
||||
<span class="breakdown-value text-info" id="chargeGroupsTotal">
|
||||
₹{{ number_format($invoice->charge_groups_total, 2) }}
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<div class="breakdown-row" style="border-top: 2px solid #e2e8f0; padding-top: 0.75rem;">
|
||||
<span class="breakdown-label fw-bold">Total Invoice Amount Including GST</span>
|
||||
<span class="breakdown-label fw-bold">Grand Total (Items + GST + Groups)</span>
|
||||
<span class="breakdown-value fw-bold text-dark" id="totalInvoiceWithGst">
|
||||
₹{{ number_format($invoice->final_amount_with_gst, 2) }}
|
||||
₹{{ number_format($invoice->grand_total_with_charges, 2) }}
|
||||
</span>
|
||||
</div>
|
||||
|
||||
@@ -523,18 +533,18 @@
|
||||
<div class="breakdown-row" style="border-bottom: none;">
|
||||
<span class="breakdown-label text-danger">Remaining</span>
|
||||
<span class="breakdown-value fw-bold text-danger" id="remainingAmount">
|
||||
₹{{ number_format($remaining, 2) }}
|
||||
₹{{ number_format(max(0, $remaining), 2) }}
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{-- Installment Summary --}}
|
||||
{{-- Installment Summary (top cards) --}}
|
||||
<div class="summary-grid-compact">
|
||||
<div class="summary-card-compact total">
|
||||
<div class="summary-value-compact text-success" id="totalInvoiceWithGstCard">
|
||||
₹{{ number_format($invoice->final_amount_with_gst, 2) }}
|
||||
₹{{ number_format($invoice->grand_total_with_charges, 2) }}
|
||||
</div>
|
||||
<div class="summary-label-compact">Total Amount</div>
|
||||
<div class="summary-label-compact">Grand Total (Items + GST + Groups)</div>
|
||||
</div>
|
||||
<div class="summary-card-compact paid">
|
||||
<div class="summary-value-compact text-primary">
|
||||
@@ -544,7 +554,7 @@
|
||||
</div>
|
||||
<div class="summary-card-compact remaining">
|
||||
<div class="summary-value-compact text-warning">
|
||||
₹{{ number_format($remaining, 2) }}
|
||||
₹{{ number_format(max(0, $remaining), 2) }}
|
||||
</div>
|
||||
<div class="summary-label-compact">Remaining</div>
|
||||
</div>
|
||||
@@ -621,7 +631,7 @@
|
||||
class="form-control-compact"
|
||||
step="0.01"
|
||||
min="1"
|
||||
max="{{ $remaining }}"
|
||||
max="{{ max(0, $remaining) }}"
|
||||
required
|
||||
placeholder="Enter installment amount">
|
||||
</div>
|
||||
@@ -784,6 +794,8 @@ document.addEventListener("DOMContentLoaded", function () {
|
||||
if (document.getElementById("gstAmount")) {
|
||||
document.getElementById("gstAmount").textContent = "₹" + formatINR(data.gstAmount);
|
||||
}
|
||||
// grand total आता finalAmountWithGst नाही, पण API अजून तेच key देत आहे,
|
||||
// त्यामुळे इथे फक्त card आणि breakdown value update करतो:
|
||||
if (document.getElementById("totalInvoiceWithGst")) {
|
||||
document.getElementById("totalInvoiceWithGst").textContent = "₹" + formatINR(data.finalAmountWithGst);
|
||||
}
|
||||
@@ -876,7 +888,6 @@ document.addEventListener("DOMContentLoaded", function () {
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
const invoiceDateInput = document.querySelector('input[name="invoice_date"]');
|
||||
const dueDateInput = document.querySelector('input[name="due_date"]');
|
||||
@@ -886,14 +897,10 @@ document.addEventListener('DOMContentLoaded', function() {
|
||||
const selectedDate = new Date(this.value);
|
||||
|
||||
if (!isNaN(selectedDate.getTime())) {
|
||||
// १० दिवस पुढे नेण्यासाठी logic
|
||||
selectedDate.setDate(selectedDate.getDate() + 10);
|
||||
|
||||
// तारीख YYYY-MM-DD format मध्ये करण्यासाठी
|
||||
const year = selectedDate.getFullYear();
|
||||
const month = String(selectedDate.getMonth() + 1).padStart(2, '0');
|
||||
const day = String(selectedDate.getDate()).padStart(2, '0');
|
||||
|
||||
dueDateInput.value = `${year}-${month}-${day}`;
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user