aoiro 0.1.0__py3-none-any.whl → 0.1.1__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
aoiro/__init__.py CHANGED
@@ -1,4 +1,4 @@
1
- __version__ = "0.1.0"
1
+ __version__ = "0.1.1"
2
2
  from ._ledger import (
3
3
  GeneralLedgerLine,
4
4
  GeneralLedgerLineImpl,
aoiro/reader/_sales.py CHANGED
@@ -120,14 +120,18 @@ def ledger_from_sales(
120
120
  )
121
121
  )
122
122
  for (t, date, currency), df_ in df.groupby(["取引先", "振込日", "通貨"]):
123
- amount = Decimal(df_["金額"].sum())
123
+ fees = Decimal(df_["手数料"].sum())
124
+ receivable = Decimal(df_["金額"].sum())
125
+ recievable_without_fees = receivable - fees
124
126
  if currency == "":
125
127
  withholding = withholding_tax(
126
128
  df_.loc[df_["源泉徴収"] == True, "金額"].sum()
127
129
  )
128
130
  values = [
129
131
  LedgerElementImpl(
130
- account="事業主貸", amount=amount - withholding, currency=currency
132
+ account="事業主貸",
133
+ amount=recievable_without_fees - withholding,
134
+ currency=currency,
131
135
  )
132
136
  ]
133
137
  if withholding > 0:
@@ -140,15 +144,23 @@ def ledger_from_sales(
140
144
  if (df_["源泉徴収"] == True).any():
141
145
  raise ValueError("通貨が異なる取引に源泉徴収が含まれています。")
142
146
  values = [
143
- LedgerElementImpl(account="事業主貸", amount=amount, currency=currency)
147
+ LedgerElementImpl(
148
+ account="事業主貸",
149
+ amount=recievable_without_fees,
150
+ currency=currency,
151
+ )
144
152
  ]
153
+ if fees > 0:
154
+ values.append(
155
+ LedgerElementImpl(account="支払手数料", amount=fees, currency=currency)
156
+ )
145
157
  ledger_lines.append(
146
158
  GeneralLedgerLineImpl(
147
159
  date=date,
148
160
  values=[
149
161
  *values,
150
162
  LedgerElementImpl(
151
- account="売掛金", amount=-amount, currency=currency
163
+ account="売掛金", amount=-receivable, currency=currency
152
164
  ),
153
165
  ],
154
166
  )
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: aoiro
3
- Version: 0.1.0
3
+ Version: 0.1.1
4
4
  Summary: CSV-based 青色申告 CLI app
5
5
  License: AGPL-3.0-only
6
6
  Author: 34j
@@ -1,4 +1,4 @@
1
- aoiro/__init__.py,sha256=D8t03maRfGmkHrZtRdmbJ5U5NCEIpB7Zh8FbEytsXHk,1342
1
+ aoiro/__init__.py,sha256=qNPQL4wHxhTc5yCQuZfAqdlXxn66hfqUq27L6C2_lGI,1342
2
2
  aoiro/__main__.py,sha256=37q_z3ZTcZhgeSOGjKR91PPFHinUKZpyZTTfpiOizjs,80
3
3
  aoiro/_ledger.py,sha256=uqpy9lenWdxNa-7UkKQRu2YMX74Byw2dbrgyAtuVf4o,8662
4
4
  aoiro/_multidimensional.py,sha256=1XOsLX8JULZ5KdTMaePWt_emYHlTY0tzZP6yglxa2vU,6046
@@ -9,9 +9,9 @@ aoiro/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
9
9
  aoiro/reader/__init__.py,sha256=h53M_CpbPpZVCnY3nxY6qqWmabK_50X8sih-G_adFN4,332
10
10
  aoiro/reader/_expenses.py,sha256=ncZug8uwMGC18qJLCOEkLLbdASMdaoLc87IoZ9o4KrM,1394
11
11
  aoiro/reader/_io.py,sha256=8GSkBxn_8MVpq-4-47FeXEI5D1sugR415LsRA5hQH_I,4411
12
- aoiro/reader/_sales.py,sha256=jRzs2032YqZNiSbdrp-G9Qhlo8AA40fYmhBhFFQuViE,5297
13
- aoiro-0.1.0.dist-info/LICENSE,sha256=2xqHuoHohba7gpcZZKtOICRjzeKsQANXG8WoV9V35KM,33893
14
- aoiro-0.1.0.dist-info/METADATA,sha256=ZMkQgpsV3fny5YYwXd2qCNmOj5h_e14eNcAfdCUFlpA,13486
15
- aoiro-0.1.0.dist-info/WHEEL,sha256=XbeZDeTWKc1w7CSIyre5aMDU_-PohRwTQceYnisIYYY,88
16
- aoiro-0.1.0.dist-info/entry_points.txt,sha256=bfcB8r_8xOWhLGp_SRYaNbohnbiZjhCCsHWCgtLeMWM,39
17
- aoiro-0.1.0.dist-info/RECORD,,
12
+ aoiro/reader/_sales.py,sha256=6TdYYRT4uTODZZ16IptHO4UilG1Q6_z-_RaelQQGNbg,5713
13
+ aoiro-0.1.1.dist-info/LICENSE,sha256=2xqHuoHohba7gpcZZKtOICRjzeKsQANXG8WoV9V35KM,33893
14
+ aoiro-0.1.1.dist-info/METADATA,sha256=r9NXkmi4tjhuCSfugPlt39XdYqjcIuKgXVp698LJkC8,13486
15
+ aoiro-0.1.1.dist-info/WHEEL,sha256=XbeZDeTWKc1w7CSIyre5aMDU_-PohRwTQceYnisIYYY,88
16
+ aoiro-0.1.1.dist-info/entry_points.txt,sha256=bfcB8r_8xOWhLGp_SRYaNbohnbiZjhCCsHWCgtLeMWM,39
17
+ aoiro-0.1.1.dist-info/RECORD,,
File without changes
File without changes