lucadeal 0.5.5 → 0.5.7
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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +8 -0
- data/lib/luca_deal/fee.rb +8 -5
- data/lib/luca_deal/invoice.rb +5 -6
- data/lib/luca_deal/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f38a6fb61fd01e68eefa964fbac76eb83ee2449e5d1d70ebee0164758d23a8b5
|
4
|
+
data.tar.gz: 8d72a97c0af4b35fef36771fd35d224f77bbf09b76e90e2d6271988ef6fc2877
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a3179e7f88e7022b29e2a10be76847ccf8edbd0a91ab56b70e9a71e0e1c42f828baf68dc701e4fbdf816bd4afc0d449494b81125adb1e78cd3c9f1bb2fd7a3cb
|
7
|
+
data.tar.gz: 04a7c35dc5bab8b531669b137aadaa746fdbe6853d1c7ca5ca614937eac9aa5e0efa34b349eeb3eacdb358fbb07fbb8f54d8f8c8b11b43d99aa4fc4c6e7072d6
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,11 @@
|
|
1
|
+
## LucaDeal 0.5.7
|
2
|
+
|
3
|
+
* `luca-deal fee export` now skips no transaction customer.
|
4
|
+
|
5
|
+
## LucaDeal 0.5.6
|
6
|
+
|
7
|
+
* `luca-deal report balance` now prints customer ID.
|
8
|
+
|
1
9
|
## LucaDeal 0.5.5
|
2
10
|
|
3
11
|
* `luca-deal report balance --detail` now correctly handles historical Customer attributes.
|
data/lib/luca_deal/fee.rb
CHANGED
@@ -155,11 +155,14 @@ module LucaDeal
|
|
155
155
|
labels = export_labels
|
156
156
|
[].tap do |res|
|
157
157
|
self.class.asof(@date.year, @date.month) do |dat|
|
158
|
-
item = {}
|
159
|
-
item['date'] = dat['issue_date']
|
160
|
-
item['debit'] = []
|
161
|
-
item['credit'] = []
|
162
158
|
sub = dat['sales_fee']
|
159
|
+
next if readable(sub['fee']) == 0 and readable(sub['deduction']) == 0
|
160
|
+
|
161
|
+
item = {
|
162
|
+
'date' => dat['issue_date'],
|
163
|
+
'debit' => [],
|
164
|
+
'credit' => []
|
165
|
+
}
|
163
166
|
if readable(sub['fee']) != 0
|
164
167
|
item['debit'] << { 'label' => labels[:debit][:fee], 'amount' => readable(sub['fee']) }
|
165
168
|
item['credit'] << { 'label' => labels[:credit][:fee], 'amount' => readable(sub['fee']) }
|
@@ -226,7 +229,7 @@ module LucaDeal
|
|
226
229
|
# TODO: load labels from CONST.config before country defaults
|
227
230
|
#
|
228
231
|
def export_labels
|
229
|
-
case LucaRecord::CONST.
|
232
|
+
case LucaRecord::CONST.config['country']
|
230
233
|
when 'jp'
|
231
234
|
{
|
232
235
|
debit: { fee: '支払手数料', tax: '支払手数料', deduction: '未払費用' },
|
data/lib/luca_deal/invoice.rb
CHANGED
@@ -91,10 +91,8 @@ module LucaDeal
|
|
91
91
|
|
92
92
|
def self.report(date, scan_years = 10, detail: false, due: false)
|
93
93
|
fy_end = Date.new(date.year, date.month, -1)
|
94
|
-
|
95
|
-
|
96
|
-
Customer.all.each { |c| h[c['name']] = LucaSupport::Code.parse_current(c, fy_end) }
|
97
|
-
end
|
94
|
+
customers = {}.tap do |h|
|
95
|
+
Customer.all.each { |c| h[c['id']] = LucaSupport::Code.parse_current(c, fy_end) }
|
98
96
|
end
|
99
97
|
[].tap do |res|
|
100
98
|
items = {}
|
@@ -113,7 +111,7 @@ module LucaDeal
|
|
113
111
|
next if (settle_date && settle_date <= fy_end)
|
114
112
|
end
|
115
113
|
|
116
|
-
customer = invoice.dig('customer', '
|
114
|
+
customer = invoice.dig('customer', 'id')
|
117
115
|
items[customer] ||= { 'unsettled' => BigDecimal('0'), 'invoices' => [] }
|
118
116
|
items[customer]['unsettled'] += (invoice.dig('subtotal', 0, 'items') + invoice.dig('subtotal', 0, 'tax')||0)
|
119
117
|
items[customer]['invoices'] << invoice
|
@@ -121,7 +119,8 @@ module LucaDeal
|
|
121
119
|
end
|
122
120
|
items.each do |k, item|
|
123
121
|
row = {
|
124
|
-
'
|
122
|
+
'id' => k,
|
123
|
+
'customer' => customers.dig(k, 'name'),
|
125
124
|
'unsettled' => LucaSupport::Code.readable(item['unsettled']),
|
126
125
|
}
|
127
126
|
if detail
|
data/lib/luca_deal/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: lucadeal
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Chuma Takahiro
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-07-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: lucarecord
|