Added Estimate.sync_by_doc_number

This commit is contained in:
2024-08-19 22:30:34 -04:00
parent 4f789080e7
commit dd9ac3c481
2 changed files with 14 additions and 2 deletions

View File

@@ -16,6 +16,8 @@ class EstimateController < ApplicationController
skip_before_action :verify_authenticity_token, :check_if_login_required, :unless => proc {|c| session[:token].nil? }
def get_estimate
# Force sync for estimate by doc number
Estimate.sync_by_doc_number if params[:search]
estimate = Estimate.find_by_id(params[:id]) if params[:id]
estimate = Estimate.find_by_doc_number(params[:search]) if params[:search]
return estimate