IF EXISTS ( SELECT * 
            FROM   sysobjects 
            WHERE  id = object_id(N'[dbo].[sp_DebtorsAgeReport]') 
                   and OBJECTPROPERTY(id, N'IsProcedure') = 1 )
BEGIN
    DROP PROCEDURE [dbo].[sp_DebtorsAgeReport]
END




IF EXISTS ( SELECT * 
            FROM   sysobjects 
            WHERE  id = object_id(N'[dbo].[v_InvoiceListing]') 
                   and OBJECTPROPERTY(id, N'IsView') = 1 )
BEGIN
    DROP VIEW [dbo].[v_InvoiceListing]
END



IF EXISTS ( SELECT * 
            FROM   sysobjects 
            WHERE  id = object_id(N'[dbo].[v_DebitListing]') 
                   and OBJECTPROPERTY(id, N'IsView') = 1 )
BEGIN
    DROP VIEW [dbo].[v_DebitListing]
END



IF EXISTS ( SELECT * 
            FROM   sysobjects 
            WHERE  id = object_id(N'[dbo].[v_CreditListing]') 
                   and OBJECTPROPERTY(id, N'IsView') = 1 )
BEGIN
    DROP VIEW [dbo].[v_CreditListing]
END



IF EXISTS ( SELECT * 
            FROM   sysobjects 
            WHERE  id = object_id(N'[dbo].[v_ReceiptListing]') 
                   and OBJECTPROPERTY(id, N'IsView') = 1 )
BEGIN
    DROP VIEW [dbo].[v_ReceiptListing]
END