JSlip
1.0
jslip
src
module
RootMenu
RootMenuModel.php
Go to the documentation of this file.
1
<?php
8
require_once(dirname(__FILE__) .
'/../../lib/Model.php'
);
9
10
class
RootMenuModel
extends
Model
11
{
12
public
function
chkDatabse
() {
13
14
$this->
connect
();
15
$sql =
"SELECT COUNT(*) AS `cnt` FROM `t_basic`"
;
16
$rec = $this->
getRecord
($sql);
17
$this->
close
();
18
19
if
($rec[0][
'cnt'
] < 1) {
20
return
$this->
_init
();
21
}
22
23
return
''
;
24
}
25
26
private
function
_init
() {
27
28
$err = $this->
_initBasic
();
29
30
if
(!empty($err)) {
31
return
$err;
32
}
33
34
$err = $this->
_initSection
();
35
36
if
(!empty($err)) {
37
return
$err;
38
}
39
40
$err = $this->
_initAccount
();
41
42
if
(!empty($err)) {
43
return
$err;
44
}
45
46
$err = $this->
_initItem
();
47
48
if
(!empty($err)) {
49
return
$err;
50
}
51
52
$err = $this->
_initTax
();
53
54
if
(!empty($err)) {
55
return
$err;
56
}
57
58
$err = $this->
_initEra
();
59
60
if
(!empty($err)) {
61
return
$err;
62
}
63
64
return
''
;
65
}
66
67
private
function
_initBasic
() {
68
69
$err =
''
;
70
71
$this->
connect
();
72
$this->
begin
();
73
74
try
{
75
76
$sql =
"INSERT INTO `t_basic`"
77
.
" (`name`, `disp_name`, `term_year`, `term_begin`, `term_end`, `round`, `calendar`, `valid_flg`)"
78
.
" VALUES"
79
.
" ('Datagram', '有限会社データグラム', 2018, '2018-04-01', '2019-03-31', 0, 'japanese', FALSE)"
80
;
81
$ans = $this->
query
($sql);
82
83
for
($i = 0; $i < 99; $i++) {
84
$sql =
"INSERT INTO `t_basic`"
85
.
" (`name`, `disp_name`, `term_year`, `term_begin`, `term_end`, `round`, `calendar`, `valid_flg`)"
86
.
" VALUES"
87
.
" ('名称', '表示名称', 2018, '2018-04-01', '2019-03-31', 0, 'japanese', FALSE)"
88
;
89
$ans = $this->
query
($sql);
90
}
91
92
}
catch
(Exception $e) {
93
$err = $e->getMessage();
94
}
95
96
if
(empty($err)) {
97
$this->
commit
();
98
}
else
{
99
$this->
rollback
();
100
}
101
102
$this->
close
();
103
104
return
$err;
105
}
106
107
private
function
_initSection
() {
108
109
$err =
''
;
110
111
$this->
connect
();
112
$this->
begin
();
113
114
try
{
115
$sql =
"SELECT `id` FROM `t_basic` ORDER BY `id`"
;
116
$rec = $this->
getRecord
($sql);
117
118
foreach
($rec as $r) {
119
120
$sql =
"INSERT INTO `t_section`"
121
.
" (`bid`, `kana`, `name`, `update_person`)"
122
.
" VALUES"
123
.
" ('"
. $r[
'id'
] .
"'"
124
.
", 'きょうつう'"
125
.
", '共通'"
126
.
", '"
. $_SESSION[
'minfo'
][
'mid'
] .
"'"
127
.
")"
128
;
129
$ans = $this->
query
($sql);
130
}
131
132
}
catch
(Exception $e) {
133
$err = $e->getMessage();
134
}
135
136
if
(empty($err)) {
137
$this->
commit
();
138
}
else
{
139
$this->
rollback
();
140
}
141
142
$this->
close
();
143
144
return
$err;
145
}
146
147
private
function
_initAccount
() {
148
149
$err =
''
;
150
$acc = $this->
_getAccount
();
151
152
$this->
connect
();
153
$this->
begin
();
154
155
try
{
156
$sql =
"SELECT `id` FROM `t_basic` ORDER BY `id`"
;
157
$rec = $this->
getRecord
($sql);
158
159
foreach
($rec as $r) {
160
foreach
($acc as $a) {
161
$sql =
"INSERT INTO `t_account`"
162
.
" (`bid`, `ccd`, `item`, `item_ccd`, `division`, `kana`, `name`, `delete_flg`, `edit_flg`, `update_person`)"
163
.
" VALUES"
164
.
" ('"
. $r[
'id'
] .
"'"
165
.
", '"
. $a[0] .
"'"
166
.
", '"
. $a[1] .
"'"
167
.
", '"
. $a[2] .
"'"
168
.
", '"
. $a[3] .
"'"
169
.
", '"
. $a[4] .
"'"
170
.
", '"
. $a[5] .
"'"
171
.
", FALSE"
172
.
", FALSE"
173
.
", '"
. $_SESSION[
'minfo'
][
'mid'
] .
"'"
174
.
")"
175
;
176
$ans = $this->
query
($sql);
177
}
178
}
179
180
}
catch
(Exception $e) {
181
$err = $e->getMessage();
182
}
183
184
if
(empty($err)) {
185
$this->
commit
();
186
}
else
{
187
$this->
rollback
();
188
}
189
190
$this->
close
();
191
192
return
$err;
193
}
194
195
private
function
_initItem
() {
196
197
$err =
''
;
198
$acc = $this->
_getAccount
();
199
200
$this->
connect
();
201
$this->
begin
();
202
203
try
{
204
$sql =
"SELECT `id` FROM `t_basic` ORDER BY `id`"
;
205
$rec = $this->
getRecord
($sql);
206
207
foreach
($rec as $r) {
208
foreach
($acc as $a) {
209
$sql =
"INSERT INTO `t_item`"
210
.
" (`bid`, `kcd`, `ccd`, `account`, `item`, `kana`, `name`, `valid_flg`, `delete_flg`, `edit_flg`, `update_person`)"
211
.
" VALUES"
212
.
" ('"
. $r[
'id'
] .
"'"
213
.
", '"
. sprintf(
"%4d%02d00"
, $a[0], $a[1]) .
"'"
214
.
", '"
. $a[0] .
"'"
215
.
", '"
. $a[1] .
"'"
216
.
", '0'"
217
.
", '"
. $a[4] .
"'"
218
.
", '"
. $a[5] .
"'"
219
.
", TRUE"
220
.
", FALSE"
221
.
", FALSE"
222
.
", '"
. $_SESSION[
'minfo'
][
'mid'
] .
"'"
223
.
")"
224
;
225
$ans = $this->
query
($sql);
226
}
227
}
228
229
}
catch
(Exception $e) {
230
$err = $e->getMessage();
231
}
232
233
if
(empty($err)) {
234
$this->
commit
();
235
}
else
{
236
$this->
rollback
();
237
}
238
239
$this->
close
();
240
241
return
$err;
242
}
243
244
private
function
_getAccount
() {
245
return
[
246
[
'0'
,
'0'
,
'0'
,
'0'
,
'しょぐち'
,
'諸口'
],
247
[
'1111'
,
'11'
,
'10'
,
'0'
,
'げんきん'
,
'現金'
],
248
[
'1112'
,
'11'
,
'10'
,
'0'
,
'とうざよきん'
,
'当座預金'
],
249
[
'1112'
,
'12'
,
'10'
,
'0'
,
'ふつうよきん'
,
'普通預金'
],
250
[
'1112'
,
'13'
,
'10'
,
'0'
,
'つうちよきん'
,
'通知預金'
],
251
[
'1112'
,
'19'
,
'10'
,
'0'
,
'そのたりゅうどうせいよきん'
,
'其他流動性預金'
],
252
[
'1112'
,
'21'
,
'10'
,
'0'
,
'ていきよきん'
,
'定期預金'
],
253
[
'1112'
,
'22'
,
'10'
,
'0'
,
'ていきつみたて'
,
'定期積金'
],
254
[
'1112'
,
'29'
,
'10'
,
'0'
,
'そのたこていせいよきん'
,
'其他固定性預金'
],
255
[
'1121'
,
'11'
,
'10'
,
'0'
,
'うけとりてがた'
,
'受取手形'
],
256
[
'1131'
,
'11'
,
'10'
,
'0'
,
'うりかけきん'
,
'売掛金'
],
257
[
'1139'
,
'11'
,
'10'
,
'1'
,
'かしだおれひきあてきん'
,
'貸倒引当金'
],
258
[
'1140'
,
'11'
,
'10'
,
'0'
,
'ゆうかしょうけん'
,
'有価証券'
],
259
[
'1210'
,
'11'
,
'14'
,
'0'
,
'しょうひん'
,
'商品'
],
260
[
'1220'
,
'11'
,
'13'
,
'0'
,
'せいひん'
,
'製品'
],
261
[
'1250'
,
'11'
,
'11'
,
'0'
,
'げんざいりょう'
,
'原材料'
],
262
[
'1260'
,
'11'
,
'12'
,
'0'
,
'しかかりきん'
,
'仕掛品'
],
263
[
'1270'
,
'11'
,
'10'
,
'0'
,
'ちょぞうひん'
,
'貯蔵品'
],
264
[
'1410'
,
'11'
,
'10'
,
'0'
,
'まえわたしきん'
,
'前渡金'
],
265
[
'1420'
,
'11'
,
'10'
,
'0'
,
'かりばらいきん'
,
'仮払金'
],
266
[
'1420'
,
'21'
,
'10'
,
'0'
,
'かりばらいしょうひぜい'
,
'仮払消費税'
],
267
[
'1421'
,
'11'
,
'10'
,
'0'
,
'まえばらいひよう'
,
'前払費用'
],
268
[
'1430'
,
'22'
,
'10'
,
'0'
,
'みしゅうしょうひぜい'
,
'未収消費税'
],
269
[
'1441'
,
'11'
,
'10'
,
'0'
,
'たんきかしつけきん'
,
'短期貸付金'
],
270
[
'1450'
,
'11'
,
'10'
,
'0'
,
'みしゅうきん'
,
'未収金'
],
271
[
'1460'
,
'11'
,
'10'
,
'0'
,
'たてかえきん'
,
'立替金'
],
272
[
'1990'
,
'11'
,
'10'
,
'1'
,
'かしだおれひきあてきん'
,
'貸倒引当金'
],
273
[
'2111'
,
'11'
,
'10'
,
'0'
,
'たてもの'
,
'建物'
],
274
[
'2111'
,
'12'
,
'10'
,
'0'
,
'たてものふぞくせつび'
,
'建物付属設備'
],
275
[
'2121'
,
'11'
,
'10'
,
'0'
,
'こうちくぶつ'
,
'構築物'
],
276
[
'2131'
,
'11'
,
'10'
,
'0'
,
'きかいそうち'
,
'機械装置'
],
277
[
'2151'
,
'11'
,
'10'
,
'0'
,
'しゃりょううんぱんぐ'
,
'車輌運搬具'
],
278
[
'2151'
,
'12'
,
'10'
,
'0'
,
'ふつうじょうようしゃ'
,
'普通乗用車'
],
279
[
'2161'
,
'11'
,
'10'
,
'0'
,
'こうぐきぐびひん'
,
'工具器具備品'
],
280
[
'2210'
,
'11'
,
'10'
,
'0'
,
'とち'
,
'土地'
],
281
[
'2270'
,
'11'
,
'10'
,
'0'
,
'けんせつかりかんじょう'
,
'建設仮勘定'
],
282
[
'2290'
,
'11'
,
'10'
,
'1'
,
'げんかしょうきゃくりゅけいがく'
,
'減価償却累計額'
],
283
[
'2330'
,
'11'
,
'10'
,
'0'
,
'しゃくちけん'
,
'借地権'
],
284
[
'2420'
,
'11'
,
'10'
,
'0'
,
'でんわかにゅうけん'
,
'電話加入権'
],
285
[
'2611'
,
'11'
,
'10'
,
'0'
,
'とうしゆうかしょうけん'
,
'投資有価証券'
],
286
[
'2620'
,
'11'
,
'10'
,
'0'
,
'ほしょうきん'
,
'保証金'
],
287
[
'2620'
,
'19'
,
'10'
,
'0'
,
'そのたとうし'
,
'その他投資'
],
288
[
'2621'
,
'11'
,
'10'
,
'0'
,
'しゅっしきん'
,
'出資金'
],
289
[
'2631'
,
'11'
,
'10'
,
'0'
,
'ちょうきかしつけきん'
,
'長期貸付金'
],
290
[
'2639'
,
'11'
,
'10'
,
'1'
,
'かしだおれひきあてきん'
,
'貸倒引当金'
],
291
[
'2810'
,
'11'
,
'10'
,
'0'
,
'ちょうきまえばらいひよう'
,
'長期前払費用'
],
292
[
'3110'
,
'11'
,
'10'
,
'1'
,
'そうりつひ'
,
'創立費'
],
293
[
'4110'
,
'11'
,
'20'
,
'1'
,
'わりびきてがた'
,
'割引手形'
],
294
[
'4110'
,
'12'
,
'20'
,
'1'
,
'うらがきてがた'
,
'裏書手形'
],
295
[
'4111'
,
'11'
,
'20'
,
'1'
,
'しはらいてがた'
,
'支払手形'
],
296
[
'4120'
,
'11'
,
'20'
,
'1'
,
'かいかけきん'
,
'買掛金'
],
297
[
'4130'
,
'11'
,
'20'
,
'1'
,
'たんきかりいれきん'
,
'短期借入金'
],
298
[
'4140'
,
'11'
,
'20'
,
'1'
,
'みはらいきん'
,
'未払金'
],
299
[
'4140'
,
'12'
,
'20'
,
'1'
,
'みはらいひよう'
,
'未払費用'
],
300
[
'4140'
,
'21'
,
'20'
,
'1'
,
'みはらいしょうひぜい'
,
'未払消費税'
],
301
[
'4147'
,
'11'
,
'21'
,
'1'
,
'みはらいほうじんぜいとう'
,
'未払法人税等'
],
302
[
'4160'
,
'11'
,
'20'
,
'1'
,
'まえうけきん'
,
'前受金'
],
303
[
'4160'
,
'12'
,
'20'
,
'1'
,
'かりうけきん'
,
'仮受金'
],
304
[
'4160'
,
'22'
,
'20'
,
'1'
,
'かりうけしょうひぜい'
,
'仮受消費税'
],
305
[
'4170'
,
'11'
,
'20'
,
'1'
,
'あずかりきん'
,
'預り金'
],
306
[
'4210'
,
'11'
,
'20'
,
'1'
,
'まえうけしゅうえき'
,
'前受収益'
],
307
[
'4350'
,
'11'
,
'20'
,
'1'
,
'しょうよひきあてきん'
,
'賞与引当金'
],
308
[
'5141'
,
'11'
,
'20'
,
'1'
,
'ちょうきかりいれきん'
,
'長期借入金'
],
309
[
'5310'
,
'11'
,
'20'
,
'1'
,
'たいしょくきゅうよひきあてきん'
,
'退職給与引当金'
],
310
[
'7110'
,
'11'
,
'30'
,
'1'
,
'しほんきん'
,
'資本金'
],
311
[
'7210'
,
'11'
,
'30'
,
'1'
,
'しほんじゅんびきん'
,
'資本準備金'
],
312
[
'7260'
,
'11'
,
'30'
,
'1'
,
'りえきじゅんびきん'
,
'利益準備金'
],
313
[
'7310'
,
'11'
,
'30'
,
'1'
,
'そのたじょうよきん'
,
'その他剰余金'
],
314
[
'7328'
,
'11'
,
'30'
,
'1'
,
'べっとつみたてきん'
,
'別途積立金'
],
315
[
'8111'
,
'11'
,
'61'
,
'1'
,
'うりあげだか'
,
'売上高'
],
316
[
'8111'
,
'12'
,
'61'
,
'1'
,
'ひかぜいうりあげだか'
,
'非課税売上高'
],
317
[
'8111'
,
'21'
,
'62'
,
'1'
,
'しょうひんうりあげだか'
,
'商品売上高'
],
318
[
'8111'
,
'22'
,
'62'
,
'1'
,
'ひかぜいしょうひんうりあげだか'
,
'非課税商品売上高'
],
319
[
'8119'
,
'11'
,
'61'
,
'0'
,
'うりあげねびきだか'
,
'売上値引高'
],
320
[
'8119'
,
'12'
,
'61'
,
'0'
,
'うりあげもどりだか'
,
'売上戻り高'
],
321
[
'8119'
,
'21'
,
'62'
,
'0'
,
'しょうひんうりあげねびきだか'
,
'商品売上値引高'
],
322
[
'8119'
,
'22'
,
'62'
,
'0'
,
'しょうひんうりあげもどりだか'
,
'商品売上戻り高'
],
323
[
'8210'
,
'11'
,
'44'
,
'0'
,
'きしゅしょうひんたなおろしだか'
,
'期首商品棚卸高'
],
324
[
'8210'
,
'12'
,
'43'
,
'0'
,
'きしゅせいひんたなおろしだか'
,
'期首製品棚卸高'
],
325
[
'8210'
,
'21'
,
'41'
,
'0'
,
'きしゅざいりょうたなおろしだか'
,
'期首材料棚卸高'
],
326
[
'8210'
,
'31'
,
'42'
,
'0'
,
'きしゅしかかりたなおりしだか'
,
'期首仕掛棚卸高'
],
327
[
'8221'
,
'11'
,
'71'
,
'0'
,
'しいれだか'
,
'仕入高'
],
328
[
'8221'
,
'12'
,
'71'
,
'0'
,
'ひかぜいしいれだか'
,
'非課税仕入高'
],
329
[
'8221'
,
'21'
,
'51'
,
'0'
,
'ざいりょうしいれだか'
,
'材料仕入高'
],
330
[
'8221'
,
'22'
,
'51'
,
'0'
,
'ひかぜいざいりょうしいれ'
,
'非課税材料仕入'
],
331
[
'8229'
,
'11'
,
'71'
,
'1'
,
'しいれねびきだか'
,
'仕入値引高'
],
332
[
'8229'
,
'12'
,
'71'
,
'1'
,
'しいれもどしだか'
,
'仕入戻し高'
],
333
[
'8229'
,
'21'
,
'51'
,
'1'
,
'ざいりょうしいれねびきだか'
,
'材料仕入値引高'
],
334
[
'8229'
,
'22'
,
'51'
,
'1'
,
'ざいりょうしいれもどしだか'
,
'材料仕入戻し高'
],
335
[
'8230'
,
'11'
,
'52'
,
'0'
,
'ちんぎんてあて(せい)'
,
'賃金手当(製)'
],
336
[
'8230'
,
'12'
,
'52'
,
'0'
,
'しょうよ(せい)'
,
'賞与(製)'
],
337
[
'8230'
,
'13'
,
'52'
,
'0'
,
'ざっきゅう(せい)'
,
'雑給(製)'
],
338
[
'8230'
,
'14'
,
'52'
,
'0'
,
'たいしょくきん(せい)'
,
'退職金(製)'
],
339
[
'8230'
,
'15'
,
'53'
,
'0'
,
'ほうていふくりひ(せい)'
,
'法定福利費(製)'
],
340
[
'8230'
,
'16'
,
'53'
,
'0'
,
'ふくりこうせいひ(せい)'
,
'福利厚生費(製)'
],
341
[
'8230'
,
'17'
,
'53'
,
'0'
,
'そのたろうむひ(せい)'
,
'其他労務費(製)'
],
342
[
'8230'
,
'21'
,
'54'
,
'0'
,
'がいちゅうかこうひ(せい)'
,
'外注加工費(製)'
],
343
[
'8230'
,
'31'
,
'54'
,
'0'
,
'どうりょくひ(せい)'
,
'動力費(製)'
],
344
[
'8230'
,
'32'
,
'54'
,
'0'
,
'ちんたいりょう(せい)'
,
'賃貸料(製)'
],
345
[
'8230'
,
'33'
,
'54'
,
'0'
,
'ほけんりょう(せい)'
,
'保険料(製)'
],
346
[
'8230'
,
'34'
,
'54'
,
'0'
,
'しゅうぜんひ(せい)'
,
'修繕費(製)'
],
347
[
'8230'
,
'35'
,
'54'
,
'0'
,
'げんかしょうきゃくひ(せい)'
,
'減価償却費(製)'
],
348
[
'8230'
,
'36'
,
'54'
,
'0'
,
'にづくりうんちん(せい)'
,
'荷造運賃(製)'
],
349
[
'8230'
,
'37'
,
'54'
,
'0'
,
'しょうもうひんひ(せい)'
,
'消耗品費(製)'
],
350
[
'8230'
,
'38'
,
'54'
,
'0'
,
'すいどうこうねつひ(せい)'
,
'水道光熱費(製)'
],
351
[
'8230'
,
'39'
,
'54'
,
'0'
,
'こうさいひ(せい)'
,
'交際費(製)'
],
352
[
'8230'
,
'41'
,
'54'
,
'0'
,
'りょひこうつうひ(せい)'
,
'旅費交通費(製)'
],
353
[
'8230'
,
'42'
,
'54'
,
'0'
,
'つうしんひ(せい)'
,
'通信費(製)'
],
354
[
'8230'
,
'43'
,
'54'
,
'0'
,
'そぜいこうか(せい)'
,
'租税公課(製)'
],
355
[
'8230'
,
'44'
,
'54'
,
'0'
,
'けんきゅうひ(せい)'
,
'研究費(製)'
],
356
[
'8230'
,
'91'
,
'54'
,
'0'
,
'ざっぴ(せい)'
,
'雑費(製)'
],
357
[
'8230'
,
'99'
,
'54'
,
'1'
,
'たかんじょうへふりかえ'
,
'他勘定へ振替'
],
358
[
'8240'
,
'11'
,
'49'
,
'1'
,
'きまつしょうひんたなおろしだか'
,
'期末商品棚卸高'
],
359
[
'8240'
,
'12'
,
'48'
,
'1'
,
'きまつせいひんたなおろしだか'
,
'期末製品棚卸高'
],
360
[
'8240'
,
'21'
,
'46'
,
'1'
,
'きまつざいりょうたなおろしだか'
,
'期末材料棚卸高'
],
361
[
'8240'
,
'31'
,
'47'
,
'1'
,
'きまつしかかりたなおりしだか'
,
'期末仕掛棚卸高'
],
362
[
'8310'
,
'11'
,
'72'
,
'0'
,
'やくいんほうしゅう'
,
'役員報酬'
],
363
[
'8310'
,
'21'
,
'72'
,
'0'
,
'きゅうよてあて'
,
'給料手当'
],
364
[
'8310'
,
'22'
,
'72'
,
'0'
,
'しょうよ'
,
'賞与'
],
365
[
'8310'
,
'23'
,
'72'
,
'0'
,
'ざっきゅう'
,
'雑給'
],
366
[
'8310'
,
'24'
,
'72'
,
'0'
,
'たいしょくきん'
,
'退職金'
],
367
[
'8310'
,
'25'
,
'73'
,
'0'
,
'ほうていふくりひ'
,
'法定福利費'
],
368
[
'8310'
,
'26'
,
'73'
,
'0'
,
'ふくりこうせいひ'
,
'福利厚生費'
],
369
[
'8310'
,
'31'
,
'74'
,
'0'
,
'たいしょくひきあてきんくりいれ'
,
'退職引当金繰入'
],
370
[
'8310'
,
'41'
,
'74'
,
'0'
,
'りょひこうつうひ'
,
'旅費交通費'
],
371
[
'8310'
,
'42'
,
'74'
,
'0'
,
'つうしんひ'
,
'通信費'
],
372
[
'8310'
,
'43'
,
'74'
,
'0'
,
'はんばいてすうりょう'
,
'販売手数料'
],
373
[
'8310'
,
'44'
,
'74'
,
'0'
,
'にづくりうんちん'
,
'荷造運賃'
],
374
[
'8310'
,
'45'
,
'74'
,
'0'
,
'こうこくせんでんひ'
,
'広告宣伝費'
],
375
[
'8310'
,
'46'
,
'74'
,
'0'
,
'こうさいひ'
,
'交際費'
],
376
[
'8310'
,
'47'
,
'74'
,
'0'
,
'かいぎひ'
,
'会議費'
],
377
[
'8310'
,
'48'
,
'74'
,
'0'
,
'ねんりょうひ'
,
'燃料費'
],
378
[
'8310'
,
'49'
,
'74'
,
'0'
,
'すいどうこうねつひ'
,
'水道光熱費'
],
379
[
'8310'
,
'51'
,
'74'
,
'0'
,
'しょうもうひんひ'
,
'消耗品費'
],
380
[
'8310'
,
'52'
,
'74'
,
'0'
,
'そぜいこうか'
,
'租税公課'
],
381
[
'8310'
,
'53'
,
'74'
,
'0'
,
'としょひ'
,
'図書費'
],
382
[
'8310'
,
'54'
,
'74'
,
'0'
,
'しはらいてすうりょう'
,
'支払手数料'
],
383
[
'8310'
,
'55'
,
'74'
,
'0'
,
'しょかいひ'
,
'諸会費'
],
384
[
'8310'
,
'56'
,
'74'
,
'0'
,
'けんきゅうひ'
,
'研究費'
],
385
[
'8310'
,
'57'
,
'74'
,
'0'
,
'ちんたいりょう'
,
'賃借料'
],
386
[
'8310'
,
'58'
,
'74'
,
'0'
,
'ほけんりょう'
,
'保険料'
],
387
[
'8310'
,
'59'
,
'74'
,
'0'
,
'しゅうぜんひ'
,
'修繕費'
],
388
[
'8310'
,
'61'
,
'74'
,
'0'
,
'じむようひんひ'
,
'事務用品費'
],
389
[
'8310'
,
'71'
,
'74'
,
'0'
,
'げんかしょうきゃくひ'
,
'減価償却費'
],
390
[
'8310'
,
'72'
,
'74'
,
'0'
,
'かしだおれひきあてきんくりいいれ'
,
'貸倒引当金繰入'
],
391
[
'8310'
,
'73'
,
'74'
,
'0'
,
'かしだおれそんしつ(かぜい)'
,
'貸倒損失(課税)'
],
392
[
'8310'
,
'91'
,
'74'
,
'0'
,
'ざっぴ'
,
'雑費'
],
393
[
'8610'
,
'11'
,
'80'
,
'1'
,
'うけとりりそく'
,
'受取利息'
],
394
[
'8610'
,
'12'
,
'80'
,
'1'
,
'うけとりりそく(げんせん)'
,
'受取利息(源泉)'
],
395
[
'8620'
,
'11'
,
'80'
,
'1'
,
'うけとりはいとうきん'
,
'受取配当金'
],
396
[
'8790'
,
'11'
,
'80'
,
'1'
,
'ざつしゅうにゅう'
,
'雑収入'
],
397
[
'8810'
,
'11'
,
'80'
,
'0'
,
'しはらいりそくわりびきりょう'
,
'支払利息割引料'
],
398
[
'8990'
,
'11'
,
'80'
,
'0'
,
'ざつそんしつ'
,
'雑損失'
],
399
[
'8990'
,
'21'
,
'80'
,
'0'
,
'かしだおれそんしつ(ひかぜい)'
,
'貸倒損失(非課税)'
],
400
[
'9110'
,
'11'
,
'90'
,
'1'
,
'こていしさんばいきゃくえき'
,
'固定資産売却益'
],
401
[
'9210'
,
'11'
,
'90'
,
'0'
,
'こていしさんばいきゃくそん'
,
'固定資産売却損'
],
402
[
'9810'
,
'11'
,
'91'
,
'0'
,
'ほうじんぜいとう'
,
'法人税等'
],
403
[
'9910'
,
'11'
,
'31'
,
'1'
,
'ぜんきくりこしりえき'
,
'前期繰越利益'
],
404
[
'9910'
,
'12'
,
'31'
,
'0'
,
'ぜんきくりこしそんしつ'
,
'前期繰越損失'
],
405
[
'9920'
,
'11'
,
'90'
,
'1'
,
'ちゅうかんはいとうとりくずしがく'
,
'中間配当取崩額'
],
406
[
'9970'
,
'11'
,
'90'
,
'0'
,
'ちゅうかんはいとうがく'
,
'中間配当額'
],
407
];
408
}
409
410
private
function
_initTax
() {
411
412
$err =
''
;
413
414
$this->
connect
();
415
$this->
begin
();
416
417
try
{
418
$sql =
"SELECT `id` FROM `t_basic` ORDER BY `id`"
;
419
$rec = $this->
getRecord
($sql);
420
$fmt =
"INSERT INTO `t_tax` (`bid`, `name`, `rate`, `valid_flg`) VALUES ('%s', '%s', '%s', TRUE)"
;
421
$dat
= [
422
[
'消費税8%'
,
'0.08'
]
423
, [
'消費税10%'
,
'0.10'
]
424
];
425
426
foreach
($rec as $r) {
427
foreach
(
$dat
as $d) {
428
$sql = sprintf($fmt, $r[
'id'
], $d[0], $d[1]);
429
$ans = $this->
query
($sql);
430
}
431
}
432
433
}
catch
(Exception $e) {
434
$err = $e->getMessage();
435
}
436
437
if
(empty($err)) {
438
$this->
commit
();
439
}
else
{
440
$this->
rollback
();
441
}
442
443
$this->
close
();
444
445
return
$err;
446
}
447
448
private
function
_initEra
() {
449
450
$err =
''
;
451
452
$this->
connect
();
453
$this->
begin
();
454
455
try
{
456
$sql =
"SELECT `id` FROM `t_basic` ORDER BY `id`"
;
457
$rec = $this->
getRecord
($sql);
458
$fmt =
"INSERT INTO `t_era` (`bid`, `ymd`, `era`, `abr`, `delete_flg`) VALUES ('%s', '%s', '%s', '%s', FALSE)"
;
459
$dat
= [
460
[
'1868-09-08'
,
'明治'
,
'M'
],
461
[
'1912-07-30'
,
'大正'
,
'T'
],
462
[
'1926-12-25'
,
'昭和'
,
'S'
],
463
[
'1989-01-08'
,
'平成'
,
'H'
],
464
[
'2019-05-01'
,
'令和'
,
'R'
],
465
];
466
467
foreach
($rec as $r) {
468
foreach
(
$dat
as $d) {
469
$sql = sprintf($fmt, $r[
'id'
], $d[0], $d[1], $d[2]);
470
$ans = $this->
query
($sql);
471
}
472
}
473
474
}
catch
(Exception $e) {
475
$err = $e->getMessage();
476
}
477
478
if
(empty($err)) {
479
$this->
commit
();
480
}
else
{
481
$this->
rollback
();
482
}
483
484
$this->
close
();
485
486
return
$err;
487
}
488
}
RootMenuModel\_init
_init()
Definition:
RootMenuModel.php:26
RootMenuModel\_getAccount
_getAccount()
Definition:
RootMenuModel.php:244
Model\connect
connect()
Definition:
Model.php:12
Model\begin
begin()
Definition:
Model.php:31
RootMenuModel\_initSection
_initSection()
Definition:
RootMenuModel.php:107
Model\query
query($sql)
Definition:
Model.php:47
Model\getRecord
getRecord($sql)
Definition:
Model.php:55
RootMenuModel
Definition:
RootMenuModel.php:10
RootMenuModel\_initItem
_initItem()
Definition:
RootMenuModel.php:195
$dat
$dat
Definition:
tex_tmplt_bs.php:291
Model
Definition:
Model.php:8
Model\commit
commit()
Definition:
Model.php:35
RootMenuModel\_initBasic
_initBasic()
Definition:
RootMenuModel.php:67
Model\close
close()
Definition:
Model.php:27
RootMenuModel\chkDatabse
chkDatabse()
Definition:
RootMenuModel.php:12
RootMenuModel\_initAccount
_initAccount()
Definition:
RootMenuModel.php:147
RootMenuModel\_initEra
_initEra()
Definition:
RootMenuModel.php:448
Model\rollback
rollback()
Definition:
Model.php:39
RootMenuModel\_initTax
_initTax()
Definition:
RootMenuModel.php:410
Generated by
1.8.16