container: hledger-flow: coinbase: add on-chain native tx amount column

for calculating native (fiat) amount without fee. Can be used with
custom tax rules to calculate native amount of any on-chain spends.
This commit is contained in:
2026-04-01 12:19:02 -07:00
parent 070a2f9fe8
commit 59ec5a9010
2 changed files with 4 additions and 3 deletions

View File

@@ -180,11 +180,11 @@ function __parse()
if ($7 > 0 && $5 > 0) {printf("%.8f", ($7 / $5) * $16)}; printf OFS # native_network_transaction_fee_amount
#
# Add new column to calculate the difference between amount and network fee,
# i.e., amount_amount - network_transaction_fee_amount
# Add new columns to calculate the difference between amount and network fee
#
if ($16 > 0) {printf("%.8f", $5 - $16)}; printf OFS # network_transaction_amount_amount
if ($16 > 0) {printf("%.8f", ($5 - $16) * ($7 / $5))}; printf OFS # native_network_transaction_amount
#
# Advanced Trade: add new column for calculating real value amount

View File

@@ -15,7 +15,7 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
fields account_id,coinbase_id,type,status_,amount_amount,amount_currency,native_amount_amount,native_amount_currency,created_at,resource,resource_path,description,network_status,network_network_name,network_hash,network_transaction_fee_amount,network_transaction_fee_currency,to_resource,to_address,to_email,from_resource,from_resource_path,from_id,from_name,cancelable,idem,buy_total_amount,buy_total_currency,buy_subtotal_amount,buy_subtotal_currency,buy_fee_amount,buy_fee_currency,buy_id,buy_payment_method_name,sell_total_amount,sell_total_currency,sell_subtotal_amount,sell_subtotal_currency,sell_fee_amount,sell_fee_currency,sell_id,sell_payment_method_name,trade_fee_amount,trade_fee_currency,trade_id,trade_payment_method_name,advanced_trade_fill_fill_price,advanced_trade_fill_product_id,advanced_trade_fill_order_id,advanced_trade_fill_commission,advanced_trade_fill_order_side,native_amount_price,native_network_transaction_fee_amount,network_transaction_amount_amount,advanced_trade_fill_real_value_amount,advanced_trade_fill_pair_lhs,advanced_trade_fill_pair_rhs,advanced_trade_fill_cost_basis_amount,taxed_at,direction,subaccount
fields account_id,coinbase_id,type,status_,amount_amount,amount_currency,native_amount_amount,native_amount_currency,created_at,resource,resource_path,description,network_status,network_network_name,network_hash,network_transaction_fee_amount,network_transaction_fee_currency,to_resource,to_address,to_email,from_resource,from_resource_path,from_id,from_name,cancelable,idem,buy_total_amount,buy_total_currency,buy_subtotal_amount,buy_subtotal_currency,buy_fee_amount,buy_fee_currency,buy_id,buy_payment_method_name,sell_total_amount,sell_total_currency,sell_subtotal_amount,sell_subtotal_currency,sell_fee_amount,sell_fee_currency,sell_id,sell_payment_method_name,trade_fee_amount,trade_fee_currency,trade_id,trade_payment_method_name,advanced_trade_fill_fill_price,advanced_trade_fill_product_id,advanced_trade_fill_order_id,advanced_trade_fill_commission,advanced_trade_fill_order_side,native_amount_price,native_network_transaction_fee_amount,network_transaction_amount_amount,native_network_transaction_amount,advanced_trade_fill_real_value_amount,advanced_trade_fill_pair_lhs,advanced_trade_fill_pair_rhs,advanced_trade_fill_cost_basis_amount,taxed_at,direction,subaccount
# The above fields; in order and in human-readable form:
#
@@ -73,6 +73,7 @@ fields account_id,coinbase_id,type,status_,amount_amount,amount_currency,native_
# native_amount_price
# native_network_transaction_fee_amount
# network_transaction_amount_amount
# native_network_transaction_amount
# advanced_trade_fill_real_value_amount
# advanced_trade_fill_pair_lhs
# advanced_trade_fill_pair_rhs