From a4884c9beac255e2c55d28ea164ba780323ee990 Mon Sep 17 00:00:00 2001 From: Yan Date: Mon, 4 Sep 2017 15:10:26 +0630 Subject: [PATCH] item instance code add to sale_item --- app/models/sale.rb | 1 + db/migrate/20170403161857_create_sale_items.rb | 1 + 2 files changed, 2 insertions(+) diff --git a/app/models/sale.rb b/app/models/sale.rb index 6eec518f..c4925812 100644 --- a/app/models/sale.rb +++ b/app/models/sale.rb @@ -158,6 +158,7 @@ class Sale < ApplicationRecord #pull sale_item.product_code = item.item_code + sale_item.item_instance_code = item.item_instance_code sale_item.product_name = item.item_name sale_item.product_alt_name = item.alt_name sale_item.account_id = item.account_id diff --git a/db/migrate/20170403161857_create_sale_items.rb b/db/migrate/20170403161857_create_sale_items.rb index d42b6f3c..27cf7ac4 100644 --- a/db/migrate/20170403161857_create_sale_items.rb +++ b/db/migrate/20170403161857_create_sale_items.rb @@ -4,6 +4,7 @@ class CreateSaleItems < ActiveRecord::Migration[5.1] t.string :sale_item_id, :limit => 16, :primary_key => true#custom primary key - to ensure consistence for cloud syncing t.string :sale_id, foreign_key: true, :limit => 16 t.string :product_code, :null => false + t.string :item_instance_code t.string :product_name, :null => false t.string :product_alt_name, :null => false t.integer :account_id, :limit => 8, :null => false, :default => 1