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.Rate*QuotationItem.QTY) AS Amount,SalesMan.Mobile,SalesMan.email,ISNULL(QuotationItem.partno,'') AS partno,ISNULL(Quotation.Vatno,'') AS VATNO,ISNULL(Vattotal,0) AS VATTOTAL, ISNULL(Vattotal,0) AS VATPER,ISNULL(Vattotal,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 GO SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO ALTER procedure [dbo].[sp_SelectReceiptEntryPrint] ( @VoucherNo varchar(100) ) as begin SELECT CustomerReceipt.VoucherNo,CustomerReceipt.PaidDate,CustomerReceipt.TotAmount as NetAmt,CustomerReceipt.CustomerCode, CustomerReceipt.CustomerName, CustomerReceipt.Account,CustomerReceipt.AccountCode,CustomerReceipt.ChequeNo,CustomerReceipt.ChequeDate, CustomerReceiptDetail.InvoiceNo,CustomerReceiptDetail.InvoiceAmount,CustomerReceiptDetail.ReceivedAmount, CustomerReceiptDetail.BalanceAmount,CustomerReceiptDetail.PaidDate as CustPaidDate, CustomerReceiptDetail.Narration,CustomerReceipt.bank,isnull(rvno,'')as Rvno,CASE WHEN isnull(Advance,'')='1' THEN 'Y' ELSE 'N' END AS Advance,CustomerReceipt.narration as finalNarration ,CustomerReceipt.PayMode FROM CustomerReceipt LEFT JOIN CustomerReceiptDetail on CustomerReceipt.VoucherNo=CustomerReceiptDetail.VoucherNo where CustomerReceipt.VoucherNo=@VoucherNo AND ReceivedAmount <>0 order by CustomerReceipt.VoucherNo end