sync receipt
This commit is contained in:
@@ -64,6 +64,8 @@ class AssignedOrderItem < ApplicationRecord
|
||||
|
||||
private
|
||||
def generate_custom_id
|
||||
self.assigned_order_item_id = SeedGenerator.generate_id(self.class.name, "AOI")
|
||||
if self.assigned_order_item_id.nil?
|
||||
self.assigned_order_item_id = SeedGenerator.generate_id(self.class.name, "AOI")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -122,6 +122,8 @@ class Booking < ApplicationRecord
|
||||
|
||||
private
|
||||
def generate_custom_id
|
||||
self.booking_id = SeedGenerator.generate_id(self.class.name, "BKI")
|
||||
if self.booking_id.nil?
|
||||
self.booking_id = SeedGenerator.generate_id(self.class.name, "BKI")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -557,7 +557,9 @@ class Order < ApplicationRecord
|
||||
private
|
||||
|
||||
def generate_custom_id
|
||||
self.order_id = SeedGenerator.generate_id(self.class.name, "ODR")
|
||||
if self.order_id.nil?
|
||||
self.order_id = SeedGenerator.generate_id(self.class.name, "ODR")
|
||||
end
|
||||
end
|
||||
|
||||
def set_order_date
|
||||
|
||||
@@ -97,6 +97,8 @@ class OrderItem < ApplicationRecord
|
||||
|
||||
private
|
||||
def generate_custom_id
|
||||
self.order_items_id = SeedGenerator.generate_id(self.class.name, "ODI")
|
||||
if self.order_items_id.nil?
|
||||
self.order_items_id = SeedGenerator.generate_id(self.class.name, "ODI")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -38,20 +38,20 @@ class Printer::PrinterWorker
|
||||
end
|
||||
|
||||
def print(file_path,printer_destination = nil )
|
||||
# if printer_destination.nil?
|
||||
# printer_destination = self.printer_destination
|
||||
# end
|
||||
if printer_destination.nil?
|
||||
printer_destination = self.printer_destination
|
||||
end
|
||||
|
||||
# puts printer_destination
|
||||
# puts '........Printer Destination..........'
|
||||
puts printer_destination
|
||||
puts '........Printer Destination..........'
|
||||
|
||||
# copy = self.print_copies
|
||||
# #Print only when printer information is not null
|
||||
# if !self.printer_destination.nil?
|
||||
# (1..copy).each do
|
||||
# page = Cups::PrintJob.new(file_path, printer_destination)
|
||||
# page.print
|
||||
# end
|
||||
# end
|
||||
copy = self.print_copies
|
||||
#Print only when printer information is not null
|
||||
if !self.printer_destination.nil?
|
||||
(1..copy).each do
|
||||
page = Cups::PrintJob.new(file_path, printer_destination)
|
||||
page.print
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -2951,6 +2951,8 @@ end
|
||||
private
|
||||
|
||||
def generate_custom_id
|
||||
self.sale_id = SeedGenerator.generate_id(self.class.name, "SAL")
|
||||
if self.sale_id.nil?
|
||||
self.sale_id = SeedGenerator.generate_id(self.class.name, "SAL")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -176,6 +176,8 @@ class SaleAudit < ApplicationRecord
|
||||
|
||||
private
|
||||
def generate_custom_id
|
||||
self.sale_audit_id = SeedGenerator.generate_id(self.class.name, "SAI")
|
||||
if self.sale_audit_id.nil?
|
||||
self.sale_audit_id = SeedGenerator.generate_id(self.class.name, "SAI")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -223,6 +223,8 @@ class SaleItem < ApplicationRecord
|
||||
|
||||
private
|
||||
def generate_custom_id
|
||||
self.sale_item_id = SeedGenerator.generate_id(self.class.name, "SLI")
|
||||
if self.sale_item_id.nil?
|
||||
self.sale_item_id = SeedGenerator.generate_id(self.class.name, "SLI")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -34,7 +34,9 @@ class SaleOrder < ApplicationRecord
|
||||
private
|
||||
def generate_sale_order_id
|
||||
# self.class.name
|
||||
saleOrderId = SeedGenerator.generate_id(self.class.name, 'SOI')
|
||||
self.sale_order_id = saleOrderId
|
||||
if self.sale_order_id.nil?
|
||||
self.sale_order_id = SeedGenerator.generate_id(self.class.name, 'SOI')
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
|
||||
@@ -1065,6 +1065,8 @@ class SalePayment < ApplicationRecord
|
||||
|
||||
private
|
||||
def generate_custom_id
|
||||
self.sale_payment_id = SeedGenerator.generate_id(self.class.name, "SPI")
|
||||
if self.sale_payment_id.nil?
|
||||
self.sale_payment_id = SeedGenerator.generate_id(self.class.name, "SPI")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -34,6 +34,8 @@ class SaleTax < ApplicationRecord
|
||||
|
||||
private
|
||||
def generate_custom_id
|
||||
self.sale_tax_id = SeedGenerator.generate_id(self.class.name, "STI")
|
||||
if self.sale_tax_id.nil?
|
||||
self.sale_tax_id = SeedGenerator.generate_id(self.class.name, "STI")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user