SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO ALTER PROCEDURE [dbo].[sp_SaveQuotation] ( @QuotationNO nvarchar(50), @BranchCode varchar(10) ) AS begin SELECT RFQDate,Quotation.Del1,Quotation.Del2,Quotation.Del3,Quotation.Del4,Freight,Trans,Quotation.SalesMan,Quotation.AttenMob,Quotation.AttenEmail,Quotation.CustEmail,Quotation.QuotationNo, Quotation.EntryDate,Quotation.RefNo,Quotation.Attended,Quotation.custRefNo,Quotation.CustomerName,Quotation.CustomerCode,Quotation.Address,Quotation.Attention, Quotation.Telephone,Quotation.Fax,Quotation.GrossAmount,Quotation.NETDISC as LESS,Quotation.NetAmount,Quotation.Remarks,Quotation.PaymentTerms,Quotation.Validity, Quotation.PlaceOfDelivery,Quotation.DeliveryTime,QuotationItem.SlNo,QuotationItem.ItemName,QuotationItem.ItemCode,QuotationItem.Unit,QuotationItem.Qty, QuotationItem.Rate,QuotationItem.QTY*QUOTATIONITEM.RATE AS Amount,SalesMan.Mobile,SalesMan.email,ISNULL(QuotationItem.partno,'') AS partno,ISNULL(Quotation.Vatno,'') AS VATNO,ISNULL(Vattotal,0) AS VATTOTAL, ISNULL(VATPER,0) AS VATPER,ISNULL(VATAMT,0) AS VATAMT ,ISNULL(C.NameAR,'') as Arabicname,isnull(C.Address1AR,'') as ArabicAddress , dbo.currency_conversion(QUOTATION.NetAmount) as ARABICNETAMOUNT ,isnull(logoimage,'')as logoimage,isnull(signatureimage,'')as signatureimage,isnull(sealimage,'')as sealimage,isnull(footerimage,'')as footerimage,isnull(headderimage,'')as headderimage FROM Quotation INNER JOIN QuotationItem ON Quotation.QuotationNo = QuotationItem.QuotationNo left join SalesMan on Quotation.Attended=SalesMan.Code LEFT JOIN CUSTOMER C ON C.CODE=Quotation.CUSTOMERCODE JOIN Companydetails CD ON ISNULL(CD.BranchCode,@BranchCode)=@BranchCode where Quotation.QuotationNo=@QuotationNO ORDER BY QuotationItem.SlNo end