fix get_order_items_details method in order_item and add taxes in receipt

This commit is contained in:
Yan
2017-06-15 17:57:58 +06:30
parent e085adab74
commit 03feae5b0f
6 changed files with 48 additions and 22 deletions

View File

@@ -16,6 +16,7 @@ class Origami::DiscountsController < BaseOrigamiController
discount_value = params[:discount_value]
discount_amount = params[:discount_amount]
grand_total = params[:grand_total]
product_name = "Overall Discount"
if discount_type == 0
remark="Discount " + discount_amount + " as net"
@@ -32,13 +33,14 @@ class Origami::DiscountsController < BaseOrigamiController
#save sale item for discount
if sale_item_id != nil
origin_sale_item = SaleItem.find(sale_item_id)
product_name = origin_sale_item.product_name + "-Disocunt"
end
sale_item = SaleItem.new
#pull
sale_item.sale_id = sale_id
sale_item.product_code = origin_sale_item != nil ? origin_sale_item.product_code : sale_id
sale_item.product_name = "Overall Discount"
sale_item.product_name = product_name
sale_item.remark = remark
sale_item.qty = 1