s11
This commit is contained in:
@@ -22,10 +22,8 @@
|
||||
$description = $_POST['description'];
|
||||
$quantity = $_POST['quantity'];
|
||||
$rate = $_POST['rate'];
|
||||
$tax = $_POST['tax'];
|
||||
$taxAmount = $_POST['taxAmount'];
|
||||
|
||||
|
||||
$discount = $_POST['discount'];
|
||||
$discountAmount = $_POST['discountAmount'];
|
||||
|
||||
// EMI Calculation
|
||||
$emiAmount = round($totalAmount / $tenure, 2);
|
||||
@@ -56,7 +54,7 @@
|
||||
}
|
||||
|
||||
// Insert into invoice table
|
||||
$stmt2 = $db->prepare("INSERT INTO invoice (customerId, invoiceId, customerName, address, frequency, invoiceDate, paymentMode, salesAgent, marketingAgent, tenure, item, description, qty, rate, tax, totalAmount, adminNote, taxAmount) VALUES (:customerId, :invoiceId, :customerName, :address, :frequency, :invoiceDate, :paymentMode, :salesAgent, :marketingAgent, :tenure, :item, :description, :qty, :rate, :tax, :totalAmount, :adminNote, :taxAmount)");
|
||||
$stmt2 = $db->prepare("INSERT INTO invoice (customerId, invoiceId, customerName, address, frequency, invoiceDate, paymentMode, salesAgent, marketingAgent, tenure, item, description, qty, rate, discount, totalAmount, adminNote, discountAmount) VALUES (:customerId, :invoiceId, :customerName, :address, :frequency, :invoiceDate, :paymentMode, :salesAgent, :marketingAgent, :tenure, :item, :description, :qty, :rate, :discount, :totalAmount, :adminNote, :discountAmount)");
|
||||
$stmt2->bindParam(':customerId', $_GET['customerId']);
|
||||
$stmt2->bindParam(':invoiceId', $invoiceId);
|
||||
$stmt2->bindParam(':customerName', $customerName);
|
||||
@@ -71,10 +69,10 @@
|
||||
$stmt2->bindParam(':description', $description);
|
||||
$stmt2->bindParam(':qty', $quantity);
|
||||
$stmt2->bindParam(':rate', $rate);
|
||||
$stmt2->bindParam(':tax', $tax);
|
||||
$stmt2->bindParam(':discount', $discount);
|
||||
$stmt2->bindParam(':totalAmount', $totalAmount);
|
||||
$stmt2->bindParam(':adminNote', $adminNote);
|
||||
$stmt2->bindParam(':taxAmount', $taxAmount);
|
||||
$stmt2->bindParam(':discountAmount', $discountAmount);
|
||||
$stmt2->execute();
|
||||
|
||||
echo '<div class="alert alert-success">New EMI Plan Saved Successfully!</div>';
|
||||
@@ -156,13 +154,14 @@
|
||||
</div>
|
||||
<div class="w-100">
|
||||
<div class="mb-3">
|
||||
<label for="paymentMode" class="form-label">Payment Mode:</label>
|
||||
<label for="paymentMode" class="form-label">Payment Methods:</label>
|
||||
<select name="paymentMode" class="form-control"required>
|
||||
<option value="">-Select-</option>
|
||||
<option value="UPI">UPI</option>
|
||||
<option value="Credit Card">Credit Card</option>
|
||||
<option value="Debit Card">Debit Card</option>
|
||||
<option value="Cash">Cash</option>
|
||||
<option value="Stripe">Stripe</option>
|
||||
<option value="Zelle">Zelle</option>
|
||||
<option value="Bank Transfer">Bank Transfer</option>
|
||||
<option value="Cheque">Cheque</option>
|
||||
<option value="Other">Other</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
@@ -213,8 +212,8 @@
|
||||
<th class="p-2">Description</th>
|
||||
<th class="p-2">Qty</th>
|
||||
<th class="p-2">Rate</th>
|
||||
<th class="p-2">Tax % </th>
|
||||
<th class="p-2">Tax Amount</th>
|
||||
<th class="p-2">Discount % </th>
|
||||
<th class="p-2">Discount Amount</th>
|
||||
<th class="p-2">Amount</th>
|
||||
</tr>
|
||||
</thead>
|
||||
@@ -233,8 +232,8 @@
|
||||
<input class="form-control w-100" name="rate" id="rate" />
|
||||
</td>
|
||||
<td>
|
||||
<select name="tax" id="tax" class="form-control">
|
||||
<option value="0">No Tax</option>
|
||||
<select name="discount" id="discount" class="form-control">
|
||||
<option value="0">No Discount</option>
|
||||
<option value="5">5 %</option>
|
||||
<option value="10">10 %</option>
|
||||
<option value="12">12 %</option>
|
||||
@@ -242,7 +241,7 @@
|
||||
</select>
|
||||
</td>
|
||||
<td>
|
||||
<input readonly class="form-control" name="taxAmount" id="taxAmount" />
|
||||
<input readonly class="form-control" name="discountAmount" id="discountAmount" />
|
||||
</td>
|
||||
<td>
|
||||
<input readonly class="form-control" name="totalAmount" id="totalAmount" />
|
||||
@@ -297,8 +296,8 @@
|
||||
document.addEventListener("DOMContentLoaded", function () {
|
||||
const quantityInput = document.getElementById("quantity");
|
||||
const rateInput = document.getElementById("rate");
|
||||
const taxSelect = document.getElementById("tax");
|
||||
const taxAmountInput = document.getElementById("taxAmount");
|
||||
const taxSelect = document.getElementById("discount");
|
||||
const taxAmountInput = document.getElementById("discountAmount");
|
||||
const totalAmountInput = document.getElementById("totalAmount");
|
||||
|
||||
function calculateTotal() {
|
||||
@@ -308,7 +307,7 @@
|
||||
|
||||
let subtotal = quantity * rate;
|
||||
let taxAmount = (subtotal * tax) / 100;
|
||||
let grandTotal = subtotal + taxAmount;
|
||||
let grandTotal = subtotal - taxAmount;
|
||||
|
||||
taxAmountInput.value = taxAmount.toFixed(2); // Format Tax Amount
|
||||
totalAmountInput.value = grandTotal.toFixed(2); // Format Total Amount
|
||||
|
||||
Reference in New Issue
Block a user