-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathWebPOS.sql
186 lines (158 loc) · 3.73 KB
/
WebPOS.sql
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
--create database WebPOS_Inventory
--GO
--create database WebPOS_Sales
--GO
--create database WebPOS_Common
GO
use WebPOS_Common
create table Setting (
Id int not null primary key identity (1, 1),
LayoutName nvarchar(50) not null,
[Language] nvarchar(50) not null,
AppTitle nvarchar(255) not null,
CalendarType tinyint not null,
IsActive bit not null
)
GO
create table OptionType (
Id int not null primary key identity (1, 1),
Name nvarchar(255) not null,
Code nvarchar(10) null,
IsReadOnly bit not null,
IsDeleted bit not null
)
GO
create table OptionValue(
Id int not null primary key identity (1, 1),
TypeId int not null,
Name nvarchar(255) not null,
Code nvarchar(255) null,
Flag nvarchar(50) null,
IsDefault bit not null,
IsReadOnly bit not null,
IsDeleted bit not null
)
GO
use WebPOS_Inventory
GO
create table Product (
Id int not null primary key identity(1, 1),
Code nvarchar(100) null,
Name nvarchar(255) not null,
Cost float not null,
Price float not null,
Profit float not null,
Discount float not null,
InitialQuantity int not null,
CurrentQuantity int not null,
AlerQuantity int not null,
CurrencyId int not null,
CurrencyName nvarchar(255) null,
CurrencyCode nvarchar(10) null,
UnitId int null,
UnitName nvarchar(255) null,
CategoryId int null,
CategoryName nvarchar(255) null,
ExpiryDate date null,
Note nvarchar(max) null,
UpdatedBy int not null,
UpdatedDate datetime2 not null,
IsDeleted bit not null
)
GO
create table Warehouse (
Id int not null primary key identity (1, 1),
Name nvarchar(255) not null,
Note nvarchar(max) null,
IsDefault bit not null,
IsDeleted bit not null
)
GO
use WebPOS_Sales
GO
create table Account (
Id int not null primary key identity (1, 1),
Name nvarchar(255) not null,
Phone nvarchar(50) null,
[Address] nvarchar(50) null,
CurrencyId int not null,
CurrencyCode nvarchar(10) null,
CurrencyName nvarchar(255) null,
CurrentDebit float not null,
CurrentCredit float not null,
CurrentBalance float not null,
AccountTypeId int not null,
AccountTypeName nvarchar(255) null,
UpdatedBy int not null,
UpdatedDate datetime2 not null,
IsDeleted bit not null
)
GO
create table Invoice (
Id int not null primary key identity (1, 1),
SerialNum nvarchar(50) not null,
InvoiceType tinyint not null,
WarehouseId int not null,
WarehouseName nvarchar(255),
TreasuryId int not null,
AccountId int null,
CurrencyId int not null,
CurrencyCode nvarchar(10) null,
CurrencyName nvarchar(255) null,
CurrencyRate float not null,
IssueDate date not null,
PaymentType tinyint not null,
TotalPrice float not null,
ItemsCount int not null,
Note nvarchar(max) null,
UpdatedBy int not null,
UpdatedDate datetime2 not null,
IsDeleted bit not null
)
GO
create table InvoiceItem (
Id int not null primary key identity (1, 1),
InvoiceId int not null,
ProductId int not null,
ProductName nvarchar(255) null,
UnitPrice float not null,
TotalPrice float not null,
Cost float not null,
Profit float not null,
UnitDiscount float not null,
TotalDiscount float not null,
Quantity int not null,
IsDeleted bit not null
)
GO
create table [Transaction] (
Id int not null primary key identity (1, 1),
Amount float not null,
[Date] date not null,
AccountId int not null,
AccountName nvarchar(255),
InvoiceId int null,
TransactionType tinyint not null,
TreasuryId int not null,
CurrncyId int not null,
CurrencyCode nvarchar(10) null,
CurrencyName nvarchar(255) null,
CurrencyRate float not null,
Note nvarchar(max) null,
UpdatedBy int not null,
UpdatedDate datetime2 not null,
IsDeleted bit not null
)
GO
create table Treasury (
Id int not null primary key identity (1, 1),
Name nvarchar(255) not null,
CurrencyId int not null,
CurrencyCode nvarchar(10) null,
CurrencyName nvarchar(255) null,
CurrentBalance float not null,
Note nvarchar(max) null,
IsDefault bit not null,
IsDeleted bit not null
)
GO