Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 sp_ownerbalanceAcctChk

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2001-10-01 : 01:05:19
Rodney writes "Q. Print checks fails when runing procedure?
*****************************************************************************
* This stored procedure is to Get the Owner Balance
* Parameters Description :
* ****************************************************************************
* Name Mandatory Comments
* ****************************************************************************
* Company : Tanning Technology International
* Author : Srinivasulu Pashikanti
* Created on :
* HISTORY :
*******************************************************************************
*RETURN Values DESCRIPTION :
******************************************************************************
* VALUE MEANING
******************************************************************************
* Cursor Owner
******************************************************************************
* Author Date of Modificaton Comments
Maheshwaran V 08/17/2001 1) Hold payment flag
considered ONLY for
calculating owner balances
for owner checks. For
validating funds against invoices,
the same is NOT considered.
2) Logic for implementing
scenario 3) of owner balances
explained with labels for
reusable code segments.


RW 09/18/01 Corrected error msgs 207 and 16916
******************************************************************************

******************************************************************************/

CREATE procedure sp_ownerBalanceAcctChk
@inputFlag varchar(2), -- 'AU' For All Units,'SU' Selected Units,
-- 'CT' Selected units Based on Complex Type,
-- 'MT' Selected units Based on Management Type,
@parString varchar(4000), -- if @inputFlag is 'AU' then 'ALL/null'
-- if @inputFlag is 'SU' then Units string with ',' delimiter
-- if @inputFlag is 'CT' then ComplexType with ',' delimiter
-- if @inputFlag is 'MT' then Management type with ',' delimiter
@bdate smalldatetime, -- Balance Date
@apFlag bit, -- Only for 'SU' if it called from AP Cheque type ownere balance confirmation
@reports bit -- Only used for Reports '1' is for reports '0' for Others.
AS
begin
set nocount on
declare @v_curString varchar(8000) -- Total Cursor String
declare @v_inString varchar(4000) -- For all instrings
declare @v_personid int -- Person Id
declare @v_unitid int -- Unit ID
declare @v_contractid int -- Contract Number
declare @outFlag int -- Out Flag
declare @v_recentCldate smalldatetime -- Most Recent Close Date
declare @v_amountTot money -- Calculated Amount
declare @v_ownershipper decimal -- Ownership Percentage
declare @personname varchar(60) -- Person Lastname + First Name
declare @unitname varchar(30) -- Unit Name
declare @ccyear int -- Current year
declare @bbdate smalldatetime -- Balance Date
declare @v_chequeFlag bit -- For Cheque Flag
declare @invoiceamt money -- For Invoice Total Amount
declare @reportsbalance money -- For reports purpose.
-- added by Mahesh on 08/15/2001
declare @noOfOwners int -- For determining how checks are to be issued
-- added by Mahesh on 08/15/2001 ends
if @bdate is null
begin
select @ccyear = datepart(yyyy,getdate())
select @bbdate = getdate()
end
else
begin
select @ccyear = datepart(yyyy,@bdate)
select @bbdate = @bdate
end
-- To find the Most Recent Clo
   

- Advertisement -