Giter Club home page Giter Club logo

jimmy_ramayana's Introduction

(1..3).each do |x|

SalesOrder.create_object(
  :sales_date             => DateTime.now - 6.days         ,
  :description      => "description stock adjustment #{x}"      ,
  :contact_id => Contact.first.id 
)

end

puts “Total PO: #{SalesOrder.count}”

item_array = Item.all SalesOrder.all.each do |po|

(1..3).each do |x|
  SalesOrderDetail.create_object(
    :item_id => item_array[x-1].id,
    :quantity => 10, 
    :sales_order_id => po.id 
  )

end

end

SalesOrder.first.confirm_object(:confirmed_at => DateTime.now-2.days) SalesOrder.last.confirm_object(:confirmed_at => DateTime.now - 1.days)

puts “Total po detail: #{SalesOrderDetail.count}” puts “Total po confirmed: #{SalesOrder.where(:is_confirmed => true).count }”

SalesOrder.where(:is_confirmed => true ).each do |po|

DeliveryOrder.create_object(
  :delivery_date             => DateTime.now - 4.days         ,
  :description      => "description sales_delivery #{po.id}"      ,
  :sales_order_id => po.id,
  :warehouse_id => Warehouse.first.id 
)

end

puts “Total PR: #{DeliveryOrder.count}”

DeliveryOrder.all.each do |pr|

pr.sales_order.sales_order_details.each do |pod|
  DeliveryOrderDetail.create_object(
    :sales_order_detail_id => pod.id ,
    :quantity => pod.quantity - 1 , 
    :sales_delivery_id => pr.id 
  )
end

end

puts “Total pr detail: #{DeliveryOrderDetail.count}”

jimmy_ramayana's People

Contributors

weyewe avatar

Watchers

 avatar James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.