Skip to content

Commit

Permalink
Add stock column to sale invoice items table
Browse files Browse the repository at this point in the history
  • Loading branch information
efthakhar committed Aug 22, 2023
1 parent 84a9934 commit 26566e9
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion resources/admin-resources/modules/sale/AddSale.vue
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,8 @@ function calculateGrandTotal() {
invoice_grand_total.value = 0;
selected_items.value.forEach((p) => {
p.quantity > p.stock_quantity ? (p.quantity = p.stock_quantity) : "";
if (p.tax_type == "exclusive") {
let item_total_with_tax =
p.quantity * (p.sale_price * (p.tax_rate / 100) + p.sale_price);
Expand Down Expand Up @@ -271,7 +273,7 @@ onMounted(async () => {
class="form-select form-select-sm"
v-model="selected_warehouse"
@input="onSelectWarehouse()"
:disabled="selected_items.length>0"
:disabled="selected_items.length > 0"
>
<option value="">none</option>
<option :value="w.id" v-for="w in warehouses">
Expand Down Expand Up @@ -316,6 +318,7 @@ onMounted(async () => {
<tr class="bg-ass text-secondary">
<th class="min150">Product</th>
<th class="min100">Unit Price</th>
<th class="">Stock</th>
<th class="min100">Quantity</th>
<th class="min100">Tax</th>
<th class="min100">Subtotal</th>
Expand All @@ -326,6 +329,14 @@ onMounted(async () => {
<tr v-for="p in selected_items">
<td>{{ p.name }}</td>
<td>{{ p.sale_price }}</td>
<td>
<input
type="number"
class="max100 form-control"
:value="p.stock_quantity"
disabled
/>
</td>
<td>
<input
type="number"
Expand Down

0 comments on commit 26566e9

Please sign in to comment.