Loyalty_GenderInfo View

<< Click to Display Table of Contents >>

Navigation:  iVend Database Database > Views >

Loyalty_GenderInfo View

Navigation: iVend Database Database > Views >

hm_btn_navigate_prevhm_btn_navigate_tophm_btn_navigate_next

iVend 6.6 Database Help

Loyalty_GenderInfo View

Collapse All Expand All

iVend Database Database : Loyalty_GenderInfo View

Properties

Creation Date

6/3/2015 7:07 PM

Is Schema Bound

dbimages_boolean-false

Encrypted

dbimages_boolean-false

Ansi Nulls

dbimages_boolean-true

Columns

 

Column Name

Description

Datatype

Length

Allow Nulls

Default

Formula

 

LoyaltyId

 

VarWChar

50

 

 

 

 

BirthDate

 

DBTimeStamp

4

dbimages_tick

 

 

 

Gender

 

VarWChar

50

dbimages_tick

 

 

 

ActualDate

 

DBTimeStamp

4

 

 

 

 

TransactionKey

 

Integer

4

dbimages_tick

 

 

 

PayableAmount

 

Numeric

9 (38,5)

dbimages_tick

 

 

 

LoyaltyProgram

 

VarWChar

40

dbimages_tick

 

 

 

LoyaltyProgramDesc

 

VarWChar

200

dbimages_tick

 

 

 

SubsidiaryKey

 

BigInt

8

dbimages_tick

 

 

 

CultureInfo

 

VarWChar

40

dbimages_tick

 

 

 

BaseCultureInfo

 

VarWChar

20

dbimages_tick

 

 

 

ExchangeRate

 

Numeric

9 (20,5)

 

 

 

Objects that Loyalty_GenderInfo depends on

 

Database Object

Object Type

Description

Dep Level

CfgLoyaltyConfig table

CfgLoyaltyConfig

Table

Stores the configuration information for the loyalty

1

CusCustomer table

CusCustomer

Table

Defines the customer details that interact with the enterprise.

1

LoyLoyaltyCardInformation table

LoyLoyaltyCardInformation

Table

Store the Details of Loyalty Customer in the system.

1

PmtCurrency table

PmtCurrency

Table

Define a list of all currecies defined in the system.

1

RtlSubsidiary table

RtlSubsidiary

Table

Defines all the Subsidiaries defined in the application

1

SubSubsidiaryItem table

SubSubsidiaryItem

Table

Stores Subsidiary information for each master, which can have multiple Subsidiaries assigned

1

TrxTransaction table

TrxTransaction

Table

The main table which defined the primary details concerned with every type of transaction.

1

TrxTransactionPayment table

TrxTransactionPayment

Table

Stores all the payment details for each transaction.

1

View Definition

CREATE view [dbo].[Loyalty_GenderInfo]

AS

Select

Distinct LCI.LoyaltyId,

CASE WHEN LCI.RegistrationMethod IN (1,3) THEN Cust.BirthDate WHEN LCI.RegistrationMethod=2 THEN LCI.BirthDate END AS BirthDate,

CASE WHEN LCI.RegistrationMethod IN (1,3) THEN Cust.Gender WHEN LCI.RegistrationMethod=2 THEN ISNULL(LCI.Gender,'') END AS Gender,

LCI.RegistrationDate AS ActualDate,Count(Trx.TransactionKey)TransactionKey, Sum(TP.PaidAmount)PayableAmount, Cg.Id AS LoyaltyProgram,

Cg.Description AS LoyaltyProgramDesc, Sub.SubsidiaryKey,

(CASE WHEN (ISNULL(Sub.SubsidiaryKey,0) =0 OR Sub.SubsidiaryKey IS NULL) THEN (Select CultureInfo From PmtCurrency Where IsBaseCurrency=1) ELSE Sub.CultureInfo END) AS CultureInfo,

(Select CultureInfo From PmtCurrency Where IsBaseCurrency=1) AS BaseCultureInfo, ISNULL(Trx.ExchangeRate,1) AS ExchangeRate

From

LoyLoyaltyCardInformation LCI

LEFT OUTER JOIN CusCustomer Cust WITH (NOLOCK) ON LCI.CustomerKey = Cust.CustomerKey   and LCI.IsDeleted =0-- AND CUSt.IsDeleted=0

LEFT OUTER JOIN TrxTransaction Trx WITH (NOLOCK) ON LCI.LoyaltyId = Trx.LoyaltyId and Trx.IsVoided =0 AND Trx.IsSuspended=0

INNER JOIN TrxTransactionPayment TP ON Trx.TransactionKey = Tp.TransactionKey AND TP.TenderType<>9

INNER JOIN CfgLoyaltyConfig Cg ON LCI.LoyaltyConfigKey = Cg.LoyaltyConfigKey

LEFT OUTER JOIN SubSubsidiaryItem SSI ON Cg.LoyaltyConfigKey = SSI.SourceKey And SourceType=328

LEFT OUTER JOIN RtlSubsidiary Sub ON SSI.SubsidiaryKey = Sub.SubsidiaryKey

Group BY LCI.LoyaltyId, LCI.RegistrationMethod, Cust.BirthDate, LCI.BirthDate, Cust.Gender, LCI.Gender, LCI.RegistrationDate,

Cg.Id, Cg.Description, Sub.SubsidiaryKey, Sub.CultureInfo, ISNULL(Trx.ExchangeRate,1)

See Also

Related Objects

iVend Database Database

 

 


© 2019 All Rights Reserved.

Send comments on this topic.