Subversion Repositories SmartDukaan

Rev

Rev 37588 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 37588 Rev 37592
Line 17... Line 17...
17
CREATE TABLE IF NOT EXISTS fofo.partner_investment (
17
CREATE TABLE IF NOT EXISTS fofo.partner_investment (
18
    fofo_id                      INT            NOT NULL,
18
    fofo_id                      INT            NOT NULL,
19
 
19
 
20
    -- refreshed every 2 minutes
20
    -- refreshed every 2 minutes
21
    wallet_amount                DECIMAL(14,2)  NOT NULL DEFAULT 0,
21
    wallet_amount                DECIMAL(14,2)  NOT NULL DEFAULT 0,
-
 
22
 
-
 
23
    -- GROSS stock. Investment counts stock net of live-demo units held past 90 days, but that
-
 
24
    -- haircut moves on its own daily clock, so storing the netted figure would mean re-netting it
-
 
25
    -- every time the haircut changed. Store what is measured and derive the net
-
 
26
    -- (getNetInStockAmount = gross - demo_excluded_amount).
22
    in_stock_amount              DECIMAL(14,2)  NOT NULL DEFAULT 0,
27
    in_stock_gross_amount        DECIMAL(14,2)  NOT NULL DEFAULT 0,
23
    unbilled_amount              DECIMAL(14,2)  NOT NULL DEFAULT 0,
28
    unbilled_amount              DECIMAL(14,2)  NOT NULL DEFAULT 0,
24
    grn_pending_amount           DECIMAL(14,2)  NOT NULL DEFAULT 0,
29
    grn_pending_amount           DECIMAL(14,2)  NOT NULL DEFAULT 0,
25
    activated_stock_amount       DECIMAL(14,2)  NOT NULL DEFAULT 0,
30
    activated_stock_amount       DECIMAL(14,2)  NOT NULL DEFAULT 0,
26
    activated_grn_pending_amount DECIMAL(14,2)  NOT NULL DEFAULT 0,
31
    activated_grn_pending_amount DECIMAL(14,2)  NOT NULL DEFAULT 0,
27
    return_in_transit_amount     DECIMAL(14,2)  NOT NULL DEFAULT 0,
32
    return_in_transit_amount     DECIMAL(14,2)  NOT NULL DEFAULT 0,
28
    utilized_amount              DECIMAL(14,2)  NOT NULL DEFAULT 0,
33
    utilized_amount              DECIMAL(14,2)  NOT NULL DEFAULT 0,
29
 
34
 
30
    -- refreshed daily (time-driven), plus on the sweep when the partner's stock moved
35
    -- refreshed daily (time-driven), plus on the sweep when the partner's stock moved
31
    aged_apple_stock_amount      DECIMAL(14,2)  NOT NULL DEFAULT 0,
36
    aged_apple_stock_amount      DECIMAL(14,2)  NOT NULL DEFAULT 0,
-
 
37
    aged_apple_qty               INT            NOT NULL DEFAULT 0,
32
    demo_excluded_amount         DECIMAL(14,2)  NOT NULL DEFAULT 0,
38
    demo_excluded_amount         DECIMAL(14,2)  NOT NULL DEFAULT 0,
33
    aged_refreshed_on            DATE               NULL,
39
    aged_refreshed_on            DATE               NULL,
34
 
40
 
35
    -- derived
41
    -- derived
36
    total_investment             DECIMAL(14,2)  NOT NULL DEFAULT 0,
42
    total_investment             DECIMAL(14,2)  NOT NULL DEFAULT 0,