You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

60 lines
3.6 KiB

1 year ago
  1. USE [FastMoneyPro_Remit]
  2. GO
  3. /****** Object: StoredProcedure [dbo].[ProcFiscalMonthSetup] Script Date: 9/27/2019 1:30:14 PM ******/
  4. SET ANSI_NULLS ON
  5. GO
  6. SET QUOTED_IDENTIFIER ON
  7. GO
  8. /*
  9. select nplYear, convert(varchar, engDateBaisakh,107) 'engDateBaisakh', baisakh, jestha, ashadh, shrawan, bhadra, ashwin,kartik, mangshir, poush, magh, falgun, chaitra from Fiscal_Month
  10. exec ProcFiscalMonthSetup 'i',
  11. exec ProcFiscalMonthSetup 'c',@nplYear = '2066'
  12. exec ProcFiscalMonthSetup 'c',@nplYear = '2066',@engDateBaisakh='2010-07-17'
  13. --SELECT * FROM Fiscal_Month
  14. */
  15. CREATE procedure [dbo].[ProcFiscalMonthSetup]
  16. @flag char(1),
  17. @nplYear varchar(10),
  18. @engDateBaisakh varchar(10)=null,
  19. @baisakh int=null,
  20. @jestha int=null,
  21. @ashadh int=null,
  22. @shrawan int=null,
  23. @bhadra int=null,
  24. @ashwin int=null,
  25. @kartik int=null,
  26. @mangshir int=null,
  27. @poush int=null,
  28. @magh int=null,
  29. @falgun int=null,
  30. @chaitra int=null
  31. as
  32. set nocount on;
  33. if(@flag ='c')
  34. begin
  35. if exists(select * from Fiscal_Month where nplYear = @nplYear or YEAR(engDateBaisakh) = YEAR(@engDateBaisakh))
  36. select 'True'
  37. else
  38. select 'False'
  39. end
  40. if(@flag ='i')
  41. begin
  42. begin
  43. if exists(select * from Fiscal_Month where nplYear = @nplYear or YEAR(engDateBaisakh) = YEAR(@engDateBaisakh))
  44. select 'True'
  45. else
  46. begin
  47. insert into Fiscal_Month
  48. (nplYear, engDateBaisakh, baisakh, jestha, ashadh, shrawan, bhadra, ashwin, kartik, mangshir, poush, magh, falgun, chaitra)
  49. values (@nplYear, @engDateBaisakh,@baisakh,@jestha,@ashadh,@shrawan,@bhadra,@ashwin,@kartik,@mangshir,@poush,@magh,@falgun,@chaitra)
  50. exec spa_generate_calendar @engDateBaisakh,@nplYear,@baisakh,@jestha,@ashadh,@shrawan,@bhadra,@ashwin,@kartik,@mangshir,
  51. @poush,@magh,@falgun,@chaitra
  52. end
  53. end
  54. end
  55. GO