/*==============================================================*/
/* Upgrade struktury z wersji 70 do 71                          */
/*==============================================================*/

/* ================== Tabela ReceiptPaymentBon ====================*/

CREATE TABLE ReceiptPaymentBon (
    PaymentFormId        NUMERIC(9)           NOT NULL,
    CurrencyId           NUMERIC(9)           NOT NULL,
    PosId                NUMERIC(9)           NOT NULL,
    ReceiptId            NUMERIC(9)           NOT NULL,
    OrderNumber          SMALLINT             NOT NULL,
    BonCode              VARCHAR(40)          NULL,
    ServiceName          VARCHAR(25)          NULL,
    TransactionId        VARCHAR(40)          NULL,
    BonType 		     SMALLINT             NULL,
    BonValue             DECIMAL(16,4)        NULL,
    TransactionTime 	 DATETIME             NULL,
    constraint PK_ReceiptPaymentBon PRIMARY KEY (ReceiptId, CurrencyId, PaymentFormId, PosId, OrderNumber)
)
GO

/* Update numeru struktury */
UPDATE StructureVersion SET Version = 71
GO