Ran the push flow against ERPNext 15.121.6 on a plain site and on a site with India Compliance 15.32.0 (podman, scripts/erpnext-e2e). 15 ignored live tests pass on both. Fixes, each covered by a mock-based test: - load_options no longer fails on a plain site: the India Compliance-only gstin field is dropped on a 417 and retried. - Code-less rows with fractional hours or minutes send stock_uom, since ERPNext defaults it to Nos. - A created document whose total differs from Voiced's (ERPNext's default Banker's Rounding on half-paise ties) is recorded as a conflict, kept as a draft, not submitted and not given a PDF. The message names Commercial Rounding as the fix. - An existing customer address is reused instead of creating a duplicate on every first push. A bare creation order-by is not used with a Dynamic Link filter. - A re-adopted document no longer gets a second copy of the PDF. - Reverse charge: India Compliance rejects is_reverse_charge unless tax rows are negative RCM amounts, so the flag is sent as 0 with a warning that the invoice lands as a normal taxed invoice. - The 16-character name rule is checked locally in mirror mode under India Compliance, and a TDS-only payment is refused locally with the reason. Payment Entry mapping verified: bank_account is the Account name (paid_to), paid and received amounts equal the cash received, allocated_amount is cash plus TDS, and TDS is one positive deductions row. The integration user needs the Accounts User and Sales User roles. Not verified: ERPNext v14 and v16, other India Compliance versions, the Tauri commands and UI against a live site, SEZ and overseas customers, UTGST supplier states, TLS sites, e-invoicing.
43 lines
2.1 KiB
Bash
Executable File
43 lines
2.1 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
# Brings up the voiced-erp podman project and prepares two ERPNext v15 sites for the live tests:
|
|
# 127.0.0.1 plain ERPNext -> .env.a (URL http://127.0.0.1:8088)
|
|
# localhost ERPNext + India Compliance -> .env.b (URL http://localhost:8088)
|
|
# Both are served by the same backend; Frappe picks the site from the Host header.
|
|
# Safe to re-run: existing sites are kept and the integration user's key is regenerated.
|
|
set -euo pipefail
|
|
cd "$(dirname "$0")"
|
|
|
|
COMPOSE=(podman-compose -p voiced-erp -f compose.yml)
|
|
IMAGE=localhost/voiced-erp-ic:v15
|
|
BENCH_SITES=/home/frappe/frappe-bench/sites
|
|
|
|
podman image exists "$IMAGE" || podman build -t "$IMAGE" -f Containerfile.ic .
|
|
|
|
"${COMPOSE[@]}" up -d db redis configurator
|
|
until [ "$(podman inspect -f '{{.State.Status}}' voiced-erp-configurator)" = exited ]; do sleep 2; done
|
|
[ "$(podman inspect -f '{{.State.ExitCode}}' voiced-erp-configurator)" = 0 ] || { echo "configurator failed: podman logs voiced-erp-configurator" >&2; exit 1; }
|
|
"${COMPOSE[@]}" up -d backend worker
|
|
|
|
in_backend() { podman exec -i voiced-erp-backend bash -c "$1"; }
|
|
|
|
for site in 127.0.0.1 localhost; do
|
|
default=""; [ "$site" = 127.0.0.1 ] && default="--set-default"
|
|
in_backend "test -d $BENCH_SITES/$site || bench new-site $site --mariadb-user-host-login-scope='%' \
|
|
--admin-password=admin --db-root-username=root --db-root-password=admin --install-app erpnext $default" >/dev/null
|
|
done
|
|
|
|
until curl -fsS http://127.0.0.1:8088/api/method/ping >/dev/null 2>&1; do sleep 2; done
|
|
|
|
# setup_site.py prints `ENV KEY=VALUE` lines; turn them into a sourceable env file (untracked: .env.* is ignored).
|
|
write_env() { # site, url, file, extra args...
|
|
local site=$1 url=$2 file=$3; shift 3
|
|
in_backend "cd $BENCH_SITES && /home/frappe/frappe-bench/env/bin/python - $site $*" < setup_site.py \
|
|
| sed -n 's/^ENV \([A-Z_]*\)=\(.*\)$/export \1="\2"/p' > "$file"
|
|
echo "export ERPNEXT_URL=\"$url\"" >> "$file"
|
|
chmod 600 "$file"
|
|
}
|
|
write_env 127.0.0.1 http://127.0.0.1:8088 .env.a
|
|
write_env localhost http://localhost:8088 .env.b ic
|
|
|
|
echo "Ready. Source .env.a (plain) or .env.b (India Compliance), then run the live tests (see README.md)."
|