Skip to content

Instantly share code, notes, and snippets.

Payment.create({:enquiry_id=>enquiry_id,:pay_ref=>charge.id,:amount=>amount,:card_fee=>card_fee,:card_holder=>charge.source.name ,:is_refund=>false,:last_four=>charge.source.last4,:customer_id=>customer_id,:charge_by=>@currentUser,:pay_type=>payMethod,:stripe_fee =>balance.fee})
def importCustomers
a = Array.new
spreadsheet = open_spreadsheet(params[:file])
header = spreadsheet.row(1)
if Settings.enquiryExpireIn.present?
@expireDate =Time.now+Settings.enquiryExpireIn.to_i.days
end
(2..spreadsheet.last_row).each do |i|
# sleep(1.0/24.0)
Passenger.find_in_batches batch_size: 1000 do |passengers|
execute <<-SQL
UPDATE passengers AS p
SET cruise_index = crs.name,
person_index = person.name
FROM passengers, enquiries e, tours t, directions d, cruises crs,
(SELECT id, name FROM (
SELECT p.id, concat(coalesce(par.first_name, c.first_name), ' ',coalesce(par.last_name, c.last_name)) AS name
FROM passengers p
LEFT JOIN partners par
def archive
ReconciliationEvent.find_or_create_by(payment_id: params[:id], reconciliation_date: Time.now)
render :json =>{"msg"=>Payment.update(params[:id], is_archive: true)}
end
def archive_selected
count=0
Payment.where(id: params[:ids]).each do |x|
11
- 1h investigating payment error and it's consquences
- 1h taking care of 31770 booking with no customer
- 2h issue with reports not being generated
- 4h investigating missing payment emails
12
- 1h getting rid of some cancellation fee
- 4h wrong associated cruises and directions
- Для трех круизов
- Посмотреть остальные дипломы
######### 1 CHAPTER ##########
- Везде проставить ссылки
- Списки с красной строки, перенос строки тоже
- Структурная схема
- Временно вырезать инфу про проект
- Данный модуль разрабатывался по зaпросу туристической фирмы
module Sortable
def sortable(columns=nil)
@@sortable ||= columns.with_indifferent_access
end
def order_condition(column='id', direction='desc')
direction = %w[asc desc].include?(direction) ? direction : 'desc'
if sortable.keys.include?(column)
column = sortable[column]
SELECT DISTINCT COUNT(DISTINCT `questionnaire_answer_set_answers`.`id`)
FROM `questionnaire_answer_set_answers`
INNER JOIN `questionnaire_answer_set_answers_question_answer_options`
ON `questionnaire_answer_set_answers_question_answer_options`.`answer_id` = `questionnaire_answer_set_answers`.`id`
INNER JOIN `questionnaire_question_answer_options`
ON `questionnaire_question_answer_options`.`id` = `questionnaire_answer_set_answers_question_answer_options`.`answer_option_id`
LEFT OUTER JOIN `questionnaire_question_answer_option_translations`
ON `questionnaire_question_answer_option_translations`.`questionnaire_question_answer_option_id` = `questionnaire_question_answer_options`.`id`
WHERE `questionnaire_answer_set_answers`.`question_id` = 23
3) Backend plan
- Add new fields for 'Feedback': crew, meals, cleanliness, representatives, booking_experience, suggestions, other.
Serialize these fields.
? - Add new model 'Excursion'( name, rating, cruise_id, direction_id )
- Add new user type 'StaffMember'( first_name, last_name, email, boat_id )
- When logged in it should be redirected to the feedback form with combination of his boat and the nearest departure time for it.
? - Should we bind a 'StaffMember' to a tour?
- Partial which accepts an array of hashes as a collection
- Hold the hash structure in yml file
The array structure is something like:
production:
solr:
hostname: localhost
port: 8983
log_level: WARNING
path: /solr/production
# read_timeout: 2
# open_timeout: 0.5
development: