Compare commits
2 Commits
v15.54.2
...
mergify/bp
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f94dffe568 | ||
|
|
ad3094fd11 |
@@ -18,4 +18,8 @@ max_line_length = 110
|
||||
[{*.json}]
|
||||
insert_final_newline = false
|
||||
indent_style = space
|
||||
<<<<<<< HEAD
|
||||
indent_size = 2
|
||||
=======
|
||||
indent_size = 1
|
||||
>>>>>>> 329d14957b (fix: validate negative qty)
|
||||
|
||||
@@ -30,5 +30,20 @@ b147b85e6ac19a9220cd1e2958a6ebd99373283a
|
||||
# bulk format python code with black
|
||||
baec607ff5905b1c67531096a9cf50ec7ff00a5d
|
||||
|
||||
<<<<<<< HEAD
|
||||
# ruff
|
||||
960ef14b7a68cfec9e309ec12845f521cb6a721c
|
||||
=======
|
||||
# bulk refactor with sourcery
|
||||
eb9ee3f79b94e594fc6dfa4f6514580e125eee8c
|
||||
|
||||
# js formatting
|
||||
ec74a5e56617bbd76ac402451468fd4668af543d
|
||||
|
||||
# ruff formatting
|
||||
a308792ee7fda18a681e9181f4fd00b36385bc23
|
||||
|
||||
# noisy typing refactoring of get_item_details
|
||||
7b7211ac79c248a79ba8a999ff34e734d874c0ae
|
||||
d827ed21adc7b36047e247cbb0dc6388d048a7f9
|
||||
>>>>>>> 329d14957b (fix: validate negative qty)
|
||||
|
||||
14
.github/helper/documentation.py
vendored
14
.github/helper/documentation.py
vendored
@@ -1,7 +1,13 @@
|
||||
import sys
|
||||
<<<<<<< HEAD
|
||||
import requests
|
||||
from urllib.parse import urlparse
|
||||
|
||||
=======
|
||||
from urllib.parse import urlparse
|
||||
|
||||
import requests
|
||||
>>>>>>> 329d14957b (fix: validate negative qty)
|
||||
|
||||
WEBSITE_REPOS = [
|
||||
"erpnext_com",
|
||||
@@ -36,11 +42,15 @@ def is_documentation_link(word: str) -> bool:
|
||||
|
||||
|
||||
def contains_documentation_link(body: str) -> bool:
|
||||
<<<<<<< HEAD
|
||||
return any(
|
||||
is_documentation_link(word)
|
||||
for line in body.splitlines()
|
||||
for word in line.split()
|
||||
)
|
||||
=======
|
||||
return any(is_documentation_link(word) for line in body.splitlines() for word in line.split())
|
||||
>>>>>>> 329d14957b (fix: validate negative qty)
|
||||
|
||||
|
||||
def check_pull_request(number: str) -> "tuple[int, str]":
|
||||
@@ -53,12 +63,16 @@ def check_pull_request(number: str) -> "tuple[int, str]":
|
||||
head_sha = (payload.get("head") or {}).get("sha")
|
||||
body = (payload.get("body") or "").lower()
|
||||
|
||||
<<<<<<< HEAD
|
||||
if (
|
||||
not title.startswith("feat")
|
||||
or not head_sha
|
||||
or "no-docs" in body
|
||||
or "backport" in body
|
||||
):
|
||||
=======
|
||||
if not title.startswith("feat") or not head_sha or "no-docs" in body or "backport" in body:
|
||||
>>>>>>> 329d14957b (fix: validate negative qty)
|
||||
return 0, "Skipping documentation checks... 🏃"
|
||||
|
||||
if contains_documentation_link(body):
|
||||
|
||||
13
.github/helper/install.sh
vendored
13
.github/helper/install.sh
vendored
@@ -12,9 +12,22 @@ pip install frappe-bench
|
||||
|
||||
githubbranch=${GITHUB_BASE_REF:-${GITHUB_REF##*/}}
|
||||
frappeuser=${FRAPPE_USER:-"frappe"}
|
||||
<<<<<<< HEAD
|
||||
frappebranch=${FRAPPE_BRANCH:-$githubbranch}
|
||||
|
||||
git clone "https://github.com/${frappeuser}/frappe" --branch "${frappebranch}" --depth 1
|
||||
=======
|
||||
frappecommitish=${FRAPPE_BRANCH:-$githubbranch}
|
||||
|
||||
mkdir frappe
|
||||
pushd frappe
|
||||
git init
|
||||
git remote add origin "https://github.com/${frappeuser}/frappe"
|
||||
git fetch origin "${frappecommitish}" --depth 1
|
||||
git checkout FETCH_HEAD
|
||||
popd
|
||||
|
||||
>>>>>>> 329d14957b (fix: validate negative qty)
|
||||
bench init --skip-assets --frappe-path ~/frappe --python "$(which python)" frappe-bench
|
||||
|
||||
mkdir ~/frappe-bench/sites/test_site
|
||||
|
||||
68
.github/helper/translation.py
vendored
Normal file
68
.github/helper/translation.py
vendored
Normal file
@@ -0,0 +1,68 @@
|
||||
import re
|
||||
import sys
|
||||
|
||||
errors_encounter = 0
|
||||
pattern = re.compile(
|
||||
r"_\(([\"']{,3})(?P<message>((?!\1).)*)\1(\s*,\s*context\s*=\s*([\"'])(?P<py_context>((?!\5).)*)\5)*(\s*,(\s*?.*?\n*?)*(,\s*([\"'])(?P<js_context>((?!\11).)*)\11)*)*\)"
|
||||
)
|
||||
words_pattern = re.compile(r"_{1,2}\([\"'`]{1,3}.*?[a-zA-Z]")
|
||||
start_pattern = re.compile(r"_{1,2}\([f\"'`]{1,3}")
|
||||
f_string_pattern = re.compile(r"_\(f[\"']")
|
||||
starts_with_f_pattern = re.compile(r"_\(f")
|
||||
|
||||
# skip first argument
|
||||
files = sys.argv[1:]
|
||||
files_to_scan = [_file for _file in files if _file.endswith((".py", ".js"))]
|
||||
|
||||
for _file in files_to_scan:
|
||||
with open(_file) as f:
|
||||
print(f"Checking: {_file}")
|
||||
file_lines = f.readlines()
|
||||
for line_number, line in enumerate(file_lines, 1):
|
||||
if "frappe-lint: disable-translate" in line:
|
||||
continue
|
||||
|
||||
start_matches = start_pattern.search(line)
|
||||
if start_matches:
|
||||
starts_with_f = starts_with_f_pattern.search(line)
|
||||
|
||||
if starts_with_f:
|
||||
has_f_string = f_string_pattern.search(line)
|
||||
if has_f_string:
|
||||
errors_encounter += 1
|
||||
print(
|
||||
f"\nF-strings are not supported for translations at line number {line_number}\n{line.strip()[:100]}"
|
||||
)
|
||||
continue
|
||||
else:
|
||||
continue
|
||||
|
||||
match = pattern.search(line)
|
||||
error_found = False
|
||||
|
||||
if not match and line.endswith((",\n", "[\n")):
|
||||
# concat remaining text to validate multiline pattern
|
||||
line = "".join(file_lines[line_number - 1 :])
|
||||
line = line[start_matches.start() + 1 :]
|
||||
match = pattern.match(line)
|
||||
|
||||
if not match:
|
||||
error_found = True
|
||||
print(f"\nTranslation syntax error at line number {line_number}\n{line.strip()[:100]}")
|
||||
|
||||
if not error_found and not words_pattern.search(line):
|
||||
error_found = True
|
||||
print(
|
||||
f"\nTranslation is useless because it has no words at line number {line_number}\n{line.strip()[:100]}"
|
||||
)
|
||||
|
||||
if error_found:
|
||||
errors_encounter += 1
|
||||
|
||||
if errors_encounter > 0:
|
||||
print(
|
||||
'\nVisit "https://frappeframework.com/docs/user/en/translations" to learn about valid translation strings.'
|
||||
)
|
||||
sys.exit(1)
|
||||
else:
|
||||
print("\nGood To Go!")
|
||||
40
.github/helper/update_pot_file.sh
vendored
Normal file
40
.github/helper/update_pot_file.sh
vendored
Normal file
@@ -0,0 +1,40 @@
|
||||
#!/bin/bash
|
||||
set -e
|
||||
cd ~ || exit
|
||||
|
||||
echo "Setting Up Bench..."
|
||||
|
||||
pip install frappe-bench
|
||||
bench -v init frappe-bench --skip-assets --skip-redis-config-generation --python "$(which python)"
|
||||
cd ./frappe-bench || exit
|
||||
|
||||
echo "Get ERPNext..."
|
||||
bench get-app --skip-assets erpnext "${GITHUB_WORKSPACE}"
|
||||
|
||||
echo "Generating POT file..."
|
||||
bench generate-pot-file --app erpnext
|
||||
|
||||
cd ./apps/erpnext || exit
|
||||
|
||||
echo "Configuring git user..."
|
||||
git config user.email "developers@erpnext.com"
|
||||
git config user.name "frappe-pr-bot"
|
||||
|
||||
echo "Setting the correct git remote..."
|
||||
# Here, the git remote is a local file path by default. Let's change it to the upstream repo.
|
||||
git remote set-url upstream https://github.com/frappe/erpnext.git
|
||||
|
||||
echo "Creating a new branch..."
|
||||
isodate=$(date -u +"%Y-%m-%d")
|
||||
branch_name="pot_${BASE_BRANCH}_${isodate}"
|
||||
git checkout -b "${branch_name}"
|
||||
|
||||
echo "Commiting changes..."
|
||||
git add erpnext/locale/main.pot
|
||||
git commit -m "chore: update POT file"
|
||||
|
||||
gh auth setup-git
|
||||
git push -u upstream "${branch_name}"
|
||||
|
||||
echo "Creating a PR..."
|
||||
gh pr create --fill --base "${BASE_BRANCH}" --head "${branch_name}" --reviewer ${PR_REVIEWER} -R frappe/erpnext
|
||||
11
.github/stale.yml
vendored
11
.github/stale.yml
vendored
@@ -12,6 +12,17 @@ exemptProjects: true
|
||||
# Set to true to ignore issues in a milestone (defaults to false)
|
||||
exemptMilestones: true
|
||||
|
||||
<<<<<<< HEAD
|
||||
=======
|
||||
# Skip the stale action for draft PRs
|
||||
exemptDraftPr: true
|
||||
|
||||
# Issues or Pull Requests with these labels will never be considered stale. Set to `[]` to disable
|
||||
exemptLabels:
|
||||
- hotfix
|
||||
- no-stale
|
||||
|
||||
>>>>>>> 329d14957b (fix: validate negative qty)
|
||||
pulls:
|
||||
daysUntilStale: 15
|
||||
daysUntilClose: 3
|
||||
|
||||
26
.github/workflows/backport.yml
vendored
Normal file
26
.github/workflows/backport.yml
vendored
Normal file
@@ -0,0 +1,26 @@
|
||||
name: Backport
|
||||
on:
|
||||
pull_request_target:
|
||||
types:
|
||||
- closed
|
||||
- labeled
|
||||
|
||||
jobs:
|
||||
main:
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 60
|
||||
steps:
|
||||
- name: Checkout Actions
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
repository: "frappe/backport"
|
||||
path: ./actions
|
||||
ref: develop
|
||||
- name: Install Actions
|
||||
run: npm install --production --prefix ./actions
|
||||
- name: Run backport
|
||||
uses: ./actions/backport
|
||||
with:
|
||||
token: ${{secrets.RELEASE_TOKEN}}
|
||||
labelsToAdd: "backport"
|
||||
title: "{{originalTitle}}"
|
||||
39
.github/workflows/generate-pot-file.yml
vendored
Normal file
39
.github/workflows/generate-pot-file.yml
vendored
Normal file
@@ -0,0 +1,39 @@
|
||||
# This workflow is agnostic to branches. Only maintain on develop branch.
|
||||
# To add/remove branches just modify the matrix.
|
||||
|
||||
name: Regenerate POT file (translatable strings)
|
||||
on:
|
||||
schedule:
|
||||
# 9:30 UTC => 3 PM IST Sunday
|
||||
- cron: "30 9 * * 0"
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
regenerate-pot-file:
|
||||
name: Regenerate POT file
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
branch: ["develop"]
|
||||
permissions:
|
||||
contents: write
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
ref: ${{ matrix.branch }}
|
||||
|
||||
- name: Setup Python
|
||||
uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: "3.12"
|
||||
|
||||
- name: Run script to update POT file
|
||||
run: |
|
||||
bash ${GITHUB_WORKSPACE}/.github/helper/update_pot_file.sh
|
||||
env:
|
||||
GH_TOKEN: ${{ secrets.RELEASE_TOKEN }}
|
||||
BASE_BRANCH: ${{ matrix.branch }}
|
||||
PR_REVIEWER: barredterra # change to your GitHub username if you copied this file
|
||||
32
.github/workflows/initiate_release.yml
vendored
Normal file
32
.github/workflows/initiate_release.yml
vendored
Normal file
@@ -0,0 +1,32 @@
|
||||
# This workflow is agnostic to branches. Only maintain on develop branch.
|
||||
# To add/remove versions just modify the matrix.
|
||||
|
||||
name: Create weekly release pull requests
|
||||
on:
|
||||
schedule:
|
||||
# 9:30 UTC => 3 PM IST Tuesday
|
||||
- cron: "30 9 * * 2"
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
stable-release:
|
||||
name: Release
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
version: ["14", "15"]
|
||||
|
||||
steps:
|
||||
- uses: octokit/request-action@v2.x
|
||||
with:
|
||||
route: POST /repos/{owner}/{repo}/pulls
|
||||
owner: frappe
|
||||
repo: erpnext
|
||||
title: |-
|
||||
"chore: release v${{ matrix.version }}"
|
||||
body: "Automated weekly release."
|
||||
base: version-${{ matrix.version }}
|
||||
head: version-${{ matrix.version }}-hotfix
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }}
|
||||
15
.github/workflows/linters.yml
vendored
15
.github/workflows/linters.yml
vendored
@@ -20,6 +20,21 @@ jobs:
|
||||
- name: Install and Run Pre-commit
|
||||
uses: pre-commit/action@v3.0.0
|
||||
|
||||
<<<<<<< HEAD
|
||||
=======
|
||||
semgrep:
|
||||
name: semgrep
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
- name: Set up Python 3.10
|
||||
uses: actions/setup-python@v4
|
||||
with:
|
||||
python-version: '3.10'
|
||||
cache: pip
|
||||
|
||||
>>>>>>> 329d14957b (fix: validate negative qty)
|
||||
- name: Download Semgrep rules
|
||||
run: git clone --depth 1 https://github.com/frappe/semgrep-rules.git frappe-semgrep-rules
|
||||
|
||||
|
||||
21
.github/workflows/lock.yml
vendored
Normal file
21
.github/workflows/lock.yml
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
name: 'Lock threads'
|
||||
|
||||
on:
|
||||
schedule:
|
||||
- cron: '0 0 * * *'
|
||||
workflow_dispatch:
|
||||
|
||||
permissions:
|
||||
issues: write
|
||||
pull-requests: write
|
||||
|
||||
|
||||
jobs:
|
||||
lock:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: dessant/lock-threads@v5
|
||||
with:
|
||||
github-token: ${{ github.token }}
|
||||
issue-inactive-days: 14
|
||||
pr-inactive-days: 14
|
||||
33
.github/workflows/patch.yml
vendored
33
.github/workflows/patch.yml
vendored
@@ -32,7 +32,11 @@ jobs:
|
||||
|
||||
steps:
|
||||
- name: Clone
|
||||
<<<<<<< HEAD
|
||||
uses: actions/checkout@v2
|
||||
=======
|
||||
uses: actions/checkout@v4
|
||||
>>>>>>> 329d14957b (fix: validate negative qty)
|
||||
|
||||
- name: Check for valid Python & Merge Conflicts
|
||||
run: |
|
||||
@@ -43,12 +47,21 @@ jobs:
|
||||
fi
|
||||
|
||||
- name: Setup Python
|
||||
<<<<<<< HEAD
|
||||
uses: "actions/setup-python@v4"
|
||||
with:
|
||||
python-version: '3.10'
|
||||
|
||||
- name: Setup Node
|
||||
uses: actions/setup-node@v2
|
||||
=======
|
||||
uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: '3.11'
|
||||
|
||||
- name: Setup Node
|
||||
uses: actions/setup-node@v4
|
||||
>>>>>>> 329d14957b (fix: validate negative qty)
|
||||
with:
|
||||
node-version: 18
|
||||
check-latest: true
|
||||
@@ -57,7 +70,11 @@ jobs:
|
||||
run: echo "127.0.0.1 test_site" | sudo tee -a /etc/hosts
|
||||
|
||||
- name: Cache pip
|
||||
<<<<<<< HEAD
|
||||
uses: actions/cache@v2
|
||||
=======
|
||||
uses: actions/cache@v4
|
||||
>>>>>>> 329d14957b (fix: validate negative qty)
|
||||
with:
|
||||
path: ~/.cache/pip
|
||||
key: ${{ runner.os }}-pip-${{ hashFiles('**/*requirements.txt', '**/pyproject.toml') }}
|
||||
@@ -66,7 +83,11 @@ jobs:
|
||||
${{ runner.os }}-
|
||||
|
||||
- name: Cache node modules
|
||||
<<<<<<< HEAD
|
||||
uses: actions/cache@v2
|
||||
=======
|
||||
uses: actions/cache@v4
|
||||
>>>>>>> 329d14957b (fix: validate negative qty)
|
||||
env:
|
||||
cache-name: cache-node-modules
|
||||
with:
|
||||
@@ -81,7 +102,11 @@ jobs:
|
||||
id: yarn-cache-dir-path
|
||||
run: echo "::set-output name=dir::$(yarn cache dir)"
|
||||
|
||||
<<<<<<< HEAD
|
||||
- uses: actions/cache@v2
|
||||
=======
|
||||
- uses: actions/cache@v4
|
||||
>>>>>>> 329d14957b (fix: validate negative qty)
|
||||
id: yarn-cache
|
||||
with:
|
||||
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
|
||||
@@ -134,9 +159,17 @@ jobs:
|
||||
}
|
||||
|
||||
update_to_version 14
|
||||
<<<<<<< HEAD
|
||||
|
||||
echo "Updating to latest version"
|
||||
git -C "apps/frappe" checkout -q -f "${GITHUB_BASE_REF:-${GITHUB_REF##*/}}"
|
||||
=======
|
||||
update_to_version 15
|
||||
|
||||
echo "Updating to latest version"
|
||||
git -C "apps/frappe" fetch --depth 1 upstream "${GITHUB_BASE_REF:-${GITHUB_REF##*/}}"
|
||||
git -C "apps/frappe" checkout -q -f FETCH_HEAD
|
||||
>>>>>>> 329d14957b (fix: validate negative qty)
|
||||
git -C "apps/erpnext" checkout -q -f "$GITHUB_SHA"
|
||||
|
||||
pgrep honcho | xargs kill
|
||||
|
||||
22
.github/workflows/patch_faux.yml
vendored
Normal file
22
.github/workflows/patch_faux.yml
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
# Tests are skipped for these files but github doesn't allow "passing" hence this is required.
|
||||
|
||||
name: Skipped Patch Test
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
paths:
|
||||
- "**.js"
|
||||
- "**.css"
|
||||
- "**.md"
|
||||
- "**.html"
|
||||
- "**.csv"
|
||||
|
||||
jobs:
|
||||
test:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
name: Patch Test
|
||||
|
||||
steps:
|
||||
- name: Pass skipped tests unconditionally
|
||||
run: "echo Skipped"
|
||||
14
.github/workflows/release.yml
vendored
14
.github/workflows/release.yml
vendored
@@ -2,23 +2,37 @@ name: Generate Semantic Release
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
<<<<<<< HEAD
|
||||
- version-15
|
||||
=======
|
||||
- version-13
|
||||
>>>>>>> 329d14957b (fix: validate negative qty)
|
||||
jobs:
|
||||
release:
|
||||
name: Release
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout Entire Repository
|
||||
<<<<<<< HEAD
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
persist-credentials: false
|
||||
|
||||
=======
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
fetch-depth: 0
|
||||
persist-credentials: false
|
||||
>>>>>>> 329d14957b (fix: validate negative qty)
|
||||
- name: Setup Node.js
|
||||
uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: 20
|
||||
<<<<<<< HEAD
|
||||
|
||||
=======
|
||||
>>>>>>> 329d14957b (fix: validate negative qty)
|
||||
- name: Setup dependencies
|
||||
run: |
|
||||
npm install @semantic-release/git @semantic-release/exec --no-save
|
||||
|
||||
8
.github/workflows/release_notes.yml
vendored
8
.github/workflows/release_notes.yml
vendored
@@ -29,7 +29,15 @@ jobs:
|
||||
steps:
|
||||
- name: Update notes
|
||||
run: |
|
||||
<<<<<<< HEAD
|
||||
NEW_NOTES=$(gh api --method POST -H "Accept: application/vnd.github+json" /repos/frappe/erpnext/releases/generate-notes -f tag_name=$RELEASE_TAG | jq -r '.body' | sed -E '/^\* (chore|ci|test|docs|style)/d' )
|
||||
=======
|
||||
NEW_NOTES=$(gh api --method POST -H "Accept: application/vnd.github+json" /repos/frappe/erpnext/releases/generate-notes -f tag_name=$RELEASE_TAG \
|
||||
| jq -r '.body' \
|
||||
| sed -E '/^\* (chore|ci|test|docs|style)/d' \
|
||||
| sed -E 's/by @mergify //'
|
||||
)
|
||||
>>>>>>> 329d14957b (fix: validate negative qty)
|
||||
RELEASE_ID=$(gh api -H "Accept: application/vnd.github+json" /repos/frappe/erpnext/releases/tags/$RELEASE_TAG | jq -r '.id')
|
||||
gh api --method PATCH -H "Accept: application/vnd.github+json" /repos/frappe/erpnext/releases/$RELEASE_ID -f body="$NEW_NOTES"
|
||||
|
||||
|
||||
130
.github/workflows/run-indinvidual-tests.yml
vendored
Normal file
130
.github/workflows/run-indinvidual-tests.yml
vendored
Normal file
@@ -0,0 +1,130 @@
|
||||
name: Individual
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
|
||||
concurrency:
|
||||
group: server-individual-tests-develop-${{ github.event_name }}-${{ github.event.number || github.event_name == 'workflow_dispatch' && github.run_id || '' }}
|
||||
cancel-in-progress: false
|
||||
|
||||
jobs:
|
||||
discover:
|
||||
runs-on: ubuntu-latest
|
||||
outputs:
|
||||
matrix: ${{ steps.set-matrix.outputs.matrix }}
|
||||
steps:
|
||||
- name: Clone
|
||||
uses: actions/checkout@v4
|
||||
- id: set-matrix
|
||||
run: |
|
||||
# Use grep and find to get the list of test files
|
||||
matrix=$(find . -path '*/doctype/*/test_*.py' | xargs grep -l 'def test_' | awk '{
|
||||
# Remove ./ prefix, file extension, and replace / with .
|
||||
gsub(/^\.\//, "", $0)
|
||||
gsub(/\.py$/, "", $0)
|
||||
gsub(/\//, ".", $0)
|
||||
# Add to array
|
||||
tests[NR] = $0
|
||||
}
|
||||
END {
|
||||
# Start JSON array
|
||||
printf "{\n \"include\": [\n"
|
||||
# Loop through array and create JSON objects
|
||||
for (i=1; i<=NR; i++) {
|
||||
printf " {\"test\": \"%s\"}", tests[i]
|
||||
if (i < NR) printf ","
|
||||
printf "\n"
|
||||
}
|
||||
# Close JSON array
|
||||
printf " ]\n}"
|
||||
}')
|
||||
|
||||
# Output the matrix
|
||||
echo "matrix=$(echo "$matrix" | jq -c)" >> $GITHUB_OUTPUT
|
||||
|
||||
# For debugging (optional)
|
||||
echo "Generated matrix:"
|
||||
echo "$matrix"
|
||||
test:
|
||||
needs: discover
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 60
|
||||
env:
|
||||
NODE_ENV: "production"
|
||||
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix: ${{fromJson(needs.discover.outputs.matrix)}}
|
||||
|
||||
name: Test
|
||||
|
||||
services:
|
||||
mysql:
|
||||
image: mariadb:10.6
|
||||
env:
|
||||
MARIADB_ROOT_PASSWORD: 'root'
|
||||
ports:
|
||||
- 3306:3306
|
||||
options: --health-cmd="mariadb-admin ping" --health-interval=5s --health-timeout=2s --health-retries=3
|
||||
|
||||
steps:
|
||||
- name: Clone
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Setup Python
|
||||
uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: '3.12'
|
||||
|
||||
- name: Setup Node
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 18
|
||||
check-latest: true
|
||||
|
||||
- name: Add to Hosts
|
||||
run: echo "127.0.0.1 test_site" | sudo tee -a /etc/hosts
|
||||
|
||||
- name: Cache pip
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: ~/.cache/pip
|
||||
key: ${{ runner.os }}-pip-${{ hashFiles('**/*requirements.txt', '**/pyproject.toml') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-pip-
|
||||
${{ runner.os }}-
|
||||
|
||||
- name: Cache node modules
|
||||
uses: actions/cache@v4
|
||||
env:
|
||||
cache-name: cache-node-modules
|
||||
with:
|
||||
path: ~/.npm
|
||||
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-build-${{ env.cache-name }}-
|
||||
${{ runner.os }}-build-
|
||||
${{ runner.os }}-
|
||||
|
||||
- name: Get yarn cache directory path
|
||||
id: yarn-cache-dir-path
|
||||
run: echo "::set-output name=dir::$(yarn cache dir)"
|
||||
|
||||
- uses: actions/cache@v4
|
||||
id: yarn-cache
|
||||
with:
|
||||
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
|
||||
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-yarn-
|
||||
|
||||
- name: Install
|
||||
run: bash ${GITHUB_WORKSPACE}/.github/helper/install.sh
|
||||
env:
|
||||
DB: mariadb
|
||||
TYPE: server
|
||||
FRAPPE_USER: ${{ github.event.inputs.user }}
|
||||
FRAPPE_BRANCH: ${{ github.event.inputs.branch }}
|
||||
|
||||
- name: Run Tests
|
||||
run: 'cd ~/frappe-bench/ && bench --site test_site run-tests --app erpnext --module ${{ matrix.test }}'
|
||||
24
.github/workflows/server-tests-mariadb-faux.yml
vendored
Normal file
24
.github/workflows/server-tests-mariadb-faux.yml
vendored
Normal file
@@ -0,0 +1,24 @@
|
||||
# Tests are skipped for these files but github doesn't allow "passing" hence this is required.
|
||||
|
||||
name: Skipped Tests
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
paths:
|
||||
- "**.js"
|
||||
- "**.css"
|
||||
- "**.md"
|
||||
- "**.html"
|
||||
|
||||
jobs:
|
||||
test:
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
matrix:
|
||||
container: [1, 2, 3, 4]
|
||||
|
||||
name: Python Unit Tests
|
||||
|
||||
steps:
|
||||
- name: Pass skipped tests unconditionally
|
||||
run: "echo Skipped"
|
||||
77
.github/workflows/server-tests-mariadb.yml
vendored
77
.github/workflows/server-tests-mariadb.yml
vendored
@@ -1,6 +1,11 @@
|
||||
name: Server (Mariadb)
|
||||
|
||||
on:
|
||||
<<<<<<< HEAD
|
||||
=======
|
||||
repository_dispatch:
|
||||
types: [frappe-framework-change]
|
||||
>>>>>>> 329d14957b (fix: validate negative qty)
|
||||
pull_request:
|
||||
paths-ignore:
|
||||
- '**.js'
|
||||
@@ -31,6 +36,12 @@ jobs:
|
||||
test:
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 60
|
||||
<<<<<<< HEAD
|
||||
=======
|
||||
env:
|
||||
NODE_ENV: "production"
|
||||
WITH_COVERAGE: ${{ github.event_name != 'pull_request' }}
|
||||
>>>>>>> 329d14957b (fix: validate negative qty)
|
||||
|
||||
strategy:
|
||||
fail-fast: false
|
||||
@@ -51,12 +62,21 @@ jobs:
|
||||
|
||||
steps:
|
||||
- name: Clone
|
||||
<<<<<<< HEAD
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Setup Python
|
||||
uses: actions/setup-python@v2
|
||||
with:
|
||||
python-version: '3.11'
|
||||
=======
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Setup Python
|
||||
uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: '3.12'
|
||||
>>>>>>> 329d14957b (fix: validate negative qty)
|
||||
|
||||
- name: Check for valid Python & Merge Conflicts
|
||||
run: |
|
||||
@@ -67,7 +87,11 @@ jobs:
|
||||
fi
|
||||
|
||||
- name: Setup Node
|
||||
<<<<<<< HEAD
|
||||
uses: actions/setup-node@v2
|
||||
=======
|
||||
uses: actions/setup-node@v4
|
||||
>>>>>>> 329d14957b (fix: validate negative qty)
|
||||
with:
|
||||
node-version: 18
|
||||
check-latest: true
|
||||
@@ -76,7 +100,11 @@ jobs:
|
||||
run: echo "127.0.0.1 test_site" | sudo tee -a /etc/hosts
|
||||
|
||||
- name: Cache pip
|
||||
<<<<<<< HEAD
|
||||
uses: actions/cache@v2
|
||||
=======
|
||||
uses: actions/cache@v4
|
||||
>>>>>>> 329d14957b (fix: validate negative qty)
|
||||
with:
|
||||
path: ~/.cache/pip
|
||||
key: ${{ runner.os }}-pip-${{ hashFiles('**/*requirements.txt', '**/pyproject.toml') }}
|
||||
@@ -85,7 +113,11 @@ jobs:
|
||||
${{ runner.os }}-
|
||||
|
||||
- name: Cache node modules
|
||||
<<<<<<< HEAD
|
||||
uses: actions/cache@v2
|
||||
=======
|
||||
uses: actions/cache@v4
|
||||
>>>>>>> 329d14957b (fix: validate negative qty)
|
||||
env:
|
||||
cache-name: cache-node-modules
|
||||
with:
|
||||
@@ -100,7 +132,11 @@ jobs:
|
||||
id: yarn-cache-dir-path
|
||||
run: echo "::set-output name=dir::$(yarn cache dir)"
|
||||
|
||||
<<<<<<< HEAD
|
||||
- uses: actions/cache@v2
|
||||
=======
|
||||
- uses: actions/cache@v4
|
||||
>>>>>>> 329d14957b (fix: validate negative qty)
|
||||
id: yarn-cache
|
||||
with:
|
||||
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
|
||||
@@ -114,6 +150,7 @@ jobs:
|
||||
DB: mariadb
|
||||
TYPE: server
|
||||
FRAPPE_USER: ${{ github.event.inputs.user }}
|
||||
<<<<<<< HEAD
|
||||
FRAPPE_BRANCH: ${{ github.event.inputs.branch }}
|
||||
|
||||
- name: Run Tests
|
||||
@@ -122,7 +159,47 @@ jobs:
|
||||
TYPE: server
|
||||
CI_BUILD_ID: ${{ github.run_id }}
|
||||
ORCHESTRATOR_URL: http://test-orchestrator.frappe.io
|
||||
=======
|
||||
FRAPPE_BRANCH: ${{ github.event.client_payload.sha || github.event.inputs.branch }}
|
||||
|
||||
- name: Run Tests
|
||||
run: 'cd ~/frappe-bench/ && bench --site test_site run-parallel-tests --app erpnext --total-builds ${{ strategy.job-total }} --build-number ${{ matrix.container }}'
|
||||
env:
|
||||
TYPE: server
|
||||
CAPTURE_COVERAGE: ${{ github.event_name != 'pull_request' }}
|
||||
|
||||
>>>>>>> 329d14957b (fix: validate negative qty)
|
||||
|
||||
- name: Show bench output
|
||||
if: ${{ always() }}
|
||||
run: cat ~/frappe-bench/bench_start.log || true
|
||||
<<<<<<< HEAD
|
||||
=======
|
||||
|
||||
- name: Upload coverage data
|
||||
uses: actions/upload-artifact@v3
|
||||
if: github.event_name != 'pull_request'
|
||||
with:
|
||||
name: coverage-${{ matrix.container }}
|
||||
path: /home/runner/frappe-bench/sites/coverage.xml
|
||||
|
||||
coverage:
|
||||
name: Coverage Wrap Up
|
||||
needs: test
|
||||
runs-on: ubuntu-latest
|
||||
if: ${{ github.event_name != 'pull_request' }}
|
||||
steps:
|
||||
- name: Clone
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Download artifacts
|
||||
uses: actions/download-artifact@v3
|
||||
|
||||
- name: Upload coverage data
|
||||
uses: codecov/codecov-action@v4
|
||||
with:
|
||||
name: MariaDB
|
||||
token: ${{ secrets.CODECOV_TOKEN }}
|
||||
fail_ci_if_error: true
|
||||
verbose: true
|
||||
>>>>>>> 329d14957b (fix: validate negative qty)
|
||||
|
||||
25
.github/workflows/server-tests-postgres.yml
vendored
25
.github/workflows/server-tests-postgres.yml
vendored
@@ -41,12 +41,21 @@ jobs:
|
||||
steps:
|
||||
|
||||
- name: Clone
|
||||
<<<<<<< HEAD
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Setup Python
|
||||
uses: actions/setup-python@v2
|
||||
with:
|
||||
python-version: '3.10'
|
||||
=======
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Setup Python
|
||||
uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: '3.12'
|
||||
>>>>>>> 329d14957b (fix: validate negative qty)
|
||||
|
||||
- name: Check for valid Python & Merge Conflicts
|
||||
run: |
|
||||
@@ -57,7 +66,11 @@ jobs:
|
||||
fi
|
||||
|
||||
- name: Setup Node
|
||||
<<<<<<< HEAD
|
||||
uses: actions/setup-node@v2
|
||||
=======
|
||||
uses: actions/setup-node@v4
|
||||
>>>>>>> 329d14957b (fix: validate negative qty)
|
||||
with:
|
||||
node-version: 18
|
||||
check-latest: true
|
||||
@@ -66,7 +79,11 @@ jobs:
|
||||
run: echo "127.0.0.1 test_site" | sudo tee -a /etc/hosts
|
||||
|
||||
- name: Cache pip
|
||||
<<<<<<< HEAD
|
||||
uses: actions/cache@v2
|
||||
=======
|
||||
uses: actions/cache@v4
|
||||
>>>>>>> 329d14957b (fix: validate negative qty)
|
||||
with:
|
||||
path: ~/.cache/pip
|
||||
key: ${{ runner.os }}-pip-${{ hashFiles('**/*requirements.txt', '**/pyproject.toml') }}
|
||||
@@ -75,7 +92,11 @@ jobs:
|
||||
${{ runner.os }}-
|
||||
|
||||
- name: Cache node modules
|
||||
<<<<<<< HEAD
|
||||
uses: actions/cache@v2
|
||||
=======
|
||||
uses: actions/cache@v4
|
||||
>>>>>>> 329d14957b (fix: validate negative qty)
|
||||
env:
|
||||
cache-name: cache-node-modules
|
||||
with:
|
||||
@@ -90,7 +111,11 @@ jobs:
|
||||
id: yarn-cache-dir-path
|
||||
run: echo "::set-output name=dir::$(yarn cache dir)"
|
||||
|
||||
<<<<<<< HEAD
|
||||
- uses: actions/cache@v2
|
||||
=======
|
||||
- uses: actions/cache@v4
|
||||
>>>>>>> 329d14957b (fix: validate negative qty)
|
||||
id: yarn-cache
|
||||
with:
|
||||
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
|
||||
|
||||
13
.gitignore
vendored
13
.gitignore
vendored
@@ -2,7 +2,10 @@
|
||||
*.py~
|
||||
.DS_Store
|
||||
conf.py
|
||||
<<<<<<< HEAD
|
||||
locale
|
||||
=======
|
||||
>>>>>>> 329d14957b (fix: validate negative qty)
|
||||
latest_updates.json
|
||||
.wnf-lang-status
|
||||
*.egg-info
|
||||
@@ -15,5 +18,13 @@ __pycache__
|
||||
*~
|
||||
.idea/
|
||||
.vscode/
|
||||
<<<<<<< HEAD
|
||||
node_modules/
|
||||
.backportrc.json
|
||||
.backportrc.json
|
||||
=======
|
||||
.helix/
|
||||
node_modules/
|
||||
.backportrc.json
|
||||
# Aider AI Chat
|
||||
.aider*
|
||||
>>>>>>> 329d14957b (fix: validate negative qty)
|
||||
|
||||
20
.mergify.yml
20
.mergify.yml
@@ -17,6 +17,10 @@ pull_request_rules:
|
||||
- base=version-12
|
||||
- base=version-14
|
||||
- base=version-15
|
||||
<<<<<<< HEAD
|
||||
=======
|
||||
- base=version-16
|
||||
>>>>>>> 329d14957b (fix: validate negative qty)
|
||||
actions:
|
||||
close:
|
||||
comment:
|
||||
@@ -24,6 +28,7 @@ pull_request_rules:
|
||||
@{{author}}, thanks for the contribution, but we do not accept pull requests on a stable branch. Please raise PR on an appropriate hotfix branch.
|
||||
https://github.com/frappe/erpnext/wiki/Pull-Request-Checklist#which-branch
|
||||
|
||||
<<<<<<< HEAD
|
||||
- name: Auto-close PRs on pre-release branch
|
||||
conditions:
|
||||
- base=version-13-pre-release
|
||||
@@ -34,6 +39,8 @@ pull_request_rules:
|
||||
@{{author}}, pre-release branch is not maintained anymore. Releases are directly done by merging hotfix branch to stable branches.
|
||||
|
||||
|
||||
=======
|
||||
>>>>>>> 329d14957b (fix: validate negative qty)
|
||||
- name: backport to develop
|
||||
conditions:
|
||||
- label="backport develop"
|
||||
@@ -54,6 +61,7 @@ pull_request_rules:
|
||||
assignees:
|
||||
- "{{ author }}"
|
||||
|
||||
<<<<<<< HEAD
|
||||
- name: backport to version-14-pre-release
|
||||
conditions:
|
||||
- label="backport version-14-pre-release"
|
||||
@@ -61,6 +69,15 @@ pull_request_rules:
|
||||
backport:
|
||||
branches:
|
||||
- version-14-pre-release
|
||||
=======
|
||||
- name: backport to version-15-hotfix
|
||||
conditions:
|
||||
- label="backport version-15-hotfix"
|
||||
actions:
|
||||
backport:
|
||||
branches:
|
||||
- version-15-hotfix
|
||||
>>>>>>> 329d14957b (fix: validate negative qty)
|
||||
assignees:
|
||||
- "{{ author }}"
|
||||
|
||||
@@ -74,6 +91,7 @@ pull_request_rules:
|
||||
assignees:
|
||||
- "{{ author }}"
|
||||
|
||||
<<<<<<< HEAD
|
||||
- name: backport to version-13-pre-release
|
||||
conditions:
|
||||
- label="backport version-13-pre-release"
|
||||
@@ -103,6 +121,8 @@ pull_request_rules:
|
||||
- version-12-pre-release
|
||||
assignees:
|
||||
- "{{ author }}"
|
||||
=======
|
||||
>>>>>>> 329d14957b (fix: validate negative qty)
|
||||
|
||||
- name: Automatic merge on CI success and review
|
||||
conditions:
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
{
|
||||
<<<<<<< HEAD
|
||||
"branches": ["version-15"],
|
||||
=======
|
||||
"branches": ["version-13"],
|
||||
>>>>>>> 329d14957b (fix: validate negative qty)
|
||||
"plugins": [
|
||||
"@semantic-release/commit-analyzer", {
|
||||
"preset": "angular",
|
||||
@@ -21,4 +25,8 @@
|
||||
],
|
||||
"@semantic-release/github"
|
||||
]
|
||||
<<<<<<< HEAD
|
||||
}
|
||||
=======
|
||||
}
|
||||
>>>>>>> 329d14957b (fix: validate negative qty)
|
||||
|
||||
15
CODEOWNERS
15
CODEOWNERS
@@ -3,11 +3,19 @@
|
||||
# These owners will be the default owners for everything in
|
||||
# the repo. Unless a later match takes precedence,
|
||||
|
||||
<<<<<<< HEAD
|
||||
erpnext/accounts/ @deepeshgarg007 @ruthra-kumar
|
||||
erpnext/assets/ @khushi8112 @deepeshgarg007
|
||||
erpnext/regional @deepeshgarg007 @ruthra-kumar
|
||||
erpnext/selling @deepeshgarg007 @ruthra-kumar
|
||||
erpnext/support/ @deepeshgarg007
|
||||
=======
|
||||
erpnext/accounts/ @ruthra-kumar
|
||||
erpnext/assets/ @khushi8112
|
||||
erpnext/regional @ruthra-kumar
|
||||
erpnext/selling @ruthra-kumar
|
||||
erpnext/support/ @ruthra-kumar
|
||||
>>>>>>> 329d14957b (fix: validate negative qty)
|
||||
pos*
|
||||
|
||||
erpnext/buying/ @rohitwaghchaure
|
||||
@@ -17,8 +25,15 @@ erpnext/quality_management/ @rohitwaghchaure
|
||||
erpnext/stock/ @rohitwaghchaure
|
||||
erpnext/subcontracting @rohitwaghchaure
|
||||
|
||||
<<<<<<< HEAD
|
||||
erpnext/controllers/ @deepeshgarg007 @rohitwaghchaure
|
||||
erpnext/patches/ @deepeshgarg007
|
||||
|
||||
.github/ @deepeshgarg007
|
||||
=======
|
||||
erpnext/controllers/ @ruthra-kumar @rohitwaghchaure
|
||||
erpnext/patches/ @ruthra-kumar
|
||||
|
||||
.github/ @ruthra-kumar
|
||||
>>>>>>> 329d14957b (fix: validate negative qty)
|
||||
pyproject.toml @akhilnarang
|
||||
|
||||
@@ -7,8 +7,12 @@
|
||||
<p>ERP made simple</p>
|
||||
</p>
|
||||
|
||||
<<<<<<< HEAD
|
||||
[](https://github.com/frappe/erpnext/actions/workflows/server-tests.yml)
|
||||
[](https://github.com/erpnext/erpnext_ui_tests/actions/workflows/ui-tests.yml)
|
||||
=======
|
||||
[](https://github.com/frappe/erpnext/actions/workflows/server-tests-mariadb.yml)
|
||||
>>>>>>> 329d14957b (fix: validate negative qty)
|
||||
[](https://www.codetriage.com/frappe/erpnext)
|
||||
[](https://codecov.io/gh/frappe/erpnext)
|
||||
[](https://hub.docker.com/r/frappe/erpnext-worker)
|
||||
@@ -73,8 +77,11 @@ New passwords will be created for the ERPNext "Administrator" user, the MariaDB
|
||||
1. [Issue Guidelines](https://github.com/frappe/erpnext/wiki/Issue-Guidelines)
|
||||
1. [Report Security Vulnerabilities](https://erpnext.com/security)
|
||||
1. [Pull Request Requirements](https://github.com/frappe/erpnext/wiki/Contribution-Guidelines)
|
||||
<<<<<<< HEAD
|
||||
1. [Translations](https://translate.erpnext.com)
|
||||
|
||||
=======
|
||||
>>>>>>> 329d14957b (fix: validate negative qty)
|
||||
|
||||
## License
|
||||
|
||||
|
||||
3
babel_extractors.csv
Normal file
3
babel_extractors.csv
Normal file
@@ -0,0 +1,3 @@
|
||||
**/setup/setup_wizard/data/uom_data.json,erpnext.gettext.extractors.uom_data.extract
|
||||
**/setup/doctype/incoterm/incoterms.csv,erpnext.gettext.extractors.incoterms.extract
|
||||
**/setup/setup_wizard/data/*.txt,erpnext.gettext.extractors.lines_from_txt_file.extract
|
||||
|
10
crowdin.yml
Normal file
10
crowdin.yml
Normal file
@@ -0,0 +1,10 @@
|
||||
files:
|
||||
- source: /erpnext/locale/main.pot
|
||||
translation: /erpnext/locale/%two_letters_code%.po
|
||||
pull_request_title: "fix: sync translations from crowdin"
|
||||
pull_request_labels:
|
||||
- translation
|
||||
pull_request_reviewers:
|
||||
- barredterra # change to your GitHub username if you copied this file
|
||||
commit_message: "fix: %language% translations"
|
||||
append_commit_message: false
|
||||
@@ -1,10 +1,20 @@
|
||||
import functools
|
||||
import inspect
|
||||
<<<<<<< HEAD
|
||||
|
||||
import frappe
|
||||
from frappe.utils.user import is_website_user
|
||||
|
||||
__version__ = "15.39.6"
|
||||
=======
|
||||
from typing import TypeVar
|
||||
|
||||
import frappe
|
||||
from frappe.model.document import Document
|
||||
from frappe.utils.user import is_website_user
|
||||
|
||||
__version__ = "16.0.0-dev"
|
||||
>>>>>>> 329d14957b (fix: validate negative qty)
|
||||
|
||||
|
||||
def get_default_company(user=None):
|
||||
@@ -160,3 +170,37 @@ def check_app_permission():
|
||||
return False
|
||||
|
||||
return True
|
||||
<<<<<<< HEAD
|
||||
=======
|
||||
|
||||
|
||||
T = TypeVar("T")
|
||||
|
||||
|
||||
def normalize_ctx_input(T: type) -> callable:
|
||||
"""
|
||||
Normalizes the first argument (ctx) of the decorated function by:
|
||||
- Converting Document objects to dictionaries
|
||||
- Parsing JSON strings
|
||||
- Casting the result to the specified type T
|
||||
"""
|
||||
|
||||
def decorator(func: callable):
|
||||
# conserve annotations for frappe.utils.typing_validations
|
||||
@functools.wraps(func, assigned=(a for a in functools.WRAPPER_ASSIGNMENTS if a != "__annotations__"))
|
||||
def wrapper(ctx: T | Document | dict | str, *args, **kwargs):
|
||||
if isinstance(ctx, Document):
|
||||
ctx = T(**ctx.as_dict())
|
||||
elif isinstance(ctx, dict):
|
||||
ctx = T(**ctx)
|
||||
else:
|
||||
ctx = T(**frappe.parse_json(ctx))
|
||||
|
||||
return func(ctx, *args, **kwargs)
|
||||
|
||||
# set annotations from function
|
||||
wrapper.__annotations__.update({k: v for k, v in func.__annotations__.items() if k != "ctx"})
|
||||
return wrapper
|
||||
|
||||
return decorator
|
||||
>>>>>>> 329d14957b (fix: validate negative qty)
|
||||
|
||||
@@ -220,7 +220,11 @@ def calculate_monthly_amount(
|
||||
if amount + already_booked_amount_in_account_currency > item.net_amount:
|
||||
amount = item.net_amount - already_booked_amount_in_account_currency
|
||||
|
||||
<<<<<<< HEAD
|
||||
if not (get_first_day(start_date) == start_date and get_last_day(end_date) == end_date):
|
||||
=======
|
||||
if get_first_day(start_date) != start_date or get_last_day(end_date) != end_date:
|
||||
>>>>>>> 329d14957b (fix: validate negative qty)
|
||||
partial_month = flt(date_diff(end_date, start_date)) / flt(
|
||||
date_diff(get_last_day(end_date), get_first_day(start_date))
|
||||
)
|
||||
|
||||
@@ -64,6 +64,11 @@
|
||||
"label": "Is Group"
|
||||
},
|
||||
{
|
||||
<<<<<<< HEAD
|
||||
=======
|
||||
"fetch_from": "parent_account.company",
|
||||
"fetch_if_empty": 1,
|
||||
>>>>>>> 329d14957b (fix: validate negative qty)
|
||||
"fieldname": "company",
|
||||
"fieldtype": "Link",
|
||||
"in_standard_filter": 1,
|
||||
@@ -106,6 +111,10 @@
|
||||
"fieldname": "parent_account",
|
||||
"fieldtype": "Link",
|
||||
"ignore_user_permissions": 1,
|
||||
<<<<<<< HEAD
|
||||
=======
|
||||
"in_preview": 1,
|
||||
>>>>>>> 329d14957b (fix: validate negative qty)
|
||||
"label": "Parent Account",
|
||||
"oldfieldname": "parent_account",
|
||||
"oldfieldtype": "Link",
|
||||
@@ -248,8 +257,17 @@
|
||||
],
|
||||
"search_fields": "account_number",
|
||||
"show_name_in_global_search": 1,
|
||||
<<<<<<< HEAD
|
||||
"sort_field": "modified",
|
||||
"sort_order": "ASC",
|
||||
"states": [],
|
||||
"track_changes": 1
|
||||
}
|
||||
=======
|
||||
"show_preview_popup": 1,
|
||||
"sort_field": "creation",
|
||||
"sort_order": "ASC",
|
||||
"states": [],
|
||||
"track_changes": 1
|
||||
}
|
||||
>>>>>>> 329d14957b (fix: validate negative qty)
|
||||
|
||||
@@ -92,9 +92,13 @@ class Account(NestedSet):
|
||||
super().on_update()
|
||||
|
||||
def onload(self):
|
||||
<<<<<<< HEAD
|
||||
frozen_accounts_modifier = frappe.db.get_value(
|
||||
"Accounts Settings", "Accounts Settings", "frozen_accounts_modifier"
|
||||
)
|
||||
=======
|
||||
frozen_accounts_modifier = frappe.db.get_single_value("Accounts Settings", "frozen_accounts_modifier")
|
||||
>>>>>>> 329d14957b (fix: validate negative qty)
|
||||
if not frozen_accounts_modifier or frozen_accounts_modifier in frappe.get_roles():
|
||||
self.set_onload("can_freeze_account", True)
|
||||
|
||||
|
||||
@@ -81,7 +81,11 @@ frappe.treeview_settings["Account"] = {
|
||||
|
||||
// show Dr if positive since balance is calculated as debit - credit else show Cr
|
||||
const balance = account.balance_in_account_currency || account.balance;
|
||||
<<<<<<< HEAD
|
||||
const dr_or_cr = balance > 0 ? "Dr" : "Cr";
|
||||
=======
|
||||
const dr_or_cr = balance > 0 ? __("Dr") : __("Cr");
|
||||
>>>>>>> 329d14957b (fix: validate negative qty)
|
||||
const format = (value, currency) => format_currency(Math.abs(value), currency);
|
||||
|
||||
if (account.balance !== undefined) {
|
||||
|
||||
@@ -75,7 +75,11 @@ def create_charts(
|
||||
# after all accounts are already inserted.
|
||||
frappe.local.flags.ignore_update_nsm = True
|
||||
_import_accounts(chart, None, None, root_account=True)
|
||||
<<<<<<< HEAD
|
||||
rebuild_tree("Account", "parent_account")
|
||||
=======
|
||||
rebuild_tree("Account")
|
||||
>>>>>>> 329d14957b (fix: validate negative qty)
|
||||
frappe.local.flags.ignore_update_nsm = False
|
||||
|
||||
|
||||
@@ -232,6 +236,11 @@ def build_account_tree(tree, parent, all_accounts):
|
||||
tree[child.account_name]["account_type"] = child.account_type
|
||||
if child.tax_rate:
|
||||
tree[child.account_name]["tax_rate"] = child.tax_rate
|
||||
<<<<<<< HEAD
|
||||
=======
|
||||
if child.account_currency:
|
||||
tree[child.account_name]["account_currency"] = child.account_currency
|
||||
>>>>>>> 329d14957b (fix: validate negative qty)
|
||||
if not parent:
|
||||
tree[child.account_name]["root_type"] = child.root_type
|
||||
|
||||
|
||||
@@ -0,0 +1,569 @@
|
||||
{
|
||||
"country_code": "de",
|
||||
"name": "SKR03 mit Kontonummern",
|
||||
"tree": {
|
||||
"Aktiva": {
|
||||
"is_group": 1,
|
||||
"root_type": "Asset",
|
||||
"A - Anlagevermögen": {
|
||||
"is_group": 1,
|
||||
"EDV-Software": {
|
||||
"account_number": "0027",
|
||||
"account_type": "Fixed Asset"
|
||||
},
|
||||
"Geschäftsausstattung": {
|
||||
"account_number": "0410",
|
||||
"account_type": "Fixed Asset"
|
||||
},
|
||||
"Büroeinrichtung": {
|
||||
"account_number": "0420",
|
||||
"account_type": "Fixed Asset"
|
||||
},
|
||||
"Darlehen": {
|
||||
"account_number": "0565"
|
||||
},
|
||||
"Maschinen": {
|
||||
"account_number": "0210",
|
||||
"account_type": "Fixed Asset"
|
||||
},
|
||||
"Betriebsausstattung": {
|
||||
"account_number": "0400",
|
||||
"account_type": "Fixed Asset"
|
||||
},
|
||||
"Ladeneinrichtung": {
|
||||
"account_number": "0430",
|
||||
"account_type": "Fixed Asset"
|
||||
},
|
||||
"Accumulated Depreciation": {
|
||||
"account_type": "Accumulated Depreciation"
|
||||
}
|
||||
},
|
||||
"B - Umlaufvermögen": {
|
||||
"is_group": 1,
|
||||
"I. Vorräte": {
|
||||
"is_group": 1,
|
||||
"Roh-, Hilfs- und Betriebsstoffe (Bestand)": {
|
||||
"account_number": "3970",
|
||||
"account_type": "Stock"
|
||||
},
|
||||
"Waren (Bestand)": {
|
||||
"account_number": "3980",
|
||||
"account_type": "Stock"
|
||||
}
|
||||
},
|
||||
"II. Forderungen und sonstige Vermögensgegenstände": {
|
||||
"is_group": 1,
|
||||
"Forderungen aus Lieferungen und Leistungen mit Kontokorrent": {
|
||||
"account_number": "1400",
|
||||
"account_type": "Receivable",
|
||||
"is_group": 1
|
||||
},
|
||||
"Forderungen aus Lieferungen und Leistungen ohne Kontokorrent": {
|
||||
"account_number": "1410",
|
||||
"account_type": "Receivable"
|
||||
},
|
||||
"Durchlaufende Posten": {
|
||||
"account_number": "1590"
|
||||
},
|
||||
"Verrechnungskonto Gewinnermittlung § 4 Abs. 3 EStG, nicht ergebniswirksam": {
|
||||
"account_number": "1371"
|
||||
},
|
||||
"Abziehbare Vorsteuer": {
|
||||
"is_group": 1,
|
||||
"Abziehbare Vorsteuer 7 %": {
|
||||
"account_number": "1571",
|
||||
"account_type": "Tax",
|
||||
"tax_rate": 7.0
|
||||
},
|
||||
"Abziehbare Vorsteuer 19 %": {
|
||||
"account_number": "1576",
|
||||
"account_type": "Tax",
|
||||
"tax_rate": 19.0
|
||||
},
|
||||
"Abziehbare Vorsteuer nach § 13b UStG 19 %": {
|
||||
"account_number": "1577",
|
||||
"account_type": "Tax",
|
||||
"tax_rate": 19.0
|
||||
}
|
||||
}
|
||||
},
|
||||
"III. Wertpapiere": {
|
||||
"is_group": 1,
|
||||
"Anteile an verbundenen Unternehmen (Umlaufvermögen)": {
|
||||
"account_number": "1340"
|
||||
},
|
||||
"Anteile an herrschender oder mit Mehrheit beteiligter Gesellschaft": {
|
||||
"account_number": "1344"
|
||||
},
|
||||
"Sonstige Wertpapiere": {
|
||||
"account_number": "1348"
|
||||
}
|
||||
},
|
||||
"IV. Kassenbestand, Bundesbankguthaben, Guthaben bei Kreditinstituten und Schecks.": {
|
||||
"is_group": 1,
|
||||
"Kasse": {
|
||||
"is_group": 1,
|
||||
"account_type": "Cash",
|
||||
"Kasse": {
|
||||
"account_number": "1000",
|
||||
"account_type": "Cash"
|
||||
}
|
||||
},
|
||||
"Bank": {
|
||||
"is_group": 1,
|
||||
"account_type": "Bank",
|
||||
"Postbank": {
|
||||
"account_number": "1100",
|
||||
"account_type": "Bank"
|
||||
},
|
||||
"Bankkonto": {
|
||||
"account_number": "1200",
|
||||
"account_type": "Bank"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"C - Rechnungsabgrenzungsposten": {
|
||||
"is_group": 1,
|
||||
"Aktive Rechnungsabgrenzung": {
|
||||
"account_number": "0980"
|
||||
}
|
||||
},
|
||||
"D - Aktive latente Steuern": {
|
||||
"is_group": 1,
|
||||
"Aktive latente Steuern": {
|
||||
"account_number": "0983"
|
||||
}
|
||||
},
|
||||
"E - Aktiver Unterschiedsbetrag aus der Vermögensverrechnung": {
|
||||
"is_group": 1
|
||||
}
|
||||
},
|
||||
"Passiva": {
|
||||
"is_group": 1,
|
||||
"root_type": "Liability",
|
||||
"A. Eigenkapital": {
|
||||
"is_group": 1,
|
||||
"I. Gezeichnetes Kapital": {
|
||||
"is_group": 1
|
||||
},
|
||||
"II. Kapitalrücklage": {
|
||||
"is_group": 1
|
||||
},
|
||||
"III. Gewinnrücklagen": {
|
||||
"is_group": 1
|
||||
},
|
||||
"IV. Gewinnvortrag/Verlustvortrag": {
|
||||
"is_group": 1
|
||||
},
|
||||
"V. Jahresüberschuß/Jahresfehlbetrag": {
|
||||
"is_group": 1
|
||||
}
|
||||
},
|
||||
"B. Rückstellungen": {
|
||||
"is_group": 1,
|
||||
"I. Rückstellungen für Pensionen und ähnliche Verpflichtungen": {
|
||||
"is_group": 1
|
||||
},
|
||||
"II. Steuerrückstellungen": {
|
||||
"is_group": 1
|
||||
},
|
||||
"III. sonstige Rückstellungen": {
|
||||
"is_group": 1
|
||||
}
|
||||
},
|
||||
"C. Verbindlichkeiten": {
|
||||
"is_group": 1,
|
||||
"I. Anleihen": {
|
||||
"is_group": 1
|
||||
},
|
||||
"II. Verbindlichkeiten gegenüber Kreditinstituten": {
|
||||
"is_group": 1
|
||||
},
|
||||
"III. Erhaltene Anzahlungen auf Bestellungen": {
|
||||
"is_group": 1
|
||||
},
|
||||
"IV. Verbindlichkeiten aus Lieferungen und Leistungen": {
|
||||
"is_group": 1,
|
||||
"Verbindlichkeiten aus Lieferungen und Leistungen mit Kontokorrent": {
|
||||
"account_number": "1600",
|
||||
"account_type": "Payable",
|
||||
"is_group": 1
|
||||
},
|
||||
"Verbindlichkeiten aus Lieferungen und Leistungen ohne Kontokorrent": {
|
||||
"account_number": "1610",
|
||||
"account_type": "Payable"
|
||||
}
|
||||
},
|
||||
"V. Verbindlichkeiten aus der Annahme gezogener Wechsel und der Ausstellung eigener Wechsel": {
|
||||
"is_group": 1
|
||||
},
|
||||
"VI. Verbindlichkeiten gegenüber verbundenen Unternehmen": {
|
||||
"is_group": 1
|
||||
},
|
||||
"VII. Verbindlichkeiten gegenüber Unternehmen, mit denen ein Beteiligungsverhältnis besteht": {
|
||||
"is_group": 1
|
||||
},
|
||||
"VIII. sonstige Verbindlichkeiten": {
|
||||
"is_group": 1,
|
||||
"Sonstige Verbindlichkeiten": {
|
||||
"account_number": "1700",
|
||||
"account_type": "Asset Received But Not Billed"
|
||||
},
|
||||
"Sonstige Verbindlichkeiten (1 bis 5 Jahre)": {
|
||||
"account_number": "1702",
|
||||
"account_type": "Stock Received But Not Billed"
|
||||
},
|
||||
"Verbindlichkeiten aus Lohn und Gehalt": {
|
||||
"account_number": "1740",
|
||||
"account_type": "Payable"
|
||||
},
|
||||
"Umsatzsteuer": {
|
||||
"is_group": 1,
|
||||
"Umsatzsteuer 7 %": {
|
||||
"account_number": "1771",
|
||||
"account_type": "Tax",
|
||||
"tax_rate": 7.0
|
||||
},
|
||||
"Umsatzsteuer 19 %": {
|
||||
"account_number": "1776",
|
||||
"account_type": "Tax",
|
||||
"tax_rate": 19.0
|
||||
},
|
||||
"Umsatzsteuer-Vorauszahlung": {
|
||||
"account_number": "1780",
|
||||
"account_type": "Tax"
|
||||
},
|
||||
"Umsatzsteuer-Vorauszahlung 1/11": {
|
||||
"account_number": "1781"
|
||||
},
|
||||
"Umsatzsteuer nach § 13b UStG 19 %": {
|
||||
"account_number": "1787",
|
||||
"account_type": "Tax",
|
||||
"tax_rate": 19.0
|
||||
},
|
||||
"Umsatzsteuer Vorjahr": {
|
||||
"account_number": "1790"
|
||||
},
|
||||
"Umsatzsteuer frühere Jahre": {
|
||||
"account_number": "1791"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"D. Rechnungsabgrenzungsposten": {
|
||||
"is_group": 1,
|
||||
"Passive Rechnungsabgrenzung": {
|
||||
"account_number": "0990"
|
||||
}
|
||||
},
|
||||
"E. Passive latente Steuern": {
|
||||
"is_group": 1
|
||||
}
|
||||
},
|
||||
"Erlöse u. Erträge 2/8": {
|
||||
"is_group": 1,
|
||||
"root_type": "Income",
|
||||
"Erlöskonten 8": {
|
||||
"is_group": 1,
|
||||
"Erlöse": {
|
||||
"account_number": "8200",
|
||||
"account_type": "Income Account"
|
||||
},
|
||||
"Erlöse USt. 19 %": {
|
||||
"account_number": "8400",
|
||||
"account_type": "Income Account"
|
||||
},
|
||||
"Erlöse USt. 7 %": {
|
||||
"account_number": "8300",
|
||||
"account_type": "Income Account"
|
||||
}
|
||||
},
|
||||
"Ertragskonten 2": {
|
||||
"is_group": 1,
|
||||
"sonstige Zinsen und ähnliche Erträge": {
|
||||
"account_number": "2650",
|
||||
"account_type": "Income Account"
|
||||
},
|
||||
"Außerordentliche Erträge": {
|
||||
"account_number": "2500",
|
||||
"account_type": "Income Account"
|
||||
},
|
||||
"Sonstige Erträge": {
|
||||
"account_number": "2700",
|
||||
"account_type": "Income Account"
|
||||
}
|
||||
}
|
||||
},
|
||||
"Aufwendungen 2/4": {
|
||||
"is_group": 1,
|
||||
"root_type": "Expense",
|
||||
"Fremdleistungen": {
|
||||
"account_number": "3100",
|
||||
"account_type": "Expense Account"
|
||||
},
|
||||
"Fremdleistungen ohne Vorsteuer": {
|
||||
"account_number": "3109",
|
||||
"account_type": "Expense Account"
|
||||
},
|
||||
"Bauleistungen eines im Inland ansässigen Unternehmers 19 % Vorsteuer und 19 % Umsatzsteuer": {
|
||||
"account_number": "3120",
|
||||
"account_type": "Expense Account"
|
||||
},
|
||||
"Wareneingang": {
|
||||
"account_number": "3200"
|
||||
},
|
||||
"Bezugsnebenkosten": {
|
||||
"account_number": "3800",
|
||||
"account_type": "Expenses Included In Asset Valuation"
|
||||
},
|
||||
"Herstellungskosten": {
|
||||
"account_number": "4996",
|
||||
"account_type": "Cost of Goods Sold"
|
||||
},
|
||||
"Verluste aus dem Abgang von Gegenständen des Anlagevermögens": {
|
||||
"account_number": "2320",
|
||||
"account_type": "Stock Adjustment"
|
||||
},
|
||||
"Verwaltungskosten": {
|
||||
"account_number": "4997",
|
||||
"account_type": "Expenses Included In Valuation"
|
||||
},
|
||||
"Vertriebskosten": {
|
||||
"account_number": "4998",
|
||||
"account_type": "Expenses Included In Valuation"
|
||||
},
|
||||
"Gegenkonto 4996-4998": {
|
||||
"account_number": "4999"
|
||||
},
|
||||
"Abschreibungen": {
|
||||
"is_group": 1,
|
||||
"Abschreibungen auf Sachanlagen (ohne AfA auf Kfz und Gebäude)": {
|
||||
"account_number": "4830",
|
||||
"account_type": "Accumulated Depreciation"
|
||||
},
|
||||
"Abschreibungen auf Gebäude": {
|
||||
"account_number": "4831",
|
||||
"account_type": "Depreciation"
|
||||
},
|
||||
"Abschreibungen auf Kfz": {
|
||||
"account_number": "4832",
|
||||
"account_type": "Depreciation"
|
||||
},
|
||||
"Sofortabschreibung GWG": {
|
||||
"account_number": "4855",
|
||||
"account_type": "Expense Account"
|
||||
}
|
||||
},
|
||||
"Kfz-Kosten": {
|
||||
"is_group": 1,
|
||||
"Kfz-Steuer": {
|
||||
"account_number": "4510",
|
||||
"account_type": "Expense Account"
|
||||
},
|
||||
"Kfz-Versicherungen": {
|
||||
"account_number": "4520",
|
||||
"account_type": "Expense Account"
|
||||
},
|
||||
"laufende Kfz-Betriebskosten": {
|
||||
"account_number": "4530",
|
||||
"account_type": "Expense Account"
|
||||
},
|
||||
"Kfz-Reparaturen": {
|
||||
"account_number": "4540",
|
||||
"account_type": "Expense Account"
|
||||
},
|
||||
"Fremdfahrzeuge": {
|
||||
"account_number": "4570",
|
||||
"account_type": "Expense Account"
|
||||
},
|
||||
"sonstige Kfz-Kosten": {
|
||||
"account_number": "4580",
|
||||
"account_type": "Expense Account"
|
||||
}
|
||||
},
|
||||
"Personalkosten": {
|
||||
"is_group": 1,
|
||||
"Gehälter": {
|
||||
"account_number": "4120",
|
||||
"account_type": "Expense Account"
|
||||
},
|
||||
"gesetzliche soziale Aufwendungen": {
|
||||
"account_number": "4130",
|
||||
"account_type": "Expense Account"
|
||||
},
|
||||
"Aufwendungen für Altersvorsorge": {
|
||||
"account_number": "4165",
|
||||
"account_type": "Expense Account"
|
||||
},
|
||||
"Vermögenswirksame Leistungen": {
|
||||
"account_number": "4170",
|
||||
"account_type": "Expense Account"
|
||||
},
|
||||
"Aushilfslöhne": {
|
||||
"account_number": "4190",
|
||||
"account_type": "Expense Account"
|
||||
}
|
||||
},
|
||||
"Raumkosten": {
|
||||
"is_group": 1,
|
||||
"Miete und Nebenkosten": {
|
||||
"account_number": "4210",
|
||||
"account_type": "Expense Account"
|
||||
},
|
||||
"Gas, Wasser, Strom (Verwaltung, Vertrieb)": {
|
||||
"account_number": "4240",
|
||||
"account_type": "Expense Account"
|
||||
},
|
||||
"Reinigung": {
|
||||
"account_number": "4250",
|
||||
"account_type": "Expense Account"
|
||||
}
|
||||
},
|
||||
"Reparatur/Instandhaltung": {
|
||||
"is_group": 1,
|
||||
"Reparaturen und Instandhaltungen von anderen Anlagen und Betriebs- und Geschäftsausstattung": {
|
||||
"account_number": "4805",
|
||||
"account_type": "Expense Account"
|
||||
}
|
||||
},
|
||||
"Versicherungsbeiträge": {
|
||||
"is_group": 1,
|
||||
"Versicherungen": {
|
||||
"account_number": "4360",
|
||||
"account_type": "Expense Account"
|
||||
},
|
||||
"Beiträge": {
|
||||
"account_number": "4380",
|
||||
"account_type": "Expense Account"
|
||||
},
|
||||
"sonstige Ausgaben": {
|
||||
"account_number": "4390",
|
||||
"account_type": "Expense Account"
|
||||
},
|
||||
"steuerlich abzugsfähige Verspätungszuschläge und Zwangsgelder": {
|
||||
"account_number": "4396",
|
||||
"account_type": "Expense Account"
|
||||
}
|
||||
},
|
||||
"Werbe-/Reisekosten": {
|
||||
"is_group": 1,
|
||||
"Werbekosten": {
|
||||
"account_number": "4610",
|
||||
"account_type": "Expense Account"
|
||||
},
|
||||
"Aufmerksamkeiten": {
|
||||
"account_number": "4653",
|
||||
"account_type": "Expense Account"
|
||||
},
|
||||
"nicht abzugsfähige Betriebsausg. aus Werbe-, Repräs.- u. Reisekosten": {
|
||||
"account_number": "4665",
|
||||
"account_type": "Expense Account"
|
||||
},
|
||||
"Reisekosten Unternehmer": {
|
||||
"account_number": "4670",
|
||||
"account_type": "Expense Account"
|
||||
}
|
||||
},
|
||||
"verschiedene Kosten": {
|
||||
"is_group": 1,
|
||||
"Porto": {
|
||||
"account_number": "4910",
|
||||
"account_type": "Expense Account"
|
||||
},
|
||||
"Telekom": {
|
||||
"account_number": "4920",
|
||||
"account_type": "Expense Account"
|
||||
},
|
||||
"Mobilfunk D2": {
|
||||
"account_number": "4921",
|
||||
"account_type": "Expense Account"
|
||||
},
|
||||
"Internet": {
|
||||
"account_number": "4922",
|
||||
"account_type": "Expense Account"
|
||||
},
|
||||
"Bürobedarf": {
|
||||
"account_number": "4930",
|
||||
"account_type": "Expense Account"
|
||||
},
|
||||
"Zeitschriften, Bücher": {
|
||||
"account_number": "4940",
|
||||
"account_type": "Expense Account"
|
||||
},
|
||||
"Fortbildungskosten": {
|
||||
"account_number": "4945",
|
||||
"account_type": "Expense Account"
|
||||
},
|
||||
"Buchführungskosten": {
|
||||
"account_number": "4955",
|
||||
"account_type": "Expense Account"
|
||||
},
|
||||
"Abschluß- u. Prüfungskosten": {
|
||||
"account_number": "4957",
|
||||
"account_type": "Expense Account"
|
||||
},
|
||||
"Nebenkosten des Geldverkehrs": {
|
||||
"account_number": "4970",
|
||||
"account_type": "Expense Account"
|
||||
},
|
||||
"Werkzeuge und Kleingeräte": {
|
||||
"account_number": "4985",
|
||||
"account_type": "Expense Account"
|
||||
}
|
||||
},
|
||||
"Zinsaufwendungen": {
|
||||
"is_group": 1,
|
||||
"Zinsaufwendungen für kurzfristige Verbindlichkeiten": {
|
||||
"account_number": "2110",
|
||||
"account_type": "Expense Account"
|
||||
},
|
||||
"Zinsaufwendungen für KFZ Finanzierung": {
|
||||
"account_number": "2121",
|
||||
"account_type": "Expense Account"
|
||||
}
|
||||
}
|
||||
},
|
||||
"Anfangsbestand 9": {
|
||||
"is_group": 1,
|
||||
"root_type": "Equity",
|
||||
"Saldenvortragskonten": {
|
||||
"is_group": 1,
|
||||
"Saldenvortrag Sachkonten": {
|
||||
"account_number": "9000"
|
||||
},
|
||||
"Saldenvorträge Debitoren": {
|
||||
"account_number": "9008"
|
||||
},
|
||||
"Saldenvorträge Kreditoren": {
|
||||
"account_number": "9009"
|
||||
}
|
||||
}
|
||||
},
|
||||
"Privatkonten 1": {
|
||||
"is_group": 1,
|
||||
"root_type": "Equity",
|
||||
"Privatentnahmen/-einlagen": {
|
||||
"is_group": 1,
|
||||
"Privatentnahme allgemein": {
|
||||
"account_number": "1800"
|
||||
},
|
||||
"Privatsteuern": {
|
||||
"account_number": "1810"
|
||||
},
|
||||
"Sonderausgaben beschränkt abzugsfähig": {
|
||||
"account_number": "1820"
|
||||
},
|
||||
"Sonderausgaben unbeschränkt abzugsfähig": {
|
||||
"account_number": "1830"
|
||||
},
|
||||
"Außergewöhnliche Belastungen": {
|
||||
"account_number": "1850"
|
||||
},
|
||||
"Privateinlagen": {
|
||||
"account_number": "1890"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -1653,4 +1653,8 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
<<<<<<< HEAD
|
||||
}
|
||||
=======
|
||||
}
|
||||
>>>>>>> 329d14957b (fix: validate negative qty)
|
||||
|
||||
@@ -36,6 +36,7 @@
|
||||
}
|
||||
},
|
||||
"Fixed Assets": {
|
||||
<<<<<<< HEAD
|
||||
"Capital Equipments": {
|
||||
"account_type": "Fixed Asset"
|
||||
},
|
||||
@@ -46,6 +47,18 @@
|
||||
"account_type": "Fixed Asset"
|
||||
},
|
||||
"Office Equipments": {
|
||||
=======
|
||||
"Capital Equipment": {
|
||||
"account_type": "Fixed Asset"
|
||||
},
|
||||
"Electronic Equipment": {
|
||||
"account_type": "Fixed Asset"
|
||||
},
|
||||
"Furniture and Fixtures": {
|
||||
"account_type": "Fixed Asset"
|
||||
},
|
||||
"Office Equipment": {
|
||||
>>>>>>> 329d14957b (fix: validate negative qty)
|
||||
"account_type": "Fixed Asset"
|
||||
},
|
||||
"Plants and Machineries": {
|
||||
|
||||
@@ -1,6 +1,10 @@
|
||||
{
|
||||
"country_code": "ni",
|
||||
<<<<<<< HEAD
|
||||
"name": "Nicaragua - Catalogo de Cuentas",
|
||||
=======
|
||||
"name": "Nicaragua - Catálogo de Cuentas",
|
||||
>>>>>>> 329d14957b (fix: validate negative qty)
|
||||
"tree": {
|
||||
"Activo": {
|
||||
"Activo Corriente": {
|
||||
@@ -491,4 +495,8 @@
|
||||
"root_type": "Liability"
|
||||
}
|
||||
}
|
||||
}
|
||||
<<<<<<< HEAD
|
||||
}
|
||||
=======
|
||||
}
|
||||
>>>>>>> 329d14957b (fix: validate negative qty)
|
||||
|
||||
@@ -23,6 +23,7 @@ def get():
|
||||
_("Tax Assets"): {"is_group": 1},
|
||||
},
|
||||
_("Fixed Assets"): {
|
||||
<<<<<<< HEAD
|
||||
_("Capital Equipments"): {"account_type": "Fixed Asset"},
|
||||
_("Electronic Equipments"): {"account_type": "Fixed Asset"},
|
||||
_("Furnitures and Fixtures"): {"account_type": "Fixed Asset"},
|
||||
@@ -30,6 +31,15 @@ def get():
|
||||
_("Plants and Machineries"): {"account_type": "Fixed Asset"},
|
||||
_("Buildings"): {"account_type": "Fixed Asset"},
|
||||
_("Softwares"): {"account_type": "Fixed Asset"},
|
||||
=======
|
||||
_("Capital Equipment"): {"account_type": "Fixed Asset"},
|
||||
_("Electronic Equipment"): {"account_type": "Fixed Asset"},
|
||||
_("Furniture and Fixtures"): {"account_type": "Fixed Asset"},
|
||||
_("Office Equipment"): {"account_type": "Fixed Asset"},
|
||||
_("Plants and Machineries"): {"account_type": "Fixed Asset"},
|
||||
_("Buildings"): {"account_type": "Fixed Asset"},
|
||||
_("Software"): {"account_type": "Fixed Asset"},
|
||||
>>>>>>> 329d14957b (fix: validate negative qty)
|
||||
_("Accumulated Depreciation"): {"account_type": "Accumulated Depreciation"},
|
||||
_("CWIP Account"): {
|
||||
"account_type": "Capital Work in Progress",
|
||||
|
||||
@@ -36,6 +36,7 @@ def get():
|
||||
"account_number": "1100-1600",
|
||||
},
|
||||
_("Fixed Assets"): {
|
||||
<<<<<<< HEAD
|
||||
_("Capital Equipments"): {"account_type": "Fixed Asset", "account_number": "1710"},
|
||||
_("Electronic Equipments"): {"account_type": "Fixed Asset", "account_number": "1720"},
|
||||
_("Furnitures and Fixtures"): {"account_type": "Fixed Asset", "account_number": "1730"},
|
||||
@@ -43,6 +44,15 @@ def get():
|
||||
_("Plants and Machineries"): {"account_type": "Fixed Asset", "account_number": "1750"},
|
||||
_("Buildings"): {"account_type": "Fixed Asset", "account_number": "1760"},
|
||||
_("Softwares"): {"account_type": "Fixed Asset", "account_number": "1770"},
|
||||
=======
|
||||
_("Capital Equipment"): {"account_type": "Fixed Asset", "account_number": "1710"},
|
||||
_("Electronic Equipment"): {"account_type": "Fixed Asset", "account_number": "1720"},
|
||||
_("Furniture and Fixtures"): {"account_type": "Fixed Asset", "account_number": "1730"},
|
||||
_("Office Equipment"): {"account_type": "Fixed Asset", "account_number": "1740"},
|
||||
_("Plants and Machineries"): {"account_type": "Fixed Asset", "account_number": "1750"},
|
||||
_("Buildings"): {"account_type": "Fixed Asset", "account_number": "1760"},
|
||||
_("Software"): {"account_type": "Fixed Asset", "account_number": "1770"},
|
||||
>>>>>>> 329d14957b (fix: validate negative qty)
|
||||
_("Accumulated Depreciation"): {
|
||||
"account_type": "Accumulated Depreciation",
|
||||
"account_number": "1780",
|
||||
|
||||
@@ -1,11 +1,18 @@
|
||||
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
|
||||
# License: GNU General Public License v3. See license.txt
|
||||
<<<<<<< HEAD
|
||||
|
||||
|
||||
import unittest
|
||||
|
||||
import frappe
|
||||
from frappe.test_runner import make_test_records
|
||||
=======
|
||||
import unittest
|
||||
|
||||
import frappe
|
||||
from frappe.tests import IntegrationTestCase
|
||||
>>>>>>> 329d14957b (fix: validate negative qty)
|
||||
from frappe.utils import nowdate
|
||||
|
||||
from erpnext.accounts.doctype.account.account import (
|
||||
@@ -15,10 +22,17 @@ from erpnext.accounts.doctype.account.account import (
|
||||
)
|
||||
from erpnext.stock import get_company_default_inventory_account, get_warehouse_account
|
||||
|
||||
<<<<<<< HEAD
|
||||
test_dependencies = ["Company"]
|
||||
|
||||
|
||||
class TestAccount(unittest.TestCase):
|
||||
=======
|
||||
EXTRA_TEST_RECORD_DEPENDENCIES = ["Company"]
|
||||
|
||||
|
||||
class TestAccount(IntegrationTestCase):
|
||||
>>>>>>> 329d14957b (fix: validate negative qty)
|
||||
def test_rename_account(self):
|
||||
if not frappe.db.exists("Account", "1210 - Debtors - _TC"):
|
||||
acc = frappe.new_doc("Account")
|
||||
@@ -120,7 +134,11 @@ class TestAccount(unittest.TestCase):
|
||||
InvalidAccountMergeError,
|
||||
merge_account,
|
||||
"Capital Stock - _TC",
|
||||
<<<<<<< HEAD
|
||||
"Softwares - _TC",
|
||||
=======
|
||||
"Software - _TC",
|
||||
>>>>>>> 329d14957b (fix: validate negative qty)
|
||||
)
|
||||
|
||||
# Raise error as currency doesn't match
|
||||
@@ -203,8 +221,11 @@ class TestAccount(unittest.TestCase):
|
||||
In a parent->child company setup, child should inherit parent account currency if explicitly specified.
|
||||
"""
|
||||
|
||||
<<<<<<< HEAD
|
||||
make_test_records("Company")
|
||||
|
||||
=======
|
||||
>>>>>>> 329d14957b (fix: validate negative qty)
|
||||
frappe.local.flags.pop("ignore_root_company_validation", None)
|
||||
|
||||
def create_bank_account():
|
||||
@@ -328,7 +349,11 @@ class TestAccount(unittest.TestCase):
|
||||
|
||||
|
||||
def _make_test_records(verbose=None):
|
||||
<<<<<<< HEAD
|
||||
from frappe.test_runner import make_test_objects
|
||||
=======
|
||||
from frappe.tests.utils import make_test_objects
|
||||
>>>>>>> 329d14957b (fix: validate negative qty)
|
||||
|
||||
accounts = [
|
||||
# [account_name, parent_account, is_group]
|
||||
|
||||
3
erpnext/accounts/doctype/account/test_records.toml
Normal file
3
erpnext/accounts/doctype/account/test_records.toml
Normal file
@@ -0,0 +1,3 @@
|
||||
[[Account]]
|
||||
name = "_Test Account 1"
|
||||
|
||||
@@ -129,7 +129,11 @@
|
||||
"icon": "fa fa-list",
|
||||
"in_create": 1,
|
||||
"links": [],
|
||||
<<<<<<< HEAD
|
||||
"modified": "2023-03-06 08:56:36.393237",
|
||||
=======
|
||||
"modified": "2024-03-27 13:05:56.710541",
|
||||
>>>>>>> 329d14957b (fix: validate negative qty)
|
||||
"modified_by": "Administrator",
|
||||
"module": "Accounts",
|
||||
"name": "Account Closing Balance",
|
||||
@@ -158,7 +162,11 @@
|
||||
"role": "Auditor"
|
||||
}
|
||||
],
|
||||
<<<<<<< HEAD
|
||||
"sort_field": "modified",
|
||||
=======
|
||||
"sort_field": "creation",
|
||||
>>>>>>> 329d14957b (fix: validate negative qty)
|
||||
"sort_order": "DESC",
|
||||
"states": []
|
||||
}
|
||||
@@ -2,8 +2,24 @@
|
||||
# See license.txt
|
||||
|
||||
# import frappe
|
||||
<<<<<<< HEAD
|
||||
from frappe.tests.utils import FrappeTestCase
|
||||
|
||||
|
||||
class TestAccountClosingBalance(FrappeTestCase):
|
||||
=======
|
||||
from frappe.tests import IntegrationTestCase, UnitTestCase
|
||||
|
||||
|
||||
class UnitTestAccountClosingBalance(UnitTestCase):
|
||||
"""
|
||||
Unit tests for AccountClosingBalance.
|
||||
Use this class for testing individual functions and methods.
|
||||
"""
|
||||
|
||||
pass
|
||||
|
||||
|
||||
class TestAccountClosingBalance(IntegrationTestCase):
|
||||
>>>>>>> 329d14957b (fix: validate negative qty)
|
||||
pass
|
||||
|
||||
@@ -49,7 +49,11 @@
|
||||
}
|
||||
],
|
||||
"links": [],
|
||||
<<<<<<< HEAD
|
||||
"modified": "2021-02-08 16:37:53.936656",
|
||||
=======
|
||||
"modified": "2024-03-27 13:05:56.890002",
|
||||
>>>>>>> 329d14957b (fix: validate negative qty)
|
||||
"modified_by": "Administrator",
|
||||
"module": "Accounts",
|
||||
"name": "Accounting Dimension",
|
||||
@@ -80,7 +84,13 @@
|
||||
"write": 1
|
||||
}
|
||||
],
|
||||
<<<<<<< HEAD
|
||||
"sort_field": "modified",
|
||||
"sort_order": "ASC",
|
||||
=======
|
||||
"sort_field": "creation",
|
||||
"sort_order": "ASC",
|
||||
"states": [],
|
||||
>>>>>>> 329d14957b (fix: validate negative qty)
|
||||
"track_changes": 1
|
||||
}
|
||||
@@ -1,17 +1,31 @@
|
||||
# Copyright (c) 2019, Frappe Technologies Pvt. Ltd. and Contributors
|
||||
# See license.txt
|
||||
<<<<<<< HEAD
|
||||
|
||||
import unittest
|
||||
|
||||
import frappe
|
||||
=======
|
||||
import unittest
|
||||
|
||||
import frappe
|
||||
from frappe.tests import IntegrationTestCase
|
||||
>>>>>>> 329d14957b (fix: validate negative qty)
|
||||
|
||||
from erpnext.accounts.doctype.journal_entry.test_journal_entry import make_journal_entry
|
||||
from erpnext.accounts.doctype.sales_invoice.test_sales_invoice import create_sales_invoice
|
||||
|
||||
<<<<<<< HEAD
|
||||
test_dependencies = ["Cost Center", "Location", "Warehouse", "Department"]
|
||||
|
||||
|
||||
class TestAccountingDimension(unittest.TestCase):
|
||||
=======
|
||||
EXTRA_TEST_RECORD_DEPENDENCIES = ["Cost Center", "Location", "Warehouse", "Department"]
|
||||
|
||||
|
||||
class TestAccountingDimension(IntegrationTestCase):
|
||||
>>>>>>> 329d14957b (fix: validate negative qty)
|
||||
def setUp(self):
|
||||
create_dimension()
|
||||
|
||||
|
||||
@@ -1,4 +1,8 @@
|
||||
{
|
||||
<<<<<<< HEAD
|
||||
=======
|
||||
"actions": [],
|
||||
>>>>>>> 329d14957b (fix: validate negative qty)
|
||||
"creation": "2019-07-16 17:53:18.718831",
|
||||
"doctype": "DocType",
|
||||
"editable_grid": 1,
|
||||
@@ -73,13 +77,24 @@
|
||||
}
|
||||
],
|
||||
"istable": 1,
|
||||
<<<<<<< HEAD
|
||||
"modified": "2019-08-15 11:59:09.389891",
|
||||
=======
|
||||
"links": [],
|
||||
"modified": "2024-03-27 13:05:57.056874",
|
||||
>>>>>>> 329d14957b (fix: validate negative qty)
|
||||
"modified_by": "Administrator",
|
||||
"module": "Accounts",
|
||||
"name": "Accounting Dimension Detail",
|
||||
"owner": "Administrator",
|
||||
"permissions": [],
|
||||
<<<<<<< HEAD
|
||||
"sort_field": "modified",
|
||||
"sort_order": "DESC",
|
||||
=======
|
||||
"sort_field": "creation",
|
||||
"sort_order": "DESC",
|
||||
"states": [],
|
||||
>>>>>>> 329d14957b (fix: validate negative qty)
|
||||
"track_changes": 1
|
||||
}
|
||||
@@ -94,7 +94,11 @@
|
||||
],
|
||||
"index_web_pages_for_search": 1,
|
||||
"links": [],
|
||||
<<<<<<< HEAD
|
||||
"modified": "2023-06-07 14:59:41.869117",
|
||||
=======
|
||||
"modified": "2024-03-27 13:05:57.199186",
|
||||
>>>>>>> 329d14957b (fix: validate negative qty)
|
||||
"modified_by": "Administrator",
|
||||
"module": "Accounts",
|
||||
"name": "Accounting Dimension Filter",
|
||||
@@ -139,7 +143,11 @@
|
||||
}
|
||||
],
|
||||
"quick_entry": 1,
|
||||
<<<<<<< HEAD
|
||||
"sort_field": "modified",
|
||||
=======
|
||||
"sort_field": "creation",
|
||||
>>>>>>> 329d14957b (fix: validate negative qty)
|
||||
"sort_order": "DESC",
|
||||
"states": [],
|
||||
"track_changes": 1
|
||||
|
||||
@@ -67,7 +67,10 @@ class AccountingDimensionFilter(Document):
|
||||
|
||||
def get_dimension_filter_map():
|
||||
if not frappe.flags.get("dimension_filter_map"):
|
||||
<<<<<<< HEAD
|
||||
# nosemgrep
|
||||
=======
|
||||
>>>>>>> 329d14957b (fix: validate negative qty)
|
||||
filters = frappe.db.sql(
|
||||
"""
|
||||
SELECT
|
||||
|
||||
@@ -12,7 +12,11 @@ from erpnext.accounts.doctype.accounting_dimension.test_accounting_dimension imp
|
||||
from erpnext.accounts.doctype.sales_invoice.test_sales_invoice import create_sales_invoice
|
||||
from erpnext.exceptions import InvalidAccountDimensionError, MandatoryAccountDimensionError
|
||||
|
||||
<<<<<<< HEAD
|
||||
test_dependencies = ["Location", "Cost Center", "Department"]
|
||||
=======
|
||||
EXTRA_TEST_RECORD_DEPENDENCIES = ["Location", "Cost Center", "Department"]
|
||||
>>>>>>> 329d14957b (fix: validate negative qty)
|
||||
|
||||
|
||||
class TestAccountingDimensionFilter(unittest.TestCase):
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
{
|
||||
<<<<<<< HEAD
|
||||
"allow_copy": 0,
|
||||
"allow_guest_to_view": 0,
|
||||
"allow_import": 0,
|
||||
@@ -314,4 +315,116 @@
|
||||
"sort_order": "DESC",
|
||||
"track_changes": 1,
|
||||
"track_seen": 0
|
||||
=======
|
||||
"actions": [],
|
||||
"autoname": "field:period_name",
|
||||
"creation": "2018-04-13 18:50:14.672323",
|
||||
"doctype": "DocType",
|
||||
"editable_grid": 1,
|
||||
"engine": "InnoDB",
|
||||
"field_order": [
|
||||
"period_name",
|
||||
"start_date",
|
||||
"end_date",
|
||||
"column_break_4",
|
||||
"company",
|
||||
"section_break_7",
|
||||
"closed_documents"
|
||||
],
|
||||
"fields": [
|
||||
{
|
||||
"fieldname": "period_name",
|
||||
"fieldtype": "Data",
|
||||
"in_list_view": 1,
|
||||
"label": "Period Name",
|
||||
"reqd": 1,
|
||||
"unique": 1
|
||||
},
|
||||
{
|
||||
"fieldname": "start_date",
|
||||
"fieldtype": "Date",
|
||||
"in_list_view": 1,
|
||||
"label": "Start Date",
|
||||
"reqd": 1
|
||||
},
|
||||
{
|
||||
"fieldname": "end_date",
|
||||
"fieldtype": "Date",
|
||||
"in_list_view": 1,
|
||||
"label": "End Date",
|
||||
"reqd": 1
|
||||
},
|
||||
{
|
||||
"fieldname": "column_break_4",
|
||||
"fieldtype": "Column Break"
|
||||
},
|
||||
{
|
||||
"fieldname": "company",
|
||||
"fieldtype": "Link",
|
||||
"in_list_view": 1,
|
||||
"label": "Company",
|
||||
"options": "Company",
|
||||
"reqd": 1
|
||||
},
|
||||
{
|
||||
"fieldname": "section_break_7",
|
||||
"fieldtype": "Section Break"
|
||||
},
|
||||
{
|
||||
"fieldname": "closed_documents",
|
||||
"fieldtype": "Table",
|
||||
"label": "Closed Documents",
|
||||
"options": "Closed Document",
|
||||
"reqd": 1
|
||||
}
|
||||
],
|
||||
"links": [],
|
||||
"modified": "2024-03-27 13:05:57.388109",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Accounts",
|
||||
"name": "Accounting Period",
|
||||
"owner": "Administrator",
|
||||
"permissions": [
|
||||
{
|
||||
"create": 1,
|
||||
"delete": 1,
|
||||
"email": 1,
|
||||
"export": 1,
|
||||
"print": 1,
|
||||
"read": 1,
|
||||
"report": 1,
|
||||
"role": "System Manager",
|
||||
"share": 1,
|
||||
"write": 1
|
||||
},
|
||||
{
|
||||
"create": 1,
|
||||
"delete": 1,
|
||||
"email": 1,
|
||||
"export": 1,
|
||||
"print": 1,
|
||||
"read": 1,
|
||||
"report": 1,
|
||||
"role": "Accounts Manager",
|
||||
"share": 1,
|
||||
"write": 1
|
||||
},
|
||||
{
|
||||
"create": 1,
|
||||
"delete": 1,
|
||||
"email": 1,
|
||||
"export": 1,
|
||||
"print": 1,
|
||||
"read": 1,
|
||||
"report": 1,
|
||||
"role": "Accounts User",
|
||||
"share": 1,
|
||||
"write": 1
|
||||
}
|
||||
],
|
||||
"sort_field": "creation",
|
||||
"sort_order": "DESC",
|
||||
"states": [],
|
||||
"track_changes": 1
|
||||
>>>>>>> 329d14957b (fix: validate negative qty)
|
||||
}
|
||||
@@ -1,9 +1,16 @@
|
||||
# Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and Contributors
|
||||
# See license.txt
|
||||
<<<<<<< HEAD
|
||||
|
||||
import unittest
|
||||
|
||||
import frappe
|
||||
=======
|
||||
import unittest
|
||||
|
||||
import frappe
|
||||
from frappe.tests import IntegrationTestCase
|
||||
>>>>>>> 329d14957b (fix: validate negative qty)
|
||||
from frappe.utils import add_months, nowdate
|
||||
|
||||
from erpnext.accounts.doctype.accounting_period.accounting_period import (
|
||||
@@ -12,10 +19,17 @@ from erpnext.accounts.doctype.accounting_period.accounting_period import (
|
||||
)
|
||||
from erpnext.accounts.doctype.sales_invoice.test_sales_invoice import create_sales_invoice
|
||||
|
||||
<<<<<<< HEAD
|
||||
test_dependencies = ["Item"]
|
||||
|
||||
|
||||
class TestAccountingPeriod(unittest.TestCase):
|
||||
=======
|
||||
EXTRA_TEST_RECORD_DEPENDENCIES = ["Item"]
|
||||
|
||||
|
||||
class TestAccountingPeriod(IntegrationTestCase):
|
||||
>>>>>>> 329d14957b (fix: validate negative qty)
|
||||
def test_overlap(self):
|
||||
ap1 = create_accounting_period(
|
||||
start_date="2018-04-01", end_date="2018-06-30", company="Wind Power LLC"
|
||||
|
||||
@@ -521,7 +521,11 @@
|
||||
}
|
||||
],
|
||||
"quick_entry": 1,
|
||||
<<<<<<< HEAD
|
||||
"sort_field": "modified",
|
||||
=======
|
||||
"sort_field": "creation",
|
||||
>>>>>>> 329d14957b (fix: validate negative qty)
|
||||
"sort_order": "ASC",
|
||||
"states": [],
|
||||
"track_changes": 1
|
||||
|
||||
@@ -1,9 +1,16 @@
|
||||
import unittest
|
||||
|
||||
import frappe
|
||||
<<<<<<< HEAD
|
||||
|
||||
|
||||
class TestAccountsSettings(unittest.TestCase):
|
||||
=======
|
||||
from frappe.tests import IntegrationTestCase
|
||||
|
||||
|
||||
class TestAccountsSettings(IntegrationTestCase):
|
||||
>>>>>>> 329d14957b (fix: validate negative qty)
|
||||
def tearDown(self):
|
||||
# Just in case `save` method succeeds, we need to take things back to default so that other tests
|
||||
# don't break
|
||||
|
||||
@@ -2,7 +2,11 @@
|
||||
# See license.txt
|
||||
|
||||
import frappe
|
||||
<<<<<<< HEAD
|
||||
from frappe.tests.utils import FrappeTestCase
|
||||
=======
|
||||
from frappe.tests import IntegrationTestCase, UnitTestCase
|
||||
>>>>>>> 329d14957b (fix: validate negative qty)
|
||||
from frappe.utils import nowdate, today
|
||||
|
||||
from erpnext.accounts.doctype.payment_entry.test_payment_entry import get_payment_entry
|
||||
@@ -10,8 +14,19 @@ from erpnext.accounts.test.accounts_mixin import AccountsTestMixin
|
||||
from erpnext.buying.doctype.purchase_order.test_purchase_order import create_purchase_order
|
||||
from erpnext.selling.doctype.sales_order.test_sales_order import make_sales_order
|
||||
|
||||
<<<<<<< HEAD
|
||||
|
||||
class TestAdvancePaymentLedgerEntry(AccountsTestMixin, FrappeTestCase):
|
||||
=======
|
||||
# On IntegrationTestCase, the doctype test records and all
|
||||
# link-field test record depdendencies are recursively loaded
|
||||
# Use these module variables to add/remove to/from that list
|
||||
EXTRA_TEST_RECORD_DEPENDENCIES = [] # eg. ["User"]
|
||||
IGNORE_TEST_RECORD_DEPENDENCIES = [] # eg. ["User"]
|
||||
|
||||
|
||||
class TestAdvancePaymentLedgerEntry(AccountsTestMixin, IntegrationTestCase):
|
||||
>>>>>>> 329d14957b (fix: validate negative qty)
|
||||
"""
|
||||
Integration tests for AdvancePaymentLedgerEntry.
|
||||
Use this class for testing interactions between multiple components.
|
||||
|
||||
@@ -45,12 +45,22 @@
|
||||
"index_web_pages_for_search": 1,
|
||||
"istable": 1,
|
||||
"links": [],
|
||||
<<<<<<< HEAD
|
||||
"modified": "2021-11-25 10:27:51.712286",
|
||||
=======
|
||||
"modified": "2024-03-27 13:05:58.308002",
|
||||
>>>>>>> 329d14957b (fix: validate negative qty)
|
||||
"modified_by": "Administrator",
|
||||
"module": "Accounts",
|
||||
"name": "Advance Tax",
|
||||
"owner": "Administrator",
|
||||
"permissions": [],
|
||||
<<<<<<< HEAD
|
||||
"sort_field": "modified",
|
||||
"sort_order": "DESC"
|
||||
=======
|
||||
"sort_field": "creation",
|
||||
"sort_order": "DESC",
|
||||
"states": []
|
||||
>>>>>>> 329d14957b (fix: validate negative qty)
|
||||
}
|
||||
@@ -13,6 +13,10 @@
|
||||
"col_break_1",
|
||||
"description",
|
||||
"included_in_paid_amount",
|
||||
<<<<<<< HEAD
|
||||
=======
|
||||
"set_by_item_tax_template",
|
||||
>>>>>>> 329d14957b (fix: validate negative qty)
|
||||
"accounting_dimensions_section",
|
||||
"cost_center",
|
||||
"dimension_col_break",
|
||||
@@ -20,11 +24,19 @@
|
||||
"rate",
|
||||
"section_break_9",
|
||||
"currency",
|
||||
<<<<<<< HEAD
|
||||
=======
|
||||
"net_amount",
|
||||
>>>>>>> 329d14957b (fix: validate negative qty)
|
||||
"tax_amount",
|
||||
"total",
|
||||
"allocated_amount",
|
||||
"column_break_13",
|
||||
"base_tax_amount",
|
||||
<<<<<<< HEAD
|
||||
=======
|
||||
"base_net_amount",
|
||||
>>>>>>> 329d14957b (fix: validate negative qty)
|
||||
"base_total"
|
||||
],
|
||||
"fields": [
|
||||
@@ -174,17 +186,58 @@
|
||||
"label": "Account Currency",
|
||||
"options": "Currency",
|
||||
"read_only": 1
|
||||
<<<<<<< HEAD
|
||||
=======
|
||||
},
|
||||
{
|
||||
"columns": 2,
|
||||
"fieldname": "net_amount",
|
||||
"fieldtype": "Currency",
|
||||
"in_list_view": 1,
|
||||
"label": "Net Amount",
|
||||
"options": "currency",
|
||||
"read_only": 1
|
||||
},
|
||||
{
|
||||
"fieldname": "base_net_amount",
|
||||
"fieldtype": "Currency",
|
||||
"label": "Net Amount (Company Currency)",
|
||||
"oldfieldname": "tax_amount",
|
||||
"oldfieldtype": "Currency",
|
||||
"options": "Company:company:default_currency",
|
||||
"read_only": 1
|
||||
},
|
||||
{
|
||||
"default": "0",
|
||||
"fieldname": "set_by_item_tax_template",
|
||||
"fieldtype": "Check",
|
||||
"hidden": 1,
|
||||
"label": "Set by Item Tax Template",
|
||||
"print_hide": 1,
|
||||
"read_only": 1,
|
||||
"report_hide": 1
|
||||
>>>>>>> 329d14957b (fix: validate negative qty)
|
||||
}
|
||||
],
|
||||
"index_web_pages_for_search": 1,
|
||||
"istable": 1,
|
||||
"links": [],
|
||||
<<<<<<< HEAD
|
||||
"modified": "2021-11-25 11:10:10.945027",
|
||||
=======
|
||||
"modified": "2024-11-22 19:16:22.346267",
|
||||
>>>>>>> 329d14957b (fix: validate negative qty)
|
||||
"modified_by": "Administrator",
|
||||
"module": "Accounts",
|
||||
"name": "Advance Taxes and Charges",
|
||||
"owner": "Administrator",
|
||||
"permissions": [],
|
||||
<<<<<<< HEAD
|
||||
"sort_field": "modified",
|
||||
"sort_order": "ASC"
|
||||
=======
|
||||
"sort_field": "creation",
|
||||
"sort_order": "ASC",
|
||||
"states": []
|
||||
>>>>>>> 329d14957b (fix: validate negative qty)
|
||||
}
|
||||
@@ -18,6 +18,10 @@ class AdvanceTaxesandCharges(Document):
|
||||
account_head: DF.Link
|
||||
add_deduct_tax: DF.Literal["Add", "Deduct"]
|
||||
allocated_amount: DF.Currency
|
||||
<<<<<<< HEAD
|
||||
=======
|
||||
base_net_amount: DF.Currency
|
||||
>>>>>>> 329d14957b (fix: validate negative qty)
|
||||
base_tax_amount: DF.Currency
|
||||
base_total: DF.Currency
|
||||
charge_type: DF.Literal[
|
||||
@@ -27,11 +31,19 @@ class AdvanceTaxesandCharges(Document):
|
||||
currency: DF.Link | None
|
||||
description: DF.SmallText
|
||||
included_in_paid_amount: DF.Check
|
||||
<<<<<<< HEAD
|
||||
=======
|
||||
net_amount: DF.Currency
|
||||
>>>>>>> 329d14957b (fix: validate negative qty)
|
||||
parent: DF.Data
|
||||
parentfield: DF.Data
|
||||
parenttype: DF.Data
|
||||
rate: DF.Float
|
||||
row_id: DF.Data | None
|
||||
<<<<<<< HEAD
|
||||
=======
|
||||
set_by_item_tax_template: DF.Check
|
||||
>>>>>>> 329d14957b (fix: validate negative qty)
|
||||
tax_amount: DF.Currency
|
||||
total: DF.Currency
|
||||
# end: auto-generated types
|
||||
|
||||
@@ -14,30 +14,48 @@
|
||||
"fieldtype": "Link",
|
||||
"label": "Accounting Dimension",
|
||||
"options": "DocType",
|
||||
<<<<<<< HEAD
|
||||
"read_only": 1,
|
||||
"show_days": 1,
|
||||
"show_seconds": 1
|
||||
=======
|
||||
"read_only": 1
|
||||
>>>>>>> 329d14957b (fix: validate negative qty)
|
||||
},
|
||||
{
|
||||
"fieldname": "dimension_value",
|
||||
"fieldtype": "Dynamic Link",
|
||||
"in_list_view": 1,
|
||||
<<<<<<< HEAD
|
||||
"options": "accounting_dimension",
|
||||
"show_days": 1,
|
||||
"show_seconds": 1
|
||||
=======
|
||||
"options": "accounting_dimension"
|
||||
>>>>>>> 329d14957b (fix: validate negative qty)
|
||||
}
|
||||
],
|
||||
"index_web_pages_for_search": 1,
|
||||
"istable": 1,
|
||||
"links": [],
|
||||
<<<<<<< HEAD
|
||||
"modified": "2020-11-23 09:56:19.744200",
|
||||
=======
|
||||
"modified": "2024-03-27 13:05:58.587487",
|
||||
>>>>>>> 329d14957b (fix: validate negative qty)
|
||||
"modified_by": "Administrator",
|
||||
"module": "Accounts",
|
||||
"name": "Allowed Dimension",
|
||||
"owner": "Administrator",
|
||||
"permissions": [],
|
||||
"quick_entry": 1,
|
||||
<<<<<<< HEAD
|
||||
"sort_field": "modified",
|
||||
"sort_order": "DESC",
|
||||
=======
|
||||
"sort_field": "creation",
|
||||
"sort_order": "DESC",
|
||||
"states": [],
|
||||
>>>>>>> 329d14957b (fix: validate negative qty)
|
||||
"track_changes": 1
|
||||
}
|
||||
@@ -20,14 +20,22 @@
|
||||
],
|
||||
"istable": 1,
|
||||
"links": [],
|
||||
<<<<<<< HEAD
|
||||
"modified": "2024-01-03 11:13:02.669632",
|
||||
=======
|
||||
"modified": "2024-03-27 13:05:58.698893",
|
||||
>>>>>>> 329d14957b (fix: validate negative qty)
|
||||
"modified_by": "Administrator",
|
||||
"module": "Accounts",
|
||||
"name": "Allowed To Transact With",
|
||||
"owner": "Administrator",
|
||||
"permissions": [],
|
||||
"quick_entry": 1,
|
||||
<<<<<<< HEAD
|
||||
"sort_field": "modified",
|
||||
=======
|
||||
"sort_field": "creation",
|
||||
>>>>>>> 329d14957b (fix: validate negative qty)
|
||||
"sort_order": "DESC",
|
||||
"states": [],
|
||||
"track_changes": 1
|
||||
|
||||
@@ -15,9 +15,13 @@
|
||||
"in_list_view": 1,
|
||||
"label": "Accounts",
|
||||
"options": "Account",
|
||||
<<<<<<< HEAD
|
||||
"reqd": 1,
|
||||
"show_days": 1,
|
||||
"show_seconds": 1
|
||||
=======
|
||||
"reqd": 1
|
||||
>>>>>>> 329d14957b (fix: validate negative qty)
|
||||
},
|
||||
{
|
||||
"columns": 2,
|
||||
@@ -25,22 +29,36 @@
|
||||
"fieldname": "is_mandatory",
|
||||
"fieldtype": "Check",
|
||||
"in_list_view": 1,
|
||||
<<<<<<< HEAD
|
||||
"label": "Is Mandatory",
|
||||
"show_days": 1,
|
||||
"show_seconds": 1
|
||||
=======
|
||||
"label": "Is Mandatory"
|
||||
>>>>>>> 329d14957b (fix: validate negative qty)
|
||||
}
|
||||
],
|
||||
"index_web_pages_for_search": 1,
|
||||
"istable": 1,
|
||||
"links": [],
|
||||
<<<<<<< HEAD
|
||||
"modified": "2020-11-22 19:55:13.324136",
|
||||
=======
|
||||
"modified": "2024-03-27 13:05:59.168897",
|
||||
>>>>>>> 329d14957b (fix: validate negative qty)
|
||||
"modified_by": "Administrator",
|
||||
"module": "Accounts",
|
||||
"name": "Applicable On Account",
|
||||
"owner": "Administrator",
|
||||
"permissions": [],
|
||||
"quick_entry": 1,
|
||||
<<<<<<< HEAD
|
||||
"sort_field": "modified",
|
||||
"sort_order": "DESC",
|
||||
=======
|
||||
"sort_field": "creation",
|
||||
"sort_order": "DESC",
|
||||
"states": [],
|
||||
>>>>>>> 329d14957b (fix: validate negative qty)
|
||||
"track_changes": 1
|
||||
}
|
||||
@@ -101,7 +101,11 @@
|
||||
}
|
||||
],
|
||||
"links": [],
|
||||
<<<<<<< HEAD
|
||||
"modified": "2020-07-17 14:00:13.105433",
|
||||
=======
|
||||
"modified": "2024-03-27 13:06:36.896195",
|
||||
>>>>>>> 329d14957b (fix: validate negative qty)
|
||||
"modified_by": "Administrator",
|
||||
"module": "Accounts",
|
||||
"name": "Bank",
|
||||
@@ -121,7 +125,13 @@
|
||||
}
|
||||
],
|
||||
"quick_entry": 1,
|
||||
<<<<<<< HEAD
|
||||
"sort_field": "modified",
|
||||
"sort_order": "DESC",
|
||||
=======
|
||||
"sort_field": "creation",
|
||||
"sort_order": "DESC",
|
||||
"states": [],
|
||||
>>>>>>> 329d14957b (fix: validate negative qty)
|
||||
"track_changes": 1
|
||||
}
|
||||
@@ -1,8 +1,17 @@
|
||||
# Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and Contributors
|
||||
# See license.txt
|
||||
<<<<<<< HEAD
|
||||
|
||||
import unittest
|
||||
|
||||
|
||||
class TestBank(unittest.TestCase):
|
||||
=======
|
||||
import unittest
|
||||
|
||||
from frappe.tests import IntegrationTestCase
|
||||
|
||||
|
||||
class TestBank(IntegrationTestCase):
|
||||
>>>>>>> 329d14957b (fix: validate negative qty)
|
||||
pass
|
||||
|
||||
@@ -283,8 +283,16 @@
|
||||
}
|
||||
],
|
||||
"search_fields": "bank,account",
|
||||
<<<<<<< HEAD
|
||||
"sort_field": "modified",
|
||||
"sort_order": "DESC",
|
||||
"states": [],
|
||||
"track_changes": 1
|
||||
}
|
||||
=======
|
||||
"sort_field": "creation",
|
||||
"sort_order": "DESC",
|
||||
"states": [],
|
||||
"track_changes": 1
|
||||
}
|
||||
>>>>>>> 329d14957b (fix: validate negative qty)
|
||||
|
||||
@@ -70,7 +70,11 @@ class BankAccount(Document):
|
||||
|
||||
def validate_company(self):
|
||||
if self.is_company_account and not self.company:
|
||||
<<<<<<< HEAD
|
||||
frappe.throw(_("Company is manadatory for company account"))
|
||||
=======
|
||||
frappe.throw(_("Company is mandatory for company account"))
|
||||
>>>>>>> 329d14957b (fix: validate negative qty)
|
||||
|
||||
def validate_iban(self):
|
||||
"""
|
||||
|
||||
@@ -1,15 +1,25 @@
|
||||
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
|
||||
# See license.txt
|
||||
<<<<<<< HEAD
|
||||
|
||||
=======
|
||||
>>>>>>> 329d14957b (fix: validate negative qty)
|
||||
import unittest
|
||||
|
||||
import frappe
|
||||
from frappe import ValidationError
|
||||
<<<<<<< HEAD
|
||||
|
||||
# test_records = frappe.get_test_records('Bank Account')
|
||||
|
||||
|
||||
class TestBankAccount(unittest.TestCase):
|
||||
=======
|
||||
from frappe.tests import IntegrationTestCase
|
||||
|
||||
|
||||
class TestBankAccount(IntegrationTestCase):
|
||||
>>>>>>> 329d14957b (fix: validate negative qty)
|
||||
def test_validate_iban(self):
|
||||
valid_ibans = [
|
||||
"GB82 WEST 1234 5698 7654 32",
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
{
|
||||
<<<<<<< HEAD
|
||||
"allow_copy": 0,
|
||||
"allow_events_in_timeline": 0,
|
||||
"allow_guest_to_view": 0,
|
||||
@@ -67,17 +68,50 @@
|
||||
{
|
||||
"amend": 0,
|
||||
"cancel": 0,
|
||||
=======
|
||||
"actions": [],
|
||||
"allow_import": 1,
|
||||
"allow_rename": 1,
|
||||
"autoname": "field:account_subtype",
|
||||
"creation": "2018-10-25 15:46:08.054586",
|
||||
"doctype": "DocType",
|
||||
"editable_grid": 1,
|
||||
"engine": "InnoDB",
|
||||
"field_order": [
|
||||
"account_subtype"
|
||||
],
|
||||
"fields": [
|
||||
{
|
||||
"fieldname": "account_subtype",
|
||||
"fieldtype": "Data",
|
||||
"label": "Account Subtype",
|
||||
"unique": 1
|
||||
}
|
||||
],
|
||||
"links": [],
|
||||
"modified": "2024-03-27 13:06:37.221876",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Accounts",
|
||||
"name": "Bank Account Subtype",
|
||||
"owner": "Administrator",
|
||||
"permissions": [
|
||||
{
|
||||
>>>>>>> 329d14957b (fix: validate negative qty)
|
||||
"create": 1,
|
||||
"delete": 1,
|
||||
"email": 1,
|
||||
"export": 1,
|
||||
<<<<<<< HEAD
|
||||
"if_owner": 0,
|
||||
"import": 0,
|
||||
"permlevel": 0,
|
||||
=======
|
||||
>>>>>>> 329d14957b (fix: validate negative qty)
|
||||
"print": 1,
|
||||
"read": 1,
|
||||
"report": 1,
|
||||
"role": "System Manager",
|
||||
<<<<<<< HEAD
|
||||
"set_user_permissions": 0,
|
||||
"share": 1,
|
||||
"submit": 0,
|
||||
@@ -86,17 +120,27 @@
|
||||
{
|
||||
"amend": 0,
|
||||
"cancel": 0,
|
||||
=======
|
||||
"share": 1,
|
||||
"write": 1
|
||||
},
|
||||
{
|
||||
>>>>>>> 329d14957b (fix: validate negative qty)
|
||||
"create": 1,
|
||||
"delete": 1,
|
||||
"email": 1,
|
||||
"export": 1,
|
||||
<<<<<<< HEAD
|
||||
"if_owner": 0,
|
||||
"import": 0,
|
||||
"permlevel": 0,
|
||||
=======
|
||||
>>>>>>> 329d14957b (fix: validate negative qty)
|
||||
"print": 1,
|
||||
"read": 1,
|
||||
"report": 1,
|
||||
"role": "Accounts Manager",
|
||||
<<<<<<< HEAD
|
||||
"set_user_permissions": 0,
|
||||
"share": 1,
|
||||
"submit": 0,
|
||||
@@ -105,24 +149,38 @@
|
||||
{
|
||||
"amend": 0,
|
||||
"cancel": 0,
|
||||
=======
|
||||
"share": 1,
|
||||
"write": 1
|
||||
},
|
||||
{
|
||||
>>>>>>> 329d14957b (fix: validate negative qty)
|
||||
"create": 1,
|
||||
"delete": 1,
|
||||
"email": 1,
|
||||
"export": 1,
|
||||
<<<<<<< HEAD
|
||||
"if_owner": 0,
|
||||
"import": 0,
|
||||
"permlevel": 0,
|
||||
=======
|
||||
>>>>>>> 329d14957b (fix: validate negative qty)
|
||||
"print": 1,
|
||||
"read": 1,
|
||||
"report": 1,
|
||||
"role": "Accounts User",
|
||||
<<<<<<< HEAD
|
||||
"set_user_permissions": 0,
|
||||
"share": 1,
|
||||
"submit": 0,
|
||||
=======
|
||||
"share": 1,
|
||||
>>>>>>> 329d14957b (fix: validate negative qty)
|
||||
"write": 1
|
||||
}
|
||||
],
|
||||
"quick_entry": 1,
|
||||
<<<<<<< HEAD
|
||||
"read_only": 0,
|
||||
"read_only_onload": 0,
|
||||
"show_name_in_global_search": 0,
|
||||
@@ -131,4 +189,9 @@
|
||||
"track_changes": 0,
|
||||
"track_seen": 0,
|
||||
"track_views": 0
|
||||
=======
|
||||
"sort_field": "creation",
|
||||
"sort_order": "DESC",
|
||||
"states": []
|
||||
>>>>>>> 329d14957b (fix: validate negative qty)
|
||||
}
|
||||
@@ -1,8 +1,17 @@
|
||||
# Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and Contributors
|
||||
# See license.txt
|
||||
<<<<<<< HEAD
|
||||
|
||||
import unittest
|
||||
|
||||
|
||||
class TestBankAccountSubtype(unittest.TestCase):
|
||||
=======
|
||||
import unittest
|
||||
|
||||
from frappe.tests import IntegrationTestCase
|
||||
|
||||
|
||||
class TestBankAccountSubtype(IntegrationTestCase):
|
||||
>>>>>>> 329d14957b (fix: validate negative qty)
|
||||
pass
|
||||
|
||||
@@ -19,7 +19,11 @@
|
||||
}
|
||||
],
|
||||
"links": [],
|
||||
<<<<<<< HEAD
|
||||
"modified": "2020-04-10 21:13:09.137898",
|
||||
=======
|
||||
"modified": "2024-03-27 13:06:37.347035",
|
||||
>>>>>>> 329d14957b (fix: validate negative qty)
|
||||
"modified_by": "Administrator",
|
||||
"module": "Accounts",
|
||||
"name": "Bank Account Type",
|
||||
@@ -63,6 +67,12 @@
|
||||
}
|
||||
],
|
||||
"quick_entry": 1,
|
||||
<<<<<<< HEAD
|
||||
"sort_field": "modified",
|
||||
"sort_order": "DESC"
|
||||
=======
|
||||
"sort_field": "creation",
|
||||
"sort_order": "DESC",
|
||||
"states": []
|
||||
>>>>>>> 329d14957b (fix: validate negative qty)
|
||||
}
|
||||
@@ -1,9 +1,19 @@
|
||||
# Copyright (c) 2020, Frappe Technologies Pvt. Ltd. and Contributors
|
||||
# See license.txt
|
||||
<<<<<<< HEAD
|
||||
|
||||
# import frappe
|
||||
import unittest
|
||||
|
||||
|
||||
class TestBankAccountType(unittest.TestCase):
|
||||
=======
|
||||
# import frappe
|
||||
import unittest
|
||||
|
||||
from frappe.tests import IntegrationTestCase
|
||||
|
||||
|
||||
class TestBankAccountType(IntegrationTestCase):
|
||||
>>>>>>> 329d14957b (fix: validate negative qty)
|
||||
pass
|
||||
|
||||
@@ -91,7 +91,11 @@
|
||||
"idx": 1,
|
||||
"issingle": 1,
|
||||
"links": [],
|
||||
<<<<<<< HEAD
|
||||
"modified": "2022-11-28 17:24:13.008692",
|
||||
=======
|
||||
"modified": "2024-03-27 13:06:37.477927",
|
||||
>>>>>>> 329d14957b (fix: validate negative qty)
|
||||
"modified_by": "Administrator",
|
||||
"module": "Accounts",
|
||||
"name": "Bank Clearance",
|
||||
@@ -107,7 +111,11 @@
|
||||
],
|
||||
"quick_entry": 1,
|
||||
"read_only": 1,
|
||||
<<<<<<< HEAD
|
||||
"sort_field": "modified",
|
||||
=======
|
||||
"sort_field": "creation",
|
||||
>>>>>>> 329d14957b (fix: validate negative qty)
|
||||
"sort_order": "ASC",
|
||||
"states": []
|
||||
}
|
||||
@@ -1,9 +1,16 @@
|
||||
# Copyright (c) 2020, Frappe Technologies Pvt. Ltd. and Contributors
|
||||
# See license.txt
|
||||
<<<<<<< HEAD
|
||||
|
||||
import unittest
|
||||
|
||||
import frappe
|
||||
=======
|
||||
import unittest
|
||||
|
||||
import frappe
|
||||
from frappe.tests import IntegrationTestCase
|
||||
>>>>>>> 329d14957b (fix: validate negative qty)
|
||||
from frappe.utils import add_months, getdate
|
||||
|
||||
from erpnext.accounts.doctype.cost_center.test_cost_center import create_cost_center
|
||||
@@ -15,9 +22,16 @@ from erpnext.stock.doctype.warehouse.test_warehouse import create_warehouse
|
||||
from erpnext.tests.utils import if_lending_app_installed, if_lending_app_not_installed
|
||||
|
||||
|
||||
<<<<<<< HEAD
|
||||
class TestBankClearance(unittest.TestCase):
|
||||
@classmethod
|
||||
def setUpClass(cls):
|
||||
=======
|
||||
class TestBankClearance(IntegrationTestCase):
|
||||
@classmethod
|
||||
def setUpClass(cls):
|
||||
super().setUpClass()
|
||||
>>>>>>> 329d14957b (fix: validate negative qty)
|
||||
create_warehouse(
|
||||
warehouse_name="_Test Warehouse",
|
||||
properties={"parent_warehouse": "All Warehouses - _TC"},
|
||||
@@ -26,9 +40,12 @@ class TestBankClearance(unittest.TestCase):
|
||||
create_item("_Test Item")
|
||||
create_cost_center(cost_center_name="_Test Cost Center", company="_Test Company")
|
||||
|
||||
<<<<<<< HEAD
|
||||
clear_payment_entries()
|
||||
clear_loan_transactions()
|
||||
clear_pos_sales_invoices()
|
||||
=======
|
||||
>>>>>>> 329d14957b (fix: validate negative qty)
|
||||
make_bank_account()
|
||||
add_transactions()
|
||||
|
||||
@@ -123,6 +140,7 @@ class TestBankClearance(unittest.TestCase):
|
||||
self.assertEqual(si_clearance_date, date)
|
||||
|
||||
|
||||
<<<<<<< HEAD
|
||||
def clear_payment_entries():
|
||||
frappe.db.delete("Payment Entry")
|
||||
|
||||
@@ -140,6 +158,8 @@ def clear_loan_transactions():
|
||||
frappe.db.delete(dt)
|
||||
|
||||
|
||||
=======
|
||||
>>>>>>> 329d14957b (fix: validate negative qty)
|
||||
def make_bank_account():
|
||||
if not frappe.db.get_value("Account", "_Test Bank Clearance - _TC"):
|
||||
frappe.get_doc(
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
{
|
||||
<<<<<<< HEAD
|
||||
"allow_copy": 0,
|
||||
"allow_events_in_timeline": 0,
|
||||
"allow_guest_to_view": 0,
|
||||
@@ -337,4 +338,116 @@
|
||||
"track_changes": 0,
|
||||
"track_seen": 0,
|
||||
"track_views": 0
|
||||
=======
|
||||
"actions": [],
|
||||
"creation": "2013-02-22 01:27:37",
|
||||
"doctype": "DocType",
|
||||
"editable_grid": 1,
|
||||
"engine": "InnoDB",
|
||||
"field_order": [
|
||||
"payment_document",
|
||||
"payment_entry",
|
||||
"against_account",
|
||||
"amount",
|
||||
"column_break_5",
|
||||
"posting_date",
|
||||
"cheque_number",
|
||||
"cheque_date",
|
||||
"clearance_date"
|
||||
],
|
||||
"fields": [
|
||||
{
|
||||
"fieldname": "payment_document",
|
||||
"fieldtype": "Link",
|
||||
"label": "Payment Document",
|
||||
"options": "DocType"
|
||||
},
|
||||
{
|
||||
"columns": 2,
|
||||
"fieldname": "payment_entry",
|
||||
"fieldtype": "Dynamic Link",
|
||||
"in_list_view": 1,
|
||||
"label": "Payment Entry",
|
||||
"oldfieldname": "voucher_id",
|
||||
"oldfieldtype": "Link",
|
||||
"options": "payment_document",
|
||||
"width": "50"
|
||||
},
|
||||
{
|
||||
"columns": 2,
|
||||
"fieldname": "against_account",
|
||||
"fieldtype": "Data",
|
||||
"in_list_view": 1,
|
||||
"label": "Against Account",
|
||||
"oldfieldname": "against_account",
|
||||
"oldfieldtype": "Data",
|
||||
"read_only": 1,
|
||||
"width": "15"
|
||||
},
|
||||
{
|
||||
"columns": 2,
|
||||
"fieldname": "amount",
|
||||
"fieldtype": "Data",
|
||||
"in_list_view": 1,
|
||||
"label": "Amount",
|
||||
"oldfieldname": "debit",
|
||||
"oldfieldtype": "Currency",
|
||||
"read_only": 1
|
||||
},
|
||||
{
|
||||
"fieldname": "column_break_5",
|
||||
"fieldtype": "Column Break",
|
||||
"width": "50%"
|
||||
},
|
||||
{
|
||||
"columns": 2,
|
||||
"fieldname": "posting_date",
|
||||
"fieldtype": "Date",
|
||||
"label": "Posting Date",
|
||||
"oldfieldname": "posting_date",
|
||||
"oldfieldtype": "Date",
|
||||
"read_only": 1
|
||||
},
|
||||
{
|
||||
"columns": 2,
|
||||
"fieldname": "cheque_number",
|
||||
"fieldtype": "Data",
|
||||
"in_list_view": 1,
|
||||
"label": "Cheque Number",
|
||||
"oldfieldname": "cheque_number",
|
||||
"oldfieldtype": "Data",
|
||||
"read_only": 1
|
||||
},
|
||||
{
|
||||
"fieldname": "cheque_date",
|
||||
"fieldtype": "Date",
|
||||
"label": "Cheque Date",
|
||||
"oldfieldname": "cheque_date",
|
||||
"oldfieldtype": "Date",
|
||||
"read_only": 1
|
||||
},
|
||||
{
|
||||
"columns": 2,
|
||||
"fieldname": "clearance_date",
|
||||
"fieldtype": "Date",
|
||||
"in_list_view": 1,
|
||||
"label": "Clearance Date",
|
||||
"oldfieldname": "clearance_date",
|
||||
"oldfieldtype": "Date"
|
||||
}
|
||||
],
|
||||
"idx": 1,
|
||||
"istable": 1,
|
||||
"links": [],
|
||||
"modified": "2024-03-27 13:06:37.609319",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Accounts",
|
||||
"name": "Bank Clearance Detail",
|
||||
"owner": "Administrator",
|
||||
"permissions": [],
|
||||
"quick_entry": 1,
|
||||
"sort_field": "creation",
|
||||
"sort_order": "ASC",
|
||||
"states": []
|
||||
>>>>>>> 329d14957b (fix: validate negative qty)
|
||||
}
|
||||
@@ -1,4 +1,5 @@
|
||||
{
|
||||
<<<<<<< HEAD
|
||||
"allow_copy": 0,
|
||||
"allow_guest_to_view": 0,
|
||||
"allow_import": 0,
|
||||
@@ -1053,4 +1054,262 @@
|
||||
"track_changes": 0,
|
||||
"track_seen": 0,
|
||||
"track_views": 0
|
||||
=======
|
||||
"actions": [],
|
||||
"autoname": "ACC-BG-.YYYY.-.#####",
|
||||
"creation": "2016-12-17 10:43:35.731631",
|
||||
"doctype": "DocType",
|
||||
"document_type": "Document",
|
||||
"editable_grid": 1,
|
||||
"engine": "InnoDB",
|
||||
"field_order": [
|
||||
"bg_type",
|
||||
"reference_doctype",
|
||||
"reference_docname",
|
||||
"customer",
|
||||
"supplier",
|
||||
"project",
|
||||
"column_break_6",
|
||||
"amount",
|
||||
"start_date",
|
||||
"validity",
|
||||
"end_date",
|
||||
"bank_account_info",
|
||||
"bank",
|
||||
"bank_account",
|
||||
"account",
|
||||
"bank_account_no",
|
||||
"column_break_17",
|
||||
"iban",
|
||||
"branch_code",
|
||||
"swift_number",
|
||||
"section_break_14",
|
||||
"more_information",
|
||||
"margin_details",
|
||||
"bank_guarantee_number",
|
||||
"name_of_beneficiary",
|
||||
"column_break_19",
|
||||
"margin_money",
|
||||
"charges",
|
||||
"fixed_deposit_number",
|
||||
"amended_from"
|
||||
],
|
||||
"fields": [
|
||||
{
|
||||
"fieldname": "bg_type",
|
||||
"fieldtype": "Select",
|
||||
"label": "Bank Guarantee Type",
|
||||
"options": "\nReceiving\nProviding",
|
||||
"reqd": 1
|
||||
},
|
||||
{
|
||||
"fieldname": "reference_doctype",
|
||||
"fieldtype": "Link",
|
||||
"label": "Reference Document Type",
|
||||
"options": "DocType",
|
||||
"read_only": 1
|
||||
},
|
||||
{
|
||||
"fieldname": "reference_docname",
|
||||
"fieldtype": "Dynamic Link",
|
||||
"label": "Reference Document Name",
|
||||
"options": "reference_doctype"
|
||||
},
|
||||
{
|
||||
"depends_on": "eval: doc.bg_type == \"Receiving\"",
|
||||
"fieldname": "customer",
|
||||
"fieldtype": "Link",
|
||||
"label": "Customer",
|
||||
"options": "Customer"
|
||||
},
|
||||
{
|
||||
"depends_on": "eval: doc.bg_type == \"Providing\"",
|
||||
"fieldname": "supplier",
|
||||
"fieldtype": "Link",
|
||||
"label": "Supplier",
|
||||
"options": "Supplier"
|
||||
},
|
||||
{
|
||||
"allow_on_submit": 1,
|
||||
"fieldname": "project",
|
||||
"fieldtype": "Link",
|
||||
"label": "Project",
|
||||
"options": "Project"
|
||||
},
|
||||
{
|
||||
"fieldname": "column_break_6",
|
||||
"fieldtype": "Column Break"
|
||||
},
|
||||
{
|
||||
"fieldname": "amount",
|
||||
"fieldtype": "Currency",
|
||||
"in_list_view": 1,
|
||||
"label": "Amount",
|
||||
"reqd": 1
|
||||
},
|
||||
{
|
||||
"fieldname": "start_date",
|
||||
"fieldtype": "Date",
|
||||
"label": "Start Date",
|
||||
"reqd": 1
|
||||
},
|
||||
{
|
||||
"fieldname": "validity",
|
||||
"fieldtype": "Int",
|
||||
"label": "Validity in Days"
|
||||
},
|
||||
{
|
||||
"fieldname": "end_date",
|
||||
"fieldtype": "Date",
|
||||
"label": "End Date",
|
||||
"read_only": 1
|
||||
},
|
||||
{
|
||||
"fieldname": "bank_account_info",
|
||||
"fieldtype": "Section Break",
|
||||
"label": "Bank Account Info"
|
||||
},
|
||||
{
|
||||
"fieldname": "bank",
|
||||
"fieldtype": "Link",
|
||||
"label": "Bank",
|
||||
"options": "Bank"
|
||||
},
|
||||
{
|
||||
"fieldname": "bank_account",
|
||||
"fieldtype": "Link",
|
||||
"label": "Bank Account",
|
||||
"options": "Bank Account"
|
||||
},
|
||||
{
|
||||
"fieldname": "account",
|
||||
"fieldtype": "Link",
|
||||
"label": "Account",
|
||||
"options": "Account",
|
||||
"read_only": 1
|
||||
},
|
||||
{
|
||||
"fieldname": "bank_account_no",
|
||||
"fieldtype": "Data",
|
||||
"label": "Bank Account No",
|
||||
"read_only": 1
|
||||
},
|
||||
{
|
||||
"fieldname": "column_break_17",
|
||||
"fieldtype": "Column Break"
|
||||
},
|
||||
{
|
||||
"fieldname": "iban",
|
||||
"fieldtype": "Data",
|
||||
"label": "IBAN",
|
||||
"read_only": 1
|
||||
},
|
||||
{
|
||||
"fieldname": "branch_code",
|
||||
"fieldtype": "Data",
|
||||
"label": "Branch Code",
|
||||
"read_only": 1
|
||||
},
|
||||
{
|
||||
"fieldname": "swift_number",
|
||||
"fieldtype": "Data",
|
||||
"label": "SWIFT number",
|
||||
"read_only": 1
|
||||
},
|
||||
{
|
||||
"fieldname": "section_break_14",
|
||||
"fieldtype": "Section Break"
|
||||
},
|
||||
{
|
||||
"fieldname": "more_information",
|
||||
"fieldtype": "Text Editor",
|
||||
"label": "Clauses and Conditions"
|
||||
},
|
||||
{
|
||||
"fieldname": "margin_details",
|
||||
"fieldtype": "Section Break",
|
||||
"label": "Other Details"
|
||||
},
|
||||
{
|
||||
"fieldname": "bank_guarantee_number",
|
||||
"fieldtype": "Data",
|
||||
"label": "Bank Guarantee Number",
|
||||
"unique": 1
|
||||
},
|
||||
{
|
||||
"fieldname": "name_of_beneficiary",
|
||||
"fieldtype": "Data",
|
||||
"label": "Name of Beneficiary"
|
||||
},
|
||||
{
|
||||
"fieldname": "column_break_19",
|
||||
"fieldtype": "Column Break"
|
||||
},
|
||||
{
|
||||
"fieldname": "margin_money",
|
||||
"fieldtype": "Currency",
|
||||
"label": "Margin Money"
|
||||
},
|
||||
{
|
||||
"fieldname": "charges",
|
||||
"fieldtype": "Currency",
|
||||
"label": "Charges Incurred"
|
||||
},
|
||||
{
|
||||
"fieldname": "fixed_deposit_number",
|
||||
"fieldtype": "Data",
|
||||
"label": "Fixed Deposit Number"
|
||||
},
|
||||
{
|
||||
"fieldname": "amended_from",
|
||||
"fieldtype": "Link",
|
||||
"label": "Amended From",
|
||||
"no_copy": 1,
|
||||
"options": "Bank Guarantee",
|
||||
"print_hide": 1,
|
||||
"read_only": 1
|
||||
}
|
||||
],
|
||||
"is_submittable": 1,
|
||||
"links": [],
|
||||
"modified": "2024-03-27 13:06:37.731207",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Accounts",
|
||||
"name": "Bank Guarantee",
|
||||
"owner": "Administrator",
|
||||
"permissions": [
|
||||
{
|
||||
"create": 1,
|
||||
"email": 1,
|
||||
"export": 1,
|
||||
"print": 1,
|
||||
"read": 1,
|
||||
"report": 1,
|
||||
"role": "Accounts User",
|
||||
"share": 1,
|
||||
"submit": 1,
|
||||
"write": 1
|
||||
},
|
||||
{
|
||||
"cancel": 1,
|
||||
"create": 1,
|
||||
"delete": 1,
|
||||
"email": 1,
|
||||
"export": 1,
|
||||
"print": 1,
|
||||
"read": 1,
|
||||
"report": 1,
|
||||
"role": "Accounts Manager",
|
||||
"share": 1,
|
||||
"submit": 1,
|
||||
"write": 1
|
||||
}
|
||||
],
|
||||
"quick_entry": 1,
|
||||
"search_fields": "customer",
|
||||
"sort_field": "creation",
|
||||
"sort_order": "DESC",
|
||||
"states": [],
|
||||
"title_field": "customer"
|
||||
>>>>>>> 329d14957b (fix: validate negative qty)
|
||||
}
|
||||
@@ -48,11 +48,19 @@ class BankGuarantee(Document):
|
||||
|
||||
def on_submit(self):
|
||||
if not self.bank_guarantee_number:
|
||||
<<<<<<< HEAD
|
||||
frappe.throw(_("Enter the Bank Guarantee Number before submittting."))
|
||||
if not self.name_of_beneficiary:
|
||||
frappe.throw(_("Enter the name of the Beneficiary before submittting."))
|
||||
if not self.bank:
|
||||
frappe.throw(_("Enter the name of the bank or lending institution before submittting."))
|
||||
=======
|
||||
frappe.throw(_("Enter the Bank Guarantee Number before submitting."))
|
||||
if not self.name_of_beneficiary:
|
||||
frappe.throw(_("Enter the name of the Beneficiary before submitting."))
|
||||
if not self.bank:
|
||||
frappe.throw(_("Enter the name of the bank or lending institution before submitting."))
|
||||
>>>>>>> 329d14957b (fix: validate negative qty)
|
||||
|
||||
|
||||
@frappe.whitelist()
|
||||
|
||||
@@ -1,8 +1,17 @@
|
||||
# Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and Contributors
|
||||
# See license.txt
|
||||
<<<<<<< HEAD
|
||||
|
||||
import unittest
|
||||
|
||||
|
||||
class TestBankGuarantee(unittest.TestCase):
|
||||
=======
|
||||
import unittest
|
||||
|
||||
from frappe.tests import IntegrationTestCase
|
||||
|
||||
|
||||
class TestBankGuarantee(IntegrationTestCase):
|
||||
>>>>>>> 329d14957b (fix: validate negative qty)
|
||||
pass
|
||||
|
||||
@@ -137,7 +137,14 @@
|
||||
}
|
||||
],
|
||||
"quick_entry": 1,
|
||||
<<<<<<< HEAD
|
||||
"sort_field": "modified",
|
||||
"sort_order": "DESC",
|
||||
"states": []
|
||||
}
|
||||
=======
|
||||
"sort_field": "creation",
|
||||
"sort_order": "DESC",
|
||||
"states": []
|
||||
}
|
||||
>>>>>>> 329d14957b (fix: validate negative qty)
|
||||
|
||||
@@ -4,7 +4,11 @@
|
||||
|
||||
import frappe
|
||||
from frappe import qb
|
||||
<<<<<<< HEAD
|
||||
from frappe.tests.utils import FrappeTestCase
|
||||
=======
|
||||
from frappe.tests import IntegrationTestCase
|
||||
>>>>>>> 329d14957b (fix: validate negative qty)
|
||||
from frappe.utils import add_days, today
|
||||
|
||||
from erpnext.accounts.doctype.bank_reconciliation_tool.bank_reconciliation_tool import (
|
||||
@@ -15,7 +19,11 @@ from erpnext.accounts.doctype.payment_entry.test_payment_entry import create_pay
|
||||
from erpnext.accounts.test.accounts_mixin import AccountsTestMixin
|
||||
|
||||
|
||||
<<<<<<< HEAD
|
||||
class TestBankReconciliationTool(AccountsTestMixin, FrappeTestCase):
|
||||
=======
|
||||
class TestBankReconciliationTool(AccountsTestMixin, IntegrationTestCase):
|
||||
>>>>>>> 329d14957b (fix: validate negative qty)
|
||||
def setUp(self):
|
||||
self.create_company()
|
||||
self.create_customer()
|
||||
|
||||
@@ -2,6 +2,19 @@
|
||||
// For license information, please see license.txt
|
||||
|
||||
frappe.ui.form.on("Bank Statement Import", {
|
||||
<<<<<<< HEAD
|
||||
=======
|
||||
onload(frm) {
|
||||
frm.set_query("bank_account", function (doc) {
|
||||
return {
|
||||
filters: {
|
||||
company: doc.company,
|
||||
},
|
||||
};
|
||||
});
|
||||
},
|
||||
|
||||
>>>>>>> 329d14957b (fix: validate negative qty)
|
||||
setup(frm) {
|
||||
frappe.realtime.on("data_import_refresh", ({ data_import }) => {
|
||||
frm.import_in_progress = false;
|
||||
|
||||
@@ -230,7 +230,15 @@
|
||||
"write": 1
|
||||
}
|
||||
],
|
||||
<<<<<<< HEAD
|
||||
"sort_field": "modified",
|
||||
"sort_order": "DESC",
|
||||
"track_changes": 1
|
||||
}
|
||||
=======
|
||||
"sort_field": "creation",
|
||||
"sort_order": "DESC",
|
||||
"states": [],
|
||||
"track_changes": 1
|
||||
}
|
||||
>>>>>>> 329d14957b (fix: validate negative qty)
|
||||
|
||||
@@ -79,7 +79,12 @@ class BankStatementImport(DataImport):
|
||||
from frappe.utils.background_jobs import is_job_enqueued
|
||||
from frappe.utils.scheduler import is_scheduler_inactive
|
||||
|
||||
<<<<<<< HEAD
|
||||
if is_scheduler_inactive() and not frappe.flags.in_test:
|
||||
=======
|
||||
run_now = frappe.flags.in_test or frappe.conf.developer_mode
|
||||
if is_scheduler_inactive() and not run_now:
|
||||
>>>>>>> 329d14957b (fix: validate negative qty)
|
||||
frappe.throw(_("Scheduler is inactive. Cannot import data."), title=_("Scheduler Inactive"))
|
||||
|
||||
job_id = f"bank_statement_import::{self.name}"
|
||||
@@ -96,7 +101,11 @@ class BankStatementImport(DataImport):
|
||||
google_sheets_url=self.google_sheets_url,
|
||||
bank=self.bank,
|
||||
template_options=self.template_options,
|
||||
<<<<<<< HEAD
|
||||
now=frappe.conf.developer_mode or frappe.flags.in_test,
|
||||
=======
|
||||
now=run_now,
|
||||
>>>>>>> 329d14957b (fix: validate negative qty)
|
||||
)
|
||||
return True
|
||||
|
||||
|
||||
@@ -1,9 +1,19 @@
|
||||
# Copyright (c) 2020, Frappe Technologies and Contributors
|
||||
# See license.txt
|
||||
<<<<<<< HEAD
|
||||
|
||||
# import frappe
|
||||
import unittest
|
||||
|
||||
|
||||
class TestBankStatementImport(unittest.TestCase):
|
||||
=======
|
||||
# import frappe
|
||||
import unittest
|
||||
|
||||
from frappe.tests import IntegrationTestCase
|
||||
|
||||
|
||||
class TestBankStatementImport(IntegrationTestCase):
|
||||
>>>>>>> 329d14957b (fix: validate negative qty)
|
||||
pass
|
||||
|
||||
@@ -113,7 +113,12 @@ class AutoMatchbyPartyNameDescription:
|
||||
|
||||
for party in parties:
|
||||
filters = {"status": "Active"} if party == "Employee" else {"disabled": 0}
|
||||
<<<<<<< HEAD
|
||||
names = frappe.get_all(party, filters=filters, pluck=party.lower() + "_name")
|
||||
=======
|
||||
field = party.lower() + "_name"
|
||||
names = frappe.get_all(party, filters=filters, fields=[f"{field} as party_name", "name"])
|
||||
>>>>>>> 329d14957b (fix: validate negative qty)
|
||||
|
||||
for field in ["bank_party_name", "description"]:
|
||||
if not self.get(field):
|
||||
@@ -132,7 +137,15 @@ class AutoMatchbyPartyNameDescription:
|
||||
|
||||
def fuzzy_search_and_return_result(self, party, names, field) -> tuple | None:
|
||||
skip = False
|
||||
<<<<<<< HEAD
|
||||
result = process.extract(query=self.get(field), choices=names, scorer=fuzz.token_set_ratio)
|
||||
=======
|
||||
result = process.extract(
|
||||
query=self.get(field),
|
||||
choices={row.get("name"): row.get("party_name") for row in names},
|
||||
scorer=fuzz.token_set_ratio,
|
||||
)
|
||||
>>>>>>> 329d14957b (fix: validate negative qty)
|
||||
party_name, skip = self.process_fuzzy_result(result)
|
||||
|
||||
if not party_name:
|
||||
@@ -150,14 +163,22 @@ class AutoMatchbyPartyNameDescription:
|
||||
|
||||
Returns: Result, Skip (whether or not to discontinue matching)
|
||||
"""
|
||||
<<<<<<< HEAD
|
||||
PARTY, SCORE, CUTOFF = 0, 1, 80
|
||||
=======
|
||||
SCORE, PARTY_ID, CUTOFF = 1, 2, 80
|
||||
>>>>>>> 329d14957b (fix: validate negative qty)
|
||||
|
||||
if not result or not len(result):
|
||||
return None, False
|
||||
|
||||
first_result = result[0]
|
||||
if len(result) == 1:
|
||||
<<<<<<< HEAD
|
||||
return (first_result[PARTY] if first_result[SCORE] > CUTOFF else None), True
|
||||
=======
|
||||
return (first_result[PARTY_ID] if first_result[SCORE] > CUTOFF else None), True
|
||||
>>>>>>> 329d14957b (fix: validate negative qty)
|
||||
|
||||
second_result = result[1]
|
||||
if first_result[SCORE] > CUTOFF:
|
||||
@@ -166,7 +187,11 @@ class AutoMatchbyPartyNameDescription:
|
||||
if first_result[SCORE] == second_result[SCORE]:
|
||||
return None, True
|
||||
|
||||
<<<<<<< HEAD
|
||||
return first_result[PARTY], True
|
||||
=======
|
||||
return first_result[PARTY_ID], True
|
||||
>>>>>>> 329d14957b (fix: validate negative qty)
|
||||
else:
|
||||
return None, False
|
||||
|
||||
|
||||
@@ -208,6 +208,7 @@ class BankTransaction(Document):
|
||||
if self.party_type and self.party:
|
||||
return
|
||||
|
||||
<<<<<<< HEAD
|
||||
result = None
|
||||
try:
|
||||
result = AutoMatchParty(
|
||||
@@ -219,6 +220,15 @@ class BankTransaction(Document):
|
||||
).match()
|
||||
except Exception:
|
||||
frappe.log_error(title=_("Error in party matching for Bank Transaction {0}").format(self.name))
|
||||
=======
|
||||
result = AutoMatchParty(
|
||||
bank_party_account_number=self.bank_party_account_number,
|
||||
bank_party_iban=self.bank_party_iban,
|
||||
bank_party_name=self.bank_party_name,
|
||||
description=self.description,
|
||||
deposit=self.deposit,
|
||||
).match()
|
||||
>>>>>>> 329d14957b (fix: validate negative qty)
|
||||
|
||||
if not result:
|
||||
return
|
||||
|
||||
@@ -2,13 +2,30 @@
|
||||
# License: GNU General Public License v3. See license.txt
|
||||
|
||||
import frappe
|
||||
<<<<<<< HEAD
|
||||
from frappe.tests.utils import FrappeTestCase
|
||||
=======
|
||||
from frappe.tests import IntegrationTestCase, UnitTestCase
|
||||
>>>>>>> 329d14957b (fix: validate negative qty)
|
||||
from frappe.utils import nowdate
|
||||
|
||||
from erpnext.accounts.doctype.bank_transaction.test_bank_transaction import create_bank_account
|
||||
|
||||
|
||||
<<<<<<< HEAD
|
||||
class TestAutoMatchParty(FrappeTestCase):
|
||||
=======
|
||||
class UnitTestBankTransaction(UnitTestCase):
|
||||
"""
|
||||
Unit tests for BankTransaction.
|
||||
Use this class for testing individual functions and methods.
|
||||
"""
|
||||
|
||||
pass
|
||||
|
||||
|
||||
class TestAutoMatchParty(IntegrationTestCase):
|
||||
>>>>>>> 329d14957b (fix: validate negative qty)
|
||||
@classmethod
|
||||
def setUpClass(cls):
|
||||
create_bank_account()
|
||||
|
||||
@@ -6,7 +6,11 @@ import json
|
||||
import frappe
|
||||
from frappe import utils
|
||||
from frappe.model.docstatus import DocStatus
|
||||
<<<<<<< HEAD
|
||||
from frappe.tests.utils import FrappeTestCase
|
||||
=======
|
||||
from frappe.tests import IntegrationTestCase, UnitTestCase
|
||||
>>>>>>> 329d14957b (fix: validate negative qty)
|
||||
|
||||
from erpnext.accounts.doctype.bank_reconciliation_tool.bank_reconciliation_tool import (
|
||||
get_linked_payments,
|
||||
@@ -18,6 +22,7 @@ from erpnext.accounts.doctype.purchase_invoice.test_purchase_invoice import make
|
||||
from erpnext.accounts.doctype.sales_invoice.test_sales_invoice import create_sales_invoice
|
||||
from erpnext.tests.utils import if_lending_app_installed
|
||||
|
||||
<<<<<<< HEAD
|
||||
test_dependencies = ["Item", "Cost Center"]
|
||||
|
||||
|
||||
@@ -31,6 +36,22 @@ class TestBankTransaction(FrappeTestCase):
|
||||
]:
|
||||
frappe.db.delete(dt)
|
||||
clear_loan_transactions()
|
||||
=======
|
||||
EXTRA_TEST_RECORD_DEPENDENCIES = ["Item", "Cost Center"]
|
||||
|
||||
|
||||
class UnitTestBankTransaction(UnitTestCase):
|
||||
"""
|
||||
Unit tests for BankTransaction.
|
||||
Use this class for testing individual functions and methods.
|
||||
"""
|
||||
|
||||
pass
|
||||
|
||||
|
||||
class TestBankTransaction(IntegrationTestCase):
|
||||
def setUp(self):
|
||||
>>>>>>> 329d14957b (fix: validate negative qty)
|
||||
make_pos_profile()
|
||||
|
||||
# generate and use a uniq hash identifier for 'Bank Account' and it's linked GL 'Account' to avoid validation error
|
||||
@@ -222,11 +243,14 @@ class TestBankTransaction(FrappeTestCase):
|
||||
self.assertEqual(linked_payments[0]["name"], repayment_entry.name)
|
||||
|
||||
|
||||
<<<<<<< HEAD
|
||||
@if_lending_app_installed
|
||||
def clear_loan_transactions():
|
||||
frappe.db.delete("Loan Repayment")
|
||||
|
||||
|
||||
=======
|
||||
>>>>>>> 329d14957b (fix: validate negative qty)
|
||||
def create_bank_account(
|
||||
bank_name="Citi Bank", gl_account="_Test Bank - _TC", bank_account_name="Checking Account"
|
||||
):
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
{
|
||||
<<<<<<< HEAD
|
||||
"allow_copy": 0,
|
||||
"allow_events_in_timeline": 0,
|
||||
"allow_guest_to_view": 0,
|
||||
@@ -104,4 +105,42 @@
|
||||
"track_changes": 0,
|
||||
"track_seen": 0,
|
||||
"track_views": 0
|
||||
=======
|
||||
"actions": [],
|
||||
"creation": "2018-10-24 15:24:56.713277",
|
||||
"doctype": "DocType",
|
||||
"editable_grid": 1,
|
||||
"engine": "InnoDB",
|
||||
"field_order": [
|
||||
"bank_transaction_field",
|
||||
"file_field"
|
||||
],
|
||||
"fields": [
|
||||
{
|
||||
"fieldname": "bank_transaction_field",
|
||||
"fieldtype": "Select",
|
||||
"in_list_view": 1,
|
||||
"label": "Field in Bank Transaction",
|
||||
"reqd": 1
|
||||
},
|
||||
{
|
||||
"fieldname": "file_field",
|
||||
"fieldtype": "Data",
|
||||
"in_list_view": 1,
|
||||
"label": "Column in Bank File",
|
||||
"reqd": 1
|
||||
}
|
||||
],
|
||||
"istable": 1,
|
||||
"links": [],
|
||||
"modified": "2024-03-27 13:06:38.436517",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Accounts",
|
||||
"name": "Bank Transaction Mapping",
|
||||
"owner": "Administrator",
|
||||
"permissions": [],
|
||||
"sort_field": "creation",
|
||||
"sort_order": "DESC",
|
||||
"states": []
|
||||
>>>>>>> 329d14957b (fix: validate negative qty)
|
||||
}
|
||||
@@ -1,4 +1,5 @@
|
||||
{
|
||||
<<<<<<< HEAD
|
||||
"allow_copy": 0,
|
||||
"allow_events_in_timeline": 0,
|
||||
"allow_guest_to_view": 0,
|
||||
@@ -111,6 +112,43 @@
|
||||
"translatable": 0,
|
||||
"unique": 0
|
||||
},
|
||||
=======
|
||||
"actions": [],
|
||||
"creation": "2018-11-28 08:55:40.815355",
|
||||
"doctype": "DocType",
|
||||
"editable_grid": 1,
|
||||
"engine": "InnoDB",
|
||||
"field_order": [
|
||||
"payment_document",
|
||||
"payment_entry",
|
||||
"allocated_amount",
|
||||
"clearance_date"
|
||||
],
|
||||
"fields": [
|
||||
{
|
||||
"fieldname": "payment_document",
|
||||
"fieldtype": "Link",
|
||||
"in_list_view": 1,
|
||||
"label": "Payment Document",
|
||||
"options": "DocType",
|
||||
"reqd": 1
|
||||
},
|
||||
{
|
||||
"fieldname": "payment_entry",
|
||||
"fieldtype": "Dynamic Link",
|
||||
"in_list_view": 1,
|
||||
"label": "Payment Entry",
|
||||
"options": "payment_document",
|
||||
"reqd": 1
|
||||
},
|
||||
{
|
||||
"fieldname": "allocated_amount",
|
||||
"fieldtype": "Currency",
|
||||
"in_list_view": 1,
|
||||
"label": "Allocated Amount",
|
||||
"reqd": 1
|
||||
},
|
||||
>>>>>>> 329d14957b (fix: validate negative qty)
|
||||
{
|
||||
"depends_on": "eval:doc.docstatus==1",
|
||||
"fieldname": "clearance_date",
|
||||
@@ -120,6 +158,7 @@
|
||||
"print_hide": 1,
|
||||
"read_only": 1
|
||||
}
|
||||
<<<<<<< HEAD
|
||||
],
|
||||
"has_web_view": 0,
|
||||
"hide_heading": 0,
|
||||
@@ -148,3 +187,20 @@
|
||||
"track_seen": 0,
|
||||
"track_views": 0
|
||||
}
|
||||
=======
|
||||
],
|
||||
"istable": 1,
|
||||
"links": [],
|
||||
"modified": "2024-03-27 13:06:38.549438",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Accounts",
|
||||
"name": "Bank Transaction Payments",
|
||||
"owner": "Administrator",
|
||||
"permissions": [],
|
||||
"quick_entry": 1,
|
||||
"sort_field": "creation",
|
||||
"sort_order": "DESC",
|
||||
"states": [],
|
||||
"track_changes": 1
|
||||
}
|
||||
>>>>>>> 329d14957b (fix: validate negative qty)
|
||||
|
||||
@@ -170,7 +170,11 @@
|
||||
"index_web_pages_for_search": 1,
|
||||
"issingle": 1,
|
||||
"links": [],
|
||||
<<<<<<< HEAD
|
||||
"modified": "2023-12-01 16:49:54.073890",
|
||||
=======
|
||||
"modified": "2024-03-27 13:06:39.619458",
|
||||
>>>>>>> 329d14957b (fix: validate negative qty)
|
||||
"modified_by": "Administrator",
|
||||
"module": "Accounts",
|
||||
"name": "Bisect Accounting Statements",
|
||||
@@ -188,7 +192,11 @@
|
||||
}
|
||||
],
|
||||
"read_only": 1,
|
||||
<<<<<<< HEAD
|
||||
"sort_field": "modified",
|
||||
=======
|
||||
"sort_field": "creation",
|
||||
>>>>>>> 329d14957b (fix: validate negative qty)
|
||||
"sort_order": "DESC",
|
||||
"states": []
|
||||
}
|
||||
@@ -138,10 +138,18 @@ class BisectAccountingStatements(Document):
|
||||
|
||||
# set root as current node
|
||||
root = frappe.db.get_all("Bisect Nodes", filters={"root": ["is", "not set"]})[0]
|
||||
<<<<<<< HEAD
|
||||
self.get_report_summary()
|
||||
self.current_node = root.name
|
||||
self.current_from_date = self.from_date
|
||||
self.current_to_date = self.to_date
|
||||
=======
|
||||
self.current_node = root.name
|
||||
self.current_from_date = self.from_date
|
||||
self.current_to_date = self.to_date
|
||||
|
||||
self.get_report_summary()
|
||||
>>>>>>> 329d14957b (fix: validate negative qty)
|
||||
self.save()
|
||||
|
||||
def get_report_summary(self):
|
||||
|
||||
@@ -2,8 +2,24 @@
|
||||
# See license.txt
|
||||
|
||||
# import frappe
|
||||
<<<<<<< HEAD
|
||||
from frappe.tests.utils import FrappeTestCase
|
||||
|
||||
|
||||
class TestBisectAccountingStatements(FrappeTestCase):
|
||||
=======
|
||||
from frappe.tests import IntegrationTestCase, UnitTestCase
|
||||
|
||||
|
||||
class UnitTestBisectAccountingStatements(UnitTestCase):
|
||||
"""
|
||||
Unit tests for BisectAccountingStatements.
|
||||
Use this class for testing individual functions and methods.
|
||||
"""
|
||||
|
||||
pass
|
||||
|
||||
|
||||
class TestBisectAccountingStatements(IntegrationTestCase):
|
||||
>>>>>>> 329d14957b (fix: validate negative qty)
|
||||
pass
|
||||
|
||||
@@ -70,7 +70,11 @@
|
||||
],
|
||||
"index_web_pages_for_search": 1,
|
||||
"links": [],
|
||||
<<<<<<< HEAD
|
||||
"modified": "2023-12-01 17:46:12.437996",
|
||||
=======
|
||||
"modified": "2024-03-27 13:06:39.766063",
|
||||
>>>>>>> 329d14957b (fix: validate negative qty)
|
||||
"modified_by": "Administrator",
|
||||
"module": "Accounts",
|
||||
"name": "Bisect Nodes",
|
||||
@@ -91,7 +95,11 @@
|
||||
}
|
||||
],
|
||||
"read_only": 1,
|
||||
<<<<<<< HEAD
|
||||
"sort_field": "modified",
|
||||
=======
|
||||
"sort_field": "creation",
|
||||
>>>>>>> 329d14957b (fix: validate negative qty)
|
||||
"sort_order": "DESC",
|
||||
"states": []
|
||||
}
|
||||
@@ -2,8 +2,24 @@
|
||||
# See license.txt
|
||||
|
||||
# import frappe
|
||||
<<<<<<< HEAD
|
||||
from frappe.tests.utils import FrappeTestCase
|
||||
|
||||
|
||||
class TestBisectNodes(FrappeTestCase):
|
||||
=======
|
||||
from frappe.tests import IntegrationTestCase, UnitTestCase
|
||||
|
||||
|
||||
class UnitTestBisectNodes(UnitTestCase):
|
||||
"""
|
||||
Unit tests for BisectNodes.
|
||||
Use this class for testing individual functions and methods.
|
||||
"""
|
||||
|
||||
pass
|
||||
|
||||
|
||||
class TestBisectNodes(IntegrationTestCase):
|
||||
>>>>>>> 329d14957b (fix: validate negative qty)
|
||||
pass
|
||||
|
||||
@@ -207,7 +207,11 @@
|
||||
"index_web_pages_for_search": 1,
|
||||
"is_submittable": 1,
|
||||
"links": [],
|
||||
<<<<<<< HEAD
|
||||
"modified": "2022-10-10 22:14:36.361509",
|
||||
=======
|
||||
"modified": "2024-03-27 13:06:42.675933",
|
||||
>>>>>>> 329d14957b (fix: validate negative qty)
|
||||
"modified_by": "Administrator",
|
||||
"module": "Accounts",
|
||||
"name": "Budget",
|
||||
@@ -231,7 +235,11 @@
|
||||
"write": 1
|
||||
}
|
||||
],
|
||||
<<<<<<< HEAD
|
||||
"sort_field": "modified",
|
||||
=======
|
||||
"sort_field": "creation",
|
||||
>>>>>>> 329d14957b (fix: validate negative qty)
|
||||
"sort_order": "DESC",
|
||||
"states": [],
|
||||
"track_changes": 1
|
||||
|
||||
@@ -1,9 +1,16 @@
|
||||
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
|
||||
# See license.txt
|
||||
<<<<<<< HEAD
|
||||
|
||||
import unittest
|
||||
|
||||
import frappe
|
||||
=======
|
||||
import unittest
|
||||
|
||||
import frappe
|
||||
from frappe.tests import IntegrationTestCase
|
||||
>>>>>>> 329d14957b (fix: validate negative qty)
|
||||
from frappe.utils import now_datetime, nowdate
|
||||
|
||||
from erpnext.accounts.doctype.budget.budget import BudgetError, get_actual_expense
|
||||
@@ -11,10 +18,17 @@ from erpnext.accounts.doctype.journal_entry.test_journal_entry import make_journ
|
||||
from erpnext.accounts.utils import get_fiscal_year
|
||||
from erpnext.buying.doctype.purchase_order.test_purchase_order import create_purchase_order
|
||||
|
||||
<<<<<<< HEAD
|
||||
test_dependencies = ["Monthly Distribution"]
|
||||
|
||||
|
||||
class TestBudget(unittest.TestCase):
|
||||
=======
|
||||
EXTRA_TEST_RECORD_DEPENDENCIES = ["Monthly Distribution"]
|
||||
|
||||
|
||||
class TestBudget(IntegrationTestCase):
|
||||
>>>>>>> 329d14957b (fix: validate negative qty)
|
||||
def test_monthly_budget_crossed_ignore(self):
|
||||
set_total_expense_zero(nowdate(), "cost_center")
|
||||
|
||||
|
||||
@@ -29,14 +29,22 @@
|
||||
],
|
||||
"istable": 1,
|
||||
"links": [],
|
||||
<<<<<<< HEAD
|
||||
"modified": "2024-03-04 15:43:27.016947",
|
||||
=======
|
||||
"modified": "2024-03-27 13:06:42.854458",
|
||||
>>>>>>> 329d14957b (fix: validate negative qty)
|
||||
"modified_by": "Administrator",
|
||||
"module": "Accounts",
|
||||
"name": "Budget Account",
|
||||
"owner": "Administrator",
|
||||
"permissions": [],
|
||||
"quick_entry": 1,
|
||||
<<<<<<< HEAD
|
||||
"sort_field": "modified",
|
||||
=======
|
||||
"sort_field": "creation",
|
||||
>>>>>>> 329d14957b (fix: validate negative qty)
|
||||
"sort_order": "DESC",
|
||||
"states": []
|
||||
}
|
||||
@@ -13,19 +13,35 @@
|
||||
"fieldtype": "Link",
|
||||
"in_list_view": 1,
|
||||
"label": "Campaign",
|
||||
<<<<<<< HEAD
|
||||
"options": "Campaign"
|
||||
=======
|
||||
"options": "UTM Campaign"
|
||||
>>>>>>> 329d14957b (fix: validate negative qty)
|
||||
}
|
||||
],
|
||||
"index_web_pages_for_search": 1,
|
||||
"istable": 1,
|
||||
"links": [],
|
||||
<<<<<<< HEAD
|
||||
"modified": "2021-05-07 10:43:49.717633",
|
||||
=======
|
||||
"modified": "2024-06-28 11:04:09.815940",
|
||||
>>>>>>> 329d14957b (fix: validate negative qty)
|
||||
"modified_by": "Administrator",
|
||||
"module": "Accounts",
|
||||
"name": "Campaign Item",
|
||||
"owner": "Administrator",
|
||||
"permissions": [],
|
||||
<<<<<<< HEAD
|
||||
"sort_field": "modified",
|
||||
"sort_order": "DESC",
|
||||
"track_changes": 1
|
||||
}
|
||||
}
|
||||
=======
|
||||
"sort_field": "creation",
|
||||
"sort_order": "DESC",
|
||||
"states": [],
|
||||
"track_changes": 1
|
||||
}
|
||||
>>>>>>> 329d14957b (fix: validate negative qty)
|
||||
|
||||
@@ -124,7 +124,11 @@
|
||||
],
|
||||
"is_submittable": 1,
|
||||
"links": [],
|
||||
<<<<<<< HEAD
|
||||
"modified": "2023-12-28 13:15:46.858427",
|
||||
=======
|
||||
"modified": "2024-03-27 13:06:44.260440",
|
||||
>>>>>>> 329d14957b (fix: validate negative qty)
|
||||
"modified_by": "Administrator",
|
||||
"module": "Accounts",
|
||||
"name": "Cashier Closing",
|
||||
@@ -145,7 +149,11 @@
|
||||
"write": 1
|
||||
}
|
||||
],
|
||||
<<<<<<< HEAD
|
||||
"sort_field": "modified",
|
||||
=======
|
||||
"sort_field": "creation",
|
||||
>>>>>>> 329d14957b (fix: validate negative qty)
|
||||
"sort_order": "DESC",
|
||||
"states": [],
|
||||
"track_changes": 1
|
||||
|
||||
@@ -1,8 +1,17 @@
|
||||
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
|
||||
# See license.txt
|
||||
<<<<<<< HEAD
|
||||
|
||||
import unittest
|
||||
|
||||
|
||||
class TestCashierClosing(unittest.TestCase):
|
||||
=======
|
||||
import unittest
|
||||
|
||||
from frappe.tests import IntegrationTestCase
|
||||
|
||||
|
||||
class TestCashierClosing(IntegrationTestCase):
|
||||
>>>>>>> 329d14957b (fix: validate negative qty)
|
||||
pass
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user