Submit to different table with in the page #78
jeremyevans
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Google Group Post: https://groups.google.com/g/ruby-forme/c/eYJbxh1J13c
Google Group Date: Mon, 24 Apr 2017 12:55:16 -0700
Google Group Sender: [email protected]
Hi Jeremy,
In a typical retail environment, while billing in a salesbill module, we
may need to hold or park a salebill for a while, which can be resumed later.
We want to save that parked bill to separate table and delete it once
resumed back to sale table.
Currently, while clicking the submit button, we insert the datas to sales
and sales_orders table.
To hold a salebill
Now, when the user clicks hold button, we want to insert datas (submit
action) to *holdsales and holdsales_orders *table.
post action for sales
r.is 'submit_sales' do
@sale = Sale.new
@sale.sales_orders_attributes = r['sale']['sales_orders_attributes']
@sale.set_fields(r['sale'], %w'bill_no date customer_id sub_total
entity_id')
@sale.save
r.redirect r.referrer
end
question #1 How can we accomplish this?
To resume a held salebill
With in the salebill page itself, now when the user wants to resume any one
of the held bill, a table with all holdsales data will be populated.
while clicking the billno of holdsales, we want to load datas in the
salebill page itself.
get action for sales
r.is 'sale' do
@page_title = 'Sale Bill'
@subform_opts = {
:caption=>nil,
:grid=>true,
:attr=>{:class=>"item-row"},
:inputs_opts=>{:attr=>{:id=>'ordr', :class=>'ui fixed striped
table'}},
:labels=>['Item', 'Qty', 'Rate', 'Amount', 'Del'],
:legend=>nil,
:labeler=>nil}
question #2 How can we get from holdsales and holdsales_orders table and
submit to sales and sales_orders?* table.*
Hope you understood.
Thanks and regards,
I.Murugesan
Beta Was this translation helpful? Give feedback.
All reactions