api discount and change tax
This commit is contained in:
1
app/views/api/change_tax/index.json.jbuilder
Normal file
1
app/views/api/change_tax/index.json.jbuilder
Normal file
@@ -0,0 +1 @@
|
||||
json.status true
|
||||
@@ -2,6 +2,7 @@ if @customer.present?
|
||||
json.status true
|
||||
else
|
||||
json.status false
|
||||
json.message @message
|
||||
end
|
||||
|
||||
json.data @customer
|
||||
|
||||
1
app/views/api/discounts/create.json.jbuilder
Normal file
1
app/views/api/discounts/create.json.jbuilder
Normal file
@@ -0,0 +1 @@
|
||||
json.status true
|
||||
@@ -1,6 +1,7 @@
|
||||
if @status == true
|
||||
#show invoice number and stuff
|
||||
json.status @status
|
||||
json.booking_id @booking.booking_id
|
||||
json.sale_id @sale_data.sale_id
|
||||
sale = Sale.find(@sale_data.sale_id)
|
||||
|
||||
|
||||
@@ -1,8 +1,14 @@
|
||||
if sale_item
|
||||
json.sale_item_id sale_item.sale_item_id
|
||||
json.product_name sale_item.product_name
|
||||
json.product_alt_name sale_item.product_alt_name
|
||||
json.qty sale_item.qty
|
||||
json.unit_price sale_item.unit_price
|
||||
json.price sale_item.price
|
||||
json.taxable_price sale_item.taxable_price
|
||||
json.status sale_item.status
|
||||
if discount_item = sale_item.discount_item
|
||||
json.discount discount_item.discount
|
||||
json.discount_type discount_item.discount_type
|
||||
end
|
||||
end
|
||||
|
||||
@@ -26,7 +26,7 @@ if sale
|
||||
|
||||
json.shift_sale_id sale.shift_sale_id
|
||||
|
||||
json.sale_items sale.sale_items, partial: "api/sale_items/sale_item", as: :sale_item
|
||||
json.sale_items sale.sale_items.includes(:discount_item).where(status: nil), partial: "api/sale_items/sale_item", as: :sale_item
|
||||
|
||||
json.sale_taxes sale.sale_taxes, partial: "api/sale_taxes/sale_tax", as: :sale_tax
|
||||
end
|
||||
|
||||
@@ -1,4 +1,2 @@
|
||||
json.status true
|
||||
json.data do
|
||||
json.tax_profiles @tax_profiles, :name, :group_type, :rate, :inclusive, :order_by
|
||||
end
|
||||
json.data @tax_profiles, :name, :group_type, :rate, :inclusive, :order_by
|
||||
|
||||
Reference in New Issue
Block a user