Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Merge branch 'version-13-hotfix' into 'version-13-pre-release' #29542

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
123 commits
Select commit Hold shift + click to select a range
db3d2c3
fix: Prevent clearing of Depreciation Schedule on adding more than on…
GangaManoj Nov 18, 2021
54cac35
fix: Rename loop variable
GangaManoj Nov 19, 2021
8a4019e
fix: Clear Depreciation Schedule entries that aren't linked with Jour…
GangaManoj Nov 22, 2021
57f41bc
fix: Test if multiple Depreciation Schedules are set up for multiple …
GangaManoj Nov 23, 2021
ae875ab
fix: Retain depreciation schedule rows that are linked with JEs while…
GangaManoj Nov 23, 2021
855ae39
fix: Test if clear_depreciation_schedule() works for multiple finance…
GangaManoj Nov 23, 2021
d000782
fix: Edit dates and frequency of depreciation
GangaManoj Nov 23, 2021
c9a9d0b
fix(ux): tripple digit cart qty
dj12djdjs Dec 30, 2021
d763b16
Merge remote-tracking branch 'upstream/version-13-hotfix' into fix-ec…
dj12djdjs Dec 31, 2021
852543c
fix: Merge conflicts
GangaManoj Jan 12, 2022
c121ab8
Merge remote-tracking branch 'upstream/version-13-hotfix' into fix-ec…
dj12djdjs Jan 17, 2022
d7f16c4
refactor: convert CTE validation to python (#29324)
mergify[bot] Jan 18, 2022
69fded2
fix: enable allow negative stock by default in reposts (#29331) (#29333)
mergify[bot] Jan 18, 2022
c8eae9d
fix: contact duplication on converting lead to customer
anupamvs Jan 18, 2022
79ce36c
fix: sider issue
anupamvs Jan 18, 2022
b917f33
Merge branch 'version-13-hotfix' into crm-contact-duplication-v13
anupamvs Jan 18, 2022
8775154
refactor: update_serial_no function and code cleanup
noahjacob Dec 13, 2021
dc0d974
fix(patch): updates maintenance schedule field for old docs
noahjacob Dec 15, 2021
f541b5c
test: added test for serial no. filters
noahjacob Dec 17, 2021
0bb0a9d
fix(test): fixed test case not creating serials
noahjacob Dec 17, 2021
93325c7
refactor: moved purpose table mandatory check to server
noahjacob Dec 17, 2021
add3636
fix: Serial No. filters for unscheduled visits
noahjacob Jan 17, 2022
3023757
fix: Conflicts
marination Jan 19, 2022
44d2098
fix: changed function name
anupamvs Jan 19, 2022
93d665b
fix: Patch (reload doc)
marination Jan 19, 2022
6c45223
Merge pull request #29352 from frappe/mergify/bp/version-13-hotfix/pr…
marination Jan 19, 2022
f75d36d
fix: from time and to time not updated in drag and drop action #29114…
mergify[bot] Jan 19, 2022
25398d0
fix: Cleanup empty rows on bank statement import
deepeshgarg007 Jan 20, 2022
829ea71
Merge pull request #29366 from deepeshgarg007/bank_statement_import_t…
deepeshgarg007 Jan 20, 2022
77cb7eb
fix: (enhance) BOM Operations Report
marination Jan 20, 2022
e963d0e
fix: Sider (unused imports) and Linter(add extra empty line)
marination Jan 20, 2022
655d898
fix: Allow only BOM with ops in BOM ID filter & add total row to report
marination Jan 20, 2022
b9a4280
fix: show stock UOM for material transfers (#29376) (#29377)
mergify[bot] Jan 20, 2022
eb44b16
Merge pull request #29378 from frappe/mergify/bp/version-13-hotfix/pr…
marination Jan 20, 2022
d190ea4
ci: disable coverage on v13 branch
ankush Jan 20, 2022
8a9a13c
ci: concurrency control on v13 branches
ankush Jan 20, 2022
d32f229
ci: fail on merge conflict label
ankush Jan 20, 2022
2924107
Merge branch 'version-13-hotfix' into crm-contact-duplication-v13
anupamvs Jan 20, 2022
7d130af
fix: Cart Logic of Item variant without Website Item
marination Jan 20, 2022
696fc0a
refactor: Added deprecation warning for hospitality domain (#29384)
ChillarAnand Jan 21, 2022
ceba7f2
fix: updated packed_items getting fetched on Sales Return / Credit No…
mergify[bot] Jan 21, 2022
1f099bc
Merge pull request #29077 from dj12djdjs/fix-ecommerce-cart-badge
marination Jan 21, 2022
04e3fb8
Merge pull request #28851 from frappe/mergify/bp/version-13-hotfix/pr…
nextchamp-saqib Jan 21, 2022
9869b31
fix(Timesheets): calculate to time (backport #28589) (#29390)
mergify[bot] Jan 21, 2022
844b73e
fix: first depreciation amount in asset
nextchamp-saqib Jan 21, 2022
398fab4
fix: depreciation amount on selling an asset
nextchamp-saqib Jan 21, 2022
8e2b96e
fix: failing test cases
nextchamp-saqib Jan 21, 2022
c1dd3d7
tests: Variant without web item price fetch and add to cart
marination Jan 21, 2022
4fec250
fix: merge conflicts
nextchamp-saqib Jan 21, 2022
33b5e1d
fix: Sider and Linter
marination Jan 21, 2022
2185016
fix: (test) set user for price test
marination Jan 21, 2022
fde6f13
fix: cannot cancel jv after migrating from v12 (#29391)
mergify[bot] Jan 21, 2022
f2d8d7a
Merge pull request #29383 from marination/item-variant-web-logic-fix
marination Jan 21, 2022
6aaa187
Merge pull request #29392 from frappe/mergify/bp/version-13-hotfix/pr…
nextchamp-saqib Jan 21, 2022
d9f783f
fix: update status on visit cancel (#29389) (#29394)
mergify[bot] Jan 21, 2022
2be15bd
fix: Wrong variable name breaks Cart Items rendering
marination Jan 21, 2022
f336b5d
perf: single query to update serial nos
ankush Jan 21, 2022
0e413ef
fix: bad default for non-existing serial nos
ankush Jan 21, 2022
91887f2
fix(patch): update stock reconciliation current serial nos
ankush Jan 21, 2022
f60ea20
test: create and cancel sr no with stock reco
ankush Jan 21, 2022
1538076
fix(patch): skip patch if column doesn't exist
ankush Jan 21, 2022
ef782fd
fix: Previous document currency getting overriden
deepeshgarg007 Jan 21, 2022
bfbcde7
debug: CI
marination Jan 21, 2022
315d542
Merge pull request #29398 from marination/minor-quotation-doc-wrong-var
marination Jan 21, 2022
096e7b9
fix: Don't delete barcode while saving Item (#29411)
Jan 23, 2022
2fbaba4
fix: bypass_credit_limit_check in credit balance report (#29401)
mergify[bot] Jan 23, 2022
43a21f2
Merge pull request #29337 from anupamvs/crm-contact-duplication-v13
rohitwaghchaure Jan 24, 2022
5406902
fix: incorrect raw materials quantity in manufacture stock entry
rohitwaghchaure Jan 23, 2022
384c623
fix: conflicts
rohitwaghchaure Jan 24, 2022
bbd777a
fix: opening invoice creation tool not taking in accouting dimension
ruthra-kumar Jan 21, 2022
b96fa03
test: validating custom accouting dimension in opening invoice tool
ruthra-kumar Jan 21, 2022
1273221
fix: linter issue
ruthra-kumar Jan 23, 2022
24011bc
refactor: fix failing test cases
ruthra-kumar Jan 24, 2022
37bbdc6
refactor: a more generalized way to clear old entries for test cases
ruthra-kumar Jan 19, 2022
abd8291
test: unit test for deferred items with zero months
ruthra-kumar Jan 19, 2022
f6ee0c7
Merge branch 'version-13-hotfix' into doc_currency_override
deepeshgarg007 Jan 24, 2022
51518cf
Merge pull request #29423 from frappe/mergify/bp/version-13-hotfix/pr…
deepeshgarg007 Jan 24, 2022
f7593f5
Merge pull request #29424 from frappe/mergify/bp/version-13-hotfix/pr…
deepeshgarg007 Jan 24, 2022
3dfe7fa
fix: issue of CI
rohitwaghchaure Jan 24, 2022
aba8788
Merge pull request #29422 from frappe/mergify/bp/version-13-hotfix/pr…
rohitwaghchaure Jan 24, 2022
e8bc4f1
fix:Add shipping charges to taxes only if applicable
deepeshgarg007 Jan 24, 2022
d361e23
test: clear singles cache for changed settings (#29430) (#29431)
mergify[bot] Jan 24, 2022
895dd68
fix: honour 'include holidays' setting while marking attendance for l…
mergify[bot] Jan 24, 2022
ecba064
Merge pull request #29404 from deepeshgarg007/doc_currency_override
deepeshgarg007 Jan 24, 2022
63ccddf
fix: fetch "transfer material against" from BOM (#29435) (#29436)
mergify[bot] Jan 24, 2022
034773a
fix: broken patches (#29067)
saurabh6790 Jan 25, 2022
177a209
fix(Employee): set user image and validate user id only if user data …
ruchamahabal Jan 25, 2022
58fd704
fix: remove all stock UOM conversion when changing stock UOM (#29463)
mergify[bot] Jan 26, 2022
d2b61bb
fix(healthcare): populate current practitioner in appointment availab…
akashkrishna619 Jan 26, 2022
352c585
fix: Further sort sales_order_analysis to get consistent response
surajshetty3416 Jan 27, 2022
4e4855f
Merge pull request #29473 from frappe/mergify/bp/version-13-hotfix/pr…
surajshetty3416 Jan 27, 2022
67689e7
fix: stock ledger rendering glitch (#29482)
mergify[bot] Jan 27, 2022
03bd686
chore: disable annoying flake8 formatting for QB (#29488)
ankush Jan 28, 2022
4e14d28
fix: ensure correct-ish transfer against
ankush Jan 28, 2022
de01f0f
fix(patch): update BOMs to have correct transfer_material_against
ankush Jan 28, 2022
5dd443e
test: delete data after running test
ankush Jan 28, 2022
5f9fdba
Merge branch 'version-13-hotfix' into shipping_rule_apply
deepeshgarg007 Jan 29, 2022
c24724a
fix: qty filter not working if apply_multiple_pricing_rules is enabled
nextchamp-saqib Dec 14, 2021
e7e0359
test: add test_multiple_pricing_rules
nextchamp-saqib Dec 14, 2021
eeb2402
chore: rename redefinition of multiple pricing rule test
nextchamp-saqib Dec 15, 2021
8535ad5
chore: undo unnecessary changes
nextchamp-saqib Jan 20, 2022
ebe9599
Merge pull request #29428 from deepeshgarg007/shipping_rule_apply
deepeshgarg007 Jan 29, 2022
997ddbe
fix: ignore alternate item while checking pending qty
ankush Jan 28, 2022
cc08125
refactor: reusable clean_serial_nos
ankush Jan 24, 2022
db3eef9
fix: extend sr_no cleanup to packed items too
ankush Jan 24, 2022
70dc773
fix: work order serial no allows storing whitespace
ankush Jan 24, 2022
dc82bec
fix(India) Tax calculation for overseas suppliers
deepeshgarg007 Jan 28, 2022
0fb4e81
fix: cost of poor quality report time filters not working (#28958) (#…
mergify[bot] Jan 30, 2022
2c83f18
Merge pull request #29518 from frappe/mergify/bp/version-13-hotfix/pr…
deepeshgarg007 Jan 31, 2022
f31e521
fix: qty filter not working if apply_multiple_pricing_rules is enabled
nextchamp-saqib Jan 31, 2022
9da63f2
fix(sales order): incorrect no. of items fetched while creating dn
nextchamp-saqib Jan 25, 2022
e6f2343
chore: add comment
nextchamp-saqib Jan 25, 2022
bed7201
fix: merge conflicts
nextchamp-saqib Jan 31, 2022
144c8ec
Merge pull request #29528 from frappe/mergify/bp/version-13-hotfix/pr…
nextchamp-saqib Jan 31, 2022
8aa6423
fix: add unique constraint on bin at db level
ankush Jan 30, 2022
b3f36ef
fix: ignore None item/wh whie updating reservation
ankush Jan 30, 2022
a7b30d9
fix(patch): patch duplicate bins
s-aga-r Jan 30, 2022
f99f537
refactor: patch for fixing broken bins
ankush Jan 30, 2022
2b868e7
fix: update reserved qty for production/ s/c
ankush Jan 31, 2022
9425ca0
chore: revert manual handling of stock level section (#29537) (#29538)
mergify[bot] Jan 31, 2022
2bc4275
Merge pull request #29534 from frappe/mergify/bp/version-13-hotfix/pr…
ankush Jan 31, 2022
5ac11a4
refactor!: dynamically compute bom_level (backport #29522) (#29540)
mergify[bot] Jan 31, 2022
862961d
chore: Merge branch 'version-13-hotfix' into 'version-13-pre-release'
rohitwaghchaure Jan 31, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .flake8
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ ignore =
B007,
B950,
W191,
E124, # closing bracket, irritating while writing QB code

max-line-length = 200
exclude=.github/helper/semgrep_rules
10 changes: 10 additions & 0 deletions .github/workflows/patch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,14 @@ on:
paths-ignore:
- '**.js'
- '**.md'
types: [opened, unlabeled, synchronize, reopened]
workflow_dispatch:


concurrency:
group: patch-mariadb-v13-${{ github.event.number }}
cancel-in-progress: true

jobs:
test:
runs-on: ubuntu-18.04
Expand All @@ -25,6 +30,11 @@ jobs:
options: --health-cmd="mysqladmin ping" --health-interval=5s --health-timeout=2s --health-retries=3

steps:
- name: Check for merge conficts label
if: ${{ contains(github.event.pull_request.labels.*.name, 'conflicts') }}
run: |
echo "Remove merge conflicts and remove conflict label to run CI"
exit 1
- name: Clone
uses: actions/checkout@v2

Expand Down
44 changes: 12 additions & 32 deletions .github/workflows/server-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,18 @@ on:
paths-ignore:
- '**.js'
- '**.md'
types: [opened, unlabeled, synchronize, reopened]
workflow_dispatch:
push:
branches: [ develop ]
paths-ignore:
- '**.js'
- '**.md'

concurrency:
group: server-mariadb-v13-${{ github.event.number }}
cancel-in-progress: true

jobs:
test:
runs-on: ubuntu-18.04
Expand All @@ -35,6 +40,12 @@ jobs:
options: --health-cmd="mysqladmin ping" --health-interval=5s --health-timeout=2s --health-retries=3

steps:
- name: Check for merge conficts label
if: ${{ contains(github.event.pull_request.labels.*.name, 'conflicts') }}
run: |
echo "Remove merge conflicts and remove conflict label to run CI"
exit 1

- name: Clone
uses: actions/checkout@v2

Expand Down Expand Up @@ -89,39 +100,8 @@ jobs:
run: bash ${GITHUB_WORKSPACE}/.github/helper/install.sh

- name: Run Tests
run: cd ~/frappe-bench/ && bench --site test_site run-parallel-tests --app erpnext --use-orchestrator --with-coverage
run: cd ~/frappe-bench/ && bench --site test_site run-parallel-tests --app erpnext --use-orchestrator
env:
TYPE: server
CI_BUILD_ID: ${{ github.run_id }}
ORCHESTRATOR_URL: http://test-orchestrator.frappe.io

- name: Upload Coverage Data
run: |
cp ~/frappe-bench/sites/.coverage ${GITHUB_WORKSPACE}
cd ${GITHUB_WORKSPACE}
pip3 install coverage==5.5
pip3 install coveralls==3.0.1
coveralls
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
COVERALLS_FLAG_NAME: run-${{ matrix.container }}
COVERALLS_SERVICE_NAME: ${{ github.event_name == 'pull_request' && 'github' || 'github-actions' }}
COVERALLS_PARALLEL: true

coveralls:
name: Coverage Wrap Up
needs: test
container: python:3-slim
runs-on: ubuntu-18.04
steps:
- name: Clone
uses: actions/checkout@v2

- name: Coveralls Finished
run: |
cd ${GITHUB_WORKSPACE}
pip3 install coverage==5.5
pip3 install coveralls==3.0.1
coveralls --finish
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4 changes: 4 additions & 0 deletions .github/workflows/ui-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ on:
- '**.md'
workflow_dispatch:

concurrency:
group: ui-v13-${{ github.event.number }}
cancel-in-progress: true

jobs:
test:
runs-on: ubuntu-18.04
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ def get_item_dict():
default_uom = frappe.db.get_single_value("Stock Settings", "stock_uom") or _("Nos")
rate = flt(row.outstanding_amount) / flt(row.qty)

return frappe._dict({
item_dict = frappe._dict({
"uom": default_uom,
"rate": rate or 0.0,
"qty": row.qty,
Expand All @@ -146,6 +146,13 @@ def get_item_dict():
"cost_center": cost_center
})

for dimension in get_accounting_dimensions():
item_dict.update({
dimension: row.get(dimension)
})

return item_dict

item = get_item_dict()

invoice = frappe._dict({
Expand All @@ -166,7 +173,7 @@ def get_item_dict():
accounting_dimension = get_accounting_dimensions()
for dimension in accounting_dimension:
invoice.update({
dimension: item.get(dimension)
dimension: self.get(dimension) or item.get(dimension)
})

return invoice
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,26 @@
from frappe.cache_manager import clear_doctype_cache
from frappe.custom.doctype.property_setter.property_setter import make_property_setter

from erpnext.accounts.doctype.accounting_dimension.test_accounting_dimension import (
create_dimension,
disable_dimension,
)
from erpnext.accounts.doctype.opening_invoice_creation_tool.opening_invoice_creation_tool import (
get_temporary_opening_account,
)

test_dependencies = ["Customer", "Supplier"]
test_dependencies = ["Customer", "Supplier", "Accounting Dimension"]

class TestOpeningInvoiceCreationTool(unittest.TestCase):
def setUp(self):
if not frappe.db.exists("Company", "_Test Opening Invoice Company"):
make_company()
create_dimension()

def make_invoices(self, invoice_type="Sales", company=None, party_1=None, party_2=None, invoice_number=None):
def make_invoices(self, invoice_type="Sales", company=None, party_1=None, party_2=None, invoice_number=None, department=None):
doc = frappe.get_single("Opening Invoice Creation Tool")
args = get_opening_invoice_creation_dict(invoice_type=invoice_type, company=company,
party_1=party_1, party_2=party_2, invoice_number=invoice_number)
party_1=party_1, party_2=party_2, invoice_number=invoice_number, department=department)
doc.update(args)
return doc.make_invoices()

Expand Down Expand Up @@ -106,6 +111,19 @@ def test_renaming_of_invoice_using_invoice_number_field(self):
doc = frappe.get_doc('Sales Invoice', inv)
doc.cancel()

def test_opening_invoice_with_accounting_dimension(self):
invoices = self.make_invoices(invoice_type="Sales", company="_Test Opening Invoice Company", department='Sales - _TOIC')

expected_value = {
"keys": ["customer", "outstanding_amount", "status", "department"],
0: ["_Test Customer", 300, "Overdue", "Sales - _TOIC"],
1: ["_Test Customer 1", 250, "Overdue", "Sales - _TOIC"],
}
self.check_expected_values(invoices, expected_value, invoice_type="Sales")

def tearDown(self):
disable_dimension()

def get_opening_invoice_creation_dict(**args):
party = "Customer" if args.get("invoice_type", "Sales") == "Sales" else "Supplier"
company = args.get("company", "_Test Company")
Expand Down
20 changes: 20 additions & 0 deletions erpnext/accounts/doctype/pricing_rule/test_pricing_rule.py
Original file line number Diff line number Diff line change
Expand Up @@ -630,6 +630,26 @@ def test_pricing_rule_for_transaction(self):
for doc in [si, si1]:
doc.delete()

def test_multiple_pricing_rules_with_min_qty(self):
make_pricing_rule(discount_percentage=20, selling=1, priority=1, min_qty=4,
apply_multiple_pricing_rules=1, title="_Test Pricing Rule with Min Qty - 1")
make_pricing_rule(discount_percentage=10, selling=1, priority=2, min_qty=4,
apply_multiple_pricing_rules=1, title="_Test Pricing Rule with Min Qty - 2")

si = create_sales_invoice(do_not_submit=True, customer="_Test Customer 1", qty=1, currency="USD")
item = si.items[0]
item.stock_qty = 1
si.save()
self.assertFalse(item.discount_percentage)
item.qty = 5
item.stock_qty = 5
si.save()
self.assertEqual(item.discount_percentage, 30)
si.delete()

frappe.delete_doc_if_exists("Pricing Rule", "_Test Pricing Rule with Min Qty - 1")
frappe.delete_doc_if_exists("Pricing Rule", "_Test Pricing Rule with Min Qty - 2")

test_dependencies = ["Campaign"]

def make_pricing_rule(**args):
Expand Down
2 changes: 1 addition & 1 deletion erpnext/accounts/doctype/pricing_rule/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ def sorted_by_priority(pricing_rules, args, doc=None):
for key in sorted(pricing_rule_dict):
pricing_rules_list.extend(pricing_rule_dict.get(key))

return pricing_rules_list or pricing_rules
return pricing_rules_list

def filter_pricing_rule_based_on_condition(pricing_rules, doc=None):
filtered_pricing_rules = []
Expand Down
8 changes: 6 additions & 2 deletions erpnext/accounts/doctype/sales_invoice/sales_invoice.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
from erpnext.stock.doctype.batch.batch import set_batch_nos
from erpnext.stock.doctype.delivery_note.delivery_note import update_billed_amount_based_on_so
from erpnext.stock.doctype.serial_no.serial_no import get_delivery_note_serial_no, get_serial_nos
from erpnext.stock.utils import calculate_mapped_packed_items_return

form_grid_templates = {
"items": "templates/form_grid/item_grid.html"
Expand Down Expand Up @@ -745,8 +746,11 @@ def update_current_stock(self):

def update_packing_list(self):
if cint(self.update_stock) == 1:
from erpnext.stock.doctype.packed_item.packed_item import make_packing_list
make_packing_list(self)
if cint(self.is_return) and self.return_against:
calculate_mapped_packed_items_return(self)
else:
from erpnext.stock.doctype.packed_item.packed_item import make_packing_list
make_packing_list(self)
else:
self.set('packed_items', [])

Expand Down
18 changes: 9 additions & 9 deletions erpnext/accounts/doctype/sales_invoice/test_sales_invoice.py
Original file line number Diff line number Diff line change
Expand Up @@ -2177,9 +2177,9 @@ def test_asset_depreciation_on_sale_with_pro_rata(self):
asset.load_from_db()

expected_values = [
["2020-06-30", 1311.48, 1311.48],
["2021-06-30", 20000.0, 21311.48],
["2021-09-30", 5041.1, 26352.58]
["2020-06-30", 1366.12, 1366.12],
["2021-06-30", 20000.0, 21366.12],
["2021-09-30", 5041.1, 26407.22]
]

for i, schedule in enumerate(asset.schedules):
Expand Down Expand Up @@ -2227,12 +2227,12 @@ def test_depreciation_on_return_of_sold_asset(self):
asset.load_from_db()

expected_values = [
["2020-06-30", 1311.48, 1311.48, True],
["2021-06-30", 20000.0, 21311.48, True],
["2022-06-30", 20000.0, 41311.48, False],
["2023-06-30", 20000.0, 61311.48, False],
["2024-06-30", 20000.0, 81311.48, False],
["2025-06-06", 18688.52, 100000.0, False]
["2020-06-30", 1366.12, 1366.12, True],
["2021-06-30", 20000.0, 21366.12, True],
["2022-06-30", 20000.0, 41366.12, False],
["2023-06-30", 20000.0, 61366.12, False],
["2024-06-30", 20000.0, 81366.12, False],
["2025-06-06", 18633.88, 100000.0, False]
]

for i, schedule in enumerate(asset.schedules):
Expand Down
3 changes: 2 additions & 1 deletion erpnext/accounts/doctype/shipping_rule/shipping_rule.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,8 @@ def apply(self, doc):
if doc.currency != doc.company_currency:
shipping_amount = flt(shipping_amount / doc.conversion_rate, 2)

self.add_shipping_rule_to_tax_table(doc, shipping_amount)
if shipping_amount:
self.add_shipping_rule_to_tax_table(doc, shipping_amount)

def get_shipping_amount_from_rules(self, value):
for condition in self.get("conditions"):
Expand Down
2 changes: 1 addition & 1 deletion erpnext/accounts/party.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ def _get_party_details(party=None, account=None, party_type="Customer", company=
frappe.throw(_("Not permitted for {0}").format(party), frappe.PermissionError)

party = frappe.get_doc(party_type, party)
currency = party.default_currency if party.get("default_currency") else get_company_currency(company)
currency = party.get("default_currency") or currency or get_company_currency(company)

party_address, shipping_address = set_address_details(party_details, party, party_type, doctype, company, party_address, company_address, shipping_address)
set_contact_details(party_details, party, party_type)
Expand Down
Loading