Sha256: c31c952d9408850565970fd9b81a4614a2a73a8cb09c6503cac8a08f74d48bae
Contents?: true
Size: 1.44 KB
Versions: 18
Compression:
Stored size: 1.44 KB
Contents
module Comee module Core class SalesOrderItemsController < ApplicationController include Common def index super do SalesOrderItem.includes( :sales_order, :customer_order_item, :source, :product, :unit ).where(sales_order_id: params[:id]) end end def suggest_values service = CustomerOrderService.new result = service.suggest_values(params[:id], suggest_params[:unit_id]) render json: {success: true, data: result} end def cancel item = set_object item.update(canceled: true) render_content(item) end def activate item = set_object item.update(canceled: false) render_content(item) end def destroy Comee::Core::SalesOrderItem.destroy(params[:id]) render json: {success: true} end private def suggest_params params.permit(:unit_id, :quantity) end def model_params params.require(:payload).permit(:sales_order_id, :customer_order_item_id, :product_id, :unit_id, :quantity, :quantity_delivered, :customer_item_no, :customer_item_description, :price, :handover_date, :delivery_date, :eb_number, :lead_time, :comment, :action_note, :po_reference, :pallet_no, :source_id) end end end end
Version data entries
18 entries across 18 versions & 1 rubygems