Module: Luca::Jp::Common
Class Method Summary collapse
- .一般区分の税額(所得 = nil) ⇒ Object
- .中小企業の軽減税率対象を超える所得(所得 = nil) ⇒ Object
-
.中小企業の軽減税率対象所得(所得 = nil) ⇒ Object
—————————————————– :section: 法人税額の計算 —————————————————–.
- .中小企業の軽減税額(所得 = nil) ⇒ Object
- .中間還付税額(税額, 中間納付額) ⇒ Object
-
.地方法人特別税(事業税) ⇒ Object
100円未満切り捨て.
- .地方法人税額(地方法人税課税標準) ⇒ Object
- .地方消費税中間納付額 ⇒ Object
-
.均等割 ⇒ Object
—————————————————– :section: 地方税額の計算 —————————————————–.
-
.当期所得金額 ⇒ Object
税引前当期利益をもとに計算 消費税を租税公課に計上している場合、控除済みの金額 未払事業税は精算時に認識.
- .当期控除計 ⇒ Object
- .当期繰越損失 ⇒ Object
- .所得400万以下(所得 = nil) ⇒ Object
- .所得800万以下(所得 = nil) ⇒ Object
- .所得800万超(所得 = nil) ⇒ Object
-
.所得割400万以下(所得 = nil) ⇒ Object
100円未満切り捨て.
-
.所得割800万以下(所得 = nil) ⇒ Object
100円未満切り捨て.
-
.所得割800万超(所得 = nil) ⇒ Object
100円未満切り捨て.
-
.所得金額 ⇒ Object
繰越損失適用後の所得金額.
- .期末資本金 ⇒ Object
-
.期首繰越損失 ⇒ Object
—————————————————– :section: 繰越損失の計算 —————————————————–.
- .未納事業税期中増減 ⇒ Object
-
.法人税割(法人税 = nil) ⇒ Object
100円未満切り捨て.
-
.消費税中間納付額 ⇒ Object
—————————————————– :section: 消費税の計算 —————————————————–.
- .消費税課税売上高(税率 = 10) ⇒ Object
-
.税額計算 ⇒ Object
法人税、地方税の当期確定税額の計算.
- .納付税額(税額, 中間納付額) ⇒ Object
- .翌期繰越損失 ⇒ Object
-
.資本金等の額 ⇒ Object
—————————————————– :section: 外形標準の計算 —————————————————–.
- .還付事業税 ⇒ Object
Class Method Details
.一般区分の税額(所得 = nil) ⇒ Object
60 61 62 |
# File 'lib/luca/jp/common.rb', line 60 def 一般区分の税額(所得 = nil) (中小企業の軽減税率対象を超える所得(所得) * 23.2 / 100).to_i end |
.中小企業の軽減税率対象を超える所得(所得 = nil) ⇒ Object
49 50 51 52 53 54 55 56 57 58 |
# File 'lib/luca/jp/common.rb', line 49 def 中小企業の軽減税率対象を超える所得(所得 = nil) 所得 ||= 所得金額 return 0 if 所得 <= 0 if 所得 <= 8_000_000 0 else ((所得 - 8_000_000) / 1000).floor * 1000 end end |
.中小企業の軽減税率対象所得(所得 = nil) ⇒ Object
:section: 法人税額の計算
32 33 34 35 36 37 38 39 40 41 42 43 |
# File 'lib/luca/jp/common.rb', line 32 def 中小企業の軽減税率対象所得(所得 = nil) 所得 ||= 所得金額 return 0 if 所得 <= 0 if 所得 >= 8_000_000 8_000_000 elsif 所得 < 0 0 else (所得 / 1000).floor * 1000 end end |
.中小企業の軽減税額(所得 = nil) ⇒ Object
45 46 47 |
# File 'lib/luca/jp/common.rb', line 45 def 中小企業の軽減税額(所得 = nil) 中小企業の軽減税率対象所得(所得) * 15 / 100 end |
.中間還付税額(税額, 中間納付額) ⇒ Object
203 204 205 206 207 208 209 |
# File 'lib/luca/jp/common.rb', line 203 def 中間還付税額(税額, 中間納付額) if 税額 < 中間納付額 中間納付額 - 税額 else 0 end end |
.地方法人特別税(事業税) ⇒ Object
100円未満切り捨て
187 188 189 |
# File 'lib/luca/jp/common.rb', line 187 def 地方法人特別税(事業税) ((事業税 * 37 / 100) / 100).floor * 100 end |
.地方法人税額(地方法人税課税標準) ⇒ Object
64 65 66 |
# File 'lib/luca/jp/common.rb', line 64 def 地方法人税額(地方法人税課税標準) (地方法人税課税標準 * 10.3 / 100).to_i end |
.地方消費税中間納付額 ⇒ Object
229 230 231 |
# File 'lib/luca/jp/common.rb', line 229 def 地方消費税中間納付額 prepaid_tax('185C') end |
.均等割 ⇒ Object
:section: 地方税額の計算
114 115 116 117 118 119 120 |
# File 'lib/luca/jp/common.rb', line 114 def 均等割 if config.dig('jp', 'eltax', 'office_23ku') [70_000, 0] else [20_000, 50_000] end end |
.当期所得金額 ⇒ Object
税引前当期利益をもとに計算 消費税を租税公課に計上している場合、控除済みの金額 未払事業税は精算時に認識
79 80 81 82 |
# File 'lib/luca/jp/common.rb', line 79 def 当期所得金額 _, 納付事業税 = 未納事業税期中増減 LucaSupport::Code.readable(@pl_data.dig('GA') - 納付事業税) end |
.当期控除計 ⇒ Object
94 95 96 |
# File 'lib/luca/jp/common.rb', line 94 def 当期控除計 @繰越損失管理.deduction end |
.当期繰越損失 ⇒ Object
104 105 106 107 |
# File 'lib/luca/jp/common.rb', line 104 def 当期繰越損失 @繰越損失管理.records .filter { |record| record['start_date'] == @start_date }.dig(0, 'increase') || 0 end |
.所得400万以下(所得 = nil) ⇒ Object
136 137 138 139 140 141 142 143 144 145 |
# File 'lib/luca/jp/common.rb', line 136 def 所得400万以下(所得 = nil) 所得 ||= 所得金額 return 0 if 所得 < 0 if 所得 >= 4_000_000 4_000_000 else (所得 / 1000).floor * 1000 end end |
.所得800万以下(所得 = nil) ⇒ Object
152 153 154 155 156 157 158 159 160 161 162 163 |
# File 'lib/luca/jp/common.rb', line 152 def 所得800万以下(所得 = nil) 所得 ||= 所得金額 return 0 if 所得 < 0 if 所得 <= 4_000_000 0 elsif 所得 >= 8_000_000 4_000_000 else ((所得 - 4_000_000) / 1000).floor * 1000 end end |
.所得800万超(所得 = nil) ⇒ Object
170 171 172 173 174 175 176 177 178 179 |
# File 'lib/luca/jp/common.rb', line 170 def 所得800万超(所得 = nil) 所得 ||= 所得金額 return 0 if 所得 < 0 if 所得 <= 8_000_000 0 else ((所得 - 8_000_000) / 1000).floor * 1000 end end |
.所得割400万以下(所得 = nil) ⇒ Object
100円未満切り捨て
148 149 150 |
# File 'lib/luca/jp/common.rb', line 148 def 所得割400万以下(所得 = nil) ((所得400万以下(所得) * 3.5 / 100) / 100).floor * 100 end |
.所得割800万以下(所得 = nil) ⇒ Object
100円未満切り捨て
166 167 168 |
# File 'lib/luca/jp/common.rb', line 166 def 所得割800万以下(所得 = nil) ((所得800万以下(所得) * 5.3 / 100) / 100).floor * 100 end |
.所得割800万超(所得 = nil) ⇒ Object
100円未満切り捨て
182 183 184 |
# File 'lib/luca/jp/common.rb', line 182 def 所得割800万超(所得 = nil) ((所得800万超(所得) * 7.0 / 100) / 100).floor * 100 end |
.所得金額 ⇒ Object
繰越損失適用後の所得金額
70 71 72 73 |
# File 'lib/luca/jp/common.rb', line 70 def 所得金額 @繰越損失管理 = Sonshitsu.load(@end_date).update(当期所得金額).save if @繰越損失管理.nil? @繰越損失管理.profit end |
.期末資本金 ⇒ Object
240 241 242 |
# File 'lib/luca/jp/common.rb', line 240 def 期末資本金 readable(@bs_data.dig('911')) end |
.期首繰越損失 ⇒ Object
:section: 繰越損失の計算
88 89 90 91 92 |
# File 'lib/luca/jp/common.rb', line 88 def 期首繰越損失 @繰越損失管理.records .filter { |record| record['start_date'] > @end_date.prev_year(10) && record['end_date'] < @start_date } .inject(0) { |sum, record| sum + (record['amount'] || 0) } end |
.未納事業税期中増減 ⇒ Object
215 216 217 218 |
# File 'lib/luca/jp/common.rb', line 215 def 未納事業税期中増減 r = gross_amount('5152', @start_date.year, @start_date.month, @end_date.year, @end_date.month) [LucaSupport::Code.readable(r[1]), LucaSupport::Code.readable(r[0])] end |
.法人税割(法人税 = nil) ⇒ Object
100円未満切り捨て
123 124 125 126 127 128 129 130 131 132 133 134 |
# File 'lib/luca/jp/common.rb', line 123 def 法人税割(法人税 = nil) 課税標準 = if 法人税 (法人税 / 1000).floor * 1000 else 法人税割課税標準 end if config.dig('jp', 'eltax', 'office_23ku') [(課税標準 * 7 / 100 / 100).floor * 100, 0] else [(課税標準 * 1 / 100 / 100).floor * 100, (課税標準 * 6 / 100 / 100).floor * 100] end end |
.消費税中間納付額 ⇒ Object
:section: 消費税の計算
225 226 227 |
# File 'lib/luca/jp/common.rb', line 225 def 消費税中間納付額 prepaid_tax('185B') end |
.消費税課税売上高(税率 = 10) ⇒ Object
191 192 193 |
# File 'lib/luca/jp/common.rb', line 191 def 消費税課税売上高(税率 = 10) LucaSupport::Code.readable(@pl_data.dig('A0') * 100 / (100 + 税率).floor || 0) end |
.税額計算 ⇒ Object
法人税、地方税の当期確定税額の計算
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/luca/jp/common.rb', line 12 def 税額計算 所得 = 所得金額 { houjin: {}, kenmin: {}, shimin: {} }.tap do |tax| 法人税額 = 中小企業の軽減税額(所得) + 一般区分の税額(所得) tax[:houjin][:kokuzei] = (法人税額 / 100).floor * 100 地方法人税課税標準 = (法人税額 / 1000).floor * 1000 地方法人税 = 地方法人税額(地方法人税課税標準) tax[:houjin][:chihou] = (地方法人税 / 100).floor * 100 tax[:kenmin][:houjinzei], tax[:shimin][:houjinzei] = 法人税割(法人税額) tax[:kenmin][:kintou], tax[:shimin][:kintou] = 均等割 tax[:kenmin][:shotoku] = 所得割400万以下(所得) + 所得割800万以下(所得) + 所得割800万超(所得) tax[:kenmin][:tokubetsu] = 地方法人特別税(tax[:kenmin][:shotoku]) end end |
.納付税額(税額, 中間納付額) ⇒ Object
195 196 197 198 199 200 201 |
# File 'lib/luca/jp/common.rb', line 195 def 納付税額(税額, 中間納付額) if 税額 > 中間納付額 税額 - 中間納付額 else 0 end end |
.翌期繰越損失 ⇒ Object
98 99 100 101 102 |
# File 'lib/luca/jp/common.rb', line 98 def 翌期繰越損失 @繰越損失管理.records .filter { |record| record['start_date'] > @end_date.prev_year(10) && record['end_date'] < @start_date } .inject(0) { |sum, record| sum + (record['amount'] || 0) } end |
.資本金等の額 ⇒ Object
:section: 外形標準の計算
236 237 238 |
# File 'lib/luca/jp/common.rb', line 236 def 資本金等の額 readable(@bs_data.dig('911') + @bs_data.dig('913')) end |
.還付事業税 ⇒ Object
211 212 213 |
# File 'lib/luca/jp/common.rb', line 211 def 還付事業税 refund_tax('1504') end |