/*==============================================================*/
/* Upgrade struktury z wersji 56 do 57                          */
/*==============================================================*/

CREATE TABLE FiscalReportECopy(
	ReportId 						INTEGER 		PRIMARY KEY AUTOINCREMENT,
	PosId 							numeric(9) 		not null,
	LastUpdate 						datetime 		not null,
	FormatForPharmacyPrinter 		smallint 		not null,
	SupportForPharmacyFunctions 	smallint 		not null,
	ReportDate 						datetime 		not null,
	ReceiptCount 					numeric 		not null,
	CancelledReceiptCount 			numeric 		not null,
	DbChangesCount 					numeric 		not null,
	DailyReportNumber 				numeric 		not null,
	SaleBruttoValue 				decimal(20,2) 	not null,
	PTUValue 						decimal(20,2) 	not null,
	PrintoutCount 					numeric 		not null,
	ResetCount 						numeric 		not null,
	LastReceiptNumber 				numeric 		not null,
	LastPrintoutNumber 				numeric 		not null,
	ValuationCount 					numeric 		not null,
	CancelledReceiptValue 			decimal(20,2) 	not null,
	Payment 						decimal(20,2) 	not null,
	TotalizerA 						decimal(20,2) 	not null,
	TotalizerB 						decimal(20,2) 	not null,
	TotalizerC 						decimal(20,2) 	not null,
	TotalizerD 						decimal(20,2) 	not null,
	TotalizerE 						decimal(20,2) 	not null,
	TotalizerF 						decimal(20,2) 	not null,
	TotalizerG 						decimal(20,2) 	not null,
	PTUA 							decimal(20,2) 	not null,
	PTUB 							decimal(20,2) 	not null,
	PTUC 							decimal(20,2) 	not null,
	PTUD 							decimal(20,2) 	not null,
	PTUE 							decimal(20,2) 	not null,
	PTUF 							decimal(20,2) 	not null,
	PTUG 							decimal(20,2) 	not null,
	TotalValuePTU_A 				decimal(20,2) 	not null,
	TotalValuePTU_B 				decimal(20,2) 	not null,
	TotalValuePTU_C 				decimal(20,2) 	not null,
	TotalValuePTU_D 				decimal(20,2) 	not null,
	TotalValuePTU_E 				decimal(20,2) 	not null,
	TotalValuePTU_F 				decimal(20,2) 	not null,
	TotalValuePTU_G 				decimal(20,2) 	not null,
	TotalValuePTU 					decimal(20,2) 	not null,
	TotalSaleBrutto 				decimal(20,2) 	not null,
	TotalizerA_FV 					decimal(20,2) 	not null,
	TotalizerB_FV 					decimal(20,2) 	not null,
	TotalizerC_FV 					decimal(20,2) 	not null,
	TotalizerD_FV 					decimal(20,2) 	not null,
	TotalizerE_FV 					decimal(20,2) 	not null,
	TotalizerF_FV 					decimal(20,2) 	not null,
	TotalizerG_FV 					decimal(20,2) 	not null,
	PTUA_FV 						decimal(20,2) 	not null,
	PTUB_FV 						decimal(20,2) 	not null,
	PTUC_FV 						decimal(20,2) 	not null,
	PTUD_FV 						decimal(20,2) 	not null,
	PTUE_FV 						decimal(20,2) 	not null,
	PTUF_FV 						decimal(20,2) 	not null,
	PTUG_FV 						decimal(20,2) 	not null,
	TotalValuePTU_A_FV 				decimal(20,2) 	not null,
	TotalValuePTU_B_FV 				decimal(20,2) 	not null,
	TotalValuePTU_C_FV 				decimal(20,2) 	not null,
	TotalValuePTU_D_FV 				decimal(20,2) 	not null,
	TotalValuePTU_E_FV 				decimal(20,2) 	not null,
	TotalValuePTU_F_FV 				decimal(20,2) 	not null,
	TotalValuePTU_G_FV 				decimal(20,2) 	not null,
	TotalValuePTU_FV 				decimal(20,2) 	not null,
	TotalSaleBruttoFV 				decimal(20,2) 	not null,
	InvoiceCount 					numeric 		not null,
	LastInvoiceNumber 				numeric 		not null,
	TotalSaleFV 					numeric 		not null,
	TotalPTU_FV 					decimal(20,2) 	not null,
	RatePTU_A 						smallint 		not null,
	RatePTU_B 						smallint 		not null,
	RatePTU_C 						smallint 		not null,
	RatePTU_D 						smallint 		not null,
	RatePTU_E 						smallint 		not null,
	RatePTU_F 						smallint 		not null,
	RatePTU_G 						smallint 		not null,
	CurrencyName 					text(20) 		not null,
	CancelledValuationCount 		numeric 		not null,
	ShortcutFromElectronicCopyData 	text(80) 		not null,
	FirstSale 						datetime 		not null,
	LastSale 						datetime		not null
)
GO

UPDATE StructureVersion SET Version = 57
GO
