我正在开发一个需要计算税收的购物车,我正在寻找第三方税务服务来处理计算.
我在另一个应用程序中使用过Avalara,但由于我必须在他们的java库中使用Rjb gem,因此它有点悲惨.
有没有人建议税务服务与铁路运作良好?
我们经常发生大量的构建,并且需要大量的资源.因此,我们希望在每次构建后清除构建源和暂存目录.我在本地TFS 2015 Update 1中使用vNext版本.我创建了一个PowerShell脚本作为执行删除的最终任务:
[CmdletBinding()]
param()
begin {
function Delete-Directory {
param([string]$directory)
Write-Output "Attempting to delete '$($directory)'"
if (Test-Path $directory -pathType container) {
Get-ChildItem -Path $directory -Force -Recurse | Remove-Item -Recurse -Force
Write-Output "Successfully deleted the directory: '$($directory)'"
} else {
Write-Output "Failed to delete '$($directory)' as it does not exist"
}
}
}
process {
Delete-Directory $env:BUILD_SOURCESDIRECTORY
Delete-Directory $env:BUILD_STAGINGDIRECTORY
}
end{}
Run Code Online (Sandbox Code Playgroud)
最初,Get-ChildItem .... | Remove-Item我没有使用,而是使用,Remove-Item *path* -Recurse -Force但显然删除项的recurse参数存在问题.最初它有时是有效的.现在它永远不会起作用.
我尝试了很多不同的变体,这里有一些结果:
随着-Recurse …
我想对 Django Oscar 上的所有产品征收 18% 的税。实现这一目标的最佳且简单的方法是什么?
我已遵循此文档。
结账/tax.py
from decimal import Decimal as D
def apply_to(submission):
# Assume 7% sales tax on sales to New Jersey You could instead use an
# external service like Avalara to look up the appropriates taxes.
STATE_TAX_RATES = {
'NJ': D('0.07')
}
shipping_address = submission['shipping_address']
rate = D('0.18')
for line in submission['basket'].all_lines():
line_tax = calculate_tax(
line.line_price_excl_tax_incl_discounts, rate)
unit_tax = (line_tax / line.quantity).quantize(D('0.01'))
line.purchase_info.price.tax = unit_tax
# Note, we change the submission in …Run Code Online (Sandbox Code Playgroud) avalara ×3
django ×1
django-oscar ×1
e-commerce ×1
powershell ×1
python ×1
ruby ×1
tfs ×1
tfs-2015 ×1