USP_DATAFORMTEMPLATE_ADD_DONATIONBATCHROW

The save procedure used by the add dataform template "Donation Batch Add Data Form 2".

Parameters

Parameter Parameter Type Mode Description
@ID uniqueidentifier INOUT The output parameter indicating the ID of the record added.
@BATCHID uniqueidentifier IN Input parameter indicating the context ID for the record being added.
@SEQUENCE int IN Sequence
@EVENTID uniqueidentifier IN Event
@USERID nvarchar(100) IN Username
@PASSWORD nvarchar(500) IN Password
@LASTNAME nvarchar(100) IN Last name
@FIRSTNAME nvarchar(100) IN First name
@MIDDLENAME nvarchar(100) IN Middle name
@TITLECODEID uniqueidentifier IN Title
@SUFFIXCODEID uniqueidentifier IN Suffix
@NICKNAME nvarchar(100) IN Nick name
@MAIDENNAME nvarchar(200) IN Maiden name
@BIRTHDATE UDT_FUZZYDATE IN Birth date
@GENDERCODE int IN Gender
@MARITALSTATUSCODEID uniqueidentifier IN Marital status
@ADDRESSTYPECODEID uniqueidentifier IN Address type
@COUNTRYID uniqueidentifier IN Country
@ADDRESS nvarchar(300) IN Address
@CITY nvarchar(100) IN City
@STATEID uniqueidentifier IN State/Province
@POSTCODE nvarchar(24) IN Postcode
@DONOTMAIL bit IN Do not send mail to this address
@DONOTMAILREASONCODEID uniqueidentifier IN Reason
@PHONETYPECODEID uniqueidentifier IN Phone type
@PHONENUMBER nvarchar(200) IN Phone number
@EMAILADDRESS UDT_EMAILADDRESS IN Email address
@ISCOMPANYGIFT bit IN This is an organization donation
@COMPANYNAME nvarchar(200) IN Organization name
@COMPANYURL UDT_WEBADDRESS IN Organization website
@COMPANY_ADDRESSTYPECODEID uniqueidentifier IN Organization address type
@COMPANY_COUNTRYID uniqueidentifier IN Organization country
@COMPANY_ADDRESS nvarchar(300) IN Organization address
@COMPANY_CITY nvarchar(100) IN Organization city
@COMPANY_STATEID uniqueidentifier IN Organization state
@COMPANY_POSTCODE nvarchar(24) IN Organization postcode
@COMPANY_DONOTMAIL bit IN Organization: Do not send mail to this address
@COMPANY_DONOTMAILREASONCODEID uniqueidentifier IN Organization: Reason
@COMPANY_PHONETYPECODEID uniqueidentifier IN Organization phone type
@COMPANY_PHONENUMBER nvarchar(200) IN Organization phone number
@COMPANY_EMAILADDRESS UDT_EMAILADDRESS IN Organization email address
@GIFTTYPE nvarchar(100) IN Gift type
@GIFTAMOUNT money IN Gift amount
@NUMPAYMENTS int IN Number of payments
@FREQUENCY nvarchar(200) IN Frequency
@AUTOINSTALLMENTS bit IN Automatic installments
@ANONYMOUS bit IN Gift is anonymous
@STARTDATE UDT_FUZZYDATE IN Start date
@INFINITEGIFT bit IN Gift is infinite
@PAYMENTMETHODCODE int IN Payment method
@CREDITCARDHOLDER nvarchar(200) IN Card holder name
@CREDITCARDNUMBER nvarchar(20) IN Credit card number
@CREDITCARDTYPE uniqueidentifier IN Credit card type
@EXPIRATIONDATE UDT_FUZZYDATE IN Expiration on date
@CREDITCARDTOKEN uniqueidentifier IN Credit card token
@CREDITCARDID uniqueidentifier IN Credit card ID
@AUTHORIZATIONCODE nvarchar(20) IN Authorization code
@TRANSACTIONID uniqueidentifier IN Transaction ID
@REJECTIONMESSAGE nvarchar(250) IN Rejection message
@TYPECODE tinyint IN Type code
@AMOUNT money IN Amount
@CONSTITUENTID uniqueidentifier IN Constituent ID
@CHECKDATE UDT_FUZZYDATE IN Check date
@CHECKNUMBER nvarchar(40) IN Check number
@BANKACCOUNTTYPECODE int IN Bank account type
@BANKACCOUNTHOLDER nvarchar(200) IN Bank account holder
@BANKACCOUNTNUMBER nvarchar(200) IN Bank account number
@BANKACCOUNTROUTINGCODE nvarchar(200) IN Bank account routing code
@SAMEASPRIMARYADDRESS bit IN Billing address same as primary
@BILLING_ADDRESSTYPECODEID uniqueidentifier IN Billing address type
@BILLING_COUNTRYID uniqueidentifier IN Billing country
@BILLING_ADDRESSBLOCK nvarchar(300) IN Billing address
@BILLING_CITY nvarchar(100) IN Billing city
@BILLING_STATEID uniqueidentifier IN Billing state
@BILLING_POSTCODE nvarchar(24) IN Billing postcode
@BILLING_STATE nvarchar(10) IN Billing state
@BILLING_COUNTRY nvarchar(4) IN Billing country
@SAVETRIBUTEEASCONSTITUENT bit IN Save tributee as constituent
@SHOWTRIBUTE bit IN I would like to make a donation to honor
@TRIBUTEFIRSTNAME nvarchar(400) IN Tributee first name
@TRIBUTELASTNAME nvarchar(400) IN Tributee last name
@TRIBUTEEMAIL UDT_EMAILADDRESS IN Tributee email address
@TRIBUTEADDRESS nvarchar(600) IN Tributee address
@TRIBUTECITY nvarchar(200) IN Tributee city
@TRIBUTEPOSTCODE nvarchar(48) IN Tributee postcode
@TRIBUTESTATEID uniqueidentifier IN Tributee state
@TRIBUTETYPECODEID uniqueidentifier IN Tribute type
@TRIBUTETEXT nvarchar(500) IN Tribute message
@TRIBUTEANONYMOUS bit IN Do not display tribute information
@ACKNOWLEDGEFIRSTNAME nvarchar(400) IN Acknowledgee first name
@ACKNOWLEDGELASTNAME nvarchar(400) IN Acknowledgee last name
@ACKNOWLEDGEEMAIL UDT_EMAILADDRESS IN Acknowledgee email address
@MESSAGETOACKNOWLEDGE nvarchar(2000) IN Message about my donation
@RECOGNITIONCREDIT nvarchar(100) IN Recognition credit
@MATCHINGCOMPANYNAME nvarchar(400) IN Matching gift company name
@MATCHINGAMOUNT money IN Matching Amount
@RECIPIENTGROUPID uniqueidentifier IN Recognition group
@RECIPIENTREGISTRANTID uniqueidentifier IN Recognition individual
@RECIPIENTROLE nvarchar(200) IN Recognition credit
@SENDTOACKNOWLEDGE bit IN Send email to acknowledgee
@ORIGINALCLIENTUSERID int IN Original client user id
@ORIGINALCONSTITUENTID uniqueidentifier IN Search existing constituents
@PHONEID uniqueidentifier IN Phone id
@ADDRESSID uniqueidentifier IN Address id
@EMAILADDRESSID uniqueidentifier IN Email address id
@ORGANIZATIONCONSTITUENTID uniqueidentifier IN Search existing organization constituents
@MERCHANTACCOUNTID uniqueidentifier IN Merchant account ID
@CHANGEAGENTID uniqueidentifier IN Input parameter indicating the ID of the change agent invoking the procedure.
@SUBSCRIBEDNEWSLETTERIDS xml IN eNewsletter
@SENDNOTIFICATIONS bit IN
@BNUMBER nvarchar(100) IN
@VENDORID nvarchar(50) IN

Definition

Copy

CREATE procedure dbo.USP_DATAFORMTEMPLATE_ADD_DONATIONBATCHROW
(
  @ID uniqueidentifier = null output,
    @BATCHID uniqueidentifier,
    @SEQUENCE int,
    @EVENTID uniqueidentifier,
    @USERID nvarchar(100) = '',
    @PASSWORD nvarchar(500) = '',
    @LASTNAME nvarchar(100),
    @FIRSTNAME nvarchar(100),
    @MIDDLENAME nvarchar(100) = '',
    @TITLECODEID uniqueidentifier = null,
    @SUFFIXCODEID uniqueidentifier = null,
    @NICKNAME nvarchar(100) = '',
    @MAIDENNAME nvarchar(200) = '',
    @BIRTHDATE UDT_FUZZYDATE = '00000000',
    @GENDERCODE int = 0,
    @MARITALSTATUSCODEID uniqueidentifier = null,
    @ADDRESSTYPECODEID uniqueidentifier = null,
    @COUNTRYID uniqueidentifier = null,
    @ADDRESS nvarchar(300) = '',
    @CITY nvarchar(100) = '',
    @STATEID uniqueidentifier = null,
    @POSTCODE nvarchar(24) = '',
    @DONOTMAIL bit = 0,
    @DONOTMAILREASONCODEID uniqueidentifier = null,
    @PHONETYPECODEID uniqueidentifier = null,
    @PHONENUMBER nvarchar(200) = '',
    @EMAILADDRESS UDT_EMAILADDRESS = '',
    @ISCOMPANYGIFT bit = 0,
    @COMPANYNAME nvarchar(200) = '',
    @COMPANYURL UDT_WEBADDRESS = null,
    @COMPANY_ADDRESSTYPECODEID uniqueidentifier = null,
    @COMPANY_COUNTRYID uniqueidentifier = null,
    @COMPANY_ADDRESS nvarchar(300) = '',
    @COMPANY_CITY nvarchar(100) = '',
    @COMPANY_STATEID uniqueidentifier = null,
    @COMPANY_POSTCODE nvarchar(24) = '',
    @COMPANY_DONOTMAIL bit = 0,
    @COMPANY_DONOTMAILREASONCODEID uniqueidentifier = null,
    @COMPANY_PHONETYPECODEID uniqueidentifier = null,
    @COMPANY_PHONENUMBER nvarchar(200) = '',
    @COMPANY_EMAILADDRESS UDT_EMAILADDRESS = null,
    @GIFTTYPE nvarchar(100) = '',
    @GIFTAMOUNT money = 0,
    @NUMPAYMENTS int = 0,
    @FREQUENCY nvarchar(200) = '',
    @AUTOINSTALLMENTS bit = 0,
    @ANONYMOUS bit = 0,
    @STARTDATE UDT_FUZZYDATE = '00000000',
    @INFINITEGIFT bit = 0,
    @PAYMENTMETHODCODE int = 0,
    @CREDITCARDHOLDER nvarchar(200) = '',
    @CREDITCARDNUMBER nvarchar(20) = '',
    @CREDITCARDTYPE uniqueidentifier = null,
    @EXPIRATIONDATE UDT_FUZZYDATE = '00000000',
  @CREDITCARDTOKEN uniqueidentifier = null,
  @CREDITCARDID uniqueidentifier = null,
  @AUTHORIZATIONCODE nvarchar(20) = '',
  @TRANSACTIONID uniqueidentifier = null,
  @REJECTIONMESSAGE nvarchar(250) = '',
  @TYPECODE tinyint = 0,
  @AMOUNT money = 0,
  @CONSTITUENTID uniqueidentifier = null,
  @CHECKDATE UDT_FUZZYDATE = '00000000',
  @CHECKNUMBER nvarchar(40) = '',
    @BANKACCOUNTTYPECODE int = 0,
    @BANKACCOUNTHOLDER nvarchar(200) = '',
    @BANKACCOUNTNUMBER nvarchar(200) = '',
    @BANKACCOUNTROUTINGCODE nvarchar(200) = '',
    @SAMEASPRIMARYADDRESS bit = 0,
    @BILLING_ADDRESSTYPECODEID uniqueidentifier = null,
    @BILLING_COUNTRYID uniqueidentifier = null,
    @BILLING_ADDRESSBLOCK nvarchar(300) = '',
    @BILLING_CITY nvarchar(100) = '',
    @BILLING_STATEID uniqueidentifier = null,
    @BILLING_POSTCODE nvarchar(24) = '',
  @BILLING_STATE nvarchar(10) = null,
  @BILLING_COUNTRY nvarchar(4) = null,
  @SAVETRIBUTEEASCONSTITUENT bit = 0,
    @SHOWTRIBUTE bit = 1,
    @TRIBUTEFIRSTNAME nvarchar(400) = '',
    @TRIBUTELASTNAME nvarchar(400) = '',
    @TRIBUTEEMAIL UDT_EMAILADDRESS = null,
    @TRIBUTEADDRESS nvarchar(600) = '',
    @TRIBUTECITY nvarchar(200) = '',
    @TRIBUTEPOSTCODE nvarchar(48) = '',
    @TRIBUTESTATEID uniqueidentifier = null,
    @TRIBUTETYPECODEID uniqueidentifier = null,
    @TRIBUTETEXT nvarchar(500) = '',
    @TRIBUTEANONYMOUS bit = 0,
    @ACKNOWLEDGEFIRSTNAME nvarchar(400) = '',
    @ACKNOWLEDGELASTNAME nvarchar(400) = '',
    @ACKNOWLEDGEEMAIL UDT_EMAILADDRESS = null,
    @MESSAGETOACKNOWLEDGE nvarchar(2000) = '',
    @RECOGNITIONCREDIT nvarchar(100) = '',
    @MATCHINGCOMPANYNAME nvarchar(400) = '',
    @MATCHINGAMOUNT money = 0,
    @RECIPIENTGROUPID uniqueidentifier = null,
  @RECIPIENTREGISTRANTID uniqueidentifier = null,
    @RECIPIENTROLE nvarchar(200) = '',
    @SENDTOACKNOWLEDGE bit = 0,

  @ORIGINALCLIENTUSERID integer = null,
  @ORIGINALCONSTITUENTID uniqueidentifier = null,
  @PHONEID uniqueidentifier = null,
  @ADDRESSID uniqueidentifier = null,
  @EMAILADDRESSID uniqueidentifier = null,

  @ORGANIZATIONCONSTITUENTID uniqueidentifier = null,

  @MERCHANTACCOUNTID uniqueidentifier = null,
  @CHANGEAGENTID uniqueidentifier = null,

  @SUBSCRIBEDNEWSLETTERIDS xml = null,

  @SENDNOTIFICATIONS bit = 1,
  @BNUMBER nvarchar(100) = '',
  @VENDORID nvarchar(50) = ''
)
as

set nocount on;

if @NUMPAYMENTS is null
  set @NUMPAYMENTS=0

if (@GIFTTYPE = 'recurring_gift' and @INFINITEGIFT = 0) or (@GIFTTYPE = 'pledge' and @FREQUENCY <> 'single_payment')
begin
  if @NUMPAYMENTS < 1
  begin
    raiserror('NUMBEROFPAYMENTSMINVALUE', 13, 1)
    return 1
  end
end

exec dbo.USP_DONATIONBATCH_ADD_EDIT
    @ID = @ID output,
    @BATCHID = @BATCHID,
    @SEQUENCE = @SEQUENCE,
    @EVENTID = @EVENTID,
    @USERID = @USERID,
    @PASSWORD = @PASSWORD,
    @LASTNAME = @LASTNAME,
    @FIRSTNAME = @FIRSTNAME,
    @MIDDLENAME = @MIDDLENAME,
    @TITLECODEID = @TITLECODEID,
    @SUFFIXCODEID = @SUFFIXCODEID,
    @NICKNAME = @NICKNAME,
    @MAIDENNAME = @MAIDENNAME,
    @BIRTHDATE = @BIRTHDATE,
    @GENDERCODE = @GENDERCODE,
    @MARITALSTATUSCODEID = @MARITALSTATUSCODEID,
    @ADDRESSTYPECODEID = @ADDRESSTYPECODEID,
    @COUNTRYID = @COUNTRYID,
    @ADDRESS = @ADDRESS,
    @CITY = @CITY,
    @STATEID = @STATEID,
    @POSTCODE = @POSTCODE,
    @DONOTMAIL = @DONOTMAIL,
    @DONOTMAILREASONCODEID = @DONOTMAILREASONCODEID,
    @PHONETYPECODEID = @PHONETYPECODEID,
    @PHONENUMBER = @PHONENUMBER,
    @EMAILADDRESS = @EMAILADDRESS,
    @ISCOMPANYGIFT = @ISCOMPANYGIFT,
    @COMPANYNAME = @COMPANYNAME,
    @COMPANYURL = @COMPANYURL,
    @COMPANY_ADDRESSTYPECODEID = @COMPANY_ADDRESSTYPECODEID,
    @COMPANY_COUNTRYID = @COMPANY_COUNTRYID,
    @COMPANY_ADDRESS = @COMPANY_ADDRESS,
    @COMPANY_CITY = @COMPANY_CITY,
    @COMPANY_STATEID = @COMPANY_STATEID,
    @COMPANY_POSTCODE = @COMPANY_POSTCODE,
    @COMPANY_DONOTMAIL = @COMPANY_DONOTMAIL,
    @COMPANY_DONOTMAILREASONCODEID = @COMPANY_DONOTMAILREASONCODEID,
    @COMPANY_PHONETYPECODEID = @COMPANY_PHONETYPECODEID,
    @COMPANY_PHONENUMBER = @COMPANY_PHONENUMBER,
    @COMPANY_EMAILADDRESS = @COMPANY_EMAILADDRESS,
    @GIFTTYPE = @GIFTTYPE,
    @GIFTAMOUNT = @GIFTAMOUNT,
    @NUMPAYMENTS = @NUMPAYMENTS,
    @FREQUENCY = @FREQUENCY,
    @AUTOINSTALLMENTS = @AUTOINSTALLMENTS,
    @ANONYMOUS = @ANONYMOUS,
    @STARTDATE = @STARTDATE,
    @INFINITEGIFT = @INFINITEGIFT,
    @PAYMENTMETHODCODE = @PAYMENTMETHODCODE,
    @CREDITCARDHOLDER = @CREDITCARDHOLDER,
    @CREDITCARDNUMBER = @CREDITCARDNUMBER,
    @CREDITCARDTYPE = @CREDITCARDTYPE,
    @EXPIRATIONDATE = @EXPIRATIONDATE,
    @CREDITCARDTOKEN = @CREDITCARDTOKEN,
    @AUTHORIZATIONCODE = @AUTHORIZATIONCODE,
    @TRANSACTIONID = @TRANSACTIONID,
    @REJECTIONMESSAGE = @REJECTIONMESSAGE,
    @CHECKDATE = @CHECKDATE,
    @CHECKNUMBER = @CHECKNUMBER,
    @BANKACCOUNTTYPECODE = @BANKACCOUNTTYPECODE,
    @BANKACCOUNTHOLDER = @BANKACCOUNTHOLDER,
    @BANKACCOUNTNUMBER = @BANKACCOUNTNUMBER,
    @BANKACCOUNTROUTINGCODE = @BANKACCOUNTROUTINGCODE,
    @SAMEASPRIMARYADDRESS = @SAMEASPRIMARYADDRESS,
    @BILLING_ADDRESSTYPECODEID = @BILLING_ADDRESSTYPECODEID,
    @BILLING_COUNTRYID = @BILLING_COUNTRYID,
    @BILLING_ADDRESSBLOCK = @BILLING_ADDRESSBLOCK,
    @BILLING_CITY = @BILLING_CITY,
    @BILLING_STATEID = @BILLING_STATEID,
    @BILLING_POSTCODE = @BILLING_POSTCODE,
    @SAVETRIBUTEEASCONSTITUENT = @SAVETRIBUTEEASCONSTITUENT,
    @SHOWTRIBUTE = @SHOWTRIBUTE,
    @TRIBUTEFIRSTNAME = @TRIBUTEFIRSTNAME,
    @TRIBUTELASTNAME = @TRIBUTELASTNAME,
    @TRIBUTEEMAIL = @TRIBUTEEMAIL,
    @TRIBUTEADDRESS = @TRIBUTEADDRESS,
    @TRIBUTECITY = @TRIBUTECITY,
    @TRIBUTEPOSTCODE = @TRIBUTEPOSTCODE,
    @TRIBUTESTATEID = @TRIBUTESTATEID,
    @TRIBUTETYPECODEID = @TRIBUTETYPECODEID,
    @TRIBUTETEXT = @TRIBUTETEXT,
    @TRIBUTEANONYMOUS = @TRIBUTEANONYMOUS,
    @ACKNOWLEDGEFIRSTNAME = @ACKNOWLEDGEFIRSTNAME,
    @ACKNOWLEDGELASTNAME = @ACKNOWLEDGELASTNAME,
    @ACKNOWLEDGEEMAIL = @ACKNOWLEDGEEMAIL,
    @MESSAGETOACKNOWLEDGE = @MESSAGETOACKNOWLEDGE,
    @RECOGNITIONCREDIT = @RECOGNITIONCREDIT,
    @MATCHINGCOMPANYNAME = @MATCHINGCOMPANYNAME,
    @MATCHINGAMOUNT = @MATCHINGAMOUNT,
    @RECIPIENTGROUPID = @RECIPIENTGROUPID,
    @RECIPIENTREGISTRANTID = @RECIPIENTREGISTRANTID,
    @RECIPIENTROLE = @RECIPIENTROLE,
    @SENDTOACKNOWLEDGE = @SENDTOACKNOWLEDGE,

    @ORIGINALCLIENTUSERID = @ORIGINALCLIENTUSERID,
    @ORIGINALCONSTITUENTID = @ORIGINALCONSTITUENTID,
    @PHONEID = @PHONEID,
    @ADDRESSID = @ADDRESSID,
    @EMAILADDRESSID = @EMAILADDRESSID,

    @ORGANIZATIONCONSTITUENTID = @ORGANIZATIONCONSTITUENTID,

    @CHANGEAGENTID = @CHANGEAGENTID,

    @SENDNOTIFICATIONS = @SENDNOTIFICATIONS,
    @VENDORID = @VENDORID


    -- exec dbo.USP_DONATIONBATCH_GETEMAILLIST_ADDFROMXML @ID, @SUBSCRIBEDNEWSLETTERIDS, @CHANGEAGENTID;

return 0