/* Begin_Procs taCreateTerritoryPre */
if exists (
select
*
from
sysobjects
where
id = object_id(
'dbo.taCreateTerritoryPre'
)
and
type =
'P'
)
begin
drop
procedure
dbo.taCreateTerritoryPre
end
go
create
procedure
dbo.taCreateTerritoryPre
/*
**********************************************************************
* (c) 2004 Microsoft Business Solutions, Inc.
**********************************************************************
*
*
PROCEDURE
NAME
: taCreateTerritoryPre
*
* SANSCRIPT
NAME
: NA
*
* PARAMETERS:
*
* DESCRIPTION: taCreateSalespersonPost Integration Stored
Procedure
*
* TABLES:
*
Table
Name
Access
* ========== ======
*
* PROCEDURES CALLED:
*
*
DATABASE
: Company
*
*
RETURN
VALUE:
* 0 = Successful
* non-0 =
Not
successful
*
* REVISION HISTORY:
*
*
Date
Who Comments
*
----------------------------------------------------------------
*
*
********************************************************************
*
********************************************************************
*/
@I_vSALSTERR
char
(15)
output
, /*Territory ID <Required>*/
@I_vSLTERDSC
char
(30)
output
, /*Territory Description <Optional>*/
@I_vSLPRSNID
char
(15)
output
, /*Salesperson ID <Optional>*/
@I_vSTMGRFNM
char
(15)
output
, /*Sales Terr Managers
First
Name
<Optional>*/
@I_vSTMGRMNM
char
(15)
output
, /*Sales Terr Managers Middle
Name
<Optional>*/
@I_vSTMGRLNM
char
(20)
output
, /*Sales Terr Managers
Last
Name
<Optional>*/
@I_vCOUNTRY
char
(60)
output
, /*Country <Optional>*/
@I_vCOSTTODT
numeric
(19,5)
output
, /*Cost
to
Date
<Optional>*/
@I_vTTLCOMTD
numeric
(19,5)
output
, /*Total Commissions
to
Date
<Optional>*/
@I_vTTLCOMLY
numeric
(19,5)
output
, /*Total Commissions
Last
Year
<Optional>*/
@I_vNCOMSLYR
numeric
(19,5)
output
, /*Non-Comm Sales
Last
Year
<Optional>*/
@I_vCOMSLLYR
numeric
(19,5)
output
, /*Comm Sales
Last
Year
<Optional>*/
@I_vCSTLSTYR
numeric
(19,5)
output
, /*Cost
Last
Year
<Optional>*/
@I_vCOMSLTDT
numeric
(19,5)
output
, /*Commissioned Sales
To
Date
<Optional>*/
@I_vNCOMSLTD
numeric
(19,5)
output
, /*Non-Comm Sales
To
Date
<Optional>*/
@I_vKPCALHST tinyint
output
,/*Keep Calendar History - 0=
No
1=Yes <Optional>*/
@I_vKPERHIST tinyint
output
,/*Keep Period History - 0=
No
1=Yes <Optional>*/
@I_vMODIFDT datetime
output
, /*Modified
Date
<Optional>*/
@I_vCREATDDT datetime
output
, /*
Create
Date
<Optional>*/
@I_vUSRDEFND1
char
(50)
output
, /*
User
Defined field-developer use
only
*/
@I_vUSRDEFND2
char
(50)
output
, /*
User
Defined field-developer use
only
*/
@I_vUSRDEFND3
char
(50)
output
, /*
User
Defined field-developer use
only
*/
@I_vUSRDEFND4
varchar
(8000)
output
, /*
User
Defined field-developer use
only
*/
@I_vUSRDEFND5
varchar
(8000)
output
, /*
User
Defined field-developer use
only
*/
@O_iErrorState
int
output
,/*
Return
value: 0=
No
Errors, 1=Error Occurred*/
@oErrString
varchar
(255)
output
/*
Return
Error Code List*/
as
set
nocount
on
select
@O_iErrorState = 0
/*
Create
Custom Business Logic */
set
@I_vSLTERDSC =
'Created by eConnect'
/*
End
Create
Custom Business Logic */
return
(@O_iErrorState)
go
grant
execute
on
dbo.taCreateTerritoryPre
to
DYNGRP
go
/* End_Procs taCreateTerritoryPre */