Sha256: 433d69f87df1900551881bed7c83493ceb28fb4ae37b40979981db36fae2cb17
Contents?: true
Size: 1.5 KB
Versions: 1
Compression:
Stored size: 1.5 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, :processing_status) end end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
comee_core-0.2.35 | app/controllers/comee/core/sales_order_items_controller.rb |