USE [billing] GO /****** Object: StoredProcedure [dbo].[Cashier_LoadDiscount] Script Date: 05/16/2011 11:52:39 ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO Create Procedure [dbo].[Cashier_LoadDiscount] as select * from Build_File..tbCoRevenuecode where lgrp = 'D' and cashieractive = 'Y' and RevenueID not in ('VR','DL') order by itemname USE [billing] GO /****** Object: StoredProcedure [dbo].[spCash_ReportCreditCard_Daily] Script Date: 05/16/2011 13:21:42 ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO ALTER PROCEDURE [dbo].[spCash_ReportCreditCard_Daily] @ReportDate varchar(10), @EndDate as varchar(10) = @ReportDate, @RangeType as int = 1, @Card as varchar(20) = '' AS declare @ComputerID varchar(10) set @ComputerID = LEFT(HOST_ID(), 10) delete tbCashReportCreditCard where ComputerID = @ComputerID if @RangeType = 1 Begin insert into tbCashReportCreditCard select c.TransDate, SUBSTRING(c.TransNum, 3, 10) TransNum, c.PaymentFrom, s.Particulars, s.NetAmount [Amount], c.Card, convert(varchar(10), c. Cutoffdate, 101) as ReportDate, '', @ComputerID from tbcashcardmaster c left join tbcashchargeslips s on c.transnum = s.refnum where c.cutoffdate between @ReportDate and @EndDate + ' 23:59:59.99' and c.status = '' and (isnull(C.Card,'') = @Card or @Card = '') End else Begin insert into tbCashReportCreditCard select c.TransDate, SUBSTRING(c.TransNum, 3, 10) TransNum, c.PaymentFrom, s.Particulars, s.NetAmount [Amount], c.Card, convert(varchar(10), c.TransDate, 101) as ReportDate, '', @ComputerID from tbcashcardmaster c left join tbcashchargeslips s on c.transnum = s.refnum where c.transdate between @ReportDate and @EndDate + ' 23:59:59.99' and c.status = '' and (isnull(C.Card,'') = @Card or @Card = '') End ALTER table Patient_Data..tboutpatient add [BadDebt] [bit] NULL ALTER table Patient_Data..tbpatient add [BadDebt] [bit] NULL