问题标签 [accounting]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
0 回答
206 浏览

mongodb - Is there any way to use MapReduce to replay a sequential financial transaction log?

I'm working on a project that requires GAAP accounting conformance for deferred revenue collection. Cash is converted to a proprietary "currency" or credits. These credits may have different values based upon the purchase price at time of conversion (including exchange rate fluctuations).

As each purchase is made, the amount is deducted from the earliest "bucket" of credits until they are exhausted and the next eldest bucket is encountered. The valuation of the credits spent define the total revenue for that particular purchase... so it may differ for each product simply based upon the order of credits and debits / the value of each credit.

My sequential mind sees this as an easy imperative problem. With the data I'm capturing, I can replay the transaction logs and arrive at a daily total for revenue for each customer and each product... that can then be amortized for the services provided. No problem.

My data is in a sharded MongoDB cluster of replica sets. Dumping it and writing a post-processing script is easy, but I'd love to be able to report directly out of it.

I've played with simple MapReduce operations in the past. Is there any way to sequentially process a transaction log? While normal transaction logs can be processed in parallel, and I've done this, I just can't seem to find a way to twist MapReduce (MongoDB or Hadoop) to replay in order. I don't think it can be done. Am I wrong or just a n00b?

My only options at this point are post-processing replay, manipulating currency buckets at time of purchase or utilizing something I've overlooked... perhaps I'm not thinking enough outside the box here.

Any brief insights or pointers are greatly appreciated.

0 投票
3 回答
2151 浏览

php - JS:如何添加,然后扣除增值税并返回完全相同的原始价值?

我允许用户以 NET 或 Gross 的形式将产品价格输入库存。如果他们以总价格输入价格,则在存储之前为他们计算 NET,并使用以下代码:

我努力让它发挥作用,但不确定这是否是问题所在。

如果我输入“100.00”作为总数字并且我的增值税率为 12%,它返回Net为“112.00”,所以它似乎正在工作。

所以我输入了一个总价为 100.00 美元的产品,净价计算为“89.29 美元”(我假设这是正确的)。

为上述 10 个项目创建发票时,发票底部如下所示:

我期待的是:

...特别是因为,当仅出售上述其中一种时,会导致:

......这是预期的。因此,可以合理地假设购买 10 件相同物品的成本恰好是其十倍。

这是我用来将增值税添加到净小计的公式:

数量 x 净价 x 0.12 (10 x 89.29 x 0.12) = 107.148

然后将上述四舍五入为 107.15,将其添加到净小计为 1000.05。

当我重新添加增值税时,我需要什么公式才能达到 1000?

总结/澄清 这个公式...数量 x 净价 x 0.12 (10 x 89.29 x 0.12)

给我107.148,但我认为我需要它给我的是107.10

那么我可以使用什么javascript函数来实现这一点(或者我需要如何调整我的公式/将其转换为代码)?

更新 @jakub 我认为是在正确的轨道上。我找到了一种简单的方法来测试它,方法是:

(仍然等于 107.15)

以上内容基于 Jakub 的输入,如下所示。请注意,我在这里没有单独乘以 10,因为我注意到我们正在小计级别工作。

0 投票
1 回答
1810 浏览

printing - CUPS 打印机记帐如何工作?

关于 cups,来自《UNIX 和 Linux 系统管理》一书:

如果其他人添加了一台打印机并且网络上运行的一个或多个 CUPS 服务器知道它,您的 CUPS 服务器就会知道它的存在。您不必将打印机显式添加到本地库存或将 PPD 复制到您的机器。这是魔法。

因此,为了让同一网络 (192.168.0.0/24) 中的每个人都了解我配置的打印机,我需要以下配置:

并实施打印机记帐:

在此示例中,理论上,网络 192.168.0.0/24 上的任何用户每周可以打印 100 页。但我的问题是,我找不到任何地方 CUPS 如何跟踪用户的打印机使用情况。我无法理解 CUPS 如何在没有任何身份验证机制的情况下实现打印机记帐。

0 投票
1 回答
369 浏览

python - 供应商发票和帐户类型

我成功生成了供应商发票。我现在遇到的问题是我无法支付我创建的发票(通过代码)。似乎是由于用于付款的帐户不正确?

错误是:没有任何反应,如果状态没有从打开变为已付款,但是当我从演示数据手动将帐户更改为“X111111 债权人(测试)”时,它会毫无问题地获得付款。

这是我的代码:

0 投票
1 回答
53 浏览

sql - 数据库之间的安全价值转移

我做了一些搜索,但找不到合适的搜索词。

有两个完全分开但受信任的数据库。它们的连接不可靠(但安全)。两个数据库都在不同的服务器上运行,并有一定的服务器故障概率。

两个数据库都是用钱运作的,需要将一些金额从一个账户(数据库#1,服务器#1)“转移”到另一个账户(数据库#2,服务器#2)。

这应该以永远不会导致“损失金钱”或“重复金钱”的方式完成,即使两个服务器都崩溃并在最坏的时刻恢复。

我认为应该有一个通用算法。

0 投票
1 回答
761 浏览

ms-access - 数据库设计:如何在 Access 数据库中跟踪机票销售情况?

我正在做我的最终项目,以介绍 Access DB 类。我的任务是一般的“创建一个至少包含 3 个表的数据库,其中 2 个是链接的”,对表的类型(客户关系、财务管理、产品/服务相关数据)有一些特定要求。

我决定为一家虚构的航空公司创建一个数据库。我需要跟踪财务信息,尤其是门票销售情况。我有一个tblFlights table包含 BaseFare 字段的字段,一个tblAirports table包含机场费用和机场税的字段,以及一个tblInvoice table当前仅包含invoice numbercustomer ID字段的字段。我想我会使用报告来生成实际发票,而不是表格,对吗?所以,我不想在发票表中存储一堆财务数据,也许我什至不应该有发票表?我如何跟踪客户欠了多少钱以及他们支付了多少钱?

0 投票
1 回答
116 浏览

excel - 计算平衡帐户所需的时间?

我有一个帐户 Excel 表,您可以在其中输入所有费用,所有收入(包括消费税),它会计算您的位置(EG - 本月 717.75 美元)。

I 它还为您提供了要支付的消费税内容$taxableIncome*3)/23以及关于您应该缴纳多少所得税的粗略指南$taxableIncome*0.17

您还告诉程序您的每小时费率是多少。

我想添加到程序中,让它告诉你这个月你需要多工作 X 小时才能平衡。

这不会太难

$deficit/$hourlyRate = hours needed to work除了每额外工作一小时,我们需要增加消费税费用($hourlyRate*3)/23,并增加$hourlyRate*0.17所得税费用。

这是我不太明白如何解决的部分。

因此,考虑到每小时费率$21.00+gst = $24.15/h和不足,我如何计算$717.75出我还需要工作多少小时?

基本上我想知道如何做一个公式
    0 <= [( x1+x2+x3 ...)-( y1+y2+y3 ...)] / z1
其中x1必须增加直到整个公式等于 0,但是随着x1的增加,y1y2
x 也必须增加。= 收入来源
y。= 费用
z。= 每小时费率(包括消费税)

请注意,虽然 excel 公式很有用,但我并不指望人们为我做这项工作,只是伪代码中的通用概述就可以了。

0 投票
1 回答
532 浏览

sql - 帐户余额 - Google 电子表格 SQL 查询

如何获得 F 列中的结果余额?

什么是性能最高的选项?

我知道 sum 和 rest 值如何,但我不知道如何将它们干净地放在 F 列中。

我试过的

我做的:

得到:

现在,如果我休息 k - i,我可以得到平衡。但是,我怎样才能为对应的元素做到这一点?我的意思是银行与银行等等。

0 投票
1 回答
256 浏览

microsoft-dynamics - Microsoft Dynamics GP 10.0:“业务对象”/存储过程文档在哪里?

除其他外,我一直在查看 Microsoft Dynamics GP 的“eConnect 程序员指南 10.0 版”。

本文档中提到了一些存储过程(称为“业务对象”),我可以调用它们来获取/修改 Dynamics 数据库中的数据......但奇怪的是,该文档实际上并没有告诉我它们的名称,什么他们的参数是,或者他们做什么。

我一直在网上四处寻找,但无法找到此文档。任何人都可以帮忙吗?

谢谢

0 投票
1 回答
2424 浏览

ruby-on-rails - Use Integer Cents or Decimal for Accounting Amounts?

I'm working on a rails application with Postgres and ActiveRecord that is keeping track of payments and transaction fees (which are based on percentages).

Currently I'm using BigDecimal (and decimal columns in ActiveRecord) to keep track of the values of these transactions, but dealing with rounding has been frustrating. (for example how 8.05 - 1.0 ==> 7.050000000000001)

Does it make sense to continue using decimal columns for dollar amounts? Or should I switch to storing everything in integer value cents so I don't need to deal with rounding issues.

An important note is that none of my transactions (as of now) are worth fractional cents.

What are the pros and cons of each approach?