update customer validation messages
This commit is contained in:
@@ -7,8 +7,8 @@ class Customer < ApplicationRecord
|
||||
has_many :sales
|
||||
|
||||
validates_presence_of :name, :contact_no, :email,:card_no
|
||||
validates :contact_no, uniqueness: true
|
||||
validates :email, uniqueness: true
|
||||
validates :contact_no, uniqueness: true, numericality: true
|
||||
validates :email, uniqueness: true,format: { with: /\A([^@\s]+)@((?:[-a-z0-9]+\.)+[a-z]{2,})\z/i, on: :create }
|
||||
validates :card_no, uniqueness: true
|
||||
validates :paypar_account_no, uniqueness: true
|
||||
|
||||
|
||||
@@ -666,7 +666,13 @@ end
|
||||
.joins("INNER JOIN shift_sales sh ON sh.id = sales.shift_sale_id")
|
||||
.where("sales.sale_status = 'void' and (sh.shift_started_at between ? and ?
|
||||
OR sh.shift_closed_at between ? and ? )", from ,to, from, to)
|
||||
|
||||
|
||||
if shift.present?
|
||||
query = query.where("sales.sale_status = 'void' and s.shift_sale_id in (?)",shift.to_a)
|
||||
else
|
||||
query = query.where("payment_method='creditnote' and s.sale_status = 'completed' and s.receipt_date between ? and ? ",from,to)
|
||||
end
|
||||
|
||||
out = {:items => account}
|
||||
sale_arr.push(out)
|
||||
return sale_arr
|
||||
|
||||
Reference in New Issue
Block a user