Merge pull request #32958 from pps190/fix-item-price-brand
fix: link `Item Price` brand to `Brand` doctype.
diff --git a/.github/workflows/server-tests-mariadb.yml b/.github/workflows/server-tests-mariadb.yml
index e3b92fd..b40faa7 100644
--- a/.github/workflows/server-tests-mariadb.yml
+++ b/.github/workflows/server-tests-mariadb.yml
@@ -59,7 +59,7 @@
- name: Setup Python
uses: actions/setup-python@v2
with:
- python-version: '3.10'
+ python-version: '3.11'
- name: Check for valid Python & Merge Conflicts
run: |
@@ -120,7 +120,7 @@
FRAPPE_BRANCH: ${{ github.event.inputs.branch }}
- name: Run Tests
- run: cd ~/frappe-bench/ && bench --site test_site run-parallel-tests --app erpnext --use-orchestrator --with-coverage
+ run: 'cd ~/frappe-bench/ && bench --site test_site run-parallel-tests --app erpnext --with-coverage --total-builds 4 --build-number ${{ matrix.container }}'
env:
TYPE: server
CI_BUILD_ID: ${{ github.run_id }}
diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml
index dc3011f..73aae33 100644
--- a/.pre-commit-config.yaml
+++ b/.pre-commit-config.yaml
@@ -16,8 +16,8 @@
- id: check-merge-conflict
- id: check-ast
- - repo: https://gitlab.com/pycqa/flake8
- rev: 3.9.2
+ - repo: https://github.com/PyCQA/flake8
+ rev: 5.0.4
hooks:
- id: flake8
additional_dependencies: [
diff --git a/erpnext/accounts/doctype/account/chart_of_accounts/unverified/at_austria_chart_template.json b/erpnext/accounts/doctype/account/chart_of_accounts/unverified/at_austria_chart_template.json
index 3b07d51..58d67be 100644
--- a/erpnext/accounts/doctype/account/chart_of_accounts/unverified/at_austria_chart_template.json
+++ b/erpnext/accounts/doctype/account/chart_of_accounts/unverified/at_austria_chart_template.json
@@ -2,397 +2,438 @@
"country_code": "at",
"name": "Austria - Chart of Accounts",
"tree": {
- "Summe Abschreibungen und Aufwendungen": {
- "7010 bis 7080 Abschreibungen auf das Anlageverm\u00f6gen (ausgenommen Finanzanlagen)": {},
- "7100 bis 7190 Sonstige Steuern": {
- "account_type": "Tax"
- },
- "7200 bis 7290 Instandhaltung u. Reinigung durh Dritte, Entsorgung, Beleuchtung": {},
- "7300 bis 7310 Transporte durch Dritte": {},
- "7320 bis 7330 Kfz - Aufwand": {},
- "7340 bis 7350 Reise- und Fahraufwand": {},
- "7360 bis 7370 Tag- und N\u00e4chtigungsgelder": {},
- "7380 bis 7390 Nachrichtenaufwand": {},
- "7400 bis 7430 Miet- und Pachtaufwand": {},
- "7440 bis 7470 Leasingaufwand": {},
- "7480 bis 7490 Lizenzaufwand": {},
- "7500 bis 7530 Aufwand f\u00fcr beigestelltes Personal": {},
- "7540 bis 7570 Provisionen an Dritte": {},
- "7580 bis 7590 Aufsichtsratsverg\u00fctungen": {},
- "7610 bis 7620 Druckerzeugnisse und Vervielf\u00e4ltigungen": {},
- "7650 bis 7680 Werbung und Repr\u00e4sentationen": {},
- "7700 bis 7740 Versicherungen": {},
- "7750 bis 7760 Beratungs- und Pr\u00fcfungsaufwand": {},
- "7800 bis 7810 Schadensf\u00e4lle": {},
- "7840 bis 7880 Verschiedene betriebliche Aufwendungen": {},
- "7910 bis 7950 Aufwandsstellenrechung der Hersteller": {},
- "Abschreibungen auf aktivierte Aufwendungen f\u00fcr das Ingangs. u. Erweitern des Betriebes": {},
- "Abschreibungen vom Umlaufverm\u00f6gen, soweit diese die im Unternehmen \u00fcblichen Abschreibungen \u00fcbersteigen": {},
- "Aufwandsstellenrechnung": {},
- "Aus- und Fortbildung": {},
- "Buchwert abgegangener Anlagen, ausgenommen Finanzanlagen": {},
- "B\u00fcromaterial und Drucksorten": {},
- "Fachliteratur und Zeitungen ": {},
- "Herstellungskosten der zur Erzielung der Umsatzerl\u00f6se erbrachten Leistungen": {},
- "Mitgliedsbeitr\u00e4ge": {},
- "Skontoertr\u00e4ge auf sonstige betriebliche Aufwendungen": {},
- "Sonstige betrieblichen Aufwendungen": {},
- "Spenden und Trinkgelder": {},
- "Spesen des Geldverkehrs": {},
- "Verluste aus dem Abgang vom Anlageverm\u00f6gen, ausgenommen Finanzanlagen": {},
- "Vertriebskosten": {},
- "Verwaltungskosten": {},
- "root_type": "Expense"
- },
- "Summe Betriebliche Ertr\u00e4ge": {
- "4400 bis 4490 Erl\u00f6sschm\u00e4lerungen": {},
- "4500 bis 4570 Ver\u00e4nderungen des Bestandes an fertigen und unfertigen Erzeugn. sowie an noch nicht abrechenbaren Leistungen": {},
- "4580 bis 4590 andere aktivierte Eigenleistungen": {},
- "4600 bis 4620 Erl\u00f6se aus dem Abgang vom Anlageverm\u00f6gen, ausgen. Finanzanlagen": {},
- "4630 bis 4650 Ertr\u00e4ge aus dem Abgang vom Anlageverm\u00f6gen, ausgen. Finanzanlagen": {},
- "4660 bis 4670 Ertr\u00e4ge aus der Zuschreibung zum Anlageverm\u00f6gen, ausgen. Finanzanlagen": {},
- "4700 bis 4790 Ertr\u00e4ge aus der Aufl\u00f6sung von R\u00fcckstellungen": {},
- "4800 bis 4990 \u00dcbrige betriebliche Ertr\u00e4ge": {},
- "Erl\u00f6se 0 % Ausfuhrlieferungen/Drittl\u00e4nder": {},
- "Erl\u00f6se 10 %": {},
- "Erl\u00f6se 20 %": {},
- "Erl\u00f6se aus im Inland stpfl. EG Lieferungen 10 % USt": {},
- "Erl\u00f6se aus im Inland stpfl. EG Lieferungen 20 % USt": {},
- "Erl\u00f6se i.g. Lieferungen (stfr)": {},
- "root_type": "Income"
- },
- "Summe Eigenkapital R\u00fccklagen Abschlusskonten": {
- "9000 bis 9180 Gezeichnetes bzw. gewidmetes Kapital": {
- "account_type": "Equity"
- },
- "9200 bis 9290 Kapitalr\u00fccklagen": {
- "account_type": "Equity"
- },
- "9300 bis 9380 Gewinnr\u00fccklagen": {
- "account_type": "Equity"
- },
- "9400 bis 9590 Bewertungsreserven uns sonst. unversteuerte R\u00fccklagen": {
- "account_type": "Equity"
- },
- "9600 bis 9690 Privat und Verrechnungskonten bei Einzelunternehmen und Personengesellschaften": {},
- "9700 bis 9790 Einlagen stiller Gesellschafter ": {},
- "9900 bis 9999 Evidenzkonten": {},
- "Bilanzgewinn (-verlust )": {
- "account_type": "Equity"
- },
- "Er\u00f6ffnungsbilanz": {},
- "Gewinn- und Verlustrechnung": {},
- "Schlussbilanz": {},
- "nicht eingeforderte ausstehende Einlagen": {
- "account_type": "Equity"
- },
- "root_type": "Equity"
- },
- "Summe Finanzertr\u00e4ge und Aufwendungen": {
- "8000 bis 8040 Ertr\u00e4ge aus Beteiligungen": {},
- "8050 bis 8090 Ertr\u00e4ge aus anderen Wertpapieren und Ausleihungen des Finanzanlageverm\u00f6gens": {},
- "8100 bis 8130 Sonstige Zinsen und \u00e4hnliche Ertr\u00e4ge": {},
- "8220 bis 8250 Aufwendungen aus Beteiligungen": {},
- "8260 bis 8270 Aufwendungen aus sonst. Fiananzanlagen und aus Wertpapieren des Umlaufverm\u00f6gens": {},
- "8280 bis 8340 Zinsen und \u00e4hnliche Aufwendungem": {},
- "8400 bis 8440 Au\u00dferordentliche Ertr\u00e4ge": {},
- "8450 bis 8490 Au\u00dferordentliche Aufwendungen": {},
- "8500 bis 8590 Steuern vom Einkommen und vom Ertrag": {
- "account_type": "Tax"
- },
- "8600 bis 8690 Aufl\u00f6sung unversteuerten R\u00fccklagen": {},
- "8700 bis 8740 Aufl\u00f6sung von Kapitalr\u00fccklagen": {},
- "8750 bis 8790 Aufl\u00f6sung von Gewinnr\u00fccklagen": {},
- "8800 bis 8890 Zuweisung von unversteuerten R\u00fccklagen": {},
- "Buchwert abgegangener Beteiligungen": {},
- "Buchwert abgegangener Wertpapiere des Umlaufverm\u00f6gens": {},
- "Buchwert abgegangener sonstiger Finanzanlagen": {},
- "Erl\u00f6se aus dem Abgang von Beteiligungen": {},
- "Erl\u00f6se aus dem Abgang von Wertpapieren des Umlaufverm\u00f6gens": {},
- "Erl\u00f6se aus dem Abgang von sonstigen Finanzanlagen": {},
- "Ertr\u00e4ge aus dem Abgang von und der Zuschreibung zu Finanzanlagen": {},
- "Ertr\u00e4ge aus dem Abgang von und der Zuschreibung zu Wertpapieren des Umlaufverm\u00f6gens": {},
- "Gewinabfuhr bzw. Verlust\u00fcberrechnung aus Ergebnisabf\u00fchrungsvertr\u00e4gen": {},
- "nicht ausgenutzte Lieferantenskonti": {},
- "root_type": "Income"
- },
- "Summe Fremdkapital": {
- "3020 bis 3030 Steuerr\u00fcckstellungen": {},
- "3040 bis 3090 Sonstige R\u00fcckstellungen": {},
- "3110 bis 3170 Verbindlichkeiten gegen\u00fcber Kredidinstituten": {},
- "3180 bis 3190 Verbindlichkeiten gegen\u00fcber Finanzinstituten": {},
- "3380 bis 3390 Verbindlichkeiten aus der Annahme gezogener Wechsel u. d. Ausstellungen eigener Wechsel": {
+ "Klasse 0 Aktiva: Anlageverm\u00f6gen": {
+ "0100 Konzessionen ": {"account_type": "Fixed Asset"},
+ "0110 Patentrechte und Lizenzen ": {"account_type": "Fixed Asset"},
+ "0120 Datenverarbeitungsprogramme ": {"account_type": "Fixed Asset"},
+ "0130 Marken, Warenzeichen und Musterschutzrechte, sonstige Urheberrechte ": {"account_type": "Fixed Asset"},
+ "0140 Pacht- und Mietrechte ": {"account_type": "Fixed Asset"},
+ "0150 Bezugs- und ähnliche Rechte ": {"account_type": "Fixed Asset"},
+ "0160 Geschäfts-/Firmenwert ": {"account_type": "Fixed Asset"},
+ "0170 Umgründungsmehrwert ": {"account_type": "Fixed Asset"},
+ "0180 Geleistete Anzahlungen auf immaterielle Vermögensgegenstände": {"account_type": "Fixed Asset"},
+ "0190 Kumulierte Abschreibungen zu immateriellen Vermögensgegenständen ": {"account_type": "Fixed Asset"},
+ "0200 Unbebaute Grundstücke, soweit nicht landwirtschaftlich genutzt ": {"account_type": "Fixed Asset"},
+ "0210 Bebaute Grundstücke (Grundwert) ": {"account_type": "Fixed Asset"},
+ "0220 Landwirtschaftlich genutzte Grundstücke ": {"account_type": "Fixed Asset"},
+ "0230 Grundstücksgleiche Rechte ": {"account_type": "Fixed Asset"},
+ "0300 Betriebs- und Geschäftsgebäude auf eigenem Grund ": {"account_type": "Fixed Asset"},
+ "0310 Wohn- und Sozialgebäude auf eigenem Grund ": {"account_type": "Fixed Asset"},
+ "0320 Betriebs- und Geschäftsgebäude auf fremdem Grund ": {"account_type": "Fixed Asset"},
+ "0330 Wohn- und Sozialgebäude auf fremdem Grund ": {"account_type": "Fixed Asset"},
+ "0340 Grundstückseinrichtungen auf eigenem Grund ": {"account_type": "Fixed Asset"},
+ "0350 Grundstückseinrichtungen auf fremdem Grund ": {"account_type": "Fixed Asset"},
+ "0360 Bauliche Investitionen in fremden (gepachteten) Betriebs- und Geschäftsgebäuden": {"account_type": "Fixed Asset"},
+ "0370 Bauliche Investitionen in fremden (gepachteten) Wohn- und Sozialgebäuden": {"account_type": "Fixed Asset"},
+ "0390 Kumulierte Abschreibungen zu Grundstücken ": {"account_type": "Fixed Asset"},
+ "0400 Maschinen und Geräte ": {"account_type": "Fixed Asset"},
+ "0500 Maschinenwerkzeuge ": {"account_type": "Fixed Asset"},
+ "0510 Allgemeine Werkzeuge und Handwerkzeuge ": {"account_type": "Fixed Asset"},
+ "0520 Prototypen, Formen, Modelle ": {"account_type": "Fixed Asset"},
+ "0530 Andere Erzeugungshilfsmittel (auch Softwarewerkzeuge)": {"account_type": "Fixed Asset"},
+ "0540 Hebezeuge und Montageanlagen ": {"account_type": "Fixed Asset"},
+ "0550 Geringwertige Vermögensgegenstände, soweit im Erzeugungsprozess ": {"account_type": "Fixed Asset"},
+ "0560 Festwerte technische Anlagen und Maschinen ": {"account_type": "Fixed Asset"},
+ "0590 Kumulierte Abschreibungen zu technischen Anlagen und Maschinen ": {"account_type": "Fixed Asset"},
+ "0600 Betriebs- und Geschäftsausstattung, soweit nicht gesondert angeführt ": {"account_type": "Fixed Asset"},
+ "0610 Andere Anlagen, soweit nicht gesondert angeführt ": {"account_type": "Fixed Asset"},
+ "0620 Büromaschinen, EDV-Anlagen ": {"account_type": "Fixed Asset"},
+ "0630 PKW und Kombis ": {"account_type": "Fixed Asset"},
+ "0640 LKW ": {"account_type": "Fixed Asset"},
+ "0650 Andere Beförderungsmittel ": {"account_type": "Fixed Asset"},
+ "0660 Gebinde ": {"account_type": "Fixed Asset"},
+ "0670 Geringwertige Vermögensgegenstände, soweit nicht im Erzeugungssprozess verwendet": {"account_type": "Fixed Asset"},
+ "0680 Festwerte außer technische Anlagen und Maschinen ": {"account_type": "Fixed Asset"},
+ "0690 Kumulierte Abschreibungen zu anderen Anlagen, Betriebs- und Geschäftsausstattung": {"account_type": "Fixed Asset"},
+ "0700 Geleistete Anzahlungen auf Sachanlagen ": {"account_type": "Fixed Asset"},
+ "0710 Anlagen in Bau ": {"account_type": "Fixed Asset"},
+ "0790 Kumulierte Abschreibungen zu geleisteten Anzahlungen auf Sachanlagen ": {"account_type": "Fixed Asset"},
+ "0800 Anteile an verbundenen Unternehmen ": {"account_type": "Fixed Asset"},
+ "0810 Beteiligungen an Gemeinschaftsunternehmen ": {"account_type": "Fixed Asset"},
+ "0820 Beteiligungen an angeschlossenen (assoziierten) Unternehmen ": {"account_type": "Fixed Asset"},
+ "0830 Eigene Anteile, Anteile an herrschenden oder mit Mehrheit beteiligten ": {"account_type": "Fixed Asset"},
+ "0840 Sonstige Beteiligungen ": {"account_type": "Fixed Asset"},
+ "0850 Ausleihungen an verbundene Unternehmen ": {"account_type": "Fixed Asset"},
+ "0860 Ausleihungen an Unternehmen mit Beteiligungsverhältnis": {"account_type": "Fixed Asset"},
+ "0870 Ausleihungen an Gesellschafter ": {"account_type": "Fixed Asset"},
+ "0880 Sonstige Ausleihungen ": {"account_type": "Fixed Asset"},
+ "0890 Anteile an Kapitalgesellschaften ohne Beteiligungscharakter ": {"account_type": "Fixed Asset"},
+ "0900 Anteile an Personengesellschaften ohne Beteiligungscharakter ": {"account_type": "Fixed Asset"},
+ "0910 Genossenschaftsanteile ohne Beteiligungscharakter ": {"account_type": "Fixed Asset"},
+ "0920 Anteile an Investmentfonds ": {"account_type": "Fixed Asset"},
+ "0930 Festverzinsliche Wertpapiere des Anlagevermögens ": {"account_type": "Fixed Asset"},
+ "0980 Geleistete Anzahlungen auf Finanzanlagen ": {"account_type": "Fixed Asset"},
+ "0990 Kumulierte Abschreibungen zu Finanzanlagen ": {"account_type": "Fixed Asset"},
+ "root_type": "Asset"
+ },
+ "Klasse 1 Aktiva: Vorr\u00e4te": {
+ "1000 Bezugsverrechnung": {"account_type": "Stock"},
+ "1100 Rohstoffe": {"account_type": "Stock"},
+ "1200 Bezogene Teile": {"account_type": "Stock"},
+ "1300 Hilfsstoffe": {"account_type": "Stock"},
+ "1350 Betriebsstoffe": {"account_type": "Stock"},
+ "1360 Vorrat Energietraeger": {"account_type": "Stock"},
+ "1400 Unfertige Erzeugnisse": {"account_type": "Stock"},
+ "1500 Fertige Erzeugnisse": {"account_type": "Stock"},
+ "1600 Handelswarenvorrat": {"account_type": "Stock Received But Not Billed"},
+ "1700 Noch nicht abrechenbare Leistungen": {"account_type": "Stock"},
+ "1900 Wertberichtigungen": {"account_type": "Stock"},
+ "1800 Geleistete Anzahlungen": {"account_type": "Stock"},
+ "1900 Wertberichtigungen": {"account_type": "Stock"},
+ "root_type": "Asset"
+ },
+ "Klasse 3 Passiva: Verbindlichkeiten": {
+ "3000 Allgemeine Verbindlichkeiten (Schuld)": {"account_type": "Payable"},
+ "3010 R\u00fcckstellungen f\u00fcr Pensionen": {"account_type": "Payable"},
+ "3020 Steuerr\u00fcckstellungen": {"account_type": "Tax"},
+ "3041 Sonstige R\u00fcckstellungen": {"account_type": "Payable"},
+ "3110 Verbindlichkeiten gegen\u00fcber Bank": {"account_type": "Payable"},
+ "3150 Verbindlichkeiten Darlehen": {"account_type": "Payable"},
+ "3185 Verbindlichkeiten Kreditkarte": {"account_type": "Payable"},
+ "3380 Verbindlichkeiten aus der Annahme gezogener Wechsel u. d. Ausstellungen eigener Wechsel": {
"account_type": "Payable"
},
- "3400 bis 3470 Verbindlichkeiten gegen\u00fc. verb. Untern., Verbindl. gegen\u00fc. Untern., mit denen eine Beteiligungsverh\u00e4lnis besteht": {},
- "3600 bis 3690 Verbindlichkeiten im Rahmen der sozialen Sicherheit": {},
- "3700 bis 3890 \u00dcbrige sonstige Verbindlichkeiten": {},
- "3900 bis 3990 Passive Rechnungsabgrenzungsposten": {},
- "Anleihen (einschlie\u00dflich konvertibler)": {},
- "Erhaltene Anzahlungenauf Bestellungen": {},
- "R\u00fcckstellungen f\u00fcr Abfertigung": {},
- "R\u00fcckstellungen f\u00fcr Pensionen": {},
- "USt. \u00a719 /art (reverse charge)": {
+ "3400 Verbindlichkeiten gegen\u00fc. verb. Untern., Verbindl. gegen\u00fc. Untern., mit denen eine Beteiligungsverh\u00e4lnis besteht": {},
+ "3460 Verbindlichkeiten gegenueber Gesellschaftern": {"account_type": "Payable"},
+ "3470 Einlagen stiller Gesellschafter": {"account_type": "Payable"},
+ "3585 Verbindlichkeiten Lohnsteuer": {"account_type": "Tax"},
+ "3590 Verbindlichkeiten Kommunalabgaben": {"account_type": "Tax"},
+ "3595 Verbindlichkeiten Dienstgeberbeitrag": {"account_type": "Tax"},
+ "3600 Verbindlichkeiten Sozialversicherung": {"account_type": "Payable"},
+ "3640 Verbindlichkeiten Loehne und Gehaelter": {"account_type": "Payable"},
+ "3700 Sonstige Verbindlichkeiten": {"account_type": "Payable"},
+ "3900 Passive Rechnungsabgrenzungsposten": {"account_type": "Payable"},
+ "3100 Anleihen (einschlie\u00dflich konvertibler)": {"account_type": "Payable"},
+ "3200 Erhaltene Anzahlungen auf Bestellungen": {"account_type": "Payable"},
+ "3040 R\u00fcckstellungen f\u00fcr Abfertigung": {"account_type": "Payable"},
+
+ "3530 USt. \u00a719 (reverse charge)": {
"account_type": "Tax"
},
- "Umsatzsteuer": {},
- "Umsatzsteuer Zahllast": {
+ "3500 Verbindlichkeiten aus Umsatzsteuer": {"account_type": "Tax"},
+ "3580 Umsatzsteuer Zahllast": {
"account_type": "Tax"
},
- "Umsatzsteuer aus i.g. Erwerb 10%": {
+ "3510 Umsatzsteuer Inland 20%": {
"account_type": "Tax"
},
- "Umsatzsteuer aus i.g. Erwerb 20%": {
+ "3515 Umsatzsteuer Inland 10%": {
+ "account_type": "Tax"
+ },
+ "3520 Umsatzsteuer aus i.g. Erwerb 20%": {
"account_type": "Tax"
},
- "Umsatzsteuer aus i.g. Lieferungen 10%": {
+ "3525 Umsatzsteuer aus i.g. Erwerb 10%": {
"account_type": "Tax"
- },
- "Umsatzsteuer aus i.g. Lieferungen 20%": {
- "account_type": "Tax"
- },
- "Umsatzsteuer-Evidenzkonto f\u00fcr erhaltene Anzahlungen auf Bestellungen": {},
- "Verbindlichkeiten aus Lieferungen u. Leistungen EU": {
+ },
+ "3560 Umsatzsteuer-Evidenzkonto f\u00fcr erhaltene Anzahlungen auf Bestellungen": {},
+ "3360 Verbindlichkeiten aus Lieferungen u. Leistungen EU": {
"account_type": "Payable"
},
- "Verbindlichkeiten aus Lieferungen u. Leistungen Inland": {
+ "3000 Verbindlichkeiten aus Lieferungen u. Leistungen Inland": {
"account_type": "Payable"
},
- "Verbindlichkeiten aus Lieferungen u. Leistungen sonst. Ausland": {
+ "3370 Verbindlichkeiten aus Lieferungen u. Leistungen sonst. Ausland": {
"account_type": "Payable"
},
- "Verbindlichkeiten gegen\u00fcber Gesellschaften": {},
- "Verrechnung Finanzamt": {
+ "3400 Verbindlichkeiten gegen\u00fcber verbundenen Unternehmen": {},
+ "3570 Verrechnung Finanzamt": {
"account_type": "Tax"
},
"root_type": "Liability"
- },
- "Summe Kontoklasse 0 Anlageverm\u00f6gen": {
- "44 bis 49 Sonstige Maschinen und maschinelle Anlagen": {},
- "920 bis 930 Festverzinsliche Wertpapiere des Anlageverm\u00f6gens": {},
- "940 bis 970 Sonstige Finanzanlagen, Wertrechte": {},
- "Allgemeine Werkzeuge und Handwerkzeuge": {},
- "Andere Bef\u00f6rderungsmittel": {},
- "Andere Betriebs- und Gesch\u00e4ftsausstattung": {},
- "Andere Erzeugungshilfsmittel": {},
- "Anlagen im Bau": {},
- "Anteile an Investmentfonds": {},
- "Anteile an Kapitalgesellschaften ohne Beteiligungscharakter": {},
- "Anteile an Personengesellschaften ohne Beteiligungscharakter": {},
- "Anteile an verbundenen Unternehmen": {},
- "Antriebsmaschinen": {},
- "Aufwendungen f\u00fcs das Ingangssetzen u. Erweitern eines Betriebes": {},
- "Ausleihungen an verbundene Unternehmen": {},
- "Ausleihungen an verbundene Unternehmen, mit denen ein Beteiligungsverh\u00e4lnis besteht": {},
- "Bauliche Investitionen in fremden (gepachteten) Betriebs- und Gesch\u00e4ftsgeb\u00e4uden": {},
- "Bauliche Investitionen in fremden (gepachteten) Wohn- und Sozialgeb\u00e4uden": {},
- "Bebaute Grundst\u00fccke (Grundwert)": {},
- "Beheizungs- und Beleuchtungsanlagen": {},
- "Beteiligungen an Gemeinschaftunternehmen": {},
- "Beteiligungen an angeschlossenen (assoziierten) Unternehmen": {},
- "Betriebs- und Gesch\u00e4ftsgeb\u00e4ude auf eigenem Grund": {},
- "Betriebs- und Gesch\u00e4ftsgeb\u00e4ude auf fremdem Grund": {},
- "B\u00fcromaschinen, EDV - Anlagen": {},
- "Datenverarbeitungsprogramme": {},
- "Energieversorgungsanlagen": {},
- "Fertigungsmaschinen": {},
- "Gebinde": {},
- "Geleistete Anzahlungen": {},
- "Genossenschaften ohne Beteiligungscharakter": {},
- "Geringwertige Verm\u00f6gensgegenst\u00e4nde, soweit im Erzeugerprozess verwendet": {},
- "Geringwertige Verm\u00f6gensgegenst\u00e4nde, soweit nicht im Erzeugungsprozess verwendet": {},
- "Gesch\u00e4fts(Firmen)wert": {},
- "Grundst\u00fcckseinrichtunten auf eigenem Grund": {},
- "Grundst\u00fcckseinrichtunten auf fremdem Grund": {},
- "Grundst\u00fccksgleiche Rechte": {},
- "Hebezeuge und Montageanlagen": {},
- "Konzessionen": {},
- "Kumulierte Abschreibungen": {},
- "LKW": {},
- "Marken, Warenzeichen und Musterschutzrechte": {},
- "Maschinenwerkzeuge": {},
- "Nachrichten- und Kontrollanlagen": {},
- "PKW": {},
- "Pacht- und Mietrechte": {},
- "Patentrechte und Lizenzen": {},
- "Sonstige Ausleihungen": {},
- "Sonstige Beteiligungen": {},
- "Transportanlagen": {},
- "Unbebaute Grundst\u00fccke": {},
- "Vorrichtungen, Formen und Modelle": {},
- "Wohn- und Sozialgeb\u00e4ude auf eigenem Grund": {},
- "Wohn- und Sozialgeb\u00e4ude auf fremdem Grund": {},
+ },
+ "Klasse 2 Aktiva: Umlaufverm\u00f6gen, Rechnungsabgrenzungen": {
+ "2030 Forderungen aus Lieferungen und Leistungen Inland (0% USt, umsatzsteuerfrei)": {
+ "account_type": "Receivable"
+ },
+ "2010 Forderungen aus Lieferungen und Leistungen Inland (10% USt, umsatzsteuerfrei)": {
+ "account_type": "Receivable"
+ },
+ "2000 Forderungen aus Lieferungen und Leistungen Inland (20% USt, umsatzsteuerfrei)": {
+ "account_type": "Receivable"
+ },
+ "2040 Forderungen aus Lieferungen und Leistungen Inland (sonstiger USt-Satz)": {
+ "account_type": "Receivable"
+ },
+ "2100 Forderungen aus Lieferungen und Leistungen EU": {
+ "account_type": "Receivable"
+ },
+ "2150 Forderungen aus Lieferungen und Leistungen Ausland (Nicht-EU)": {
+ "account_type": "Receivable"
+ },
+ "2200 Forderungen gegen\u00fcber verbundenen Unternehmen": {
+ "account_type": "Receivable"
+ },
+ "2250 Forderungen gegen\u00fcber Unternehmen, mit denen ein Beteiligungsverh\u00e4ltnis besteht": {
+ "account_type": "Receivable"
+ },
+ "2300 Sonstige Forderungen und Verm\u00f6gensgegenst\u00e4nde": {
+ "account_type": "Receivable"
+ },
+ "2630 Sonstige Wertpapiere": {
+ "account_type": "Stock"
+ },
+ "2750 Kassenbest\u00e4nde in Fremdw\u00e4hrung": {
+ "account_type": "Cash"
+ },
+ "2900 Aktive Rechnungsabrenzungsposten": {
+ "account_type": "Receivable"
+ },
+ "2600 Anteile an verbundenen Unternehmen": {
+ "account_type": "Equity"
+ },
+ "2680 Besitzwechsel ohne Forderungen": {
+ "account_type": "Receivable"
+ },
+ "2950 Aktiviertes Disagio": {
+ "account_type": "Receivable"
+ },
+ "2610 Eigene Anteile und Wertpapiere an mit Mehrheit beteiligten Unternehmen": {
+ "account_type": "Receivable"
+ },
+ "2570 Einfuhrumsatzsteuer (bezahlt)": {"account_type": "Tax"},
+
+ "2460 Eingeforderte aber noch nicht eingezahlte Einlagen": {
+ "account_type": "Receivable"
+ },
+ "2180 Einzelwertberichtigungen zu Forderungen aus Lief. und Leist. Ausland": {
+ "account_type": "Receivable"
+ },
+ "2130 Einzelwertberichtigungen zu Forderungen aus Lief. und Leist. EU": {
+ "account_type": "Receivable"
+ },
+ "2080 Einzelwertberichtigungen zu Forderungen aus Lief. und Leist. Inland ": {
+ "account_type": "Receivable"
+ },
+ "2270 Einzelwertberichtigungen zu Forderungen gegen\u00fcber Unternehmen mit denen ein Beteiligungsverh\u00e4ltnis besteht": {
+ "account_type": "Receivable"
+ },
+ "2230 Einzelwertberichtigungen zu Forderungen gegen\u00fcber verbundenen Unternehmen": {
+ "account_type": "Receivable"
+ },
+ "2470 Einzelwertberichtigungen zu sonstigen Forderungen und Verm\u00f6gensgegenst\u00e4nden": {
+ "account_type": "Receivable"
+ },
+ "2700 Kassenbestand": {
+ "account_type": "Cash"
+ },
+ "2190 Pauschalwertberichtigungen zu Forderungen aus Lief. und Leist. sonstiges Ausland": {
+ "account_type": "Receivable"
+ },
+ "2130 Pauschalwertberichtigungen zu Forderungen aus Lief. und Leist. EU": {
+ "account_type": "Receivable"
+ },
+ "2100 Pauschalwertberichtigungen zu Forderungen aus Lief. und Leist. Inland ": {
+ "account_type": "Receivable"
+ },
+ "2280 Pauschalwertberichtigungen zu Forderungen gegen\u00fcber Unternehmen mit denen ein Beteiligungsverh\u00e4ltnis besteht": {
+ "account_type": "Receivable"
+ },
+ "2240 Pauschalwertberichtigungen zu Forderungen gegen\u00fcber verbundenen Unternehmen": {
+ "account_type": "Receivable"
+ },
+ "2480 Pauschalwertberichtigungen zu sonstigen Forderungen und Verm\u00f6gensgegenst\u00e4nden": {
+ "account_type": "Receivable"
+ },
+ "2740 Postwertzeichen": {
+ "account_type": "Cash"
+ },
+ "2780 Schecks in Euro": {
+ "account_type": "Cash"
+ },
+ "2800 Guthaben bei Bank": {
+ "account_type": "Bank"
+ },
+ "2801 Guthaben bei Bank - Sparkonto": {
+ "account_type": "Bank"
+ },
+ "2810 Guthaben bei Paypal": {
+ "account_type": "Bank"
+ },
+ "2930 Mietvorauszahlungen": {
+ "account_type": "Receivable"
+ },
+ "2980 Abgrenzung latenter Steuern": {
+ "account_type": "Receivable"
+ },
+ "2500 Vorsteuer": {
+ "account_type": "Receivable"
+ },
+ "2510 Vorsteuer Inland 10%": {
+ "account_type": "Tax"
+ },
+ "2895 Schwebende Geldbewegugen": {
+ "account_type": "Bank"
+ },
+ "2513 Vorsteuer Inland 5%": {
+ "account_type": "Tax"
+ },
+ "2515 Vorsteuer Inland 20%": {
+ "account_type": "Tax"
+ },
+ "2520 Vorsteuer aus innergemeinschaftlichem Erwerb 10%": {
+ "account_type": "Tax"
+ },
+ "2525 Vorsteuer aus innergemeinschaftlichem Erwerb 20%": {
+ "account_type": "Tax"
+ },
+ "2530 Vorsteuer \u00a719/Art 19 ( reverse charge ) ": {
+ "account_type": "Tax"
+ },
+ "2690 Wertberichtigungen zu Wertpapieren und Anteilen": {
+ "account_type": "Receivable"
+ },
"root_type": "Asset"
},
- "Summe Personalaufwand": {
- "6000 bis 6190 L\u00f6hne": {},
- "6200 bis 6390 Geh\u00e4lter": {},
- "6400 bis 6440 Aufwendungen f\u00fcr Abfertigungen": {},
- "6450 bis 6490 Aufwendungen f\u00fcr Altersversorgung": {},
- "6500 bis 6550 Gesetzlicher Sozialaufwand Arbeiter": {},
- "6560 bis 6590 Gesetzlicher Sozialaufwand Angestellte": {},
- "6600 bis 6650 Lohnabh\u00e4ngige Abgaben und Pflichtbeitr\u00e4gte": {},
- "6660 bis 6690 Gehaltsabh\u00e4ngige Abgaben und Pflichtbeitr\u00e4gte": {},
- "6700 bis 6890 Sonstige Sozialaufwendungen": {},
- "Aufwandsstellenrechnung": {},
+ "Klasse 4: Betriebliche Erträge": {
+ "4000 Erlöse 20 %": {"account_type": "Income Account"},
+ "4020 Erl\u00f6se 0 % steuerbefreit": {"account_type": "Income Account"},
+ "4010 Erl\u00f6se 10 %": {"account_type": "Income Account"},
+ "4030 Erl\u00f6se 13 %": {"account_type": "Income Account"},
+ "4040 Erl\u00f6se 0 % innergemeinschaftliche Lieferungen": {"account_type": "Income Account"},
+ "4400 Erl\u00f6sreduktion 0 % steuerbefreit": {"account_type": "Expense Account"},
+ "4410 Erl\u00f6sreduktion 10 %": {"account_type": "Expense Account"},
+ "4420 Erl\u00f6sreduktion 20 %": {"account_type": "Expense Account"},
+ "4430 Erl\u00f6sreduktion 13 %": {"account_type": "Expense Account"},
+ "4440 Erl\u00f6sreduktion 0 % innergemeinschaftliche Lieferungen": {"account_type": "Expense Account"},
+ "4500 Ver\u00e4nderungen des Bestandes an fertigen und unfertigen Erzeugn. sowie an noch nicht abrechenbaren Leistungen": {"account_type": "Income Account"},
+ "4580 Aktivierte Eigenleistungen": {"account_type": "Income Account"},
+ "4600 Erl\u00f6se aus dem Abgang vom Anlageverm\u00f6gen, ausgen. Finanzanlagen": {"account_type": "Income Account"},
+ "4630 Ertr\u00e4ge aus dem Abgang vom Anlageverm\u00f6gen, ausgen. Finanzanlagen": {"account_type": "Income Account"},
+ "4660 Ertr\u00e4ge aus der Zuschreibung zum Anlageverm\u00f6gen, ausgen. Finanzanlagen": {"account_type": "Income Account"},
+ "4700 Ertr\u00e4ge aus der Aufl\u00f6sung von R\u00fcckstellungen": {"account_type": "Income Account"},
+ "4800 \u00dcbrige betriebliche Ertr\u00e4ge": {"account_type": "Income Account"},
+ "root_type": "Income"
+ },
+ "Klasse 5: Aufwand f\u00fcr Material und Leistungen": {
+ "5000 Einkauf Partnerleistungen": {"account_type": "Cost of Goods Sold"},
+ "5100 Verbrauch an Rohstoffen": {"account_type": "Cost of Goods Sold"},
+ "5200 Verbrauch von bezogenen Fertig- und Einzelteilen": {"account_type": "Cost of Goods Sold"},
+ "5300 Verbrauch von Hilfsstoffen": {"account_type": "Cost of Goods Sold"},
+ "5340 Verbrauch Verpackungsmaterial": {"account_type": "Cost of Goods Sold"},
+ "5470 Verbrauch von Kleinmaterial": {"account_type": "Cost of Goods Sold"},
+ "5450 Verbrauch von Reinigungsmaterial": {"account_type": "Cost of Goods Sold"},
+ "5400 Verbrauch von Betriebsstoffen": {"account_type": "Cost of Goods Sold"},
+ "5500 Verbrauch von Werkzeugen und anderen Erzeugungshilfsmittel": {"account_type": "Cost of Goods Sold"},
+ "5600 Verbrauch von Brenn- und Treibstoffen, Energie und Wasser": {"account_type": "Cost of Goods Sold"},
+ "5700 Bearbeitung durch Dritte": {"account_type": "Cost of Goods Sold"},
+ "5900 Aufwandsstellenrechnung Material": {"account_type": "Cost of Goods Sold"},
+ "5820 Skontoertr\u00e4ge (20% USt.)": {"account_type": "Income Account"},
+ "5810 Skontoertr\u00e4ge (10% USt.)": {"account_type": "Income Account"},
+ "5010 Handelswareneinkauf 10 %": {"account_type": "Cost of Goods Sold"},
+ "5020 Handelswareneinkauf 20 %": {"account_type": "Cost of Goods Sold"},
+ "5040 Handelswareneinkauf innergemeinschaftlicher Erwerb 10 % VSt/10 % USt": {"account_type": "Cost of Goods Sold"},
+ "5050 Handelswareneinkauf innergemeinschaftlicher Erwerb 20 % VSt/20 % USt": {"account_type": "Cost of Goods Sold"},
+ "5070 Handelswareneinkauf innergemeinschaftlicher Erwerb ohne Vorsteuerabzug und 10 % USt": {"account_type": "Cost of Goods Sold"},
+ "5080 Handelswareneinkauf innergemeinschaftlicher Erwerb ohne Vorsteuerabzug und 20 % USt": {"account_type": "Cost of Goods Sold"},
"root_type": "Expense"
},
- "Summe Umlaufverm\u00f6gen": {
- "2000 bis 2007 Forderungen aus Lief. und Leist. Inland": {
- "account_type": "Receivable"
- },
- "2100 bis 2120 Forderungen aus Lief. und Leist. EU": {
- "account_type": "Receivable"
- },
- "2150 bis 2170 Forderungen aus Lief. und Leist. Ausland": {
- "account_type": "Receivable"
- },
- "2200 bis 2220 Forderungen gegen\u00fcber verbundenen Unternehmen": {
- "account_type": "Receivable"
- },
- "2250 bis 2270 Forderungen gegen\u00fcber Unternehmen, mit denen ein Beteiligungsverh\u00e4ltnis besteht": {
- "account_type": "Receivable"
- },
- "2300 bis 2460 Sonstige Forderungen und Verm\u00f6gensgegenst\u00e4nde": {
- "account_type": "Receivable"
- },
- "2630 bis 2670 Sonstige Wertpapiere": {
- "account_type": "Receivable"
- },
- "2750 bis 2770 Kassenbest\u00e4nde in Fremdw\u00e4hrung": {
- "account_type": "Receivable"
- },
- "Aktive Rechnungsabrenzungsposten": {
- "account_type": "Receivable"
- },
- "Anteile an verbundenen Unternehmen": {
- "account_type": "Receivable"
- },
- "Bank / Guthaben bei Kreditinstituten": {
- "account_type": "Receivable"
- },
- "Besitzwechsel ...": {
- "account_type": "Receivable"
- },
- "Disagio": {
- "account_type": "Receivable"
- },
- "Eigene Anteile (Wertpapiere)": {
- "account_type": "Receivable"
- },
- "Einfuhrumsatzsteuer (bezahlt)": {},
- "Eingeforderte aber noch nicht eingezahlte Einlagen": {
- "account_type": "Receivable"
- },
- "Einzelwertberichtigungen zu Forderungen aus Lief. und Leist. Ausland": {
- "account_type": "Receivable"
- },
- "Einzelwertberichtigungen zu Forderungen aus Lief. und Leist. EU": {
- "account_type": "Receivable"
- },
- "Einzelwertberichtigungen zu Forderungen aus Lief. und Leist. Inland ": {
- "account_type": "Receivable"
- },
- "Einzelwertberichtigungen zu Forderungen gegen\u00fcber Unternehmen mit denen ein Beteiligungsverh\u00e4ltnis besteht": {
- "account_type": "Receivable"
- },
- "Einzelwertberichtigungen zu Forderungen gegen\u00fcber verbundenen Unternehmen": {
- "account_type": "Receivable"
- },
- "Einzelwertberichtigungen zu sonstigen Forderungen und Verm\u00f6gensgegenst\u00e4nden": {
- "account_type": "Receivable"
- },
- "Kassenbestand": {
- "account_type": "Receivable"
- },
- "Pauschalwertberichtigungen zu Forderungen aus Lief. und Leist. Ausland": {
- "account_type": "Receivable"
- },
- "Pauschalwertberichtigungen zu Forderungen aus Lief. und Leist. EU": {
- "account_type": "Receivable"
- },
- "Pauschalwertberichtigungen zu Forderungen aus Lief. und Leist. Inland ": {
- "account_type": "Receivable"
- },
- "Pauschalwertberichtigungen zu Forderungen gegen\u00fcber Unternehmen mit denen ein Beteiligungsverh\u00e4ltnis besteht": {
- "account_type": "Receivable"
- },
- "Pauschalwertberichtigungen zu Forderungen gegen\u00fcber verbundenen Unternehmen": {
- "account_type": "Receivable"
- },
- "Pauschalwertberichtigungen zu sonstigen Forderungen und Verm\u00f6gensgegenst\u00e4nden": {
- "account_type": "Receivable"
- },
- "Postwertzeichen": {
- "account_type": "Receivable"
- },
- "Schecks in Inlandsw\u00e4hrung": {
- "account_type": "Receivable"
- },
- "Sonstige Anteile": {
- "account_type": "Receivable"
- },
- "Stempelmarken": {
- "account_type": "Receivable"
- },
- "Steuerabgrenzung": {
- "account_type": "Receivable"
- },
- "Unterschiedsbetrag gem. Abschnitt XII Pensionskassengesetz": {
- "account_type": "Receivable"
- },
- "Unterschiedsbetrag zur gebotenen Pensionsr\u00fcckstellung": {
- "account_type": "Receivable"
- },
- "Vorsteuer": {
- "account_type": "Receivable"
- },
- "Vorsteuer aus ig. Erwerb 10%": {
- "account_type": "Tax"
- },
- "Vorsteuer aus ig. Erwerb 20%": {
- "account_type": "Tax"
- },
- "Vorsteuer \u00a719/Art 19 ( reverse charge ) ": {
- "account_type": "Tax"
- },
- "Wertberichtigungen": {
- "account_type": "Receivable"
- },
- "root_type": "Asset"
- },
- "Summe Vorr\u00e4te": {
- "1000 bis 1090 Bezugsverrechnung": {},
- "1100 bis 1190 Rohstoffe": {},
- "1200 bis 1290 Bezogene Teile": {},
- "1300 bis 1340 Hilfsstoffe": {},
- "1350 bis 1390 Betriebsstoffe": {},
- "1400 bis 1490 Unfertige Erzeugniss": {},
- "1500 bis 1590 Fertige Erzeugniss": {},
- "1600 bis 1690 Waren": {},
- "1700 bis 1790 Noch nicht abgerechenbare Leistungen": {},
- "1900 bis 1990 Wertberichtigungen": {},
- "geleistete Anzahlungen": {},
- "root_type": "Asset"
- },
- "Summe Wareneinsatz": {
- "5100 bis 5190 Verbrauch an Rohstoffen": {},
- "5200 bis 5290 Verbrauch von bezogenen Fertig- und Einzelteilen": {},
- "5300 bis 5390 Verbrauch von Hilfsstoffen": {},
- "5400 bis 5490 Verbrauch von Betriebsstoffen": {},
- "5500 bis 5590 Verbrauch von Werkzeugen und anderen Erzeugungshilfsmittel": {},
- "5600 bis 5690 Verbrauch von Brenn- und Treibstoffen, Energie und Wasser": {},
- "5700 bis 5790 Sonstige bezogene Herstellungsleistungen": {},
- "Aufwandsstellenrechnung": {},
- "Skontoertr\u00e4ge auf Materialaufwand": {},
- "Skontoertr\u00e4ge auf sonstige bezogene Herstellungsleistungen": {},
- "Wareneinkauf 10 %": {},
- "Wareneinkauf 20 %": {},
- "Wareneinkauf igErwerb 10 % VSt/10 % USt": {},
- "Wareneinkauf igErwerb 20 % VSt/20 % USt": {},
- "Wareneinkauf igErwerb ohne Vorsteuerabzug und 10 % USt": {},
- "Wareneinkauf igErwerb ohne Vorsteuerabzug und 20 % USt": {},
+ "Klasse 6: Personalaufwand": {
+ "6000 L\u00f6hne": {"account_type": "Payable"},
+ "6200 Geh\u00e4lter": {"account_type": "Payable"},
+ "6400 Aufwendungen f\u00fcr Abfertigungen": {"account_type": "Payable"},
+ "6450 Aufwendungen f\u00fcr Altersversorgung": {"account_type": "Payable"},
+ "6500 Gesetzlicher Sozialaufwand Arbeiter": {"account_type": "Payable"},
+ "6560 Gesetzlicher Sozialaufwand Angestellte": {"account_type": "Payable"},
+ "6600 Lohnabh\u00e4ngige Abgaben und Pflichtbeitr\u00e4gte": {"account_type": "Payable"},
+ "6660 Gehaltsabh\u00e4ngige Abgaben und Pflichtbeitr\u00e4gte": {"account_type": "Payable"},
+ "6700 Sonstige Sozialaufwendungen": {"account_type": "Payable"},
+ "6900 Aufwandsstellenrechnung Personal": {"account_type": "Payable"},
"root_type": "Expense"
+ },
+ "Klasse 7: Abschreibungen und sonstige betriebliche Aufwendungen": {
+ "7010 Abschreibungen auf das Anlageverm\u00f6gen (ausgenommen Finanzanlagen)": {"account_type": "Depreciation"},
+ "7100 Sonstige Steuern und Geb\u00fchren": {"account_type": "Tax"},
+ "7200 Instandhaltung u. Reinigung durch Dritte, Entsorgung, Energie": {"account_type": "Expense Account"},
+ "7300 Transporte durch Dritte": {"account_type": "Expense Account"},
+ "7310 Fahrrad - Aufwand": {"account_type": "Expense Account"},
+ "7320 Kfz - Aufwand": {"account_type": "Expense Account"},
+ "7330 LKW - Aufwand": {"account_type": "Expense Account"},
+ "7340 Lastenrad - Aufwand": {"account_type": "Expense Account"},
+ "7350 Reise- und Fahraufwand": {"account_type": "Expense Account"},
+ "7360 Tag- und N\u00e4chtigungsgelder": {"account_type": "Expense Account"},
+ "7380 Nachrichtenaufwand": {"account_type": "Expense Account"},
+ "7400 Miet- und Pachtaufwand": {"account_type": "Expense Account"},
+ "7440 Leasingaufwand": {"account_type": "Expense Account"},
+ "7480 Lizenzaufwand": {"account_type": "Expense Account"},
+ "7500 Aufwand f\u00fcr beigestelltes Personal": {"account_type": "Expense Account"},
+ "7540 Provisionen an Dritte": {"account_type": "Expense Account"},
+ "7580 Aufsichtsratsverg\u00fctungen": {"account_type": "Expense Account"},
+ "7610 Druckerzeugnisse und Vervielf\u00e4ltigungen": {"account_type": "Expense Account"},
+ "7650 Werbung und Repr\u00e4sentationen": {"account_type": "Expense Account"},
+ "7700 Versicherungen": {"account_type": "Expense Account"},
+ "7750 Beratungs- und Pr\u00fcfungsaufwand": {"account_type": "Expense Account"},
+ "7800 Forderungsverluste und Schadensf\u00e4lle": {"account_type": "Expense Account"},
+ "7840 Verschiedene betriebliche Aufwendungen": {"account_type": "Expense Account"},
+ "7910 Aufwandsstellenrechung der Hersteller": {"account_type": "Expense Account"},
+ "7060 Sofortabschreibungen geringwertig": {"account_type": "Expense Account"},
+ "7070 Abschreibungen vom Umlaufverm\u00f6gen, soweit diese die im Unternehmen \u00fcblichen Abschreibungen \u00fcbersteigen": {"account_type": "Depreciation"},
+ "7900 Aufwandsstellenrechnung": {"account_type": "Expense Account"},
+ "7770 Aus- und Fortbildung": {"account_type": "Expense Account"},
+ "7820 Buchwert abgegangener Anlagen, ausgenommen Finanzanlagen": {"account_type": "Expense Account"},
+ "7600 B\u00fcromaterial und Drucksorten": {"account_type": "Expense Account"},
+ "7630 Fachliteratur und Zeitungen ": {"account_type": "Expense Account"},
+ "7960 Herstellungskosten der zur Erzielung der Umsatzerl\u00f6se erbrachten Leistungen": {"account_type": "Expense Account"},
+ "7780 Mitgliedsbeitr\u00e4ge": {"account_type": "Expense Account"},
+ "7880 Skontoertr\u00e4ge auf sonstige betriebliche Aufwendungen": {"account_type": "Expense Account"},
+ "7990 Sonstige betrieblichen Aufwendungen": {"account_type": "Expense Account"},
+ "7680 Spenden und Trinkgelder": {"account_type": "Expense Account"},
+ "7790 Spesen des Geldverkehrs": {"account_type": "Expense Account"},
+ "7830 Verluste aus dem Abgang vom Anlageverm\u00f6gen, ausgenommen Finanzanlagen": {"account_type": "Expense Account"},
+ "7970 Vertriebskosten": {"account_type": "Expense Account"},
+ "7980 Verwaltungskosten": {"account_type": "Expense Account"},
+ "root_type": "Expense"
+ },
+ "Klasse 8: Finanz- und ausserordentliche Ertr\u00e4ge und Aufwendungen": {
+ "8000 Ertr\u00e4ge aus Beteiligungen": {"account_type": "Income Account"},
+ "8050 Ertr\u00e4ge aus anderen Wertpapieren und Ausleihungen des Finanzanlageverm\u00f6gens": {"account_type": "Income Account"},
+ "8100 Zinsen aus Bankguthaben": {"account_type": "Income Account"},
+ "8110 Zinsen aus gewaehrten Darlehen": {"account_type": "Income Account"},
+ "8130 Verzugszinsenertraege": {"account_type": "Income Account"},
+ "8220 Aufwendungen aus Beteiligungen": {"account_type": "Expense Account"},
+ "8260 Aufwendungen aus sonst. Fiananzanlagen und aus Wertpapieren des Umlaufverm\u00f6gens": {},
+ "8280 Zinsen und \u00e4hnliche Aufwendungem": {"account_type": "Expense Account"},
+ "8400 Au\u00dferordentliche Ertr\u00e4ge": {"account_type": "Income Account"},
+ "8450 Au\u00dferordentliche Aufwendungen": {"account_type": "Expense Account"},
+ "8500 Steuern vom Einkommen und vom Ertrag": {
+ "account_type": "Tax"
+ },
+ "8600 Aufl\u00f6sung unversteuerten R\u00fccklagen": {"account_type": "Income Account"},
+ "8700 Aufl\u00f6sung von Kapitalr\u00fccklagen": {"account_type": "Income Account"},
+ "8750 Aufl\u00f6sung von Gewinnr\u00fccklagen": {"account_type": "Income Account"},
+ "8800 Zuweisung zu unversteuerten R\u00fccklagen": {"account_type": "Expense Account"},
+ "8900 Zuweisung zu Gewinnr\u00fccklagen": {"account_type": "Expense Account"},
+ "8100 Buchwert abgegangener Beteiligungen": {"account_type": "Expense Account"},
+ "8130 Buchwert abgegangener Wertpapiere des Umlaufverm\u00f6gens": {"account_type": "Expense Account"},
+ "8120 Buchwert abgegangener sonstiger Finanzanlagen": {"account_type": "Expense Account"},
+ "8990 Gewinnabfuhr bzw. Verlust\u00fcberrechnung aus Ergebnisabf\u00fchrungsvertr\u00e4gen": {"account_type": "Expense Account"},
+ "8350 nicht ausgenutzte Lieferantenskonti": {"account_type": "Expense Account"},
+ "root_type": "Income"
+ },
+ "Klasse 9 Passiva: Eigenkapital, R\u00fccklagen, stille Einlagen, Abschlusskonten": {
+ "9000 Gezeichnetes bzw. gewidmetes Kapital": {
+ "account_type": "Equity"
+ },
+ "9200 Kapitalr\u00fccklagen": {
+ "account_type": "Equity"
+ },
+ "9300 Gewinnr\u00fccklagen": {
+ "account_type": "Equity"
+ },
+ "9400 Bewertungsreserven uns sonst. unversteuerte R\u00fccklagen": {
+ "account_type": "Equity"
+ },
+ "9600 Private Entnahmen": {"account_type": "Equity"},
+ "9610 Privatsteuern": {"account_type": "Equity"},
+ "9700 Einlagen stiller Gesellschafter ": {"account_type": "Equity"},
+ "9900 Evidenzkonto": {"account_type": "Equity"},
+ "9800 Er\u00f6ffnungsbilanzkonto (EBK)": {"account_type": "Equity"},
+ "9880 Jahresergebnis laut Gewinn- und Verlustrechnung (G+V)": {"account_type": "Equity"},
+ "9850 Schlussbilanzkonto (SBK)": {"account_type": "Round Off"},
+ "9190 nicht eingeforderte ausstehende Einlagen und berechtigte Entnahmen von Gesellschaftern": {
+ "account_type": "Equity"
+ },
+ "root_type": "Equity"
}
- }
-}
+ }
+ }
diff --git a/erpnext/accounts/doctype/account/chart_of_accounts/verified/hu_chart_of_accounts_for_microenterprises_with_account_number.json b/erpnext/accounts/doctype/account/chart_of_accounts/verified/hu_chart_of_accounts_for_microenterprises_with_account_number.json
new file mode 100644
index 0000000..2cd6c0f
--- /dev/null
+++ b/erpnext/accounts/doctype/account/chart_of_accounts/verified/hu_chart_of_accounts_for_microenterprises_with_account_number.json
@@ -0,0 +1,1654 @@
+{
+ "tree": {
+ "SZ\u00c1MLAOSZT\u00c1LY BEFEKTETETT ESZK\u00d6Z\u00d6K": {
+ "account_number": 1,
+ "root_type": "Asset",
+ "is_group": 1,
+ "IMMATERI\u00c1LIS JAVAK": {
+ "account_number": 11,
+ "root_type": "Asset",
+ "is_group": 1,
+ "Vagyoni \u00e9rt\u00e9k\u0171 jogok": {
+ "account_number": 113,
+ "root_type": "Asset",
+ "is_group": 1,
+ "Vagyoni \u00e9rt\u00e9k\u0171 jogok brutt\u00f3 \u00e9rt\u00e9ke": {
+ "account_number": 1131,
+ "root_type": "Asset"
+ },
+ "Vagyoni \u00e9rt\u00e9k\u0171 jogok terven fel\u00fcli \u00e9rt\u00e9kcs\u00f6kken\u00e9se \u00e9s annak vissza\u00edr\u00e1sa": {
+ "account_number": 1138,
+ "root_type": "Asset"
+ },
+ "Vagyoni \u00e9rt\u00e9k\u0171 jogok terv szerinti \u00e9rt\u00e9kcs\u00f6kken\u00e9se": {
+ "account_number": 1139,
+ "root_type": "Asset"
+ }
+ },
+ "Szellemi term\u00e9kek": {
+ "account_number": 114,
+ "root_type": "Asset",
+ "is_group": 1,
+ "Szellemi term\u00e9kek brutt\u00f3 \u00e9rt\u00e9ke": {
+ "account_number": 1141,
+ "root_type": "Asset"
+ },
+ "Szellemi term\u00e9kek terven fel\u00fcli \u00e9rt\u00e9kcs\u00f6kken\u00e9se \u00e9s annak vissza\u00edr\u00e1sa": {
+ "account_number": 1148,
+ "root_type": "Asset"
+ },
+ "Szellemi term\u00e9kek terv szerinti \u00e9rt\u00e9kcs\u00f6kken\u00e9se": {
+ "account_number": 1149,
+ "root_type": "Asset"
+ }
+ },
+ "Kis \u00e9rt\u00e9k\u0171 immateri\u00e1lis javak": {
+ "account_number": 119,
+ "root_type": "Asset",
+ "is_group": 1,
+ "Kis \u00e9rt\u00e9k\u0171 immateri\u00e1lis javak brutt\u00f3 \u00e9rt\u00e9ke": {
+ "account_number": 1191,
+ "root_type": "Asset"
+ },
+ "Kis \u00e9rt\u00e9k\u0171 immateri\u00e1lis javak terv szerinti \u00e9rt\u00e9kcs\u00f6kken\u00e9se": {
+ "account_number": 1199,
+ "root_type": "Asset"
+ }
+ }
+ },
+ "INGATLANOK \u00c9S KAPCSOL\u00d3D\u00d3 VAGYONI \u00c9RT\u00c9K\u0170 JOGOK": {
+ "account_number": 12,
+ "root_type": "Asset",
+ "is_group": 1,
+ "Telkek, f\u00f6ldter\u00fcletek": {
+ "account_number": 121,
+ "root_type": "Asset",
+ "is_group": 1,
+ "Telkek, f\u00f6ldter\u00fcletek brutt\u00f3 \u00e9rt\u00e9ke": {
+ "account_number": 1211,
+ "root_type": "Asset"
+ },
+ "Telkek, f\u00f6ldter\u00fcletek terven fel\u00fcli \u00e9rt\u00e9kcs\u00f6kken\u00e9se \u00e9s annak vissza\u00edr\u00e1sa": {
+ "account_number": 1218,
+ "root_type": "Asset"
+ },
+ "Telkek, f\u00f6ldter\u00fcletek terv szerinti \u00e9rt\u00e9kcs\u00f6kken\u00e9se": {
+ "account_number": 1219,
+ "root_type": "Asset"
+ }
+ },
+ "Ingatlanokhoz kapcsol\u00f3d\u00f3 vagyoni \u00e9rt\u00e9k\u0171 jogok": {
+ "account_number": 122,
+ "root_type": "Asset",
+ "is_group": 1,
+ "Ingatlanokhoz kapcsol\u00f3d\u00f3 vagyoni \u00e9rt\u00e9k\u0171 jogok brutt\u00f3 \u00e9rt\u00e9ke": {
+ "account_number": 1221,
+ "root_type": "Asset"
+ },
+ "Ingatlanokhoz kapcsol\u00f3d\u00f3 vagyoni \u00e9rt\u00e9k\u0171 jogok terven fel\u00fcli \u00e9rt\u00e9kcs\u00f6kken\u00e9se \u00e9s annak vissza\u00edr\u00e1sa": {
+ "account_number": 1228,
+ "root_type": "Asset"
+ },
+ "Ingatlanokhoz kapcsol\u00f3d\u00f3 vagyoni \u00e9rt\u00e9k\u0171 jogok terv szerinti \u00e9rt\u00e9kcs\u00f6kken\u00e9se": {
+ "account_number": 1229,
+ "root_type": "Asset"
+ }
+ },
+ "\u00c9p\u00fcletek, \u00e9p\u00fcletr\u00e9szek, tulajdoni h\u00e1nyadok": {
+ "account_number": 123,
+ "root_type": "Asset",
+ "is_group": 1,
+ "\u00c9p\u00fcletek, \u00e9p\u00fcletr\u00e9szek, tulajdoni h\u00e1nyadok brutt\u00f3 \u00e9rt\u00e9ke": {
+ "account_number": 1231,
+ "root_type": "Asset"
+ },
+ "\u00c9p\u00fcletek, \u00e9p\u00fcletr\u00e9szek, tulajdoni h\u00e1nyadok terven fel\u00fcli \u00e9rt\u00e9kcs\u00f6kken\u00e9se \u00e9s annak vissza\u00edr\u00e1sa": {
+ "account_number": 1238,
+ "root_type": "Asset"
+ },
+ "\u00c9p\u00fcletek, \u00e9p\u00fcletr\u00e9szek, tulajdoni h\u00e1nyadok terv szerinti \u00e9rt\u00e9kcs\u00f6kken\u00e9se": {
+ "account_number": 1239,
+ "root_type": "Asset"
+ }
+ },
+ "Egy\u00e9b ingatlanok": {
+ "account_number": 124,
+ "root_type": "Asset",
+ "is_group": 1,
+ "Egy\u00e9b ingatlanok brutt\u00f3 \u00e9rt\u00e9ke": {
+ "account_number": 1241,
+ "root_type": "Asset"
+ },
+ "Egy\u00e9b ingatlanok terven fel\u00fcli \u00e9rt\u00e9kcs\u00f6kken\u00e9se \u00e9s annak vissza\u00edr\u00e1sa": {
+ "account_number": 1248,
+ "root_type": "Asset"
+ },
+ "Egy\u00e9b ingatlanok terv szerinti \u00e9rt\u00e9kcs\u00f6kken\u00e9se": {
+ "account_number": 1249,
+ "root_type": "Asset"
+ }
+ },
+ "Kis \u00e9rt\u00e9k\u0171 ingatlanok": {
+ "account_number": 129,
+ "root_type": "Asset",
+ "is_group": 1,
+ "Kis \u00e9rt\u00e9k\u0171 ingatlanok brutt\u00f3 \u00e9rt\u00e9ke": {
+ "account_number": 1291,
+ "root_type": "Asset"
+ },
+ "Kis \u00e9rt\u00e9k\u0171 ingatlanok terv szerinti \u00e9rt\u00e9kcs\u00f6kken\u00e9se": {
+ "account_number": 1299,
+ "root_type": "Asset"
+ }
+ }
+ },
+ "M\u0170SZAKI BERENDEZ\u00c9SEK, G\u00c9PEK, J\u00c1RM\u0170VEK": {
+ "account_number": 13,
+ "root_type": "Asset",
+ "is_group": 1,
+ "Termel\u0151 g\u00e9pek, berendez\u00e9sek": {
+ "account_number": 131,
+ "root_type": "Asset",
+ "is_group": 1,
+ "Termel\u0151 g\u00e9pek, berendez\u00e9sek brutt\u00f3 \u00e9rt\u00e9ke": {
+ "account_number": 1311,
+ "root_type": "Asset"
+ },
+ "Termel\u0151 g\u00e9pek, berendez\u00e9sek terven fel\u00fcli \u00e9rt\u00e9kcs\u00f6kken\u00e9se \u00e9s annak vissza\u00edr\u00e1sa": {
+ "account_number": 1318,
+ "root_type": "Asset"
+ },
+ "Termel\u0151 g\u00e9pek, berendez\u00e9sek terv szerinti \u00e9rt\u00e9kcs\u00f6kken\u00e9se": {
+ "account_number": 1319,
+ "root_type": "Asset"
+ }
+ },
+ "M\u0171szaki j\u00e1rm\u0171vek": {
+ "account_number": 132,
+ "root_type": "Asset",
+ "is_group": 1,
+ "M\u0171szaki j\u00e1rm\u0171vek brutt\u00f3 \u00e9rt\u00e9ke": {
+ "account_number": 1321,
+ "root_type": "Asset"
+ },
+ "M\u0171szaki j\u00e1rm\u0171vek terven fel\u00fcli \u00e9rt\u00e9kcs\u00f6kken\u00e9se \u00e9s annak vissza\u00edr\u00e1sa": {
+ "account_number": 1328,
+ "root_type": "Asset"
+ },
+ "M\u0171szaki j\u00e1rm\u0171vek terv szerinti \u00e9rt\u00e9kcs\u00f6kken\u00e9se": {
+ "account_number": 1329,
+ "root_type": "Asset"
+ }
+ },
+ "Ki nem emelt m\u0171szaki berendez\u00e9sek, g\u00e9pek, j\u00e1rm\u0171vek": {
+ "account_number": 133,
+ "root_type": "Asset",
+ "is_group": 1,
+ "Ki nem emelt m\u0171szaki berendez\u00e9sek, g\u00e9pek, j\u00e1rm\u0171vek brutt\u00f3 \u00e9rt\u00e9ke": {
+ "account_number": 1331,
+ "root_type": "Asset"
+ },
+ "Ki nem emelt m\u0171szaki berendez\u00e9sek, g\u00e9pek, j\u00e1rm\u0171vek terven fel\u00fcli \u00e9rt\u00e9kcs\u00f6kken\u00e9se \u00e9s annak vissza\u00edr\u00e1sa": {
+ "account_number": 1338,
+ "root_type": "Asset"
+ },
+ "Ki nem emelt m\u0171szaki berendez\u00e9sek, g\u00e9pek, j\u00e1rm\u0171vek terv szerinti \u00e9rt\u00e9kcs\u00f6kken\u00e9se": {
+ "account_number": 1339,
+ "root_type": "Asset"
+ }
+ },
+ "Kis \u00e9rt\u00e9k\u0171 m\u0171szaki berendez\u00e9sek, g\u00e9pek, j\u00e1rm\u0171vek": {
+ "account_number": 139,
+ "root_type": "Asset",
+ "is_group": 1,
+ "Kis \u00e9rt\u00e9k\u0171 m\u0171szaki berendez\u00e9sek, g\u00e9pek, j\u00e1rm\u0171vek brutt\u00f3 \u00e9rt\u00e9ke": {
+ "account_number": 1391,
+ "root_type": "Asset"
+ },
+ "Kis \u00e9rt\u00e9k\u0171 m\u0171szaki berendez\u00e9sek, g\u00e9pek, j\u00e1rm\u0171vek terv szerinti \u00e9rt\u00e9kcs\u00f6kken\u00e9se": {
+ "account_number": 1399,
+ "root_type": "Asset"
+ }
+ }
+ },
+ "EGY\u00c9B BERENDEZ\u00c9SEK, FELSZEREL\u00c9SEK, J\u00c1RM\u0170VEK": {
+ "account_number": 14,
+ "root_type": "Asset",
+ "is_group": 1,
+ "Egy\u00e9b (\u00fczemi \u00fczleti), berendez\u00e9sek, felszerel\u00e9sek": {
+ "account_number": 141,
+ "root_type": "Asset",
+ "is_group": 1,
+ "Egy\u00e9b (\u00fczemi \u00fczleti), berendez\u00e9sek, felszerel\u00e9sek brutt\u00f3 \u00e9rt\u00e9ke": {
+ "account_number": 1411,
+ "root_type": "Asset"
+ },
+ "Egy\u00e9b (\u00fczemi \u00fczleti), berendez\u00e9sek, felszerel\u00e9sek terven fel\u00fcli \u00e9rt\u00e9kcs\u00f6kken\u00e9se \u00e9s annak vissza\u00edr\u00e1sa": {
+ "account_number": 1418,
+ "root_type": "Asset"
+ },
+ "Egy\u00e9b (\u00fczemi \u00fczleti), berendez\u00e9sek, felszerel\u00e9sek terv szerinti \u00e9rt\u00e9kcs\u00f6kken\u00e9se": {
+ "account_number": 1419,
+ "root_type": "Asset"
+ }
+ },
+ "Egy\u00e9b j\u00e1rm\u0171vek": {
+ "account_number": 142,
+ "root_type": "Asset",
+ "is_group": 1,
+ "Egy\u00e9b j\u00e1rm\u0171vek brutt\u00f3 \u00e9rt\u00e9ke": {
+ "account_number": 1421,
+ "root_type": "Asset"
+ },
+ "Egy\u00e9b j\u00e1rm\u0171vek terven fel\u00fcli \u00e9rt\u00e9kcs\u00f6kken\u00e9se \u00e9s annak vissza\u00edr\u00e1sa": {
+ "account_number": 1428,
+ "root_type": "Asset"
+ },
+ "Egy\u00e9b j\u00e1rm\u0171vek terv szerinti \u00e9rt\u00e9kcs\u00f6kken\u00e9se": {
+ "account_number": 1429,
+ "root_type": "Asset"
+ }
+ },
+ "Irodai, igazgat\u00e1si berendez\u00e9sek \u00e9s felszerel\u00e9sek": {
+ "account_number": 143,
+ "root_type": "Asset",
+ "is_group": 1,
+ "Irodai, igazgat\u00e1si berendez\u00e9sek \u00e9s felszerel\u00e9sek brutt\u00f3 \u00e9rt\u00e9ke": {
+ "account_number": 1431,
+ "root_type": "Asset"
+ },
+ "Irodai, igazgat\u00e1si berendez\u00e9sek \u00e9s felszerel\u00e9sek terven fel\u00fcli \u00e9rt\u00e9kcs\u00f6kken\u00e9se \u00e9s annak vissza\u00edr\u00e1sa": {
+ "account_number": 1438,
+ "root_type": "Asset"
+ },
+ "Irodai, igazgat\u00e1si berendez\u00e9sek \u00e9s felszerel\u00e9sek terv szerinti \u00e9rt\u00e9kcs\u00f6kken\u00e9se": {
+ "account_number": 1439,
+ "root_type": "Asset"
+ }
+ },
+ "Ki nem emelt egy\u00e9b berendez\u00e9sek, felszerel\u00e9sek": {
+ "account_number": 144,
+ "root_type": "Asset",
+ "is_group": 1,
+ "Ki nem emelt egy\u00e9b berendez\u00e9sek, felszerel\u00e9sek brutt\u00f3 \u00e9rt\u00e9ke": {
+ "account_number": 1441,
+ "root_type": "Asset"
+ },
+ "Ki nem emelt egy\u00e9b berendez\u00e9sek, felszerel\u00e9sek terven fel\u00fcli \u00e9rt\u00e9kcs\u00f6kken\u00e9se \u00e9s annak vissza\u00edr\u00e1sa": {
+ "account_number": 1448,
+ "root_type": "Asset"
+ },
+ "Ki nem emelt egy\u00e9b berendez\u00e9sek, felszerel\u00e9sek terv szerinti \u00e9rt\u00e9kcs\u00f6kken\u00e9se": {
+ "account_number": 1449,
+ "root_type": "Asset"
+ }
+ },
+ "Kis \u00e9rt\u00e9k\u0171 egy\u00e9b berendez\u00e9sek, felszerel\u00e9sek, j\u00e1rm\u0171vek": {
+ "account_number": 149,
+ "root_type": "Asset",
+ "is_group": 1,
+ "Kis \u00e9rt\u00e9k\u0171 egy\u00e9b berendez\u00e9sek, felszerel\u00e9sek, j\u00e1rm\u0171vek brutt\u00f3 \u00e9rt\u00e9ke": {
+ "account_number": 1491,
+ "root_type": "Asset"
+ },
+ "Kis \u00e9rt\u00e9k\u0171 egy\u00e9b berendez\u00e9sek, felszerel\u00e9sek, j\u00e1rm\u0171vek terv szerinti \u00e9rt\u00e9kcs\u00f6kken\u00e9se": {
+ "account_number": 1499,
+ "root_type": "Asset"
+ }
+ }
+ },
+ "TENY\u00c9SZ\u00c1LLATOK": {
+ "account_number": 15,
+ "root_type": "Asset",
+ "is_group": 1,
+ "Teny\u00e9szt\u00e9sben hasznos\u00edtott \u00e1llatok": {
+ "account_number": 151,
+ "root_type": "Asset",
+ "is_group": 1,
+ "Teny\u00e9szt\u00e9sben hasznos\u00edtott \u00e1llatok brutt\u00f3 \u00e9rt\u00e9ke": {
+ "account_number": 1511,
+ "root_type": "Asset"
+ },
+ "Teny\u00e9szt\u00e9sben hasznos\u00edtott \u00e1llatok terven fel\u00fcli \u00e9rt\u00e9kcs\u00f6kken\u00e9se \u00e9s annak vissza\u00edr\u00e1sa": {
+ "account_number": 1518,
+ "root_type": "Asset"
+ },
+ "Teny\u00e9szt\u00e9sben hasznos\u00edtott \u00e1llatok terv szerinti \u00e9rt\u00e9kcs\u00f6kken\u00e9se": {
+ "account_number": 1519,
+ "root_type": "Asset"
+ }
+ },
+ "Ig\u00e1s\u00e1llatok": {
+ "account_number": 152,
+ "root_type": "Asset",
+ "is_group": 1,
+ "Ig\u00e1s\u00e1llatok brutt\u00f3 \u00e9rt\u00e9ke": {
+ "account_number": 1521,
+ "root_type": "Asset"
+ },
+ "Ig\u00e1s\u00e1llatok terven fel\u00fcli \u00e9rt\u00e9kcs\u00f6kken\u00e9se \u00e9s annak vissza\u00edr\u00e1sa": {
+ "account_number": 1528,
+ "root_type": "Asset"
+ },
+ "Ig\u00e1s\u00e1llatok terv szerinti \u00e9rt\u00e9kcs\u00f6kken\u00e9se": {
+ "account_number": 1529,
+ "root_type": "Asset"
+ }
+ },
+ "Egy\u00e9b teny\u00e9sz\u00e1llatok": {
+ "account_number": 153,
+ "root_type": "Asset",
+ "is_group": 1,
+ "Egy\u00e9b teny\u00e9sz\u00e1llatok brutt\u00f3 \u00e9rt\u00e9ke": {
+ "account_number": 1531,
+ "root_type": "Asset"
+ },
+ "Egy\u00e9b teny\u00e9sz\u00e1llatok terven fel\u00fcli \u00e9rt\u00e9kcs\u00f6kken\u00e9se \u00e9s annak vissza\u00edr\u00e1sa": {
+ "account_number": 1538,
+ "root_type": "Asset"
+ },
+ "Egy\u00e9b teny\u00e9sz\u00e1llatok terv szerinti \u00e9rt\u00e9kcs\u00f6kken\u00e9se": {
+ "account_number": 1539,
+ "root_type": "Asset"
+ }
+ },
+ "Kis \u00e9rt\u00e9k\u0171 teny\u00e9sz\u00e1llatok": {
+ "account_number": 159,
+ "root_type": "Asset",
+ "is_group": 1,
+ "Kis \u00e9rt\u00e9k\u0171 teny\u00e9sz\u00e1llatok brutt\u00f3 \u00e9rt\u00e9ke": {
+ "account_number": 1591,
+ "root_type": "Asset"
+ },
+ "Kis \u00e9rt\u00e9k\u0171 teny\u00e9sz\u00e1llatok terv szerinti \u00e9rt\u00e9kcs\u00f6kken\u00e9se": {
+ "account_number": 1599,
+ "root_type": "Asset"
+ }
+ }
+ },
+ "BERUH\u00c1Z\u00c1SOK, FEL\u00daJ\u00cdT\u00c1SOK": {
+ "account_number": 16,
+ "root_type": "Asset",
+ "is_group": 1,
+ "Beruh\u00e1z\u00e1sok": {
+ "account_number": 161,
+ "root_type": "Asset"
+ },
+ "Fel\u00faj\u00edt\u00e1sok": {
+ "account_number": 162,
+ "root_type": "Asset"
+ },
+ "Beruh\u00e1z\u00e1sok, fel\u00faj\u00edt\u00e1sok terven fel\u00fcli \u00e9rt\u00e9kcs\u00f6kken\u00e9se \u00e9s annak vissza\u00edr\u00e1sa": {
+ "account_number": 168,
+ "root_type": "Asset"
+ }
+ },
+ "TULAJDONI R\u00c9SZESED\u00c9ST JELENT\u0150 BEFEKTET\u00c9SEK (R\u00c9SZESED\u00c9SEK)": {
+ "account_number": 17,
+ "root_type": "Asset",
+ "is_group": 1,
+ "Tart\u00f3s r\u00e9szesed\u00e9sek": {
+ "account_number": 171,
+ "root_type": "Asset"
+ },
+ "R\u00e9szesed\u00e9sek \u00e9rt\u00e9kveszt\u00e9se \u00e9s annak vissza\u00edr\u00e1sa": {
+ "account_number": 179,
+ "root_type": "Asset"
+ }
+ },
+ "HITELVISZONYT MEGTESTES\u00cdT\u0150 \u00c9RT\u00c9KPAP\u00cdROK": {
+ "account_number": 18,
+ "root_type": "Asset",
+ "is_group": 1,
+ "\u00c1llamk\u00f6tv\u00e9nyek": {
+ "account_number": 181,
+ "root_type": "Asset"
+ },
+ "Tart\u00f3s diszkont \u00e9rt\u00e9kpap\u00edrok": {
+ "account_number": 182,
+ "root_type": "Asset"
+ },
+ "V\u00e1llalkoz\u00e1sok \u00e1ltal kibocs\u00e1tott tart\u00f3s \u00e9rt\u00e9kpap\u00edrok": {
+ "account_number": 183,
+ "root_type": "Asset"
+ },
+ "Egy\u00e9b hitelviszonyt megtestes\u00edt\u0151 \u00e9rt\u00e9kpap\u00edrok": {
+ "account_number": 184,
+ "root_type": "Asset"
+ },
+ "Tart\u00f3s \u00e9rt\u00e9kpap\u00edrok \u00e9rt\u00e9kveszt\u00e9se \u00e9s annak vissza\u00edr\u00e1sa": {
+ "account_number": 189,
+ "root_type": "Asset"
+ }
+ },
+ "TART\u00d3SAN ADOTT K\u00d6LCS\u00d6N\u00d6K (tart\u00f3s bankbet\u00e9tek)": {
+ "account_number": 19,
+ "root_type": "Asset",
+ "is_group": 1,
+ "Tart\u00f3san adott k\u00f6lcs\u00f6n\u00f6k": {
+ "account_number": 191,
+ "root_type": "Asset"
+ },
+ "Tart\u00f3s bankbet\u00e9tek": {
+ "account_number": 192,
+ "root_type": "Asset"
+ },
+ "Tart\u00f3san adott k\u00f6lcs\u00f6n\u00f6k (\u00e9s bankbet\u00e9tek) \u00e9rt\u00e9kveszt\u00e9se \u00e9s annak vissza\u00edr\u00e1sa": {
+ "account_number": 199,
+ "root_type": "Asset"
+ }
+ }
+ },
+ "SZ\u00c1MLAOSZT\u00c1LY K\u00c9SZLETEK": {
+ "account_number": 2,
+ "root_type": "Asset",
+ "is_group": 1,
+ "ANYAGOK": {
+ "account_number": "21-22",
+ "root_type": "Asset",
+ "is_group": 1,
+ "Nyers \u00e9s alapanyagok": {
+ "account_number": 211,
+ "root_type": "Asset"
+ },
+ "Seg\u00e9danyagok": {
+ "account_number": 221,
+ "root_type": "Asset"
+ },
+ "\u00dczem \u00e9s f\u0171t\u0151anyagok": {
+ "account_number": 222,
+ "root_type": "Asset"
+ },
+ "Fenntart\u00e1si anyagok": {
+ "account_number": 223,
+ "root_type": "Asset"
+ },
+ "\u00c9p\u00edt\u00e9si anyagok": {
+ "account_number": 224,
+ "root_type": "Asset"
+ },
+ "Egy \u00e9ven bel\u00fcl elhaszn\u00e1l\u00f3d\u00f3 anyagi eszk\u00f6z\u00f6k": {
+ "account_number": 225,
+ "root_type": "Asset"
+ },
+ "T\u00e1rgyi eszk\u00f6z\u00f6k k\u00f6z\u00fcl \u00e1tsorolt anyagok": {
+ "account_number": 226,
+ "root_type": "Asset"
+ },
+ "Egy\u00e9b anyagok": {
+ "account_number": 227,
+ "root_type": "Asset"
+ },
+ "Anyagok \u00e9rt\u00e9kveszt\u00e9se \u00e9s annak vissza\u00edr\u00e1sa": {
+ "account_number": 229,
+ "root_type": "Asset"
+ }
+ },
+ "BEFEJEZETLEN TERMEL\u00c9S \u00c9S F\u00c9LK\u00c9SZ TERM\u00c9KEK": {
+ "account_number": 23,
+ "root_type": "Asset",
+ "is_group": 1,
+ "Befejezetlen termel\u00e9s": {
+ "account_number": 231,
+ "root_type": "Asset"
+ },
+ "F\u00e9lk\u00e9sz term\u00e9kek": {
+ "account_number": 232,
+ "root_type": "Asset"
+ },
+ "Befejezetlen termel\u00e9s \u00e9s f\u00e9lk\u00e9sz term\u00e9kek \u00e9rt\u00e9kveszt\u00e9se \u00e9s annak vissza\u00edr\u00e1sa": {
+ "account_number": 239,
+ "root_type": "Asset"
+ }
+ },
+ "N\u00d6VEND\u00c9K, H\u00cdZ\u00d3 \u00c9S EGY\u00c9B \u00c1LLATOK": {
+ "account_number": 24,
+ "root_type": "Asset",
+ "is_group": 1,
+ "N\u00f6vend\u00e9k\u00e1llatok": {
+ "account_number": 241,
+ "root_type": "Asset"
+ },
+ "H\u00edz\u00f3\u00e1llatok": {
+ "account_number": 242,
+ "root_type": "Asset"
+ },
+ "Egy\u00e9b \u00e1llatok": {
+ "account_number": 243,
+ "root_type": "Asset"
+ },
+ "B\u00e9rbevett \u00e1llatok": {
+ "account_number": 244,
+ "root_type": "Asset"
+ },
+ "\u00c1llatok \u00e9rt\u00e9kveszt\u00e9se \u00e9s annak vissza\u00edr\u00e1sa": {
+ "account_number": 249,
+ "root_type": "Asset"
+ }
+ },
+ "K\u00c9SZTERM\u00c9KEK": {
+ "account_number": 25,
+ "root_type": "Asset",
+ "is_group": 1,
+ "K\u00e9szterm\u00e9kek": {
+ "account_number": 251,
+ "root_type": "Asset"
+ },
+ "K\u00e9szterm\u00e9kek \u00e9rt\u00e9kveszt\u00e9se \u00e9s annak vissza\u00edr\u00e1sa": {
+ "account_number": 259,
+ "root_type": "Asset"
+ }
+ },
+ "KERESKEDELMI \u00c1RUK": {
+ "account_number": 26,
+ "root_type": "Asset",
+ "is_group": 1,
+ "Kereskedelmi \u00e1ruk": {
+ "account_number": 261,
+ "root_type": "Asset"
+ },
+ "Idegen helyen t\u00e1rolt, bizom\u00e1nyba \u00e1tadott \u00e1ruk": {
+ "account_number": 262,
+ "root_type": "Asset"
+ },
+ "T\u00e1rgyi eszk\u00f6z\u00f6k k\u00f6z\u00fcl \u00e1tsorolt \u00e1ruk": {
+ "account_number": 263,
+ "root_type": "Asset"
+ },
+ "Bels\u0151 (egys\u00e9gek, tev\u00e9kenys\u00e9gek k\u00f6z\u00f6tti) \u00e1tad\u00e1s\u00e1tv\u00e9tel \u00fctk\u00f6z\u0151sz\u00e1mla": {
+ "account_number": 264,
+ "root_type": "Asset"
+ },
+ "Kereskedelmi \u00e1ruk \u00e9rt\u00e9kveszt\u00e9se \u00e9s annak vissza\u00edr\u00e1sa": {
+ "account_number": 269,
+ "root_type": "Asset"
+ }
+ },
+ "K\u00d6ZVET\u00cdTETT SZOLG\u00c1LTAT\u00c1SOK": {
+ "account_number": 27,
+ "root_type": "Asset",
+ "is_group": 1,
+ "K\u00f6zvet\u00edtett szolg\u00e1ltat\u00e1sok": {
+ "account_number": 271,
+ "root_type": "Asset"
+ },
+ "K\u00f6zvet\u00edtett szolg\u00e1ltat\u00e1sok \u00e9rt\u00e9kveszt\u00e9se \u00e9s annak vissza\u00edr\u00e1sa": {
+ "account_number": 279,
+ "root_type": "Asset"
+ }
+ },
+ "BET\u00c9TD\u00cdJAS G\u00d6NGY\u00d6LEGEK": {
+ "account_number": 28,
+ "root_type": "Asset",
+ "is_group": 1,
+ "Bet\u00e9td\u00edjas g\u00f6ngy\u00f6legek": {
+ "account_number": 281,
+ "root_type": "Asset"
+ },
+ "Bet\u00e9td\u00edjas g\u00f6ngy\u00f6legek \u00e9rt\u00e9kveszt\u00e9se \u00e9s annak vissza\u00edr\u00e1sa": {
+ "account_number": 289,
+ "root_type": "Asset"
+ }
+ }
+ },
+ "SZ\u00c1MLAOSZT\u00c1LY K\u00d6VETEL\u00c9SEK, P\u00c9NZ\u00dcGYI ESZK\u00d6Z\u00d6K \u00c9S AKT\u00cdV ID\u0150BELI ELHAT\u00c1ROL\u00c1SOK": {
+ "account_number": 3,
+ "root_type": "Asset",
+ "is_group": 1,
+ "K\u00d6VETEL\u00c9SEK \u00c1RUSZ\u00c1LL\u00cdT\u00c1SB\u00d3L \u00c9S SZOLG\u00c1LTAT\u00c1SB\u00d3L (VEV\u0150K)": {
+ "account_number": 31,
+ "root_type": "Asset",
+ "is_group": 1,
+ "Vev\u0151k\u00f6vetel\u00e9sek": {
+ "account_number": 311,
+ "root_type": "Asset"
+ },
+ "Vev\u0151k\u00f6vetel\u00e9sek \u00e9rt\u00e9kveszt\u00e9se": {
+ "account_number": 319,
+ "root_type": "Asset"
+ }
+ },
+ "K\u00d6VETEL\u00c9SEK TULAJDONOSSAL SZEMBEN": {
+ "account_number": 33,
+ "root_type": "Asset",
+ "is_group": 1,
+ "Jegyzett, de m\u00e9g be nem fizetett t\u0151ke": {
+ "account_number": 331,
+ "root_type": "Asset"
+ }
+ },
+ "V\u00c1LT\u00d3K\u00d6VETEL\u00c9SEK": {
+ "account_number": 34,
+ "root_type": "Asset",
+ "is_group": 1,
+ "V\u00e1lt\u00f3k\u00f6vetel\u00e9sek": {
+ "account_number": 341,
+ "root_type": "Asset"
+ },
+ "V\u00e1lt\u00f3k\u00f6vetel\u00e9sek \u00e9rt\u00e9kveszt\u00e9se": {
+ "account_number": 349,
+ "root_type": "Asset"
+ }
+ },
+ "ADOTT EL\u0150LEGEK": {
+ "account_number": 35,
+ "root_type": "Asset",
+ "is_group": 1,
+ "Immateri\u00e1lis javakra adott el\u0151legek": {
+ "account_number": 351,
+ "root_type": "Asset"
+ },
+ "Beruh\u00e1z\u00e1sokra adott el\u0151legek": {
+ "account_number": 352,
+ "root_type": "Asset"
+ },
+ "K\u00e9szletekre adott el\u0151legek": {
+ "account_number": 353,
+ "root_type": "Asset"
+ },
+ "Egy\u00e9b c\u00e9lra adott el\u0151legek": {
+ "account_number": 354,
+ "root_type": "Asset"
+ },
+ "Adott el\u0151legek \u00e9rt\u00e9kveszt\u00e9se": {
+ "account_number": 359,
+ "root_type": "Asset"
+ }
+ },
+ "EGY\u00c9B K\u00d6VETEL\u00c9SEK": {
+ "account_number": 36,
+ "root_type": "Asset",
+ "is_group": 1,
+ "Munkav\u00e1llal\u00f3kkal szembeni k\u00f6vetel\u00e9sek": {
+ "account_number": 361,
+ "root_type": "Asset"
+ },
+ "K\u00f6lts\u00e9gvet\u00e9ssel szembeni k\u00f6vetel\u00e9sek": {
+ "account_number": 362,
+ "root_type": "Asset"
+ },
+ "R\u00f6vid lej\u00e1ratra k\u00f6lcs\u00f6nadott p\u00e9nzeszk\u00f6z\u00f6k": {
+ "account_number": 363,
+ "root_type": "Asset"
+ },
+ "R\u00e9szesed\u00e9sekkel, \u00e9rt\u00e9kpap\u00edrokkal kapcsolatos k\u00f6vetel\u00e9sek": {
+ "account_number": 364,
+ "root_type": "Asset"
+ },
+ "K\u00fcl\u00f6nf\u00e9le egy\u00e9b k\u00f6vetel\u00e9sek": {
+ "account_number": 365,
+ "root_type": "Asset"
+ },
+ "Egy\u00e9b k\u00f6vetel\u00e9sek \u00e9rt\u00e9kveszt\u00e9se": {
+ "account_number": 369,
+ "root_type": "Asset"
+ }
+ },
+ "\u00c9RT\u00c9KPAP\u00cdROK": {
+ "account_number": 37,
+ "root_type": "Asset",
+ "is_group": 1,
+ "R\u00e9szesed\u00e9sek": {
+ "account_number": 371,
+ "root_type": "Asset"
+ },
+ "Saj\u00e1t r\u00e9szv\u00e9nyek, saj\u00e1t \u00fczletr\u00e9szek": {
+ "account_number": 372,
+ "root_type": "Asset"
+ },
+ "Forgat\u00e1si c\u00e9l\u00fa hitelviszonyt megtestes\u00edt\u0151 \u00e9rt\u00e9kpap\u00edrok": {
+ "account_number": 373,
+ "root_type": "Asset"
+ },
+ "\u00c9rt\u00e9kpap\u00edr elsz\u00e1mol\u00e1si sz\u00e1mla": {
+ "account_number": 378,
+ "root_type": "Asset"
+ },
+ "\u00c9rt\u00e9kpap\u00edrok \u00e9rt\u00e9kveszt\u00e9se": {
+ "account_number": 379,
+ "root_type": "Asset"
+ }
+ },
+ "P\u00c9NZESZK\u00d6Z\u00d6K": {
+ "account_number": 38,
+ "root_type": "Asset",
+ "is_group": 1,
+ "P\u00e9nzt\u00e1r": {
+ "account_number": 381,
+ "root_type": "Asset"
+ },
+ "Valutap\u00e9nzt\u00e1r": {
+ "account_number": 382,
+ "root_type": "Asset"
+ },
+ "Csekkek": {
+ "account_number": 383,
+ "root_type": "Asset"
+ },
+ "Elsz\u00e1mol\u00e1si bet\u00e9tsz\u00e1mla": {
+ "account_number": 384,
+ "root_type": "Asset"
+ },
+ "Elk\u00fcl\u00f6n\u00edtett bet\u00e9tsz\u00e1mla": {
+ "account_number": 385,
+ "root_type": "Asset"
+ },
+ "Devizabet\u00e9tsz\u00e1mla": {
+ "account_number": 386,
+ "root_type": "Asset"
+ },
+ "Elektronikus p\u00e9nz": {
+ "account_number": 387,
+ "root_type": "Asset"
+ },
+ "\u00c1tvezet\u00e9si sz\u00e1mla": {
+ "account_number": 389,
+ "root_type": "Asset"
+ }
+ },
+ "AKT\u00cdV ID\u0150BELI ELHAT\u00c1ROL\u00c1SOK": {
+ "account_number": 39,
+ "root_type": "Asset",
+ "is_group": 1,
+ "Akt\u00edv id\u0151beli elhat\u00e1rol\u00e1sok": {
+ "account_number": 391,
+ "root_type": "Asset"
+ }
+ }
+ },
+ "SZ\u00c1MLAOSZT\u00c1LY FORR\u00c1SOK": {
+ "account_number": 4,
+ "root_type": "Liability",
+ "is_group": 1,
+ "SAJ\u00c1T T\u0150KE": {
+ "account_number": 41,
+ "root_type": "Liability",
+ "is_group": 1,
+ "account_type": "Equity",
+ "Jegyzett t\u0151ke": {
+ "account_number": 411,
+ "root_type": "Liability",
+ "account_type": "Equity"
+ },
+ "T\u0151ketartal\u00e9k": {
+ "account_number": 412,
+ "root_type": "Liability",
+ "account_type": "Equity"
+ },
+ "Eredm\u00e9nytartal\u00e9k": {
+ "account_number": 413,
+ "root_type": "Liability",
+ "account_type": "Equity"
+ },
+ "Lek\u00f6t\u00f6tt tartal\u00e9k": {
+ "account_number": 414,
+ "root_type": "Liability",
+ "account_type": "Equity"
+ },
+ "Ad\u00f3zott eredm\u00e9ny": {
+ "account_number": 419,
+ "root_type": "Liability",
+ "account_type": "Equity"
+ }
+ },
+ "C\u00c9LTARTAL\u00c9KOK": {
+ "account_number": 42,
+ "root_type": "Liability",
+ "is_group": 1,
+ "C\u00e9ltartal\u00e9k a v\u00e1rhat\u00f3 k\u00f6telezetts\u00e9gekre": {
+ "account_number": 421,
+ "root_type": "Liability"
+ }
+ },
+ "H\u00c1TRASOROLT K\u00d6TELEZETTS\u00c9GEK": {
+ "account_number": 43,
+ "root_type": "Liability",
+ "is_group": 1,
+ "H\u00e1trasorolt k\u00f6telezetts\u00e9gek": {
+ "account_number": 431,
+ "root_type": "Liability"
+ }
+ },
+ "HOSSZ\u00da LEJ\u00c1RAT\u00da K\u00d6TELEZETTS\u00c9GEK": {
+ "account_number": 44,
+ "root_type": "Liability",
+ "is_group": 1,
+ "Hossz\u00fa lej\u00e1ratra kapott k\u00f6lcs\u00f6n\u00f6k": {
+ "account_number": 441,
+ "root_type": "Liability"
+ },
+ "\u00c1tv\u00e1ltoztathat\u00f3 k\u00f6tv\u00e9nyek": {
+ "account_number": 442,
+ "root_type": "Liability"
+ },
+ "Tartoz\u00e1sok k\u00f6tv\u00e9nykibocs\u00e1t\u00e1sb\u00f3l": {
+ "account_number": 443,
+ "root_type": "Liability"
+ },
+ "Beruh\u00e1z\u00e1si \u00e9s fejleszt\u00e9si hitelek": {
+ "account_number": 444,
+ "root_type": "Liability"
+ },
+ "Egy\u00e9b hossz\u00fa lej\u00e1rat\u00fa hitelek": {
+ "account_number": 445,
+ "root_type": "Liability"
+ },
+ "P\u00e9nz\u00fcgyi l\u00edzing miatti k\u00f6telezetts\u00e9gek": {
+ "account_number": 446,
+ "root_type": "Liability"
+ },
+ "Egy\u00e9b hossz\u00fa lej\u00e1rat\u00fa k\u00f6telezetts\u00e9gek": {
+ "account_number": 449,
+ "root_type": "Liability"
+ }
+ },
+ "R\u00d6VID LEJ\u00c1RAT\u00da K\u00d6TELEZETTS\u00c9GEK": {
+ "account_number": "45-47",
+ "root_type": "Liability",
+ "is_group": 1,
+ "R\u00f6vid lej\u00e1rat\u00fa k\u00f6lcs\u00f6n\u00f6k": {
+ "account_number": 451,
+ "root_type": "Liability"
+ },
+ "R\u00f6vid lej\u00e1rat\u00fa hitelek": {
+ "account_number": 452,
+ "root_type": "Liability"
+ },
+ "Vev\u0151kt\u0151l kapott el\u0151legek": {
+ "account_number": 453,
+ "root_type": "Liability"
+ },
+ "K\u00f6telezetts\u00e9gek \u00e1rusz\u00e1ll\u00edt\u00e1sb\u00f3l \u00e9s szolg\u00e1ltat\u00e1sb\u00f3l (sz\u00e1ll\u00edt\u00f3k)": {
+ "account_number": 454,
+ "root_type": "Liability"
+ },
+ "Beruh\u00e1z\u00e1si sz\u00e1ll\u00edt\u00f3k": {
+ "account_number": 455,
+ "root_type": "Liability"
+ },
+ "Nem sz\u00e1ml\u00e1zott sz\u00e1ll\u00edt\u00f3k": {
+ "account_number": 456,
+ "root_type": "Liability"
+ },
+ "V\u00e1lt\u00f3tartoz\u00e1sok": {
+ "account_number": 457,
+ "root_type": "Liability"
+ },
+ "Eredm\u00e9nyt terhel\u0151 ad\u00f3k elsz\u00e1mol\u00e1sa": {
+ "account_number": 461,
+ "root_type": "Liability"
+ },
+ "Szem\u00e9lyi j\u00f6vedelemad\u00f3 (SZJA) elsz\u00e1mol\u00e1sa": {
+ "account_number": 462,
+ "root_type": "Liability"
+ },
+ "J\u00f6ved\u00e9ki ad\u00f3 elsz\u00e1mol\u00e1sa": {
+ "account_number": 463,
+ "root_type": "Liability"
+ },
+ "G\u00e9pj\u00e1rm\u0171 ad\u00f3 (c\u00e9gaut\u00f3ad\u00f3) elsz\u00e1mol\u00e1sa": {
+ "account_number": 464,
+ "root_type": "Liability"
+ },
+ "V\u00e1melsz\u00e1mol\u00e1si sz\u00e1mla": {
+ "account_number": 465,
+ "root_type": "Liability"
+ },
+ "El\u0151zetesen felsz\u00e1m\u00edtott \u00e1ltal\u00e1nos forgalmi ad\u00f3": {
+ "account_number": 466,
+ "root_type": "Liability"
+ },
+ "Fizetend\u0151 \u00e1ltal\u00e1nos forgalmi ad\u00f3": {
+ "account_number": 467,
+ "root_type": "Liability"
+ },
+ "\u00c1ltal\u00e1nos forgalmi ad\u00f3 elsz\u00e1mol\u00e1si sz\u00e1mla": {
+ "account_number": 468,
+ "root_type": "Liability"
+ },
+ "Helyi ad\u00f3k elsz\u00e1mol\u00e1si sz\u00e1mla": {
+ "account_number": 469,
+ "root_type": "Liability"
+ },
+ "J\u00f6vedelemelsz\u00e1mol\u00e1si sz\u00e1mla": {
+ "account_number": 471,
+ "root_type": "Liability"
+ },
+ "Fel nem vett j\u00e1rand\u00f3s\u00e1gok": {
+ "account_number": 472,
+ "root_type": "Liability"
+ },
+ "Szoci\u00e1lis hozz\u00e1j\u00e1rul\u00e1si ad\u00f3": {
+ "account_number": 473,
+ "root_type": "Liability"
+ },
+ "Szakk\u00e9pz\u00e9si hozz\u00e1j\u00e1rul\u00e1s": {
+ "account_number": 474,
+ "root_type": "Liability"
+ },
+ "Egy\u00e9b \u00e1llami ad\u00f3hat\u00f3s\u00e1ggal szembeni k\u00f6telezetts\u00e9g elsz\u00e1mol\u00e1sa": {
+ "account_number": 476,
+ "root_type": "Liability"
+ },
+ "R\u00f6vid lej\u00e1rat\u00fa egy\u00e9b k\u00f6telezetts\u00e9gek munkav\u00e1llal\u00f3kkal \u00e9s tulajdonosokkal szemben": {
+ "account_number": 477,
+ "root_type": "Liability"
+ },
+ "R\u00e9szesed\u00e9sekkel, \u00e9rt\u00e9kpap\u00edrokkal kapcsolatos k\u00f6telezetts\u00e9gek": {
+ "account_number": 478,
+ "root_type": "Liability"
+ },
+ "K\u00fcl\u00f6nf\u00e9le egy\u00e9b r\u00f6vid lej\u00e1rat\u00fa k\u00f6telezetts\u00e9gek": {
+ "account_number": 479,
+ "root_type": "Liability"
+ }
+ },
+ "PASSZ\u00cdV ID\u0150BELI ELHAT\u00c1ROL\u00c1SOK": {
+ "account_number": 48,
+ "root_type": "Liability",
+ "is_group": 1,
+ "Passz\u00edv id\u0151beli elhat\u00e1rol\u00e1sok": {
+ "account_number": 481,
+ "root_type": "Liability"
+ }
+ },
+ "\u00c9VI M\u00c9RLEGSZ\u00c1ML\u00c1K": {
+ "account_number": 49,
+ "root_type": "Liability",
+ "is_group": 1,
+ "Nyit\u00f3m\u00e9rleg sz\u00e1mla": {
+ "account_number": 491,
+ "root_type": "Liability"
+ },
+ "Z\u00e1r\u00f3m\u00e9rleg sz\u00e1mla": {
+ "account_number": 492,
+ "root_type": "Liability"
+ },
+ "Ad\u00f3zott eredm\u00e9ny elsz\u00e1mol\u00e1si sz\u00e1mla": {
+ "account_number": 493,
+ "root_type": "Liability"
+ }
+ }
+ },
+ "SZ\u00c1MLAOSZT\u00c1LY K\u00d6LTS\u00c9GNEMEK": {
+ "account_number": 5,
+ "root_type": "Expense",
+ "is_group": 1,
+ "ANYAGK\u00d6LTS\u00c9G": {
+ "account_number": 51,
+ "root_type": "Expense",
+ "is_group": 1,
+ "Alapanyagok k\u00f6lts\u00e9gei": {
+ "account_number": 511,
+ "root_type": "Expense"
+ },
+ "Egy \u00e9ven bel\u00fcl elhaszn\u00e1l\u00f3d\u00f3 anyagi eszk\u00f6z\u00f6k k\u00f6lts\u00e9gei": {
+ "account_number": 512,
+ "root_type": "Expense"
+ },
+ "Egy\u00e9b anyagk\u00f6lts\u00e9g": {
+ "account_number": 513,
+ "root_type": "Expense"
+ },
+ "Anyagk\u00f6lts\u00e9g megt\u00e9r\u00fcl\u00e9s": {
+ "account_number": 519,
+ "root_type": "Expense"
+ }
+ },
+ "IG\u00c9NYBE VETT SZOLG\u00c1LTAT\u00c1SOK K\u00d6LTS\u00c9GEI": {
+ "account_number": 52,
+ "root_type": "Expense",
+ "is_group": 1,
+ "Sz\u00e1ll\u00edt\u00e1srakod\u00e1s, rakt\u00e1roz\u00e1s k\u00f6lts\u00e9gei": {
+ "account_number": 521,
+ "root_type": "Expense"
+ },
+ "B\u00e9rleti d\u00edjak": {
+ "account_number": 522,
+ "root_type": "Expense"
+ },
+ "Karbantart\u00e1si k\u00f6lts\u00e9gek": {
+ "account_number": 523,
+ "root_type": "Expense"
+ },
+ "Hirdet\u00e9s, rekl\u00e1m, propaganda k\u00f6lts\u00e9gek": {
+ "account_number": 524,
+ "root_type": "Expense"
+ },
+ "Oktat\u00e1s \u00e9s tov\u00e1bbk\u00e9pz\u00e9s k\u00f6lts\u00e9gei": {
+ "account_number": 525,
+ "root_type": "Expense"
+ },
+ "Utaz\u00e1si \u00e9s kik\u00fcldet\u00e9si k\u00f6lts\u00e9gek (napid\u00edj n\u00e9lk\u00fcl)": {
+ "account_number": 526,
+ "root_type": "Expense"
+ },
+ "Ig\u00e9nybe vett egy\u00e9b szolg\u00e1ltat\u00e1sok k\u00f6lts\u00e9gei": {
+ "account_number": 529,
+ "root_type": "Expense"
+ }
+ },
+ "EGY\u00c9B SZOLG\u00c1LTAT\u00c1SOK K\u00d6LTS\u00c9GEI": {
+ "account_number": 53,
+ "root_type": "Expense",
+ "is_group": 1,
+ "Hat\u00f3s\u00e1gi igazgat\u00e1si, szolg\u00e1ltat\u00e1si d\u00edjak, illet\u00e9kek": {
+ "account_number": 531,
+ "root_type": "Expense"
+ },
+ "P\u00e9nz\u00fcgyi, befektet\u00e9si szolg\u00e1ltat\u00e1si d\u00edjak": {
+ "account_number": 532,
+ "root_type": "Expense"
+ },
+ "Biztos\u00edt\u00e1si d\u00edjak": {
+ "account_number": 533,
+ "root_type": "Expense"
+ },
+ "K\u00f6lts\u00e9gk\u00e9nt elsz\u00e1moland\u00f3 ad\u00f3k, j\u00e1rul\u00e9kok, term\u00e9kd\u00edjak": {
+ "account_number": 534,
+ "root_type": "Expense"
+ },
+ "K\u00fcl\u00f6nf\u00e9le egy\u00e9b szolg\u00e1ltat\u00e1sok k\u00f6lts\u00e9gei": {
+ "account_number": 539,
+ "root_type": "Expense"
+ }
+ },
+ "B\u00c9RK\u00d6LTS\u00c9G": {
+ "account_number": 54,
+ "root_type": "Expense",
+ "is_group": 1,
+ "B\u00e9rk\u00f6lts\u00e9g": {
+ "account_number": 541,
+ "root_type": "Expense"
+ }
+ },
+ "SZEM\u00c9LYI JELLEG\u0170 EGY\u00c9B KIFIZET\u00c9SEK": {
+ "account_number": 55,
+ "root_type": "Expense",
+ "is_group": 1,
+ "Munkav\u00e1llal\u00f3knak, tagoknak fizetett szem\u00e9lyi jelleg\u0171 kifizet\u00e9sek": {
+ "account_number": 551,
+ "root_type": "Expense"
+ },
+ "J\u00f3l\u00e9ti \u00e9s kultur\u00e1lis k\u00f6lts\u00e9gek": {
+ "account_number": 552,
+ "root_type": "Expense"
+ },
+ "Reprezent\u00e1ci\u00f3s k\u00f6lts\u00e9gek": {
+ "account_number": 553,
+ "root_type": "Expense"
+ },
+ "Egy\u00e9b szem\u00e9lyi jelleg\u0171 kifizet\u00e9sek": {
+ "account_number": 559,
+ "root_type": "Expense"
+ }
+ },
+ "B\u00c9RJ\u00c1RUL\u00c9KOK": {
+ "account_number": 56,
+ "root_type": "Expense",
+ "is_group": 1,
+ "Szoci\u00e1lis hozz\u00e1j\u00e1rul\u00e1si ad\u00f3": {
+ "account_number": 561,
+ "root_type": "Expense"
+ },
+ "Szakk\u00e9pz\u00e9si hozz\u00e1j\u00e1rul\u00e1s": {
+ "account_number": 563,
+ "root_type": "Expense"
+ },
+ "Egy\u00e9b b\u00e9rj\u00e1rul\u00e9kok": {
+ "account_number": 569,
+ "root_type": "Expense"
+ }
+ },
+ "\u00c9RT\u00c9KCS\u00d6KKEN\u00c9SI LE\u00cdR\u00c1S": {
+ "account_number": 57,
+ "root_type": "Expense",
+ "is_group": 1,
+ "Terv szerinti \u00e9rt\u00e9kcs\u00f6kken\u00e9si le\u00edr\u00e1s": {
+ "account_number": 571,
+ "root_type": "Expense"
+ },
+ "Kis \u00e9rt\u00e9k\u0171 eszk\u00f6z\u00f6k egy \u00f6sszegben elsz\u00e1molt \u00e9rt\u00e9kcs\u00f6kken\u00e9si le\u00edr\u00e1sa": {
+ "account_number": 572,
+ "root_type": "Expense"
+ }
+ },
+ "AKTIV\u00c1LT SAJ\u00c1T TELJES\u00cdTM\u00c9NYEK \u00c9RT\u00c9KE": {
+ "account_number": 58,
+ "root_type": "Expense",
+ "is_group": 1,
+ "Saj\u00e1t termel\u00e9s\u0171 k\u00e9szletek \u00e1llom\u00e1nyv\u00e1ltoz\u00e1sa": {
+ "account_number": 581,
+ "root_type": "Expense"
+ },
+ "Saj\u00e1t el\u0151\u00e1ll\u00edt\u00e1s\u00fa eszk\u00f6z\u00f6k aktiv\u00e1lt \u00e9rt\u00e9ke": {
+ "account_number": 582,
+ "root_type": "Expense"
+ },
+ "Aktiv\u00e1lt saj\u00e1t teljes\u00edtm\u00e9nyek \u00e1tvezet\u00e9si sz\u00e1mla": {
+ "account_number": 589,
+ "root_type": "Expense"
+ }
+ },
+ "K\u00d6LTS\u00c9GNEMEK \u00c1TVEZET\u00c9SE": {
+ "account_number": 59,
+ "root_type": "Expense",
+ "is_group": 1,
+ "K\u00f6lts\u00e9gnemek \u00e1tvezet\u00e9si sz\u00e1mla": {
+ "account_number": 599,
+ "root_type": "Expense"
+ }
+ }
+ },
+ "SZ\u00c1MLAOSZT\u00c1LY R\u00c1FORD\u00cdT\u00c1SOK": {
+ "account_number": 8,
+ "root_type": "Expense",
+ "is_group": 1,
+ "ANYAGJELLEG\u0170 R\u00c1FORD\u00cdT\u00c1SOK": {
+ "account_number": 81,
+ "root_type": "Expense",
+ "is_group": 1,
+ "Anyagk\u00f6lts\u00e9g": {
+ "account_number": 811,
+ "root_type": "Expense"
+ },
+ "Ig\u00e9nybe vett szolg\u00e1ltat\u00e1sok \u00e9rt\u00e9ke": {
+ "account_number": 812,
+ "root_type": "Expense"
+ },
+ "Egy\u00e9b szolg\u00e1ltat\u00e1sok \u00e9rt\u00e9ke": {
+ "account_number": 813,
+ "root_type": "Expense"
+ },
+ "Eladott \u00e1ruk beszerz\u00e9si \u00e9rt\u00e9ke": {
+ "account_number": 814,
+ "root_type": "Expense"
+ },
+ "Eladott (k\u00f6zvet\u00edtett) szolg\u00e1ltat\u00e1sok \u00e9rt\u00e9ke": {
+ "account_number": 815,
+ "root_type": "Expense"
+ }
+ },
+ "SZEM\u00c9LYI JELLEG\u0170 R\u00c1FORD\u00cdT\u00c1SOK": {
+ "account_number": 82,
+ "root_type": "Expense",
+ "is_group": 1,
+ "B\u00e9rk\u00f6lts\u00e9g": {
+ "account_number": 821,
+ "root_type": "Expense"
+ },
+ "Szem\u00e9lyi jelleg\u0171 egy\u00e9b kifizet\u00e9sek": {
+ "account_number": 822,
+ "root_type": "Expense"
+ },
+ "B\u00e9rj\u00e1rul\u00e9kok": {
+ "account_number": 823,
+ "root_type": "Expense"
+ }
+ },
+ "\u00c9RT\u00c9KCS\u00d6KKEN\u00c9SI LE\u00cdR\u00c1S": {
+ "account_number": 83,
+ "root_type": "Expense",
+ "is_group": 1,
+ "\u00c9rt\u00e9kcs\u00f6kken\u00e9si le\u00edr\u00e1s": {
+ "account_number": 831,
+ "root_type": "Expense"
+ }
+ },
+ "EGY\u00c9B R\u00c1FORD\u00cdT\u00c1SOK": {
+ "account_number": 86,
+ "root_type": "Expense",
+ "is_group": 1,
+ "Egy\u00e9b r\u00e1ford\u00edt\u00e1snak min\u0151s\u00fcl\u0151 \u00e9rt\u00e9kes\u00edt\u00e9sek": {
+ "account_number": 861,
+ "root_type": "Expense",
+ "is_group": 1,
+ "\u00c9rt\u00e9kes\u00edtett immateri\u00e1lis javak, t\u00e1rgyi eszk\u00f6z\u00f6k k\u00f6nyv szerinti \u00e9rt\u00e9ke": {
+ "account_number": 8611,
+ "root_type": "Expense"
+ },
+ "\u00c9rt\u00e9kes\u00edtett, \u00e1truh\u00e1zott (engedm\u00e9nyezett) k\u00f6vetel\u00e9sek k\u00f6nyv szerinti \u00e9rt\u00e9ke": {
+ "account_number": 8612,
+ "root_type": "Expense"
+ }
+ },
+ "Egy\u00e9b r\u00e1ford\u00edt\u00e1snak min\u0151s\u00fcl\u0151 eszk\u00f6z kivezet\u00e9sek": {
+ "account_number": 862,
+ "root_type": "Expense",
+ "is_group": 1,
+ "Hi\u00e1nyz\u00f3, megsemmis\u00fclt, kiselejtezett immateri\u00e1lis javak, t\u00e1rgyi eszk\u00f6z\u00f6k nett\u00f3 \u00e9rt\u00e9ke": {
+ "account_number": 8621,
+ "root_type": "Expense"
+ },
+ "Hi\u00e1nyz\u00f3, megsemmis\u00fclt, \u00e1llom\u00e1nyb\u00f3l kivezetett k\u00e9szletek k\u00f6nyv szerinti \u00e9rt\u00e9ke": {
+ "account_number": 8622,
+ "root_type": "Expense"
+ }
+ },
+ "Behajthatatlan k\u00f6vetel\u00e9sek le\u00edrt \u00f6sszege": {
+ "account_number": 863,
+ "root_type": "Expense"
+ },
+ "C\u00e9ltartal\u00e9k k\u00e9pz\u00e9s": {
+ "account_number": 864,
+ "root_type": "Expense"
+ },
+ "Ut\u00f3lag adott, nem sz\u00e1ml\u00e1zott engedm\u00e9ny": {
+ "account_number": 865,
+ "root_type": "Expense"
+ },
+ "Egy\u00e9b r\u00e1ford\u00edt\u00e1sk\u00e9nt elsz\u00e1molt ad\u00f3k, illet\u00e9kek, hozz\u00e1j\u00e1rul\u00e1sok": {
+ "account_number": 866,
+ "root_type": "Expense",
+ "is_group": 1,
+ "K\u00f6zponti k\u00f6lts\u00e9gvet\u00e9ssel elsz\u00e1molt ad\u00f3k, illet\u00e9kek, hozz\u00e1j\u00e1rul\u00e1sok": {
+ "account_number": 8661,
+ "root_type": "Expense"
+ },
+ "Helyi \u00f6nkorm\u00e1nyzatokkal elsz\u00e1molt ad\u00f3k, illet\u00e9kek, hozz\u00e1j\u00e1rul\u00e1sok": {
+ "account_number": 8662,
+ "root_type": "Expense"
+ },
+ "Elk\u00fcl\u00f6n\u00edtett \u00e1llami p\u00e9nzalapokkal elsz\u00e1molt ad\u00f3k, illet\u00e9kek, hozz\u00e1j\u00e1rul\u00e1sok": {
+ "account_number": 8663,
+ "root_type": "Expense"
+ },
+ "T\u00e1rsadalombiztos\u00edt\u00e1ssal elsz\u00e1molt ad\u00f3k, illet\u00e9kek, hozz\u00e1j\u00e1rul\u00e1sok": {
+ "account_number": 8664,
+ "root_type": "Expense"
+ },
+ "EU p\u00e9nz\u00fcgyi alapokkal elsz\u00e1molt ad\u00f3k, illet\u00e9kek, hozz\u00e1j\u00e1rul\u00e1sok": {
+ "account_number": 8665,
+ "root_type": "Expense"
+ },
+ "R\u00e1ford\u00edt\u00e1sk\u00e9nt elsz\u00e1molt egy\u00e9b ad\u00f3k \u00e9s ad\u00f3jelleg\u0171 t\u00e9telek": {
+ "account_number": 8666,
+ "root_type": "Expense"
+ }
+ },
+ "Egy\u00e9b r\u00e1ford\u00edt\u00e1sk\u00e9nt elsz\u00e1molt, ad\u00f3nak nem min\u0151s\u00fcl\u0151 kifizet\u00e9sek": {
+ "account_number": 867,
+ "root_type": "Expense",
+ "is_group": 1,
+ "K\u00e1resem\u00e9nnyel kapcsolatos fizetett, fizetend\u0151 \u00f6sszegek": {
+ "account_number": 8671,
+ "root_type": "Expense"
+ },
+ "K\u00f6lts\u00e9gek (r\u00e1f.) ellent\u00e9telez\u00e9s\u00e9re visszafizet\u00e9si k\u00f6telezetts\u00e9g n\u00e9lk\u00fcl adott t\u00e1mogat\u00e1s, v\u00e9glegesen \u00e1tadott p\u00e9nzeszk\u00f6z, juttat\u00e1s": {
+ "account_number": 8672,
+ "root_type": "Expense"
+ },
+ "Fejleszt\u00e9si c\u00e9lra, visszafizet\u00e9si k\u00f6telezetts\u00e9g n\u00e9lk\u00fcl adott t\u00e1mogat\u00e1s, juttat\u00e1s": {
+ "account_number": 8673,
+ "root_type": "Expense"
+ },
+ "Fejleszt\u00e9si c\u00e9lra kapott t\u00e1mogat\u00e1s visszafizetend\u0151 \u00f6sszege": {
+ "account_number": 8674,
+ "root_type": "Expense"
+ },
+ "Tao \u00e1ltal elismert b\u00edrs\u00e1gok, k\u00f6tb\u00e9rek, k\u00e9sedelmi kamatok, p\u00f3tl\u00e9kok, k\u00e1rt\u00e9r\u00edt\u00e9sek, s\u00e9relemd\u00edjak": {
+ "account_number": 8675,
+ "root_type": "Expense"
+ },
+ "Tao \u00e1ltal el nem ismert b\u00edrs\u00e1gok, k\u00f6tb\u00e9rek, k\u00e9sedelmi kamatok, p\u00f3tl\u00e9kok, k\u00e1rt\u00e9r\u00edt\u00e9sek, s\u00e9relemd\u00edjak": {
+ "account_number": 8676,
+ "root_type": "Expense"
+ }
+ },
+ "Terven fel\u00fcli \u00e9rt\u00e9kcs\u00f6kken\u00e9sek, \u00e9rt\u00e9kveszt\u00e9sek": {
+ "account_number": 868,
+ "root_type": "Expense",
+ "is_group": 1,
+ "Immateri\u00e1lis javak terven fel\u00fcli \u00e9rt\u00e9kcs\u00f6kken\u00e9se": {
+ "account_number": 8681,
+ "root_type": "Expense"
+ },
+ "T\u00e1rgyi eszk\u00f6z\u00f6k terven fel\u00fcli \u00e9rt\u00e9kcs\u00f6kken\u00e9se": {
+ "account_number": 8682,
+ "root_type": "Expense"
+ },
+ "K\u00e9szletek \u00e9rt\u00e9kveszt\u00e9se": {
+ "account_number": 8683,
+ "root_type": "Expense"
+ },
+ "K\u00f6vetel\u00e9sek \u00e9rt\u00e9kveszt\u00e9se": {
+ "account_number": 8684,
+ "root_type": "Expense"
+ }
+ },
+ "K\u00fcl\u00f6nf\u00e9le egy\u00e9b r\u00e1ford\u00edt\u00e1sok": {
+ "account_number": 869,
+ "root_type": "Expense",
+ "is_group": 1,
+ "T\u00e1rsas\u00e1gba bevitt, \u00e9rt\u00e9kp. v. r\u00e9sz. nem min\u0151s\u00fcl\u0151 vagyont. k\u00f6nyv sz. \u00e9s l\u00e9tes\u00edt\u0151 o. meghat. \u00e9rt\u00e9k\u00e9nek vesztes\u00e9gjelleg\u0171 k\u00fcl.": {
+ "account_number": 8691,
+ "root_type": "Expense"
+ },
+ "Ellent\u00e9telez\u00e9s n\u00e9lk\u00fcl \u00e1tv\u00e1llalt k\u00f6telezetts\u00e9g szerz\u0151d\u00e9s szerinti \u00f6sszege": {
+ "account_number": 8692,
+ "root_type": "Expense"
+ },
+ "T\u00e9r\u00edt\u00e9s n\u00e9lk\u00fcl \u00e1tadott, r\u00e9szesed\u00e9snek vagy \u00e9rt\u00e9kpap\u00edrnak nem min\u0151s\u00fcl\u0151 eszk\u00f6z\u00f6k nyilv\u00e1ntart\u00e1s szerinti \u00e9rt\u00e9ke": {
+ "account_number": 8693,
+ "root_type": "Expense"
+ },
+ "T\u00e9r\u00edt\u00e9s n\u00e9lk\u00fcl ny\u00fajtott szolg\u00e1ltat\u00e1sok beker\u00fcl\u00e9si \u00e9rt\u00e9ke": {
+ "account_number": 8694,
+ "root_type": "Expense"
+ },
+ "Elengedett k\u00f6vetel\u00e9sek k\u00f6nyv szerinti \u00e9rt\u00e9ke": {
+ "account_number": 8695,
+ "root_type": "Expense"
+ },
+ "Egy\u00e9b, vagyoncs\u00f6kken\u00e9ssel j\u00e1r\u00f3 r\u00e1ford\u00edt\u00e1sok": {
+ "account_number": 8696,
+ "root_type": "Expense"
+ }
+ }
+ },
+ "P\u00c9NZ\u00dcGYI M\u0170VELETEK R\u00c1FORD\u00cdT\u00c1SAI": {
+ "account_number": 87,
+ "root_type": "Expense",
+ "is_group": 1,
+ "R\u00e9szesed\u00e9sekb\u0151l sz\u00e1rmaz\u00f3 r\u00e1ford\u00edt\u00e1sok, \u00e1rfolyamvesztes\u00e9gek": {
+ "account_number": 871,
+ "root_type": "Expense"
+ },
+ "Befektetett p\u00e9nz\u00fcgyi eszk\u00f6z\u00f6kb\u0151l (\u00e9rt\u00e9kpap\u00edrokb\u00f3l, k\u00f6lcs\u00f6n\u00f6kb\u0151l) sz\u00e1rmaz\u00f3 r\u00e1ford\u00edt\u00e1sok \u00e1rfolyamvesztes\u00e9gek": {
+ "account_number": 872,
+ "root_type": "Expense"
+ },
+ "Hitelint\u00e9zetnek fizetend\u0151 kamatok \u00e9s kamatjelleg\u0171 r\u00e1ford\u00edt\u00e1sok": {
+ "account_number": 873,
+ "root_type": "Expense"
+ },
+ "Nem hitelint\u00e9zetnek fizetend\u0151 kamatok \u00e9s kamatjelleg\u0171 r\u00e1ford\u00edt\u00e1sok": {
+ "account_number": 874,
+ "root_type": "Expense"
+ },
+ "R\u00e9szesed\u00e9sek, \u00e9rt\u00e9kpap\u00edrok, bankbet\u00e9tek \u00e9rt\u00e9kveszt\u00e9se \u00e9s vissza\u00edr\u00e1sa": {
+ "account_number": 875,
+ "root_type": "Expense",
+ "is_group": 1,
+ "R\u00e9szesed\u00e9sek, \u00e9rt\u00e9kpap\u00edrok, bankbet\u00e9tek \u00e9rt\u00e9kveszt\u00e9se": {
+ "account_number": 8751,
+ "root_type": "Expense"
+ },
+ "R\u00e9szesed\u00e9sek, \u00e9rt\u00e9kpap\u00edrok, bankbet\u00e9tek \u00e9rt\u00e9kveszt\u00e9s\u00e9nek vissza\u00edr\u00e1sa": {
+ "account_number": 8752,
+ "root_type": "Expense"
+ }
+ },
+ "K\u00fclf\u00f6ldi p\u00e9nz\u00e9rt\u00e9kre sz\u00f3l\u00f3 eszk\u00f6z\u00f6k \u00e9s k\u00f6telezetts\u00e9gek \u00e1rfolyamvesztes\u00e9gei": {
+ "account_number": 876,
+ "root_type": "Expense",
+ "is_group": 1,
+ "Deviza \u00e9s valutak\u00e9szletek forintra \u00e1tv\u00e1lt\u00e1s\u00e1nak \u00e1rfolyamvesztes\u00e9ge": {
+ "account_number": 8761,
+ "root_type": "Expense"
+ },
+ "K\u00fclf\u00f6ldi p\u00e9nz\u00e9rt\u00e9kre sz\u00f3l\u00f3 eszk\u00f6z\u00f6k \u00e9s k\u00f6telezetts\u00e9gek p\u00e9nz\u00fcgyileg rendezett \u00e1rfolyamvesztes\u00e9ge": {
+ "account_number": 8762,
+ "root_type": "Expense"
+ }
+ },
+ "P\u00e9nz\u00fcgyi m\u0171veletek egy\u00e9b r\u00e1ford\u00edt\u00e1sai": {
+ "account_number": 877,
+ "root_type": "Expense"
+ },
+ "P\u00e9nz\u00fcgyi rendez\u00e9shez kapcsol\u00f3d\u00f3an adott engedm\u00e9ny": {
+ "account_number": 878,
+ "root_type": "Expense"
+ },
+ "Egy\u00e9b vagyoncs\u00f6kken\u00e9ssel j\u00e1r\u00f3 p\u00e9nz\u00fcgyi r\u00e1ford\u00edt\u00e1sok": {
+ "account_number": 879,
+ "root_type": "Expense"
+ }
+ },
+ "EREDM\u00c9NYT TERHEL\u0150 AD\u00d3K": {
+ "account_number": 89,
+ "root_type": "Expense",
+ "is_group": 1,
+ "T\u00e1rsas\u00e1gi ad\u00f3": {
+ "account_number": 891,
+ "root_type": "Expense"
+ },
+ "Kisv\u00e1llalati ad\u00f3": {
+ "account_number": 893,
+ "root_type": "Expense"
+ },
+ "Eredm\u00e9nyt terhel\u0151 egy\u00e9b ad\u00f3k": {
+ "account_number": 899,
+ "root_type": "Expense"
+ }
+ }
+ },
+ "SZ\u00c1MLAOSZT\u00c1LY BEV\u00c9TELEK": {
+ "account_number": 9,
+ "root_type": "Income",
+ "is_group": 1,
+ "BELF\u00d6LDI \u00c9RT\u00c9KES\u00cdT\u00c9S \u00c1RBEV\u00c9TELE": {
+ "account_number": 91,
+ "root_type": "Income",
+ "is_group": 1,
+ "Belf\u00f6ldinek \u00e9rt\u00e9kes\u00edtett saj\u00e1t termel\u00e9s\u0171 k\u00e9szletek \u00e1rbev\u00e9tele": {
+ "account_number": 911,
+ "root_type": "Income"
+ },
+ "Belf\u00f6ldinek \u00e9rt\u00e9kes\u00edtett v\u00e1s\u00e1rolt k\u00e9szletek \u00e1rbev\u00e9tele": {
+ "account_number": 912,
+ "root_type": "Income"
+ },
+ "Belf\u00f6ldinek ny\u00fajtott szolg\u00e1ltat\u00e1sok \u00e1rbev\u00e9tele": {
+ "account_number": 913,
+ "root_type": "Income"
+ },
+ "Belf\u00f6ldi \u00e9rt\u00e9kes\u00edt\u00e9ssel kapcsolatos \u00e1rt\u00e1mogat\u00e1s": {
+ "account_number": 918,
+ "root_type": "Income"
+ },
+ "Egy\u00e9b belf\u00f6ldi \u00e9rt\u00e9kes\u00edt\u00e9s \u00e1rbev\u00e9tele": {
+ "account_number": 919,
+ "root_type": "Income"
+ }
+ },
+ "EXPORT\u00c9RT\u00c9KES\u00cdT\u00c9S \u00c1RBEV\u00c9TELE": {
+ "account_number": 92,
+ "root_type": "Income",
+ "is_group": 1,
+ "K\u00fclf\u00f6ldinek \u00e9rt\u00e9kes\u00edtett saj\u00e1t termel\u00e9s\u0171 k\u00e9szletek \u00e1rbev\u00e9tele": {
+ "account_number": 921,
+ "root_type": "Income"
+ },
+ "K\u00fclf\u00f6ldinek \u00e9rt\u00e9kes\u00edtett v\u00e1s\u00e1rolt k\u00e9szletek \u00e1rbev\u00e9tele": {
+ "account_number": 922,
+ "root_type": "Income"
+ },
+ "K\u00fclf\u00f6ldinek ny\u00fajtott szolg\u00e1ltat\u00e1sok \u00e1rbev\u00e9tele": {
+ "account_number": 923,
+ "root_type": "Income"
+ },
+ "K\u00fclf\u00f6ldi \u00e9rt\u00e9kes\u00edt\u00e9ssel kapcsolatos \u00e1rt\u00e1mogat\u00e1s": {
+ "account_number": 928,
+ "root_type": "Income"
+ },
+ "Egy\u00e9b k\u00fclf\u00f6ldi \u00e9rt\u00e9kes\u00edt\u00e9s \u00e1rbev\u00e9tele": {
+ "account_number": 929,
+ "root_type": "Income"
+ }
+ },
+ "EGY\u00c9B BEV\u00c9TELEK": {
+ "account_number": 96,
+ "root_type": "Income",
+ "is_group": 1,
+ "Egy\u00e9b bev\u00e9telnek min\u0151s\u00fcl\u0151 \u00e9rt\u00e9kes\u00edt\u00e9sek": {
+ "account_number": 961,
+ "root_type": "Income",
+ "is_group": 1,
+ "\u00c9rt\u00e9kes\u00edtett immateri\u00e1lis javak, t\u00e1rgyi eszk\u00f6z\u00f6k ellen\u00e9rt\u00e9ke": {
+ "account_number": 9611,
+ "root_type": "Income"
+ },
+ "\u00c9rt\u00e9kes\u00edtett, \u00e1truh\u00e1zott (engedm\u00e9nyezett) k\u00f6vetel\u00e9sek ellen\u00e9rt\u00e9ke": {
+ "account_number": 9612,
+ "root_type": "Income"
+ }
+ },
+ "K\u00f6vetel\u00e9s k\u00f6nyv szerinti \u00e9rt\u00e9k\u00e9t meghalad\u00f3an realiz\u00e1lt \u00f6sszeg": {
+ "account_number": 963,
+ "root_type": "Income"
+ },
+ "C\u00e9ltartal\u00e9k felold\u00e1s": {
+ "account_number": 964,
+ "root_type": "Income"
+ },
+ "Ut\u00f3lag kapott, nem sz\u00e1ml\u00e1zott engedm\u00e9ny": {
+ "account_number": 965,
+ "root_type": "Income"
+ },
+ "M\u0171k\u00f6d\u00e9si c\u00e9lra kapott t\u00e1mogat\u00e1s, juttat\u00e1s": {
+ "account_number": 966,
+ "root_type": "Income",
+ "is_group": 1,
+ "K\u00f6zponti k\u00f6lts\u00e9gvet\u00e9sb\u0151l kapott t\u00e1mogat\u00e1s, juttat\u00e1s": {
+ "account_number": 9661,
+ "root_type": "Income"
+ },
+ "Helyi \u00f6nkorm\u00e1nyzatokt\u00f3l kapott t\u00e1mogat\u00e1s, juttat\u00e1s": {
+ "account_number": 9662,
+ "root_type": "Income"
+ },
+ "Eur\u00f3pai Uni\u00f3t\u00f3l kapott t\u00e1mogat\u00e1s, juttat\u00e1s": {
+ "account_number": 9663,
+ "root_type": "Income"
+ },
+ "Egy\u00e9b forr\u00e1sb\u00f3l kapott t\u00e1mogat\u00e1s, juttat\u00e1s": {
+ "account_number": 9664,
+ "root_type": "Income"
+ }
+ },
+ "Egy\u00e9b bev\u00e9telk\u00e9nt elsz\u00e1molt p\u00e9nzbev\u00e9telek": {
+ "account_number": 967,
+ "root_type": "Income",
+ "is_group": 1,
+ "K\u00e1resem\u00e9nnyel kapcsolatos t\u00e9r\u00edt\u00e9sek": {
+ "account_number": 9671,
+ "root_type": "Income"
+ },
+ "K\u00f6lts\u00e9gek (r\u00e1ford\u00edt\u00e1sok) ellent\u00e9telez\u00e9s\u00e9re kapott t\u00e1mogat\u00e1s, juttat\u00e1s": {
+ "account_number": 9672,
+ "root_type": "Income"
+ },
+ "Fejleszt\u00e9si c\u00e9lra kapott t\u00e1mogat\u00e1s, juttat\u00e1s": {
+ "account_number": 9673,
+ "root_type": "Income"
+ },
+ "Kapott b\u00edrs\u00e1gok, k\u00f6tb\u00e9rek, fekb\u00e9rek, k\u00e9sedelmi kamatok, k\u00e1rt\u00e9r\u00edt\u00e9sek": {
+ "account_number": 9674,
+ "root_type": "Income"
+ }
+ },
+ "Terven fel\u00fcli \u00e9rt\u00e9kcs\u00f6kken\u00e9sek, \u00e9rt\u00e9kveszt\u00e9sek vissza\u00edr\u00e1sa": {
+ "account_number": 968,
+ "root_type": "Income",
+ "is_group": 1,
+ "Immateri\u00e1lis javak terven fel\u00fcli \u00e9rt\u00e9kcs\u00f6kken\u00e9s\u00e9nek vissza\u00edr\u00e1sa": {
+ "account_number": 9681,
+ "root_type": "Income"
+ },
+ "T\u00e1rgyi eszk\u00f6z\u00f6k terven fel\u00fcli \u00e9rt\u00e9kcs\u00f6kken\u00e9s\u00e9nek vissza\u00edr\u00e1sa": {
+ "account_number": 9682,
+ "root_type": "Income"
+ },
+ "K\u00e9szletek \u00e9rt\u00e9kveszt\u00e9s\u00e9nek vissza\u00edr\u00e1sa": {
+ "account_number": 9683,
+ "root_type": "Income"
+ },
+ "R\u00e9szesed\u00e9sek \u00e9rt\u00e9kveszt\u00e9s\u00e9nek vissza\u00edr\u00e1sa": {
+ "account_number": 9684,
+ "root_type": "Income"
+ }
+ },
+ "K\u00fcl\u00f6nf\u00e9le egy\u00e9b bev\u00e9telek": {
+ "account_number": 969,
+ "root_type": "Income",
+ "is_group": 1,
+ "Gazd. t\u00e1rs. bevitt, \u00e9rt\u00e9kp. v. r\u00e9sz. nem min\u0151s\u00fcl\u0151 vagyont. nyilv. sz. \u00e9rt. \u00e9s l\u00e9tes\u00edt\u0151 o. meghat. \u00e9rt. nyeres\u00e9gjelleg\u0171 k\u00fcl.": {
+ "account_number": 9691,
+ "root_type": "Income"
+ },
+ "El\u00e9v\u00fclt k\u00f6telezetts\u00e9g k\u00f6nyv szerinti \u00e9rt\u00e9ke": {
+ "account_number": 9692,
+ "root_type": "Income"
+ },
+ "T\u00e9r\u00edt\u00e9s n\u00e9lk\u00fcl \u00e1tvett, aj\u00e1nd\u00e9kk\u00e9nt, hagyat\u00e9kk\u00e9nt kapott, fellelt eszk\u00f6z\u00f6k piaci vagy jogszab\u00e1ly szerinti \u00e9rt\u00e9ke": {
+ "account_number": 9693,
+ "root_type": "Income"
+ },
+ "T\u00e9r\u00edt\u00e9s n\u00e9lk\u00fcl kapott szolg\u00e1ltat\u00e1sok piaci vagy jogszab\u00e1ly szerinti \u00e9rt\u00e9ke": {
+ "account_number": 9694,
+ "root_type": "Income"
+ },
+ "Elengedett \u00e9s ellent\u00e9telez\u00e9s n\u00e9lk\u00fcl \u00e1tv\u00e1llalt k\u00f6telezetts\u00e9g \u00e9rt\u00e9ke": {
+ "account_number": 9695,
+ "root_type": "Income"
+ },
+ "Egy\u00e9b, vagyonn\u00f6veked\u00e9ssel j\u00e1r\u00f3 bev\u00e9telek": {
+ "account_number": 9696,
+ "root_type": "Income"
+ }
+ }
+ },
+ "P\u00c9NZ\u00dcGYI M\u0170VELETEK BEV\u00c9TELEI": {
+ "account_number": 97,
+ "root_type": "Income",
+ "is_group": 1,
+ "R\u00e9szesed\u00e9sekb\u0151l sz\u00e1rmaz\u00f3 bev\u00e9telek, \u00e1rfolyamnyeres\u00e9gek": {
+ "account_number": 971,
+ "root_type": "Income"
+ },
+ "Befektetett p\u00e9nz\u00fcgyi eszk\u00f6z\u00f6kb\u0151l (\u00e9rt\u00e9kpap\u00edrokb\u00f3l, k\u00f6lcs\u00f6n\u00f6kb\u0151l) sz\u00e1rmaz\u00f3 bev\u00e9telek, \u00e1rfolyamnyeres\u00e9gek": {
+ "account_number": 972,
+ "root_type": "Income"
+ },
+ "Hitelint\u00e9zett\u0151l kapott kamatok \u00e9s kamatjelleg\u0171 bev\u00e9telek": {
+ "account_number": 973,
+ "root_type": "Income"
+ },
+ "Nem hitelint\u00e9zett\u0151l kapott kamatok \u00e9s kamatjelleg\u0171 bev\u00e9telek": {
+ "account_number": 974,
+ "root_type": "Income"
+ },
+ "Kapott (j\u00e1r\u00f3) osztal\u00e9k \u00e9s r\u00e9szesed\u00e9s": {
+ "account_number": 975,
+ "root_type": "Income"
+ },
+ "K\u00fclf\u00f6ldi p\u00e9nz\u00e9rt\u00e9kre sz\u00f3l\u00f3 eszk\u00f6z\u00f6k \u00e9s k\u00f6telezetts\u00e9gek \u00e1rfolyamnyeres\u00e9gei": {
+ "account_number": 976,
+ "root_type": "Income",
+ "is_group": 1,
+ "Deviza \u00e9s valutak\u00e9szletek forintra \u00e1tv\u00e1lt\u00e1s\u00e1nak \u00e1rfolyamnyeres\u00e9ge": {
+ "account_number": 9761,
+ "root_type": "Income"
+ },
+ "K\u00fclf\u00f6ldi p\u00e9nz\u00e9rt\u00e9kre sz\u00f3l\u00f3 eszk\u00f6z\u00f6k \u00e9s k\u00f6telezetts\u00e9gek p\u00e9nz\u00fcgyileg rendezett \u00e1rfolyamnyeres\u00e9ge": {
+ "account_number": 9762,
+ "root_type": "Income"
+ }
+ },
+ "P\u00e9nz\u00fcgyi m\u0171veletek egy\u00e9b bev\u00e9telei": {
+ "account_number": 977,
+ "root_type": "Income"
+ },
+ "P\u00e9nz\u00fcgyi rendez\u00e9shez kapcsol\u00f3d\u00f3an kapott engedm\u00e9ny": {
+ "account_number": 978,
+ "root_type": "Income"
+ },
+ "Egy\u00e9b vagyonn\u00f6veked\u00e9ssel j\u00e1r\u00f3 p\u00e9nz\u00fcgyi bev\u00e9telek": {
+ "account_number": 979,
+ "root_type": "Income"
+ }
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/erpnext/accounts/doctype/accounting_dimension_filter/accounting_dimension_filter.js b/erpnext/accounts/doctype/accounting_dimension_filter/accounting_dimension_filter.js
index 750e129..8a6b021 100644
--- a/erpnext/accounts/doctype/accounting_dimension_filter/accounting_dimension_filter.js
+++ b/erpnext/accounts/doctype/accounting_dimension_filter/accounting_dimension_filter.js
@@ -3,10 +3,6 @@
frappe.ui.form.on('Accounting Dimension Filter', {
refresh: function(frm, cdt, cdn) {
- if (frm.doc.accounting_dimension) {
- frm.set_df_property('dimensions', 'label', frm.doc.accounting_dimension, cdn, 'dimension_value');
- }
-
let help_content =
`<table class="table table-bordered" style="background-color: var(--scrollbar-track-color);">
<tr><td>
@@ -68,6 +64,7 @@
frm.clear_table("dimensions");
let row = frm.add_child("dimensions");
row.accounting_dimension = frm.doc.accounting_dimension;
+ frm.fields_dict["dimensions"].grid.update_docfield_property("dimension_value", "label", frm.doc.accounting_dimension);
frm.refresh_field("dimensions");
frm.trigger('setup_filters');
},
diff --git a/erpnext/accounts/doctype/bank_clearance/bank_clearance.js b/erpnext/accounts/doctype/bank_clearance/bank_clearance.js
index 63cc465..7e57c2f 100644
--- a/erpnext/accounts/doctype/bank_clearance/bank_clearance.js
+++ b/erpnext/accounts/doctype/bank_clearance/bank_clearance.js
@@ -4,6 +4,23 @@
frappe.ui.form.on("Bank Clearance", {
setup: function(frm) {
frm.add_fetch("account", "account_currency", "account_currency");
+
+ frm.set_query("account", function() {
+ return {
+ "filters": {
+ "account_type": ["in",["Bank","Cash"]],
+ "is_group": 0,
+ }
+ };
+ });
+
+ frm.set_query("bank_account", function () {
+ return {
+ filters: {
+ 'is_company_account': 1
+ },
+ };
+ });
},
onload: function(frm) {
@@ -12,14 +29,7 @@
locals[":Company"][frappe.defaults.get_user_default("Company")]["default_bank_account"]: "";
frm.set_value("account", default_bank_account);
- frm.set_query("account", function() {
- return {
- "filters": {
- "account_type": ["in",["Bank","Cash"]],
- "is_group": 0
- }
- };
- });
+
frm.set_value("from_date", frappe.datetime.month_start());
frm.set_value("to_date", frappe.datetime.month_end());
diff --git a/erpnext/accounts/doctype/bank_guarantee/bank_guarantee.js b/erpnext/accounts/doctype/bank_guarantee/bank_guarantee.js
index febf85c..99cc0a7 100644
--- a/erpnext/accounts/doctype/bank_guarantee/bank_guarantee.js
+++ b/erpnext/accounts/doctype/bank_guarantee/bank_guarantee.js
@@ -43,20 +43,13 @@
reference_docname: function(frm) {
if (frm.doc.reference_docname && frm.doc.reference_doctype) {
- let fields_to_fetch = ["grand_total"];
let party_field = frm.doc.reference_doctype == "Sales Order" ? "customer" : "supplier";
- if (frm.doc.reference_doctype == "Sales Order") {
- fields_to_fetch.push("project");
- }
-
- fields_to_fetch.push(party_field);
frappe.call({
- method: "erpnext.accounts.doctype.bank_guarantee.bank_guarantee.get_vouchar_detials",
+ method: "erpnext.accounts.doctype.bank_guarantee.bank_guarantee.get_voucher_details",
args: {
- "column_list": fields_to_fetch,
- "doctype": frm.doc.reference_doctype,
- "docname": frm.doc.reference_docname
+ "bank_guarantee_type": frm.doc.bg_type,
+ "reference_name": frm.doc.reference_docname
},
callback: function(r) {
if (r.message) {
diff --git a/erpnext/accounts/doctype/bank_guarantee/bank_guarantee.py b/erpnext/accounts/doctype/bank_guarantee/bank_guarantee.py
index 9144a29..02eb599 100644
--- a/erpnext/accounts/doctype/bank_guarantee/bank_guarantee.py
+++ b/erpnext/accounts/doctype/bank_guarantee/bank_guarantee.py
@@ -2,11 +2,8 @@
# For license information, please see license.txt
-import json
-
import frappe
from frappe import _
-from frappe.desk.search import sanitize_searchfield
from frappe.model.document import Document
@@ -25,14 +22,18 @@
@frappe.whitelist()
-def get_vouchar_detials(column_list, doctype, docname):
- column_list = json.loads(column_list)
- for col in column_list:
- sanitize_searchfield(col)
- return frappe.db.sql(
- """ select {columns} from `tab{doctype}` where name=%s""".format(
- columns=", ".join(column_list), doctype=doctype
- ),
- docname,
- as_dict=1,
- )[0]
+def get_voucher_details(bank_guarantee_type: str, reference_name: str):
+ if not isinstance(reference_name, str):
+ raise TypeError("reference_name must be a string")
+
+ fields_to_fetch = ["grand_total"]
+
+ if bank_guarantee_type == "Receiving":
+ doctype = "Sales Order"
+ fields_to_fetch.append("customer")
+ fields_to_fetch.append("project")
+ else:
+ doctype = "Purchase Order"
+ fields_to_fetch.append("supplier")
+
+ return frappe.db.get_value(doctype, reference_name, fields_to_fetch, as_dict=True)
diff --git a/erpnext/accounts/doctype/bank_reconciliation_tool/bank_reconciliation_tool.js b/erpnext/accounts/doctype/bank_reconciliation_tool/bank_reconciliation_tool.js
index 46ba27c..28e79b5 100644
--- a/erpnext/accounts/doctype/bank_reconciliation_tool/bank_reconciliation_tool.js
+++ b/erpnext/accounts/doctype/bank_reconciliation_tool/bank_reconciliation_tool.js
@@ -12,6 +12,9 @@
},
};
});
+ let no_bank_transactions_text =
+ `<div class="text-muted text-center">${__("No Matching Bank Transactions Found")}</div>`
+ set_field_options("no_bank_transactions", no_bank_transactions_text);
},
onload: function (frm) {
diff --git a/erpnext/accounts/doctype/bank_reconciliation_tool/bank_reconciliation_tool.json b/erpnext/accounts/doctype/bank_reconciliation_tool/bank_reconciliation_tool.json
index b643e6e..f666101 100644
--- a/erpnext/accounts/doctype/bank_reconciliation_tool/bank_reconciliation_tool.json
+++ b/erpnext/accounts/doctype/bank_reconciliation_tool/bank_reconciliation_tool.json
@@ -81,8 +81,7 @@
},
{
"fieldname": "no_bank_transactions",
- "fieldtype": "HTML",
- "options": "<div class=\"text-muted text-center\">No Matching Bank Transactions Found</div>"
+ "fieldtype": "HTML"
}
],
"hide_toolbar": 1,
@@ -109,4 +108,4 @@
"quick_entry": 1,
"sort_field": "modified",
"sort_order": "DESC"
-}
\ No newline at end of file
+}
diff --git a/erpnext/accounts/doctype/bank_statement_import/bank_statement_import.js b/erpnext/accounts/doctype/bank_statement_import/bank_statement_import.js
index f745620..04af323 100644
--- a/erpnext/accounts/doctype/bank_statement_import/bank_statement_import.js
+++ b/erpnext/accounts/doctype/bank_statement_import/bank_statement_import.js
@@ -100,7 +100,7 @@
if (frm.doc.status.includes("Success")) {
frm.add_custom_button(
- __("Go to {0} List", [frm.doc.reference_doctype]),
+ __("Go to {0} List", [__(frm.doc.reference_doctype)]),
() => frappe.set_route("List", frm.doc.reference_doctype)
);
}
diff --git a/erpnext/accounts/doctype/budget/budget.json b/erpnext/accounts/doctype/budget/budget.json
index fc4dd20..f0566f4 100644
--- a/erpnext/accounts/doctype/budget/budget.json
+++ b/erpnext/accounts/doctype/budget/budget.json
@@ -1,6 +1,7 @@
{
"actions": [],
"allow_import": 1,
+ "autoname": "naming_series:",
"creation": "2016-05-16 11:42:29.632528",
"doctype": "DocType",
"editable_grid": 1,
@@ -9,6 +10,7 @@
"budget_against",
"company",
"cost_center",
+ "naming_series",
"project",
"fiscal_year",
"column_break_3",
@@ -190,15 +192,26 @@
"label": "Budget Accounts",
"options": "Budget Account",
"reqd": 1
+ },
+ {
+ "fieldname": "naming_series",
+ "fieldtype": "Data",
+ "hidden": 1,
+ "label": "Series",
+ "no_copy": 1,
+ "print_hide": 1,
+ "read_only": 1,
+ "set_only_once": 1
}
],
"index_web_pages_for_search": 1,
"is_submittable": 1,
"links": [],
- "modified": "2020-10-06 15:13:54.055854",
+ "modified": "2022-10-10 22:14:36.361509",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Budget",
+ "naming_rule": "By \"Naming Series\" field",
"owner": "Administrator",
"permissions": [
{
@@ -220,5 +233,6 @@
],
"sort_field": "modified",
"sort_order": "DESC",
+ "states": [],
"track_changes": 1
}
\ No newline at end of file
diff --git a/erpnext/accounts/doctype/budget/budget.py b/erpnext/accounts/doctype/budget/budget.py
index 5527f9f..637ac7a 100644
--- a/erpnext/accounts/doctype/budget/budget.py
+++ b/erpnext/accounts/doctype/budget/budget.py
@@ -5,7 +5,6 @@
import frappe
from frappe import _
from frappe.model.document import Document
-from frappe.model.naming import make_autoname
from frappe.utils import add_months, flt, fmt_money, get_last_day, getdate
from erpnext.accounts.doctype.accounting_dimension.accounting_dimension import (
@@ -23,11 +22,6 @@
class Budget(Document):
- def autoname(self):
- self.name = make_autoname(
- self.get(frappe.scrub(self.budget_against)) + "/" + self.fiscal_year + "/.###"
- )
-
def validate(self):
if not self.get(frappe.scrub(self.budget_against)):
frappe.throw(_("{0} is mandatory").format(self.budget_against))
@@ -109,8 +103,11 @@
):
self.applicable_on_booking_actual_expenses = 1
+ def before_naming(self):
+ self.naming_series = f"{{{frappe.scrub(self.budget_against)}}}./.{self.fiscal_year}/.###"
-def validate_expense_against_budget(args):
+
+def validate_expense_against_budget(args, expense_amount=0):
args = frappe._dict(args)
if args.get("company") and not args.fiscal_year:
@@ -178,13 +175,13 @@
) # nosec
if budget_records:
- validate_budget_records(args, budget_records)
+ validate_budget_records(args, budget_records, expense_amount)
-def validate_budget_records(args, budget_records):
+def validate_budget_records(args, budget_records, expense_amount):
for budget in budget_records:
if flt(budget.budget_amount):
- amount = get_amount(args, budget)
+ amount = expense_amount or get_amount(args, budget)
yearly_action, monthly_action = get_actions(args, budget)
if monthly_action in ["Stop", "Warn"]:
diff --git a/erpnext/accounts/doctype/budget/test_budget.py b/erpnext/accounts/doctype/budget/test_budget.py
index c48c7d9..11af9a2 100644
--- a/erpnext/accounts/doctype/budget/test_budget.py
+++ b/erpnext/accounts/doctype/budget/test_budget.py
@@ -334,6 +334,39 @@
budget.cancel()
jv.cancel()
+ def test_monthly_budget_against_main_cost_center(self):
+ from erpnext.accounts.doctype.cost_center.test_cost_center import create_cost_center
+ from erpnext.accounts.doctype.cost_center_allocation.test_cost_center_allocation import (
+ create_cost_center_allocation,
+ )
+
+ cost_centers = [
+ "Main Budget Cost Center 1",
+ "Sub Budget Cost Center 1",
+ "Sub Budget Cost Center 2",
+ ]
+
+ for cc in cost_centers:
+ create_cost_center(cost_center_name=cc, company="_Test Company")
+
+ create_cost_center_allocation(
+ "_Test Company",
+ "Main Budget Cost Center 1 - _TC",
+ {"Sub Budget Cost Center 1 - _TC": 60, "Sub Budget Cost Center 2 - _TC": 40},
+ )
+
+ make_budget(budget_against="Cost Center", cost_center="Main Budget Cost Center 1 - _TC")
+
+ jv = make_journal_entry(
+ "_Test Account Cost for Goods Sold - _TC",
+ "_Test Bank - _TC",
+ 400000,
+ "Main Budget Cost Center 1 - _TC",
+ posting_date=nowdate(),
+ )
+
+ self.assertRaises(BudgetError, jv.submit)
+
def set_total_expense_zero(posting_date, budget_against_field=None, budget_against_CC=None):
if budget_against_field == "project":
diff --git a/erpnext/accounts/doctype/chart_of_accounts_importer/chart_of_accounts_importer.py b/erpnext/accounts/doctype/chart_of_accounts_importer/chart_of_accounts_importer.py
index 01bf1c2..83c206a 100644
--- a/erpnext/accounts/doctype/chart_of_accounts_importer/chart_of_accounts_importer.py
+++ b/erpnext/accounts/doctype/chart_of_accounts_importer/chart_of_accounts_importer.py
@@ -52,7 +52,7 @@
if parent_company and (not allow_account_creation_against_child_company):
msg = _("{} is a child company.").format(frappe.bold(company)) + " "
msg += _("Please import accounts against parent company or enable {} in company master.").format(
- frappe.bold("Allow Account Creation Against Child Company")
+ frappe.bold(_("Allow Account Creation Against Child Company"))
)
frappe.throw(msg, title=_("Wrong Company"))
diff --git a/erpnext/accounts/doctype/exchange_rate_revaluation/exchange_rate_revaluation.json b/erpnext/accounts/doctype/exchange_rate_revaluation/exchange_rate_revaluation.json
index a7315a6..e00b17e 100644
--- a/erpnext/accounts/doctype/exchange_rate_revaluation/exchange_rate_revaluation.json
+++ b/erpnext/accounts/doctype/exchange_rate_revaluation/exchange_rate_revaluation.json
@@ -1,389 +1,138 @@
{
- "allow_copy": 0,
- "allow_guest_to_view": 0,
- "allow_import": 1,
- "allow_rename": 0,
- "autoname": "ACC-ERR-.YYYY.-.#####",
- "beta": 0,
- "creation": "2018-04-13 18:25:55.943587",
- "custom": 0,
- "docstatus": 0,
- "doctype": "DocType",
- "document_type": "",
- "editable_grid": 1,
- "engine": "InnoDB",
+ "actions": [],
+ "allow_import": 1,
+ "autoname": "ACC-ERR-.YYYY.-.#####",
+ "creation": "2018-04-13 18:25:55.943587",
+ "doctype": "DocType",
+ "editable_grid": 1,
+ "engine": "InnoDB",
+ "field_order": [
+ "posting_date",
+ "column_break_2",
+ "company",
+ "section_break_4",
+ "get_entries",
+ "accounts",
+ "section_break_6",
+ "total_gain_loss",
+ "amended_from"
+ ],
"fields": [
{
- "allow_bulk_edit": 0,
- "allow_in_quick_entry": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "default": "Today",
- "fieldname": "posting_date",
- "fieldtype": "Date",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 1,
- "in_standard_filter": 0,
- "label": "Posting Date",
- "length": 0,
- "no_copy": 0,
- "permlevel": 0,
- "precision": "",
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 1,
- "search_index": 0,
- "set_only_once": 0,
- "translatable": 0,
- "unique": 0
- },
+ "default": "Today",
+ "fieldname": "posting_date",
+ "fieldtype": "Date",
+ "in_list_view": 1,
+ "label": "Posting Date",
+ "reqd": 1
+ },
{
- "allow_bulk_edit": 0,
- "allow_in_quick_entry": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "column_break_2",
- "fieldtype": "Column Break",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 0,
- "in_standard_filter": 0,
- "length": 0,
- "no_copy": 0,
- "permlevel": 0,
- "precision": "",
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
- "translatable": 0,
- "unique": 0
- },
+ "fieldname": "column_break_2",
+ "fieldtype": "Column Break"
+ },
{
- "allow_bulk_edit": 0,
- "allow_in_quick_entry": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "company",
- "fieldtype": "Link",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 1,
- "in_standard_filter": 0,
- "label": "Company",
- "length": 0,
- "no_copy": 0,
- "options": "Company",
- "permlevel": 0,
- "precision": "",
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 1,
- "search_index": 0,
- "set_only_once": 0,
- "translatable": 0,
- "unique": 0
- },
+ "fieldname": "company",
+ "fieldtype": "Link",
+ "in_list_view": 1,
+ "label": "Company",
+ "options": "Company",
+ "reqd": 1
+ },
{
- "allow_bulk_edit": 0,
- "allow_in_quick_entry": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "section_break_4",
- "fieldtype": "Section Break",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 0,
- "in_standard_filter": 0,
- "length": 0,
- "no_copy": 0,
- "permlevel": 0,
- "precision": "",
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
- "translatable": 0,
- "unique": 0
- },
+ "fieldname": "section_break_4",
+ "fieldtype": "Section Break"
+ },
{
- "allow_bulk_edit": 0,
- "allow_in_quick_entry": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "get_entries",
- "fieldtype": "Button",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 0,
- "in_standard_filter": 0,
- "label": "Get Entries",
- "length": 0,
- "no_copy": 0,
- "permlevel": 0,
- "precision": "",
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
- "translatable": 0,
- "unique": 0
- },
+ "fieldname": "get_entries",
+ "fieldtype": "Button",
+ "label": "Get Entries"
+ },
{
- "allow_bulk_edit": 0,
- "allow_in_quick_entry": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "accounts",
- "fieldtype": "Table",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 0,
- "in_standard_filter": 0,
- "label": "Exchange Rate Revaluation Account",
- "length": 0,
- "no_copy": 1,
- "options": "Exchange Rate Revaluation Account",
- "permlevel": 0,
- "precision": "",
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 1,
- "search_index": 0,
- "set_only_once": 0,
- "translatable": 0,
- "unique": 0
- },
+ "fieldname": "accounts",
+ "fieldtype": "Table",
+ "label": "Exchange Rate Revaluation Account",
+ "no_copy": 1,
+ "options": "Exchange Rate Revaluation Account",
+ "reqd": 1
+ },
{
- "allow_bulk_edit": 0,
- "allow_in_quick_entry": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "section_break_6",
- "fieldtype": "Section Break",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 0,
- "in_standard_filter": 0,
- "length": 0,
- "no_copy": 0,
- "permlevel": 0,
- "precision": "",
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
- "translatable": 0,
- "unique": 0
- },
+ "fieldname": "section_break_6",
+ "fieldtype": "Section Break"
+ },
{
- "allow_bulk_edit": 0,
- "allow_in_quick_entry": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "total_gain_loss",
- "fieldtype": "Currency",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 0,
- "in_standard_filter": 0,
- "label": "Total Gain/Loss",
- "length": 0,
- "no_copy": 0,
- "permlevel": 0,
- "precision": "",
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 1,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
- "translatable": 0,
- "unique": 0
- },
+ "fieldname": "total_gain_loss",
+ "fieldtype": "Currency",
+ "label": "Total Gain/Loss",
+ "options": "Company:company:default_currency",
+ "read_only": 1
+ },
{
- "allow_bulk_edit": 0,
- "allow_in_quick_entry": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "amended_from",
- "fieldtype": "Link",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 0,
- "in_standard_filter": 0,
- "label": "Amended From",
- "length": 0,
- "no_copy": 1,
- "options": "Exchange Rate Revaluation",
- "permlevel": 0,
- "print_hide": 1,
- "print_hide_if_no_value": 0,
- "read_only": 1,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
- "translatable": 0,
- "unique": 0
+ "fieldname": "amended_from",
+ "fieldtype": "Link",
+ "label": "Amended From",
+ "no_copy": 1,
+ "options": "Exchange Rate Revaluation",
+ "print_hide": 1,
+ "read_only": 1
}
- ],
- "has_web_view": 0,
- "hide_heading": 0,
- "hide_toolbar": 0,
- "idx": 0,
- "image_view": 0,
- "in_create": 0,
- "is_submittable": 1,
- "issingle": 0,
- "istable": 0,
- "max_attachments": 0,
- "modified": "2018-08-21 16:15:34.660715",
- "modified_by": "Administrator",
- "module": "Accounts",
- "name": "Exchange Rate Revaluation",
- "name_case": "",
- "owner": "Administrator",
+ ],
+ "is_submittable": 1,
+ "links": [],
+ "modified": "2022-11-17 10:28:03.911554",
+ "modified_by": "Administrator",
+ "module": "Accounts",
+ "name": "Exchange Rate Revaluation",
+ "naming_rule": "Expression (old style)",
+ "owner": "Administrator",
"permissions": [
{
- "amend": 1,
- "cancel": 1,
- "create": 1,
- "delete": 1,
- "email": 1,
- "export": 1,
- "if_owner": 0,
- "import": 0,
- "permlevel": 0,
- "print": 1,
- "read": 1,
- "report": 1,
- "role": "System Manager",
- "set_user_permissions": 0,
- "share": 1,
- "submit": 1,
+ "amend": 1,
+ "cancel": 1,
+ "create": 1,
+ "delete": 1,
+ "email": 1,
+ "export": 1,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "System Manager",
+ "share": 1,
+ "submit": 1,
"write": 1
- },
+ },
{
- "amend": 1,
- "cancel": 1,
- "create": 1,
- "delete": 1,
- "email": 1,
- "export": 1,
- "if_owner": 0,
- "import": 0,
- "permlevel": 0,
- "print": 1,
- "read": 1,
- "report": 1,
- "role": "Accounts Manager",
- "set_user_permissions": 0,
- "share": 1,
- "submit": 1,
+ "amend": 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
- },
+ },
{
- "amend": 1,
- "cancel": 1,
- "create": 1,
- "delete": 1,
- "email": 1,
- "export": 1,
- "if_owner": 0,
- "import": 0,
- "permlevel": 0,
- "print": 1,
- "read": 1,
- "report": 1,
- "role": "Accounts User",
- "set_user_permissions": 0,
- "share": 1,
- "submit": 1,
+ "amend": 1,
+ "cancel": 1,
+ "create": 1,
+ "delete": 1,
+ "email": 1,
+ "export": 1,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "Accounts User",
+ "share": 1,
+ "submit": 1,
"write": 1
}
- ],
- "quick_entry": 0,
- "read_only": 0,
- "read_only_onload": 0,
- "show_name_in_global_search": 0,
- "sort_field": "modified",
- "sort_order": "DESC",
- "track_changes": 1,
- "track_seen": 0,
- "track_views": 0
+ ],
+ "sort_field": "modified",
+ "sort_order": "DESC",
+ "states": [],
+ "track_changes": 1
}
\ No newline at end of file
diff --git a/erpnext/accounts/doctype/exchange_rate_revaluation/exchange_rate_revaluation.py b/erpnext/accounts/doctype/exchange_rate_revaluation/exchange_rate_revaluation.py
index 2f81c5f..c907a25 100644
--- a/erpnext/accounts/doctype/exchange_rate_revaluation/exchange_rate_revaluation.py
+++ b/erpnext/accounts/doctype/exchange_rate_revaluation/exchange_rate_revaluation.py
@@ -233,6 +233,10 @@
balance = get_balance_on(
account, date=posting_date, party_type=party_type, party=party, in_account_currency=False
)
+ account_details = {
+ "account_currency": account_currency,
+ }
+
if balance:
balance_in_account_currency = get_balance_on(
account, date=posting_date, party_type=party_type, party=party
@@ -242,13 +246,14 @@
)
new_exchange_rate = get_exchange_rate(account_currency, company_currency, posting_date)
new_balance_in_base_currency = balance_in_account_currency * new_exchange_rate
- account_details = {
- "account_currency": account_currency,
- "balance_in_base_currency": balance,
- "balance_in_account_currency": balance_in_account_currency,
- "current_exchange_rate": current_exchange_rate,
- "new_exchange_rate": new_exchange_rate,
- "new_balance_in_base_currency": new_balance_in_base_currency,
- }
+ account_details = account_details.update(
+ {
+ "balance_in_base_currency": balance,
+ "balance_in_account_currency": balance_in_account_currency,
+ "current_exchange_rate": current_exchange_rate,
+ "new_exchange_rate": new_exchange_rate,
+ "new_balance_in_base_currency": new_balance_in_base_currency,
+ }
+ )
return account_details
diff --git a/erpnext/accounts/doctype/exchange_rate_revaluation_account/exchange_rate_revaluation_account.json b/erpnext/accounts/doctype/exchange_rate_revaluation_account/exchange_rate_revaluation_account.json
index 30ff9eb..80e972b 100644
--- a/erpnext/accounts/doctype/exchange_rate_revaluation_account/exchange_rate_revaluation_account.json
+++ b/erpnext/accounts/doctype/exchange_rate_revaluation_account/exchange_rate_revaluation_account.json
@@ -1,475 +1,120 @@
{
- "allow_copy": 0,
- "allow_events_in_timeline": 0,
- "allow_guest_to_view": 0,
- "allow_import": 0,
- "allow_rename": 0,
- "beta": 0,
+ "actions": [],
"creation": "2018-04-13 18:30:06.110433",
- "custom": 0,
- "docstatus": 0,
"doctype": "DocType",
- "document_type": "",
"editable_grid": 1,
"engine": "InnoDB",
+ "field_order": [
+ "account",
+ "party_type",
+ "party",
+ "column_break_2",
+ "account_currency",
+ "balance_in_account_currency",
+ "balances",
+ "current_exchange_rate",
+ "balance_in_base_currency",
+ "column_break_9",
+ "new_exchange_rate",
+ "new_balance_in_base_currency",
+ "gain_loss"
+ ],
"fields": [
{
- "allow_bulk_edit": 0,
- "allow_in_quick_entry": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fetch_if_empty": 0,
"fieldname": "account",
"fieldtype": "Link",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
"in_list_view": 1,
- "in_standard_filter": 0,
"label": "Account",
- "length": 0,
- "no_copy": 0,
"options": "Account",
- "permlevel": 0,
- "precision": "",
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 1,
- "search_index": 0,
- "set_only_once": 0,
- "translatable": 0,
- "unique": 0
+ "reqd": 1
},
{
- "allow_bulk_edit": 0,
- "allow_in_quick_entry": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fetch_if_empty": 0,
"fieldname": "party_type",
"fieldtype": "Link",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 0,
- "in_standard_filter": 0,
"label": "Party Type",
- "length": 0,
- "no_copy": 0,
- "options": "DocType",
- "permlevel": 0,
- "precision": "",
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
- "translatable": 0,
- "unique": 0
+ "options": "DocType"
},
{
- "allow_bulk_edit": 0,
- "allow_in_quick_entry": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fetch_if_empty": 0,
"fieldname": "party",
"fieldtype": "Dynamic Link",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 0,
- "in_standard_filter": 0,
"label": "Party",
- "length": 0,
- "no_copy": 0,
- "options": "party_type",
- "permlevel": 0,
- "precision": "",
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
- "translatable": 0,
- "unique": 0
+ "options": "party_type"
},
{
- "allow_bulk_edit": 0,
- "allow_in_quick_entry": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fetch_if_empty": 0,
"fieldname": "column_break_2",
- "fieldtype": "Column Break",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 0,
- "in_standard_filter": 0,
- "length": 0,
- "no_copy": 0,
- "permlevel": 0,
- "precision": "",
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
- "translatable": 0,
- "unique": 0
+ "fieldtype": "Column Break"
},
{
- "allow_bulk_edit": 0,
- "allow_in_quick_entry": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fetch_if_empty": 0,
"fieldname": "account_currency",
"fieldtype": "Link",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 0,
- "in_standard_filter": 0,
"label": "Account Currency",
- "length": 0,
- "no_copy": 0,
"options": "Currency",
- "permlevel": 0,
- "precision": "",
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 1,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
- "translatable": 0,
- "unique": 0
+ "read_only": 1
},
{
- "allow_bulk_edit": 0,
- "allow_in_quick_entry": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fetch_if_empty": 0,
"fieldname": "balance_in_account_currency",
"fieldtype": "Currency",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 0,
- "in_standard_filter": 0,
"label": "Balance In Account Currency",
- "length": 0,
- "no_copy": 0,
"options": "account_currency",
- "permlevel": 0,
- "precision": "",
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 1,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
- "translatable": 0,
- "unique": 0
+ "read_only": 1
},
{
- "allow_bulk_edit": 0,
- "allow_in_quick_entry": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fetch_if_empty": 0,
"fieldname": "balances",
- "fieldtype": "Section Break",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 0,
- "in_standard_filter": 0,
- "label": "",
- "length": 0,
- "no_copy": 0,
- "permlevel": 0,
- "precision": "",
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
- "translatable": 0,
- "unique": 0
+ "fieldtype": "Section Break"
},
{
- "allow_bulk_edit": 0,
- "allow_in_quick_entry": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fetch_if_empty": 0,
"fieldname": "current_exchange_rate",
"fieldtype": "Float",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 0,
- "in_standard_filter": 0,
"label": "Current Exchange Rate",
- "length": 0,
- "no_copy": 0,
- "permlevel": 0,
- "precision": "",
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 1,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
- "translatable": 0,
- "unique": 0
+ "read_only": 1
},
{
- "allow_bulk_edit": 0,
- "allow_in_quick_entry": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fetch_if_empty": 0,
"fieldname": "balance_in_base_currency",
"fieldtype": "Currency",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
"in_list_view": 1,
- "in_standard_filter": 0,
"label": "Balance In Base Currency",
- "length": 0,
- "no_copy": 0,
- "permlevel": 0,
- "precision": "",
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 1,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
- "translatable": 0,
- "unique": 0
+ "options": "Company:company:default_currency",
+ "read_only": 1
},
{
- "allow_bulk_edit": 0,
- "allow_in_quick_entry": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fetch_if_empty": 0,
"fieldname": "column_break_9",
- "fieldtype": "Column Break",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 0,
- "in_standard_filter": 0,
- "length": 0,
- "no_copy": 0,
- "permlevel": 0,
- "precision": "",
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
- "translatable": 0,
- "unique": 0
+ "fieldtype": "Column Break"
},
{
- "allow_bulk_edit": 0,
- "allow_in_quick_entry": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fetch_if_empty": 0,
"fieldname": "new_exchange_rate",
"fieldtype": "Float",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
"in_list_view": 1,
- "in_standard_filter": 0,
"label": "New Exchange Rate",
- "length": 0,
- "no_copy": 0,
- "permlevel": 0,
- "precision": "",
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 1,
- "search_index": 0,
- "set_only_once": 0,
- "translatable": 0,
- "unique": 0
+ "reqd": 1
},
{
- "allow_bulk_edit": 0,
- "allow_in_quick_entry": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fetch_if_empty": 0,
"fieldname": "new_balance_in_base_currency",
"fieldtype": "Currency",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
"in_list_view": 1,
- "in_standard_filter": 0,
"label": "New Balance In Base Currency",
- "length": 0,
- "no_copy": 0,
- "permlevel": 0,
- "precision": "",
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 1,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
- "translatable": 0,
- "unique": 0
+ "options": "Company:company:default_currency",
+ "read_only": 1
},
{
- "allow_bulk_edit": 0,
- "allow_in_quick_entry": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fetch_if_empty": 0,
"fieldname": "gain_loss",
"fieldtype": "Currency",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
"in_list_view": 1,
- "in_standard_filter": 0,
"label": "Gain/Loss",
- "length": 0,
- "no_copy": 0,
- "permlevel": 0,
- "precision": "",
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 1,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
- "translatable": 0,
- "unique": 0
+ "options": "Company:company:default_currency",
+ "read_only": 1
}
],
- "has_web_view": 0,
- "hide_heading": 0,
- "hide_toolbar": 0,
- "idx": 0,
- "image_view": 0,
- "in_create": 0,
- "is_submittable": 0,
- "issingle": 0,
"istable": 1,
- "max_attachments": 0,
- "modified": "2019-06-26 18:57:51.762345",
+ "links": [],
+ "modified": "2022-11-17 10:26:18.302728",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Exchange Rate Revaluation Account",
- "name_case": "",
"owner": "Administrator",
"permissions": [],
"quick_entry": 1,
- "read_only": 0,
- "read_only_onload": 0,
- "show_name_in_global_search": 0,
"sort_field": "modified",
"sort_order": "DESC",
- "track_changes": 1,
- "track_seen": 0,
- "track_views": 0
+ "states": [],
+ "track_changes": 1
}
\ No newline at end of file
diff --git a/erpnext/accounts/doctype/journal_entry/journal_entry.js b/erpnext/accounts/doctype/journal_entry/journal_entry.js
index 763e2e6..a5ff7f1 100644
--- a/erpnext/accounts/doctype/journal_entry/journal_entry.js
+++ b/erpnext/accounts/doctype/journal_entry/journal_entry.js
@@ -312,8 +312,7 @@
}
}
- get_outstanding(doctype, docname, company, child, due_date) {
- var me = this;
+ get_outstanding(doctype, docname, company, child) {
var args = {
"doctype": doctype,
"docname": docname,
diff --git a/erpnext/accounts/doctype/journal_entry/journal_entry.py b/erpnext/accounts/doctype/journal_entry/journal_entry.py
index 52690e1..de012b2 100644
--- a/erpnext/accounts/doctype/journal_entry/journal_entry.py
+++ b/erpnext/accounts/doctype/journal_entry/journal_entry.py
@@ -1210,6 +1210,7 @@
args = json.loads(args)
company_currency = erpnext.get_company_currency(args.get("company"))
+ due_date = None
if args.get("doctype") == "Journal Entry":
condition = " and party=%(party)s" if args.get("party") else ""
@@ -1234,10 +1235,12 @@
invoice = frappe.db.get_value(
args["doctype"],
args["docname"],
- ["outstanding_amount", "conversion_rate", scrub(party_type)],
+ ["outstanding_amount", "conversion_rate", scrub(party_type), "due_date"],
as_dict=1,
)
+ due_date = invoice.get("due_date")
+
exchange_rate = (
invoice.conversion_rate if (args.get("account_currency") != company_currency) else 1
)
@@ -1260,6 +1263,7 @@
"exchange_rate": exchange_rate,
"party_type": party_type,
"party": invoice.get(scrub(party_type)),
+ "reference_due_date": due_date,
}
diff --git a/erpnext/accounts/doctype/journal_entry_account/journal_entry_account.json b/erpnext/accounts/doctype/journal_entry_account/journal_entry_account.json
index dff883a..47ad19e 100644
--- a/erpnext/accounts/doctype/journal_entry_account/journal_entry_account.json
+++ b/erpnext/accounts/doctype/journal_entry_account/journal_entry_account.json
@@ -202,6 +202,7 @@
"fieldname": "reference_type",
"fieldtype": "Select",
"label": "Reference Type",
+ "no_copy": 1,
"options": "\nSales Invoice\nPurchase Invoice\nJournal Entry\nSales Order\nPurchase Order\nExpense Claim\nAsset\nLoan\nPayroll Entry\nEmployee Advance\nExchange Rate Revaluation\nInvoice Discounting\nFees\nFull and Final Statement"
},
{
@@ -209,13 +210,15 @@
"fieldtype": "Dynamic Link",
"in_list_view": 1,
"label": "Reference Name",
+ "no_copy": 1,
"options": "reference_type"
},
{
"depends_on": "eval:doc.reference_type&&!in_list(doc.reference_type, ['Expense Claim', 'Asset', 'Employee Loan', 'Employee Advance'])",
"fieldname": "reference_due_date",
- "fieldtype": "Select",
- "label": "Reference Due Date"
+ "fieldtype": "Date",
+ "label": "Reference Due Date",
+ "no_copy": 1
},
{
"fieldname": "project",
@@ -274,19 +277,22 @@
"fieldname": "reference_detail_no",
"fieldtype": "Data",
"hidden": 1,
- "label": "Reference Detail No"
+ "label": "Reference Detail No",
+ "no_copy": 1
}
],
"idx": 1,
"istable": 1,
"links": [],
- "modified": "2021-08-30 21:27:32.200299",
+ "modified": "2022-10-26 20:03:10.906259",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Journal Entry Account",
+ "naming_rule": "Random",
"owner": "Administrator",
"permissions": [],
"sort_field": "modified",
"sort_order": "DESC",
+ "states": [],
"track_changes": 1
}
\ No newline at end of file
diff --git a/erpnext/accounts/doctype/journal_entry_template/journal_entry_template.js b/erpnext/accounts/doctype/journal_entry_template/journal_entry_template.js
index cf5fbe1..88f1c90 100644
--- a/erpnext/accounts/doctype/journal_entry_template/journal_entry_template.js
+++ b/erpnext/accounts/doctype/journal_entry_template/journal_entry_template.js
@@ -45,21 +45,6 @@
frm.trigger("clear_child");
switch(frm.doc.voucher_type){
- case "Opening Entry":
- frm.set_value("is_opening", "Yes");
- frappe.call({
- type:"GET",
- method: "erpnext.accounts.doctype.journal_entry.journal_entry.get_opening_accounts",
- args: {
- "company": frm.doc.company
- },
- callback: function(r) {
- if(r.message) {
- add_accounts(frm.doc, r.message);
- }
- }
- });
- break;
case "Bank Entry":
case "Cash Entry":
frappe.call({
diff --git a/erpnext/accounts/doctype/opening_invoice_creation_tool/opening_invoice_creation_tool.js b/erpnext/accounts/doctype/opening_invoice_creation_tool/opening_invoice_creation_tool.js
index 7eb5c42..88867d1 100644
--- a/erpnext/accounts/doctype/opening_invoice_creation_tool/opening_invoice_creation_tool.js
+++ b/erpnext/accounts/doctype/opening_invoice_creation_tool/opening_invoice_creation_tool.js
@@ -20,15 +20,14 @@
frm.dashboard.reset();
frm.doc.import_in_progress = true;
}
- if (data.user != frappe.session.user) return;
if (data.count == data.total) {
- setTimeout((title) => {
+ setTimeout(() => {
frm.doc.import_in_progress = false;
frm.clear_table("invoices");
frm.refresh_fields();
frm.page.clear_indicator();
- frm.dashboard.hide_progress(title);
- frappe.msgprint(__("Opening {0} Invoice created", [frm.doc.invoice_type]));
+ frm.dashboard.hide_progress();
+ frappe.msgprint(__("Opening {0} Invoices created", [frm.doc.invoice_type]));
}, 1500, data.title);
return;
}
@@ -51,13 +50,6 @@
method: "make_invoices",
freeze: 1,
freeze_message: __("Creating {0} Invoice", [frm.doc.invoice_type]),
- callback: function(r) {
- if (r.message.length == 1) {
- frappe.msgprint(__("{0} Invoice created successfully.", [frm.doc.invoice_type]));
- } else if (r.message.length < 50) {
- frappe.msgprint(__("{0} Invoices created successfully.", [frm.doc.invoice_type]));
- }
- }
});
});
diff --git a/erpnext/accounts/doctype/opening_invoice_creation_tool/opening_invoice_creation_tool.py b/erpnext/accounts/doctype/opening_invoice_creation_tool/opening_invoice_creation_tool.py
index f7df1ff..47c2ceb 100644
--- a/erpnext/accounts/doctype/opening_invoice_creation_tool/opening_invoice_creation_tool.py
+++ b/erpnext/accounts/doctype/opening_invoice_creation_tool/opening_invoice_creation_tool.py
@@ -255,17 +255,15 @@
def publish(index, total, doctype):
- if total < 50:
- return
frappe.publish_realtime(
"opening_invoice_creation_progress",
dict(
title=_("Opening Invoice Creation In Progress"),
message=_("Creating {} out of {} {}").format(index + 1, total, doctype),
- user=frappe.session.user,
count=index + 1,
total=total,
),
+ user=frappe.session.user,
)
diff --git a/erpnext/accounts/doctype/payment_entry/payment_entry.py b/erpnext/accounts/doctype/payment_entry/payment_entry.py
index 7f245fd..51b134a 100644
--- a/erpnext/accounts/doctype/payment_entry/payment_entry.py
+++ b/erpnext/accounts/doctype/payment_entry/payment_entry.py
@@ -62,7 +62,6 @@
self.set_missing_values()
self.validate_payment_type()
self.validate_party_details()
- self.validate_bank_accounts()
self.set_exchange_rate()
self.validate_mandatory()
self.validate_reference_documents()
@@ -243,23 +242,6 @@
if not frappe.db.exists(self.party_type, self.party):
frappe.throw(_("Invalid {0}: {1}").format(self.party_type, self.party))
- if self.party_account and self.party_type in ("Customer", "Supplier"):
- self.validate_account_type(
- self.party_account, [erpnext.get_party_account_type(self.party_type)]
- )
-
- def validate_bank_accounts(self):
- if self.payment_type in ("Pay", "Internal Transfer"):
- self.validate_account_type(self.paid_from, ["Bank", "Cash"])
-
- if self.payment_type in ("Receive", "Internal Transfer"):
- self.validate_account_type(self.paid_to, ["Bank", "Cash"])
-
- def validate_account_type(self, account, account_types):
- account_type = frappe.db.get_value("Account", account, "account_type")
- # if account_type not in account_types:
- # frappe.throw(_("Account Type for {0} must be {1}").format(account, comma_or(account_types)))
-
def set_exchange_rate(self, ref_doc=None):
self.set_source_exchange_rate(ref_doc)
self.set_target_exchange_rate(ref_doc)
@@ -995,7 +977,9 @@
if self.payment_type in ("Receive", "Pay") and self.party:
for d in self.get("references"):
if d.allocated_amount and d.reference_doctype in frappe.get_hooks("advance_payment_doctypes"):
- frappe.get_doc(d.reference_doctype, d.reference_name).set_total_advance_paid()
+ frappe.get_doc(
+ d.reference_doctype, d.reference_name, for_update=True
+ ).set_total_advance_paid()
def on_recurring(self, reference_doc, auto_repeat_doc):
self.reference_no = reference_doc.name
diff --git a/erpnext/accounts/doctype/payment_ledger_entry/test_payment_ledger_entry.py b/erpnext/accounts/doctype/payment_ledger_entry/test_payment_ledger_entry.py
index a71b19e..fc6dbba 100644
--- a/erpnext/accounts/doctype/payment_ledger_entry/test_payment_ledger_entry.py
+++ b/erpnext/accounts/doctype/payment_ledger_entry/test_payment_ledger_entry.py
@@ -3,12 +3,13 @@
import frappe
from frappe import qb
-from frappe.tests.utils import FrappeTestCase
+from frappe.tests.utils import FrappeTestCase, change_settings
from frappe.utils import nowdate
from erpnext.accounts.doctype.payment_entry.payment_entry import get_payment_entry
from erpnext.accounts.doctype.payment_entry.test_payment_entry import create_payment_entry
from erpnext.accounts.doctype.sales_invoice.test_sales_invoice import create_sales_invoice
+from erpnext.selling.doctype.sales_order.test_sales_order import make_sales_order
from erpnext.stock.doctype.item.test_item import create_item
@@ -127,6 +128,25 @@
payment.posting_date = posting_date
return payment
+ def create_sales_order(
+ self, qty=1, rate=100, posting_date=nowdate(), do_not_save=False, do_not_submit=False
+ ):
+ so = make_sales_order(
+ company=self.company,
+ transaction_date=posting_date,
+ customer=self.customer,
+ item_code=self.item,
+ cost_center=self.cost_center,
+ warehouse=self.warehouse,
+ debit_to=self.debit_to,
+ currency="INR",
+ qty=qty,
+ rate=100,
+ do_not_save=do_not_save,
+ do_not_submit=do_not_submit,
+ )
+ return so
+
def clear_old_entries(self):
doctype_list = [
"GL Entry",
@@ -406,3 +426,89 @@
]
self.assertEqual(pl_entries_for_crnote[0], expected_values[0])
self.assertEqual(pl_entries_for_crnote[1], expected_values[1])
+
+ @change_settings(
+ "Accounts Settings",
+ {"unlink_payment_on_cancellation_of_invoice": 1, "delete_linked_ledger_entries": 1},
+ )
+ def test_multi_payment_unlink_on_invoice_cancellation(self):
+ transaction_date = nowdate()
+ amount = 100
+ si = self.create_sales_invoice(qty=1, rate=amount, posting_date=transaction_date)
+
+ for amt in [40, 40, 20]:
+ # payment 1
+ pe = get_payment_entry(si.doctype, si.name)
+ pe.paid_amount = amt
+ pe.get("references")[0].allocated_amount = amt
+ pe = pe.save().submit()
+
+ si.reload()
+ si.cancel()
+
+ entries = frappe.db.get_list(
+ "Payment Ledger Entry",
+ filters={"against_voucher_type": si.doctype, "against_voucher_no": si.name, "delinked": 0},
+ )
+ self.assertEqual(entries, [])
+
+ # with references removed, deletion should be possible
+ si.delete()
+ self.assertRaises(frappe.DoesNotExistError, frappe.get_doc, si.doctype, si.name)
+
+ @change_settings(
+ "Accounts Settings",
+ {"unlink_payment_on_cancellation_of_invoice": 1, "delete_linked_ledger_entries": 1},
+ )
+ def test_multi_je_unlink_on_invoice_cancellation(self):
+ transaction_date = nowdate()
+ amount = 100
+ si = self.create_sales_invoice(qty=1, rate=amount, posting_date=transaction_date)
+
+ # multiple JE's against invoice
+ for amt in [40, 40, 20]:
+ je1 = self.create_journal_entry(
+ self.income_account, self.debit_to, amt, posting_date=transaction_date
+ )
+ je1.get("accounts")[1].party_type = "Customer"
+ je1.get("accounts")[1].party = self.customer
+ je1.get("accounts")[1].reference_type = si.doctype
+ je1.get("accounts")[1].reference_name = si.name
+ je1 = je1.save().submit()
+
+ si.reload()
+ si.cancel()
+
+ entries = frappe.db.get_list(
+ "Payment Ledger Entry",
+ filters={"against_voucher_type": si.doctype, "against_voucher_no": si.name, "delinked": 0},
+ )
+ self.assertEqual(entries, [])
+
+ # with references removed, deletion should be possible
+ si.delete()
+ self.assertRaises(frappe.DoesNotExistError, frappe.get_doc, si.doctype, si.name)
+
+ @change_settings(
+ "Accounts Settings",
+ {"unlink_payment_on_cancellation_of_invoice": 1, "delete_linked_ledger_entries": 1},
+ )
+ def test_advance_payment_unlink_on_order_cancellation(self):
+ transaction_date = nowdate()
+ amount = 100
+ so = self.create_sales_order(qty=1, rate=amount, posting_date=transaction_date).save().submit()
+
+ pe = get_payment_entry(so.doctype, so.name).save().submit()
+
+ so.reload()
+ so.cancel()
+
+ entries = frappe.db.get_list(
+ "Payment Ledger Entry",
+ filters={"against_voucher_type": so.doctype, "against_voucher_no": so.name, "delinked": 0},
+ )
+ self.assertEqual(entries, [])
+
+ # with references removed, deletion should be possible
+ so.delete()
+ self.assertRaises(frappe.DoesNotExistError, frappe.get_doc, so.doctype, so.name)
diff --git a/erpnext/accounts/doctype/pos_closing_entry/pos_closing_entry.js b/erpnext/accounts/doctype/pos_closing_entry/pos_closing_entry.js
index 1d596c1..e6d9fe2 100644
--- a/erpnext/accounts/doctype/pos_closing_entry/pos_closing_entry.js
+++ b/erpnext/accounts/doctype/pos_closing_entry/pos_closing_entry.js
@@ -25,7 +25,7 @@
frappe.realtime.on('closing_process_complete', async function(data) {
await frm.reload_doc();
- if (frm.doc.status == 'Failed' && frm.doc.error_message && data.user == frappe.session.user) {
+ if (frm.doc.status == 'Failed' && frm.doc.error_message) {
frappe.msgprint({
title: __('POS Closing Failed'),
message: frm.doc.error_message,
diff --git a/erpnext/accounts/doctype/pos_invoice/pos_invoice.json b/erpnext/accounts/doctype/pos_invoice/pos_invoice.json
index 6f8b382..eedaaaf 100644
--- a/erpnext/accounts/doctype/pos_invoice/pos_invoice.json
+++ b/erpnext/accounts/doctype/pos_invoice/pos_invoice.json
@@ -343,7 +343,8 @@
"no_copy": 1,
"options": "POS Invoice",
"print_hide": 1,
- "read_only": 1
+ "read_only": 1,
+ "search_index": 1
},
{
"default": "0",
@@ -1553,7 +1554,7 @@
"icon": "fa fa-file-text",
"is_submittable": 1,
"links": [],
- "modified": "2022-09-27 13:00:24.166684",
+ "modified": "2022-09-30 03:49:50.455199",
"modified_by": "Administrator",
"module": "Accounts",
"name": "POS Invoice",
diff --git a/erpnext/accounts/doctype/pos_invoice/pos_invoice.py b/erpnext/accounts/doctype/pos_invoice/pos_invoice.py
index fbe0ef3..54a3e93 100644
--- a/erpnext/accounts/doctype/pos_invoice/pos_invoice.py
+++ b/erpnext/accounts/doctype/pos_invoice/pos_invoice.py
@@ -743,7 +743,3 @@
]:
payment_mode = get_mode_of_payment_info(mode_of_payment, doc.company)
append_payment(payment_mode[0])
-
-
-def on_doctype_update():
- frappe.db.add_index("POS Invoice", ["return_against"])
diff --git a/erpnext/accounts/doctype/pos_invoice/test_pos_invoice.py b/erpnext/accounts/doctype/pos_invoice/test_pos_invoice.py
index 70f128e..3132fdd 100644
--- a/erpnext/accounts/doctype/pos_invoice/test_pos_invoice.py
+++ b/erpnext/accounts/doctype/pos_invoice/test_pos_invoice.py
@@ -495,6 +495,67 @@
self.assertRaises(frappe.ValidationError, pos.submit)
+ def test_value_error_on_serial_no_validation(self):
+ from erpnext.stock.doctype.stock_entry.test_stock_entry import make_serialized_item
+
+ se = make_serialized_item(
+ company="_Test Company",
+ target_warehouse="Stores - _TC",
+ cost_center="Main - _TC",
+ expense_account="Cost of Goods Sold - _TC",
+ )
+ serial_nos = se.get("items")[0].serial_no
+
+ # make a pos invoice
+ pos = create_pos_invoice(
+ company="_Test Company",
+ debit_to="Debtors - _TC",
+ account_for_change_amount="Cash - _TC",
+ warehouse="Stores - _TC",
+ income_account="Sales - _TC",
+ expense_account="Cost of Goods Sold - _TC",
+ cost_center="Main - _TC",
+ item=se.get("items")[0].item_code,
+ rate=1000,
+ qty=1,
+ do_not_save=1,
+ )
+ pos.get("items")[0].has_serial_no = 1
+ pos.get("items")[0].serial_no = serial_nos.split("\n")[0]
+ pos.set("payments", [])
+ pos.append(
+ "payments", {"mode_of_payment": "Cash", "account": "Cash - _TC", "amount": 1000, "default": 1}
+ )
+ pos = pos.save().submit()
+
+ # make a return
+ pos_return = make_sales_return(pos.name)
+ pos_return.paid_amount = pos_return.grand_total
+ pos_return.save()
+ pos_return.submit()
+
+ # set docstatus to 2 for pos to trigger this issue
+ frappe.db.set_value("POS Invoice", pos.name, "docstatus", 2)
+
+ pos2 = create_pos_invoice(
+ company="_Test Company",
+ debit_to="Debtors - _TC",
+ account_for_change_amount="Cash - _TC",
+ warehouse="Stores - _TC",
+ income_account="Sales - _TC",
+ expense_account="Cost of Goods Sold - _TC",
+ cost_center="Main - _TC",
+ item=se.get("items")[0].item_code,
+ rate=1000,
+ qty=1,
+ do_not_save=1,
+ )
+
+ pos2.get("items")[0].has_serial_no = 1
+ pos2.get("items")[0].serial_no = serial_nos.split("\n")[0]
+ # Value error should not be triggered on validation
+ pos2.save()
+
def test_loyalty_points(self):
from erpnext.accounts.doctype.loyalty_program.loyalty_program import (
get_loyalty_program_details_with_points,
diff --git a/erpnext/accounts/doctype/pos_invoice_item/pos_invoice_item.json b/erpnext/accounts/doctype/pos_invoice_item/pos_invoice_item.json
index 3f85668..4bb1865 100644
--- a/erpnext/accounts/doctype/pos_invoice_item/pos_invoice_item.json
+++ b/erpnext/accounts/doctype/pos_invoice_item/pos_invoice_item.json
@@ -8,6 +8,7 @@
"engine": "InnoDB",
"field_order": [
"barcode",
+ "has_item_scanned",
"item_code",
"col_break1",
"item_name",
@@ -808,11 +809,19 @@
"fieldtype": "Check",
"label": "Grant Commission",
"read_only": 1
+ },
+ {
+ "default": "0",
+ "depends_on": "barcode",
+ "fieldname": "has_item_scanned",
+ "fieldtype": "Check",
+ "label": "Has Item Scanned",
+ "read_only": 1
}
],
"istable": 1,
"links": [],
- "modified": "2021-10-05 12:23:47.506290",
+ "modified": "2022-11-02 12:52:39.125295",
"modified_by": "Administrator",
"module": "Accounts",
"name": "POS Invoice Item",
@@ -820,5 +829,6 @@
"owner": "Administrator",
"permissions": [],
"sort_field": "modified",
- "sort_order": "DESC"
+ "sort_order": "DESC",
+ "states": []
}
\ No newline at end of file
diff --git a/erpnext/accounts/doctype/pos_invoice_merge_log/pos_invoice_merge_log.py b/erpnext/accounts/doctype/pos_invoice_merge_log/pos_invoice_merge_log.py
index a0a1c8c..3a237a4 100644
--- a/erpnext/accounts/doctype/pos_invoice_merge_log/pos_invoice_merge_log.py
+++ b/erpnext/accounts/doctype/pos_invoice_merge_log/pos_invoice_merge_log.py
@@ -430,7 +430,7 @@
finally:
frappe.db.commit()
- frappe.publish_realtime("closing_process_complete", {"user": frappe.session.user})
+ frappe.publish_realtime("closing_process_complete", user=frappe.session.user)
def cancel_merge_logs(merge_logs, closing_entry=None):
@@ -457,7 +457,7 @@
finally:
frappe.db.commit()
- frappe.publish_realtime("closing_process_complete", {"user": frappe.session.user})
+ frappe.publish_realtime("closing_process_complete", user=frappe.session.user)
def enqueue_job(job, **kwargs):
diff --git a/erpnext/accounts/doctype/pricing_rule/pricing_rule.json b/erpnext/accounts/doctype/pricing_rule/pricing_rule.json
index 6e7ebd1..ce9ce64 100644
--- a/erpnext/accounts/doctype/pricing_rule/pricing_rule.json
+++ b/erpnext/accounts/doctype/pricing_rule/pricing_rule.json
@@ -52,7 +52,10 @@
"free_item_rate",
"column_break_42",
"free_item_uom",
+ "round_free_qty",
"is_recursive",
+ "recurse_for",
+ "apply_recursion_over",
"section_break_23",
"valid_from",
"valid_upto",
@@ -578,12 +581,34 @@
"fieldtype": "Select",
"label": "Naming Series",
"options": "PRLE-.####"
+ },
+ {
+ "default": "0",
+ "fieldname": "round_free_qty",
+ "fieldtype": "Check",
+ "label": "Round Free Qty"
+ },
+ {
+ "depends_on": "is_recursive",
+ "description": "Give free item for every N quantity",
+ "fieldname": "recurse_for",
+ "fieldtype": "Float",
+ "label": "Recurse Every (As Per Transaction UOM)",
+ "mandatory_depends_on": "is_recursive"
+ },
+ {
+ "default": "0",
+ "depends_on": "is_recursive",
+ "description": "Qty for which recursion isn't applicable.",
+ "fieldname": "apply_recursion_over",
+ "fieldtype": "Float",
+ "label": "Apply Recursion Over (As Per Transaction UOM)"
}
],
"icon": "fa fa-gift",
"idx": 1,
"links": [],
- "modified": "2022-09-16 16:00:38.356266",
+ "modified": "2022-10-13 19:05:35.056304",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Pricing Rule",
diff --git a/erpnext/accounts/doctype/pricing_rule/pricing_rule.py b/erpnext/accounts/doctype/pricing_rule/pricing_rule.py
index 9af3188..ed46d85 100644
--- a/erpnext/accounts/doctype/pricing_rule/pricing_rule.py
+++ b/erpnext/accounts/doctype/pricing_rule/pricing_rule.py
@@ -24,6 +24,7 @@
self.validate_applicable_for_selling_or_buying()
self.validate_min_max_amt()
self.validate_min_max_qty()
+ self.validate_recursion()
self.cleanup_fields_value()
self.validate_rate_or_discount()
self.validate_max_discount()
@@ -109,6 +110,18 @@
if self.min_amt and self.max_amt and flt(self.min_amt) > flt(self.max_amt):
throw(_("Min Amt can not be greater than Max Amt"))
+ def validate_recursion(self):
+ if self.price_or_product_discount != "Product":
+ return
+ if self.free_item or self.same_item:
+ if flt(self.recurse_for) <= 0:
+ self.recurse_for = 1
+ if self.is_recursive:
+ if flt(self.apply_recursion_over) > flt(self.min_qty):
+ throw(_("Min Qty should be greater than Recurse Over Qty"))
+ if flt(self.apply_recursion_over) < 0:
+ throw(_("Recurse Over Qty cannot be less than 0"))
+
def cleanup_fields_value(self):
for logic_field in ["apply_on", "applicable_for", "rate_or_discount"]:
fieldname = frappe.scrub(self.get(logic_field) or "")
@@ -268,6 +281,18 @@
return item_details
+def update_pricing_rule_uom(pricing_rule, args):
+ child_doc = {"Item Code": "items", "Item Group": "item_groups", "Brand": "brands"}.get(
+ pricing_rule.apply_on
+ )
+
+ apply_on_field = frappe.scrub(pricing_rule.apply_on)
+
+ for row in pricing_rule.get(child_doc):
+ if row.get(apply_on_field) == args.get(apply_on_field):
+ pricing_rule.uom = row.uom
+
+
def get_pricing_rule_for_item(args, price_list_rate=0, doc=None, for_validate=False):
from erpnext.accounts.doctype.pricing_rule.utils import (
get_applied_pricing_rules,
@@ -324,6 +349,7 @@
if isinstance(pricing_rule, str):
pricing_rule = frappe.get_cached_doc("Pricing Rule", pricing_rule)
+ update_pricing_rule_uom(pricing_rule, args)
pricing_rule.apply_rule_on_other_items = get_pricing_rule_items(pricing_rule) or []
if pricing_rule.get("suggestion"):
@@ -440,12 +466,15 @@
if pricing_rule.currency == args.currency:
pricing_rule_rate = pricing_rule.rate
+ # TODO https://github.com/frappe/erpnext/pull/23636 solve this in some other way.
if pricing_rule_rate:
+ is_blank_uom = pricing_rule.get("uom") != args.get("uom")
# Override already set price list rate (from item price)
# if pricing_rule_rate > 0
item_details.update(
{
- "price_list_rate": pricing_rule_rate * args.get("conversion_factor", 1),
+ "price_list_rate": pricing_rule_rate
+ * (args.get("conversion_factor", 1) if is_blank_uom else 1),
}
)
item_details.update({"discount_percentage": 0.0})
diff --git a/erpnext/accounts/doctype/pricing_rule/test_pricing_rule.py b/erpnext/accounts/doctype/pricing_rule/test_pricing_rule.py
index 0a9db6b..d27f65e 100644
--- a/erpnext/accounts/doctype/pricing_rule/test_pricing_rule.py
+++ b/erpnext/accounts/doctype/pricing_rule/test_pricing_rule.py
@@ -595,6 +595,247 @@
frappe.get_doc("Item Price", {"item_code": "Water Flask"}).delete()
item.delete()
+ def test_item_price_with_blank_uom_pricing_rule(self):
+ properties = {
+ "item_code": "Item Blank UOM",
+ "stock_uom": "Nos",
+ "sales_uom": "Box",
+ "uoms": [dict(uom="Box", conversion_factor=10)],
+ }
+ item = make_item(properties=properties)
+
+ make_item_price("Item Blank UOM", "_Test Price List", 100)
+
+ pricing_rule_record = {
+ "doctype": "Pricing Rule",
+ "title": "_Test Item Blank UOM Rule",
+ "apply_on": "Item Code",
+ "items": [
+ {
+ "item_code": "Item Blank UOM",
+ }
+ ],
+ "selling": 1,
+ "currency": "INR",
+ "rate_or_discount": "Rate",
+ "rate": 101,
+ "company": "_Test Company",
+ }
+ rule = frappe.get_doc(pricing_rule_record)
+ rule.insert()
+
+ si = create_sales_invoice(
+ do_not_save=True, item_code="Item Blank UOM", uom="Box", conversion_factor=10
+ )
+ si.selling_price_list = "_Test Price List"
+ si.save()
+
+ # If UOM is blank consider it as stock UOM and apply pricing_rule on all UOM.
+ # rate is 101, Selling UOM is Box that have conversion_factor of 10 so 101 * 10 = 1010
+ self.assertEqual(si.items[0].price_list_rate, 1010)
+ self.assertEqual(si.items[0].rate, 1010)
+
+ si.delete()
+
+ si = create_sales_invoice(do_not_save=True, item_code="Item Blank UOM", uom="Nos")
+ si.selling_price_list = "_Test Price List"
+ si.save()
+
+ # UOM is blank so consider it as stock UOM and apply pricing_rule on all UOM.
+ # rate is 101, Selling UOM is Nos that have conversion_factor of 1 so 101 * 1 = 101
+ self.assertEqual(si.items[0].price_list_rate, 101)
+ self.assertEqual(si.items[0].rate, 101)
+
+ si.delete()
+ rule.delete()
+ frappe.get_doc("Item Price", {"item_code": "Item Blank UOM"}).delete()
+
+ item.delete()
+
+ def test_item_price_with_selling_uom_pricing_rule(self):
+ properties = {
+ "item_code": "Item UOM other than Stock",
+ "stock_uom": "Nos",
+ "sales_uom": "Box",
+ "uoms": [dict(uom="Box", conversion_factor=10)],
+ }
+ item = make_item(properties=properties)
+
+ make_item_price("Item UOM other than Stock", "_Test Price List", 100)
+
+ pricing_rule_record = {
+ "doctype": "Pricing Rule",
+ "title": "_Test Item UOM other than Stock Rule",
+ "apply_on": "Item Code",
+ "items": [
+ {
+ "item_code": "Item UOM other than Stock",
+ "uom": "Box",
+ }
+ ],
+ "selling": 1,
+ "currency": "INR",
+ "rate_or_discount": "Rate",
+ "rate": 101,
+ "company": "_Test Company",
+ }
+ rule = frappe.get_doc(pricing_rule_record)
+ rule.insert()
+
+ si = create_sales_invoice(
+ do_not_save=True, item_code="Item UOM other than Stock", uom="Box", conversion_factor=10
+ )
+ si.selling_price_list = "_Test Price List"
+ si.save()
+
+ # UOM is Box so apply pricing_rule only on Box UOM.
+ # Selling UOM is Box and as both UOM are same no need to multiply by conversion_factor.
+ self.assertEqual(si.items[0].price_list_rate, 101)
+ self.assertEqual(si.items[0].rate, 101)
+
+ si.delete()
+
+ si = create_sales_invoice(do_not_save=True, item_code="Item UOM other than Stock", uom="Nos")
+ si.selling_price_list = "_Test Price List"
+ si.save()
+
+ # UOM is Box so pricing_rule won't apply as selling_uom is Nos.
+ # As Pricing Rule is not applied price of 100 will be fetched from Item Price List.
+ self.assertEqual(si.items[0].price_list_rate, 100)
+ self.assertEqual(si.items[0].rate, 100)
+
+ si.delete()
+ rule.delete()
+ frappe.get_doc("Item Price", {"item_code": "Item UOM other than Stock"}).delete()
+
+ item.delete()
+
+ def test_item_group_price_with_blank_uom_pricing_rule(self):
+ group = frappe.get_doc(doctype="Item Group", item_group_name="_Test Pricing Rule Item Group")
+ group.save()
+ properties = {
+ "item_code": "Item with Group Blank UOM",
+ "item_group": "_Test Pricing Rule Item Group",
+ "stock_uom": "Nos",
+ "sales_uom": "Box",
+ "uoms": [dict(uom="Box", conversion_factor=10)],
+ }
+ item = make_item(properties=properties)
+
+ make_item_price("Item with Group Blank UOM", "_Test Price List", 100)
+
+ pricing_rule_record = {
+ "doctype": "Pricing Rule",
+ "title": "_Test Item with Group Blank UOM Rule",
+ "apply_on": "Item Group",
+ "item_groups": [
+ {
+ "item_group": "_Test Pricing Rule Item Group",
+ }
+ ],
+ "selling": 1,
+ "currency": "INR",
+ "rate_or_discount": "Rate",
+ "rate": 101,
+ "company": "_Test Company",
+ }
+ rule = frappe.get_doc(pricing_rule_record)
+ rule.insert()
+
+ si = create_sales_invoice(
+ do_not_save=True, item_code="Item with Group Blank UOM", uom="Box", conversion_factor=10
+ )
+ si.selling_price_list = "_Test Price List"
+ si.save()
+
+ # If UOM is blank consider it as stock UOM and apply pricing_rule on all UOM.
+ # rate is 101, Selling UOM is Box that have conversion_factor of 10 so 101 * 10 = 1010
+ self.assertEqual(si.items[0].price_list_rate, 1010)
+ self.assertEqual(si.items[0].rate, 1010)
+
+ si.delete()
+
+ si = create_sales_invoice(do_not_save=True, item_code="Item with Group Blank UOM", uom="Nos")
+ si.selling_price_list = "_Test Price List"
+ si.save()
+
+ # UOM is blank so consider it as stock UOM and apply pricing_rule on all UOM.
+ # rate is 101, Selling UOM is Nos that have conversion_factor of 1 so 101 * 1 = 101
+ self.assertEqual(si.items[0].price_list_rate, 101)
+ self.assertEqual(si.items[0].rate, 101)
+
+ si.delete()
+ rule.delete()
+ frappe.get_doc("Item Price", {"item_code": "Item with Group Blank UOM"}).delete()
+ item.delete()
+ group.delete()
+
+ def test_item_group_price_with_selling_uom_pricing_rule(self):
+ group = frappe.get_doc(doctype="Item Group", item_group_name="_Test Pricing Rule Item Group UOM")
+ group.save()
+ properties = {
+ "item_code": "Item with Group UOM other than Stock",
+ "item_group": "_Test Pricing Rule Item Group UOM",
+ "stock_uom": "Nos",
+ "sales_uom": "Box",
+ "uoms": [dict(uom="Box", conversion_factor=10)],
+ }
+ item = make_item(properties=properties)
+
+ make_item_price("Item with Group UOM other than Stock", "_Test Price List", 100)
+
+ pricing_rule_record = {
+ "doctype": "Pricing Rule",
+ "title": "_Test Item with Group UOM other than Stock Rule",
+ "apply_on": "Item Group",
+ "item_groups": [
+ {
+ "item_group": "_Test Pricing Rule Item Group UOM",
+ "uom": "Box",
+ }
+ ],
+ "selling": 1,
+ "currency": "INR",
+ "rate_or_discount": "Rate",
+ "rate": 101,
+ "company": "_Test Company",
+ }
+ rule = frappe.get_doc(pricing_rule_record)
+ rule.insert()
+
+ si = create_sales_invoice(
+ do_not_save=True,
+ item_code="Item with Group UOM other than Stock",
+ uom="Box",
+ conversion_factor=10,
+ )
+ si.selling_price_list = "_Test Price List"
+ si.save()
+
+ # UOM is Box so apply pricing_rule only on Box UOM.
+ # Selling UOM is Box and as both UOM are same no need to multiply by conversion_factor.
+ self.assertEqual(si.items[0].price_list_rate, 101)
+ self.assertEqual(si.items[0].rate, 101)
+
+ si.delete()
+
+ si = create_sales_invoice(
+ do_not_save=True, item_code="Item with Group UOM other than Stock", uom="Nos"
+ )
+ si.selling_price_list = "_Test Price List"
+ si.save()
+
+ # UOM is Box so pricing_rule won't apply as selling_uom is Nos.
+ # As Pricing Rule is not applied price of 100 will be fetched from Item Price List.
+ self.assertEqual(si.items[0].price_list_rate, 100)
+ self.assertEqual(si.items[0].rate, 100)
+
+ si.delete()
+ rule.delete()
+ frappe.get_doc("Item Price", {"item_code": "Item with Group UOM other than Stock"}).delete()
+ item.delete()
+ group.delete()
+
def test_pricing_rule_for_different_currency(self):
make_item("Test Sanitizer Item")
@@ -828,6 +1069,45 @@
si.delete()
rule.delete()
+ def test_pricing_rule_for_product_free_item_rounded_qty_and_recursion(self):
+ frappe.delete_doc_if_exists("Pricing Rule", "_Test Pricing Rule")
+ test_record = {
+ "doctype": "Pricing Rule",
+ "title": "_Test Pricing Rule",
+ "apply_on": "Item Code",
+ "currency": "USD",
+ "items": [
+ {
+ "item_code": "_Test Item",
+ }
+ ],
+ "selling": 1,
+ "rate": 0,
+ "min_qty": 3,
+ "max_qty": 7,
+ "price_or_product_discount": "Product",
+ "same_item": 1,
+ "free_qty": 1,
+ "round_free_qty": 1,
+ "is_recursive": 1,
+ "recurse_for": 2,
+ "company": "_Test Company",
+ }
+ frappe.get_doc(test_record.copy()).insert()
+
+ # With pricing rule
+ so = make_sales_order(item_code="_Test Item", qty=5)
+ so.load_from_db()
+ self.assertEqual(so.items[1].is_free_item, 1)
+ self.assertEqual(so.items[1].item_code, "_Test Item")
+ self.assertEqual(so.items[1].qty, 2)
+
+ so = make_sales_order(item_code="_Test Item", qty=7)
+ so.load_from_db()
+ self.assertEqual(so.items[1].is_free_item, 1)
+ self.assertEqual(so.items[1].item_code, "_Test Item")
+ self.assertEqual(so.items[1].qty, 4)
+
test_dependencies = ["Campaign"]
diff --git a/erpnext/accounts/doctype/pricing_rule/utils.py b/erpnext/accounts/doctype/pricing_rule/utils.py
index 1f29d73..bb54b23 100644
--- a/erpnext/accounts/doctype/pricing_rule/utils.py
+++ b/erpnext/accounts/doctype/pricing_rule/utils.py
@@ -111,6 +111,12 @@
)
if apply_on_field == "item_code":
+ if args.get("uom", None):
+ item_conditions += (
+ " and ({child_doc}.uom='{item_uom}' or IFNULL({child_doc}.uom, '')='')".format(
+ child_doc=child_doc, item_uom=args.get("uom")
+ )
+ )
if "variant_of" not in args:
args.variant_of = frappe.get_cached_value("Item", args.item_code, "variant_of")
@@ -121,6 +127,12 @@
values["variant_of"] = args.variant_of
elif apply_on_field == "item_group":
item_conditions = _get_tree_conditions(args, "Item Group", child_doc, False)
+ if args.get("uom", None):
+ item_conditions += (
+ " and ({child_doc}.uom='{item_uom}' or IFNULL({child_doc}.uom, '')='')".format(
+ child_doc=child_doc, item_uom=args.get("uom")
+ )
+ )
conditions += get_other_conditions(conditions, values, args)
warehouse_conditions = _get_tree_conditions(args, "Warehouse", "`tabPricing Rule`")
@@ -621,9 +633,13 @@
qty = pricing_rule.free_qty or 1
if pricing_rule.is_recursive:
- transaction_qty = args.get("qty") if args else doc.total_qty
+ transaction_qty = (
+ args.get("qty") if args else doc.total_qty
+ ) - pricing_rule.apply_recursion_over
if transaction_qty:
- qty = flt(transaction_qty) * qty
+ qty = flt(transaction_qty) * qty / pricing_rule.recurse_for
+ if pricing_rule.round_free_qty:
+ qty = round(qty)
free_item_data_args = {
"item_code": free_item,
diff --git a/erpnext/accounts/doctype/process_statement_of_accounts/process_statement_of_accounts.js b/erpnext/accounts/doctype/process_statement_of_accounts/process_statement_of_accounts.js
index 7dd77fb..7dd5ef3 100644
--- a/erpnext/accounts/doctype/process_statement_of_accounts/process_statement_of_accounts.js
+++ b/erpnext/accounts/doctype/process_statement_of_accounts/process_statement_of_accounts.js
@@ -9,6 +9,7 @@
refresh: function(frm){
if(!frm.doc.__islocal) {
frm.add_custom_button(__('Send Emails'), function(){
+ if (frm.is_dirty()) frappe.throw(__("Please save before proceeding."))
frappe.call({
method: "erpnext.accounts.doctype.process_statement_of_accounts.process_statement_of_accounts.send_emails",
args: {
@@ -25,7 +26,8 @@
});
});
frm.add_custom_button(__('Download'), function(){
- var url = frappe.urllib.get_full_url(
+ if (frm.is_dirty()) frappe.throw(__("Please save before proceeding."))
+ let url = frappe.urllib.get_full_url(
'/api/method/erpnext.accounts.doctype.process_statement_of_accounts.process_statement_of_accounts.download_statements?'
+ 'document_name='+encodeURIComponent(frm.doc.name))
$.ajax({
diff --git a/erpnext/accounts/doctype/process_statement_of_accounts/process_statement_of_accounts.json b/erpnext/accounts/doctype/process_statement_of_accounts/process_statement_of_accounts.json
index a26267b..16602d3 100644
--- a/erpnext/accounts/doctype/process_statement_of_accounts/process_statement_of_accounts.json
+++ b/erpnext/accounts/doctype/process_statement_of_accounts/process_statement_of_accounts.json
@@ -23,10 +23,12 @@
"fetch_customers",
"column_break_6",
"primary_mandatory",
+ "show_net_values_in_party_account",
"column_break_17",
"customers",
"preferences",
"orientation",
+ "include_break",
"include_ageing",
"ageing_based_on",
"section_break_14",
@@ -284,10 +286,22 @@
"fieldtype": "Link",
"label": "Terms and Conditions",
"options": "Terms and Conditions"
+ },
+ {
+ "default": "1",
+ "fieldname": "include_break",
+ "fieldtype": "Check",
+ "label": "Page Break After Each SoA"
+ },
+ {
+ "default": "0",
+ "fieldname": "show_net_values_in_party_account",
+ "fieldtype": "Check",
+ "label": "Show Net Values in Party Account"
}
],
"links": [],
- "modified": "2021-09-06 21:00:45.732505",
+ "modified": "2022-11-10 17:44:17.165991",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Process Statement Of Accounts",
@@ -321,5 +335,6 @@
],
"sort_field": "modified",
"sort_order": "DESC",
+ "states": [],
"track_changes": 1
}
\ No newline at end of file
diff --git a/erpnext/accounts/doctype/process_statement_of_accounts/process_statement_of_accounts.py b/erpnext/accounts/doctype/process_statement_of_accounts/process_statement_of_accounts.py
index 01f716d..a48c027 100644
--- a/erpnext/accounts/doctype/process_statement_of_accounts/process_statement_of_accounts.py
+++ b/erpnext/accounts/doctype/process_statement_of_accounts/process_statement_of_accounts.py
@@ -6,6 +6,7 @@
import frappe
from frappe import _
+from frappe.desk.reportview import get_match_cond
from frappe.model.document import Document
from frappe.utils import add_days, add_months, format_date, getdate, today
from frappe.utils.jinja import validate_template
@@ -94,6 +95,7 @@
"show_opening_entries": 0,
"include_default_book_entries": 0,
"tax_id": tax_id if tax_id else None,
+ "show_net_values_in_party_account": doc.show_net_values_in_party_account,
}
)
col, res = get_soa(filters)
@@ -128,7 +130,8 @@
if not bool(statement_dict):
return False
elif consolidated:
- result = "".join(list(statement_dict.values()))
+ delimiter = '<div style="page-break-before: always;"></div>' if doc.include_break else ""
+ result = delimiter.join(list(statement_dict.values()))
return get_pdf(result, {"orientation": doc.orientation})
else:
for customer, statement_html in statement_dict.items():
@@ -240,8 +243,6 @@
if int(primary_mandatory):
if primary_email == "":
continue
- elif (billing_email == "") and (primary_email == ""):
- continue
customer_list.append(
{"name": customer.name, "primary_email": primary_email, "billing_email": billing_email}
@@ -273,8 +274,12 @@
link.link_doctype='Customer'
and link.link_name=%s
and contact.is_billing_contact=1
+ {mcond}
ORDER BY
- contact.creation desc""",
+ contact.creation desc
+ """.format(
+ mcond=get_match_cond("Contact")
+ ),
customer_name,
)
@@ -313,6 +318,8 @@
attachments = [{"fname": customer + ".pdf", "fcontent": report_pdf}]
recipients, cc = get_recipients_and_cc(customer, doc)
+ if not recipients:
+ continue
context = get_context(customer, doc)
subject = frappe.render_template(doc.subject, context)
message = frappe.render_template(doc.body, context)
diff --git a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.js b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.js
index ec861a2..39a6235 100644
--- a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.js
+++ b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.js
@@ -31,7 +31,7 @@
super.onload();
// Ignore linked advances
- this.frm.ignore_doctypes_on_cancel_all = ['Journal Entry', 'Payment Entry'];
+ this.frm.ignore_doctypes_on_cancel_all = ['Journal Entry', 'Payment Entry', 'Purchase Invoice'];
if(!this.frm.doc.__islocal) {
// show credit_to in print format
@@ -569,6 +569,10 @@
erpnext.queries.setup_queries(frm, "Warehouse", function() {
return erpnext.queries.warehouse(frm.doc);
});
+
+ if (frm.is_new()) {
+ frm.clear_table("tax_withheld_vouchers");
+ }
},
is_subcontracted: function(frm) {
diff --git a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.json b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.json
index 3020e6d..370c0fc 100644
--- a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.json
+++ b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.json
@@ -12,39 +12,23 @@
"supplier",
"supplier_name",
"tax_id",
- "due_date",
- "tax_withholding_category",
- "column_break1",
"company",
+ "column_break_6",
"posting_date",
"posting_time",
"set_posting_time",
+ "due_date",
+ "column_break1",
"is_paid",
"is_return",
+ "return_against",
"apply_tds",
+ "tax_withholding_category",
"amended_from",
"accounting_dimensions_section",
"cost_center",
"dimension_col_break",
"project",
- "supplier_invoice_details",
- "bill_no",
- "column_break_15",
- "bill_date",
- "returns",
- "return_against",
- "section_addresses",
- "supplier_address",
- "address_display",
- "contact_person",
- "contact_display",
- "contact_mobile",
- "contact_email",
- "col_break_address",
- "shipping_address",
- "shipping_address_display",
- "billing_address",
- "billing_address_display",
"currency_and_price_list",
"currency",
"conversion_rate",
@@ -54,39 +38,35 @@
"plc_conversion_rate",
"ignore_pricing_rule",
"sec_warehouse",
- "set_warehouse",
- "rejected_warehouse",
- "col_break_warehouse",
- "set_from_warehouse",
- "supplier_warehouse",
- "is_subcontracted",
- "items_section",
- "update_stock",
"scan_barcode",
+ "col_break_warehouse",
+ "update_stock",
+ "set_warehouse",
+ "set_from_warehouse",
+ "is_subcontracted",
+ "rejected_warehouse",
+ "supplier_warehouse",
+ "items_section",
"items",
- "pricing_rule_details",
- "pricing_rules",
- "raw_materials_supplied",
- "supplied_items",
"section_break_26",
"total_qty",
+ "total_net_weight",
+ "column_break_50",
"base_total",
"base_net_total",
"column_break_28",
- "total_net_weight",
"total",
"net_total",
+ "tax_withholding_net_total",
+ "base_tax_withholding_net_total",
"taxes_section",
+ "taxes_and_charges",
+ "column_break_58",
"tax_category",
"column_break_49",
"shipping_rule",
"section_break_51",
- "taxes_and_charges",
"taxes",
- "tax_withheld_vouchers_section",
- "tax_withheld_vouchers",
- "sec_tax_breakup",
- "other_charges_calculation",
"totals",
"base_taxes_and_charges_added",
"base_taxes_and_charges_deducted",
@@ -95,12 +75,6 @@
"taxes_and_charges_added",
"taxes_and_charges_deducted",
"total_taxes_and_charges",
- "section_break_44",
- "apply_discount_on",
- "base_discount_amount",
- "column_break_46",
- "additional_discount_percentage",
- "discount_amount",
"section_break_49",
"base_grand_total",
"base_rounding_adjustment",
@@ -114,24 +88,57 @@
"total_advance",
"outstanding_amount",
"disable_rounded_total",
+ "section_break_44",
+ "apply_discount_on",
+ "base_discount_amount",
+ "column_break_46",
+ "additional_discount_percentage",
+ "discount_amount",
+ "tax_withheld_vouchers_section",
+ "tax_withheld_vouchers",
+ "sec_tax_breakup",
+ "other_charges_calculation",
+ "pricing_rule_details",
+ "pricing_rules",
+ "raw_materials_supplied",
+ "supplied_items",
+ "payments_tab",
"payments_section",
"mode_of_payment",
- "cash_bank_account",
+ "base_paid_amount",
"clearance_date",
"col_br_payments",
+ "cash_bank_account",
"paid_amount",
- "base_paid_amount",
+ "advances_section",
+ "allocate_advances_automatically",
+ "get_advances",
+ "advances",
+ "advance_tax",
"write_off",
"write_off_amount",
"base_write_off_amount",
"column_break_61",
"write_off_account",
"write_off_cost_center",
- "advances_section",
- "allocate_advances_automatically",
- "get_advances",
- "advances",
- "advance_tax",
+ "address_and_contact_tab",
+ "section_addresses",
+ "supplier_address",
+ "address_display",
+ "col_break_address",
+ "contact_person",
+ "contact_display",
+ "contact_mobile",
+ "contact_email",
+ "company_shipping_address_section",
+ "shipping_address",
+ "column_break_126",
+ "shipping_address_display",
+ "company_billing_address_section",
+ "billing_address",
+ "column_break_130",
+ "billing_address_display",
+ "terms_tab",
"payment_schedule_section",
"payment_terms_template",
"ignore_default_payment_terms_template",
@@ -139,23 +146,15 @@
"terms_section_break",
"tc_name",
"terms",
- "printing_settings",
- "letter_head",
- "select_print_heading",
- "column_break_112",
- "group_same_items",
- "language",
- "sb_14",
- "on_hold",
- "release_date",
- "cb_17",
- "hold_comment",
- "more_info",
+ "more_info_tab",
+ "status_section",
"status",
- "inter_company_invoice_reference",
- "represents_company",
- "column_break_147",
- "is_internal_supplier",
+ "column_break_177",
+ "per_received",
+ "supplier_invoice_details",
+ "bill_no",
+ "column_break_15",
+ "bill_date",
"accounting_details_section",
"credit_to",
"party_account_currency",
@@ -163,15 +162,32 @@
"against_expense_account",
"column_break_63",
"unrealized_profit_loss_account",
- "remarks",
"subscription_section",
- "from_date",
- "to_date",
- "column_break_114",
"auto_repeat",
"update_auto_repeat_reference",
- "per_received",
- "is_old_subcontracting_flow"
+ "column_break_114",
+ "from_date",
+ "to_date",
+ "printing_settings",
+ "letter_head",
+ "group_same_items",
+ "column_break_112",
+ "select_print_heading",
+ "language",
+ "sb_14",
+ "on_hold",
+ "release_date",
+ "cb_17",
+ "hold_comment",
+ "additional_info_section",
+ "is_internal_supplier",
+ "represents_company",
+ "column_break_147",
+ "inter_company_invoice_reference",
+ "is_old_subcontracting_flow",
+ "remarks",
+ "connections_tab",
+ "column_break_38"
],
"fields": [
{
@@ -354,7 +370,7 @@
"collapsible_depends_on": "bill_no",
"fieldname": "supplier_invoice_details",
"fieldtype": "Section Break",
- "label": "Supplier Invoice Details"
+ "label": "Supplier Invoice"
},
{
"fieldname": "bill_no",
@@ -379,12 +395,6 @@
},
{
"depends_on": "return_against",
- "fieldname": "returns",
- "fieldtype": "Section Break",
- "label": "Returns"
- },
- {
- "depends_on": "return_against",
"fieldname": "return_against",
"fieldtype": "Link",
"label": "Return Against Purchase Invoice",
@@ -394,10 +404,9 @@
"read_only": 1
},
{
- "collapsible": 1,
"fieldname": "section_addresses",
"fieldtype": "Section Break",
- "label": "Address and Contact"
+ "label": "Supplier Address"
},
{
"fieldname": "supplier_address",
@@ -518,11 +527,12 @@
},
{
"fieldname": "sec_warehouse",
- "fieldtype": "Section Break"
+ "fieldtype": "Section Break",
+ "hide_border": 1,
+ "label": "Items"
},
{
"depends_on": "update_stock",
- "description": "Sets 'Accepted Warehouse' in each row of the items table.",
"fieldname": "set_warehouse",
"fieldtype": "Link",
"label": "Set Accepted Warehouse",
@@ -531,7 +541,6 @@
},
{
"depends_on": "update_stock",
- "description": "Warehouse where you are maintaining stock of rejected items",
"fieldname": "rejected_warehouse",
"fieldtype": "Link",
"label": "Rejected Warehouse",
@@ -554,6 +563,7 @@
{
"fieldname": "items_section",
"fieldtype": "Section Break",
+ "hide_border": 1,
"oldfieldtype": "Section Break",
"options": "fa fa-shopping-cart"
},
@@ -581,6 +591,7 @@
"reqd": 1
},
{
+ "collapsible": 1,
"fieldname": "pricing_rule_details",
"fieldtype": "Section Break",
"label": "Pricing Rules"
@@ -593,6 +604,7 @@
"read_only": 1
},
{
+ "collapsible": 1,
"collapsible_depends_on": "supplied_items",
"fieldname": "raw_materials_supplied",
"fieldtype": "Section Break",
@@ -656,6 +668,7 @@
"read_only": 1
},
{
+ "depends_on": "total_net_weight",
"fieldname": "total_net_weight",
"fieldtype": "Float",
"label": "Total Net Weight",
@@ -665,6 +678,8 @@
{
"fieldname": "taxes_section",
"fieldtype": "Section Break",
+ "hide_border": 1,
+ "label": "Taxes and Charges",
"oldfieldtype": "Section Break",
"options": "fa fa-money"
},
@@ -688,7 +703,8 @@
},
{
"fieldname": "section_break_51",
- "fieldtype": "Section Break"
+ "fieldtype": "Section Break",
+ "hide_border": 1
},
{
"fieldname": "taxes_and_charges",
@@ -792,7 +808,6 @@
},
{
"collapsible": 1,
- "collapsible_depends_on": "discount_amount",
"fieldname": "section_break_44",
"fieldtype": "Section Break",
"label": "Additional Discount"
@@ -832,7 +847,8 @@
},
{
"fieldname": "section_break_49",
- "fieldtype": "Section Break"
+ "fieldtype": "Section Break",
+ "label": "Totals"
},
{
"fieldname": "base_grand_total",
@@ -1003,8 +1019,6 @@
},
{
"collapsible": 1,
- "collapsible_depends_on": "write_off_amount",
- "depends_on": "grand_total",
"fieldname": "write_off",
"fieldtype": "Section Break",
"label": "Write Off"
@@ -1081,7 +1095,6 @@
"print_hide": 1
},
{
- "collapsible": 1,
"collapsible_depends_on": "eval:(!doc.is_return)",
"fieldname": "payment_schedule_section",
"fieldtype": "Section Break",
@@ -1102,8 +1115,6 @@
"print_hide": 1
},
{
- "collapsible": 1,
- "collapsible_depends_on": "terms",
"fieldname": "terms_section_break",
"fieldtype": "Section Break",
"label": "Terms and Conditions",
@@ -1119,13 +1130,13 @@
{
"fieldname": "terms",
"fieldtype": "Text Editor",
- "label": "Terms and Conditions1"
+ "label": "Terms and Conditions"
},
{
"collapsible": 1,
"fieldname": "printing_settings",
"fieldtype": "Section Break",
- "label": "Printing Settings"
+ "label": "Print Settings"
},
{
"allow_on_submit": 1,
@@ -1167,15 +1178,6 @@
"read_only": 1
},
{
- "collapsible": 1,
- "fieldname": "more_info",
- "fieldtype": "Section Break",
- "label": "More Information",
- "oldfieldtype": "Section Break",
- "options": "fa fa-file-text",
- "print_hide": 1
- },
- {
"default": "0",
"fetch_from": "supplier.is_internal_supplier",
"fieldname": "is_internal_supplier",
@@ -1260,7 +1262,7 @@
"collapsible": 1,
"fieldname": "subscription_section",
"fieldtype": "Section Break",
- "label": "Subscription Section",
+ "label": "Subscription",
"print_hide": 1
},
{
@@ -1339,7 +1341,7 @@
},
{
"depends_on": "eval:doc.is_internal_supplier",
- "description": "Unrealized Profit / Loss account for intra-company transfers",
+ "description": "Unrealized Profit/Loss account for intra-company transfers",
"fieldname": "unrealized_profit_loss_account",
"fieldtype": "Link",
"label": "Unrealized Profit / Loss Account",
@@ -1356,7 +1358,6 @@
},
{
"depends_on": "eval:doc.update_stock && doc.is_internal_supplier",
- "description": "Sets 'From Warehouse' in each row of the items table.",
"fieldname": "set_from_warehouse",
"fieldtype": "Link",
"label": "Set From Warehouse",
@@ -1422,6 +1423,27 @@
"read_only": 1
},
{
+ "default": "0",
+ "fieldname": "tax_withholding_net_total",
+ "fieldtype": "Currency",
+ "hidden": 1,
+ "label": "Tax Withholding Net Total",
+ "no_copy": 1,
+ "options": "currency",
+ "read_only": 1
+ },
+ {
+ "fieldname": "base_tax_withholding_net_total",
+ "fieldtype": "Currency",
+ "hidden": 1,
+ "label": "Base Tax Withholding Net Total",
+ "no_copy": 1,
+ "options": "currency",
+ "print_hide": 1,
+ "read_only": 1
+ },
+ {
+ "collapsible_depends_on": "tax_withheld_vouchers",
"fieldname": "tax_withheld_vouchers_section",
"fieldtype": "Section Break",
"label": "Tax Withheld Vouchers"
@@ -1430,15 +1452,95 @@
"fieldname": "tax_withheld_vouchers",
"fieldtype": "Table",
"label": "Tax Withheld Vouchers",
+ "no_copy": 1,
"options": "Tax Withheld Vouchers",
"read_only": 1
+ },
+ {
+ "fieldname": "payments_tab",
+ "fieldtype": "Tab Break",
+ "label": "Payments"
+ },
+ {
+ "fieldname": "address_and_contact_tab",
+ "fieldtype": "Tab Break",
+ "label": "Address & Contact"
+ },
+ {
+ "fieldname": "terms_tab",
+ "fieldtype": "Tab Break",
+ "label": "Terms"
+ },
+ {
+ "fieldname": "more_info_tab",
+ "fieldtype": "Tab Break",
+ "label": "More Info"
+ },
+ {
+ "fieldname": "connections_tab",
+ "fieldtype": "Tab Break",
+ "label": "Connections",
+ "show_dashboard": 1
+ },
+ {
+ "fieldname": "column_break_6",
+ "fieldtype": "Column Break"
+ },
+ {
+ "fieldname": "column_break_38",
+ "fieldtype": "Column Break"
+ },
+ {
+ "fieldname": "column_break_50",
+ "fieldtype": "Column Break"
+ },
+ {
+ "fieldname": "column_break_58",
+ "fieldtype": "Column Break"
+ },
+ {
+ "fieldname": "company_shipping_address_section",
+ "fieldtype": "Section Break",
+ "label": "Company Shipping Address"
+ },
+ {
+ "fieldname": "column_break_126",
+ "fieldtype": "Column Break"
+ },
+ {
+ "fieldname": "company_billing_address_section",
+ "fieldtype": "Section Break",
+ "label": "Company Billing Address"
+ },
+ {
+ "fieldname": "column_break_130",
+ "fieldtype": "Column Break"
+ },
+ {
+ "collapsible": 1,
+ "fieldname": "status_section",
+ "fieldtype": "Section Break",
+ "label": "Status"
+ },
+ {
+ "fieldname": "column_break_177",
+ "fieldtype": "Column Break"
+ },
+ {
+ "collapsible": 1,
+ "fieldname": "additional_info_section",
+ "fieldtype": "Section Break",
+ "label": "Additional Info",
+ "oldfieldtype": "Section Break",
+ "options": "fa fa-file-text",
+ "print_hide": 1
}
],
"icon": "fa fa-file-text",
"idx": 204,
"is_submittable": 1,
"links": [],
- "modified": "2022-09-27 11:07:55.766844",
+ "modified": "2022-11-04 01:02:44.544878",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Purchase Invoice",
diff --git a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py
index 2b633cb..9a31aaf 100644
--- a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py
+++ b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py
@@ -71,6 +71,9 @@
supplier_tds = frappe.db.get_value("Supplier", self.supplier, "tax_withholding_category")
self.set_onload("supplier_tds", supplier_tds)
+ if self.is_new():
+ self.set("tax_withheld_vouchers", [])
+
def before_save(self):
if not self.on_hold:
self.release_date = ""
@@ -705,6 +708,10 @@
)
)
+ credit_amount = item.base_net_amount
+ if self.is_internal_supplier and item.valuation_rate:
+ credit_amount = flt(item.valuation_rate * item.stock_qty)
+
# Intentionally passed negative debit amount to avoid incorrect GL Entry validation
gl_entries.append(
self.get_gl_dict(
@@ -714,7 +721,7 @@
"cost_center": item.cost_center,
"project": item.project or self.project,
"remarks": self.get("remarks") or _("Accounting Entry for Stock"),
- "debit": -1 * flt(item.base_net_amount, item.precision("base_net_amount")),
+ "debit": -1 * flt(credit_amount, item.precision("base_net_amount")),
},
warehouse_account[item.from_warehouse]["account_currency"],
item=item,
@@ -1403,7 +1410,7 @@
self.repost_future_sle_and_gle()
self.update_project()
- frappe.db.set(self, "status", "Cancelled")
+ self.db_set("status", "Cancelled")
unlink_inter_company_doc(self.doctype, self.name, self.inter_company_invoice_reference)
self.ignore_linked_doctypes = (
@@ -1411,6 +1418,7 @@
"Stock Ledger Entry",
"Repost Item Valuation",
"Payment Ledger Entry",
+ "Tax Withheld Vouchers",
)
self.update_advance_tax_references(cancel=1)
@@ -1455,6 +1463,7 @@
def update_billing_status_in_pr(self, update_modified=True):
updated_pr = []
+ po_details = []
for d in self.get("items"):
if d.pr_detail:
billed_amt = frappe.db.sql(
@@ -1472,7 +1481,10 @@
)
updated_pr.append(d.purchase_receipt)
elif d.po_detail:
- updated_pr += update_billed_amount_based_on_po(d.po_detail, update_modified)
+ po_details.append(d.po_detail)
+
+ if po_details:
+ updated_pr += update_billed_amount_based_on_po(po_details, update_modified)
for pr in set(updated_pr):
from erpnext.stock.doctype.purchase_receipt.purchase_receipt import update_billing_percentage
diff --git a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice_list.js b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice_list.js
index 82d0030..e1c37c6 100644
--- a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice_list.js
+++ b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice_list.js
@@ -63,7 +63,7 @@
});
listview.page.add_action_item(__("Payment"), ()=>{
- erpnext.bulk_transaction_processing.create(listview, "Purchase Invoice", "Payment");
+ erpnext.bulk_transaction_processing.create(listview, "Purchase Invoice", "Payment Entry");
});
}
};
diff --git a/erpnext/accounts/doctype/purchase_invoice_item/purchase_invoice_item.json b/erpnext/accounts/doctype/purchase_invoice_item/purchase_invoice_item.json
index fca7e3a..5c1cb0d 100644
--- a/erpnext/accounts/doctype/purchase_invoice_item/purchase_invoice_item.json
+++ b/erpnext/accounts/doctype/purchase_invoice_item/purchase_invoice_item.json
@@ -40,6 +40,7 @@
"discount_amount",
"base_rate_with_margin",
"sec_break2",
+ "apply_tds",
"rate",
"amount",
"item_tax_template",
@@ -214,6 +215,7 @@
"reqd": 1
},
{
+ "default": "1",
"depends_on": "eval:doc.uom != doc.stock_uom",
"fieldname": "conversion_factor",
"fieldtype": "Float",
@@ -711,6 +713,7 @@
"label": "Valuation Rate",
"no_copy": 1,
"options": "Company:company:default_currency",
+ "precision": "6",
"print_hide": 1,
"read_only": 1
},
@@ -819,6 +822,7 @@
},
{
"collapsible": 1,
+ "collapsible_depends_on": "eval: doc.margin_type || doc.discount_amount",
"fieldname": "section_break_26",
"fieldtype": "Section Break",
"label": "Discount and Margin"
@@ -865,12 +869,18 @@
"label": "Product Bundle",
"options": "Product Bundle",
"read_only": 1
+ },
+ {
+ "default": "1",
+ "fieldname": "apply_tds",
+ "fieldtype": "Check",
+ "label": "Apply TDS"
}
],
"idx": 1,
"istable": 1,
"links": [],
- "modified": "2022-09-27 10:54:23.980713",
+ "modified": "2022-10-26 16:05:37.304788",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Purchase Invoice Item",
diff --git a/erpnext/accounts/doctype/repost_payment_ledger/__init__.py b/erpnext/accounts/doctype/repost_payment_ledger/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/erpnext/accounts/doctype/repost_payment_ledger/__init__.py
diff --git a/erpnext/accounts/doctype/repost_payment_ledger/repost_payment_ledger.js b/erpnext/accounts/doctype/repost_payment_ledger/repost_payment_ledger.js
new file mode 100644
index 0000000..6801408
--- /dev/null
+++ b/erpnext/accounts/doctype/repost_payment_ledger/repost_payment_ledger.js
@@ -0,0 +1,53 @@
+// Copyright (c) 2022, Frappe Technologies Pvt. Ltd. and contributors
+// For license information, please see license.txt
+
+frappe.ui.form.on('Repost Payment Ledger', {
+ setup: function(frm) {
+ frm.set_query("voucher_type", () => {
+ return {
+ filters: {
+ name: ['in', ['Purchase Invoice', 'Sales Invoice', 'Payment Entry', 'Journal Entry']]
+ }
+ };
+ });
+
+ frm.fields_dict['repost_vouchers'].grid.get_field('voucher_type').get_query = function(doc) {
+ return {
+ filters: {
+ name: ['in', ['Purchase Invoice', 'Sales Invoice', 'Payment Entry', 'Journal Entry']]
+ }
+ }
+ }
+
+ frm.fields_dict['repost_vouchers'].grid.get_field('voucher_no').get_query = function(doc) {
+ if (doc.company) {
+ return {
+ filters: {
+ company: doc.company,
+ docstatus: 1
+ }
+ }
+ }
+ }
+
+ },
+ refresh: function(frm) {
+
+ if (frm.doc.docstatus==1 && ['Queued', 'Failed'].find(x => x == frm.doc.repost_status)) {
+ frm.set_intro(__("Use 'Repost in background' button to trigger background job. Job can only be triggered when document is in Queued or Failed status."));
+ var btn_label = __("Repost in background")
+
+ frm.add_custom_button(btn_label, () => {
+ frappe.call({
+ method: 'erpnext.accounts.doctype.repost_payment_ledger.repost_payment_ledger.execute_repost_payment_ledger',
+ args: {
+ docname: frm.doc.name,
+ }
+ });
+ frappe.msgprint(__('Reposting in the background.'));
+ });
+ }
+
+ }
+});
+
diff --git a/erpnext/accounts/doctype/repost_payment_ledger/repost_payment_ledger.json b/erpnext/accounts/doctype/repost_payment_ledger/repost_payment_ledger.json
new file mode 100644
index 0000000..5175fd1
--- /dev/null
+++ b/erpnext/accounts/doctype/repost_payment_ledger/repost_payment_ledger.json
@@ -0,0 +1,159 @@
+{
+ "actions": [],
+ "allow_rename": 1,
+ "creation": "2022-10-19 21:59:33.553852",
+ "doctype": "DocType",
+ "editable_grid": 1,
+ "engine": "InnoDB",
+ "field_order": [
+ "filters_section",
+ "company",
+ "posting_date",
+ "column_break_4",
+ "voucher_type",
+ "add_manually",
+ "status_section",
+ "repost_status",
+ "repost_error_log",
+ "selected_vouchers_section",
+ "repost_vouchers",
+ "amended_from"
+ ],
+ "fields": [
+ {
+ "default": "Today",
+ "fieldname": "posting_date",
+ "fieldtype": "Date",
+ "label": "Posting Date",
+ "reqd": 1
+ },
+ {
+ "fieldname": "voucher_type",
+ "fieldtype": "Link",
+ "label": "Voucher Type",
+ "options": "DocType"
+ },
+ {
+ "fieldname": "amended_from",
+ "fieldtype": "Link",
+ "label": "Amended From",
+ "no_copy": 1,
+ "options": "Repost Payment Ledger",
+ "print_hide": 1,
+ "read_only": 1
+ },
+ {
+ "fieldname": "company",
+ "fieldtype": "Link",
+ "in_list_view": 1,
+ "label": "Company",
+ "options": "Company",
+ "reqd": 1
+ },
+ {
+ "fieldname": "selected_vouchers_section",
+ "fieldtype": "Section Break",
+ "label": "Vouchers"
+ },
+ {
+ "fieldname": "filters_section",
+ "fieldtype": "Section Break",
+ "label": "Filters"
+ },
+ {
+ "fieldname": "column_break_4",
+ "fieldtype": "Column Break"
+ },
+ {
+ "fieldname": "repost_vouchers",
+ "fieldtype": "Table",
+ "label": "Selected Vouchers",
+ "options": "Repost Payment Ledger Items"
+ },
+ {
+ "fieldname": "repost_status",
+ "fieldtype": "Select",
+ "label": "Repost Status",
+ "options": "\nQueued\nFailed\nCompleted",
+ "read_only": 1
+ },
+ {
+ "fieldname": "status_section",
+ "fieldtype": "Section Break",
+ "label": "Status"
+ },
+ {
+ "default": "0",
+ "description": "Ignore Voucher Type filter and Select Vouchers Manually",
+ "fieldname": "add_manually",
+ "fieldtype": "Check",
+ "label": "Add Manually"
+ },
+ {
+ "depends_on": "eval:doc.repost_error_log",
+ "fieldname": "repost_error_log",
+ "fieldtype": "Long Text",
+ "label": "Repost Error Log"
+ }
+ ],
+ "index_web_pages_for_search": 1,
+ "is_submittable": 1,
+ "links": [],
+ "modified": "2022-11-08 07:38:40.079038",
+ "modified_by": "Administrator",
+ "module": "Accounts",
+ "name": "Repost Payment Ledger",
+ "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,
+ "submit": 1,
+ "write": 1
+ },
+ {
+ "create": 1,
+ "email": 1,
+ "export": 1,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "Accounts User",
+ "share": 1,
+ "write": 1
+ },
+ {
+ "email": 1,
+ "export": 1,
+ "permlevel": 1,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "Accounts Manager",
+ "share": 1,
+ "write": 1
+ }
+ ],
+ "sort_field": "modified",
+ "sort_order": "DESC",
+ "states": []
+}
\ No newline at end of file
diff --git a/erpnext/accounts/doctype/repost_payment_ledger/repost_payment_ledger.py b/erpnext/accounts/doctype/repost_payment_ledger/repost_payment_ledger.py
new file mode 100644
index 0000000..9f6828f
--- /dev/null
+++ b/erpnext/accounts/doctype/repost_payment_ledger/repost_payment_ledger.py
@@ -0,0 +1,111 @@
+# Copyright (c) 2022, Frappe Technologies Pvt. Ltd. and contributors
+# For license information, please see license.txt
+
+import copy
+
+import frappe
+from frappe import _, qb
+from frappe.model.document import Document
+from frappe.query_builder.custom import ConstantColumn
+from frappe.utils.background_jobs import is_job_queued
+
+from erpnext.accounts.utils import _delete_pl_entries, create_payment_ledger_entry
+
+VOUCHER_TYPES = ["Sales Invoice", "Purchase Invoice", "Payment Entry", "Journal Entry"]
+
+
+def repost_ple_for_voucher(voucher_type, voucher_no, gle_map=None):
+ if voucher_type and voucher_no and gle_map:
+ _delete_pl_entries(voucher_type, voucher_no)
+ create_payment_ledger_entry(gle_map, cancel=0)
+
+
+@frappe.whitelist()
+def start_payment_ledger_repost(docname=None):
+ """
+ Repost Payment Ledger Entries for Vouchers through Background Job
+ """
+ if docname:
+ repost_doc = frappe.get_doc("Repost Payment Ledger", docname)
+ if repost_doc.docstatus == 1 and repost_doc.repost_status in ["Queued", "Failed"]:
+ try:
+ for entry in repost_doc.repost_vouchers:
+ doc = frappe.get_doc(entry.voucher_type, entry.voucher_no)
+
+ if doc.doctype in ["Payment Entry", "Journal Entry"]:
+ gle_map = doc.build_gl_map()
+ else:
+ gle_map = doc.get_gl_entries()
+
+ repost_ple_for_voucher(entry.voucher_type, entry.voucher_no, gle_map)
+
+ frappe.db.set_value(repost_doc.doctype, repost_doc.name, "repost_error_log", "")
+ frappe.db.set_value(repost_doc.doctype, repost_doc.name, "repost_status", "Completed")
+ except Exception as e:
+ frappe.db.rollback()
+
+ traceback = frappe.get_traceback()
+ if traceback:
+ message = "Traceback: <br>" + traceback
+ frappe.db.set_value(repost_doc.doctype, repost_doc.name, "repost_error_log", message)
+
+ frappe.db.set_value(repost_doc.doctype, repost_doc.name, "repost_status", "Failed")
+
+
+class RepostPaymentLedger(Document):
+ def __init__(self, *args, **kwargs):
+ super(RepostPaymentLedger, self).__init__(*args, **kwargs)
+ self.vouchers = []
+
+ def before_validate(self):
+ self.load_vouchers_based_on_filters()
+ self.set_status()
+
+ def load_vouchers_based_on_filters(self):
+ if not self.add_manually:
+ self.repost_vouchers.clear()
+ self.get_vouchers()
+ self.extend("repost_vouchers", copy.deepcopy(self.vouchers))
+
+ def get_vouchers(self):
+ self.vouchers.clear()
+
+ filter_on_voucher_types = [self.voucher_type] if self.voucher_type else VOUCHER_TYPES
+
+ for vtype in filter_on_voucher_types:
+ doc = qb.DocType(vtype)
+ doctype_name = ConstantColumn(vtype)
+ query = (
+ qb.from_(doc)
+ .select(doctype_name.as_("voucher_type"), doc.name.as_("voucher_no"))
+ .where(
+ (doc.docstatus == 1)
+ & (doc.company == self.company)
+ & (doc.posting_date.gte(self.posting_date))
+ )
+ )
+ entries = query.run(as_dict=True)
+ self.vouchers.extend(entries)
+
+ def set_status(self):
+ if self.docstatus == 0:
+ self.repost_status = "Queued"
+
+ def on_submit(self):
+ execute_repost_payment_ledger(self.name)
+ frappe.msgprint(_("Repost started in the background"))
+
+
+@frappe.whitelist()
+def execute_repost_payment_ledger(docname):
+ """Repost Payment Ledger Entries by background job."""
+
+ job_name = "payment_ledger_repost_" + docname
+
+ if not is_job_queued(job_name):
+ frappe.enqueue(
+ method="erpnext.accounts.doctype.repost_payment_ledger.repost_payment_ledger.start_payment_ledger_repost",
+ docname=docname,
+ is_async=True,
+ job_name=job_name,
+ )
diff --git a/erpnext/accounts/doctype/repost_payment_ledger/repost_payment_ledger_list.js b/erpnext/accounts/doctype/repost_payment_ledger/repost_payment_ledger_list.js
new file mode 100644
index 0000000..e045184
--- /dev/null
+++ b/erpnext/accounts/doctype/repost_payment_ledger/repost_payment_ledger_list.js
@@ -0,0 +1,12 @@
+frappe.listview_settings["Repost Payment Ledger"] = {
+ add_fields: ["repost_status"],
+ get_indicator: function(doc) {
+ var colors = {
+ 'Queued': 'orange',
+ 'Completed': 'green',
+ 'Failed': 'red',
+ };
+ let status = doc.repost_status;
+ return [__(status), colors[status], 'status,=,'+status];
+ },
+};
diff --git a/erpnext/accounts/doctype/repost_payment_ledger/test_repost_payment_ledger.py b/erpnext/accounts/doctype/repost_payment_ledger/test_repost_payment_ledger.py
new file mode 100644
index 0000000..781726a
--- /dev/null
+++ b/erpnext/accounts/doctype/repost_payment_ledger/test_repost_payment_ledger.py
@@ -0,0 +1,9 @@
+# Copyright (c) 2022, Frappe Technologies Pvt. Ltd. and Contributors
+# See license.txt
+
+# import frappe
+from frappe.tests.utils import FrappeTestCase
+
+
+class TestRepostPaymentLedger(FrappeTestCase):
+ pass
diff --git a/erpnext/accounts/doctype/repost_payment_ledger_items/__init__.py b/erpnext/accounts/doctype/repost_payment_ledger_items/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/erpnext/accounts/doctype/repost_payment_ledger_items/__init__.py
diff --git a/erpnext/accounts/doctype/repost_payment_ledger_items/repost_payment_ledger_items.json b/erpnext/accounts/doctype/repost_payment_ledger_items/repost_payment_ledger_items.json
new file mode 100644
index 0000000..93005ee
--- /dev/null
+++ b/erpnext/accounts/doctype/repost_payment_ledger_items/repost_payment_ledger_items.json
@@ -0,0 +1,35 @@
+{
+ "actions": [],
+ "creation": "2022-10-20 10:44:18.796489",
+ "doctype": "DocType",
+ "engine": "InnoDB",
+ "field_order": [
+ "voucher_type",
+ "voucher_no"
+ ],
+ "fields": [
+ {
+ "fieldname": "voucher_type",
+ "fieldtype": "Link",
+ "label": "Voucher Type",
+ "options": "DocType"
+ },
+ {
+ "fieldname": "voucher_no",
+ "fieldtype": "Dynamic Link",
+ "label": "Voucher No",
+ "options": "voucher_type"
+ }
+ ],
+ "istable": 1,
+ "links": [],
+ "modified": "2022-10-28 14:47:11.838109",
+ "modified_by": "Administrator",
+ "module": "Accounts",
+ "name": "Repost Payment Ledger Items",
+ "owner": "Administrator",
+ "permissions": [],
+ "sort_field": "modified",
+ "sort_order": "DESC",
+ "states": []
+}
\ No newline at end of file
diff --git a/erpnext/accounts/doctype/repost_payment_ledger_items/repost_payment_ledger_items.py b/erpnext/accounts/doctype/repost_payment_ledger_items/repost_payment_ledger_items.py
new file mode 100644
index 0000000..fb19e84
--- /dev/null
+++ b/erpnext/accounts/doctype/repost_payment_ledger_items/repost_payment_ledger_items.py
@@ -0,0 +1,9 @@
+# Copyright (c) 2022, Frappe Technologies Pvt. Ltd. and contributors
+# For license information, please see license.txt
+
+# import frappe
+from frappe.model.document import Document
+
+
+class RepostPaymentLedgerItems(Document):
+ pass
diff --git a/erpnext/accounts/doctype/sales_invoice/sales_invoice.js b/erpnext/accounts/doctype/sales_invoice/sales_invoice.js
index 73ec051..7abf3f3 100644
--- a/erpnext/accounts/doctype/sales_invoice/sales_invoice.js
+++ b/erpnext/accounts/doctype/sales_invoice/sales_invoice.js
@@ -64,6 +64,25 @@
this.frm.toggle_reqd("due_date", !this.frm.doc.is_return);
+ if (this.frm.doc.repost_required && this.frm.doc.docstatus===1) {
+ this.frm.set_intro(__("Accounting entries for this invoice needs to be reposted. Please click on 'Repost' button to update."));
+ this.frm.add_custom_button(__('Repost Accounting Entries'),
+ () => {
+ this.frm.call({
+ doc: this.frm.doc,
+ method: 'repost_accounting_entries',
+ freeze: true,
+ freeze_message: __('Reposting...'),
+ callback: (r) => {
+ if (!r.exc) {
+ frappe.msgprint(__('Accounting Entries are reposted'));
+ me.frm.refresh();
+ }
+ }
+ });
+ }).removeClass('btn-default').addClass('btn-warning');
+ }
+
if (this.frm.doc.is_return) {
this.frm.return_print_format = "Sales Invoice Return";
}
diff --git a/erpnext/accounts/doctype/sales_invoice/sales_invoice.json b/erpnext/accounts/doctype/sales_invoice/sales_invoice.json
index 2da5157..dc2f9a9 100644
--- a/erpnext/accounts/doctype/sales_invoice/sales_invoice.json
+++ b/erpnext/accounts/doctype/sales_invoice/sales_invoice.json
@@ -12,44 +12,29 @@
"customer",
"customer_name",
"tax_id",
- "pos_profile",
- "is_pos",
- "is_consolidated",
- "is_return",
- "is_debit_note",
- "update_billed_amount_in_sales_order",
- "column_break1",
"company",
"company_tax_id",
+ "column_break1",
"posting_date",
"posting_time",
"set_posting_time",
"due_date",
+ "column_break_14",
+ "is_pos",
+ "pos_profile",
+ "is_consolidated",
+ "is_return",
"return_against",
+ "update_billed_amount_in_sales_order",
+ "is_debit_note",
"amended_from",
"accounting_dimensions_section",
- "project",
- "dimension_col_break",
"cost_center",
- "customer_po_details",
- "po_no",
- "column_break_23",
- "po_date",
- "address_and_contact",
- "customer_address",
- "address_display",
- "contact_person",
- "contact_display",
- "contact_mobile",
- "contact_email",
- "territory",
- "col_break4",
- "shipping_address_name",
- "shipping_address",
- "company_address",
- "company_address_display",
- "dispatch_address_name",
- "dispatch_address",
+ "dimension_col_break",
+ "project",
+ "column_break_27",
+ "campaign",
+ "source",
"currency_and_price_list",
"currency",
"conversion_rate",
@@ -58,60 +43,35 @@
"price_list_currency",
"plc_conversion_rate",
"ignore_pricing_rule",
- "sec_warehouse",
- "set_warehouse",
- "column_break_55",
- "set_target_warehouse",
"items_section",
- "update_stock",
"scan_barcode",
+ "update_stock",
+ "column_break_39",
+ "set_warehouse",
+ "set_target_warehouse",
+ "section_break_42",
"items",
- "pricing_rule_details",
- "pricing_rules",
- "packing_list",
- "packed_items",
- "product_bundle_help",
- "time_sheet_list",
- "timesheets",
- "total_billing_amount",
- "total_billing_hours",
"section_break_30",
"total_qty",
+ "total_net_weight",
+ "column_break_32",
"base_total",
"base_net_total",
- "column_break_32",
- "total_net_weight",
+ "column_break_52",
"total",
"net_total",
"taxes_section",
"taxes_and_charges",
"column_break_38",
"shipping_rule",
+ "column_break_55",
"tax_category",
"section_break_40",
"taxes",
- "sec_tax_breakup",
- "other_charges_calculation",
"section_break_43",
"base_total_taxes_and_charges",
"column_break_47",
"total_taxes_and_charges",
- "loyalty_points_redemption",
- "loyalty_points",
- "loyalty_amount",
- "redeem_loyalty_points",
- "column_break_77",
- "loyalty_program",
- "loyalty_redemption_account",
- "loyalty_redemption_cost_center",
- "section_break_49",
- "apply_discount_on",
- "is_cash_or_non_trade_discount",
- "base_discount_amount",
- "additional_discount_account",
- "column_break_51",
- "additional_discount_percentage",
- "discount_amount",
"totals",
"base_grand_total",
"base_rounding_adjustment",
@@ -125,21 +85,28 @@
"total_advance",
"outstanding_amount",
"disable_rounded_total",
- "column_break4",
- "write_off_amount",
- "base_write_off_amount",
- "write_off_outstanding_amount_automatically",
- "column_break_74",
- "write_off_account",
- "write_off_cost_center",
- "advances_section",
- "allocate_advances_automatically",
- "get_advances",
- "advances",
- "payment_schedule_section",
- "ignore_default_payment_terms_template",
- "payment_terms_template",
- "payment_schedule",
+ "section_break_49",
+ "apply_discount_on",
+ "base_discount_amount",
+ "is_cash_or_non_trade_discount",
+ "additional_discount_account",
+ "column_break_51",
+ "additional_discount_percentage",
+ "discount_amount",
+ "sec_tax_breakup",
+ "other_charges_calculation",
+ "pricing_rule_details",
+ "pricing_rules",
+ "packing_list",
+ "packed_items",
+ "product_bundle_help",
+ "time_sheet_list",
+ "timesheets",
+ "section_break_104",
+ "total_billing_hours",
+ "column_break_106",
+ "total_billing_amount",
+ "payments_tab",
"payments_section",
"cash_bank_account",
"payments",
@@ -152,47 +119,96 @@
"column_break_90",
"change_amount",
"account_for_change_amount",
+ "advances_section",
+ "allocate_advances_automatically",
+ "get_advances",
+ "advances",
+ "write_off_section",
+ "write_off_amount",
+ "base_write_off_amount",
+ "write_off_outstanding_amount_automatically",
+ "column_break_74",
+ "write_off_account",
+ "write_off_cost_center",
+ "loyalty_points_redemption",
+ "redeem_loyalty_points",
+ "loyalty_points",
+ "loyalty_amount",
+ "column_break_77",
+ "loyalty_program",
+ "loyalty_redemption_account",
+ "loyalty_redemption_cost_center",
+ "contact_and_address_tab",
+ "address_and_contact",
+ "customer_address",
+ "address_display",
+ "col_break4",
+ "contact_person",
+ "contact_display",
+ "contact_mobile",
+ "contact_email",
+ "territory",
+ "shipping_address_section",
+ "shipping_address_name",
+ "shipping_address",
+ "shipping_addr_col_break",
+ "dispatch_address_name",
+ "dispatch_address",
+ "company_address_section",
+ "company_address",
+ "company_addr_col_break",
+ "company_address_display",
+ "terms_tab",
+ "payment_schedule_section",
+ "ignore_default_payment_terms_template",
+ "payment_terms_template",
+ "payment_schedule",
"terms_section_break",
"tc_name",
"terms",
- "edit_printing_settings",
- "letter_head",
- "group_same_items",
- "select_print_heading",
- "column_break_84",
- "language",
- "more_information",
- "status",
- "inter_company_invoice_reference",
- "represents_company",
- "customer_group",
- "campaign",
- "col_break23",
- "is_internal_customer",
- "is_discounted",
- "source",
+ "more_info_tab",
+ "customer_po_details",
+ "po_no",
+ "column_break_23",
+ "po_date",
"more_info",
"debit_to",
"party_account_currency",
"is_opening",
"column_break8",
"unrealized_profit_loss_account",
- "remarks",
+ "against_income_account",
"sales_team_section_break",
"sales_partner",
- "column_break10",
"amount_eligible_for_commission",
+ "column_break10",
"commission_rate",
"total_commission",
"section_break2",
"sales_team",
+ "edit_printing_settings",
+ "letter_head",
+ "group_same_items",
+ "column_break_84",
+ "select_print_heading",
+ "language",
"subscription_section",
"from_date",
- "to_date",
- "column_break_140",
"auto_repeat",
+ "column_break_140",
+ "to_date",
"update_auto_repeat_reference",
- "against_income_account"
+ "more_information",
+ "status",
+ "inter_company_invoice_reference",
+ "represents_company",
+ "customer_group",
+ "col_break23",
+ "is_internal_customer",
+ "is_discounted",
+ "remarks",
+ "repost_required",
+ "connections_tab"
],
"fields": [
{
@@ -453,12 +469,11 @@
"label": "Customer's Purchase Order Date"
},
{
- "collapsible": 1,
"fieldname": "address_and_contact",
"fieldtype": "Section Break",
"hide_days": 1,
"hide_seconds": 1,
- "label": "Address and Contact"
+ "label": "Billing Address"
},
{
"fieldname": "customer_address",
@@ -560,7 +575,6 @@
{
"fieldname": "company_address_display",
"fieldtype": "Small Text",
- "hidden": 1,
"hide_days": 1,
"hide_seconds": 1,
"label": "Company Address",
@@ -652,13 +666,6 @@
"print_hide": 1
},
{
- "fieldname": "sec_warehouse",
- "fieldtype": "Section Break",
- "hide_days": 1,
- "hide_seconds": 1,
- "label": "Warehouse"
- },
- {
"depends_on": "update_stock",
"fieldname": "set_warehouse",
"fieldtype": "Link",
@@ -671,6 +678,7 @@
{
"fieldname": "items_section",
"fieldtype": "Section Break",
+ "hide_border": 1,
"hide_days": 1,
"hide_seconds": 1,
"label": "Items",
@@ -702,7 +710,6 @@
"fieldtype": "Table",
"hide_days": 1,
"hide_seconds": 1,
- "label": "Items",
"oldfieldname": "entries",
"oldfieldtype": "Table",
"options": "Sales Invoice Item",
@@ -755,9 +762,10 @@
{
"collapsible": 1,
"collapsible_depends_on": "eval:doc.total_billing_amount > 0",
- "depends_on": "eval: !doc.is_return",
+ "depends_on": "eval:!doc.is_return",
"fieldname": "time_sheet_list",
"fieldtype": "Section Break",
+ "hide_border": 1,
"hide_days": 1,
"hide_seconds": 1,
"label": "Time Sheet List"
@@ -845,6 +853,7 @@
"read_only": 1
},
{
+ "depends_on": "total_net_weight",
"fieldname": "total_net_weight",
"fieldtype": "Float",
"hide_days": 1,
@@ -856,8 +865,10 @@
{
"fieldname": "taxes_section",
"fieldtype": "Section Break",
+ "hide_border": 1,
"hide_days": 1,
"hide_seconds": 1,
+ "label": "Taxes and Charges",
"oldfieldtype": "Section Break",
"options": "fa fa-money"
},
@@ -900,6 +911,7 @@
{
"fieldname": "section_break_40",
"fieldtype": "Section Break",
+ "hide_border": 1,
"hide_days": 1,
"hide_seconds": 1
},
@@ -908,7 +920,6 @@
"fieldtype": "Table",
"hide_days": 1,
"hide_seconds": 1,
- "label": "Sales Taxes and Charges",
"oldfieldname": "other_charges",
"oldfieldtype": "Table",
"options": "Sales Taxes and Charges"
@@ -1025,6 +1036,7 @@
"read_only": 1
},
{
+ "allow_on_submit": 1,
"depends_on": "redeem_loyalty_points",
"fieldname": "loyalty_redemption_account",
"fieldtype": "Link",
@@ -1046,7 +1058,6 @@
},
{
"collapsible": 1,
- "collapsible_depends_on": "discount_amount",
"fieldname": "section_break_49",
"fieldtype": "Section Break",
"hide_days": 1,
@@ -1102,6 +1113,7 @@
"fieldtype": "Section Break",
"hide_days": 1,
"hide_seconds": 1,
+ "label": "Totals",
"oldfieldtype": "Section Break",
"options": "fa fa-money",
"print_hide": 1
@@ -1283,8 +1295,6 @@
"print_hide": 1
},
{
- "collapsible": 1,
- "collapsible_depends_on": "eval:(!doc.is_pos && !doc.is_return)",
"fieldname": "payment_schedule_section",
"fieldtype": "Section Break",
"hide_days": 1,
@@ -1314,7 +1324,9 @@
"print_hide": 1
},
{
- "depends_on": "eval:doc.is_pos===1||(doc.advances && doc.advances.length>0)",
+ "collapsible": 1,
+ "collapsible_depends_on": "eval:!doc.is_pos",
+ "depends_on": "eval:doc.is_pos===1",
"fieldname": "payments_section",
"fieldtype": "Section Break",
"hide_days": 1,
@@ -1323,6 +1335,7 @@
"options": "fa fa-money"
},
{
+ "allow_on_submit": 1,
"depends_on": "is_pos",
"fieldname": "cash_bank_account",
"fieldtype": "Link",
@@ -1352,6 +1365,7 @@
"hide_seconds": 1
},
{
+ "depends_on": "eval: doc.is_pos || doc.redeem_loyalty_points",
"fieldname": "base_paid_amount",
"fieldtype": "Currency",
"hide_days": 1,
@@ -1383,10 +1397,13 @@
"read_only": 1
},
{
+ "collapsible": 1,
+ "depends_on": "is_pos",
"fieldname": "section_break_88",
"fieldtype": "Section Break",
"hide_days": 1,
- "hide_seconds": 1
+ "hide_seconds": 1,
+ "label": "Changes"
},
{
"depends_on": "is_pos",
@@ -1418,6 +1435,7 @@
"print_hide": 1
},
{
+ "allow_on_submit": 1,
"depends_on": "is_pos",
"fieldname": "account_for_change_amount",
"fieldtype": "Link",
@@ -1428,17 +1446,6 @@
"print_hide": 1
},
{
- "collapsible": 1,
- "collapsible_depends_on": "write_off_amount",
- "depends_on": "grand_total",
- "fieldname": "column_break4",
- "fieldtype": "Section Break",
- "hide_days": 1,
- "hide_seconds": 1,
- "label": "Write Off",
- "width": "50%"
- },
- {
"fieldname": "write_off_amount",
"fieldtype": "Currency",
"hide_days": 1,
@@ -1477,6 +1484,7 @@
"hide_seconds": 1
},
{
+ "allow_on_submit": 1,
"fieldname": "write_off_account",
"fieldtype": "Link",
"hide_days": 1,
@@ -1495,8 +1503,6 @@
"print_hide": 1
},
{
- "collapsible": 1,
- "collapsible_depends_on": "terms",
"fieldname": "terms_section_break",
"fieldtype": "Section Break",
"hide_days": 1,
@@ -1530,7 +1536,7 @@
"fieldtype": "Section Break",
"hide_days": 1,
"hide_seconds": 1,
- "label": "Printing Settings"
+ "label": "Print Settings"
},
{
"allow_on_submit": 1,
@@ -1591,7 +1597,7 @@
"fieldtype": "Section Break",
"hide_days": 1,
"hide_seconds": 1,
- "label": "More Information"
+ "label": "Additional Info"
},
{
"fieldname": "inter_company_invoice_reference",
@@ -1702,6 +1708,7 @@
"read_only": 1
},
{
+ "allow_on_submit": 1,
"default": "No",
"fieldname": "is_opening",
"fieldtype": "Select",
@@ -1814,7 +1821,7 @@
"fieldtype": "Section Break",
"hide_days": 1,
"hide_seconds": 1,
- "label": "Subscription Section"
+ "label": "Subscription"
},
{
"allow_on_submit": 1,
@@ -1916,6 +1923,7 @@
"read_only": 1
},
{
+ "allow_on_submit": 1,
"depends_on": "eval:doc.is_internal_customer",
"description": "Unrealized Profit / Loss account for intra-company transfers",
"fieldname": "unrealized_profit_loss_account",
@@ -1936,10 +1944,6 @@
"read_only": 1
},
{
- "fieldname": "column_break_55",
- "fieldtype": "Column Break"
- },
- {
"depends_on": "eval: doc.is_internal_customer && doc.update_stock",
"fieldname": "set_target_warehouse",
"fieldtype": "Link",
@@ -1962,6 +1966,7 @@
"label": "Disable Rounded Total"
},
{
+ "allow_on_submit": 1,
"fieldname": "additional_discount_account",
"fieldtype": "Link",
"label": "Discount Account",
@@ -2009,6 +2014,106 @@
"fieldname": "is_cash_or_non_trade_discount",
"fieldtype": "Check",
"label": "Is Cash or Non Trade Discount"
+ },
+ {
+ "fieldname": "contact_and_address_tab",
+ "fieldtype": "Tab Break",
+ "label": "Contact & Address"
+ },
+ {
+ "fieldname": "payments_tab",
+ "fieldtype": "Tab Break",
+ "label": "Payments"
+ },
+ {
+ "fieldname": "terms_tab",
+ "fieldtype": "Tab Break",
+ "label": "Terms"
+ },
+ {
+ "fieldname": "more_info_tab",
+ "fieldtype": "Tab Break",
+ "label": "More Info"
+ },
+ {
+ "fieldname": "connections_tab",
+ "fieldtype": "Tab Break",
+ "label": "Connections",
+ "show_dashboard": 1
+ },
+ {
+ "fieldname": "column_break_14",
+ "fieldtype": "Column Break"
+ },
+ {
+ "fieldname": "column_break_39",
+ "fieldtype": "Column Break"
+ },
+ {
+ "fieldname": "section_break_42",
+ "fieldtype": "Section Break",
+ "hide_border": 1,
+ "hide_days": 1,
+ "hide_seconds": 1
+ },
+ {
+ "fieldname": "column_break_55",
+ "fieldtype": "Column Break"
+ },
+ {
+ "fieldname": "shipping_address_section",
+ "fieldtype": "Section Break",
+ "label": "Shipping Address"
+ },
+ {
+ "fieldname": "company_address_section",
+ "fieldtype": "Section Break",
+ "label": "Company Address"
+ },
+ {
+ "fieldname": "shipping_addr_col_break",
+ "fieldtype": "Column Break"
+ },
+ {
+ "fieldname": "company_addr_col_break",
+ "fieldtype": "Column Break"
+ },
+ {
+ "fieldname": "column_break_27",
+ "fieldtype": "Column Break"
+ },
+ {
+ "fieldname": "column_break_52",
+ "fieldtype": "Column Break"
+ },
+ {
+ "depends_on": "eval:(!doc.is_return && doc.total_billing_amount > 0)",
+ "fieldname": "section_break_104",
+ "fieldtype": "Section Break"
+ },
+ {
+ "fieldname": "column_break_106",
+ "fieldtype": "Column Break"
+ },
+ {
+ "collapsible": 1,
+ "collapsible_depends_on": "write_off_amount",
+ "depends_on": "is_pos",
+ "fieldname": "write_off_section",
+ "fieldtype": "Section Break",
+ "hide_days": 1,
+ "hide_seconds": 1,
+ "label": "Write Off",
+ "width": "50%"
+ },
+ {
+ "default": "0",
+ "fieldname": "repost_required",
+ "fieldtype": "Check",
+ "hidden": 1,
+ "label": "Repost Required",
+ "no_copy": 1,
+ "read_only": 1
}
],
"icon": "fa fa-file-text",
@@ -2021,7 +2126,7 @@
"link_fieldname": "consolidated_invoice"
}
],
- "modified": "2022-09-16 17:44:22.227332",
+ "modified": "2022-11-15 09:33:47.870616",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Sales Invoice",
diff --git a/erpnext/accounts/doctype/sales_invoice/sales_invoice.py b/erpnext/accounts/doctype/sales_invoice/sales_invoice.py
index afd5a59..c276be2 100644
--- a/erpnext/accounts/doctype/sales_invoice/sales_invoice.py
+++ b/erpnext/accounts/doctype/sales_invoice/sales_invoice.py
@@ -11,6 +11,9 @@
import erpnext
from erpnext.accounts.deferred_revenue import validate_service_stop_date
+from erpnext.accounts.doctype.accounting_dimension.accounting_dimension import (
+ get_accounting_dimensions,
+)
from erpnext.accounts.doctype.loyalty_program.loyalty_program import (
get_loyalty_program_details_with_points,
validate_loyalty_points,
@@ -100,13 +103,11 @@
self.validate_debit_to_acc()
self.clear_unallocated_advances("Sales Invoice Advance", "advances")
self.add_remarks()
- self.validate_write_off_account()
- self.validate_account_for_change_amount()
self.validate_fixed_asset()
self.set_income_account_for_fixed_assets()
self.validate_item_cost_centers()
- self.validate_income_account()
self.check_conversion_rate()
+ self.validate_accounts()
validate_inter_company_party(
self.doctype, self.customer, self.company, self.inter_company_invoice_reference
@@ -170,6 +171,11 @@
self.reset_default_field_value("set_warehouse", "items", "warehouse")
+ def validate_accounts(self):
+ self.validate_write_off_account()
+ self.validate_account_for_change_amount()
+ self.validate_income_account()
+
def validate_fixed_asset(self):
for d in self.get("items"):
if d.is_fixed_asset and d.meta.get_field("asset") and d.asset:
@@ -367,7 +373,8 @@
if self.update_stock == 1:
self.repost_future_sle_and_gle()
- frappe.db.set(self, "status", "Cancelled")
+ self.db_set("status", "Cancelled")
+ self.db_set("repost_required", 0)
if (
frappe.db.get_single_value("Selling Settings", "sales_update_frequency") == "Each Transaction"
@@ -514,6 +521,93 @@
def on_update(self):
self.set_paid_amount()
+ def on_update_after_submit(self):
+ if hasattr(self, "repost_required"):
+ needs_repost = 0
+
+ # Check if any field affecting accounting entry is altered
+ doc_before_update = self.get_doc_before_save()
+ accounting_dimensions = get_accounting_dimensions() + ["cost_center", "project"]
+
+ # Check if opening entry check updated
+ if doc_before_update.get("is_opening") != self.is_opening:
+ needs_repost = 1
+
+ if not needs_repost:
+ # Parent Level Accounts excluding party account
+ for field in (
+ "additional_discount_account",
+ "cash_bank_account",
+ "account_for_change_amount",
+ "write_off_account",
+ "loyalty_redemption_account",
+ "unrealized_profit_loss_account",
+ ):
+ if doc_before_update.get(field) != self.get(field):
+ needs_repost = 1
+ break
+
+ # Check for parent accounting dimensions
+ for dimension in accounting_dimensions:
+ if doc_before_update.get(dimension) != self.get(dimension):
+ needs_repost = 1
+ break
+
+ # Check for child tables
+ if self.check_if_child_table_updated(
+ "items",
+ doc_before_update,
+ ("income_account", "expense_account", "discount_account"),
+ accounting_dimensions,
+ ):
+ needs_repost = 1
+
+ if self.check_if_child_table_updated(
+ "taxes", doc_before_update, ("account_head",), accounting_dimensions
+ ):
+ needs_repost = 1
+
+ self.validate_accounts()
+
+ # validate if deferred revenue is enabled for any item
+ # Don't allow to update the invoice if deferred revenue is enabled
+ if needs_repost:
+ for item in self.get("items"):
+ if item.enable_deferred_revenue:
+ frappe.throw(
+ _(
+ "Deferred Revenue is enabled for item {0}. You cannot update the invoice after submission."
+ ).format(item.item_code)
+ )
+
+ self.db_set("repost_required", needs_repost)
+
+ def check_if_child_table_updated(
+ self, child_table, doc_before_update, fields_to_check, accounting_dimensions
+ ):
+ # Check if any field affecting accounting entry is altered
+ for index, item in enumerate(self.get(child_table)):
+ for field in fields_to_check:
+ if doc_before_update.get(child_table)[index].get(field) != item.get(field):
+ return True
+
+ for dimension in accounting_dimensions:
+ if doc_before_update.get(child_table)[index].get(dimension) != item.get(dimension):
+ return True
+
+ return False
+
+ @frappe.whitelist()
+ def repost_accounting_entries(self):
+ if self.repost_required:
+ self.docstatus = 2
+ self.make_gl_entries_on_cancel()
+ self.docstatus = 1
+ self.make_gl_entries()
+ self.db_set("repost_required", 0)
+ else:
+ frappe.throw(_("No updates pending for reposting"))
+
def set_paid_amount(self):
paid_amount = 0.0
base_paid_amount = 0.0
@@ -1300,7 +1394,11 @@
def make_write_off_gl_entry(self, gl_entries):
# write off entries, applicable if only pos
- if self.write_off_account and flt(self.write_off_amount, self.precision("write_off_amount")):
+ if (
+ self.is_pos
+ and self.write_off_account
+ and flt(self.write_off_amount, self.precision("write_off_amount"))
+ ):
write_off_account_currency = get_account_currency(self.write_off_account)
default_cost_center = frappe.get_cached_value("Company", self.company, "cost_center")
@@ -2017,6 +2115,9 @@
update_address(
target_doc, "shipping_address", "shipping_address_display", source_doc.customer_address
)
+ update_address(
+ target_doc, "billing_address", "billing_address_display", source_doc.customer_address
+ )
if currency:
target_doc.currency = currency
@@ -2064,6 +2165,8 @@
if source.doctype == "Purchase Order Item" and target.doctype == "Sales Order Item":
target.purchase_order = source.parent
target.purchase_order_item = source.name
+ target.material_request = source.material_request
+ target.material_request_item = source.material_request_item
if (
source.get("purchase_order")
@@ -2303,7 +2406,7 @@
lp_details = get_loyalty_programs(customer)
if len(lp_details) == 1:
- frappe.db.set(customer, "loyalty_program", lp_details[0])
+ customer.db_set("loyalty_program", lp_details[0])
return lp_details
else:
return lp_details
diff --git a/erpnext/accounts/doctype/sales_invoice/sales_invoice_list.js b/erpnext/accounts/doctype/sales_invoice/sales_invoice_list.js
index 1130284..1605b15 100644
--- a/erpnext/accounts/doctype/sales_invoice/sales_invoice_list.js
+++ b/erpnext/accounts/doctype/sales_invoice/sales_invoice_list.js
@@ -29,7 +29,7 @@
});
listview.page.add_action_item(__("Payment"), ()=>{
- erpnext.bulk_transaction_processing.create(listview, "Sales Invoice", "Payment");
+ erpnext.bulk_transaction_processing.create(listview, "Sales Invoice", "Payment Entry");
});
}
};
diff --git a/erpnext/accounts/doctype/sales_invoice/test_sales_invoice.py b/erpnext/accounts/doctype/sales_invoice/test_sales_invoice.py
index ce44ae3..855380e 100644
--- a/erpnext/accounts/doctype/sales_invoice/test_sales_invoice.py
+++ b/erpnext/accounts/doctype/sales_invoice/test_sales_invoice.py
@@ -32,10 +32,20 @@
get_qty_after_transaction,
make_stock_entry,
)
-from erpnext.stock.utils import get_incoming_rate
+from erpnext.stock.doctype.stock_reconciliation.test_stock_reconciliation import (
+ create_stock_reconciliation,
+)
+from erpnext.stock.utils import get_incoming_rate, get_stock_balance
class TestSalesInvoice(unittest.TestCase):
+ def setUp(self):
+ from erpnext.stock.doctype.stock_ledger_entry.test_stock_ledger_entry import create_items
+
+ create_items(["_Test Internal Transfer Item"], uoms=[{"uom": "Box", "conversion_factor": 10}])
+ create_internal_parties()
+ setup_accounts()
+
def make(self):
w = frappe.copy_doc(test_records[0])
w.is_pos = 0
@@ -955,7 +965,8 @@
pos_return.insert()
pos_return.submit()
- self.assertEqual(pos_return.get("payments")[0].amount, -1000)
+ self.assertEqual(pos_return.get("payments")[0].amount, -500)
+ self.assertEqual(pos_return.get("payments")[1].amount, -500)
def test_pos_change_amount(self):
make_pos_profile(
@@ -1705,7 +1716,7 @@
si.save()
self.assertEqual(si.get("items")[0].rate, flt((price_list_rate * 25) / 100 + price_list_rate))
- def test_outstanding_amount_after_advance_jv_cancelation(self):
+ def test_outstanding_amount_after_advance_jv_cancellation(self):
from erpnext.accounts.doctype.journal_entry.test_journal_entry import (
test_records as jv_test_records,
)
@@ -1749,7 +1760,7 @@
flt(si.rounded_total + si.total_advance, si.precision("outstanding_amount")),
)
- def test_outstanding_amount_after_advance_payment_entry_cancelation(self):
+ def test_outstanding_amount_after_advance_payment_entry_cancellation(self):
pe = frappe.get_doc(
{
"doctype": "Payment Entry",
@@ -2367,29 +2378,6 @@
acc_settings.save()
def test_inter_company_transaction(self):
- from erpnext.selling.doctype.customer.test_customer import create_internal_customer
-
- create_internal_customer(
- customer_name="_Test Internal Customer",
- represents_company="_Test Company 1",
- allowed_to_interact_with="Wind Power LLC",
- )
-
- if not frappe.db.exists("Supplier", "_Test Internal Supplier"):
- supplier = frappe.get_doc(
- {
- "supplier_group": "_Test Supplier Group",
- "supplier_name": "_Test Internal Supplier",
- "doctype": "Supplier",
- "is_internal_supplier": 1,
- "represents_company": "Wind Power LLC",
- }
- )
-
- supplier.append("companies", {"company": "_Test Company 1"})
-
- supplier.insert()
-
si = create_sales_invoice(
company="Wind Power LLC",
customer="_Test Internal Customer",
@@ -2440,38 +2428,6 @@
"Expenses Included In Valuation - _TC1",
)
- if not frappe.db.exists("Customer", "_Test Internal Customer"):
- customer = frappe.get_doc(
- {
- "customer_group": "_Test Customer Group",
- "customer_name": "_Test Internal Customer",
- "customer_type": "Individual",
- "doctype": "Customer",
- "territory": "_Test Territory",
- "is_internal_customer": 1,
- "represents_company": "_Test Company 1",
- }
- )
-
- customer.append("companies", {"company": "Wind Power LLC"})
-
- customer.insert()
-
- if not frappe.db.exists("Supplier", "_Test Internal Supplier"):
- supplier = frappe.get_doc(
- {
- "supplier_group": "_Test Supplier Group",
- "supplier_name": "_Test Internal Supplier",
- "doctype": "Supplier",
- "is_internal_supplier": 1,
- "represents_company": "Wind Power LLC",
- }
- )
-
- supplier.append("companies", {"company": "_Test Company 1"})
-
- supplier.insert()
-
# begin test
si = create_sales_invoice(
company="Wind Power LLC",
@@ -2541,34 +2497,9 @@
se.cancel()
def test_internal_transfer_gl_entry(self):
- ## Create internal transfer account
- from erpnext.selling.doctype.customer.test_customer import create_internal_customer
-
- account = create_account(
- account_name="Unrealized Profit",
- parent_account="Current Liabilities - TCP1",
- company="_Test Company with perpetual inventory",
- )
-
- frappe.db.set_value(
- "Company", "_Test Company with perpetual inventory", "unrealized_profit_loss_account", account
- )
-
- customer = create_internal_customer(
- "_Test Internal Customer 2",
- "_Test Company with perpetual inventory",
- "_Test Company with perpetual inventory",
- )
-
- create_internal_supplier(
- "_Test Internal Supplier 2",
- "_Test Company with perpetual inventory",
- "_Test Company with perpetual inventory",
- )
-
si = create_sales_invoice(
company="_Test Company with perpetual inventory",
- customer=customer,
+ customer="_Test Internal Customer 2",
debit_to="Debtors - TCP1",
warehouse="Stores - TCP1",
income_account="Sales - TCP1",
@@ -2582,7 +2513,7 @@
si.update_stock = 1
si.items[0].target_warehouse = "Work In Progress - TCP1"
- # Add stock to stores for succesful stock transfer
+ # Add stock to stores for successful stock transfer
make_stock_entry(
target="Stores - TCP1", company="_Test Company with perpetual inventory", qty=1, basic_rate=100
)
@@ -2638,6 +2569,77 @@
check_gl_entries(self, target_doc.name, pi_gl_entries, add_days(nowdate(), -1))
+ def test_internal_transfer_gl_precision_issues(self):
+ # Make a stock queue of an item with two valuations
+
+ # Remove all existing stock for this
+ if get_stock_balance("_Test Internal Transfer Item", "Stores - TCP1", "2022-04-10"):
+ create_stock_reconciliation(
+ item_code="_Test Internal Transfer Item",
+ warehouse="Stores - TCP1",
+ qty=0,
+ rate=0,
+ company="_Test Company with perpetual inventory",
+ expense_account="Stock Adjustment - TCP1"
+ if frappe.get_all("Stock Ledger Entry")
+ else "Temporary Opening - TCP1",
+ posting_date="2020-04-10",
+ posting_time="14:00",
+ )
+
+ make_stock_entry(
+ item_code="_Test Internal Transfer Item",
+ target="Stores - TCP1",
+ qty=9000000,
+ basic_rate=52.0,
+ posting_date="2020-04-10",
+ posting_time="14:00",
+ )
+ make_stock_entry(
+ item_code="_Test Internal Transfer Item",
+ target="Stores - TCP1",
+ qty=60000000,
+ basic_rate=52.349777,
+ posting_date="2020-04-10",
+ posting_time="14:00",
+ )
+
+ # Make an internal transfer Sales Invoice Stock in non stock uom to check
+ # for rounding errors while converting to stock uom
+ si = create_sales_invoice(
+ company="_Test Company with perpetual inventory",
+ customer="_Test Internal Customer 2",
+ item_code="_Test Internal Transfer Item",
+ qty=5000000,
+ uom="Box",
+ debit_to="Debtors - TCP1",
+ warehouse="Stores - TCP1",
+ income_account="Sales - TCP1",
+ expense_account="Cost of Goods Sold - TCP1",
+ cost_center="Main - TCP1",
+ currency="INR",
+ do_not_save=1,
+ )
+
+ # Check GL Entries with precision
+ si.update_stock = 1
+ si.items[0].target_warehouse = "Work In Progress - TCP1"
+ si.items[0].conversion_factor = 10
+ si.save()
+ si.submit()
+
+ # Check if adjustment entry is created
+ self.assertTrue(
+ frappe.db.exists(
+ "GL Entry",
+ {
+ "voucher_type": "Sales Invoice",
+ "voucher_no": si.name,
+ "remarks": "Rounding gain/loss Entry for Stock Transfer",
+ },
+ )
+ )
+
def test_item_tax_net_range(self):
item = create_item("T Shirt")
@@ -2727,6 +2729,31 @@
check_gl_entries(self, si.name, expected_gle, add_days(nowdate(), -1))
+ # Update Invoice post submit and then check GL Entries again
+
+ si.load_from_db()
+ si.items[0].income_account = "Service - _TC"
+ si.additional_discount_account = "_Test Account Sales - _TC"
+ si.taxes[0].account_head = "TDS Payable - _TC"
+ si.save()
+
+ si.load_from_db()
+ self.assertTrue(si.repost_required)
+
+ si.repost_accounting_entries()
+
+ expected_gle = [
+ ["_Test Account Sales - _TC", 22.0, 0.0, nowdate()],
+ ["Debtors - _TC", 88, 0.0, nowdate()],
+ ["Service - _TC", 0.0, 100.0, nowdate()],
+ ["TDS Payable - _TC", 0.0, 10.0, nowdate()],
+ ]
+
+ check_gl_entries(self, si.name, expected_gle, add_days(nowdate(), -1))
+
+ si.load_from_db()
+ self.assertFalse(si.repost_required)
+
def test_asset_depreciation_on_sale_with_pro_rata(self):
"""
Tests if an Asset set to depreciate yearly on June 30, that gets sold on Sept 30, creates an additional depreciation entry on its date of sale.
@@ -3077,7 +3104,7 @@
[deferred_account, 2022.47, 0.0, "2019-03-15"],
]
- gl_entries = gl_entries = frappe.db.sql(
+ gl_entries = frappe.db.sql(
"""select account, debit, credit, posting_date
from `tabGL Entry`
where voucher_type='Journal Entry' and voucher_detail_no=%s and posting_date <= %s
@@ -3227,6 +3254,22 @@
self.assertTrue(return_si.docstatus == 1)
+ def test_sales_invoice_with_payable_tax_account(self):
+ si = create_sales_invoice(do_not_submit=True)
+ si.append(
+ "taxes",
+ {
+ "charge_type": "Actual",
+ "account_head": "Creditors - _TC",
+ "description": "Test",
+ "cost_center": "Main - _TC",
+ "tax_amount": 10,
+ "total": 10,
+ "dont_recompute_tax": 0,
+ },
+ )
+ self.assertRaises(frappe.ValidationError, si.submit)
+
def get_sales_invoice_for_e_invoice():
si = make_sales_invoice_for_ewaybill()
@@ -3268,6 +3311,7 @@
"""select account, debit, credit, posting_date
from `tabGL Entry`
where voucher_type='Sales Invoice' and voucher_no=%s and posting_date > %s
+ and is_cancelled = 0
order by posting_date asc, account asc""",
(voucher_no, posting_date),
as_dict=1,
@@ -3306,6 +3350,7 @@
"item_name": args.item_name or "_Test Item",
"description": args.description or "_Test Item",
"warehouse": args.warehouse or "_Test Warehouse - _TC",
+ "target_warehouse": args.target_warehouse,
"qty": args.qty or 1,
"uom": args.uom or "Nos",
"stock_uom": args.uom or "Nos",
@@ -3318,7 +3363,7 @@
"asset": args.asset or None,
"cost_center": args.cost_center or "_Test Cost Center - _TC",
"serial_no": args.serial_no,
- "conversion_factor": 1,
+ "conversion_factor": args.get("conversion_factor", 1),
"incoming_rate": args.incoming_rate or 0,
"batch_no": args.batch_no or None,
},
@@ -3431,6 +3476,34 @@
]
+def create_internal_parties():
+ from erpnext.selling.doctype.customer.test_customer import create_internal_customer
+
+ create_internal_customer(
+ customer_name="_Test Internal Customer",
+ represents_company="_Test Company 1",
+ allowed_to_interact_with="Wind Power LLC",
+ )
+
+ create_internal_customer(
+ customer_name="_Test Internal Customer 2",
+ represents_company="_Test Company with perpetual inventory",
+ allowed_to_interact_with="_Test Company with perpetual inventory",
+ )
+
+ create_internal_supplier(
+ supplier_name="_Test Internal Supplier",
+ represents_company="Wind Power LLC",
+ allowed_to_interact_with="_Test Company 1",
+ )
+
+ create_internal_supplier(
+ supplier_name="_Test Internal Supplier 2",
+ represents_company="_Test Company with perpetual inventory",
+ allowed_to_interact_with="_Test Company with perpetual inventory",
+ )
+
+
def create_internal_supplier(supplier_name, represents_company, allowed_to_interact_with):
if not frappe.db.exists("Supplier", supplier_name):
supplier = frappe.get_doc(
@@ -3453,6 +3526,19 @@
return supplier_name
+def setup_accounts():
+ ## Create internal transfer account
+ account = create_account(
+ account_name="Unrealized Profit",
+ parent_account="Current Liabilities - TCP1",
+ company="_Test Company with perpetual inventory",
+ )
+
+ frappe.db.set_value(
+ "Company", "_Test Company with perpetual inventory", "unrealized_profit_loss_account", account
+ )
+
+
def add_taxes(doc):
doc.append(
"taxes",
diff --git a/erpnext/accounts/doctype/sales_invoice_item/sales_invoice_item.json b/erpnext/accounts/doctype/sales_invoice_item/sales_invoice_item.json
index 4f97b63..62c3ced 100644
--- a/erpnext/accounts/doctype/sales_invoice_item/sales_invoice_item.json
+++ b/erpnext/accounts/doctype/sales_invoice_item/sales_invoice_item.json
@@ -8,6 +8,7 @@
"engine": "InnoDB",
"field_order": [
"barcode",
+ "has_item_scanned",
"item_code",
"col_break1",
"item_name",
@@ -247,6 +248,7 @@
},
{
"collapsible": 1,
+ "collapsible_depends_on": "eval: doc.margin_type || doc.discount_amount",
"fieldname": "discount_and_margin",
"fieldtype": "Section Break",
"label": "Discount and Margin"
@@ -436,6 +438,7 @@
"label": "Accounting Details"
},
{
+ "allow_on_submit": 1,
"fieldname": "income_account",
"fieldtype": "Link",
"label": "Income Account",
@@ -448,6 +451,7 @@
"width": "120px"
},
{
+ "allow_on_submit": 1,
"fieldname": "expense_account",
"fieldtype": "Link",
"label": "Expense Account",
@@ -467,6 +471,7 @@
"print_hide": 1
},
{
+ "allow_on_submit": 1,
"default": ":Company",
"fieldname": "cost_center",
"fieldtype": "Link",
@@ -798,6 +803,7 @@
"options": "Finance Book"
},
{
+ "allow_on_submit": 1,
"fieldname": "project",
"fieldtype": "Link",
"label": "Project",
@@ -832,6 +838,7 @@
"read_only": 1
},
{
+ "allow_on_submit": 1,
"fieldname": "discount_account",
"fieldtype": "Link",
"label": "Discount Account",
@@ -870,12 +877,20 @@
"label": "Purchase Order Item",
"print_hide": 1,
"read_only": 1
+ },
+ {
+ "default": "0",
+ "depends_on": "barcode",
+ "fieldname": "has_item_scanned",
+ "fieldtype": "Check",
+ "label": "Has Item Scanned",
+ "read_only": 1
}
],
"idx": 1,
"istable": 1,
"links": [],
- "modified": "2022-09-06 14:17:43.394309",
+ "modified": "2022-11-02 12:53:12.693217",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Sales Invoice Item",
diff --git a/erpnext/accounts/doctype/sales_taxes_and_charges/sales_taxes_and_charges.json b/erpnext/accounts/doctype/sales_taxes_and_charges/sales_taxes_and_charges.json
index 3a871bf..e236577 100644
--- a/erpnext/accounts/doctype/sales_taxes_and_charges/sales_taxes_and_charges.json
+++ b/erpnext/accounts/doctype/sales_taxes_and_charges/sales_taxes_and_charges.json
@@ -51,6 +51,7 @@
"oldfieldtype": "Data"
},
{
+ "allow_on_submit": 1,
"columns": 2,
"fieldname": "account_head",
"fieldtype": "Link",
@@ -63,6 +64,7 @@
"search_index": 1
},
{
+ "allow_on_submit": 1,
"default": ":Company",
"fieldname": "cost_center",
"fieldtype": "Link",
@@ -216,12 +218,13 @@
"index_web_pages_for_search": 1,
"istable": 1,
"links": [],
- "modified": "2021-08-05 20:04:01.726867",
+ "modified": "2022-10-17 13:08:17.776528",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Sales Taxes and Charges",
"owner": "Administrator",
"permissions": [],
"sort_field": "modified",
- "sort_order": "ASC"
+ "sort_order": "ASC",
+ "states": []
}
\ No newline at end of file
diff --git a/erpnext/accounts/doctype/subscription_plan/subscription_plan.py b/erpnext/accounts/doctype/subscription_plan/subscription_plan.py
index a95e0a9..f3acdc5 100644
--- a/erpnext/accounts/doctype/subscription_plan/subscription_plan.py
+++ b/erpnext/accounts/doctype/subscription_plan/subscription_plan.py
@@ -3,6 +3,7 @@
import frappe
+from dateutil import relativedelta
from frappe import _
from frappe.model.document import Document
from frappe.utils import date_diff, flt, get_first_day, get_last_day, getdate
@@ -49,7 +50,7 @@
start_date = getdate(start_date)
end_date = getdate(end_date)
- no_of_months = (end_date.year - start_date.year) * 12 + (end_date.month - start_date.month) + 1
+ no_of_months = relativedelta.relativedelta(end_date, start_date).months + 1
cost = plan.cost * no_of_months
# Adjust cost if start or end date is not month start or end
diff --git a/erpnext/accounts/doctype/tax_withholding_category/tax_withholding_category.py b/erpnext/accounts/doctype/tax_withholding_category/tax_withholding_category.py
index 84c2c9a..30ed91b 100644
--- a/erpnext/accounts/doctype/tax_withholding_category/tax_withholding_category.py
+++ b/erpnext/accounts/doctype/tax_withholding_category/tax_withholding_category.py
@@ -61,6 +61,9 @@
def get_party_tax_withholding_details(inv, tax_withholding_category=None):
+ if inv.doctype == "Payment Entry":
+ inv.tax_withholding_net_total = inv.net_total
+
pan_no = ""
parties = []
party_type, party = get_party_details(inv)
@@ -242,13 +245,16 @@
if party_type == "Supplier":
ldc = get_lower_deduction_certificate(tax_details, pan_no)
if tax_deducted:
- net_total = inv.net_total
+ net_total = inv.tax_withholding_net_total
if ldc:
tax_amount = get_tds_amount_from_ldc(
ldc, parties, pan_no, tax_details, posting_date, net_total
)
else:
tax_amount = net_total * tax_details.rate / 100 if net_total > 0 else 0
+
+ # once tds is deducted, not need to add vouchers in the invoice
+ voucher_wise_amount = {}
else:
tax_amount = get_tds_amount(ldc, parties, inv, tax_details, tax_deducted, vouchers)
@@ -269,6 +275,11 @@
def get_invoice_vouchers(parties, tax_details, company, party_type="Supplier"):
doctype = "Purchase Invoice" if party_type == "Supplier" else "Sales Invoice"
+ field = (
+ "base_tax_withholding_net_total as base_net_total"
+ if party_type == "Supplier"
+ else "base_net_total"
+ )
voucher_wise_amount = {}
vouchers = []
@@ -285,7 +296,7 @@
{"apply_tds": 1, "tax_withholding_category": tax_details.get("tax_withholding_category")}
)
- invoices_details = frappe.get_all(doctype, filters=filters, fields=["name", "base_net_total"])
+ invoices_details = frappe.get_all(doctype, filters=filters, fields=["name", field])
for d in invoices_details:
vouchers.append(d.name)
@@ -389,7 +400,7 @@
tds_amount = 0
invoice_filters = {"name": ("in", vouchers), "docstatus": 1, "apply_tds": 1}
- field = "sum(net_total)"
+ field = "sum(tax_withholding_net_total)"
if cint(tax_details.consider_party_ledger_amount):
invoice_filters.pop("apply_tds", None)
@@ -412,12 +423,12 @@
)
supp_credit_amt += supp_jv_credit_amt
- supp_credit_amt += inv.net_total
+ supp_credit_amt += inv.tax_withholding_net_total
threshold = tax_details.get("threshold", 0)
cumulative_threshold = tax_details.get("cumulative_threshold", 0)
- if (threshold and inv.net_total >= threshold) or (
+ if (threshold and inv.tax_withholding_net_total >= threshold) or (
cumulative_threshold and supp_credit_amt >= cumulative_threshold
):
if (cumulative_threshold and supp_credit_amt >= cumulative_threshold) and cint(
@@ -425,8 +436,11 @@
):
# Get net total again as TDS is calculated on net total
# Grand is used to just check for threshold breach
- net_total = frappe.db.get_value("Purchase Invoice", invoice_filters, "sum(net_total)") or 0.0
- net_total += inv.net_total
+ net_total = (
+ frappe.db.get_value("Purchase Invoice", invoice_filters, "sum(tax_withholding_net_total)")
+ or 0.0
+ )
+ net_total += inv.tax_withholding_net_total
supp_credit_amt = net_total - cumulative_threshold
if ldc and is_valid_certificate(
@@ -434,7 +448,7 @@
ldc.valid_upto,
inv.get("posting_date") or inv.get("transaction_date"),
tax_deducted,
- inv.net_total,
+ inv.tax_withholding_net_total,
ldc.certificate_limit,
):
tds_amount = get_ltds_amount(supp_credit_amt, 0, ldc.certificate_limit, ldc.rate, tax_details)
@@ -517,7 +531,7 @@
limit_consumed = frappe.db.get_value(
"Purchase Invoice",
{"supplier": ("in", parties), "apply_tds": 1, "docstatus": 1},
- "sum(net_total)",
+ "sum(tax_withholding_net_total)",
)
if is_valid_certificate(
diff --git a/erpnext/accounts/doctype/tax_withholding_category/test_tax_withholding_category.py b/erpnext/accounts/doctype/tax_withholding_category/test_tax_withholding_category.py
index e80fe11..40c732b 100644
--- a/erpnext/accounts/doctype/tax_withholding_category/test_tax_withholding_category.py
+++ b/erpnext/accounts/doctype/tax_withholding_category/test_tax_withholding_category.py
@@ -186,6 +186,46 @@
for d in reversed(invoices):
d.cancel()
+ def test_tds_calculation_on_net_total_partial_tds(self):
+ frappe.db.set_value(
+ "Supplier", "Test TDS Supplier4", "tax_withholding_category", "Cumulative Threshold TDS"
+ )
+ invoices = []
+
+ pi = create_purchase_invoice(supplier="Test TDS Supplier4", rate=20000, do_not_save=True)
+ pi.extend(
+ "items",
+ [
+ {
+ "doctype": "Purchase Invoice Item",
+ "item_code": frappe.db.get_value("Item", {"item_name": "TDS Item"}, "name"),
+ "qty": 1,
+ "rate": 20000,
+ "cost_center": "Main - _TC",
+ "expense_account": "Stock Received But Not Billed - _TC",
+ "apply_tds": 0,
+ },
+ {
+ "doctype": "Purchase Invoice Item",
+ "item_code": frappe.db.get_value("Item", {"item_name": "TDS Item"}, "name"),
+ "qty": 1,
+ "rate": 35000,
+ "cost_center": "Main - _TC",
+ "expense_account": "Stock Received But Not Billed - _TC",
+ "apply_tds": 1,
+ },
+ ],
+ )
+ pi.save()
+ pi.submit()
+ invoices.append(pi)
+
+ self.assertEqual(pi.taxes[0].tax_amount, 5500)
+
+ # cancel invoices to avoid clashing
+ for d in reversed(invoices):
+ d.cancel()
+
def test_multi_category_single_supplier(self):
frappe.db.set_value(
"Supplier", "Test TDS Supplier5", "tax_withholding_category", "Test Service Category"
diff --git a/erpnext/accounts/general_ledger.py b/erpnext/accounts/general_ledger.py
index f4a50a5..6d164ee 100644
--- a/erpnext/accounts/general_ledger.py
+++ b/erpnext/accounts/general_ledger.py
@@ -128,6 +128,12 @@
new_gl_map = []
for d in gl_map:
cost_center = d.get("cost_center")
+
+ # Validate budget against main cost center
+ validate_expense_against_budget(
+ d, expense_amount=flt(d.debit, precision) - flt(d.credit, precision)
+ )
+
if cost_center and cost_center_allocation.get(cost_center):
for sub_cost_center, percentage in cost_center_allocation.get(cost_center, {}).items():
gle = copy.deepcopy(d)
diff --git a/erpnext/accounts/report/accounts_payable/accounts_payable.js b/erpnext/accounts/report/accounts_payable/accounts_payable.js
index 7cf14e6..e1a30a4 100644
--- a/erpnext/accounts/report/accounts_payable/accounts_payable.js
+++ b/erpnext/accounts/report/accounts_payable/accounts_payable.js
@@ -51,6 +51,8 @@
} else {
frappe.query_report.set_filter_value('tax_id', "");
}
+
+ frappe.query_report.refresh();
}
},
{
diff --git a/erpnext/accounts/report/accounts_receivable/accounts_receivable.py b/erpnext/accounts/report/accounts_receivable/accounts_receivable.py
index 8557c03..a195c57 100755
--- a/erpnext/accounts/report/accounts_receivable/accounts_receivable.py
+++ b/erpnext/accounts/report/accounts_receivable/accounts_receivable.py
@@ -748,7 +748,7 @@
self.add_accounting_dimensions_filters()
- def get_cost_center_conditions(self, conditions):
+ def get_cost_center_conditions(self):
lft, rgt = frappe.db.get_value("Cost Center", self.filters.cost_center, ["lft", "rgt"])
cost_center_list = [
center.name
@@ -1009,7 +1009,7 @@
"{range3}-{range4}".format(
range3=cint(self.filters["range3"]) + 1, range4=self.filters["range4"]
),
- "{range4}-{above}".format(range4=cint(self.filters["range4"]) + 1, above=_("Above")),
+ _("{range4}-Above").format(range4=cint(self.filters["range4"]) + 1),
]
):
self.add_column(label=label, fieldname="range" + str(i + 1))
diff --git a/erpnext/accounts/report/budget_variance_report/budget_variance_report.js b/erpnext/accounts/report/budget_variance_report/budget_variance_report.js
index 718b6e2..5955c2e 100644
--- a/erpnext/accounts/report/budget_variance_report/budget_variance_report.js
+++ b/erpnext/accounts/report/budget_variance_report/budget_variance_report.js
@@ -75,7 +75,7 @@
"formatter": function (value, row, column, data, default_formatter) {
value = default_formatter(value, row, column, data);
- if (column.fieldname.includes('variance')) {
+ if (column.fieldname.includes(__("variance"))) {
if (data[column.fieldname] < 0) {
value = "<span style='color:red'>" + value + "</span>";
diff --git a/erpnext/accounts/report/budget_variance_report/budget_variance_report.py b/erpnext/accounts/report/budget_variance_report/budget_variance_report.py
index 7b774ba..96cfab9 100644
--- a/erpnext/accounts/report/budget_variance_report/budget_variance_report.py
+++ b/erpnext/accounts/report/budget_variance_report/budget_variance_report.py
@@ -383,8 +383,8 @@
"data": {
"labels": labels,
"datasets": [
- {"name": "Budget", "chartType": "bar", "values": budget_values},
- {"name": "Actual Expense", "chartType": "bar", "values": actual_values},
+ {"name": _("Budget"), "chartType": "bar", "values": budget_values},
+ {"name": _("Actual Expense"), "chartType": "bar", "values": actual_values},
],
},
"type": "bar",
diff --git a/erpnext/accounts/report/deferred_revenue_and_expense/deferred_revenue_and_expense.py b/erpnext/accounts/report/deferred_revenue_and_expense/deferred_revenue_and_expense.py
index 1eb257a..6cc86c3 100644
--- a/erpnext/accounts/report/deferred_revenue_and_expense/deferred_revenue_and_expense.py
+++ b/erpnext/accounts/report/deferred_revenue_and_expense/deferred_revenue_and_expense.py
@@ -396,7 +396,7 @@
"labels": [period.label for period in self.period_list],
"datasets": [
{
- "name": "Actual Posting",
+ "name": _("Actual Posting"),
"chartType": "bar",
"values": [x.actual for x in self.period_total],
}
@@ -410,7 +410,7 @@
if self.filters.with_upcoming_postings:
chart["data"]["datasets"].append(
- {"name": "Expected", "chartType": "line", "values": [x.total for x in self.period_total]}
+ {"name": _("Expected"), "chartType": "line", "values": [x.total for x in self.period_total]}
)
return chart
diff --git a/erpnext/accounts/report/general_ledger/general_ledger.html b/erpnext/accounts/report/general_ledger/general_ledger.html
index 378fa37..c04f518 100644
--- a/erpnext/accounts/report/general_ledger/general_ledger.html
+++ b/erpnext/accounts/report/general_ledger/general_ledger.html
@@ -52,22 +52,22 @@
{% } %}
</td>
<td style="text-align: right">
- {%= format_currency(data[i].debit, filters.presentation_currency) %}</td>
+ {%= format_currency(data[i].debit, filters.presentation_currency || data[i].account_currency) %}</td>
<td style="text-align: right">
- {%= format_currency(data[i].credit, filters.presentation_currency) %}</td>
+ {%= format_currency(data[i].credit, filters.presentation_currency || data[i].account_currency) %}</td>
{% } else { %}
<td></td>
<td></td>
<td><b>{%= frappe.format(data[i].account, {fieldtype: "Link"}) || " " %}</b></td>
<td style="text-align: right">
- {%= data[i].account && format_currency(data[i].debit, filters.presentation_currency) %}
+ {%= data[i].account && format_currency(data[i].debit, filters.presentation_currency || data[i].account_currency) %}
</td>
<td style="text-align: right">
- {%= data[i].account && format_currency(data[i].credit, filters.presentation_currency) %}
+ {%= data[i].account && format_currency(data[i].credit, filters.presentation_currency || data[i].account_currency) %}
</td>
{% } %}
<td style="text-align: right">
- {%= format_currency(data[i].balance, filters.presentation_currency) %}
+ {%= format_currency(data[i].balance, filters.presentation_currency || data[i].account_currency) %}
</td>
</tr>
{% } %}
diff --git a/erpnext/accounts/report/gross_profit/gross_profit.py b/erpnext/accounts/report/gross_profit/gross_profit.py
index f0106be..dacc809 100644
--- a/erpnext/accounts/report/gross_profit/gross_profit.py
+++ b/erpnext/accounts/report/gross_profit/gross_profit.py
@@ -3,7 +3,8 @@
import frappe
-from frappe import _, scrub
+from frappe import _, qb, scrub
+from frappe.query_builder import Order
from frappe.utils import cint, flt, formatdate
from erpnext.controllers.queries import get_match_cond
@@ -398,6 +399,7 @@
self.average_buying_rate = {}
self.filters = frappe._dict(filters)
self.load_invoice_items()
+ self.get_delivery_notes()
if filters.group_by == "Invoice":
self.group_items_by_invoice()
@@ -591,6 +593,21 @@
return flt(buying_amount, self.currency_precision)
+ def calculate_buying_amount_from_sle(self, row, my_sle, parenttype, parent, item_row, item_code):
+ for i, sle in enumerate(my_sle):
+ # find the stock valution rate from stock ledger entry
+ if (
+ sle.voucher_type == parenttype
+ and parent == sle.voucher_no
+ and sle.voucher_detail_no == item_row
+ ):
+ previous_stock_value = len(my_sle) > i + 1 and flt(my_sle[i + 1].stock_value) or 0.0
+
+ if previous_stock_value:
+ return abs(previous_stock_value - flt(sle.stock_value)) * flt(row.qty) / abs(flt(sle.qty))
+ else:
+ return flt(row.qty) * self.get_average_buying_rate(row, item_code)
+
def get_buying_amount(self, row, item_code):
# IMP NOTE
# stock_ledger_entries should already be filtered by item_code and warehouse and
@@ -607,19 +624,22 @@
if row.dn_detail:
parenttype, parent = "Delivery Note", row.delivery_note
- for i, sle in enumerate(my_sle):
- # find the stock valution rate from stock ledger entry
- if (
- sle.voucher_type == parenttype
- and parent == sle.voucher_no
- and sle.voucher_detail_no == row.item_row
- ):
- previous_stock_value = len(my_sle) > i + 1 and flt(my_sle[i + 1].stock_value) or 0.0
-
- if previous_stock_value:
- return abs(previous_stock_value - flt(sle.stock_value)) * flt(row.qty) / abs(flt(sle.qty))
- else:
- return flt(row.qty) * self.get_average_buying_rate(row, item_code)
+ return self.calculate_buying_amount_from_sle(
+ row, my_sle, parenttype, parent, row.item_row, item_code
+ )
+ elif self.delivery_notes.get((row.parent, row.item_code), None):
+ # check if Invoice has delivery notes
+ dn = self.delivery_notes.get((row.parent, row.item_code))
+ parenttype, parent, item_row, warehouse = (
+ "Delivery Note",
+ dn["delivery_note"],
+ dn["item_row"],
+ dn["warehouse"],
+ )
+ my_sle = self.sle.get((item_code, warehouse))
+ return self.calculate_buying_amount_from_sle(
+ row, my_sle, parenttype, parent, item_row, item_code
+ )
else:
return flt(row.qty) * self.get_average_buying_rate(row, item_code)
@@ -753,6 +773,29 @@
as_dict=1,
)
+ def get_delivery_notes(self):
+ self.delivery_notes = frappe._dict({})
+ if self.si_list:
+ invoices = [x.parent for x in self.si_list]
+ dni = qb.DocType("Delivery Note Item")
+ delivery_notes = (
+ qb.from_(dni)
+ .select(
+ dni.against_sales_invoice.as_("sales_invoice"),
+ dni.item_code,
+ dni.warehouse,
+ dni.parent.as_("delivery_note"),
+ dni.name.as_("item_row"),
+ )
+ .where((dni.docstatus == 1) & (dni.against_sales_invoice.isin(invoices)))
+ .groupby(dni.against_sales_invoice, dni.item_code)
+ .orderby(dni.creation, order=Order.desc)
+ .run(as_dict=True)
+ )
+
+ for entry in delivery_notes:
+ self.delivery_notes[(entry.sales_invoice, entry.item_code)] = entry
+
def group_items_by_invoice(self):
"""
Turns list of Sales Invoice Items to a tree of Sales Invoices with their Items as children.
diff --git a/erpnext/accounts/report/gross_profit/test_gross_profit.py b/erpnext/accounts/report/gross_profit/test_gross_profit.py
new file mode 100644
index 0000000..0ea6b5c
--- /dev/null
+++ b/erpnext/accounts/report/gross_profit/test_gross_profit.py
@@ -0,0 +1,209 @@
+import frappe
+from frappe import qb
+from frappe.tests.utils import FrappeTestCase
+from frappe.utils import add_days, flt, nowdate
+
+from erpnext.accounts.doctype.sales_invoice.sales_invoice import make_delivery_note
+from erpnext.accounts.doctype.sales_invoice.test_sales_invoice import create_sales_invoice
+from erpnext.accounts.report.gross_profit.gross_profit import execute
+from erpnext.stock.doctype.item.test_item import create_item
+from erpnext.stock.doctype.stock_entry.stock_entry_utils import make_stock_entry
+
+
+class TestGrossProfit(FrappeTestCase):
+ def setUp(self):
+ self.create_company()
+ self.create_item()
+ self.create_customer()
+ self.create_sales_invoice()
+ self.clear_old_entries()
+
+ def tearDown(self):
+ frappe.db.rollback()
+
+ def create_company(self):
+ company_name = "_Test Gross Profit"
+ abbr = "_GP"
+ if frappe.db.exists("Company", company_name):
+ company = frappe.get_doc("Company", company_name)
+ else:
+ company = frappe.get_doc(
+ {
+ "doctype": "Company",
+ "company_name": company_name,
+ "country": "India",
+ "default_currency": "INR",
+ "create_chart_of_accounts_based_on": "Standard Template",
+ "chart_of_accounts": "Standard",
+ }
+ )
+ company = company.save()
+
+ self.company = company.name
+ self.cost_center = company.cost_center
+ self.warehouse = "Stores - " + abbr
+ self.income_account = "Sales - " + abbr
+ self.expense_account = "Cost of Goods Sold - " + abbr
+ self.debit_to = "Debtors - " + abbr
+ self.creditors = "Creditors - " + abbr
+
+ def create_item(self):
+ item = create_item(
+ item_code="_Test GP Item", is_stock_item=1, company=self.company, warehouse=self.warehouse
+ )
+ self.item = item if isinstance(item, str) else item.item_code
+
+ def create_customer(self):
+ name = "_Test GP Customer"
+ if frappe.db.exists("Customer", name):
+ self.customer = name
+ else:
+ customer = frappe.new_doc("Customer")
+ customer.customer_name = name
+ customer.type = "Individual"
+ customer.save()
+ self.customer = customer.name
+
+ def create_sales_invoice(
+ self, qty=1, rate=100, posting_date=nowdate(), do_not_save=False, do_not_submit=False
+ ):
+ """
+ Helper function to populate default values in sales invoice
+ """
+ sinv = create_sales_invoice(
+ qty=qty,
+ rate=rate,
+ company=self.company,
+ customer=self.customer,
+ item_code=self.item,
+ item_name=self.item,
+ cost_center=self.cost_center,
+ warehouse=self.warehouse,
+ debit_to=self.debit_to,
+ parent_cost_center=self.cost_center,
+ update_stock=0,
+ currency="INR",
+ is_pos=0,
+ is_return=0,
+ return_against=None,
+ income_account=self.income_account,
+ expense_account=self.expense_account,
+ do_not_save=do_not_save,
+ do_not_submit=do_not_submit,
+ )
+ return sinv
+
+ def clear_old_entries(self):
+ doctype_list = [
+ "Sales Invoice",
+ "GL Entry",
+ "Payment Ledger Entry",
+ "Stock Entry",
+ "Stock Ledger Entry",
+ "Delivery Note",
+ ]
+ for doctype in doctype_list:
+ qb.from_(qb.DocType(doctype)).delete().where(qb.DocType(doctype).company == self.company).run()
+
+ def test_invoice_without_only_delivery_note(self):
+ """
+ Test buying amount for Invoice without `update_stock` flag set but has Delivery Note
+ """
+ se = make_stock_entry(
+ company=self.company,
+ item_code=self.item,
+ target=self.warehouse,
+ qty=1,
+ basic_rate=100,
+ do_not_submit=True,
+ )
+ item = se.items[0]
+ se.append(
+ "items",
+ {
+ "item_code": item.item_code,
+ "s_warehouse": item.s_warehouse,
+ "t_warehouse": item.t_warehouse,
+ "qty": 1,
+ "basic_rate": 200,
+ "conversion_factor": item.conversion_factor or 1.0,
+ "transfer_qty": flt(item.qty) * (flt(item.conversion_factor) or 1.0),
+ "serial_no": item.serial_no,
+ "batch_no": item.batch_no,
+ "cost_center": item.cost_center,
+ "expense_account": item.expense_account,
+ },
+ )
+ se = se.save().submit()
+
+ sinv = create_sales_invoice(
+ qty=1,
+ rate=100,
+ company=self.company,
+ customer=self.customer,
+ item_code=self.item,
+ item_name=self.item,
+ cost_center=self.cost_center,
+ warehouse=self.warehouse,
+ debit_to=self.debit_to,
+ parent_cost_center=self.cost_center,
+ update_stock=0,
+ currency="INR",
+ income_account=self.income_account,
+ expense_account=self.expense_account,
+ )
+
+ filters = frappe._dict(
+ company=self.company, from_date=nowdate(), to_date=nowdate(), group_by="Invoice"
+ )
+
+ columns, data = execute(filters=filters)
+
+ # Without Delivery Note, buying rate should be 150
+ expected_entry_without_dn = {
+ "parent_invoice": sinv.name,
+ "currency": "INR",
+ "sales_invoice": self.item,
+ "customer": self.customer,
+ "posting_date": frappe.utils.datetime.date.fromisoformat(nowdate()),
+ "item_code": self.item,
+ "item_name": self.item,
+ "warehouse": "Stores - _GP",
+ "qty": 1.0,
+ "avg._selling_rate": 100.0,
+ "valuation_rate": 150.0,
+ "selling_amount": 100.0,
+ "buying_amount": 150.0,
+ "gross_profit": -50.0,
+ "gross_profit_%": -50.0,
+ }
+ gp_entry = [x for x in data if x.parent_invoice == sinv.name]
+ self.assertDictContainsSubset(expected_entry_without_dn, gp_entry[0])
+
+ # make delivery note
+ dn = make_delivery_note(sinv.name)
+ dn.items[0].qty = 1
+ dn = dn.save().submit()
+
+ columns, data = execute(filters=filters)
+
+ # Without Delivery Note, buying rate should be 100
+ expected_entry_with_dn = {
+ "parent_invoice": sinv.name,
+ "currency": "INR",
+ "sales_invoice": self.item,
+ "customer": self.customer,
+ "posting_date": frappe.utils.datetime.date.fromisoformat(nowdate()),
+ "item_code": self.item,
+ "item_name": self.item,
+ "warehouse": "Stores - _GP",
+ "qty": 1.0,
+ "avg._selling_rate": 100.0,
+ "valuation_rate": 100.0,
+ "selling_amount": 100.0,
+ "buying_amount": 100.0,
+ "gross_profit": 0.0,
+ "gross_profit_%": 0.0,
+ }
+ gp_entry = [x for x in data if x.parent_invoice == sinv.name]
+ self.assertDictContainsSubset(expected_entry_with_dn, gp_entry[0])
diff --git a/erpnext/accounts/report/payment_ledger/__init__.py b/erpnext/accounts/report/payment_ledger/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/erpnext/accounts/report/payment_ledger/__init__.py
diff --git a/erpnext/accounts/report/payment_ledger/payment_ledger.js b/erpnext/accounts/report/payment_ledger/payment_ledger.js
new file mode 100644
index 0000000..9779844
--- /dev/null
+++ b/erpnext/accounts/report/payment_ledger/payment_ledger.js
@@ -0,0 +1,59 @@
+// Copyright (c) 2022, Frappe Technologies Pvt. Ltd. and contributors
+// For license information, please see license.txt
+/* eslint-disable */
+
+function get_filters() {
+ let filters = [
+ {
+ "fieldname":"company",
+ "label": __("Company"),
+ "fieldtype": "Link",
+ "options": "Company",
+ "default": frappe.defaults.get_user_default("Company"),
+ "reqd": 1
+ },
+ {
+ "fieldname":"period_start_date",
+ "label": __("Start Date"),
+ "fieldtype": "Date",
+ "reqd": 1,
+ "default": frappe.datetime.add_months(frappe.datetime.get_today(), -1)
+ },
+ {
+ "fieldname":"period_end_date",
+ "label": __("End Date"),
+ "fieldtype": "Date",
+ "reqd": 1,
+ "default": frappe.datetime.get_today()
+ },
+ {
+ "fieldname":"account",
+ "label": __("Account"),
+ "fieldtype": "MultiSelectList",
+ "options": "Account",
+ get_data: function(txt) {
+ return frappe.db.get_link_options('Account', txt, {
+ company: frappe.query_report.get_filter_value("company")
+ });
+ }
+ },
+ {
+ "fieldname":"voucher_no",
+ "label": __("Voucher No"),
+ "fieldtype": "Data",
+ "width": 100,
+ },
+ {
+ "fieldname":"against_voucher_no",
+ "label": __("Against Voucher No"),
+ "fieldtype": "Data",
+ "width": 100,
+ },
+
+ ]
+ return filters;
+}
+
+frappe.query_reports["Payment Ledger"] = {
+ "filters": get_filters()
+};
diff --git a/erpnext/accounts/report/payment_ledger/payment_ledger.json b/erpnext/accounts/report/payment_ledger/payment_ledger.json
new file mode 100644
index 0000000..716329f
--- /dev/null
+++ b/erpnext/accounts/report/payment_ledger/payment_ledger.json
@@ -0,0 +1,32 @@
+{
+ "add_total_row": 0,
+ "columns": [],
+ "creation": "2022-06-06 08:50:43.933708",
+ "disable_prepared_report": 0,
+ "disabled": 0,
+ "docstatus": 0,
+ "doctype": "Report",
+ "filters": [],
+ "idx": 0,
+ "is_standard": "Yes",
+ "modified": "2022-06-06 08:50:43.933708",
+ "modified_by": "Administrator",
+ "module": "Accounts",
+ "name": "Payment Ledger",
+ "owner": "Administrator",
+ "prepared_report": 0,
+ "ref_doctype": "Payment Ledger Entry",
+ "report_name": "Payment Ledger",
+ "report_type": "Script Report",
+ "roles": [
+ {
+ "role": "Accounts User"
+ },
+ {
+ "role": "Accounts Manager"
+ },
+ {
+ "role": "Auditor"
+ }
+ ]
+}
\ No newline at end of file
diff --git a/erpnext/accounts/report/payment_ledger/payment_ledger.py b/erpnext/accounts/report/payment_ledger/payment_ledger.py
new file mode 100644
index 0000000..e470c27
--- /dev/null
+++ b/erpnext/accounts/report/payment_ledger/payment_ledger.py
@@ -0,0 +1,222 @@
+# Copyright (c) 2022, Frappe Technologies Pvt. Ltd. and contributors
+# For license information, please see license.txt
+
+from collections import OrderedDict
+
+import frappe
+from frappe import _, qb
+from frappe.query_builder import Criterion
+
+
+class PaymentLedger(object):
+ def __init__(self, filters=None):
+ self.filters = filters
+ self.columns, self.data = [], []
+ self.voucher_dict = OrderedDict()
+ self.voucher_amount = []
+ self.ple = qb.DocType("Payment Ledger Entry")
+
+ def init_voucher_dict(self):
+
+ if self.voucher_amount:
+ s = set()
+ # build a set of unique vouchers
+ for ple in self.voucher_amount:
+ key = (ple.voucher_type, ple.voucher_no, ple.party)
+ s.add(key)
+
+ # for each unique vouchers, initialize +/- list
+ for key in s:
+ self.voucher_dict[key] = frappe._dict(increase=list(), decrease=list())
+
+ # for each ple, using against voucher and amount, assign it to +/- list
+ # group by against voucher
+ for ple in self.voucher_amount:
+ against_key = (ple.against_voucher_type, ple.against_voucher_no, ple.party)
+ target = None
+ if self.voucher_dict.get(against_key):
+ if ple.amount > 0:
+ target = self.voucher_dict.get(against_key).increase
+ else:
+ target = self.voucher_dict.get(against_key).decrease
+
+ # this if condition will lose unassigned ple entries(against_voucher doc doesn't have ple)
+ # need to somehow include the stray entries as well.
+ if target is not None:
+ entry = frappe._dict(
+ company=ple.company,
+ account=ple.account,
+ party_type=ple.party_type,
+ party=ple.party,
+ voucher_type=ple.voucher_type,
+ voucher_no=ple.voucher_no,
+ against_voucher_type=ple.against_voucher_type,
+ against_voucher_no=ple.against_voucher_no,
+ amount=ple.amount,
+ currency=ple.account_currency,
+ )
+
+ if self.filters.include_account_currency:
+ entry["amount_in_account_currency"] = ple.amount_in_account_currency
+
+ target.append(entry)
+
+ def build_data(self):
+ self.data.clear()
+
+ for value in self.voucher_dict.values():
+ voucher_data = []
+ if value.increase != []:
+ voucher_data.extend(value.increase)
+ if value.decrease != []:
+ voucher_data.extend(value.decrease)
+
+ if voucher_data:
+ # balance row
+ total = 0
+ total_in_account_currency = 0
+
+ for x in voucher_data:
+ total += x.amount
+ if self.filters.include_account_currency:
+ total_in_account_currency += x.amount_in_account_currency
+
+ entry = frappe._dict(
+ against_voucher_no="Outstanding:",
+ amount=total,
+ currency=voucher_data[0].currency,
+ )
+
+ if self.filters.include_account_currency:
+ entry["amount_in_account_currency"] = total_in_account_currency
+
+ voucher_data.append(entry)
+
+ # empty row
+ voucher_data.append(frappe._dict())
+ self.data.extend(voucher_data)
+
+ def build_conditions(self):
+ self.conditions = []
+
+ if self.filters.company:
+ self.conditions.append(self.ple.company == self.filters.company)
+
+ if self.filters.account:
+ self.conditions.append(self.ple.account.isin(self.filters.account))
+
+ if self.filters.period_start_date:
+ self.conditions.append(self.ple.posting_date.gte(self.filters.period_start_date))
+
+ if self.filters.period_end_date:
+ self.conditions.append(self.ple.posting_date.lte(self.filters.period_end_date))
+
+ if self.filters.voucher_no:
+ self.conditions.append(self.ple.voucher_no == self.filters.voucher_no)
+
+ if self.filters.against_voucher_no:
+ self.conditions.append(self.ple.against_voucher_no == self.filters.against_voucher_no)
+
+ def get_data(self):
+ ple = self.ple
+
+ self.build_conditions()
+
+ # fetch data from table
+ self.voucher_amount = (
+ qb.from_(ple)
+ .select(ple.star)
+ .where(ple.delinked == 0)
+ .where(Criterion.all(self.conditions))
+ .run(as_dict=True)
+ )
+
+ def get_columns(self):
+ options = None
+ self.columns.append(
+ dict(label=_("Company"), fieldname="company", fieldtype="data", options=options, width="100")
+ )
+
+ self.columns.append(
+ dict(label=_("Account"), fieldname="account", fieldtype="data", options=options, width="100")
+ )
+
+ self.columns.append(
+ dict(
+ label=_("Party Type"), fieldname="party_type", fieldtype="data", options=options, width="100"
+ )
+ )
+ self.columns.append(
+ dict(label=_("Party"), fieldname="party", fieldtype="data", options=options, width="100")
+ )
+ self.columns.append(
+ dict(
+ label=_("Voucher Type"),
+ fieldname="voucher_type",
+ fieldtype="data",
+ options=options,
+ width="100",
+ )
+ )
+ self.columns.append(
+ dict(
+ label=_("Voucher No"), fieldname="voucher_no", fieldtype="data", options=options, width="100"
+ )
+ )
+ self.columns.append(
+ dict(
+ label=_("Against Voucher Type"),
+ fieldname="against_voucher_type",
+ fieldtype="data",
+ options=options,
+ width="100",
+ )
+ )
+ self.columns.append(
+ dict(
+ label=_("Against Voucher No"),
+ fieldname="against_voucher_no",
+ fieldtype="data",
+ options=options,
+ width="100",
+ )
+ )
+ self.columns.append(
+ dict(
+ label=_("Amount"),
+ fieldname="amount",
+ fieldtype="Currency",
+ options="Company:company:default_currency",
+ width="100",
+ )
+ )
+
+ if self.filters.include_account_currency:
+ self.columns.append(
+ dict(
+ label=_("Amount in Account Currency"),
+ fieldname="amount_in_account_currency",
+ fieldtype="Currency",
+ options="currency",
+ width="100",
+ )
+ )
+ self.columns.append(
+ dict(label=_("Currency"), fieldname="currency", fieldtype="Currency", hidden=True)
+ )
+
+ def run(self):
+ self.get_columns()
+ self.get_data()
+
+ # initialize dictionary and group using against voucher
+ self.init_voucher_dict()
+
+ # convert dictionary to list and add balance rows
+ self.build_data()
+
+ return self.columns, self.data
+
+
+def execute(filters=None):
+ return PaymentLedger(filters).run()
diff --git a/erpnext/accounts/report/payment_ledger/test_payment_ledger.py b/erpnext/accounts/report/payment_ledger/test_payment_ledger.py
new file mode 100644
index 0000000..5ae9b87
--- /dev/null
+++ b/erpnext/accounts/report/payment_ledger/test_payment_ledger.py
@@ -0,0 +1,65 @@
+import unittest
+
+import frappe
+from frappe import qb
+from frappe.tests.utils import FrappeTestCase
+
+from erpnext.accounts.doctype.payment_entry.payment_entry import get_payment_entry
+from erpnext.accounts.doctype.sales_invoice.test_sales_invoice import create_sales_invoice
+from erpnext.accounts.report.payment_ledger.payment_ledger import execute
+
+
+class TestPaymentLedger(FrappeTestCase):
+ def setUp(self):
+ self.create_company()
+ self.cleanup()
+
+ def cleanup(self):
+ doctypes = []
+ doctypes.append(qb.DocType("GL Entry"))
+ doctypes.append(qb.DocType("Payment Ledger Entry"))
+ doctypes.append(qb.DocType("Sales Invoice"))
+ doctypes.append(qb.DocType("Payment Entry"))
+
+ for doctype in doctypes:
+ qb.from_(doctype).delete().where(doctype.company == self.company).run()
+
+ def create_company(self):
+ name = "Test Payment Ledger"
+ company = None
+ if frappe.db.exists("Company", name):
+ company = frappe.get_doc("Company", name)
+ else:
+ company = frappe.get_doc(
+ {
+ "doctype": "Company",
+ "company_name": name,
+ "country": "India",
+ "default_currency": "INR",
+ "create_chart_of_accounts_based_on": "Standard Template",
+ "chart_of_accounts": "Standard",
+ }
+ )
+ company = company.save()
+ self.company = company.name
+ self.cost_center = company.cost_center
+ self.warehouse = "All Warehouses" + " - " + company.abbr
+ self.income_account = company.default_income_account
+ self.expense_account = company.default_expense_account
+ self.debit_to = company.default_receivable_account
+
+ def test_unpaid_invoice_outstanding(self):
+ sinv = create_sales_invoice(
+ company=self.company,
+ debit_to=self.debit_to,
+ expense_account=self.expense_account,
+ cost_center=self.cost_center,
+ income_account=self.income_account,
+ warehouse=self.warehouse,
+ )
+ pe = get_payment_entry(sinv.doctype, sinv.name).save().submit()
+
+ filters = frappe._dict({"company": self.company})
+ columns, data = execute(filters=filters)
+ outstanding = [x for x in data if x.get("against_voucher_no") == "Outstanding:"]
+ self.assertEqual(outstanding[0].get("amount"), 0)
diff --git a/erpnext/accounts/report/purchase_register/purchase_register.py b/erpnext/accounts/report/purchase_register/purchase_register.py
index e8a1e79..a05d581 100644
--- a/erpnext/accounts/report/purchase_register/purchase_register.py
+++ b/erpnext/accounts/report/purchase_register/purchase_register.py
@@ -232,12 +232,12 @@
conditions += (
common_condition
- + "and ifnull(`tabPurchase Invoice Item`.{0}, '') in %({0})s)".format(dimension.fieldname)
+ + "and ifnull(`tabPurchase Invoice`.{0}, '') in %({0})s)".format(dimension.fieldname)
)
else:
conditions += (
common_condition
- + "and ifnull(`tabPurchase Invoice Item`.{0}, '') in %({0})s)".format(dimension.fieldname)
+ + "and ifnull(`tabPurchase Invoice`.{0}, '') in %({0})s)".format(dimension.fieldname)
)
return conditions
diff --git a/erpnext/accounts/report/sales_register/sales_register.py b/erpnext/accounts/report/sales_register/sales_register.py
index 06e3c61..b333901 100644
--- a/erpnext/accounts/report/sales_register/sales_register.py
+++ b/erpnext/accounts/report/sales_register/sales_register.py
@@ -390,12 +390,12 @@
conditions += (
common_condition
- + "and ifnull(`tabSales Invoice Item`.{0}, '') in %({0})s)".format(dimension.fieldname)
+ + "and ifnull(`tabSales Invoice`.{0}, '') in %({0})s)".format(dimension.fieldname)
)
else:
conditions += (
common_condition
- + "and ifnull(`tabSales Invoice Item`.{0}, '') in %({0})s)".format(dimension.fieldname)
+ + "and ifnull(`tabSales Invoice`.{0}, '') in %({0})s)".format(dimension.fieldname)
)
return conditions
diff --git a/erpnext/accounts/utils.py b/erpnext/accounts/utils.py
index 9ede678..103c154 100644
--- a/erpnext/accounts/utils.py
+++ b/erpnext/accounts/utils.py
@@ -460,10 +460,6 @@
frappe.flags.ignore_party_validation = False
- if entry.voucher_type in ("Payment Entry", "Journal Entry"):
- if hasattr(doc, "update_expense_claim"):
- doc.update_expense_claim()
-
def check_if_advance_entry_modified(args):
"""
@@ -648,6 +644,16 @@
(now(), frappe.session.user, ref_doc.doctype, ref_doc.name),
)
+ ple = qb.DocType("Payment Ledger Entry")
+
+ qb.update(ple).set(ple.against_voucher_type, ple.voucher_type).set(
+ ple.against_voucher_no, ple.voucher_no
+ ).set(ple.modified, now()).set(ple.modified_by, frappe.session.user).where(
+ (ple.against_voucher_type == ref_doc.doctype)
+ & (ple.against_voucher_no == ref_doc.name)
+ & (ple.delinked == 0)
+ ).run()
+
if ref_doc.doctype in ("Sales Invoice", "Purchase Invoice"):
ref_doc.set("advances", [])
@@ -1140,10 +1146,10 @@
if not existing_gle or not compare_existing_and_expected_gle(
existing_gle, expected_gle, precision
):
- _delete_gl_entries(voucher_type, voucher_no)
+ _delete_accounting_ledger_entries(voucher_type, voucher_no)
voucher_obj.make_gl_entries(gl_entries=expected_gle, from_repost=True)
else:
- _delete_gl_entries(voucher_type, voucher_no)
+ _delete_accounting_ledger_entries(voucher_type, voucher_no)
if not frappe.flags.in_test:
frappe.db.commit()
@@ -1155,12 +1161,26 @@
)
+def _delete_pl_entries(voucher_type, voucher_no):
+ ple = qb.DocType("Payment Ledger Entry")
+ qb.from_(ple).delete().where(
+ (ple.voucher_type == voucher_type) & (ple.voucher_no == voucher_no)
+ ).run()
+
+
def _delete_gl_entries(voucher_type, voucher_no):
- frappe.db.sql(
- """delete from `tabGL Entry`
- where voucher_type=%s and voucher_no=%s""",
- (voucher_type, voucher_no),
- )
+ gle = qb.DocType("GL Entry")
+ qb.from_(gle).delete().where(
+ (gle.voucher_type == voucher_type) & (gle.voucher_no == voucher_no)
+ ).run()
+
+
+def _delete_accounting_ledger_entries(voucher_type, voucher_no):
+ """
+ Remove entries from both General and Payment Ledger for specified Voucher
+ """
+ _delete_gl_entries(voucher_type, voucher_no)
+ _delete_pl_entries(voucher_type, voucher_no)
def sort_stock_vouchers_by_posting_date(
@@ -1358,9 +1378,8 @@
frappe.delete_doc("Desktop Icon", icon)
-def create_payment_ledger_entry(
- gl_entries, cancel=0, adv_adj=0, update_outstanding="Yes", from_repost=0
-):
+def get_payment_ledger_entries(gl_entries, cancel=0):
+ ple_map = []
if gl_entries:
ple = None
@@ -1400,44 +1419,57 @@
dr_or_cr *= -1
dr_or_cr_account_currency *= -1
- ple = frappe.get_doc(
- {
- "doctype": "Payment Ledger Entry",
- "posting_date": gle.posting_date,
- "company": gle.company,
- "account_type": account_type,
- "account": gle.account,
- "party_type": gle.party_type,
- "party": gle.party,
- "cost_center": gle.cost_center,
- "finance_book": gle.finance_book,
- "due_date": gle.due_date,
- "voucher_type": gle.voucher_type,
- "voucher_no": gle.voucher_no,
- "against_voucher_type": gle.against_voucher_type
- if gle.against_voucher_type
- else gle.voucher_type,
- "against_voucher_no": gle.against_voucher if gle.against_voucher else gle.voucher_no,
- "account_currency": gle.account_currency,
- "amount": dr_or_cr,
- "amount_in_account_currency": dr_or_cr_account_currency,
- "delinked": True if cancel else False,
- "remarks": gle.remarks,
- }
+ ple = frappe._dict(
+ doctype="Payment Ledger Entry",
+ posting_date=gle.posting_date,
+ company=gle.company,
+ account_type=account_type,
+ account=gle.account,
+ party_type=gle.party_type,
+ party=gle.party,
+ cost_center=gle.cost_center,
+ finance_book=gle.finance_book,
+ due_date=gle.due_date,
+ voucher_type=gle.voucher_type,
+ voucher_no=gle.voucher_no,
+ against_voucher_type=gle.against_voucher_type
+ if gle.against_voucher_type
+ else gle.voucher_type,
+ against_voucher_no=gle.against_voucher if gle.against_voucher else gle.voucher_no,
+ account_currency=gle.account_currency,
+ amount=dr_or_cr,
+ amount_in_account_currency=dr_or_cr_account_currency,
+ delinked=True if cancel else False,
+ remarks=gle.remarks,
)
dimensions_and_defaults = get_dimensions()
if dimensions_and_defaults:
for dimension in dimensions_and_defaults[0]:
- ple.set(dimension.fieldname, gle.get(dimension.fieldname))
+ ple[dimension.fieldname] = gle.get(dimension.fieldname)
- if cancel:
- delink_original_entry(ple)
- ple.flags.ignore_permissions = 1
- ple.flags.adv_adj = adv_adj
- ple.flags.from_repost = from_repost
- ple.flags.update_outstanding = update_outstanding
- ple.submit()
+ ple_map.append(ple)
+ return ple_map
+
+
+def create_payment_ledger_entry(
+ gl_entries, cancel=0, adv_adj=0, update_outstanding="Yes", from_repost=0
+):
+ if gl_entries:
+ ple_map = get_payment_ledger_entries(gl_entries, cancel=cancel)
+
+ for entry in ple_map:
+
+ ple = frappe.get_doc(entry)
+
+ if cancel:
+ delink_original_entry(ple)
+
+ ple.flags.ignore_permissions = 1
+ ple.flags.adv_adj = adv_adj
+ ple.flags.from_repost = from_repost
+ ple.flags.update_outstanding = update_outstanding
+ ple.submit()
def update_voucher_outstanding(voucher_type, voucher_no, account, party_type, party):
@@ -1457,7 +1489,12 @@
# on cancellation outstanding can be an empty list
voucher_outstanding = ple_query.get_voucher_outstandings(vouchers, common_filter=common_filter)
- if voucher_type in ["Sales Invoice", "Purchase Invoice", "Fees"] and voucher_outstanding:
+ if (
+ voucher_type in ["Sales Invoice", "Purchase Invoice", "Fees"]
+ and party_type
+ and party
+ and voucher_outstanding
+ ):
outstanding = voucher_outstanding[0]
ref_doc = frappe.get_doc(voucher_type, voucher_no)
diff --git a/erpnext/assets/doctype/asset/asset.js b/erpnext/assets/doctype/asset/asset.js
index 5512d41..7e54219 100644
--- a/erpnext/assets/doctype/asset/asset.js
+++ b/erpnext/assets/doctype/asset/asset.js
@@ -432,7 +432,11 @@
set_values_from_purchase_doc: function(frm, doctype, purchase_doc) {
frm.set_value('company', purchase_doc.company);
- frm.set_value('purchase_date', purchase_doc.posting_date);
+ if (purchase_doc.bill_date) {
+ frm.set_value('purchase_date', purchase_doc.bill_date);
+ } else {
+ frm.set_value('purchase_date', purchase_doc.posting_date);
+ }
const item = purchase_doc.items.find(item => item.item_code === frm.doc.item_code);
if (!item) {
doctype_field = frappe.scrub(doctype)
diff --git a/erpnext/assets/doctype/asset/test_asset.py b/erpnext/assets/doctype/asset/test_asset.py
index 370b13b..19c913a 100644
--- a/erpnext/assets/doctype/asset/test_asset.py
+++ b/erpnext/assets/doctype/asset/test_asset.py
@@ -221,7 +221,7 @@
asset.precision("gross_purchase_amount"),
)
pro_rata_amount, _, _ = asset.get_pro_rata_amt(
- asset.finance_books[0], 9000, add_months(get_last_day(purchase_date), 1), date
+ asset.finance_books[0], 9000, get_last_day(add_months(purchase_date, 1)), date
)
pro_rata_amount = flt(pro_rata_amount, asset.precision("gross_purchase_amount"))
self.assertEquals(accumulated_depr_amount, 18000.00 + pro_rata_amount)
@@ -230,9 +230,17 @@
self.assertTrue(asset.journal_entry_for_scrap)
expected_gle = (
- ("_Test Accumulated Depreciations - _TC", 18000.0 + pro_rata_amount, 0.0),
+ (
+ "_Test Accumulated Depreciations - _TC",
+ flt(18000.0 + pro_rata_amount, asset.precision("gross_purchase_amount")),
+ 0.0,
+ ),
("_Test Fixed Asset - _TC", 0.0, 100000.0),
- ("_Test Gain/Loss on Asset Disposal - _TC", 82000.0 - pro_rata_amount, 0.0),
+ (
+ "_Test Gain/Loss on Asset Disposal - _TC",
+ flt(82000.0 - pro_rata_amount, asset.precision("gross_purchase_amount")),
+ 0.0,
+ ),
)
gle = frappe.db.sql(
@@ -283,14 +291,22 @@
self.assertEqual(frappe.db.get_value("Asset", asset.name, "status"), "Sold")
pro_rata_amount, _, _ = asset.get_pro_rata_amt(
- asset.finance_books[0], 9000, add_months(get_last_day(purchase_date), 1), date
+ asset.finance_books[0], 9000, get_last_day(add_months(purchase_date, 1)), date
)
pro_rata_amount = flt(pro_rata_amount, asset.precision("gross_purchase_amount"))
expected_gle = (
- ("_Test Accumulated Depreciations - _TC", 18000.0 + pro_rata_amount, 0.0),
+ (
+ "_Test Accumulated Depreciations - _TC",
+ flt(18000.0 + pro_rata_amount, asset.precision("gross_purchase_amount")),
+ 0.0,
+ ),
("_Test Fixed Asset - _TC", 0.0, 100000.0),
- ("_Test Gain/Loss on Asset Disposal - _TC", 57000.0 - pro_rata_amount, 0.0),
+ (
+ "_Test Gain/Loss on Asset Disposal - _TC",
+ flt(57000.0 - pro_rata_amount, asset.precision("gross_purchase_amount")),
+ 0.0,
+ ),
("Debtors - _TC", 25000.0, 0.0),
)
diff --git a/erpnext/assets/doctype/asset_repair/asset_repair.py b/erpnext/assets/doctype/asset_repair/asset_repair.py
index 8758e9c..d5913c5 100644
--- a/erpnext/assets/doctype/asset_repair/asset_repair.py
+++ b/erpnext/assets/doctype/asset_repair/asset_repair.py
@@ -135,6 +135,7 @@
"basic_rate": stock_item.valuation_rate,
"serial_no": stock_item.serial_no,
"cost_center": self.cost_center,
+ "project": self.project,
},
)
diff --git a/erpnext/assets/doctype/asset_value_adjustment/asset_value_adjustment.py b/erpnext/assets/doctype/asset_value_adjustment/asset_value_adjustment.py
index 59ab6a9..84aa8fa 100644
--- a/erpnext/assets/doctype/asset_value_adjustment/asset_value_adjustment.py
+++ b/erpnext/assets/doctype/asset_value_adjustment/asset_value_adjustment.py
@@ -61,7 +61,9 @@
je.naming_series = depreciation_series
je.posting_date = self.date
je.company = self.company
- je.remark = "Depreciation Entry against {0} worth {1}".format(self.asset, self.difference_amount)
+ je.remark = _("Depreciation Entry against {0} worth {1}").format(
+ self.asset, self.difference_amount
+ )
je.finance_book = self.finance_book
credit_entry = {
diff --git a/erpnext/assets/doctype/location/location.py b/erpnext/assets/doctype/location/location.py
index 0d87bb2..5bff3dd 100644
--- a/erpnext/assets/doctype/location/location.py
+++ b/erpnext/assets/doctype/location/location.py
@@ -200,11 +200,11 @@
name as value,
is_group as expandable
from
- `tab{doctype}` comp
+ `tabLocation` comp
where
ifnull(parent_location, "")={parent}
""".format(
- doctype=doctype, parent=frappe.db.escape(parent)
+ parent=frappe.db.escape(parent)
),
as_dict=1,
)
diff --git a/erpnext/buying/doctype/purchase_order/purchase_order.js b/erpnext/buying/doctype/purchase_order/purchase_order.js
index ddf81ca..06fdea0 100644
--- a/erpnext/buying/doctype/purchase_order/purchase_order.js
+++ b/erpnext/buying/doctype/purchase_order/purchase_order.js
@@ -101,6 +101,11 @@
erpnext.queries.setup_queries(frm, "Warehouse", function() {
return erpnext.queries.warehouse(frm.doc);
});
+
+ // On cancel and amending a purchase order with advance payment, reset advance paid amount
+ if (frm.is_new()) {
+ frm.set_value("advance_paid", 0)
+ }
},
apply_tds: function(frm) {
diff --git a/erpnext/buying/doctype/purchase_order/purchase_order.json b/erpnext/buying/doctype/purchase_order/purchase_order.json
index fb8f25a..ded45b8 100644
--- a/erpnext/buying/doctype/purchase_order/purchase_order.json
+++ b/erpnext/buying/doctype/purchase_order/purchase_order.json
@@ -12,43 +12,24 @@
"title",
"naming_series",
"supplier",
- "get_items_from_open_material_requests",
"supplier_name",
+ "order_confirmation_no",
+ "order_confirmation_date",
+ "get_items_from_open_material_requests",
+ "column_break_7",
+ "transaction_date",
+ "schedule_date",
+ "column_break1",
+ "company",
"apply_tds",
"tax_withholding_category",
"is_subcontracted",
"supplier_warehouse",
- "column_break1",
- "company",
- "transaction_date",
- "schedule_date",
- "order_confirmation_no",
- "order_confirmation_date",
"amended_from",
"accounting_dimensions_section",
"cost_center",
"dimension_col_break",
"project",
- "drop_ship",
- "customer",
- "customer_name",
- "column_break_19",
- "customer_contact_person",
- "customer_contact_display",
- "customer_contact_mobile",
- "customer_contact_email",
- "section_addresses",
- "supplier_address",
- "address_display",
- "contact_person",
- "contact_display",
- "contact_mobile",
- "contact_email",
- "col_break_address",
- "shipping_address",
- "shipping_address_display",
- "billing_address",
- "billing_address_display",
"currency_and_price_list",
"currency",
"conversion_rate",
@@ -57,7 +38,6 @@
"price_list_currency",
"plc_conversion_rate",
"ignore_pricing_rule",
- "section_break_45",
"before_items_section",
"scan_barcode",
"set_from_warehouse",
@@ -67,10 +47,11 @@
"items",
"sb_last_purchase",
"total_qty",
+ "total_net_weight",
+ "column_break_40",
"base_total",
"base_net_total",
"column_break_26",
- "total_net_weight",
"total",
"net_total",
"section_break_48",
@@ -79,14 +60,13 @@
"set_reserve_warehouse",
"supplied_items",
"taxes_section",
+ "taxes_and_charges",
+ "column_break_53",
"tax_category",
"column_break_50",
"shipping_rule",
"section_break_52",
- "taxes_and_charges",
"taxes",
- "sec_tax_breakup",
- "other_charges_calculation",
"totals",
"base_taxes_and_charges_added",
"base_taxes_and_charges_deducted",
@@ -95,12 +75,6 @@
"taxes_and_charges_added",
"taxes_and_charges_deducted",
"total_taxes_and_charges",
- "discount_section",
- "apply_discount_on",
- "base_discount_amount",
- "column_break_45",
- "additional_discount_percentage",
- "discount_amount",
"totals_section",
"base_grand_total",
"base_rounding_adjustment",
@@ -113,37 +87,73 @@
"disable_rounded_total",
"in_words",
"advance_paid",
+ "discount_section",
+ "apply_discount_on",
+ "base_discount_amount",
+ "column_break_45",
+ "additional_discount_percentage",
+ "discount_amount",
+ "sec_tax_breakup",
+ "other_charges_calculation",
+ "address_and_contact_tab",
+ "section_addresses",
+ "supplier_address",
+ "address_display",
+ "col_break_address",
+ "contact_person",
+ "contact_display",
+ "contact_mobile",
+ "contact_email",
+ "company_shipping_address_section",
+ "shipping_address",
+ "column_break_99",
+ "shipping_address_display",
+ "company_billing_address_section",
+ "billing_address",
+ "column_break_103",
+ "billing_address_display",
+ "drop_ship",
+ "customer",
+ "customer_name",
+ "column_break_19",
+ "customer_contact_person",
+ "customer_contact_display",
+ "customer_contact_mobile",
+ "customer_contact_email",
+ "terms_tab",
"payment_schedule_section",
"payment_terms_template",
"payment_schedule",
+ "terms_section_break",
+ "tc_name",
+ "terms",
+ "more_info_tab",
"tracking_section",
"status",
"column_break_75",
"per_billed",
"per_received",
- "terms_section_break",
- "tc_name",
- "terms",
"column_break5",
"letter_head",
- "select_print_heading",
- "column_break_86",
- "language",
"group_same_items",
+ "column_break_86",
+ "select_print_heading",
+ "language",
"subscription_section",
"from_date",
"to_date",
"column_break_97",
"auto_repeat",
"update_auto_repeat_reference",
- "more_info",
+ "additional_info_section",
+ "is_internal_supplier",
+ "represents_company",
"ref_sq",
"column_break_74",
"party_account_currency",
- "is_internal_supplier",
- "represents_company",
"inter_company_order_reference",
- "is_old_subcontracting_flow"
+ "is_old_subcontracting_flow",
+ "dashboard"
],
"fields": [
{
@@ -267,8 +277,9 @@
"read_only": 1
},
{
+ "depends_on": "eval:doc.customer",
"fieldname": "drop_ship",
- "fieldtype": "Section Break",
+ "fieldtype": "Tab Break",
"label": "Drop Ship"
},
{
@@ -299,7 +310,6 @@
{
"fieldname": "customer_contact_display",
"fieldtype": "Small Text",
- "hidden": 1,
"label": "Customer Contact",
"print_hide": 1
},
@@ -319,10 +329,9 @@
"print_hide": 1
},
{
- "collapsible": 1,
"fieldname": "section_addresses",
"fieldtype": "Section Break",
- "label": "Address and Contact"
+ "label": "Supplier Address"
},
{
"fieldname": "supplier_address",
@@ -445,7 +454,6 @@
"print_hide": 1
},
{
- "description": "Sets 'Warehouse' in each row of the Items table.",
"fieldname": "set_warehouse",
"fieldtype": "Link",
"label": "Set Target Warehouse",
@@ -483,7 +491,6 @@
"allow_bulk_edit": 1,
"fieldname": "items",
"fieldtype": "Table",
- "label": "Items",
"oldfieldname": "po_details",
"oldfieldtype": "Table",
"options": "Purchase Order Item",
@@ -570,6 +577,7 @@
"read_only": 1
},
{
+ "depends_on": "total_net_weight",
"fieldname": "total_net_weight",
"fieldtype": "Float",
"label": "Total Net Weight",
@@ -579,6 +587,8 @@
{
"fieldname": "taxes_section",
"fieldtype": "Section Break",
+ "hide_border": 1,
+ "label": "Taxes and Charges",
"oldfieldtype": "Section Break",
"options": "fa fa-money"
},
@@ -633,7 +643,6 @@
{
"fieldname": "totals",
"fieldtype": "Section Break",
- "label": "Taxes and Charges",
"oldfieldtype": "Section Break",
"options": "fa fa-money"
},
@@ -698,7 +707,6 @@
"read_only": 1
},
{
- "depends_on": "total_taxes_and_charges",
"fieldname": "total_taxes_and_charges",
"fieldtype": "Currency",
"label": "Total Taxes and Charges",
@@ -708,7 +716,6 @@
},
{
"collapsible": 1,
- "collapsible_depends_on": "apply_discount_on",
"fieldname": "discount_section",
"fieldtype": "Section Break",
"label": "Additional Discount"
@@ -773,7 +780,6 @@
"read_only": 1
},
{
- "description": "In Words will be visible once you save the Purchase Order.",
"fieldname": "base_in_words",
"fieldtype": "Data",
"label": "In Words (Company Currency)",
@@ -851,7 +857,6 @@
"read_only": 1
},
{
- "collapsible": 1,
"fieldname": "payment_schedule_section",
"fieldtype": "Section Break",
"label": "Payment Terms"
@@ -871,11 +876,10 @@
"print_hide": 1
},
{
- "collapsible": 1,
"collapsible_depends_on": "terms",
"fieldname": "terms_section_break",
"fieldtype": "Section Break",
- "label": "Terms and Conditions",
+ "label": "Terms & Conditions",
"oldfieldtype": "Section Break",
"options": "fa fa-legal"
},
@@ -896,13 +900,6 @@
"oldfieldtype": "Text Editor"
},
{
- "collapsible": 1,
- "fieldname": "more_info",
- "fieldtype": "Section Break",
- "label": "More Information",
- "oldfieldtype": "Section Break"
- },
- {
"default": "Draft",
"fieldname": "status",
"fieldtype": "Select",
@@ -1023,7 +1020,7 @@
"collapsible": 1,
"fieldname": "subscription_section",
"fieldtype": "Section Break",
- "label": "Subscription Section"
+ "label": "Auto Repeat"
},
{
"allow_on_submit": 1,
@@ -1098,7 +1095,9 @@
},
{
"fieldname": "before_items_section",
- "fieldtype": "Section Break"
+ "fieldtype": "Section Break",
+ "hide_border": 1,
+ "label": "Items"
},
{
"fieldname": "items_col_break",
@@ -1109,7 +1108,8 @@
"fetch_from": "supplier.is_internal_supplier",
"fieldname": "is_internal_supplier",
"fieldtype": "Check",
- "label": "Is Internal Supplier"
+ "label": "Is Internal Supplier",
+ "read_only": 1
},
{
"fetch_from": "supplier.represents_company",
@@ -1134,10 +1134,6 @@
"options": "Tax Withholding Category"
},
{
- "fieldname": "section_break_45",
- "fieldtype": "Section Break"
- },
- {
"collapsible": 1,
"fieldname": "accounting_dimensions_section",
"fieldtype": "Section Break",
@@ -1173,13 +1169,71 @@
"fieldtype": "Link",
"label": "Set From Warehouse",
"options": "Warehouse"
+ },
+ {
+ "fieldname": "terms_tab",
+ "fieldtype": "Tab Break",
+ "label": "Terms"
+ },
+ {
+ "fieldname": "more_info_tab",
+ "fieldtype": "Tab Break",
+ "label": "More Info"
+ },
+ {
+ "fieldname": "dashboard",
+ "fieldtype": "Tab Break",
+ "label": "Dashboard",
+ "show_dashboard": 1
+ },
+ {
+ "fieldname": "column_break_7",
+ "fieldtype": "Column Break"
+ },
+ {
+ "fieldname": "column_break_40",
+ "fieldtype": "Column Break"
+ },
+ {
+ "fieldname": "column_break_53",
+ "fieldtype": "Column Break"
+ },
+ {
+ "fieldname": "address_and_contact_tab",
+ "fieldtype": "Tab Break",
+ "label": "Address & Contact"
+ },
+ {
+ "fieldname": "company_shipping_address_section",
+ "fieldtype": "Section Break",
+ "label": "Company Shipping Address"
+ },
+ {
+ "fieldname": "company_billing_address_section",
+ "fieldtype": "Section Break",
+ "label": "Company Billing Address"
+ },
+ {
+ "collapsible": 1,
+ "fieldname": "additional_info_section",
+ "fieldtype": "Section Break",
+ "label": "Additional Info",
+ "oldfieldtype": "Section Break"
+ },
+ {
+ "fieldname": "column_break_99",
+ "fieldtype": "Column Break"
+ },
+ {
+ "fieldname": "column_break_103",
+ "fieldtype": "Column Break"
}
],
"icon": "fa fa-file-text",
"idx": 105,
"is_submittable": 1,
"links": [],
- "modified": "2022-09-16 17:45:04.954055",
+ "modified": "2022-11-17 12:34:36.033363",
"modified_by": "Administrator",
"module": "Buying",
"name": "Purchase Order",
diff --git a/erpnext/buying/doctype/purchase_order/purchase_order.py b/erpnext/buying/doctype/purchase_order/purchase_order.py
index cd58d25..4c10b48 100644
--- a/erpnext/buying/doctype/purchase_order/purchase_order.py
+++ b/erpnext/buying/doctype/purchase_order/purchase_order.py
@@ -18,7 +18,7 @@
from erpnext.accounts.doctype.tax_withholding_category.tax_withholding_category import (
get_party_tax_withholding_details,
)
-from erpnext.accounts.party import get_party_account_currency
+from erpnext.accounts.party import get_party_account, get_party_account_currency
from erpnext.buying.utils import check_on_hold_or_closed_status, validate_for_items
from erpnext.controllers.buying_controller import BuyingController
from erpnext.setup.doctype.item_group.item_group import get_item_group_defaults
@@ -349,7 +349,7 @@
update_linked_doc(self.doctype, self.name, self.inter_company_order_reference)
def on_cancel(self):
- self.ignore_linked_doctypes = "Payment Ledger Entry"
+ self.ignore_linked_doctypes = ("GL Entry", "Payment Ledger Entry")
super(PurchaseOrder, self).on_cancel()
if self.is_against_so():
@@ -361,7 +361,7 @@
self.update_reserved_qty_for_subcontract()
self.check_on_hold_or_closed_status()
- frappe.db.set(self, "status", "Cancelled")
+ self.db_set("status", "Cancelled")
self.update_prevdoc_status()
@@ -558,6 +558,7 @@
target.set_advances()
target.set_payment_schedule()
+ target.credit_to = get_party_account("Supplier", source.supplier, source.company)
def update_item(obj, target, source_parent):
target.amount = flt(obj.amount) - flt(obj.billed_amt)
diff --git a/erpnext/buying/doctype/purchase_order/test_purchase_order.py b/erpnext/buying/doctype/purchase_order/test_purchase_order.py
index 6c1bcc7..5206a42 100644
--- a/erpnext/buying/doctype/purchase_order/test_purchase_order.py
+++ b/erpnext/buying/doctype/purchase_order/test_purchase_order.py
@@ -5,7 +5,7 @@
import json
import frappe
-from frappe.tests.utils import FrappeTestCase
+from frappe.tests.utils import FrappeTestCase, change_settings
from frappe.utils import add_days, flt, getdate, nowdate
from frappe.utils.data import today
@@ -709,13 +709,10 @@
pi.insert()
self.assertTrue(pi.get("payment_schedule"))
+ @change_settings("Accounts Settings", {"unlink_advance_payment_on_cancelation_of_order": 1})
def test_advance_payment_entry_unlink_against_purchase_order(self):
from erpnext.accounts.doctype.payment_entry.test_payment_entry import get_payment_entry
- frappe.db.set_value(
- "Accounts Settings", "Accounts Settings", "unlink_advance_payment_on_cancelation_of_order", 1
- )
-
po_doc = create_purchase_order()
pe = get_payment_entry("Purchase Order", po_doc.name, bank_account="_Test Bank - _TC")
@@ -735,9 +732,31 @@
pe_doc = frappe.get_doc("Payment Entry", pe.name)
pe_doc.cancel()
- frappe.db.set_value(
- "Accounts Settings", "Accounts Settings", "unlink_advance_payment_on_cancelation_of_order", 0
- )
+ @change_settings("Accounts Settings", {"unlink_advance_payment_on_cancelation_of_order": 1})
+ def test_advance_paid_upon_payment_entry_cancellation(self):
+ from erpnext.accounts.doctype.payment_entry.test_payment_entry import get_payment_entry
+
+ po_doc = create_purchase_order()
+
+ pe = get_payment_entry("Purchase Order", po_doc.name, bank_account="_Test Bank - _TC")
+ pe.reference_no = "1"
+ pe.reference_date = nowdate()
+ pe.paid_from_account_currency = po_doc.currency
+ pe.paid_to_account_currency = po_doc.currency
+ pe.source_exchange_rate = 1
+ pe.target_exchange_rate = 1
+ pe.paid_amount = po_doc.grand_total
+ pe.save(ignore_permissions=True)
+ pe.submit()
+
+ po_doc.reload()
+ self.assertEqual(po_doc.advance_paid, po_doc.base_grand_total)
+
+ pe_doc = frappe.get_doc("Payment Entry", pe.name)
+ pe_doc.cancel()
+
+ po_doc.reload()
+ self.assertEqual(po_doc.advance_paid, 0)
def test_schedule_date(self):
po = create_purchase_order(do_not_submit=True)
@@ -814,6 +833,10 @@
prepare_data_for_internal_transfer()
supplier = "_Test Internal Supplier 2"
+ mr = make_material_request(
+ qty=2, company="_Test Company with perpetual inventory", warehouse="Stores - TCP1"
+ )
+
po = create_purchase_order(
company="_Test Company with perpetual inventory",
supplier=supplier,
@@ -821,6 +844,8 @@
from_warehouse="_Test Internal Warehouse New 1 - TCP1",
qty=2,
rate=1,
+ material_request=mr.name,
+ material_request_item=mr.items[0].name,
)
so = make_inter_company_sales_order(po.name)
@@ -856,9 +881,11 @@
self.assertTrue(pi.items[0].purchase_order)
self.assertTrue(pi.items[0].po_detail)
pi.submit()
+ mr.reload()
po.load_from_db()
self.assertEqual(po.status, "Completed")
+ self.assertEqual(mr.status, "Received")
def prepare_data_for_internal_transfer():
@@ -960,6 +987,8 @@
"schedule_date": add_days(nowdate(), 1),
"include_exploded_items": args.get("include_exploded_items", 1),
"against_blanket_order": args.against_blanket_order,
+ "material_request": args.material_request,
+ "material_request_item": args.material_request_item,
},
)
diff --git a/erpnext/buying/doctype/purchase_order_item/purchase_order_item.json b/erpnext/buying/doctype/purchase_order_item/purchase_order_item.json
index 82e92e8..b8203bd 100644
--- a/erpnext/buying/doctype/purchase_order_item/purchase_order_item.json
+++ b/erpnext/buying/doctype/purchase_order_item/purchase_order_item.json
@@ -777,6 +777,7 @@
},
{
"collapsible": 1,
+ "collapsible_depends_on": "eval: doc.margin_type || doc.discount_amount",
"fieldname": "discount_and_margin_section",
"fieldtype": "Section Break",
"label": "Discount and Margin"
@@ -894,7 +895,7 @@
"index_web_pages_for_search": 1,
"istable": 1,
"links": [],
- "modified": "2022-09-07 11:12:38.634976",
+ "modified": "2022-10-26 16:47:41.364387",
"modified_by": "Administrator",
"module": "Buying",
"name": "Purchase Order Item",
diff --git a/erpnext/buying/doctype/request_for_quotation/request_for_quotation.py b/erpnext/buying/doctype/request_for_quotation/request_for_quotation.py
index ee28eb6..bdbc9ce 100644
--- a/erpnext/buying/doctype/request_for_quotation/request_for_quotation.py
+++ b/erpnext/buying/doctype/request_for_quotation/request_for_quotation.py
@@ -31,7 +31,7 @@
if self.docstatus < 1:
# after amend and save, status still shows as cancelled, until submit
- frappe.db.set(self, "status", "Draft")
+ self.db_set("status", "Draft")
def validate_duplicate_supplier(self):
supplier_list = [d.supplier for d in self.suppliers]
@@ -73,14 +73,14 @@
)
def on_submit(self):
- frappe.db.set(self, "status", "Submitted")
+ self.db_set("status", "Submitted")
for supplier in self.suppliers:
supplier.email_sent = 0
supplier.quote_status = "Pending"
self.send_to_supplier()
def on_cancel(self):
- frappe.db.set(self, "status", "Cancelled")
+ self.db_set("status", "Cancelled")
@frappe.whitelist()
def get_supplier_email_preview(self, supplier):
@@ -478,7 +478,7 @@
conditions += "and rfq.transaction_date = '{0}'".format(filters.get("transaction_date"))
rfq_data = frappe.db.sql(
- """
+ f"""
select
distinct rfq.name, rfq.transaction_date,
rfq.company
@@ -486,15 +486,18 @@
`tabRequest for Quotation` rfq, `tabRequest for Quotation Supplier` rfq_supplier
where
rfq.name = rfq_supplier.parent
- and rfq_supplier.supplier = '{0}'
+ and rfq_supplier.supplier = %(supplier)s
and rfq.docstatus = 1
- and rfq.company = '{1}'
- {2}
+ and rfq.company = %(company)s
+ {conditions}
order by rfq.transaction_date ASC
- limit %(page_len)s offset %(start)s """.format(
- filters.get("supplier"), filters.get("company"), conditions
- ),
- {"page_len": page_len, "start": start},
+ limit %(page_len)s offset %(start)s """,
+ {
+ "page_len": page_len,
+ "start": start,
+ "company": filters.get("company"),
+ "supplier": filters.get("supplier"),
+ },
as_dict=1,
)
diff --git a/erpnext/buying/doctype/supplier/supplier.json b/erpnext/buying/doctype/supplier/supplier.json
index e0ee658..66eafe9 100644
--- a/erpnext/buying/doctype/supplier/supplier.json
+++ b/erpnext/buying/doctype/supplier/supplier.json
@@ -10,34 +10,37 @@
"document_type": "Setup",
"engine": "InnoDB",
"field_order": [
- "basic_info",
"naming_series",
"supplier_name",
"country",
- "default_bank_account",
- "tax_id",
- "tax_category",
- "tax_withholding_category",
- "image",
"column_break0",
"supplier_group",
"supplier_type",
- "allow_purchase_invoice_creation_without_purchase_order",
- "allow_purchase_invoice_creation_without_purchase_receipt",
- "is_internal_supplier",
- "represents_company",
- "disabled",
"is_transporter",
- "warn_rfqs",
- "warn_pos",
- "prevent_rfqs",
- "prevent_pos",
- "allowed_to_transact_section",
- "companies",
- "section_break_7",
+ "image",
+ "defaults_section",
"default_currency",
+ "default_bank_account",
"column_break_10",
"default_price_list",
+ "payment_terms",
+ "internal_supplier_section",
+ "is_internal_supplier",
+ "represents_company",
+ "column_break_16",
+ "companies",
+ "column_break2",
+ "supplier_details",
+ "column_break_30",
+ "website",
+ "language",
+ "dashboard_tab",
+ "tax_tab",
+ "tax_id",
+ "column_break_27",
+ "tax_category",
+ "tax_withholding_category",
+ "contact_and_address_tab",
"address_contacts",
"address_html",
"column_break1",
@@ -49,31 +52,26 @@
"column_break_44",
"supplier_primary_address",
"primary_address",
- "default_payable_accounts",
+ "accounting_tab",
"accounts",
- "section_credit_limit",
- "payment_terms",
- "cb_21",
+ "settings_tab",
+ "allow_purchase_invoice_creation_without_purchase_order",
+ "allow_purchase_invoice_creation_without_purchase_receipt",
+ "column_break_54",
+ "is_frozen",
+ "disabled",
+ "warn_rfqs",
+ "warn_pos",
+ "prevent_rfqs",
+ "prevent_pos",
+ "block_supplier_section",
"on_hold",
"hold_type",
- "release_date",
- "default_tax_withholding_config",
- "column_break2",
- "website",
- "supplier_details",
- "column_break_30",
- "language",
- "is_frozen"
+ "column_break_59",
+ "release_date"
],
"fields": [
{
- "fieldname": "basic_info",
- "fieldtype": "Section Break",
- "label": "Name and Type",
- "oldfieldtype": "Section Break",
- "options": "fa fa-user"
- },
- {
"fieldname": "naming_series",
"fieldtype": "Select",
"label": "Series",
@@ -192,6 +190,7 @@
"default": "0",
"fieldname": "warn_rfqs",
"fieldtype": "Check",
+ "hidden": 1,
"label": "Warn RFQs",
"read_only": 1
},
@@ -199,6 +198,7 @@
"default": "0",
"fieldname": "warn_pos",
"fieldtype": "Check",
+ "hidden": 1,
"label": "Warn POs",
"read_only": 1
},
@@ -206,6 +206,7 @@
"default": "0",
"fieldname": "prevent_rfqs",
"fieldtype": "Check",
+ "hidden": 1,
"label": "Prevent RFQs",
"read_only": 1
},
@@ -213,29 +214,18 @@
"default": "0",
"fieldname": "prevent_pos",
"fieldtype": "Check",
+ "hidden": 1,
"label": "Prevent POs",
"read_only": 1
},
{
"depends_on": "represents_company",
- "fieldname": "allowed_to_transact_section",
- "fieldtype": "Section Break",
- "label": "Allowed To Transact With"
- },
- {
- "depends_on": "represents_company",
"fieldname": "companies",
"fieldtype": "Table",
"label": "Allowed To Transact With",
"options": "Allowed To Transact With"
},
{
- "collapsible": 1,
- "fieldname": "section_break_7",
- "fieldtype": "Section Break",
- "label": "Currency and Price List"
- },
- {
"fieldname": "default_currency",
"fieldtype": "Link",
"ignore_user_permissions": 1,
@@ -255,22 +245,12 @@
"options": "Price List"
},
{
- "collapsible": 1,
- "fieldname": "section_credit_limit",
- "fieldtype": "Section Break",
- "label": "Payment Terms"
- },
- {
"fieldname": "payment_terms",
"fieldtype": "Link",
"label": "Default Payment Terms Template",
"options": "Payment Terms Template"
},
{
- "fieldname": "cb_21",
- "fieldtype": "Column Break"
- },
- {
"default": "0",
"fieldname": "on_hold",
"fieldtype": "Check",
@@ -316,13 +296,6 @@
"read_only": 1
},
{
- "collapsible": 1,
- "collapsible_depends_on": "accounts",
- "fieldname": "default_payable_accounts",
- "fieldtype": "Section Break",
- "label": "Default Payable Accounts"
- },
- {
"description": "Mention if non-standard payable account",
"fieldname": "accounts",
"fieldtype": "Table",
@@ -331,12 +304,6 @@
},
{
"collapsible": 1,
- "fieldname": "default_tax_withholding_config",
- "fieldtype": "Section Break",
- "label": "Default Tax Withholding Config"
- },
- {
- "collapsible": 1,
"collapsible_depends_on": "supplier_details",
"fieldname": "column_break2",
"fieldtype": "Section Break",
@@ -383,7 +350,7 @@
{
"fieldname": "primary_address_and_contact_detail_section",
"fieldtype": "Section Break",
- "label": "Primary Address and Contact Detail"
+ "label": "Primary Address and Contact"
},
{
"description": "Reselect, if the chosen contact is edited after save",
@@ -420,6 +387,64 @@
"fieldtype": "Link",
"label": "Supplier Primary Address",
"options": "Address"
+ },
+ {
+ "fieldname": "dashboard_tab",
+ "fieldtype": "Tab Break",
+ "label": "Dashboard",
+ "show_dashboard": 1
+ },
+ {
+ "fieldname": "settings_tab",
+ "fieldtype": "Tab Break",
+ "label": "Settings"
+ },
+ {
+ "fieldname": "contact_and_address_tab",
+ "fieldtype": "Tab Break",
+ "label": "Contact & Address"
+ },
+ {
+ "fieldname": "accounting_tab",
+ "fieldtype": "Tab Break",
+ "label": "Accounting"
+ },
+ {
+ "fieldname": "defaults_section",
+ "fieldtype": "Section Break",
+ "label": "Defaults"
+ },
+ {
+ "fieldname": "tax_tab",
+ "fieldtype": "Tab Break",
+ "label": "Tax"
+ },
+ {
+ "collapsible": 1,
+ "fieldname": "internal_supplier_section",
+ "fieldtype": "Section Break",
+ "label": "Internal Supplier"
+ },
+ {
+ "fieldname": "column_break_16",
+ "fieldtype": "Column Break"
+ },
+ {
+ "fieldname": "column_break_27",
+ "fieldtype": "Column Break"
+ },
+ {
+ "fieldname": "column_break_54",
+ "fieldtype": "Column Break"
+ },
+ {
+ "fieldname": "block_supplier_section",
+ "fieldtype": "Section Break",
+ "label": "Block Supplier"
+ },
+ {
+ "fieldname": "column_break_59",
+ "fieldtype": "Column Break"
}
],
"icon": "fa fa-user",
@@ -432,7 +457,7 @@
"link_fieldname": "party"
}
],
- "modified": "2022-04-16 18:02:27.838623",
+ "modified": "2022-11-09 18:02:59.075203",
"modified_by": "Administrator",
"module": "Buying",
"name": "Supplier",
diff --git a/erpnext/buying/doctype/supplier/supplier.py b/erpnext/buying/doctype/supplier/supplier.py
index 43152e8..bebff1c 100644
--- a/erpnext/buying/doctype/supplier/supplier.py
+++ b/erpnext/buying/doctype/supplier/supplier.py
@@ -145,7 +145,7 @@
def after_rename(self, olddn, newdn, merge=False):
if frappe.defaults.get_global_default("supp_master_name") == "Supplier Name":
- frappe.db.set(self, "supplier_name", newdn)
+ self.db_set("supplier_name", newdn)
@frappe.whitelist()
diff --git a/erpnext/buying/doctype/supplier/test_supplier.py b/erpnext/buying/doctype/supplier/test_supplier.py
index 5572268..b9fc344 100644
--- a/erpnext/buying/doctype/supplier/test_supplier.py
+++ b/erpnext/buying/doctype/supplier/test_supplier.py
@@ -3,6 +3,7 @@
import frappe
+from frappe.custom.doctype.property_setter.property_setter import make_property_setter
from frappe.test_runner import make_test_records
from erpnext.accounts.party import get_due_date
@@ -152,6 +153,44 @@
# Rollback
address.delete()
+ def test_serach_fields_for_supplier(self):
+ from erpnext.controllers.queries import supplier_query
+
+ frappe.db.set_value("Buying Settings", None, "supp_master_name", "Naming Series")
+
+ supplier_name = create_supplier(supplier_name="Test Supplier 1").name
+
+ make_property_setter(
+ "Supplier", None, "search_fields", "supplier_group", "Data", for_doctype="Doctype"
+ )
+
+ data = supplier_query(
+ "Supplier", supplier_name, "name", 0, 20, filters={"name": supplier_name}, as_dict=True
+ )
+
+ self.assertEqual(data[0].name, supplier_name)
+ self.assertEqual(data[0].supplier_group, "Services")
+ self.assertTrue("supplier_type" not in data[0])
+
+ make_property_setter(
+ "Supplier",
+ None,
+ "search_fields",
+ "supplier_group, supplier_type",
+ "Data",
+ for_doctype="Doctype",
+ )
+ data = supplier_query(
+ "Supplier", supplier_name, "name", 0, 20, filters={"name": supplier_name}, as_dict=True
+ )
+
+ self.assertEqual(data[0].name, supplier_name)
+ self.assertEqual(data[0].supplier_group, "Services")
+ self.assertEqual(data[0].supplier_type, "Company")
+ self.assertTrue("supplier_type" in data[0])
+
+ frappe.db.set_value("Buying Settings", None, "supp_master_name", "Supplier Name")
+
def create_supplier(**args):
args = frappe._dict(args)
diff --git a/erpnext/buying/doctype/supplier_quotation/supplier_quotation.json b/erpnext/buying/doctype/supplier_quotation/supplier_quotation.json
index 8d1939a..1636561 100644
--- a/erpnext/buying/doctype/supplier_quotation/supplier_quotation.json
+++ b/erpnext/buying/doctype/supplier_quotation/supplier_quotation.json
@@ -13,19 +13,13 @@
"naming_series",
"supplier",
"supplier_name",
- "column_break1",
"company",
+ "column_break1",
+ "status",
"transaction_date",
"valid_till",
"quotation_number",
"amended_from",
- "address_section",
- "supplier_address",
- "contact_person",
- "address_display",
- "contact_display",
- "contact_mobile",
- "contact_email",
"currency_and_price_list",
"currency",
"conversion_rate",
@@ -36,25 +30,23 @@
"ignore_pricing_rule",
"items_section",
"items",
- "pricing_rule_details",
- "pricing_rules",
"section_break_22",
"total_qty",
+ "total_net_weight",
+ "column_break_26",
"base_total",
"base_net_total",
"column_break_24",
"total",
"net_total",
- "total_net_weight",
"taxes_section",
+ "taxes_and_charges",
+ "column_break_34",
"tax_category",
"column_break_36",
"shipping_rule",
"section_break_38",
- "taxes_and_charges",
"taxes",
- "tax_breakup",
- "other_charges_calculation",
"totals",
"base_taxes_and_charges_added",
"base_taxes_and_charges_deducted",
@@ -80,24 +72,36 @@
"rounded_total",
"in_words",
"disable_rounded_total",
- "terms_section_break",
+ "tax_breakup",
+ "other_charges_calculation",
+ "pricing_rule_details",
+ "pricing_rules",
+ "address_and_contact_tab",
+ "supplier_address",
+ "address_display",
+ "column_break_72",
+ "contact_person",
+ "contact_display",
+ "contact_mobile",
+ "contact_email",
+ "terms_tab",
"tc_name",
"terms",
+ "more_info_tab",
"printing_settings",
- "select_print_heading",
- "group_same_items",
- "column_break_72",
"letter_head",
+ "group_same_items",
+ "column_break_85",
+ "select_print_heading",
"language",
"subscription_section",
"auto_repeat",
"update_auto_repeat_reference",
"more_info",
- "status",
- "column_break_57",
"is_subcontracted",
- "reference",
- "opportunity"
+ "column_break_57",
+ "opportunity",
+ "connections_tab"
],
"fields": [
{
@@ -146,7 +150,7 @@
"fieldname": "supplier_name",
"fieldtype": "Data",
"in_global_search": 1,
- "label": "Name",
+ "label": "Supplier Name",
"read_only": 1
},
{
@@ -194,12 +198,6 @@
"search_index": 1
},
{
- "collapsible": 1,
- "fieldname": "address_section",
- "fieldtype": "Section Break",
- "label": "Address and Contact"
- },
- {
"fieldname": "supplier_address",
"fieldtype": "Link",
"label": "Supplier Address",
@@ -309,6 +307,8 @@
{
"fieldname": "items_section",
"fieldtype": "Section Break",
+ "hide_border": 1,
+ "label": "Items",
"oldfieldtype": "Section Break",
"options": "fa fa-shopping-cart"
},
@@ -316,7 +316,6 @@
"allow_bulk_edit": 1,
"fieldname": "items",
"fieldtype": "Table",
- "label": "Items",
"oldfieldname": "po_details",
"oldfieldtype": "Table",
"options": "Supplier Quotation Item",
@@ -394,6 +393,7 @@
{
"fieldname": "taxes_section",
"fieldtype": "Section Break",
+ "hide_border": 1,
"label": "Taxes and Charges",
"oldfieldtype": "Section Break",
"options": "fa fa-money"
@@ -417,7 +417,8 @@
},
{
"fieldname": "section_break_38",
- "fieldtype": "Section Break"
+ "fieldtype": "Section Break",
+ "hide_border": 1
},
{
"fieldname": "taxes_and_charges",
@@ -523,7 +524,6 @@
},
{
"collapsible": 1,
- "collapsible_depends_on": "discount_amount",
"fieldname": "section_break_41",
"fieldtype": "Section Break",
"label": "Additional Discount"
@@ -563,7 +563,8 @@
},
{
"fieldname": "section_break_46",
- "fieldtype": "Section Break"
+ "fieldtype": "Section Break",
+ "label": "Totals"
},
{
"fieldname": "base_grand_total",
@@ -655,18 +656,9 @@
"label": "Disable Rounded Total"
},
{
- "collapsible": 1,
- "collapsible_depends_on": "terms",
- "fieldname": "terms_section_break",
- "fieldtype": "Section Break",
- "label": "Terms and Conditions",
- "oldfieldtype": "Section Break",
- "options": "fa fa-legal"
- },
- {
"fieldname": "tc_name",
"fieldtype": "Link",
- "label": "Terms",
+ "label": "Terms Template",
"oldfieldname": "tc_name",
"oldfieldtype": "Link",
"options": "Terms and Conditions",
@@ -729,7 +721,7 @@
{
"fieldname": "subscription_section",
"fieldtype": "Section Break",
- "label": "Auto Repeat Section"
+ "label": "Auto Repeat"
},
{
"fieldname": "auto_repeat",
@@ -751,7 +743,7 @@
"collapsible": 1,
"fieldname": "more_info",
"fieldtype": "Section Break",
- "label": "More Information",
+ "label": "Additional Info",
"oldfieldtype": "Section Break",
"options": "fa fa-file-text"
},
@@ -780,11 +772,6 @@
"print_hide": 1
},
{
- "fieldname": "reference",
- "fieldtype": "Section Break",
- "label": "Reference"
- },
- {
"fieldname": "opportunity",
"fieldtype": "Link",
"label": "Opportunity",
@@ -803,6 +790,39 @@
"fieldname": "quotation_number",
"fieldtype": "Data",
"label": "Quotation Number"
+ },
+ {
+ "fieldname": "address_and_contact_tab",
+ "fieldtype": "Tab Break",
+ "label": "Address & Contact"
+ },
+ {
+ "fieldname": "terms_tab",
+ "fieldtype": "Tab Break",
+ "label": "Terms"
+ },
+ {
+ "fieldname": "more_info_tab",
+ "fieldtype": "Tab Break",
+ "label": "More Info"
+ },
+ {
+ "fieldname": "connections_tab",
+ "fieldtype": "Tab Break",
+ "label": "Connections",
+ "show_dashboard": 1
+ },
+ {
+ "fieldname": "column_break_26",
+ "fieldtype": "Column Break"
+ },
+ {
+ "fieldname": "column_break_34",
+ "fieldtype": "Column Break"
+ },
+ {
+ "fieldname": "column_break_85",
+ "fieldtype": "Column Break"
}
],
"icon": "fa fa-shopping-cart",
@@ -810,7 +830,7 @@
"index_web_pages_for_search": 1,
"is_submittable": 1,
"links": [],
- "modified": "2022-03-14 16:13:20.284572",
+ "modified": "2022-09-27 18:20:09.462037",
"modified_by": "Administrator",
"module": "Buying",
"name": "Supplier Quotation",
diff --git a/erpnext/buying/doctype/supplier_quotation/supplier_quotation.py b/erpnext/buying/doctype/supplier_quotation/supplier_quotation.py
index c19c1df..2dd748b 100644
--- a/erpnext/buying/doctype/supplier_quotation/supplier_quotation.py
+++ b/erpnext/buying/doctype/supplier_quotation/supplier_quotation.py
@@ -30,11 +30,11 @@
self.validate_valid_till()
def on_submit(self):
- frappe.db.set(self, "status", "Submitted")
+ self.db_set("status", "Submitted")
self.update_rfq_supplier_status(1)
def on_cancel(self):
- frappe.db.set(self, "status", "Cancelled")
+ self.db_set("status", "Cancelled")
self.update_rfq_supplier_status(0)
def on_trash(self):
diff --git a/erpnext/buying/report/procurement_tracker/procurement_tracker.py b/erpnext/buying/report/procurement_tracker/procurement_tracker.py
index d70ac46..71019e8 100644
--- a/erpnext/buying/report/procurement_tracker/procurement_tracker.py
+++ b/erpnext/buying/report/procurement_tracker/procurement_tracker.py
@@ -127,32 +127,27 @@
return columns
-def get_conditions(filters):
- conditions = ""
-
+def apply_filters_on_query(filters, parent, child, query):
if filters.get("company"):
- conditions += " AND parent.company=%s" % frappe.db.escape(filters.get("company"))
+ query = query.where(parent.company == filters.get("company"))
if filters.get("cost_center") or filters.get("project"):
- conditions += """
- AND (child.`cost_center`=%s OR child.`project`=%s)
- """ % (
- frappe.db.escape(filters.get("cost_center")),
- frappe.db.escape(filters.get("project")),
+ query = query.where(
+ (child.cost_center == filters.get("cost_center")) | (child.project == filters.get("project"))
)
if filters.get("from_date"):
- conditions += " AND parent.transaction_date>='%s'" % filters.get("from_date")
+ query = query.where(parent.transaction_date >= filters.get("from_date"))
if filters.get("to_date"):
- conditions += " AND parent.transaction_date<='%s'" % filters.get("to_date")
- return conditions
+ query = query.where(parent.transaction_date <= filters.get("to_date"))
+
+ return query
def get_data(filters):
- conditions = get_conditions(filters)
- purchase_order_entry = get_po_entries(conditions)
- mr_records, procurement_record_against_mr = get_mapped_mr_details(conditions)
+ purchase_order_entry = get_po_entries(filters)
+ mr_records, procurement_record_against_mr = get_mapped_mr_details(filters)
pr_records = get_mapped_pr_records()
pi_records = get_mapped_pi_records()
@@ -187,11 +182,15 @@
return procurement_record
-def get_mapped_mr_details(conditions):
+def get_mapped_mr_details(filters):
mr_records = {}
- mr_details = frappe.db.sql(
- """
- SELECT
+ parent = frappe.qb.DocType("Material Request")
+ child = frappe.qb.DocType("Material Request Item")
+
+ query = (
+ frappe.qb.from_(parent)
+ .from_(child)
+ .select(
parent.transaction_date,
parent.per_ordered,
parent.owner,
@@ -203,18 +202,13 @@
child.uom,
parent.status,
child.project,
- child.cost_center
- FROM `tabMaterial Request` parent, `tabMaterial Request Item` child
- WHERE
- parent.per_ordered>=0
- AND parent.name=child.parent
- AND parent.docstatus=1
- {conditions}
- """.format(
- conditions=conditions
- ),
- as_dict=1,
- ) # nosec
+ child.cost_center,
+ )
+ .where((parent.per_ordered >= 0) & (parent.name == child.parent) & (parent.docstatus == 1))
+ )
+ query = apply_filters_on_query(filters, parent, child, query)
+
+ mr_details = query.run(as_dict=True)
procurement_record_against_mr = []
for record in mr_details:
@@ -241,46 +235,49 @@
def get_mapped_pi_records():
- return frappe._dict(
- frappe.db.sql(
- """
- SELECT
- pi_item.po_detail,
- pi_item.base_amount
- FROM `tabPurchase Invoice Item` as pi_item
- INNER JOIN `tabPurchase Order` as po
- ON pi_item.`purchase_order` = po.`name`
- WHERE
- pi_item.docstatus = 1
- AND po.status not in ('Closed','Completed','Cancelled')
- AND pi_item.po_detail IS NOT NULL
- """
+ po = frappe.qb.DocType("Purchase Order")
+ pi_item = frappe.qb.DocType("Purchase Invoice Item")
+ pi_records = (
+ frappe.qb.from_(pi_item)
+ .inner_join(po)
+ .on(pi_item.purchase_order == po.name)
+ .select(pi_item.po_detail, pi_item.base_amount)
+ .where(
+ (pi_item.docstatus == 1)
+ & (po.status.notin(("Closed", "Completed", "Cancelled")))
+ & (pi_item.po_detail.isnotnull())
)
- )
+ ).run()
+
+ return frappe._dict(pi_records)
def get_mapped_pr_records():
- return frappe._dict(
- frappe.db.sql(
- """
- SELECT
- pr_item.purchase_order_item,
- pr.posting_date
- FROM `tabPurchase Receipt` pr, `tabPurchase Receipt Item` pr_item
- WHERE
- pr.docstatus=1
- AND pr.name=pr_item.parent
- AND pr_item.purchase_order_item IS NOT NULL
- AND pr.status not in ('Closed','Completed','Cancelled')
- """
+ pr = frappe.qb.DocType("Purchase Receipt")
+ pr_item = frappe.qb.DocType("Purchase Receipt Item")
+ pr_records = (
+ frappe.qb.from_(pr)
+ .from_(pr_item)
+ .select(pr_item.purchase_order_item, pr.posting_date)
+ .where(
+ (pr.docstatus == 1)
+ & (pr.name == pr_item.parent)
+ & (pr_item.purchase_order_item.isnotnull())
+ & (pr.status.notin(("Closed", "Completed", "Cancelled")))
)
- )
+ ).run()
+
+ return frappe._dict(pr_records)
-def get_po_entries(conditions):
- return frappe.db.sql(
- """
- SELECT
+def get_po_entries(filters):
+ parent = frappe.qb.DocType("Purchase Order")
+ child = frappe.qb.DocType("Purchase Order Item")
+
+ query = (
+ frappe.qb.from_(parent)
+ .from_(child)
+ .select(
child.name,
child.parent,
child.cost_center,
@@ -297,17 +294,15 @@
parent.transaction_date,
parent.supplier,
parent.status,
- parent.owner
- FROM `tabPurchase Order` parent, `tabPurchase Order Item` child
- WHERE
- parent.docstatus = 1
- AND parent.name = child.parent
- AND parent.status not in ('Closed','Completed','Cancelled')
- {conditions}
- GROUP BY
- parent.name, child.item_code
- """.format(
- conditions=conditions
- ),
- as_dict=1,
- ) # nosec
+ parent.owner,
+ )
+ .where(
+ (parent.docstatus == 1)
+ & (parent.name == child.parent)
+ & (parent.status.notin(("Closed", "Completed", "Cancelled")))
+ )
+ .groupby(parent.name, child.item_code)
+ )
+ query = apply_filters_on_query(filters, parent, child, query)
+
+ return query.run(as_dict=True)
diff --git a/erpnext/buying/report/purchase_order_analysis/purchase_order_analysis.py b/erpnext/buying/report/purchase_order_analysis/purchase_order_analysis.py
index a5c4649..e10c0e2 100644
--- a/erpnext/buying/report/purchase_order_analysis/purchase_order_analysis.py
+++ b/erpnext/buying/report/purchase_order_analysis/purchase_order_analysis.py
@@ -6,6 +6,7 @@
import frappe
from frappe import _
+from frappe.query_builder.functions import IfNull
from frappe.utils import date_diff, flt, getdate
@@ -16,9 +17,7 @@
validate_filters(filters)
columns = get_columns(filters)
- conditions = get_conditions(filters)
-
- data = get_data(conditions, filters)
+ data = get_data(filters)
if not data:
return [], [], None, []
@@ -37,60 +36,61 @@
frappe.throw(_("To Date cannot be before From Date."))
-def get_conditions(filters):
- conditions = ""
- if filters.get("from_date") and filters.get("to_date"):
- conditions += " and po.transaction_date between %(from_date)s and %(to_date)s"
+def get_data(filters):
+ po = frappe.qb.DocType("Purchase Order")
+ po_item = frappe.qb.DocType("Purchase Order Item")
+ pi_item = frappe.qb.DocType("Purchase Invoice Item")
- for field in ["company", "name"]:
+ query = (
+ frappe.qb.from_(po)
+ .from_(po_item)
+ .left_join(pi_item)
+ .on(pi_item.po_detail == po_item.name)
+ .select(
+ po.transaction_date.as_("date"),
+ po_item.schedule_date.as_("required_date"),
+ po_item.project,
+ po.name.as_("purchase_order"),
+ po.status,
+ po.supplier,
+ po_item.item_code,
+ po_item.qty,
+ po_item.received_qty,
+ (po_item.qty - po_item.received_qty).as_("pending_qty"),
+ IfNull(pi_item.qty, 0).as_("billed_qty"),
+ po_item.base_amount.as_("amount"),
+ (po_item.received_qty * po_item.base_rate).as_("received_qty_amount"),
+ (po_item.billed_amt * IfNull(po.conversion_rate, 1)).as_("billed_amount"),
+ (po_item.base_amount - (po_item.billed_amt * IfNull(po.conversion_rate, 1))).as_(
+ "pending_amount"
+ ),
+ po.set_warehouse.as_("warehouse"),
+ po.company,
+ po_item.name,
+ )
+ .where(
+ (po_item.parent == po.name) & (po.status.notin(("Stopped", "Closed"))) & (po.docstatus == 1)
+ )
+ .groupby(po_item.name)
+ .orderby(po.transaction_date)
+ )
+
+ for field in ("company", "name"):
if filters.get(field):
- conditions += f" and po.{field} = %({field})s"
+ query = query.where(po[field] == filters.get(field))
+
+ if filters.get("from_date") and filters.get("to_date"):
+ query = query.where(
+ po.transaction_date.between(filters.get("from_date"), filters.get("to_date"))
+ )
if filters.get("status"):
- conditions += " and po.status in %(status)s"
+ query = query.where(po.status.isin(filters.get("status")))
if filters.get("project"):
- conditions += " and poi.project = %(project)s"
+ query = query.where(po_item.project == filters.get("project"))
- return conditions
-
-
-def get_data(conditions, filters):
- data = frappe.db.sql(
- """
- SELECT
- po.transaction_date as date,
- poi.schedule_date as required_date,
- poi.project,
- po.name as purchase_order,
- po.status, po.supplier, poi.item_code,
- poi.qty, poi.received_qty,
- (poi.qty - poi.received_qty) AS pending_qty,
- IFNULL(pii.qty, 0) as billed_qty,
- poi.base_amount as amount,
- (poi.received_qty * poi.base_rate) as received_qty_amount,
- (poi.billed_amt * IFNULL(po.conversion_rate, 1)) as billed_amount,
- (poi.base_amount - (poi.billed_amt * IFNULL(po.conversion_rate, 1))) as pending_amount,
- po.set_warehouse as warehouse,
- po.company, poi.name
- FROM
- `tabPurchase Order` po,
- `tabPurchase Order Item` poi
- LEFT JOIN `tabPurchase Invoice Item` pii
- ON pii.po_detail = poi.name
- WHERE
- poi.parent = po.name
- and po.status not in ('Stopped', 'Closed')
- and po.docstatus = 1
- {0}
- GROUP BY poi.name
- ORDER BY po.transaction_date ASC
- """.format(
- conditions
- ),
- filters,
- as_dict=1,
- )
+ data = query.run(as_dict=True)
return data
diff --git a/erpnext/buying/report/supplier_quotation_comparison/supplier_quotation_comparison.py b/erpnext/buying/report/supplier_quotation_comparison/supplier_quotation_comparison.py
index 3013b6d..a728290 100644
--- a/erpnext/buying/report/supplier_quotation_comparison/supplier_quotation_comparison.py
+++ b/erpnext/buying/report/supplier_quotation_comparison/supplier_quotation_comparison.py
@@ -16,8 +16,7 @@
return [], []
columns = get_columns(filters)
- conditions = get_conditions(filters)
- supplier_quotation_data = get_data(filters, conditions)
+ supplier_quotation_data = get_data(filters)
data, chart_data = prepare_data(supplier_quotation_data, filters)
message = get_message()
@@ -25,50 +24,51 @@
return columns, data, message, chart_data
-def get_conditions(filters):
- conditions = ""
+def get_data(filters):
+ sq = frappe.qb.DocType("Supplier Quotation")
+ sq_item = frappe.qb.DocType("Supplier Quotation Item")
+
+ query = (
+ frappe.qb.from_(sq_item)
+ .from_(sq)
+ .select(
+ sq_item.parent,
+ sq_item.item_code,
+ sq_item.qty,
+ sq_item.stock_qty,
+ sq_item.amount,
+ sq_item.uom,
+ sq_item.stock_uom,
+ sq_item.request_for_quotation,
+ sq_item.lead_time_days,
+ sq.supplier.as_("supplier_name"),
+ sq.valid_till,
+ )
+ .where(
+ (sq_item.parent == sq.name)
+ & (sq_item.docstatus < 2)
+ & (sq.company == filters.get("company"))
+ & (sq.transaction_date.between(filters.get("from_date"), filters.get("to_date")))
+ )
+ .orderby(sq.transaction_date, sq_item.item_code)
+ )
+
if filters.get("item_code"):
- conditions += " AND sqi.item_code = %(item_code)s"
+ query = query.where(sq_item.item_code == filters.get("item_code"))
if filters.get("supplier_quotation"):
- conditions += " AND sqi.parent in %(supplier_quotation)s"
+ query = query.where(sq_item.parent.isin(filters.get("supplier_quotation")))
if filters.get("request_for_quotation"):
- conditions += " AND sqi.request_for_quotation = %(request_for_quotation)s"
+ query = query.where(sq_item.request_for_quotation == filters.get("request_for_quotation"))
if filters.get("supplier"):
- conditions += " AND sq.supplier in %(supplier)s"
+ query = query.where(sq.supplier.isin(filters.get("supplier")))
if not filters.get("include_expired"):
- conditions += " AND sq.status != 'Expired'"
+ query = query.where(sq.status != "Expired")
- return conditions
-
-
-def get_data(filters, conditions):
- supplier_quotation_data = frappe.db.sql(
- """
- SELECT
- sqi.parent, sqi.item_code,
- sqi.qty, sqi.stock_qty, sqi.amount,
- sqi.uom, sqi.stock_uom,
- sqi.request_for_quotation,
- sqi.lead_time_days, sq.supplier as supplier_name, sq.valid_till
- FROM
- `tabSupplier Quotation Item` sqi,
- `tabSupplier Quotation` sq
- WHERE
- sqi.parent = sq.name
- AND sqi.docstatus < 2
- AND sq.company = %(company)s
- AND sq.transaction_date between %(from_date)s and %(to_date)s
- {0}
- order by sq.transaction_date, sqi.item_code""".format(
- conditions
- ),
- filters,
- as_dict=1,
- )
+ supplier_quotation_data = query.run(as_dict=True)
return supplier_quotation_data
diff --git a/erpnext/controllers/accounts_controller.py b/erpnext/controllers/accounts_controller.py
index 22291a3..216c9f4 100644
--- a/erpnext/controllers/accounts_controller.py
+++ b/erpnext/controllers/accounts_controller.py
@@ -7,7 +7,7 @@
import frappe
from frappe import _, throw
from frappe.model.workflow import get_workflow_name, is_transition_condition_satisfied
-from frappe.query_builder.functions import Sum
+from frappe.query_builder.functions import Abs, Sum
from frappe.utils import (
add_days,
add_months,
@@ -151,6 +151,7 @@
self.validate_inter_company_reference()
self.disable_pricing_rule_on_internal_transfer()
+ self.disable_tax_included_prices_for_internal_transfer()
self.set_incoming_rate()
if self.meta.get_field("currency"):
@@ -226,7 +227,7 @@
for item in self.get("items"):
if item.get("enable_deferred_revenue") or item.get("enable_deferred_expense"):
if not item.get(field_map.get(self.doctype)):
- default_deferred_account = frappe.db.get_value(
+ default_deferred_account = frappe.get_cached_value(
"Company", self.company, "default_" + field_map.get(self.doctype)
)
if not default_deferred_account:
@@ -398,6 +399,20 @@
alert=1,
)
+ def disable_tax_included_prices_for_internal_transfer(self):
+ if self.is_internal_transfer():
+ tax_updated = False
+ for tax in self.get("taxes"):
+ if tax.get("included_in_print_rate"):
+ tax.included_in_print_rate = 0
+ tax_updated = True
+
+ if tax_updated:
+ frappe.msgprint(
+ _("Disabled tax included prices since this {} is an internal transfer").format(self.doctype),
+ alert=1,
+ )
+
def validate_due_date(self):
if self.get("is_pos"):
return
@@ -661,7 +676,7 @@
def validate_enabled_taxes_and_charges(self):
taxes_and_charges_doctype = self.meta.get_options("taxes_and_charges")
- if frappe.db.get_value(taxes_and_charges_doctype, self.taxes_and_charges, "disabled"):
+ if frappe.get_cached_value(taxes_and_charges_doctype, self.taxes_and_charges, "disabled"):
frappe.throw(
_("{0} '{1}' is disabled").format(taxes_and_charges_doctype, self.taxes_and_charges)
)
@@ -669,7 +684,7 @@
def validate_tax_account_company(self):
for d in self.get("taxes"):
if d.account_head:
- tax_account_company = frappe.db.get_value("Account", d.account_head, "company")
+ tax_account_company = frappe.get_cached_value("Account", d.account_head, "company")
if tax_account_company != self.company:
frappe.throw(
_("Row #{0}: Account {1} does not belong to company {2}").format(
@@ -804,15 +819,12 @@
self.set("advances", [])
advance_allocated = 0
for d in res:
- if d.against_order:
- allocated_amount = flt(d.amount)
+ if self.get("party_account_currency") == self.company_currency:
+ amount = self.get("base_rounded_total") or self.base_grand_total
else:
- if self.get("party_account_currency") == self.company_currency:
- amount = self.get("base_rounded_total") or self.base_grand_total
- else:
- amount = self.get("rounded_total") or self.grand_total
+ amount = self.get("rounded_total") or self.grand_total
- allocated_amount = min(amount - advance_allocated, d.amount)
+ allocated_amount = min(amount - advance_allocated, d.amount)
advance_allocated += flt(allocated_amount)
advance_row = {
@@ -917,7 +929,9 @@
party_account = self.credit_to if is_purchase_invoice else self.debit_to
party_type = "Supplier" if is_purchase_invoice else "Customer"
- gain_loss_account = frappe.db.get_value("Company", self.company, "exchange_gain_loss_account")
+ gain_loss_account = frappe.get_cached_value(
+ "Company", self.company, "exchange_gain_loss_account"
+ )
if not gain_loss_account:
frappe.throw(
_("Please set default Exchange Gain/Loss Account in Company {}").format(self.get("company"))
@@ -1014,7 +1028,7 @@
else self.grand_total
),
"outstanding_amount": self.outstanding_amount,
- "difference_account": frappe.db.get_value(
+ "difference_account": frappe.get_cached_value(
"Company", self.company, "exchange_gain_loss_account"
),
"exchange_gain_loss": flt(d.get("exchange_gain_loss")),
@@ -1334,30 +1348,20 @@
return stock_items
def set_total_advance_paid(self):
- if self.doctype == "Sales Order":
- dr_or_cr = "credit_in_account_currency"
- rev_dr_or_cr = "debit_in_account_currency"
- party = self.customer
- else:
- dr_or_cr = "debit_in_account_currency"
- rev_dr_or_cr = "credit_in_account_currency"
- party = self.supplier
-
- advance = frappe.db.sql(
- """
- select
- account_currency, sum({dr_or_cr}) - sum({rev_dr_cr}) as amount
- from
- `tabGL Entry`
- where
- against_voucher_type = %s and against_voucher = %s and party=%s
- and docstatus = 1
- """.format(
- dr_or_cr=dr_or_cr, rev_dr_cr=rev_dr_or_cr
- ),
- (self.doctype, self.name, party),
- as_dict=1,
- ) # nosec
+ ple = frappe.qb.DocType("Payment Ledger Entry")
+ party = self.customer if self.doctype == "Sales Order" else self.supplier
+ advance = (
+ frappe.qb.from_(ple)
+ .select(ple.account_currency, Abs(Sum(ple.amount)).as_("amount"))
+ .where(
+ (ple.against_voucher_type == self.doctype)
+ & (ple.against_voucher_no == self.name)
+ & (ple.party == party)
+ & (ple.delinked == 0)
+ & (ple.company == self.company)
+ )
+ .run(as_dict=True)
+ )
if advance:
advance = advance[0]
@@ -1392,7 +1396,7 @@
@property
def company_abbr(self):
if not hasattr(self, "_abbr"):
- self._abbr = frappe.db.get_value("Company", self.company, "abbr")
+ self._abbr = frappe.get_cached_value("Company", self.company, "abbr")
return self._abbr
@@ -1778,7 +1782,7 @@
"""
if self.is_internal_transfer() and not self.unrealized_profit_loss_account:
- unrealized_profit_loss_account = frappe.db.get_value(
+ unrealized_profit_loss_account = frappe.get_cached_value(
"Company", self.company, "unrealized_profit_loss_account"
)
@@ -1893,7 +1897,9 @@
@frappe.whitelist()
def get_tax_rate(account_head):
- return frappe.db.get_value("Account", account_head, ["tax_rate", "account_name"], as_dict=True)
+ return frappe.get_cached_value(
+ "Account", account_head, ["tax_rate", "account_name"], as_dict=True
+ )
@frappe.whitelist()
@@ -1902,7 +1908,7 @@
return {}
if tax_template and company:
- tax_template_company = frappe.db.get_value(master_doctype, tax_template, "company")
+ tax_template_company = frappe.get_cached_value(master_doctype, tax_template, "company")
if tax_template_company == company:
return
diff --git a/erpnext/controllers/queries.py b/erpnext/controllers/queries.py
index 8eae0a0..b0cf724 100644
--- a/erpnext/controllers/queries.py
+++ b/erpnext/controllers/queries.py
@@ -78,18 +78,16 @@
@frappe.whitelist()
@frappe.validate_and_sanitize_search_inputs
-def customer_query(doctype, txt, searchfield, start, page_len, filters):
+def customer_query(doctype, txt, searchfield, start, page_len, filters, as_dict=False):
doctype = "Customer"
conditions = []
cust_master_name = frappe.defaults.get_user_default("cust_master_name")
- if cust_master_name == "Customer Name":
- fields = ["name", "customer_group", "territory"]
- else:
- fields = ["name", "customer_name", "customer_group", "territory"]
+ fields = ["name"]
+ if cust_master_name != "Customer Name":
+ fields.append("customer_name")
fields = get_fields(doctype, fields)
-
searchfields = frappe.get_meta(doctype).get_search_fields()
searchfields = " or ".join(field + " like %(txt)s" for field in searchfields)
@@ -112,20 +110,20 @@
}
),
{"txt": "%%%s%%" % txt, "_txt": txt.replace("%", ""), "start": start, "page_len": page_len},
+ as_dict=as_dict,
)
# searches for supplier
@frappe.whitelist()
@frappe.validate_and_sanitize_search_inputs
-def supplier_query(doctype, txt, searchfield, start, page_len, filters):
+def supplier_query(doctype, txt, searchfield, start, page_len, filters, as_dict=False):
doctype = "Supplier"
supp_master_name = frappe.defaults.get_user_default("supp_master_name")
- if supp_master_name == "Supplier Name":
- fields = ["name", "supplier_group"]
- else:
- fields = ["name", "supplier_name", "supplier_group"]
+ fields = ["name"]
+ if supp_master_name != "Supplier Name":
+ fields.append("supplier_name")
fields = get_fields(doctype, fields)
@@ -145,6 +143,7 @@
**{"field": ", ".join(fields), "key": searchfield, "mcond": get_match_cond(doctype)}
),
{"txt": "%%%s%%" % txt, "_txt": txt.replace("%", ""), "start": start, "page_len": page_len},
+ as_dict=as_dict,
)
diff --git a/erpnext/controllers/sales_and_purchase_return.py b/erpnext/controllers/sales_and_purchase_return.py
index 04a0dfa..15c82af 100644
--- a/erpnext/controllers/sales_and_purchase_return.py
+++ b/erpnext/controllers/sales_and_purchase_return.py
@@ -326,7 +326,7 @@
from erpnext.stock.doctype.serial_no.serial_no import get_serial_nos
company = frappe.db.get_value("Delivery Note", source_name, "company")
- default_warehouse_for_sales_return = frappe.db.get_value(
+ default_warehouse_for_sales_return = frappe.get_cached_value(
"Company", company, "default_warehouse_for_sales_return"
)
@@ -340,11 +340,11 @@
# look for Print Heading "Credit Note"
if not doc.select_print_heading:
- doc.select_print_heading = frappe.db.get_value("Print Heading", _("Credit Note"))
+ doc.select_print_heading = frappe.get_cached_value("Print Heading", _("Credit Note"))
elif doctype == "Purchase Invoice":
# look for Print Heading "Debit Note"
- doc.select_print_heading = frappe.db.get_value("Print Heading", _("Debit Note"))
+ doc.select_print_heading = frappe.get_cached_value("Print Heading", _("Debit Note"))
for tax in doc.get("taxes") or []:
if tax.charge_type == "Actual":
@@ -404,12 +404,17 @@
returned_qty_map = get_returned_qty_map_for_row(
source_parent.name, source_parent.supplier, source_doc.name, doctype
)
- target_doc.received_qty = -1 * flt(
- source_doc.received_qty - (returned_qty_map.get("received_qty") or 0)
- )
- target_doc.rejected_qty = -1 * flt(
- source_doc.rejected_qty - (returned_qty_map.get("rejected_qty") or 0)
- )
+
+ if doctype == "Subcontracting Receipt":
+ target_doc.received_qty = -1 * flt(source_doc.qty)
+ else:
+ target_doc.received_qty = -1 * flt(
+ source_doc.received_qty - (returned_qty_map.get("received_qty") or 0)
+ )
+ target_doc.rejected_qty = -1 * flt(
+ source_doc.rejected_qty - (returned_qty_map.get("rejected_qty") or 0)
+ )
+
target_doc.qty = -1 * flt(source_doc.qty - (returned_qty_map.get("qty") or 0))
if hasattr(target_doc, "stock_qty"):
@@ -503,7 +508,7 @@
doctype
+ " Item": {
"doctype": doctype + " Item",
- "field_map": {"serial_no": "serial_no", "batch_no": "batch_no"},
+ "field_map": {"serial_no": "serial_no", "batch_no": "batch_no", "bom": "bom"},
"postprocess": update_item,
},
"Payment Schedule": {"doctype": "Payment Schedule", "postprocess": update_terms},
diff --git a/erpnext/controllers/selling_controller.py b/erpnext/controllers/selling_controller.py
index 5e9c069..e8e9076 100644
--- a/erpnext/controllers/selling_controller.py
+++ b/erpnext/controllers/selling_controller.py
@@ -442,11 +442,17 @@
# For internal transfers use incoming rate as the valuation rate
if self.is_internal_transfer():
if d.doctype == "Packed Item":
- incoming_rate = flt(d.incoming_rate * d.conversion_factor, d.precision("incoming_rate"))
+ incoming_rate = flt(
+ flt(d.incoming_rate, d.precision("incoming_rate")) * d.conversion_factor,
+ d.precision("incoming_rate"),
+ )
if d.incoming_rate != incoming_rate:
d.incoming_rate = incoming_rate
else:
- rate = flt(d.incoming_rate * d.conversion_factor, d.precision("rate"))
+ rate = flt(
+ flt(d.incoming_rate, d.precision("incoming_rate")) * d.conversion_factor,
+ d.precision("rate"),
+ )
if d.rate != rate:
d.rate = rate
frappe.msgprint(
diff --git a/erpnext/controllers/stock_controller.py b/erpnext/controllers/stock_controller.py
index 9149b4d..1e4fabe 100644
--- a/erpnext/controllers/stock_controller.py
+++ b/erpnext/controllers/stock_controller.py
@@ -57,7 +57,7 @@
make_reverse_gl_entries(voucher_type=self.doctype, voucher_no=self.name)
provisional_accounting_for_non_stock_items = cint(
- frappe.db.get_value(
+ frappe.get_cached_value(
"Company", self.company, "enable_provisional_accounting_for_non_stock_items"
)
)
@@ -142,13 +142,15 @@
warehouse_with_no_account = []
precision = self.get_debit_field_precision()
for item_row in voucher_details:
-
sle_list = sle_map.get(item_row.name)
+ sle_rounding_diff = 0.0
if sle_list:
for sle in sle_list:
if warehouse_account.get(sle.warehouse):
# from warehouse account
+ sle_rounding_diff += flt(sle.stock_value_difference)
+
self.check_expense_account(item_row)
# expense account/ target_warehouse / source_warehouse
@@ -191,9 +193,49 @@
elif sle.warehouse not in warehouse_with_no_account:
warehouse_with_no_account.append(sle.warehouse)
+ if abs(sle_rounding_diff) > (1.0 / (10**precision)) and self.is_internal_transfer():
+ warehouse_asset_account = ""
+ if self.get("is_internal_customer"):
+ warehouse_asset_account = warehouse_account[item_row.get("target_warehouse")]["account"]
+ elif self.get("is_internal_supplier"):
+ warehouse_asset_account = warehouse_account[item_row.get("warehouse")]["account"]
+
+ expense_account = frappe.get_cached_value("Company", self.company, "default_expense_account")
+
+ gl_list.append(
+ self.get_gl_dict(
+ {
+ "account": expense_account,
+ "against": warehouse_asset_account,
+ "cost_center": item_row.cost_center,
+ "project": item_row.project or self.get("project"),
+ "remarks": _("Rounding gain/loss Entry for Stock Transfer"),
+ "debit": sle_rounding_diff,
+ "is_opening": item_row.get("is_opening") or self.get("is_opening") or "No",
+ },
+ warehouse_account[sle.warehouse]["account_currency"],
+ item=item_row,
+ )
+ )
+
+ gl_list.append(
+ self.get_gl_dict(
+ {
+ "account": warehouse_asset_account,
+ "against": expense_account,
+ "cost_center": item_row.cost_center,
+ "remarks": _("Rounding gain/loss Entry for Stock Transfer"),
+ "credit": sle_rounding_diff,
+ "project": item_row.get("project") or self.get("project"),
+ "is_opening": item_row.get("is_opening") or self.get("is_opening") or "No",
+ },
+ item=item_row,
+ )
+ )
+
if warehouse_with_no_account:
for wh in warehouse_with_no_account:
- if frappe.db.get_value("Warehouse", wh, "company"):
+ if frappe.get_cached_value("Warehouse", wh, "company"):
frappe.throw(
_(
"Warehouse {0} is not linked to any account, please mention the account in the warehouse record or set default inventory account in company {1}."
@@ -407,15 +449,15 @@
# Get value based on doctype name
if not sl_dict.get(dimension.target_fieldname):
- fieldname = frappe.get_cached_value(
- "DocField", {"parent": self.doctype, "options": dimension.fetch_from_parent}, "fieldname"
+ fieldname = next(
+ (
+ field.fieldname
+ for field in frappe.get_meta(self.doctype).fields
+ if field.options == dimension.fetch_from_parent
+ ),
+ None,
)
- if not fieldname:
- fieldname = frappe.get_cached_value(
- "Custom Field", {"dt": self.doctype, "options": dimension.fetch_from_parent}, "fieldname"
- )
-
if fieldname and self.get(fieldname):
sl_dict[dimension.target_fieldname] = self.get(fieldname)
diff --git a/erpnext/controllers/subcontracting_controller.py b/erpnext/controllers/subcontracting_controller.py
index aa4468c..8d67e30 100644
--- a/erpnext/controllers/subcontracting_controller.py
+++ b/erpnext/controllers/subcontracting_controller.py
@@ -89,6 +89,9 @@
if bom.item != item.item_code:
msg = f"Please select an valid BOM for Item {item.item_name}."
frappe.throw(_(msg))
+ else:
+ msg = f"Please select a BOM for Item {item.item_name}."
+ frappe.throw(_(msg))
def __get_data_before_save(self):
item_dict = {}
diff --git a/erpnext/controllers/taxes_and_totals.py b/erpnext/controllers/taxes_and_totals.py
index cbcccce..c6a634b 100644
--- a/erpnext/controllers/taxes_and_totals.py
+++ b/erpnext/controllers/taxes_and_totals.py
@@ -58,12 +58,25 @@
self.initialize_taxes()
self.determine_exclusive_rate()
self.calculate_net_total()
+ self.calculate_tax_withholding_net_total()
self.calculate_taxes()
self.manipulate_grand_total_for_inclusive_tax()
self.calculate_totals()
self._cleanup()
self.calculate_total_net_weight()
+ def calculate_tax_withholding_net_total(self):
+ if hasattr(self.doc, "tax_withholding_net_total"):
+ sum_net_amount = 0
+ sum_base_net_amount = 0
+ for item in self.doc.get("items"):
+ if hasattr(item, "apply_tds") and item.apply_tds:
+ sum_net_amount += item.net_amount
+ sum_base_net_amount += item.base_net_amount
+
+ self.doc.tax_withholding_net_total = sum_net_amount
+ self.doc.base_tax_withholding_net_total = sum_base_net_amount
+
def validate_item_tax_template(self):
for item in self.doc.get("items"):
if item.item_code and item.get("item_tax_template"):
@@ -889,24 +902,33 @@
self.doc.other_charges_calculation = get_itemised_tax_breakup_html(self.doc)
def set_total_amount_to_default_mop(self, total_amount_to_pay):
- default_mode_of_payment = frappe.db.get_value(
- "POS Payment Method",
- {"parent": self.doc.pos_profile, "default": 1},
- ["mode_of_payment"],
- as_dict=1,
- )
-
- if default_mode_of_payment:
- self.doc.payments = []
- self.doc.append(
- "payments",
- {
- "mode_of_payment": default_mode_of_payment.mode_of_payment,
- "amount": total_amount_to_pay,
- "default": 1,
- },
+ total_paid_amount = 0
+ for payment in self.doc.get("payments"):
+ total_paid_amount += (
+ payment.amount if self.doc.party_account_currency == self.doc.currency else payment.base_amount
)
+ pending_amount = total_amount_to_pay - total_paid_amount
+
+ if pending_amount > 0:
+ default_mode_of_payment = frappe.db.get_value(
+ "POS Payment Method",
+ {"parent": self.doc.pos_profile, "default": 1},
+ ["mode_of_payment"],
+ as_dict=1,
+ )
+
+ if default_mode_of_payment:
+ self.doc.payments = []
+ self.doc.append(
+ "payments",
+ {
+ "mode_of_payment": default_mode_of_payment.mode_of_payment,
+ "amount": pending_amount,
+ "default": 1,
+ },
+ )
+
def get_itemised_tax_breakup_html(doc):
if not doc.taxes:
@@ -1034,7 +1056,7 @@
company_currency = erpnext.get_company_currency(self.doc.company)
for d in self.doc.get(self.tax_field):
if not d.account_currency:
- account_currency = frappe.db.get_value("Account", d.expense_account, "account_currency")
+ account_currency = frappe.get_cached_value("Account", d.expense_account, "account_currency")
d.account_currency = account_currency or company_currency
def set_exchange_rate(self):
diff --git a/erpnext/controllers/tests/test_subcontracting_controller.py b/erpnext/controllers/tests/test_subcontracting_controller.py
index 8490d14..0e6fe95 100644
--- a/erpnext/controllers/tests/test_subcontracting_controller.py
+++ b/erpnext/controllers/tests/test_subcontracting_controller.py
@@ -815,6 +815,7 @@
"item_name",
"qty",
"uom",
+ "bom",
"warehouse",
"stock_uom",
"subcontracting_order",
diff --git a/erpnext/controllers/trends.py b/erpnext/controllers/trends.py
index 1d6c5dc..1fb722e 100644
--- a/erpnext/controllers/trends.py
+++ b/erpnext/controllers/trends.py
@@ -80,7 +80,7 @@
if conditions.get("trans") == "Quotation" and filters.get("group_by") == "Customer":
cond += " and t1.quotation_to = 'Customer'"
- year_start_date, year_end_date = frappe.db.get_value(
+ year_start_date, year_end_date = frappe.get_cached_value(
"Fiscal Year", filters.get("fiscal_year"), ["year_start_date", "year_end_date"]
)
@@ -275,7 +275,7 @@
from dateutil.relativedelta import relativedelta
if not year_start_date:
- year_start_date, year_end_date = frappe.db.get_value(
+ year_start_date, year_end_date = frappe.get_cached_value(
"Fiscal Year", fiscal_year, ["year_start_date", "year_end_date"]
)
diff --git a/erpnext/crm/doctype/lead/lead.json b/erpnext/crm/doctype/lead/lead.json
index 99c00ad..8f8a086 100644
--- a/erpnext/crm/doctype/lead/lead.json
+++ b/erpnext/crm/doctype/lead/lead.json
@@ -375,7 +375,7 @@
"depends_on": "eval:!doc.__islocal",
"fieldname": "notes_tab",
"fieldtype": "Tab Break",
- "label": "Notes"
+ "label": "Comments"
},
{
"collapsible": 1,
@@ -506,7 +506,7 @@
{
"fieldname": "dashboard_tab",
"fieldtype": "Tab Break",
- "label": "Dashboard",
+ "label": "Connections",
"show_dashboard": 1
}
],
@@ -514,7 +514,7 @@
"idx": 5,
"image_field": "image",
"links": [],
- "modified": "2022-08-09 18:26:17.101521",
+ "modified": "2022-10-13 12:42:04.277879",
"modified_by": "Administrator",
"module": "CRM",
"name": "Lead",
diff --git a/erpnext/crm/doctype/opportunity/opportunity.json b/erpnext/crm/doctype/opportunity/opportunity.json
index fed0c7c..07641d2 100644
--- a/erpnext/crm/doctype/opportunity/opportunity.json
+++ b/erpnext/crm/doctype/opportunity/opportunity.json
@@ -544,14 +544,14 @@
"depends_on": "eval:!doc.__islocal",
"fieldname": "dashboard_tab",
"fieldtype": "Tab Break",
- "label": "Dashboard",
+ "label": "Connections",
"show_dashboard": 1
},
{
"depends_on": "eval:!doc.__islocal",
"fieldname": "notes_tab",
"fieldtype": "Tab Break",
- "label": "Notes"
+ "label": "Comments"
},
{
"fieldname": "notes_html",
@@ -622,7 +622,7 @@
"icon": "fa fa-info-sign",
"idx": 195,
"links": [],
- "modified": "2022-08-09 18:26:37.235964",
+ "modified": "2022-10-13 12:42:21.545636",
"modified_by": "Administrator",
"module": "CRM",
"name": "Opportunity",
diff --git a/erpnext/crm/doctype/opportunity/opportunity.py b/erpnext/crm/doctype/opportunity/opportunity.py
index 08eb472..f4b6e91 100644
--- a/erpnext/crm/doctype/opportunity/opportunity.py
+++ b/erpnext/crm/doctype/opportunity/opportunity.py
@@ -60,7 +60,7 @@
if not self.get(field) and frappe.db.field_exists(self.opportunity_from, field):
try:
value = frappe.db.get_value(self.opportunity_from, self.party_name, field)
- frappe.db.set(self, field, value)
+ self.db_set(field, value)
except Exception:
continue
diff --git a/erpnext/crm/doctype/prospect/prospect.json b/erpnext/crm/doctype/prospect/prospect.json
index 820a6c7..d32311b 100644
--- a/erpnext/crm/doctype/prospect/prospect.json
+++ b/erpnext/crm/doctype/prospect/prospect.json
@@ -128,7 +128,7 @@
"depends_on": "eval:!doc.__islocal",
"fieldname": "notes_section",
"fieldtype": "Tab Break",
- "label": "Notes"
+ "label": "Comments"
},
{
"depends_on": "eval: !doc.__islocal",
@@ -218,7 +218,7 @@
],
"index_web_pages_for_search": 1,
"links": [],
- "modified": "2022-08-09 18:26:56.950185",
+ "modified": "2022-10-13 12:29:33.674561",
"modified_by": "Administrator",
"module": "CRM",
"name": "Prospect",
diff --git a/erpnext/e_commerce/doctype/website_item/website_item.json b/erpnext/e_commerce/doctype/website_item/website_item.json
index c5775ee..6556eab 100644
--- a/erpnext/e_commerce/doctype/website_item/website_item.json
+++ b/erpnext/e_commerce/doctype/website_item/website_item.json
@@ -188,7 +188,8 @@
"in_list_view": 1,
"label": "Item Group",
"options": "Item Group",
- "read_only": 1
+ "read_only": 1,
+ "search_index": 1
},
{
"default": "1",
@@ -234,7 +235,8 @@
"fieldname": "brand",
"fieldtype": "Link",
"label": "Brand",
- "options": "Brand"
+ "options": "Brand",
+ "search_index": 1
},
{
"collapsible": 1,
@@ -346,7 +348,7 @@
"index_web_pages_for_search": 1,
"links": [],
"make_attachments_public": 1,
- "modified": "2022-09-13 04:05:11.614087",
+ "modified": "2022-09-30 04:01:52.090732",
"modified_by": "Administrator",
"module": "E-commerce",
"name": "Website Item",
diff --git a/erpnext/e_commerce/doctype/website_item/website_item.py b/erpnext/e_commerce/doctype/website_item/website_item.py
index c0f8c79..3e5d5f7 100644
--- a/erpnext/e_commerce/doctype/website_item/website_item.py
+++ b/erpnext/e_commerce/doctype/website_item/website_item.py
@@ -403,9 +403,6 @@
# since route is a Text column, it needs a length for indexing
frappe.db.add_index("Website Item", ["route(500)"])
- frappe.db.add_index("Website Item", ["item_group"])
- frappe.db.add_index("Website Item", ["brand"])
-
def check_if_user_is_customer(user=None):
from frappe.contacts.doctype.contact.contact import get_contact_name
diff --git a/erpnext/erpnext_integrations/doctype/quickbooks_migrator/quickbooks_migrator.py b/erpnext/erpnext_integrations/doctype/quickbooks_migrator/quickbooks_migrator.py
index b93c5c4..da56997 100644
--- a/erpnext/erpnext_integrations/doctype/quickbooks_migrator/quickbooks_migrator.py
+++ b/erpnext/erpnext_integrations/doctype/quickbooks_migrator/quickbooks_migrator.py
@@ -1345,7 +1345,7 @@
)[0]["name"]
def _publish(self, *args, **kwargs):
- frappe.publish_realtime("quickbooks_progress_update", *args, **kwargs)
+ frappe.publish_realtime("quickbooks_progress_update", *args, **kwargs, user=self.modified_by)
def _get_unique_account_name(self, quickbooks_name, number=0):
if number:
diff --git a/erpnext/erpnext_integrations/doctype/tally_migration/tally_migration.py b/erpnext/erpnext_integrations/doctype/tally_migration/tally_migration.py
index cd4aaee..e6840f5 100644
--- a/erpnext/erpnext_integrations/doctype/tally_migration/tally_migration.py
+++ b/erpnext/erpnext_integrations/doctype/tally_migration/tally_migration.py
@@ -304,6 +304,7 @@
frappe.publish_realtime(
"tally_migration_progress_update",
{"title": title, "message": message, "count": count, "total": total},
+ user=self.modified_by,
)
def _import_master_data(self):
diff --git a/erpnext/erpnext_integrations/taxjar_integration.py b/erpnext/erpnext_integrations/taxjar_integration.py
index b8893aa..2d9093b 100644
--- a/erpnext/erpnext_integrations/taxjar_integration.py
+++ b/erpnext/erpnext_integrations/taxjar_integration.py
@@ -302,7 +302,7 @@
item.tax_collectable = flt(0)
item.taxable_amount = flt(0)
- for tax in doc.taxes:
+ for tax in list(doc.taxes):
if tax.account_head == TAX_ACCOUNT_HEAD:
doc.taxes.remove(tax)
return
diff --git a/erpnext/hooks.py b/erpnext/hooks.py
index b8f51f8..f9ddb12 100644
--- a/erpnext/hooks.py
+++ b/erpnext/hooks.py
@@ -1,5 +1,3 @@
-from frappe import _
-
app_name = "erpnext"
app_title = "ERPNext"
app_publisher = "Frappe Technologies Pvt. Ltd."
@@ -94,7 +92,7 @@
{
"from_route": "/orders/<path:name>",
"to_route": "order",
- "defaults": {"doctype": "Sales Order", "parents": [{"label": _("Orders"), "route": "orders"}]},
+ "defaults": {"doctype": "Sales Order", "parents": [{"label": "Orders", "route": "orders"}]},
},
{"from_route": "/invoices", "to_route": "Sales Invoice"},
{
@@ -102,7 +100,7 @@
"to_route": "order",
"defaults": {
"doctype": "Sales Invoice",
- "parents": [{"label": _("Invoices"), "route": "invoices"}],
+ "parents": [{"label": "Invoices", "route": "invoices"}],
},
},
{"from_route": "/supplier-quotations", "to_route": "Supplier Quotation"},
@@ -111,7 +109,7 @@
"to_route": "order",
"defaults": {
"doctype": "Supplier Quotation",
- "parents": [{"label": _("Supplier Quotation"), "route": "supplier-quotations"}],
+ "parents": [{"label": "Supplier Quotation", "route": "supplier-quotations"}],
},
},
{"from_route": "/purchase-orders", "to_route": "Purchase Order"},
@@ -120,7 +118,7 @@
"to_route": "order",
"defaults": {
"doctype": "Purchase Order",
- "parents": [{"label": _("Purchase Order"), "route": "purchase-orders"}],
+ "parents": [{"label": "Purchase Order", "route": "purchase-orders"}],
},
},
{"from_route": "/purchase-invoices", "to_route": "Purchase Invoice"},
@@ -129,7 +127,7 @@
"to_route": "order",
"defaults": {
"doctype": "Purchase Invoice",
- "parents": [{"label": _("Purchase Invoice"), "route": "purchase-invoices"}],
+ "parents": [{"label": "Purchase Invoice", "route": "purchase-invoices"}],
},
},
{"from_route": "/quotations", "to_route": "Quotation"},
@@ -138,7 +136,7 @@
"to_route": "order",
"defaults": {
"doctype": "Quotation",
- "parents": [{"label": _("Quotations"), "route": "quotations"}],
+ "parents": [{"label": "Quotations", "route": "quotations"}],
},
},
{"from_route": "/shipments", "to_route": "Delivery Note"},
@@ -147,7 +145,7 @@
"to_route": "order",
"defaults": {
"doctype": "Delivery Note",
- "parents": [{"label": _("Shipments"), "route": "shipments"}],
+ "parents": [{"label": "Shipments", "route": "shipments"}],
},
},
{"from_route": "/rfq", "to_route": "Request for Quotation"},
@@ -156,14 +154,14 @@
"to_route": "rfq",
"defaults": {
"doctype": "Request for Quotation",
- "parents": [{"label": _("Request for Quotation"), "route": "rfq"}],
+ "parents": [{"label": "Request for Quotation", "route": "rfq"}],
},
},
{"from_route": "/addresses", "to_route": "Address"},
{
"from_route": "/addresses/<path:name>",
"to_route": "addresses",
- "defaults": {"doctype": "Address", "parents": [{"label": _("Addresses"), "route": "addresses"}]},
+ "defaults": {"doctype": "Address", "parents": [{"label": "Addresses", "route": "addresses"}]},
},
{"from_route": "/boms", "to_route": "BOM"},
{"from_route": "/timesheets", "to_route": "Timesheet"},
@@ -173,78 +171,78 @@
"to_route": "material_request_info",
"defaults": {
"doctype": "Material Request",
- "parents": [{"label": _("Material Request"), "route": "material-requests"}],
+ "parents": [{"label": "Material Request", "route": "material-requests"}],
},
},
{"from_route": "/project", "to_route": "Project"},
]
standard_portal_menu_items = [
- {"title": _("Projects"), "route": "/project", "reference_doctype": "Project"},
+ {"title": "Projects", "route": "/project", "reference_doctype": "Project"},
{
- "title": _("Request for Quotations"),
+ "title": "Request for Quotations",
"route": "/rfq",
"reference_doctype": "Request for Quotation",
"role": "Supplier",
},
{
- "title": _("Supplier Quotation"),
+ "title": "Supplier Quotation",
"route": "/supplier-quotations",
"reference_doctype": "Supplier Quotation",
"role": "Supplier",
},
{
- "title": _("Purchase Orders"),
+ "title": "Purchase Orders",
"route": "/purchase-orders",
"reference_doctype": "Purchase Order",
"role": "Supplier",
},
{
- "title": _("Purchase Invoices"),
+ "title": "Purchase Invoices",
"route": "/purchase-invoices",
"reference_doctype": "Purchase Invoice",
"role": "Supplier",
},
{
- "title": _("Quotations"),
+ "title": "Quotations",
"route": "/quotations",
"reference_doctype": "Quotation",
"role": "Customer",
},
{
- "title": _("Orders"),
+ "title": "Orders",
"route": "/orders",
"reference_doctype": "Sales Order",
"role": "Customer",
},
{
- "title": _("Invoices"),
+ "title": "Invoices",
"route": "/invoices",
"reference_doctype": "Sales Invoice",
"role": "Customer",
},
{
- "title": _("Shipments"),
+ "title": "Shipments",
"route": "/shipments",
"reference_doctype": "Delivery Note",
"role": "Customer",
},
- {"title": _("Issues"), "route": "/issues", "reference_doctype": "Issue", "role": "Customer"},
- {"title": _("Addresses"), "route": "/addresses", "reference_doctype": "Address"},
+ {"title": "Issues", "route": "/issues", "reference_doctype": "Issue", "role": "Customer"},
+ {"title": "Addresses", "route": "/addresses", "reference_doctype": "Address"},
{
- "title": _("Timesheets"),
+ "title": "Timesheets",
"route": "/timesheets",
"reference_doctype": "Timesheet",
"role": "Customer",
},
- {"title": _("Newsletter"), "route": "/newsletters", "reference_doctype": "Newsletter"},
+ {"title": "Newsletter", "route": "/newsletters", "reference_doctype": "Newsletter"},
{
- "title": _("Material Request"),
+ "title": "Material Request",
"route": "/material-requests",
"reference_doctype": "Material Request",
"role": "Customer",
},
- {"title": _("Appointment Booking"), "route": "/book_appointment"},
+ {"title": "Appointment Booking", "route": "/book_appointment"},
]
default_roles = [
@@ -274,8 +272,6 @@
"Timesheet": "erpnext.controllers.website_list_for_contact.has_website_permission",
}
-dump_report_map = "erpnext.startup.report_data_map.data_map"
-
before_tests = "erpnext.setup.utils.before_tests"
standard_queries = {
diff --git a/erpnext/loan_management/doctype/loan/loan.js b/erpnext/loan_management/doctype/loan/loan.js
index 38328e6..20e2b0b 100644
--- a/erpnext/loan_management/doctype/loan/loan.js
+++ b/erpnext/loan_management/doctype/loan/loan.js
@@ -61,6 +61,10 @@
},
refresh: function (frm) {
+ if (frm.doc.repayment_schedule_type == "Pro-rated calendar months") {
+ frm.set_df_property("repayment_start_date", "label", "Interest Calculation Start Date");
+ }
+
if (frm.doc.docstatus == 1) {
if (["Disbursed", "Partially Disbursed"].includes(frm.doc.status) && (!frm.doc.repay_from_salary)) {
frm.add_custom_button(__('Request Loan Closure'), function() {
@@ -103,6 +107,14 @@
frm.trigger("toggle_fields");
},
+ repayment_schedule_type: function(frm) {
+ if (frm.doc.repayment_schedule_type == "Pro-rated calendar months") {
+ frm.set_df_property("repayment_start_date", "label", "Interest Calculation Start Date");
+ } else {
+ frm.set_df_property("repayment_start_date", "label", "Repayment Start Date");
+ }
+ },
+
loan_type: function(frm) {
frm.toggle_reqd("repayment_method", frm.doc.is_term_loan);
frm.toggle_display("repayment_method", frm.doc.is_term_loan);
diff --git a/erpnext/loan_management/doctype/loan/loan.json b/erpnext/loan_management/doctype/loan/loan.json
index 47488f4..dc8b03e 100644
--- a/erpnext/loan_management/doctype/loan/loan.json
+++ b/erpnext/loan_management/doctype/loan/loan.json
@@ -18,6 +18,7 @@
"status",
"section_break_8",
"loan_type",
+ "repayment_schedule_type",
"loan_amount",
"rate_of_interest",
"is_secured_loan",
@@ -158,7 +159,8 @@
"depends_on": "is_term_loan",
"fieldname": "repayment_start_date",
"fieldtype": "Date",
- "label": "Repayment Start Date"
+ "label": "Repayment Start Date",
+ "mandatory_depends_on": "is_term_loan"
},
{
"fieldname": "column_break_11",
@@ -402,12 +404,20 @@
"fieldname": "is_npa",
"fieldtype": "Check",
"label": "Is NPA"
+ },
+ {
+ "depends_on": "is_term_loan",
+ "fetch_from": "loan_type.repayment_schedule_type",
+ "fieldname": "repayment_schedule_type",
+ "fieldtype": "Data",
+ "label": "Repayment Schedule Type",
+ "read_only": 1
}
],
"index_web_pages_for_search": 1,
"is_submittable": 1,
"links": [],
- "modified": "2022-07-12 11:50:31.957360",
+ "modified": "2022-09-30 10:36:47.902903",
"modified_by": "Administrator",
"module": "Loan Management",
"name": "Loan",
diff --git a/erpnext/loan_management/doctype/loan/loan.py b/erpnext/loan_management/doctype/loan/loan.py
index d84eef6..0c9c97f 100644
--- a/erpnext/loan_management/doctype/loan/loan.py
+++ b/erpnext/loan_management/doctype/loan/loan.py
@@ -7,7 +7,16 @@
import frappe
from frappe import _
-from frappe.utils import add_months, flt, get_last_day, getdate, now_datetime, nowdate
+from frappe.utils import (
+ add_days,
+ add_months,
+ date_diff,
+ flt,
+ get_last_day,
+ getdate,
+ now_datetime,
+ nowdate,
+)
import erpnext
from erpnext.accounts.doctype.journal_entry.journal_entry import get_payment_entry
@@ -107,30 +116,81 @@
if not self.repayment_start_date:
frappe.throw(_("Repayment Start Date is mandatory for term loans"))
+ schedule_type_details = frappe.db.get_value(
+ "Loan Type", self.loan_type, ["repayment_schedule_type", "repayment_date_on"], as_dict=1
+ )
+
self.repayment_schedule = []
payment_date = self.repayment_start_date
balance_amount = self.loan_amount
- while balance_amount > 0:
- interest_amount = flt(balance_amount * flt(self.rate_of_interest) / (12 * 100))
- principal_amount = self.monthly_repayment_amount - interest_amount
- balance_amount = flt(balance_amount + interest_amount - self.monthly_repayment_amount)
- if balance_amount < 0:
- principal_amount += balance_amount
- balance_amount = 0.0
- total_payment = principal_amount + interest_amount
- self.append(
- "repayment_schedule",
- {
- "payment_date": payment_date,
- "principal_amount": principal_amount,
- "interest_amount": interest_amount,
- "total_payment": total_payment,
- "balance_loan_amount": balance_amount,
- },
+ while balance_amount > 0:
+ interest_amount, principal_amount, balance_amount, total_payment = self.get_amounts(
+ payment_date,
+ balance_amount,
+ schedule_type_details.repayment_schedule_type,
+ schedule_type_details.repayment_date_on,
)
- next_payment_date = add_single_month(payment_date)
- payment_date = next_payment_date
+
+ if schedule_type_details.repayment_schedule_type == "Pro-rated calendar months":
+ next_payment_date = get_last_day(payment_date)
+ if schedule_type_details.repayment_date_on == "Start of the next month":
+ next_payment_date = add_days(next_payment_date, 1)
+
+ payment_date = next_payment_date
+
+ self.add_repayment_schedule_row(
+ payment_date, principal_amount, interest_amount, total_payment, balance_amount
+ )
+
+ if (
+ schedule_type_details.repayment_schedule_type == "Monthly as per repayment start date"
+ or schedule_type_details.repayment_date_on == "End of the current month"
+ ):
+ next_payment_date = add_single_month(payment_date)
+ payment_date = next_payment_date
+
+ def get_amounts(self, payment_date, balance_amount, schedule_type, repayment_date_on):
+ if schedule_type == "Monthly as per repayment start date":
+ days = 1
+ months = 12
+ else:
+ expected_payment_date = get_last_day(payment_date)
+ if repayment_date_on == "Start of the next month":
+ expected_payment_date = add_days(expected_payment_date, 1)
+
+ if expected_payment_date == payment_date:
+ # using 30 days for calculating interest for all full months
+ days = 30
+ months = 365
+ else:
+ days = date_diff(get_last_day(payment_date), payment_date)
+ months = 365
+
+ interest_amount = flt(balance_amount * flt(self.rate_of_interest) * days / (months * 100))
+ principal_amount = self.monthly_repayment_amount - interest_amount
+ balance_amount = flt(balance_amount + interest_amount - self.monthly_repayment_amount)
+ if balance_amount < 0:
+ principal_amount += balance_amount
+ balance_amount = 0.0
+
+ total_payment = principal_amount + interest_amount
+
+ return interest_amount, principal_amount, balance_amount, total_payment
+
+ def add_repayment_schedule_row(
+ self, payment_date, principal_amount, interest_amount, total_payment, balance_loan_amount
+ ):
+ self.append(
+ "repayment_schedule",
+ {
+ "payment_date": payment_date,
+ "principal_amount": principal_amount,
+ "interest_amount": interest_amount,
+ "total_payment": total_payment,
+ "balance_loan_amount": balance_loan_amount,
+ },
+ )
def set_repayment_period(self):
if self.repayment_method == "Repay Fixed Amount per Period":
diff --git a/erpnext/loan_management/doctype/loan/test_loan.py b/erpnext/loan_management/doctype/loan/test_loan.py
index da05c8e..388e65d 100644
--- a/erpnext/loan_management/doctype/loan/test_loan.py
+++ b/erpnext/loan_management/doctype/loan/test_loan.py
@@ -4,7 +4,16 @@
import unittest
import frappe
-from frappe.utils import add_days, add_months, add_to_date, date_diff, flt, get_datetime, nowdate
+from frappe.utils import (
+ add_days,
+ add_months,
+ add_to_date,
+ date_diff,
+ flt,
+ format_date,
+ get_datetime,
+ nowdate,
+)
from erpnext.loan_management.doctype.loan.loan import (
make_loan_write_off,
@@ -47,6 +56,51 @@
loan_account="Loan Account - _TC",
interest_income_account="Interest Income Account - _TC",
penalty_income_account="Penalty Income Account - _TC",
+ repayment_schedule_type="Monthly as per repayment start date",
+ )
+
+ create_loan_type(
+ "Term Loan Type 1",
+ 12000,
+ 7.5,
+ is_term_loan=1,
+ mode_of_payment="Cash",
+ disbursement_account="Disbursement Account - _TC",
+ payment_account="Payment Account - _TC",
+ loan_account="Loan Account - _TC",
+ interest_income_account="Interest Income Account - _TC",
+ penalty_income_account="Penalty Income Account - _TC",
+ repayment_schedule_type="Monthly as per repayment start date",
+ )
+
+ create_loan_type(
+ "Term Loan Type 2",
+ 12000,
+ 7.5,
+ is_term_loan=1,
+ mode_of_payment="Cash",
+ disbursement_account="Disbursement Account - _TC",
+ payment_account="Payment Account - _TC",
+ loan_account="Loan Account - _TC",
+ interest_income_account="Interest Income Account - _TC",
+ penalty_income_account="Penalty Income Account - _TC",
+ repayment_schedule_type="Pro-rated calendar months",
+ repayment_date_on="Start of the next month",
+ )
+
+ create_loan_type(
+ "Term Loan Type 3",
+ 12000,
+ 7.5,
+ is_term_loan=1,
+ mode_of_payment="Cash",
+ disbursement_account="Disbursement Account - _TC",
+ payment_account="Payment Account - _TC",
+ loan_account="Loan Account - _TC",
+ interest_income_account="Interest Income Account - _TC",
+ penalty_income_account="Penalty Income Account - _TC",
+ repayment_schedule_type="Pro-rated calendar months",
+ repayment_date_on="End of the current month",
)
create_loan_type(
@@ -62,6 +116,7 @@
"Loan Account - _TC",
"Interest Income Account - _TC",
"Penalty Income Account - _TC",
+ repayment_schedule_type="Monthly as per repayment start date",
)
create_loan_type(
@@ -902,6 +957,69 @@
amounts = calculate_amounts(loan.name, add_days(last_date, 5))
self.assertEqual(flt(amounts["pending_principal_amount"], 0), 0)
+ def test_term_loan_schedule_types(self):
+ loan = create_loan(
+ self.applicant1,
+ "Term Loan Type 1",
+ 12000,
+ "Repay Over Number of Periods",
+ 12,
+ repayment_start_date="2022-10-17",
+ )
+
+ # Check for first, second and last installment date
+ self.assertEqual(
+ format_date(loan.get("repayment_schedule")[0].payment_date, "dd-MM-yyyy"), "17-10-2022"
+ )
+ self.assertEqual(
+ format_date(loan.get("repayment_schedule")[1].payment_date, "dd-MM-yyyy"), "17-11-2022"
+ )
+ self.assertEqual(
+ format_date(loan.get("repayment_schedule")[-1].payment_date, "dd-MM-yyyy"), "17-09-2023"
+ )
+
+ loan.loan_type = "Term Loan Type 2"
+ loan.save()
+
+ # Check for first, second and last installment date
+ self.assertEqual(
+ format_date(loan.get("repayment_schedule")[0].payment_date, "dd-MM-yyyy"), "01-11-2022"
+ )
+ self.assertEqual(
+ format_date(loan.get("repayment_schedule")[1].payment_date, "dd-MM-yyyy"), "01-12-2022"
+ )
+ self.assertEqual(
+ format_date(loan.get("repayment_schedule")[-1].payment_date, "dd-MM-yyyy"), "01-10-2023"
+ )
+
+ loan.loan_type = "Term Loan Type 3"
+ loan.save()
+
+ # Check for first, second and last installment date
+ self.assertEqual(
+ format_date(loan.get("repayment_schedule")[0].payment_date, "dd-MM-yyyy"), "31-10-2022"
+ )
+ self.assertEqual(
+ format_date(loan.get("repayment_schedule")[1].payment_date, "dd-MM-yyyy"), "30-11-2022"
+ )
+ self.assertEqual(
+ format_date(loan.get("repayment_schedule")[-1].payment_date, "dd-MM-yyyy"), "30-09-2023"
+ )
+
+ loan.repayment_method = "Repay Fixed Amount per Period"
+ loan.monthly_repayment_amount = 1042
+ loan.save()
+
+ self.assertEqual(
+ format_date(loan.get("repayment_schedule")[0].payment_date, "dd-MM-yyyy"), "31-10-2022"
+ )
+ self.assertEqual(
+ format_date(loan.get("repayment_schedule")[1].payment_date, "dd-MM-yyyy"), "30-11-2022"
+ )
+ self.assertEqual(
+ format_date(loan.get("repayment_schedule")[-1].payment_date, "dd-MM-yyyy"), "30-09-2023"
+ )
+
def create_loan_scenario_for_penalty(doc):
pledge = [{"loan_security": "Test Security 1", "qty": 4000.00}]
@@ -1033,6 +1151,8 @@
penalty_income_account=None,
repayment_method=None,
repayment_periods=None,
+ repayment_schedule_type=None,
+ repayment_date_on=None,
):
if not frappe.db.exists("Loan Type", loan_name):
@@ -1042,6 +1162,7 @@
"company": "_Test Company",
"loan_name": loan_name,
"is_term_loan": is_term_loan,
+ "repayment_schedule_type": "Monthly as per repayment start date",
"maximum_loan_amount": maximum_loan_amount,
"rate_of_interest": rate_of_interest,
"penalty_interest_rate": penalty_interest_rate,
@@ -1056,8 +1177,14 @@
"repayment_periods": repayment_periods,
"write_off_amount": 100,
}
- ).insert()
+ )
+ if loan_type.is_term_loan:
+ loan_type.repayment_schedule_type = repayment_schedule_type
+ if loan_type.repayment_schedule_type != "Monthly as per repayment start date":
+ loan_type.repayment_date_on = repayment_date_on
+
+ loan_type.insert()
loan_type.submit()
diff --git a/erpnext/loan_management/doctype/loan_repayment/loan_repayment.py b/erpnext/loan_management/doctype/loan_repayment/loan_repayment.py
index e9fa2ad..8a185f8 100644
--- a/erpnext/loan_management/doctype/loan_repayment/loan_repayment.py
+++ b/erpnext/loan_management/doctype/loan_repayment/loan_repayment.py
@@ -576,8 +576,8 @@
loan_doc = frappe.get_doc("Loan", loan)
next_accrual_date = None
accrued_entries = 0
- last_repayment_amount = 0
- last_balance_amount = 0
+ last_repayment_amount = None
+ last_balance_amount = None
for term in reversed(loan_doc.get("repayment_schedule")):
if not term.is_accrued:
@@ -585,9 +585,9 @@
loan_doc.remove(term)
else:
accrued_entries += 1
- if not last_repayment_amount:
+ if last_repayment_amount is None:
last_repayment_amount = term.total_payment
- if not last_balance_amount:
+ if last_balance_amount is None:
last_balance_amount = term.balance_loan_amount
loan_doc.save()
diff --git a/erpnext/loan_management/doctype/loan_type/loan_type.json b/erpnext/loan_management/doctype/loan_type/loan_type.json
index 00337e4..5cc9464 100644
--- a/erpnext/loan_management/doctype/loan_type/loan_type.json
+++ b/erpnext/loan_management/doctype/loan_type/loan_type.json
@@ -16,6 +16,8 @@
"company",
"is_term_loan",
"disabled",
+ "repayment_schedule_type",
+ "repayment_date_on",
"description",
"account_details_section",
"mode_of_payment",
@@ -157,12 +159,30 @@
"label": "Disbursement Account",
"options": "Account",
"reqd": 1
+ },
+ {
+ "depends_on": "is_term_loan",
+ "description": "The schedule type that will be used for generating the term loan schedules (will affect the payment date and monthly repayment amount)",
+ "fieldname": "repayment_schedule_type",
+ "fieldtype": "Select",
+ "label": "Repayment Schedule Type",
+ "mandatory_depends_on": "is_term_loan",
+ "options": "\nMonthly as per repayment start date\nPro-rated calendar months"
+ },
+ {
+ "depends_on": "eval:doc.repayment_schedule_type == \"Pro-rated calendar months\"",
+ "description": "Select whether the repayment date should be the end of the current month or start of the upcoming month",
+ "fieldname": "repayment_date_on",
+ "fieldtype": "Select",
+ "label": "Repayment Date On",
+ "mandatory_depends_on": "eval:doc.repayment_schedule_type == \"Pro-rated calendar months\"",
+ "options": "\nStart of the next month\nEnd of the current month"
}
],
"index_web_pages_for_search": 1,
"is_submittable": 1,
"links": [],
- "modified": "2022-01-25 16:23:57.009349",
+ "modified": "2022-10-22 17:43:03.954201",
"modified_by": "Administrator",
"module": "Loan Management",
"name": "Loan Type",
diff --git a/erpnext/maintenance/doctype/maintenance_schedule/maintenance_schedule.py b/erpnext/maintenance/doctype/maintenance_schedule/maintenance_schedule.py
index 3dc6b0f..95e2d69 100644
--- a/erpnext/maintenance/doctype/maintenance_schedule/maintenance_schedule.py
+++ b/erpnext/maintenance/doctype/maintenance_schedule/maintenance_schedule.py
@@ -119,7 +119,7 @@
event.add_participant(self.doctype, self.name)
event.insert(ignore_permissions=1)
- frappe.db.set(self, "status", "Submitted")
+ self.db_set("status", "Submitted")
def create_schedule_list(self, start_date, end_date, no_of_visit, sales_person):
schedule_list = []
@@ -245,7 +245,7 @@
self.generate_schedule()
def on_update(self):
- frappe.db.set(self, "status", "Draft")
+ self.db_set("status", "Draft")
def update_amc_date(self, serial_nos, amc_expiry_date=None):
for serial_no in serial_nos:
@@ -344,7 +344,7 @@
if d.serial_no:
serial_nos = get_valid_serial_nos(d.serial_no)
self.update_amc_date(serial_nos)
- frappe.db.set(self, "status", "Cancelled")
+ self.db_set("status", "Cancelled")
delete_events(self.doctype, self.name)
def on_trash(self):
diff --git a/erpnext/maintenance/doctype/maintenance_visit/maintenance_visit.py b/erpnext/maintenance/doctype/maintenance_visit/maintenance_visit.py
index 66f4426..0d319bf 100644
--- a/erpnext/maintenance/doctype/maintenance_visit/maintenance_visit.py
+++ b/erpnext/maintenance/doctype/maintenance_visit/maintenance_visit.py
@@ -125,12 +125,12 @@
def on_submit(self):
self.update_customer_issue(1)
- frappe.db.set(self, "status", "Submitted")
+ self.db_set("status", "Submitted")
self.update_status_and_actual_date()
def on_cancel(self):
self.check_if_last_visit()
- frappe.db.set(self, "status", "Cancelled")
+ self.db_set("status", "Cancelled")
self.update_status_and_actual_date(cancel=True)
def on_update(self):
diff --git a/erpnext/manufacturing/doctype/bom/bom.py b/erpnext/manufacturing/doctype/bom/bom.py
index ff84991..ca4f63d 100644
--- a/erpnext/manufacturing/doctype/bom/bom.py
+++ b/erpnext/manufacturing/doctype/bom/bom.py
@@ -206,8 +206,8 @@
self.manage_default_bom()
def on_cancel(self):
- frappe.db.set(self, "is_active", 0)
- frappe.db.set(self, "is_default", 0)
+ self.db_set("is_active", 0)
+ self.db_set("is_default", 0)
# check if used in any other bom
self.validate_bom_links()
@@ -385,6 +385,7 @@
if self.docstatus == 2:
return
+ self.flags.cost_updated = False
existing_bom_cost = self.total_cost
if self.docstatus == 1:
@@ -407,7 +408,11 @@
frappe.get_doc("BOM", bom).update_cost(from_child_bom=True)
if not from_child_bom:
- frappe.msgprint(_("Cost Updated"), alert=True)
+ msg = "Cost Updated"
+ if not self.flags.cost_updated:
+ msg = "No changes in cost found"
+
+ frappe.msgprint(_(msg), alert=True)
def update_parent_cost(self):
if self.total_cost:
@@ -444,10 +449,10 @@
not frappe.db.exists(dict(doctype="BOM", docstatus=1, item=self.item, is_default=1))
and self.is_active
):
- frappe.db.set(self, "is_default", 1)
+ self.db_set("is_default", 1)
frappe.db.set_value("Item", self.item, "default_bom", self.name)
else:
- frappe.db.set(self, "is_default", 0)
+ self.db_set("is_default", 0)
item = frappe.get_doc("Item", self.item)
if item.default_bom == self.name:
frappe.db.set_value("Item", self.item, "default_bom", None)
@@ -593,11 +598,16 @@
# not via doc event, table is not regenerated and needs updation
self.calculate_exploded_cost()
+ old_cost = self.total_cost
+
self.total_cost = self.operating_cost + self.raw_material_cost - self.scrap_material_cost
self.base_total_cost = (
self.base_operating_cost + self.base_raw_material_cost - self.base_scrap_material_cost
)
+ if self.total_cost != old_cost:
+ self.flags.cost_updated = True
+
def calculate_op_cost(self, update_hour_rate=False):
"""Update workstation rate and calculates totals"""
self.operating_cost = 0
diff --git a/erpnext/manufacturing/doctype/bom/test_bom.py b/erpnext/manufacturing/doctype/bom/test_bom.py
index 27f3cc9..e34ac12 100644
--- a/erpnext/manufacturing/doctype/bom/test_bom.py
+++ b/erpnext/manufacturing/doctype/bom/test_bom.py
@@ -9,7 +9,10 @@
from frappe.tests.utils import FrappeTestCase
from frappe.utils import cstr, flt
-from erpnext.controllers.tests.test_subcontracting_controller import set_backflush_based_on
+from erpnext.controllers.tests.test_subcontracting_controller import (
+ make_stock_in_entry,
+ set_backflush_based_on,
+)
from erpnext.manufacturing.doctype.bom.bom import BOMRecursionError, item_query, make_variant_bom
from erpnext.manufacturing.doctype.bom_update_log.test_bom_update_log import (
update_cost_in_all_boms_in_test,
@@ -639,6 +642,28 @@
bom.submit()
self.assertEqual(bom.exploded_items[0].rate, bom.items[0].base_rate)
+ def test_bom_cost_update_flag(self):
+ rm_item = make_item(
+ properties={"is_stock_item": 1, "valuation_rate": 99, "last_purchase_rate": 89}
+ ).name
+ fg_item = make_item(properties={"is_stock_item": 1}).name
+
+ from erpnext.manufacturing.doctype.production_plan.test_production_plan import make_bom
+
+ bom = make_bom(item=fg_item, raw_materials=[rm_item])
+
+ create_stock_reconciliation(
+ item_code=rm_item, warehouse="_Test Warehouse - _TC", qty=100, rate=600
+ )
+
+ bom.load_from_db()
+ bom.update_cost()
+ self.assertTrue(bom.flags.cost_updated)
+
+ bom.load_from_db()
+ bom.update_cost()
+ self.assertFalse(bom.flags.cost_updated)
+
def get_default_bom(item_code="_Test FG Item 2"):
return frappe.db.get_value("BOM", {"item": item_code, "is_active": 1, "is_default": 1})
diff --git a/erpnext/manufacturing/doctype/bom_operation/bom_operation.json b/erpnext/manufacturing/doctype/bom_operation/bom_operation.json
index b965a43..5a734d8 100644
--- a/erpnext/manufacturing/doctype/bom_operation/bom_operation.json
+++ b/erpnext/manufacturing/doctype/bom_operation/bom_operation.json
@@ -9,6 +9,7 @@
"sequence_id",
"operation",
"col_break1",
+ "workstation_type",
"workstation",
"time_in_mins",
"fixed_time",
@@ -40,9 +41,9 @@
"reqd": 1
},
{
+ "depends_on": "eval:!doc.workstation_type",
"fieldname": "workstation",
"fieldtype": "Link",
- "in_list_view": 1,
"label": "Workstation",
"oldfieldname": "workstation",
"oldfieldtype": "Link",
@@ -180,13 +181,20 @@
"fieldname": "set_cost_based_on_bom_qty",
"fieldtype": "Check",
"label": "Set Operating Cost Based On BOM Quantity"
+ },
+ {
+ "fieldname": "workstation_type",
+ "fieldtype": "Link",
+ "in_list_view": 1,
+ "label": "Workstation Type",
+ "options": "Workstation Type"
}
],
"idx": 1,
"index_web_pages_for_search": 1,
"istable": 1,
"links": [],
- "modified": "2022-04-08 01:18:33.547481",
+ "modified": "2022-11-04 17:17:16.986941",
"modified_by": "Administrator",
"module": "Manufacturing",
"name": "BOM Operation",
diff --git a/erpnext/manufacturing/doctype/job_card/job_card.json b/erpnext/manufacturing/doctype/job_card/job_card.json
index 5a071f1..8506111 100644
--- a/erpnext/manufacturing/doctype/job_card/job_card.json
+++ b/erpnext/manufacturing/doctype/job_card/job_card.json
@@ -27,11 +27,14 @@
"operation",
"operation_row_number",
"column_break_18",
+ "workstation_type",
"workstation",
"employee",
"section_break_21",
"sub_operations",
"timing_detail",
+ "expected_start_date",
+ "expected_end_date",
"time_logs",
"section_break_13",
"total_completed_qty",
@@ -416,11 +419,27 @@
"fieldtype": "Link",
"label": "Quality Inspection Template",
"options": "Quality Inspection Template"
+ },
+ {
+ "fieldname": "workstation_type",
+ "fieldtype": "Link",
+ "label": "Workstation Type",
+ "options": "Workstation Type"
+ },
+ {
+ "fieldname": "expected_start_date",
+ "fieldtype": "Datetime",
+ "label": "Expected Start Date"
+ },
+ {
+ "fieldname": "expected_end_date",
+ "fieldtype": "Datetime",
+ "label": "Expected End Date"
}
],
"is_submittable": 1,
"links": [],
- "modified": "2021-11-24 19:17:40.879235",
+ "modified": "2022-11-09 15:02:44.490731",
"modified_by": "Administrator",
"module": "Manufacturing",
"name": "Job Card",
@@ -475,6 +494,7 @@
],
"sort_field": "modified",
"sort_order": "DESC",
+ "states": [],
"title_field": "operation",
"track_changes": 1
}
\ No newline at end of file
diff --git a/erpnext/manufacturing/doctype/job_card/job_card.py b/erpnext/manufacturing/doctype/job_card/job_card.py
index ed45106..8226475 100644
--- a/erpnext/manufacturing/doctype/job_card/job_card.py
+++ b/erpnext/manufacturing/doctype/job_card/job_card.py
@@ -2,11 +2,14 @@
# For license information, please see license.txt
import datetime
import json
+from typing import Optional
import frappe
from frappe import _, bold
from frappe.model.document import Document
from frappe.model.mapper import get_mapped_doc
+from frappe.query_builder import Criterion
+from frappe.query_builder.functions import IfNull, Max, Min
from frappe.utils import (
add_days,
add_to_date,
@@ -24,6 +27,7 @@
from erpnext.manufacturing.doctype.manufacturing_settings.manufacturing_settings import (
get_mins_between_operations,
)
+from erpnext.manufacturing.doctype.workstation_type.workstation_type import get_workstations
class OverlapError(frappe.ValidationError):
@@ -54,6 +58,9 @@
self.set_onload("job_card_excess_transfer", excess_transfer)
self.set_onload("work_order_closed", self.is_work_order_closed())
+ def before_validate(self):
+ self.set_wip_warehouse()
+
def validate(self):
self.validate_time_logs()
self.set_status()
@@ -109,49 +116,66 @@
def get_overlap_for(self, args, check_next_available_slot=False):
production_capacity = 1
+ jc = frappe.qb.DocType("Job Card")
+ jctl = frappe.qb.DocType("Job Card Time Log")
+
+ time_conditions = [
+ ((jctl.from_time < args.from_time) & (jctl.to_time > args.from_time)),
+ ((jctl.from_time < args.to_time) & (jctl.to_time > args.to_time)),
+ ((jctl.from_time >= args.from_time) & (jctl.to_time <= args.to_time)),
+ ]
+
+ if check_next_available_slot:
+ time_conditions.append(((jctl.from_time >= args.from_time) & (jctl.to_time >= args.to_time)))
+
+ query = (
+ frappe.qb.from_(jctl)
+ .from_(jc)
+ .select(jc.name.as_("name"), jctl.to_time, jc.workstation, jc.workstation_type)
+ .where(
+ (jctl.parent == jc.name)
+ & (Criterion.any(time_conditions))
+ & (jctl.name != f"{args.name or 'No Name'}")
+ & (jc.name != f"{args.parent or 'No Name'}")
+ & (jc.docstatus < 2)
+ )
+ .orderby(jctl.to_time, order=frappe.qb.desc)
+ )
+
+ if self.workstation_type:
+ query = query.where(jc.workstation_type == self.workstation_type)
+
if self.workstation:
production_capacity = (
frappe.get_cached_value("Workstation", self.workstation, "production_capacity") or 1
)
- validate_overlap_for = " and jc.workstation = %(workstation)s "
+ query = query.where(jc.workstation == self.workstation)
if args.get("employee"):
# override capacity for employee
production_capacity = 1
- validate_overlap_for = " and jctl.employee = %(employee)s "
+ query = query.where(jctl.employee == args.get("employee"))
- extra_cond = ""
- if check_next_available_slot:
- extra_cond = " or (%(from_time)s <= jctl.from_time and %(to_time)s <= jctl.to_time)"
-
- existing = frappe.db.sql(
- """select jc.name as name, jctl.to_time from
- `tabJob Card Time Log` jctl, `tabJob Card` jc where jctl.parent = jc.name and
- (
- (%(from_time)s > jctl.from_time and %(from_time)s < jctl.to_time) or
- (%(to_time)s > jctl.from_time and %(to_time)s < jctl.to_time) or
- (%(from_time)s <= jctl.from_time and %(to_time)s >= jctl.to_time) {0}
- )
- and jctl.name != %(name)s and jc.name != %(parent)s and jc.docstatus < 2 {1}
- order by jctl.to_time desc limit 1""".format(
- extra_cond, validate_overlap_for
- ),
- {
- "from_time": args.from_time,
- "to_time": args.to_time,
- "name": args.name or "No Name",
- "parent": args.parent or "No Name",
- "employee": args.get("employee"),
- "workstation": self.workstation,
- },
- as_dict=True,
- )
+ existing = query.run(as_dict=True)
if existing and production_capacity > len(existing):
return
+ if self.workstation_type:
+ if workstation := self.get_workstation_based_on_available_slot(existing):
+ self.workstation = workstation
+ return None
+
return existing[0] if existing else None
+ def get_workstation_based_on_available_slot(self, existing) -> Optional[str]:
+ workstations = get_workstations(self.workstation_type)
+ if workstations:
+ busy_workstations = [row.workstation for row in existing]
+ for workstation in workstations:
+ if workstation not in busy_workstations:
+ return workstation
+
def schedule_time_logs(self, row):
row.remaining_time_in_mins = row.time_in_mins
while row.remaining_time_in_mins > 0:
@@ -164,6 +188,9 @@
# get the last record based on the to time from the job card
data = self.get_overlap_for(args, check_next_available_slot=True)
if data:
+ if not self.workstation:
+ self.workstation = data.workstation
+
row.planned_start_time = get_datetime(data.to_time + get_mins_between_operations())
def check_workstation_time(self, row):
@@ -485,18 +512,21 @@
)
def update_work_order_data(self, for_quantity, time_in_mins, wo):
- time_data = frappe.db.sql(
- """
- SELECT
- min(from_time) as start_time, max(to_time) as end_time
- FROM `tabJob Card` jc, `tabJob Card Time Log` jctl
- WHERE
- jctl.parent = jc.name and jc.work_order = %s and jc.operation_id = %s
- and jc.docstatus = 1 and IFNULL(jc.is_corrective_job_card, 0) = 0
- """,
- (self.work_order, self.operation_id),
- as_dict=1,
- )
+ jc = frappe.qb.DocType("Job Card")
+ jctl = frappe.qb.DocType("Job Card Time Log")
+
+ time_data = (
+ frappe.qb.from_(jc)
+ .from_(jctl)
+ .select(Min(jctl.from_time).as_("start_time"), Max(jctl.to_time).as_("end_time"))
+ .where(
+ (jctl.parent == jc.name)
+ & (jc.work_order == self.work_order)
+ & (jc.operation_id == self.operation_id)
+ & (jc.docstatus == 1)
+ & (IfNull(jc.is_corrective_job_card, 0) == 0)
+ )
+ ).run(as_dict=True)
for data in wo.operations:
if data.get("name") == self.operation_id:
@@ -639,6 +669,12 @@
if update_status:
self.db_set("status", self.status)
+ def set_wip_warehouse(self):
+ if not self.wip_warehouse:
+ self.wip_warehouse = frappe.db.get_single_value(
+ "Manufacturing Settings", "default_wip_warehouse"
+ )
+
def validate_operation_id(self):
if (
self.get("operation_id")
diff --git a/erpnext/manufacturing/doctype/job_card/test_job_card.py b/erpnext/manufacturing/doctype/job_card/test_job_card.py
index ac71141..4d2dab7 100644
--- a/erpnext/manufacturing/doctype/job_card/test_job_card.py
+++ b/erpnext/manufacturing/doctype/job_card/test_job_card.py
@@ -136,6 +136,45 @@
)
self.assertRaises(OverlapError, jc2.save)
+ def test_job_card_overlap_with_capacity(self):
+ wo2 = make_wo_order_test_record(item="_Test FG Item 2", qty=2)
+
+ workstation = make_workstation(workstation_name=random_string(5)).name
+ frappe.db.set_value("Workstation", workstation, "production_capacity", 1)
+
+ jc1 = frappe.get_last_doc("Job Card", {"work_order": self.work_order.name})
+ jc2 = frappe.get_last_doc("Job Card", {"work_order": wo2.name})
+
+ jc1.workstation = workstation
+ jc1.append(
+ "time_logs",
+ {"from_time": "2021-01-01 00:00:00", "to_time": "2021-01-01 08:00:00", "completed_qty": 1},
+ )
+ jc1.save()
+
+ jc2.workstation = workstation
+
+ # add a new entry in same time slice
+ jc2.append(
+ "time_logs",
+ {"from_time": "2021-01-01 00:01:00", "to_time": "2021-01-01 06:00:00", "completed_qty": 1},
+ )
+ self.assertRaises(OverlapError, jc2.save)
+
+ frappe.db.set_value("Workstation", workstation, "production_capacity", 2)
+ jc2.load_from_db()
+
+ jc2.workstation = workstation
+
+ # add a new entry in same time slice
+ jc2.append(
+ "time_logs",
+ {"from_time": "2021-01-01 00:01:00", "to_time": "2021-01-01 06:00:00", "completed_qty": 1},
+ )
+
+ jc2.save()
+ self.assertTrue(jc2.name)
+
def test_job_card_multiple_materials_transfer(self):
"Test transferring RMs separately against Job Card with multiple RMs."
self.transfer_material_against = "Job Card"
diff --git a/erpnext/manufacturing/doctype/production_plan/production_plan.py b/erpnext/manufacturing/doctype/production_plan/production_plan.py
index 4bb4dcc..caff0a3 100644
--- a/erpnext/manufacturing/doctype/production_plan/production_plan.py
+++ b/erpnext/manufacturing/doctype/production_plan/production_plan.py
@@ -27,6 +27,7 @@
from erpnext.manufacturing.doctype.bom.bom import validate_bom_no
from erpnext.manufacturing.doctype.work_order.work_order import get_item_details
from erpnext.setup.doctype.item_group.item_group import get_item_group_defaults
+from erpnext.stock.get_item_details import get_conversion_factor
from erpnext.utilities.transaction_base import validate_uom_is_integer
@@ -1042,11 +1043,25 @@
if include_safety_stock:
required_qty += flt(row["safety_stock"])
+ item_details = frappe.get_cached_value(
+ "Item", row.item_code, ["purchase_uom", "stock_uom"], as_dict=1
+ )
+
+ conversion_factor = 1.0
+ if (
+ row.get("default_material_request_type") == "Purchase"
+ and item_details.purchase_uom
+ and item_details.purchase_uom != item_details.stock_uom
+ ):
+ conversion_factor = (
+ get_conversion_factor(row.item_code, item_details.purchase_uom).get("conversion_factor") or 1.0
+ )
+
if required_qty > 0:
return {
"item_code": row.item_code,
"item_name": row.item_name,
- "quantity": required_qty,
+ "quantity": required_qty / conversion_factor,
"required_bom_qty": total_qty,
"stock_uom": row.get("stock_uom"),
"warehouse": warehouse
diff --git a/erpnext/manufacturing/doctype/production_plan/test_production_plan.py b/erpnext/manufacturing/doctype/production_plan/test_production_plan.py
index 60e6398..a6d034d 100644
--- a/erpnext/manufacturing/doctype/production_plan/test_production_plan.py
+++ b/erpnext/manufacturing/doctype/production_plan/test_production_plan.py
@@ -806,6 +806,40 @@
self.assertEqual(pln.status, "Completed")
self.assertEqual(pln.po_items[0].produced_qty, 5)
+ def test_material_request_item_for_purchase_uom(self):
+ from erpnext.stock.doctype.item.test_item import make_item
+
+ fg_item = make_item(properties={"is_stock_item": 1, "stock_uom": "_Test UOM 1"}).name
+ bom_item = make_item(
+ properties={"is_stock_item": 1, "stock_uom": "_Test UOM 1", "purchase_uom": "Nos"}
+ ).name
+
+ if not frappe.db.exists("UOM Conversion Detail", {"parent": bom_item, "uom": "Nos"}):
+ doc = frappe.get_doc("Item", bom_item)
+ doc.append("uoms", {"uom": "Nos", "conversion_factor": 10})
+ doc.save()
+
+ make_bom(item=fg_item, raw_materials=[bom_item], source_warehouse="_Test Warehouse - _TC")
+
+ pln = create_production_plan(
+ item_code=fg_item, planned_qty=10, ignore_existing_ordered_qty=1, stock_uom="_Test UOM 1"
+ )
+
+ pln.make_material_request()
+
+ for row in pln.mr_items:
+ self.assertEqual(row.uom, "Nos")
+ self.assertEqual(row.quantity, 1)
+
+ for row in frappe.get_all(
+ "Material Request Item",
+ filters={"production_plan": pln.name},
+ fields=["item_code", "uom", "qty"],
+ ):
+ self.assertEqual(row.item_code, bom_item)
+ self.assertEqual(row.uom, "Nos")
+ self.assertEqual(row.qty, 1)
+
def create_production_plan(**args):
"""
diff --git a/erpnext/manufacturing/doctype/work_order/test_work_order.py b/erpnext/manufacturing/doctype/work_order/test_work_order.py
index a53c42c..694dc79 100644
--- a/erpnext/manufacturing/doctype/work_order/test_work_order.py
+++ b/erpnext/manufacturing/doctype/work_order/test_work_order.py
@@ -5,7 +5,7 @@
import frappe
from frappe.tests.utils import FrappeTestCase, change_settings, timeout
-from frappe.utils import add_days, add_months, cint, flt, now, today
+from frappe.utils import add_days, add_months, add_to_date, cint, flt, now, today
from erpnext.manufacturing.doctype.job_card.job_card import JobCardCancelError
from erpnext.manufacturing.doctype.production_plan.test_production_plan import make_bom
@@ -17,6 +17,7 @@
close_work_order,
make_job_card,
make_stock_entry,
+ make_stock_return_entry,
stop_unstop,
)
from erpnext.selling.doctype.sales_order.test_sales_order import make_sales_order
@@ -1408,6 +1409,237 @@
)
self.assertEqual(manufacture_ste_doc2.items[1].qty, 1)
+ def test_non_consumed_material_return_against_work_order(self):
+ frappe.db.set_value(
+ "Manufacturing Settings",
+ None,
+ "backflush_raw_materials_based_on",
+ "Material Transferred for Manufacture",
+ )
+
+ item = make_item(
+ "Test FG Item To Test Return Case",
+ {
+ "is_stock_item": 1,
+ },
+ )
+
+ item_code = item.name
+ bom_doc = make_bom(
+ item=item_code,
+ source_warehouse="Stores - _TC",
+ raw_materials=["Test Batch MCC Keyboard", "Test Serial No BTT Headphone"],
+ )
+
+ # Create a work order
+ wo_doc = make_wo_order_test_record(production_item=item_code, qty=5)
+ wo_doc.save()
+
+ self.assertEqual(wo_doc.bom_no, bom_doc.name)
+
+ # Transfer material for manufacture
+ ste_doc = frappe.get_doc(make_stock_entry(wo_doc.name, "Material Transfer for Manufacture", 5))
+ for row in ste_doc.items:
+ row.qty += 2
+ row.transfer_qty += 2
+ nste_doc = test_stock_entry.make_stock_entry(
+ item_code=row.item_code, target="Stores - _TC", qty=row.qty, basic_rate=100
+ )
+
+ row.batch_no = nste_doc.items[0].batch_no
+ row.serial_no = nste_doc.items[0].serial_no
+
+ ste_doc.save()
+ ste_doc.submit()
+ ste_doc.load_from_db()
+
+ # Create a stock entry to manufacture the item
+ ste_doc = frappe.get_doc(make_stock_entry(wo_doc.name, "Manufacture", 5))
+ for row in ste_doc.items:
+ if row.s_warehouse and not row.t_warehouse:
+ row.qty -= 2
+ row.transfer_qty -= 2
+
+ if row.serial_no:
+ serial_nos = get_serial_nos(row.serial_no)
+ row.serial_no = "\n".join(serial_nos[0:5])
+
+ ste_doc.save()
+ ste_doc.submit()
+
+ wo_doc.load_from_db()
+ for row in wo_doc.required_items:
+ self.assertEqual(row.transferred_qty, 7)
+ self.assertEqual(row.consumed_qty, 5)
+
+ self.assertEqual(wo_doc.status, "Completed")
+ return_ste_doc = make_stock_return_entry(wo_doc.name)
+ return_ste_doc.save()
+
+ self.assertTrue(return_ste_doc.is_return)
+ for row in return_ste_doc.items:
+ self.assertEqual(row.qty, 2)
+
+ def test_workstation_type_for_work_order(self):
+ prepare_data_for_workstation_type_check()
+
+ workstation_types = ["Workstation Type 1", "Workstation Type 2", "Workstation Type 3"]
+ planned_start_date = "2022-11-14 10:00:00"
+
+ wo_order = make_wo_order_test_record(
+ item="Test FG Item For Workstation Type", planned_start_date=planned_start_date, qty=2
+ )
+
+ job_cards = frappe.get_all(
+ "Job Card",
+ fields=[
+ "`tabJob Card`.`name`",
+ "`tabJob Card`.`workstation_type`",
+ "`tabJob Card`.`workstation`",
+ "`tabJob Card Time Log`.`from_time`",
+ "`tabJob Card Time Log`.`to_time`",
+ "`tabJob Card Time Log`.`time_in_mins`",
+ ],
+ filters=[
+ ["Job Card", "work_order", "=", wo_order.name],
+ ["Job Card Time Log", "docstatus", "=", 1],
+ ],
+ order_by="`tabJob Card`.`creation` desc",
+ )
+
+ workstations_to_check = ["Workstation 1", "Workstation 3", "Workstation 5"]
+ for index, row in enumerate(job_cards):
+ if index != 0:
+ planned_start_date = add_to_date(planned_start_date, minutes=40)
+
+ self.assertEqual(row.workstation_type, workstation_types[index])
+ self.assertEqual(row.from_time, planned_start_date)
+ self.assertEqual(row.to_time, add_to_date(planned_start_date, minutes=30))
+ self.assertEqual(row.workstation, workstations_to_check[index])
+
+ planned_start_date = "2022-11-14 10:00:00"
+
+ wo_order = make_wo_order_test_record(
+ item="Test FG Item For Workstation Type", planned_start_date=planned_start_date, qty=2
+ )
+
+ job_cards = frappe.get_all(
+ "Job Card",
+ fields=[
+ "`tabJob Card`.`name`",
+ "`tabJob Card`.`workstation_type`",
+ "`tabJob Card`.`workstation`",
+ "`tabJob Card Time Log`.`from_time`",
+ "`tabJob Card Time Log`.`to_time`",
+ "`tabJob Card Time Log`.`time_in_mins`",
+ ],
+ filters=[
+ ["Job Card", "work_order", "=", wo_order.name],
+ ["Job Card Time Log", "docstatus", "=", 1],
+ ],
+ order_by="`tabJob Card`.`creation` desc",
+ )
+
+ workstations_to_check = ["Workstation 2", "Workstation 4", "Workstation 6"]
+ for index, row in enumerate(job_cards):
+ if index != 0:
+ planned_start_date = add_to_date(planned_start_date, minutes=40)
+
+ self.assertEqual(row.workstation_type, workstation_types[index])
+ self.assertEqual(row.from_time, planned_start_date)
+ self.assertEqual(row.to_time, add_to_date(planned_start_date, minutes=30))
+ self.assertEqual(row.workstation, workstations_to_check[index])
+
+
+def prepare_data_for_workstation_type_check():
+ from erpnext.manufacturing.doctype.operation.test_operation import make_operation
+ from erpnext.manufacturing.doctype.workstation.test_workstation import make_workstation
+ from erpnext.manufacturing.doctype.workstation_type.test_workstation_type import (
+ create_workstation_type,
+ )
+
+ workstation_types = ["Workstation Type 1", "Workstation Type 2", "Workstation Type 3"]
+ for workstation_type in workstation_types:
+ create_workstation_type(workstation_type=workstation_type)
+
+ operations = ["Cutting", "Sewing", "Packing"]
+ for operation in operations:
+ make_operation(
+ {
+ "operation": operation,
+ }
+ )
+
+ workstations = [
+ {
+ "workstation": "Workstation 1",
+ "workstation_type": "Workstation Type 1",
+ },
+ {
+ "workstation": "Workstation 2",
+ "workstation_type": "Workstation Type 1",
+ },
+ {
+ "workstation": "Workstation 3",
+ "workstation_type": "Workstation Type 2",
+ },
+ {
+ "workstation": "Workstation 4",
+ "workstation_type": "Workstation Type 2",
+ },
+ {
+ "workstation": "Workstation 5",
+ "workstation_type": "Workstation Type 3",
+ },
+ {
+ "workstation": "Workstation 6",
+ "workstation_type": "Workstation Type 3",
+ },
+ ]
+
+ for row in workstations:
+ make_workstation(row)
+
+ fg_item = make_item(
+ "Test FG Item For Workstation Type",
+ {
+ "is_stock_item": 1,
+ },
+ )
+
+ rm_item = make_item(
+ "Test RM Item For Workstation Type",
+ {
+ "is_stock_item": 1,
+ },
+ )
+
+ if not frappe.db.exists("BOM", {"item": fg_item.name}):
+ bom_doc = make_bom(
+ item=fg_item.name,
+ source_warehouse="Stores - _TC",
+ raw_materials=[rm_item.name],
+ do_not_submit=True,
+ )
+
+ submit_bom = False
+ for index, operation in enumerate(operations):
+ if not frappe.db.exists("BOM Operation", {"parent": bom_doc.name, "operation": operation}):
+ bom_doc.append(
+ "operations",
+ {
+ "operation": operation,
+ "time_in_mins": 30,
+ "hour_rate": 100,
+ "workstation_type": workstation_types[index],
+ },
+ )
+
+ submit_bom = True
+
+ if submit_bom:
+ bom_doc.submit()
+
def prepare_data_for_backflush_based_on_materials_transferred():
batch_item_doc = make_item(
diff --git a/erpnext/manufacturing/doctype/work_order/work_order.js b/erpnext/manufacturing/doctype/work_order/work_order.js
index f3640b9..4aff42c 100644
--- a/erpnext/manufacturing/doctype/work_order/work_order.js
+++ b/erpnext/manufacturing/doctype/work_order/work_order.js
@@ -180,6 +180,37 @@
frm.trigger("make_bom");
});
}
+
+ frm.trigger("add_custom_button_to_return_components");
+ },
+
+ add_custom_button_to_return_components: function(frm) {
+ if (frm.doc.docstatus === 1 && in_list(["Closed", "Completed"], frm.doc.status)) {
+ let non_consumed_items = frm.doc.required_items.filter(d =>{
+ return flt(d.consumed_qty) < flt(d.transferred_qty - d.returned_qty)
+ });
+
+ if (non_consumed_items && non_consumed_items.length) {
+ frm.add_custom_button(__("Return Components"), function() {
+ frm.trigger("create_stock_return_entry");
+ }).addClass("btn-primary");
+ }
+ }
+ },
+
+ create_stock_return_entry: function(frm) {
+ frappe.call({
+ method: "erpnext.manufacturing.doctype.work_order.work_order.make_stock_return_entry",
+ args: {
+ "work_order": frm.doc.name,
+ },
+ callback: function(r) {
+ if(!r.exc) {
+ let doc = frappe.model.sync(r.message);
+ frappe.set_route("Form", doc[0].doctype, doc[0].name);
+ }
+ }
+ });
},
make_job_card: function(frm) {
@@ -415,7 +446,6 @@
frm.fields_dict.required_items.grid.toggle_reqd("source_warehouse", true);
frm.toggle_reqd("transfer_material_against",
frm.doc.operations && frm.doc.operations.length > 0);
- frm.fields_dict.operations.grid.toggle_reqd("workstation", frm.doc.operations);
},
set_sales_order: function(frm) {
@@ -517,7 +547,8 @@
erpnext.work_order = {
set_custom_buttons: function(frm) {
var doc = frm.doc;
- if (doc.docstatus === 1 && doc.status != "Closed") {
+
+ if (doc.status !== "Closed") {
frm.add_custom_button(__('Close'), function() {
frappe.confirm(__("Once the Work Order is Closed. It can't be resumed."),
() => {
@@ -525,7 +556,9 @@
}
);
}, __("Status"));
+ }
+ if (doc.docstatus === 1 && !in_list(["Closed", "Completed"], doc.status)) {
if (doc.status != 'Stopped' && doc.status != 'Completed') {
frm.add_custom_button(__('Stop'), function() {
erpnext.work_order.change_work_order_status(frm, "Stopped");
@@ -555,66 +588,69 @@
}
}
- if(!frm.doc.skip_transfer){
+ if (frm.doc.status != 'Stopped') {
// If "Material Consumption is check in Manufacturing Settings, allow Material Consumption
- if (flt(doc.material_transferred_for_manufacturing) > 0 && frm.doc.status != 'Stopped') {
- if ((flt(doc.produced_qty) < flt(doc.material_transferred_for_manufacturing))) {
- frm.has_finish_btn = true;
-
- if (frm.doc.__onload && frm.doc.__onload.material_consumption == 1) {
- // Only show "Material Consumption" when required_qty > consumed_qty
- var counter = 0;
- var tbl = frm.doc.required_items || [];
- var tbl_lenght = tbl.length;
- for (var i = 0, len = tbl_lenght; i < len; i++) {
- let wo_item_qty = frm.doc.required_items[i].transferred_qty || frm.doc.required_items[i].required_qty;
- if (flt(wo_item_qty) > flt(frm.doc.required_items[i].consumed_qty)) {
- counter += 1;
- }
- }
- if (counter > 0) {
- var consumption_btn = frm.add_custom_button(__('Material Consumption'), function() {
- const backflush_raw_materials_based_on = frm.doc.__onload.backflush_raw_materials_based_on;
- erpnext.work_order.make_consumption_se(frm, backflush_raw_materials_based_on);
- });
- consumption_btn.addClass('btn-primary');
+ if (frm.doc.__onload && frm.doc.__onload.material_consumption == 1) {
+ if (flt(doc.material_transferred_for_manufacturing) > 0 || frm.doc.skip_transfer) {
+ // Only show "Material Consumption" when required_qty > consumed_qty
+ var counter = 0;
+ var tbl = frm.doc.required_items || [];
+ var tbl_lenght = tbl.length;
+ for (var i = 0, len = tbl_lenght; i < len; i++) {
+ let wo_item_qty = frm.doc.required_items[i].transferred_qty || frm.doc.required_items[i].required_qty;
+ if (flt(wo_item_qty) > flt(frm.doc.required_items[i].consumed_qty)) {
+ counter += 1;
}
}
+ if (counter > 0) {
+ var consumption_btn = frm.add_custom_button(__('Material Consumption'), function() {
+ const backflush_raw_materials_based_on = frm.doc.__onload.backflush_raw_materials_based_on;
+ erpnext.work_order.make_consumption_se(frm, backflush_raw_materials_based_on);
+ });
+ consumption_btn.addClass('btn-primary');
+ }
+ }
+ }
+ if(!frm.doc.skip_transfer){
+ if (flt(doc.material_transferred_for_manufacturing) > 0) {
+ if ((flt(doc.produced_qty) < flt(doc.material_transferred_for_manufacturing))) {
+ frm.has_finish_btn = true;
+
+ var finish_btn = frm.add_custom_button(__('Finish'), function() {
+ erpnext.work_order.make_se(frm, 'Manufacture');
+ });
+
+ if(doc.material_transferred_for_manufacturing>=doc.qty) {
+ // all materials transferred for manufacturing, make this primary
+ finish_btn.addClass('btn-primary');
+ }
+ } else {
+ frappe.db.get_doc("Manufacturing Settings").then((doc) => {
+ let allowance_percentage = doc.overproduction_percentage_for_work_order;
+
+ if (allowance_percentage > 0) {
+ let allowed_qty = frm.doc.qty + ((allowance_percentage / 100) * frm.doc.qty);
+
+ if ((flt(doc.produced_qty) < allowed_qty)) {
+ frm.add_custom_button(__('Finish'), function() {
+ erpnext.work_order.make_se(frm, 'Manufacture');
+ });
+ }
+ }
+ });
+ }
+ }
+ } else {
+ if ((flt(doc.produced_qty) < flt(doc.qty))) {
var finish_btn = frm.add_custom_button(__('Finish'), function() {
erpnext.work_order.make_se(frm, 'Manufacture');
});
-
- if(doc.material_transferred_for_manufacturing>=doc.qty) {
- // all materials transferred for manufacturing, make this primary
- finish_btn.addClass('btn-primary');
- }
- } else {
- frappe.db.get_doc("Manufacturing Settings").then((doc) => {
- let allowance_percentage = doc.overproduction_percentage_for_work_order;
-
- if (allowance_percentage > 0) {
- let allowed_qty = frm.doc.qty + ((allowance_percentage / 100) * frm.doc.qty);
-
- if ((flt(doc.produced_qty) < allowed_qty)) {
- frm.add_custom_button(__('Finish'), function() {
- erpnext.work_order.make_se(frm, 'Manufacture');
- });
- }
- }
- });
+ finish_btn.addClass('btn-primary');
}
}
- } else {
- if ((flt(doc.produced_qty) < flt(doc.qty)) && frm.doc.status != 'Stopped') {
- var finish_btn = frm.add_custom_button(__('Finish'), function() {
- erpnext.work_order.make_se(frm, 'Manufacture');
- });
- finish_btn.addClass('btn-primary');
- }
}
}
-
},
calculate_cost: function(doc) {
if (doc.operations){
diff --git a/erpnext/manufacturing/doctype/work_order/work_order.py b/erpnext/manufacturing/doctype/work_order/work_order.py
index 7b86253..52753a0 100644
--- a/erpnext/manufacturing/doctype/work_order/work_order.py
+++ b/erpnext/manufacturing/doctype/work_order/work_order.py
@@ -20,6 +20,7 @@
nowdate,
time_diff_in_hours,
)
+from pypika import functions as fn
from erpnext.manufacturing.doctype.bom.bom import (
get_bom_item_rate,
@@ -86,11 +87,18 @@
self.validate_transfer_against()
self.validate_operation_time()
self.status = self.get_status()
+ self.validate_workstation_type()
validate_uom_is_integer(self, "stock_uom", ["qty", "produced_qty"])
self.set_required_items(reset_only_qty=len(self.get("required_items")))
+ def validate_workstation_type(self):
+ for row in self.operations:
+ if not row.workstation and not row.workstation_type:
+ msg = f"Row {row.idx}: Workstation or Workstation Type is mandatory for an operation {row.operation}"
+ frappe.throw(_(msg))
+
def validate_sales_order(self):
if self.sales_order:
self.check_sales_order_on_hold_or_close()
@@ -145,7 +153,7 @@
frappe.throw(_("Sales Order {0} is {1}").format(self.sales_order, status))
def set_default_warehouse(self):
- if not self.wip_warehouse:
+ if not self.wip_warehouse and not self.skip_transfer:
self.wip_warehouse = frappe.db.get_single_value(
"Manufacturing Settings", "default_wip_warehouse"
)
@@ -372,7 +380,7 @@
def on_cancel(self):
self.validate_cancel()
- frappe.db.set(self, "status", "Cancelled")
+ self.db_set("status", "Cancelled")
if self.production_plan and frappe.db.exists(
"Production Plan Item Reference", {"parent": self.production_plan}
@@ -490,11 +498,6 @@
def prepare_data_for_job_card(self, row, index, plan_days, enable_capacity_planning):
self.set_operation_start_end_time(index, row)
- if not row.workstation:
- frappe.throw(
- _("Row {0}: select the workstation against the operation {1}").format(row.idx, row.operation)
- )
-
original_start_time = row.planned_start_time
job_card_doc = create_job_card(
self, row, auto_create=True, enable_capacity_planning=enable_capacity_planning
@@ -661,6 +664,7 @@
"description",
"workstation",
"idx",
+ "workstation_type",
"base_hour_rate as hour_rate",
"time_in_mins",
"parent as bom",
@@ -859,6 +863,7 @@
if self.docstatus == 1:
# calculate transferred qty based on submitted stock entries
self.update_transferred_qty_for_required_items()
+ self.update_returned_qty()
# update in bin
self.update_reserved_qty_for_production()
@@ -930,23 +935,62 @@
self.set_available_qty()
def update_transferred_qty_for_required_items(self):
- """update transferred qty from submitted stock entries for that item against
- the work order"""
+ ste = frappe.qb.DocType("Stock Entry")
+ ste_child = frappe.qb.DocType("Stock Entry Detail")
- for d in self.required_items:
- transferred_qty = frappe.db.sql(
- """select sum(qty)
- from `tabStock Entry` entry, `tabStock Entry Detail` detail
- where
- entry.work_order = %(name)s
- and entry.purpose = 'Material Transfer for Manufacture'
- and entry.docstatus = 1
- and detail.parent = entry.name
- and (detail.item_code = %(item)s or detail.original_item = %(item)s)""",
- {"name": self.name, "item": d.item_code},
- )[0][0]
+ query = (
+ frappe.qb.from_(ste)
+ .inner_join(ste_child)
+ .on((ste_child.parent == ste.name))
+ .select(
+ ste_child.item_code,
+ ste_child.original_item,
+ fn.Sum(ste_child.qty).as_("qty"),
+ )
+ .where(
+ (ste.docstatus == 1)
+ & (ste.work_order == self.name)
+ & (ste.purpose == "Material Transfer for Manufacture")
+ & (ste.is_return == 0)
+ )
+ .groupby(ste_child.item_code)
+ )
- d.db_set("transferred_qty", flt(transferred_qty), update_modified=False)
+ data = query.run(as_dict=1) or []
+ transferred_items = frappe._dict({d.original_item or d.item_code: d.qty for d in data})
+
+ for row in self.required_items:
+ row.db_set(
+ "transferred_qty", (transferred_items.get(row.item_code) or 0.0), update_modified=False
+ )
+
+ def update_returned_qty(self):
+ ste = frappe.qb.DocType("Stock Entry")
+ ste_child = frappe.qb.DocType("Stock Entry Detail")
+
+ query = (
+ frappe.qb.from_(ste)
+ .inner_join(ste_child)
+ .on((ste_child.parent == ste.name))
+ .select(
+ ste_child.item_code,
+ ste_child.original_item,
+ fn.Sum(ste_child.qty).as_("qty"),
+ )
+ .where(
+ (ste.docstatus == 1)
+ & (ste.work_order == self.name)
+ & (ste.purpose == "Material Transfer for Manufacture")
+ & (ste.is_return == 1)
+ )
+ .groupby(ste_child.item_code)
+ )
+
+ data = query.run(as_dict=1) or []
+ returned_dict = frappe._dict({d.original_item or d.item_code: d.qty for d in data})
+
+ for row in self.required_items:
+ row.db_set("returned_qty", (returned_dict.get(row.item_code) or 0.0), update_modified=False)
def update_consumed_qty_for_required_items(self):
"""
@@ -1357,6 +1401,7 @@
doc.update(
{
"work_order": work_order.name,
+ "workstation_type": row.get("workstation_type"),
"operation": row.get("operation"),
"workstation": row.get("workstation"),
"posting_date": nowdate(),
@@ -1470,3 +1515,25 @@
)
)
).run()[0][0] or 0.0
+
+
+@frappe.whitelist()
+def make_stock_return_entry(work_order):
+ from erpnext.stock.doctype.stock_entry.stock_entry import get_available_materials
+
+ non_consumed_items = get_available_materials(work_order)
+ if not non_consumed_items:
+ return
+
+ wo_doc = frappe.get_cached_doc("Work Order", work_order)
+
+ stock_entry = frappe.new_doc("Stock Entry")
+ stock_entry.from_bom = 1
+ stock_entry.is_return = 1
+ stock_entry.work_order = work_order
+ stock_entry.purpose = "Material Transfer for Manufacture"
+ stock_entry.bom_no = wo_doc.bom_no
+ stock_entry.add_transfered_raw_materials_in_items()
+ stock_entry.set_stock_entry_type()
+
+ return stock_entry
diff --git a/erpnext/manufacturing/doctype/work_order_item/work_order_item.json b/erpnext/manufacturing/doctype/work_order_item/work_order_item.json
index 3acf572..f354d45 100644
--- a/erpnext/manufacturing/doctype/work_order_item/work_order_item.json
+++ b/erpnext/manufacturing/doctype/work_order_item/work_order_item.json
@@ -20,6 +20,7 @@
"column_break_11",
"transferred_qty",
"consumed_qty",
+ "returned_qty",
"available_qty_at_source_warehouse",
"available_qty_at_wip_warehouse"
],
@@ -97,6 +98,7 @@
"fieldtype": "Column Break"
},
{
+ "columns": 1,
"depends_on": "eval:!parent.skip_transfer",
"fieldname": "consumed_qty",
"fieldtype": "Float",
@@ -127,11 +129,19 @@
"fieldtype": "Currency",
"label": "Amount",
"read_only": 1
+ },
+ {
+ "columns": 1,
+ "fieldname": "returned_qty",
+ "fieldtype": "Float",
+ "in_list_view": 1,
+ "label": "Returned Qty ",
+ "read_only": 1
}
],
"istable": 1,
"links": [],
- "modified": "2020-04-13 18:46:32.966416",
+ "modified": "2022-09-28 10:50:43.512562",
"modified_by": "Administrator",
"module": "Manufacturing",
"name": "Work Order Item",
@@ -140,5 +150,6 @@
"quick_entry": 1,
"sort_field": "modified",
"sort_order": "DESC",
+ "states": [],
"track_changes": 1
}
\ No newline at end of file
diff --git a/erpnext/manufacturing/doctype/work_order_operation/work_order_operation.json b/erpnext/manufacturing/doctype/work_order_operation/work_order_operation.json
index 4e1a464..31b9201 100644
--- a/erpnext/manufacturing/doctype/work_order_operation/work_order_operation.json
+++ b/erpnext/manufacturing/doctype/work_order_operation/work_order_operation.json
@@ -10,6 +10,7 @@
"completed_qty",
"column_break_4",
"bom",
+ "workstation_type",
"workstation",
"sequence_id",
"section_break_10",
@@ -196,12 +197,18 @@
{
"fieldname": "section_break_10",
"fieldtype": "Section Break"
+ },
+ {
+ "fieldname": "workstation_type",
+ "fieldtype": "Link",
+ "label": "Workstation Type",
+ "options": "Workstation Type"
}
],
"index_web_pages_for_search": 1,
"istable": 1,
"links": [],
- "modified": "2021-11-29 16:37:18.824489",
+ "modified": "2022-11-09 01:37:56.563068",
"modified_by": "Administrator",
"module": "Manufacturing",
"name": "Work Order Operation",
@@ -209,5 +216,6 @@
"permissions": [],
"sort_field": "modified",
"sort_order": "DESC",
+ "states": [],
"track_changes": 1
}
\ No newline at end of file
diff --git a/erpnext/manufacturing/doctype/workstation/test_workstation.py b/erpnext/manufacturing/doctype/workstation/test_workstation.py
index 6db985c..1eb47ae 100644
--- a/erpnext/manufacturing/doctype/workstation/test_workstation.py
+++ b/erpnext/manufacturing/doctype/workstation/test_workstation.py
@@ -107,6 +107,7 @@
doc = frappe.get_doc({"doctype": "Workstation", "workstation_name": workstation_name})
doc.hour_rate_rent = args.get("hour_rate_rent")
doc.hour_rate_labour = args.get("hour_rate_labour")
+ doc.workstation_type = args.get("workstation_type")
doc.insert()
return doc
diff --git a/erpnext/manufacturing/doctype/workstation/workstation.js b/erpnext/manufacturing/doctype/workstation/workstation.js
index 5b9cedb..f830b17 100644
--- a/erpnext/manufacturing/doctype/workstation/workstation.js
+++ b/erpnext/manufacturing/doctype/workstation/workstation.js
@@ -2,7 +2,7 @@
// License: GNU General Public License v3. See license.txt
frappe.ui.form.on("Workstation", {
- onload: function(frm) {
+ onload(frm) {
if(frm.is_new())
{
frappe.call({
@@ -15,6 +15,18 @@
}
})
}
+ },
+
+ workstation_type(frm) {
+ if (frm.doc.workstation_type) {
+ frm.call({
+ method: "set_data_based_on_workstation_type",
+ doc: frm.doc,
+ callback: function(r) {
+ frm.refresh_fields();
+ }
+ })
+ }
}
});
diff --git a/erpnext/manufacturing/doctype/workstation/workstation.json b/erpnext/manufacturing/doctype/workstation/workstation.json
index d130391..881cba0 100644
--- a/erpnext/manufacturing/doctype/workstation/workstation.json
+++ b/erpnext/manufacturing/doctype/workstation/workstation.json
@@ -1,26 +1,30 @@
{
+ "actions": [],
"allow_import": 1,
"allow_rename": 1,
"autoname": "field:workstation_name",
"creation": "2013-01-10 16:34:17",
"doctype": "DocType",
"document_type": "Setup",
+ "engine": "InnoDB",
"field_order": [
"workstation_name",
"production_capacity",
"column_break_3",
+ "workstation_type",
"over_heads",
"hour_rate_electricity",
"hour_rate_consumable",
"column_break_11",
"hour_rate_rent",
"hour_rate_labour",
+ "section_break_11",
"hour_rate",
+ "workstaion_description",
+ "description",
"working_hours_section",
"holiday_list",
- "working_hours",
- "workstaion_description",
- "description"
+ "working_hours"
],
"fields": [
{
@@ -44,7 +48,7 @@
},
{
"fieldname": "over_heads",
- "fieldtype": "Section Break",
+ "fieldtype": "Tab Break",
"label": "Operating Costs",
"oldfieldtype": "Section Break"
},
@@ -99,7 +103,7 @@
},
{
"fieldname": "working_hours_section",
- "fieldtype": "Section Break",
+ "fieldtype": "Tab Break",
"label": "Working Hours"
},
{
@@ -128,16 +132,29 @@
{
"collapsible": 1,
"fieldname": "workstaion_description",
- "fieldtype": "Section Break",
+ "fieldtype": "Tab Break",
"label": "Description"
+ },
+ {
+ "bold": 1,
+ "fieldname": "workstation_type",
+ "fieldtype": "Link",
+ "label": "Workstation Type",
+ "options": "Workstation Type"
+ },
+ {
+ "fieldname": "section_break_11",
+ "fieldtype": "Section Break"
}
],
"icon": "icon-wrench",
"idx": 1,
- "modified": "2019-11-26 12:39:19.742052",
+ "links": [],
+ "modified": "2022-11-04 17:39:01.549346",
"modified_by": "Administrator",
"module": "Manufacturing",
"name": "Workstation",
+ "naming_rule": "By fieldname",
"owner": "Administrator",
"permissions": [
{
@@ -154,6 +171,8 @@
],
"quick_entry": 1,
"show_name_in_global_search": 1,
+ "sort_field": "modified",
"sort_order": "ASC",
+ "states": [],
"track_changes": 1
}
\ No newline at end of file
diff --git a/erpnext/manufacturing/doctype/workstation/workstation.py b/erpnext/manufacturing/doctype/workstation/workstation.py
index 59e5318..d5b6d37 100644
--- a/erpnext/manufacturing/doctype/workstation/workstation.py
+++ b/erpnext/manufacturing/doctype/workstation/workstation.py
@@ -32,7 +32,11 @@
class Workstation(Document):
- def validate(self):
+ def before_save(self):
+ self.set_data_based_on_workstation_type()
+ self.set_hour_rate()
+
+ def set_hour_rate(self):
self.hour_rate = (
flt(self.hour_rate_labour)
+ flt(self.hour_rate_electricity)
@@ -40,6 +44,30 @@
+ flt(self.hour_rate_rent)
)
+ @frappe.whitelist()
+ def set_data_based_on_workstation_type(self):
+ if self.workstation_type:
+ fields = [
+ "hour_rate_labour",
+ "hour_rate_electricity",
+ "hour_rate_consumable",
+ "hour_rate_rent",
+ "hour_rate",
+ "description",
+ ]
+
+ data = frappe.get_cached_value("Workstation Type", self.workstation_type, fields, as_dict=True)
+
+ if not data:
+ return
+
+ for field in fields:
+ if self.get(field):
+ continue
+
+ if value := data.get(field):
+ self.set(field, value)
+
def on_update(self):
self.validate_overlap_for_operation_timings()
self.update_bom_operation()
@@ -100,9 +128,7 @@
def check_if_within_operating_hours(workstation, operation, from_datetime, to_datetime):
if from_datetime and to_datetime:
- if not cint(
- frappe.db.get_value("Manufacturing Settings", "None", "allow_production_on_holidays")
- ):
+ if not frappe.db.get_single_value("Manufacturing Settings", "allow_production_on_holidays"):
check_workstation_for_holiday(workstation, from_datetime, to_datetime)
if not cint(frappe.db.get_value("Manufacturing Settings", None, "allow_overtime")):
diff --git a/erpnext/manufacturing/doctype/workstation_type/__init__.py b/erpnext/manufacturing/doctype/workstation_type/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/erpnext/manufacturing/doctype/workstation_type/__init__.py
diff --git a/erpnext/manufacturing/doctype/workstation_type/test_workstation_type.py b/erpnext/manufacturing/doctype/workstation_type/test_workstation_type.py
new file mode 100644
index 0000000..aa7a3ee
--- /dev/null
+++ b/erpnext/manufacturing/doctype/workstation_type/test_workstation_type.py
@@ -0,0 +1,21 @@
+# Copyright (c) 2022, Frappe Technologies Pvt. Ltd. and Contributors
+# See license.txt
+
+import frappe
+from frappe.tests.utils import FrappeTestCase
+
+
+class TestWorkstationType(FrappeTestCase):
+ pass
+
+
+def create_workstation_type(**args):
+ args = frappe._dict(args)
+
+ if workstation_type := frappe.db.exists("Workstation Type", args.workstation_type):
+ return frappe.get_doc("Workstation Type", workstation_type)
+ else:
+ doc = frappe.new_doc("Workstation Type")
+ doc.update(args)
+ doc.insert()
+ return doc
diff --git a/erpnext/manufacturing/doctype/workstation_type/workstation_type.js b/erpnext/manufacturing/doctype/workstation_type/workstation_type.js
new file mode 100644
index 0000000..419fa6c
--- /dev/null
+++ b/erpnext/manufacturing/doctype/workstation_type/workstation_type.js
@@ -0,0 +1,8 @@
+// Copyright (c) 2022, Frappe Technologies Pvt. Ltd. and contributors
+// For license information, please see license.txt
+
+frappe.ui.form.on('Workstation Type', {
+ // refresh: function(frm) {
+
+ // }
+});
diff --git a/erpnext/manufacturing/doctype/workstation_type/workstation_type.json b/erpnext/manufacturing/doctype/workstation_type/workstation_type.json
new file mode 100644
index 0000000..7d9e36a
--- /dev/null
+++ b/erpnext/manufacturing/doctype/workstation_type/workstation_type.json
@@ -0,0 +1,133 @@
+{
+ "actions": [],
+ "allow_import": 1,
+ "allow_rename": 1,
+ "autoname": "field:workstation_type",
+ "creation": "2022-11-04 17:03:23.334818",
+ "default_view": "List",
+ "doctype": "DocType",
+ "document_type": "Setup",
+ "engine": "InnoDB",
+ "field_order": [
+ "workstation_type",
+ "over_heads",
+ "hour_rate_electricity",
+ "hour_rate_consumable",
+ "column_break_5",
+ "hour_rate_rent",
+ "hour_rate_labour",
+ "section_break_8",
+ "hour_rate",
+ "description_tab",
+ "description"
+ ],
+ "fields": [
+ {
+ "fieldname": "workstation_type",
+ "fieldtype": "Data",
+ "in_list_view": 1,
+ "label": "Workstation Type",
+ "oldfieldname": "workstation_name",
+ "oldfieldtype": "Data",
+ "reqd": 1,
+ "unique": 1
+ },
+ {
+ "fieldname": "over_heads",
+ "fieldtype": "Section Break",
+ "label": "Operating Costs",
+ "oldfieldtype": "Section Break"
+ },
+ {
+ "description": "per hour",
+ "fieldname": "hour_rate_electricity",
+ "fieldtype": "Currency",
+ "label": "Electricity Cost",
+ "oldfieldname": "hour_rate_electricity",
+ "oldfieldtype": "Currency"
+ },
+ {
+ "description": "per hour",
+ "fieldname": "hour_rate_consumable",
+ "fieldtype": "Currency",
+ "label": "Consumable Cost",
+ "oldfieldname": "hour_rate_consumable",
+ "oldfieldtype": "Currency"
+ },
+ {
+ "description": "per hour",
+ "fieldname": "hour_rate_rent",
+ "fieldtype": "Currency",
+ "label": "Rent Cost",
+ "oldfieldname": "hour_rate_rent",
+ "oldfieldtype": "Currency"
+ },
+ {
+ "description": "Wages per hour",
+ "fieldname": "hour_rate_labour",
+ "fieldtype": "Currency",
+ "label": "Wages",
+ "oldfieldname": "hour_rate_labour",
+ "oldfieldtype": "Currency"
+ },
+ {
+ "description": "per hour",
+ "fieldname": "hour_rate",
+ "fieldtype": "Currency",
+ "label": "Net Hour Rate",
+ "oldfieldname": "hour_rate",
+ "oldfieldtype": "Currency",
+ "read_only": 1
+ },
+ {
+ "fieldname": "description",
+ "fieldtype": "Small Text",
+ "in_list_view": 1,
+ "label": "Description",
+ "oldfieldname": "description",
+ "oldfieldtype": "Text",
+ "width": "300px"
+ },
+ {
+ "fieldname": "column_break_5",
+ "fieldtype": "Column Break"
+ },
+ {
+ "collapsible": 1,
+ "fieldname": "description_tab",
+ "fieldtype": "Tab Break",
+ "label": "Description"
+ },
+ {
+ "fieldname": "section_break_8",
+ "fieldtype": "Section Break"
+ }
+ ],
+ "icon": "icon-wrench",
+ "links": [],
+ "modified": "2022-11-16 23:11:36.224249",
+ "modified_by": "Administrator",
+ "module": "Manufacturing",
+ "name": "Workstation Type",
+ "naming_rule": "By fieldname",
+ "owner": "Administrator",
+ "permissions": [
+ {
+ "create": 1,
+ "delete": 1,
+ "email": 1,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "Manufacturing User",
+ "share": 1,
+ "write": 1
+ }
+ ],
+ "quick_entry": 1,
+ "show_name_in_global_search": 1,
+ "sort_field": "modified",
+ "sort_order": "ASC",
+ "states": [],
+ "track_changes": 1
+}
\ No newline at end of file
diff --git a/erpnext/manufacturing/doctype/workstation_type/workstation_type.py b/erpnext/manufacturing/doctype/workstation_type/workstation_type.py
new file mode 100644
index 0000000..348f4f8
--- /dev/null
+++ b/erpnext/manufacturing/doctype/workstation_type/workstation_type.py
@@ -0,0 +1,25 @@
+# Copyright (c) 2022, Frappe Technologies Pvt. Ltd. and contributors
+# For license information, please see license.txt
+
+import frappe
+from frappe.model.document import Document
+from frappe.utils import flt
+
+
+class WorkstationType(Document):
+ def before_save(self):
+ self.set_hour_rate()
+
+ def set_hour_rate(self):
+ self.hour_rate = (
+ flt(self.hour_rate_labour)
+ + flt(self.hour_rate_electricity)
+ + flt(self.hour_rate_consumable)
+ + flt(self.hour_rate_rent)
+ )
+
+
+def get_workstations(workstation_type):
+ workstations = frappe.get_all("Workstation", filters={"workstation_type": workstation_type})
+
+ return [workstation.name for workstation in workstations]
diff --git a/erpnext/manufacturing/report/work_order_consumed_materials/work_order_consumed_materials.js b/erpnext/manufacturing/report/work_order_consumed_materials/work_order_consumed_materials.js
index b2428e8..2fb4ec6 100644
--- a/erpnext/manufacturing/report/work_order_consumed_materials/work_order_consumed_materials.js
+++ b/erpnext/manufacturing/report/work_order_consumed_materials/work_order_consumed_materials.js
@@ -50,7 +50,7 @@
label: __("Status"),
fieldname: "status",
fieldtype: "Select",
- options: ["In Process", "Completed", "Stopped"]
+ options: ["", "In Process", "Completed", "Stopped"]
},
{
label: __("Excess Materials Consumed"),
diff --git a/erpnext/manufacturing/report/work_order_consumed_materials/work_order_consumed_materials.py b/erpnext/manufacturing/report/work_order_consumed_materials/work_order_consumed_materials.py
index 8158bc9..14e97d3 100644
--- a/erpnext/manufacturing/report/work_order_consumed_materials/work_order_consumed_materials.py
+++ b/erpnext/manufacturing/report/work_order_consumed_materials/work_order_consumed_materials.py
@@ -1,6 +1,8 @@
# Copyright (c) 2013, Frappe Technologies Pvt. Ltd. and contributors
# For license information, please see license.txt
+from collections import defaultdict
+
import frappe
from frappe import _
@@ -18,7 +20,11 @@
filters = get_filter_condition(report_filters)
wo_items = {}
- for d in frappe.get_all("Work Order", filters=filters, fields=fields):
+
+ work_orders = frappe.get_all("Work Order", filters=filters, fields=fields)
+ returned_materials = get_returned_materials(work_orders)
+
+ for d in work_orders:
d.extra_consumed_qty = 0.0
if d.consumed_qty and d.consumed_qty > d.required_qty:
d.extra_consumed_qty = d.consumed_qty - d.required_qty
@@ -39,6 +45,28 @@
return data
+def get_returned_materials(work_orders):
+ raw_materials_qty = defaultdict(float)
+
+ raw_materials = frappe.get_all(
+ "Stock Entry",
+ fields=["`tabStock Entry Detail`.`item_code`", "`tabStock Entry Detail`.`qty`"],
+ filters=[
+ ["Stock Entry", "is_return", "=", 1],
+ ["Stock Entry Detail", "docstatus", "=", 1],
+ ["Stock Entry", "work_order", "in", [d.name for d in work_orders]],
+ ],
+ )
+
+ for d in raw_materials:
+ raw_materials_qty[d.item_code] += d.qty
+
+ for row in work_orders:
+ row.returned_qty = 0.0
+ if raw_materials_qty.get(row.raw_material_item_code):
+ row.returned_qty = raw_materials_qty.get(row.raw_material_item_code)
+
+
def get_fields():
return [
"`tabWork Order Item`.`parent`",
@@ -65,7 +93,7 @@
for field in ["name", "production_item", "company", "status"]:
value = report_filters.get(field)
if value:
- key = f"`{field}`"
+ key = f"{field}"
filters.update({key: value})
return filters
@@ -112,4 +140,10 @@
"fieldtype": "Float",
"width": 100,
},
+ {
+ "label": _("Returned Qty"),
+ "fieldname": "returned_qty",
+ "fieldtype": "Float",
+ "width": 100,
+ },
]
diff --git a/erpnext/manufacturing/workspace/manufacturing/manufacturing.json b/erpnext/manufacturing/workspace/manufacturing/manufacturing.json
index 549f5af..c25f606 100644
--- a/erpnext/manufacturing/workspace/manufacturing/manufacturing.json
+++ b/erpnext/manufacturing/workspace/manufacturing/manufacturing.json
@@ -76,168 +76,6 @@
{
"hidden": 0,
"is_query_report": 0,
- "label": "Bill of Materials",
- "link_count": 0,
- "onboard": 0,
- "type": "Card Break"
- },
- {
- "dependencies": "",
- "hidden": 0,
- "is_query_report": 0,
- "label": "Item",
- "link_count": 0,
- "link_to": "Item",
- "link_type": "DocType",
- "onboard": 1,
- "type": "Link"
- },
- {
- "dependencies": "Item",
- "hidden": 0,
- "is_query_report": 0,
- "label": "Bill of Materials",
- "link_count": 0,
- "link_to": "BOM",
- "link_type": "DocType",
- "onboard": 1,
- "type": "Link"
- },
- {
- "dependencies": "",
- "hidden": 0,
- "is_query_report": 0,
- "label": "Workstation",
- "link_count": 0,
- "link_to": "Workstation",
- "link_type": "DocType",
- "onboard": 0,
- "type": "Link"
- },
- {
- "dependencies": "",
- "hidden": 0,
- "is_query_report": 0,
- "label": "Operation",
- "link_count": 0,
- "link_to": "Operation",
- "link_type": "DocType",
- "onboard": 0,
- "type": "Link"
- },
- {
- "dependencies": "",
- "hidden": 0,
- "is_query_report": 0,
- "label": "Routing",
- "link_count": 0,
- "link_to": "Routing",
- "link_type": "DocType",
- "onboard": 0,
- "type": "Link"
- },
- {
- "dependencies": "Work Order",
- "hidden": 0,
- "is_query_report": 1,
- "label": "Production Planning Report",
- "link_count": 0,
- "link_to": "Production Planning Report",
- "link_type": "Report",
- "onboard": 0,
- "type": "Link"
- },
- {
- "dependencies": "Work Order",
- "hidden": 0,
- "is_query_report": 1,
- "label": "Work Order Summary",
- "link_count": 0,
- "link_to": "Work Order Summary",
- "link_type": "Report",
- "onboard": 0,
- "type": "Link"
- },
- {
- "dependencies": "Quality Inspection",
- "hidden": 0,
- "is_query_report": 1,
- "label": "Quality Inspection Summary",
- "link_count": 0,
- "link_to": "Quality Inspection Summary",
- "link_type": "Report",
- "onboard": 0,
- "type": "Link"
- },
- {
- "dependencies": "Downtime Entry",
- "hidden": 0,
- "is_query_report": 1,
- "label": "Downtime Analysis",
- "link_count": 0,
- "link_to": "Downtime Analysis",
- "link_type": "Report",
- "onboard": 0,
- "type": "Link"
- },
- {
- "dependencies": "Job Card",
- "hidden": 0,
- "is_query_report": 1,
- "label": "Job Card Summary",
- "link_count": 0,
- "link_to": "Job Card Summary",
- "link_type": "Report",
- "onboard": 0,
- "type": "Link"
- },
- {
- "dependencies": "BOM",
- "hidden": 0,
- "is_query_report": 1,
- "label": "BOM Search",
- "link_count": 0,
- "link_to": "BOM Search",
- "link_type": "Report",
- "onboard": 0,
- "type": "Link"
- },
- {
- "dependencies": "BOM",
- "hidden": 0,
- "is_query_report": 1,
- "label": "BOM Stock Report",
- "link_count": 0,
- "link_to": "BOM Stock Report",
- "link_type": "Report",
- "onboard": 0,
- "type": "Link"
- },
- {
- "dependencies": "Work Order",
- "hidden": 0,
- "is_query_report": 1,
- "label": "Production Analytics",
- "link_count": 0,
- "link_to": "Production Analytics",
- "link_type": "Report",
- "onboard": 0,
- "type": "Link"
- },
- {
- "dependencies": "BOM",
- "hidden": 0,
- "is_query_report": 1,
- "label": "BOM Operations Time",
- "link_count": 0,
- "link_to": "BOM Operations Time",
- "link_type": "Report",
- "onboard": 0,
- "type": "Link"
- },
- {
- "hidden": 0,
- "is_query_report": 0,
"label": "Tools",
"link_count": 0,
"onboard": 0,
@@ -400,9 +238,181 @@
"link_type": "Report",
"onboard": 0,
"type": "Link"
+ },
+ {
+ "hidden": 0,
+ "is_query_report": 0,
+ "label": "Bill of Materials",
+ "link_count": 15,
+ "onboard": 0,
+ "type": "Card Break"
+ },
+ {
+ "dependencies": "",
+ "hidden": 0,
+ "is_query_report": 0,
+ "label": "Item",
+ "link_count": 0,
+ "link_to": "Item",
+ "link_type": "DocType",
+ "onboard": 1,
+ "type": "Link"
+ },
+ {
+ "dependencies": "Item",
+ "hidden": 0,
+ "is_query_report": 0,
+ "label": "Bill of Materials",
+ "link_count": 0,
+ "link_to": "BOM",
+ "link_type": "DocType",
+ "onboard": 1,
+ "type": "Link"
+ },
+ {
+ "dependencies": "",
+ "hidden": 0,
+ "is_query_report": 0,
+ "label": "Workstation Type",
+ "link_count": 0,
+ "link_to": "Workstation Type",
+ "link_type": "DocType",
+ "onboard": 0,
+ "type": "Link"
+ },
+ {
+ "dependencies": "",
+ "hidden": 0,
+ "is_query_report": 0,
+ "label": "Workstation",
+ "link_count": 0,
+ "link_to": "Workstation",
+ "link_type": "DocType",
+ "onboard": 0,
+ "type": "Link"
+ },
+ {
+ "dependencies": "",
+ "hidden": 0,
+ "is_query_report": 0,
+ "label": "Operation",
+ "link_count": 0,
+ "link_to": "Operation",
+ "link_type": "DocType",
+ "onboard": 0,
+ "type": "Link"
+ },
+ {
+ "dependencies": "Work Order",
+ "hidden": 0,
+ "is_query_report": 1,
+ "label": "Routing",
+ "link_count": 0,
+ "link_to": "Routing",
+ "link_type": "DocType",
+ "onboard": 0,
+ "type": "Link"
+ },
+ {
+ "dependencies": "Work Order",
+ "hidden": 0,
+ "is_query_report": 1,
+ "label": "Production Planning Report",
+ "link_count": 0,
+ "link_to": "Production Planning Report",
+ "link_type": "Report",
+ "onboard": 0,
+ "type": "Link"
+ },
+ {
+ "dependencies": "Quality Inspection",
+ "hidden": 0,
+ "is_query_report": 1,
+ "label": "Work Order Summary",
+ "link_count": 0,
+ "link_to": "Work Order Summary",
+ "link_type": "Report",
+ "onboard": 0,
+ "type": "Link"
+ },
+ {
+ "dependencies": "Downtime Entry",
+ "hidden": 0,
+ "is_query_report": 1,
+ "label": "Quality Inspection Summary",
+ "link_count": 0,
+ "link_to": "Quality Inspection Summary",
+ "link_type": "Report",
+ "onboard": 0,
+ "type": "Link"
+ },
+ {
+ "dependencies": "Job Card",
+ "hidden": 0,
+ "is_query_report": 1,
+ "label": "Downtime Analysis",
+ "link_count": 0,
+ "link_to": "Downtime Analysis",
+ "link_type": "Report",
+ "onboard": 0,
+ "type": "Link"
+ },
+ {
+ "dependencies": "BOM",
+ "hidden": 0,
+ "is_query_report": 1,
+ "label": "Job Card Summary",
+ "link_count": 0,
+ "link_to": "Job Card Summary",
+ "link_type": "Report",
+ "onboard": 0,
+ "type": "Link"
+ },
+ {
+ "dependencies": "BOM",
+ "hidden": 0,
+ "is_query_report": 1,
+ "label": "BOM Search",
+ "link_count": 0,
+ "link_to": "BOM Search",
+ "link_type": "Report",
+ "onboard": 0,
+ "type": "Link"
+ },
+ {
+ "dependencies": "Work Order",
+ "hidden": 0,
+ "is_query_report": 1,
+ "label": "BOM Stock Report",
+ "link_count": 0,
+ "link_to": "BOM Stock Report",
+ "link_type": "Report",
+ "onboard": 0,
+ "type": "Link"
+ },
+ {
+ "dependencies": "BOM",
+ "hidden": 0,
+ "is_query_report": 1,
+ "label": "Production Analytics",
+ "link_count": 0,
+ "link_to": "Production Analytics",
+ "link_type": "Report",
+ "onboard": 0,
+ "type": "Link"
+ },
+ {
+ "hidden": 0,
+ "is_query_report": 0,
+ "label": "BOM Operations Time",
+ "link_count": 0,
+ "link_to": "BOM Operations Time",
+ "link_type": "Report",
+ "onboard": 0,
+ "type": "Link"
}
],
- "modified": "2022-06-15 15:18:57.062935",
+ "modified": "2022-11-14 14:53:34.616862",
"modified_by": "Administrator",
"module": "Manufacturing",
"name": "Manufacturing",
diff --git a/erpnext/patches.txt b/erpnext/patches.txt
index fc63f12..2624181 100644
--- a/erpnext/patches.txt
+++ b/erpnext/patches.txt
@@ -315,4 +315,6 @@
erpnext.patches.v14_0.create_accounting_dimensions_in_subcontracting_doctypes
erpnext.patches.v14_0.fix_subcontracting_receipt_gl_entries
erpnext.patches.v14_0.migrate_remarks_from_gl_to_payment_ledger
+erpnext.patches.v13_0.update_schedule_type_in_loans
erpnext.patches.v14_0.create_accounting_dimensions_for_asset_capitalization
+erpnext.patches.v14_0.update_tds_fields
diff --git a/erpnext/patches/v13_0/update_exchange_rate_settings.py b/erpnext/patches/v13_0/update_exchange_rate_settings.py
index ed11c62..746195f 100644
--- a/erpnext/patches/v13_0/update_exchange_rate_settings.py
+++ b/erpnext/patches/v13_0/update_exchange_rate_settings.py
@@ -1,10 +1,5 @@
-import frappe
-
from erpnext.setup.install import setup_currency_exchange
def execute():
- frappe.reload_doc("accounts", "doctype", "currency_exchange_settings_result")
- frappe.reload_doc("accounts", "doctype", "currency_exchange_settings_details")
- frappe.reload_doc("accounts", "doctype", "currency_exchange_settings")
setup_currency_exchange()
diff --git a/erpnext/patches/v13_0/update_schedule_type_in_loans.py b/erpnext/patches/v13_0/update_schedule_type_in_loans.py
new file mode 100644
index 0000000..e5b5f64
--- /dev/null
+++ b/erpnext/patches/v13_0/update_schedule_type_in_loans.py
@@ -0,0 +1,14 @@
+import frappe
+
+
+def execute():
+ loan = frappe.qb.DocType("Loan")
+ loan_type = frappe.qb.DocType("Loan Type")
+
+ frappe.qb.update(loan_type).set(
+ loan_type.repayment_schedule_type, "Monthly as per repayment start date"
+ ).where(loan_type.is_term_loan == 1).run()
+
+ frappe.qb.update(loan).set(
+ loan.repayment_schedule_type, "Monthly as per repayment start date"
+ ).where(loan.is_term_loan == 1).run()
diff --git a/erpnext/patches/v14_0/update_tds_fields.py b/erpnext/patches/v14_0/update_tds_fields.py
new file mode 100644
index 0000000..a333c5d
--- /dev/null
+++ b/erpnext/patches/v14_0/update_tds_fields.py
@@ -0,0 +1,29 @@
+import frappe
+from frappe.utils import nowdate
+
+from erpnext.accounts.utils import FiscalYearError, get_fiscal_year
+
+
+def execute():
+ # Only do for current fiscal year, no need to repost for all years
+ for company in frappe.get_all("Company"):
+ try:
+ fiscal_year_details = get_fiscal_year(date=nowdate(), company=company.name, as_dict=True)
+
+ purchase_invoice = frappe.qb.DocType("Purchase Invoice")
+
+ frappe.qb.update(purchase_invoice).set(
+ purchase_invoice.tax_withholding_net_total, purchase_invoice.net_total
+ ).set(
+ purchase_invoice.base_tax_withholding_net_total, purchase_invoice.base_net_total
+ ).where(
+ purchase_invoice.company == company.name
+ ).where(
+ purchase_invoice.apply_tds == 1
+ ).where(
+ purchase_invoice.posting_date >= fiscal_year_details.year_start_date
+ ).where(
+ purchase_invoice.docstatus == 1
+ ).run()
+ except FiscalYearError:
+ pass
diff --git a/erpnext/projects/doctype/timesheet/timesheet.js b/erpnext/projects/doctype/timesheet/timesheet.js
index e1486de..a376bf4 100644
--- a/erpnext/projects/doctype/timesheet/timesheet.js
+++ b/erpnext/projects/doctype/timesheet/timesheet.js
@@ -92,18 +92,26 @@
frm.fields_dict["time_logs"].grid.toggle_enable("billing_hours", false);
frm.fields_dict["time_logs"].grid.toggle_enable("is_billable", false);
}
+
+ let filters = {
+ "status": "Open"
+ };
+
+ if (frm.doc.customer) {
+ filters["customer"] = frm.doc.customer;
+ }
+
+ frm.set_query('parent_project', function(doc) {
+ return {
+ filters: filters
+ };
+ });
+
frm.trigger('setup_filters');
frm.trigger('set_dynamic_field_label');
},
customer: function(frm) {
- frm.set_query('parent_project', function(doc) {
- return {
- filters: {
- "customer": doc.customer
- }
- };
- });
frm.set_query('project', 'time_logs', function(doc) {
return {
filters: {
diff --git a/erpnext/projects/workspace/projects/projects.json b/erpnext/projects/workspace/projects/projects.json
index 1253649..4bdb1db 100644
--- a/erpnext/projects/workspace/projects/projects.json
+++ b/erpnext/projects/workspace/projects/projects.json
@@ -5,7 +5,7 @@
"label": "Open Projects"
}
],
- "content": "[{\"type\":\"chart\",\"data\":{\"chart_name\":\"Open Projects\",\"col\":12}},{\"type\":\"spacer\",\"data\":{\"col\":12}},{\"type\":\"header\",\"data\":{\"text\":\"<span class=\\\"h4\\\"><b>Your Shortcuts</b></span>\",\"col\":12}},{\"type\":\"shortcut\",\"data\":{\"shortcut_name\":\"Task\",\"col\":3}},{\"type\":\"shortcut\",\"data\":{\"shortcut_name\":\"Project\",\"col\":3}},{\"type\":\"shortcut\",\"data\":{\"shortcut_name\":\"Timesheet\",\"col\":3}},{\"type\":\"shortcut\",\"data\":{\"shortcut_name\":\"Project Billing Summary\",\"col\":3}},{\"type\":\"shortcut\",\"data\":{\"shortcut_name\":\"Dashboard\",\"col\":3}},{\"type\":\"spacer\",\"data\":{\"col\":12}},{\"type\":\"header\",\"data\":{\"text\":\"<span class=\\\"h4\\\"><b>Reports & Masters</b></span>\",\"col\":12}},{\"type\":\"card\",\"data\":{\"card_name\":\"Projects\",\"col\":4}},{\"type\":\"card\",\"data\":{\"card_name\":\"Time Tracking\",\"col\":4}},{\"type\":\"card\",\"data\":{\"card_name\":\"Reports\",\"col\":4}}]",
+ "content": "[{\"type\":\"chart\",\"data\":{\"chart_name\":\"Open Projects\",\"col\":12}},{\"type\":\"spacer\",\"data\":{\"col\":12}},{\"type\":\"header\",\"data\":{\"text\":\"<span class=\\\"h4\\\"><b>Your Shortcuts</b></span>\",\"col\":12}},{\"type\":\"shortcut\",\"data\":{\"shortcut_name\":\"Task\",\"col\":3}},{\"type\":\"shortcut\",\"data\":{\"shortcut_name\":\"Project\",\"col\":3}},{\"type\":\"shortcut\",\"data\":{\"shortcut_name\":\"Timesheet\",\"col\":3}},{\"type\":\"shortcut\",\"data\":{\"shortcut_name\":\"Project Billing Summary\",\"col\":3}},{\"type\":\"shortcut\",\"data\":{\"shortcut_name\":\"Dashboard\",\"col\":3}},{\"type\":\"spacer\",\"data\":{\"col\":12}},{\"type\":\"header\",\"data\":{\"text\":\"<span class=\\\"h4\\\"><b>Reports & Masters</b></span>\",\"col\":12}},{\"type\":\"card\",\"data\":{\"card_name\":\"Projects\",\"col\":4}},{\"type\":\"card\",\"data\":{\"card_name\":\"Time Tracking\",\"col\":4}},{\"type\":\"card\",\"data\":{\"card_name\":\"Reports\",\"col\":4}},{\"type\":\"card\",\"data\":{\"card_name\":\"Settings\",\"col\":4}}]",
"creation": "2020-03-02 15:46:04.874669",
"docstatus": 0,
"doctype": "Workspace",
@@ -170,9 +170,27 @@
"link_type": "Report",
"onboard": 0,
"type": "Link"
+ },
+ {
+ "hidden": 0,
+ "is_query_report": 0,
+ "label": "Settings",
+ "link_count": 1,
+ "onboard": 0,
+ "type": "Card Break"
+ },
+ {
+ "hidden": 0,
+ "is_query_report": 0,
+ "label": "Projects Settings",
+ "link_count": 0,
+ "link_to": "Projects Settings",
+ "link_type": "DocType",
+ "onboard": 0,
+ "type": "Link"
}
],
- "modified": "2022-06-28 12:31:30.167740",
+ "modified": "2022-10-11 22:39:10.436311",
"modified_by": "Administrator",
"module": "Projects",
"name": "Projects",
diff --git a/erpnext/public/js/bank_reconciliation_tool/data_table_manager.js b/erpnext/public/js/bank_reconciliation_tool/data_table_manager.js
index 5bb58fa..9ef8ce6 100644
--- a/erpnext/public/js/bank_reconciliation_tool/data_table_manager.js
+++ b/erpnext/public/js/bank_reconciliation_tool/data_table_manager.js
@@ -30,28 +30,28 @@
get_dt_columns() {
this.columns = [
{
- name: "Date",
+ name: __("Date"),
editable: false,
width: 100,
},
{
- name: "Party Type",
+ name: __("Party Type"),
editable: false,
width: 95,
},
{
- name: "Party",
+ name: __("Party"),
editable: false,
width: 100,
},
{
- name: "Description",
+ name: __("Description"),
editable: false,
width: 350,
},
{
- name: "Deposit",
+ name: __("Deposit"),
editable: false,
width: 100,
format: (value) =>
@@ -60,7 +60,7 @@
"</span>",
},
{
- name: "Withdrawal",
+ name: __("Withdrawal"),
editable: false,
width: 100,
format: (value) =>
@@ -69,26 +69,26 @@
"</span>",
},
{
- name: "Unallocated Amount",
+ name: __("Unallocated Amount"),
editable: false,
width: 100,
format: (value) =>
- "<span style='color:blue;'>" +
+ "<span style='color:var(--blue-500);'>" +
format_currency(value, this.currency) +
"</span>",
},
{
- name: "Reference Number",
+ name: __("Reference Number"),
editable: false,
width: 140,
},
{
- name: "Actions",
+ name: __("Actions"),
editable: false,
sortable: false,
focusable: false,
dropdown: false,
- width: 80,
+ width: 100,
},
];
}
@@ -118,7 +118,7 @@
row["reference_number"],
`
<Button class="btn btn-primary btn-xs center" data-name = ${row["name"]} >
- Actions
+ ${__("Actions")}
</a>
`,
];
diff --git a/erpnext/public/js/bank_reconciliation_tool/dialog_manager.js b/erpnext/public/js/bank_reconciliation_tool/dialog_manager.js
index cb34c9b..ca01f68 100644
--- a/erpnext/public/js/bank_reconciliation_tool/dialog_manager.js
+++ b/erpnext/public/js/bank_reconciliation_tool/dialog_manager.js
@@ -87,33 +87,33 @@
get_dt_columns() {
this.columns = [
{
- name: "Document Type",
+ name: __("Document Type"),
editable: false,
width: 125,
},
{
- name: "Document Name",
+ name: __("Document Name"),
editable: false,
width: 150,
},
{
- name: "Reference Date",
+ name: __("Reference Date"),
editable: false,
width: 120,
},
{
- name: "Amount",
+ name: __("Amount"),
editable: false,
width: 100,
},
{
- name: "Party",
+ name: __("Party"),
editable: false,
width: 120,
},
{
- name: "Reference Number",
+ name: __("Reference Number"),
editable: false,
width: 140,
},
@@ -222,7 +222,7 @@
{
fieldtype: "HTML",
fieldname: "no_matching_vouchers",
- options: "<div class=\"text-muted text-center\">No Matching Vouchers Found</div>"
+ options: __("<div class=\"text-muted text-center\">{0}</div>", [__("No Matching Vouchers Found")])
},
{
fieldtype: "Section Break",
@@ -444,10 +444,7 @@
vouchers: vouchers,
},
callback: (response) => {
- const alert_string =
- "Bank Transaction " +
- this.bank_transaction.name +
- " Matched";
+ const alert_string = __("Bank Transaction {0} Matched", [this.bank_transaction.name]);
frappe.show_alert(alert_string);
this.update_dt_cards(response.message);
this.dialog.hide();
@@ -471,10 +468,7 @@
cost_center: values.cost_center,
},
callback: (response) => {
- const alert_string =
- "Bank Transaction " +
- this.bank_transaction.name +
- " added as Payment Entry";
+ const alert_string = __("Bank Transaction {0} added as Payment Entry", [this.bank_transaction.name]);
frappe.show_alert(alert_string);
this.update_dt_cards(response.message);
this.dialog.hide();
@@ -498,10 +492,7 @@
second_account: values.second_account,
},
callback: (response) => {
- const alert_string =
- "Bank Transaction " +
- this.bank_transaction.name +
- " added as Journal Entry";
+ const alert_string = __("Bank Transaction {0} added as Journal Entry", [this.bank_transaction.name]);
frappe.show_alert(alert_string);
this.update_dt_cards(response.message);
this.dialog.hide();
@@ -520,10 +511,7 @@
party: values.party,
},
callback: (response) => {
- const alert_string =
- "Bank Transaction " +
- this.bank_transaction.name +
- " updated";
+ const alert_string = __("Bank Transaction {0} updated", [this.bank_transaction.name]);
frappe.show_alert(alert_string);
this.update_dt_cards(response.message);
this.dialog.hide();
diff --git a/erpnext/public/js/bank_reconciliation_tool/number_card.js b/erpnext/public/js/bank_reconciliation_tool/number_card.js
index e10d109..7e1b269 100644
--- a/erpnext/public/js/bank_reconciliation_tool/number_card.js
+++ b/erpnext/public/js/bank_reconciliation_tool/number_card.js
@@ -15,20 +15,20 @@
var chart_data = [
{
value: this.bank_statement_closing_balance,
- label: "Closing Balance as per Bank Statement",
+ label: __("Closing Balance as per Bank Statement"),
datatype: "Currency",
currency: this.currency,
},
{
value: this.cleared_balance,
- label: "Closing Balance as per ERP",
+ label: __("Closing Balance as per ERP"),
datatype: "Currency",
currency: this.currency,
},
{
value:
this.bank_statement_closing_balance - this.cleared_balance,
- label: "Difference",
+ label: __("Difference"),
datatype: "Currency",
currency: this.currency,
},
diff --git a/erpnext/public/js/bulk_transaction_processing.js b/erpnext/public/js/bulk_transaction_processing.js
index 101f50c..0e42b47 100644
--- a/erpnext/public/js/bulk_transaction_processing.js
+++ b/erpnext/public/js/bulk_transaction_processing.js
@@ -11,7 +11,7 @@
});
let count_of_rows = checked_items.length;
- frappe.confirm(__("Create {0} {1} ?", [count_of_rows, to_doctype]), ()=>{
+ frappe.confirm(__("Create {0} {1} ?", [count_of_rows, __(to_doctype)]), ()=>{
if (doc_name.length == 0) {
frappe.call({
method: "erpnext.utilities.bulk_transaction.transaction_processing",
@@ -20,11 +20,11 @@
});
if (count_of_rows > 10) {
- frappe.show_alert("Starting a background job to create {0} {1}", [count_of_rows, to_doctype]);
+ frappe.show_alert("Starting a background job to create {0} {1}", [count_of_rows, __(to_doctype)]);
}
} else {
frappe.msgprint(__("Selected document must be in submitted state"));
}
});
}
-});
\ No newline at end of file
+});
diff --git a/erpnext/public/js/controllers/accounts.js b/erpnext/public/js/controllers/accounts.js
index c1fe72b..a07f75d 100644
--- a/erpnext/public/js/controllers/accounts.js
+++ b/erpnext/public/js/controllers/accounts.js
@@ -143,6 +143,12 @@
cur_frm.cscript.account_head = function(doc, cdt, cdn) {
var d = locals[cdt][cdn];
+
+ if (doc.docstatus == 1) {
+ // Should not trigger any changes on change post submit
+ return;
+ }
+
if(!d.charge_type && d.account_head){
frappe.msgprint(__("Please select Charge Type first"));
frappe.model.set_value(cdt, cdn, "account_head", "");
diff --git a/erpnext/public/js/controllers/transaction.js b/erpnext/public/js/controllers/transaction.js
index c17610b..46ac808 100644
--- a/erpnext/public/js/controllers/transaction.js
+++ b/erpnext/public/js/controllers/transaction.js
@@ -341,6 +341,7 @@
this.set_dynamic_labels();
this.setup_sms();
this.setup_quality_inspection();
+ this.validate_has_items();
}
scan_barcode() {
@@ -348,6 +349,12 @@
barcode_scanner.process_scan();
}
+ validate_has_items () {
+ let table = this.frm.doc.items;
+ this.frm.has_items = (table && table.length
+ && table[0].qty && table[0].item_code);
+ }
+
apply_default_taxes() {
var me = this;
var taxes_and_charges_field = frappe.meta.get_docfield(me.frm.doc.doctype, "taxes_and_charges",
@@ -426,6 +433,7 @@
if(!this.validate_company_and_party()) {
this.frm.fields_dict["items"].grid.grid_rows[item.idx - 1].remove();
} else {
+ item.pricing_rules = ''
return this.frm.call({
method: "erpnext.stock.get_item_details.get_item_details",
child: item,
@@ -1045,6 +1053,7 @@
uom(doc, cdt, cdn) {
var me = this;
var item = frappe.get_doc(cdt, cdn);
+ item.pricing_rules = ''
if(item.item_code && item.uom) {
return this.frm.call({
method: "erpnext.stock.get_item_details.get_conversion_factor",
@@ -1121,6 +1130,7 @@
qty(doc, cdt, cdn) {
let item = frappe.get_doc(cdt, cdn);
+ item.pricing_rules = ''
this.conversion_factor(doc, cdt, cdn, true);
this.calculate_stock_uom_rate(doc, cdt, cdn);
this.apply_pricing_rule(item, true);
@@ -1197,7 +1207,7 @@
"base_rounding_adjustment"], company_currency);
this.frm.set_currency_labels(["total", "net_total", "total_taxes_and_charges", "discount_amount",
- "grand_total", "taxes_and_charges_added", "taxes_and_charges_deducted",
+ "grand_total", "taxes_and_charges_added", "taxes_and_charges_deducted","tax_withholding_net_total",
"rounded_total", "in_words", "paid_amount", "write_off_amount", "operating_cost",
"scrap_material_cost", "rounding_adjustment", "raw_material_cost",
"total_cost"], this.frm.doc.currency);
@@ -1214,7 +1224,7 @@
}
// toggle fields
- this.frm.toggle_display(["conversion_rate", "base_total", "base_net_total",
+ this.frm.toggle_display(["conversion_rate", "base_total", "base_net_total", "base_tax_withholding_net_total",
"base_total_taxes_and_charges", "base_taxes_and_charges_added", "base_taxes_and_charges_deducted",
"base_grand_total", "base_rounded_total", "base_in_words", "base_discount_amount",
"base_paid_amount", "base_write_off_amount", "base_operating_cost", "base_raw_material_cost",
@@ -1401,7 +1411,7 @@
if (!r.exc && r.message) {
me._set_values_for_item_list(r.message);
if(item) me.set_gross_profit(item);
- if(me.frm.doc.apply_discount_on) me.frm.trigger("apply_discount_on")
+ if (me.frm.doc.apply_discount_on) me.frm.trigger("apply_discount_on")
}
}
});
@@ -1574,6 +1584,7 @@
for (let key in pr_row) {
row_to_modify[key] = pr_row[key];
}
+ this.frm.script_manager.copy_from_first_row("items", row_to_modify, ["expense_account", "income_account"]);
});
// free_item_data is a temporary variable
diff --git a/erpnext/public/js/financial_statements.js b/erpnext/public/js/financial_statements.js
index 1a309ba..b0082bd 100644
--- a/erpnext/public/js/financial_statements.js
+++ b/erpnext/public/js/financial_statements.js
@@ -28,7 +28,7 @@
},
"open_general_ledger": function(data) {
if (!data.account) return;
- var project = $.grep(frappe.query_report.filters, function(e){ return e.df.fieldname == 'project'; })
+ let project = $.grep(frappe.query_report.filters, function(e){ return e.df.fieldname == 'project'; });
frappe.route_options = {
"account": data.account,
@@ -37,7 +37,16 @@
"to_date": data.to_date || data.year_end_date,
"project": (project && project.length > 0) ? project[0].$input.val() : ""
};
- frappe.set_route("query-report", "General Ledger");
+
+ let report = "General Ledger";
+
+ if (["Payable", "Receivable"].includes(data.account_type)) {
+ report = data.account_type == "Payable" ? "Accounts Payable" : "Accounts Receivable";
+ frappe.route_options["party_account"] = data.account;
+ frappe.route_options["report_date"] = data.year_end_date;
+ }
+
+ frappe.set_route("query-report", report);
},
"tree": true,
"name_field": "account",
diff --git a/erpnext/public/js/utils/barcode_scanner.js b/erpnext/public/js/utils/barcode_scanner.js
index 83b108b..a4f74bd 100644
--- a/erpnext/public/js/utils/barcode_scanner.js
+++ b/erpnext/public/js/utils/barcode_scanner.js
@@ -47,42 +47,49 @@
return;
}
- frappe
- .call({
- method: this.scan_api,
- args: {
- search_value: input,
- },
- })
- .then((r) => {
- const data = r && r.message;
- if (!data || Object.keys(data).length === 0) {
- this.show_alert(__("Cannot find Item with this Barcode"), "red");
- this.clean_up();
- this.play_fail_sound();
- reject();
- return;
- }
+ this.scan_api_call(input, (r) => {
+ const data = r && r.message;
+ if (!data || Object.keys(data).length === 0) {
+ this.show_alert(__("Cannot find Item with this Barcode"), "red");
+ this.clean_up();
+ this.play_fail_sound();
+ reject();
+ return;
+ }
- me.update_table(data).then(row => {
- this.play_success_sound();
- resolve(row);
- }).catch(() => {
- this.play_fail_sound();
- reject();
- });
+ me.update_table(data).then(row => {
+ this.play_success_sound();
+ resolve(row);
+ }).catch(() => {
+ this.play_fail_sound();
+ reject();
});
+ });
});
}
+ scan_api_call(input, callback) {
+ frappe
+ .call({
+ method: this.scan_api,
+ args: {
+ search_value: input,
+ },
+ })
+ .then((r) => {
+ callback(r);
+ });
+ }
+
update_table(data) {
return new Promise((resolve, reject) => {
let cur_grid = this.frm.fields_dict[this.items_table_name].grid;
const {item_code, barcode, batch_no, serial_no, uom} = data;
- let row = this.get_row_to_modify_on_scan(item_code, batch_no, uom);
+ let row = this.get_row_to_modify_on_scan(item_code, batch_no, uom, barcode);
+ this.is_new_row = false;
if (!row) {
if (this.dont_allow_new_row) {
this.show_alert(__("Maximum quantity scanned for item {0}.", [item_code]), "red");
@@ -90,11 +97,13 @@
reject();
return;
}
+ this.is_new_row = true;
// add new row if new item/batch is scanned
row = frappe.model.add_child(this.frm.doc, cur_grid.doctype, this.items_table_name);
// trigger any row add triggers defined on child table.
this.frm.script_manager.trigger(`${this.items_table_name}_add`, row.doctype, row.name);
+ this.frm.has_items = false;
}
if (this.is_duplicate_serial_no(row, serial_no)) {
@@ -105,7 +114,7 @@
frappe.run_serially([
() => this.set_selector_trigger_flag(data),
- () => this.set_item(row, item_code).then(qty => {
+ () => this.set_item(row, item_code, barcode, batch_no, serial_no).then(qty => {
this.show_scan_message(row.idx, row.item_code, qty);
}),
() => this.set_barcode_uom(row, uom),
@@ -136,7 +145,7 @@
frappe.flags.hide_serial_batch_dialog = false;
}
- set_item(row, item_code) {
+ set_item(row, item_code, barcode, batch_no, serial_no) {
return new Promise(resolve => {
const increment = async (value = 1) => {
const item_data = {item_code: item_code};
@@ -149,12 +158,186 @@
frappe.prompt(__("Please enter quantity for item {0}", [item_code]), ({value}) => {
increment(value).then((value) => resolve(value));
});
+ } else if (this.frm.has_items) {
+ this.prepare_item_for_scan(row, item_code, barcode, batch_no, serial_no);
} else {
increment().then((value) => resolve(value));
}
});
}
+ prepare_item_for_scan(row, item_code, barcode, batch_no, serial_no) {
+ var me = this;
+ this.dialog = new frappe.ui.Dialog({
+ title: __("Scan barcode for item {0}", [item_code]),
+ fields: me.get_fields_for_dialog(row, item_code, barcode, batch_no, serial_no),
+ })
+
+ this.dialog.set_primary_action(__("Update"), () => {
+ const item_data = {item_code: item_code};
+ item_data[this.qty_field] = this.dialog.get_value("scanned_qty");
+ item_data["has_item_scanned"] = 1;
+
+ this.remaining_qty = flt(this.dialog.get_value("qty")) - flt(this.dialog.get_value("scanned_qty"));
+ frappe.model.set_value(row.doctype, row.name, item_data);
+
+ frappe.run_serially([
+ () => this.set_batch_no(row, this.dialog.get_value("batch_no")),
+ () => this.set_barcode(row, this.dialog.get_value("barcode")),
+ () => this.set_serial_no(row, this.dialog.get_value("serial_no")),
+ () => this.add_child_for_remaining_qty(row),
+ () => this.clean_up()
+ ]);
+
+ this.dialog.hide();
+ });
+
+ this.dialog.show();
+
+ this.$scan_btn = this.dialog.$wrapper.find(".link-btn");
+ this.$scan_btn.css("display", "inline");
+ }
+
+ get_fields_for_dialog(row, item_code, barcode, batch_no, serial_no) {
+ let fields = [
+ {
+ fieldtype: "Data",
+ fieldname: "barcode_scanner",
+ options: "Barcode",
+ label: __("Scan Barcode"),
+ onchange: (e) => {
+ if (!e) {
+ return;
+ }
+
+ if (e.target.value) {
+ this.scan_api_call(e.target.value, (r) => {
+ if (r.message) {
+ this.update_dialog_values(item_code, r);
+ }
+ })
+ }
+ }
+ },
+ {
+ fieldtype: "Section Break",
+ },
+ {
+ fieldtype: "Float",
+ fieldname: "qty",
+ label: __("Quantity to Scan"),
+ default: row[this.qty_field] || 1,
+ },
+ {
+ fieldtype: "Column Break",
+ fieldname: "column_break_1",
+ },
+ {
+ fieldtype: "Float",
+ read_only: 1,
+ fieldname: "scanned_qty",
+ label: __("Scanned Quantity"),
+ default: 1,
+ },
+ {
+ fieldtype: "Section Break",
+ }
+ ]
+
+ if (batch_no) {
+ fields.push({
+ fieldtype: "Link",
+ fieldname: "batch_no",
+ options: "Batch No",
+ label: __("Batch No"),
+ default: batch_no,
+ read_only: 1,
+ hidden: 1
+ });
+ }
+
+ if (serial_no) {
+ fields.push({
+ fieldtype: "Small Text",
+ fieldname: "serial_no",
+ label: __("Serial Nos"),
+ default: serial_no,
+ read_only: 1,
+ });
+ }
+
+ if (barcode) {
+ fields.push({
+ fieldtype: "Data",
+ fieldname: "barcode",
+ options: "Barcode",
+ label: __("Barcode"),
+ default: barcode,
+ read_only: 1,
+ hidden: 1
+ });
+ }
+
+ return fields;
+ }
+
+ update_dialog_values(scanned_item, r) {
+ const {item_code, barcode, batch_no, serial_no} = r.message;
+
+ this.dialog.set_value("barcode_scanner", "");
+ if (item_code === scanned_item &&
+ (this.dialog.get_value("barcode") === barcode || batch_no || serial_no)) {
+
+ if (batch_no) {
+ this.dialog.set_value("batch_no", batch_no);
+ }
+
+ if (serial_no) {
+
+ this.validate_duplicate_serial_no(serial_no);
+ let serial_nos = this.dialog.get_value("serial_no") + "\n" + serial_no;
+ this.dialog.set_value("serial_no", serial_nos);
+ }
+
+ let qty = flt(this.dialog.get_value("scanned_qty")) + 1.0;
+ this.dialog.set_value("scanned_qty", qty);
+ }
+ }
+
+ validate_duplicate_serial_no(serial_no) {
+ let serial_nos = this.dialog.get_value("serial_no") ?
+ this.dialog.get_value("serial_no").split("\n") : [];
+
+ if (in_list(serial_nos, serial_no)) {
+ frappe.throw(__("Serial No {0} already scanned", [serial_no]));
+ }
+ }
+
+ add_child_for_remaining_qty(prev_row) {
+ if (this.remaining_qty && this.remaining_qty >0) {
+ let cur_grid = this.frm.fields_dict[this.items_table_name].grid;
+ let row = frappe.model.add_child(this.frm.doc, cur_grid.doctype, this.items_table_name);
+
+ let ignore_fields = ["name", "idx", "batch_no", "barcode",
+ "received_qty", "serial_no", "has_item_scanned"];
+
+ for (let key in prev_row) {
+ if (in_list(ignore_fields, key)) {
+ continue;
+ }
+
+ row[key] = prev_row[key];
+ }
+
+ row[this.qty_field] = this.remaining_qty;
+ if (this.qty_field == "qty" && frappe.meta.has_field(row.doctype, "stock_qty")) {
+ row["stock_qty"] = this.remaining_qty * row.conversion_factor;
+ }
+
+ this.frm.script_manager.trigger("item_code", row.doctype, row.name);
+ }
+ }
+
async set_serial_no(row, serial_no) {
if (serial_no && frappe.meta.has_field(row.doctype, this.serial_no_field)) {
const existing_serial_nos = row[this.serial_no_field];
@@ -205,7 +388,7 @@
return is_duplicate;
}
- get_row_to_modify_on_scan(item_code, batch_no, uom) {
+ get_row_to_modify_on_scan(item_code, batch_no, uom, barcode) {
let cur_grid = this.frm.fields_dict[this.items_table_name].grid;
// Check if batch is scanned and table has batch no field
@@ -214,12 +397,14 @@
const matching_row = (row) => {
const item_match = row.item_code == item_code;
- const batch_match = row[this.batch_no_field] == batch_no;
+ const batch_match = (!row[this.batch_no_field] || row[this.batch_no_field] == batch_no);
const uom_match = !uom || row[this.uom_field] == uom;
const qty_in_limit = flt(row[this.qty_field]) < flt(row[this.max_qty_field]);
+ const item_scanned = row.has_item_scanned;
return item_match
&& uom_match
+ && !item_scanned
&& (!is_batch_no_scan || batch_match)
&& (!check_max_qty || qty_in_limit)
}
diff --git a/erpnext/public/js/utils/party.js b/erpnext/public/js/utils/party.js
index 58594b0..644adff 100644
--- a/erpnext/public/js/utils/party.js
+++ b/erpnext/public/js/utils/party.js
@@ -242,20 +242,29 @@
});
};
-erpnext.utils.get_contact_details = function(frm) {
+erpnext.utils.get_contact_details = function (frm) {
if (frm.updating_party_details) return;
if (frm.doc["contact_person"]) {
frappe.call({
method: "frappe.contacts.doctype.contact.contact.get_contact_details",
- args: {contact: frm.doc.contact_person },
- callback: function(r) {
- if (r.message)
- frm.set_value(r.message);
- }
- })
+ args: { contact: frm.doc.contact_person },
+ callback: function (r) {
+ if (r.message) frm.set_value(r.message);
+ },
+ });
+ } else {
+ frm.set_value({
+ contact_person: "",
+ contact_display: "",
+ contact_email: "",
+ contact_mobile: "",
+ contact_phone: "",
+ contact_designation: "",
+ contact_department: "",
+ });
}
-}
+};
erpnext.utils.validate_mandatory = function(frm, label, value, trigger_on) {
if (!value) {
diff --git a/erpnext/public/scss/point-of-sale.scss b/erpnext/public/scss/point-of-sale.scss
index 7a3854c..7b7530b 100644
--- a/erpnext/public/scss/point-of-sale.scss
+++ b/erpnext/public/scss/point-of-sale.scss
@@ -159,6 +159,12 @@
}
}
+ .item-img {
+ @extend .image;
+ border-radius: 8px 8px 0 0;
+ object-fit: cover;
+ }
+
> .item-detail {
display: flex;
flex-direction: column;
diff --git a/erpnext/quality_management/doctype/quality_procedure/quality_procedure.py b/erpnext/quality_management/doctype/quality_procedure/quality_procedure.py
index 72f9e6d..e860408 100644
--- a/erpnext/quality_management/doctype/quality_procedure/quality_procedure.py
+++ b/erpnext/quality_management/doctype/quality_procedure/quality_procedure.py
@@ -79,7 +79,7 @@
]
else:
return frappe.get_all(
- doctype,
+ "Quality Procedure",
fields=["name as value", "is_group as expandable"],
filters=dict(parent_quality_procedure=parent),
order_by="name asc",
diff --git a/erpnext/regional/doctype/import_supplier_invoice/import_supplier_invoice.py b/erpnext/regional/doctype/import_supplier_invoice/import_supplier_invoice.py
index 34701c1..c52685e 100644
--- a/erpnext/regional/doctype/import_supplier_invoice/import_supplier_invoice.py
+++ b/erpnext/regional/doctype/import_supplier_invoice/import_supplier_invoice.py
@@ -146,7 +146,9 @@
def publish(self, title, message, count, total):
frappe.publish_realtime(
- "import_invoice_update", {"title": title, "message": message, "count": count, "total": total}
+ "import_invoice_update",
+ {"title": title, "message": message, "count": count, "total": total},
+ user=self.modified_by,
)
diff --git a/erpnext/regional/united_arab_emirates/setup.py b/erpnext/regional/united_arab_emirates/setup.py
index be621bc..36a0795 100644
--- a/erpnext/regional/united_arab_emirates/setup.py
+++ b/erpnext/regional/united_arab_emirates/setup.py
@@ -37,7 +37,7 @@
fieldname="vat_section",
label="VAT Details",
fieldtype="Section Break",
- insert_after="group_same_items",
+ insert_after="language",
print_hide=1,
collapsible=1,
),
diff --git a/erpnext/regional/united_states/setup.py b/erpnext/regional/united_states/setup.py
index b8f8572..47f24ef 100644
--- a/erpnext/regional/united_states/setup.py
+++ b/erpnext/regional/united_states/setup.py
@@ -49,7 +49,7 @@
dict(
fieldname="exempt_from_sales_tax",
fieldtype="Check",
- insert_after="represents_company",
+ insert_after="dn_required",
label="Is customer exempted from sales tax?",
)
],
diff --git a/erpnext/selling/doctype/customer/customer.json b/erpnext/selling/doctype/customer/customer.json
index 7cba141..7482a33 100644
--- a/erpnext/selling/doctype/customer/customer.json
+++ b/erpnext/selling/doctype/customer/customer.json
@@ -14,30 +14,35 @@
"naming_series",
"salutation",
"customer_name",
+ "customer_type",
+ "customer_group",
+ "column_break0",
+ "territory",
"gender",
- "default_bank_account",
- "tax_id",
- "tax_category",
- "tax_withholding_category",
"lead_name",
"opportunity_name",
- "image",
- "column_break0",
- "customer_group",
- "customer_type",
- "territory",
"account_manager",
- "so_required",
- "dn_required",
+ "image",
+ "defaults_tab",
+ "default_price_list",
+ "default_bank_account",
+ "column_break_14",
+ "default_currency",
+ "internal_customer_section",
"is_internal_customer",
"represents_company",
- "disabled",
- "allowed_to_transact_section",
+ "column_break_70",
"companies",
- "currency_and_price_list",
- "default_currency",
- "column_break_14",
- "default_price_list",
+ "more_info",
+ "market_segment",
+ "industry",
+ "customer_pos_id",
+ "website",
+ "language",
+ "column_break_45",
+ "customer_details",
+ "dashboard_tab",
+ "contact_and_address_tab",
"address_contacts",
"address_html",
"column_break1",
@@ -49,34 +54,39 @@
"column_break_26",
"customer_primary_address",
"primary_address",
- "default_receivable_accounts",
- "accounts",
+ "tax_tab",
+ "taxation_section",
+ "tax_id",
+ "column_break_21",
+ "tax_category",
+ "tax_withholding_category",
+ "accounting_tab",
"credit_limit_section",
"payment_terms",
"credit_limits",
- "more_info",
- "customer_details",
- "column_break_45",
- "market_segment",
- "industry",
- "website",
- "language",
- "is_frozen",
- "column_break_38",
+ "default_receivable_accounts",
+ "accounts",
+ "loyalty_points_tab",
"loyalty_program",
+ "column_break_54",
"loyalty_program_tier",
- "sales_team_section_break",
- "default_sales_partner",
- "default_commission_rate",
- "sales_team_section",
+ "sales_team_tab",
"sales_team",
- "customer_pos_id"
+ "sales_team_section",
+ "default_sales_partner",
+ "column_break_66",
+ "default_commission_rate",
+ "settings_tab",
+ "so_required",
+ "dn_required",
+ "column_break_53",
+ "is_frozen",
+ "disabled"
],
"fields": [
{
"fieldname": "basic_info",
"fieldtype": "Section Break",
- "label": "Name and Type",
"oldfieldtype": "Section Break",
"options": "fa fa-user"
},
@@ -217,24 +227,12 @@
},
{
"depends_on": "represents_company",
- "fieldname": "allowed_to_transact_section",
- "fieldtype": "Section Break",
- "label": "Allowed To Transact With"
- },
- {
- "depends_on": "represents_company",
"fieldname": "companies",
"fieldtype": "Table",
"label": "Allowed To Transact With",
"options": "Allowed To Transact With"
},
{
- "collapsible": 1,
- "fieldname": "currency_and_price_list",
- "fieldtype": "Section Break",
- "label": "Currency and Price List"
- },
- {
"fieldname": "default_currency",
"fieldtype": "Link",
"ignore_user_permissions": 1,
@@ -295,7 +293,7 @@
"description": "Select, to make the customer searchable with these fields",
"fieldname": "primary_address_and_contact_detail",
"fieldtype": "Section Break",
- "label": "Primary Address and Contact Detail"
+ "label": "Primary Address and Contact"
},
{
"description": "Reselect, if the chosen contact is edited after save",
@@ -334,20 +332,18 @@
"read_only": 1
},
{
- "collapsible": 1,
"fieldname": "default_receivable_accounts",
"fieldtype": "Section Break",
"label": "Default Receivable Accounts"
},
{
- "description": "Mention if non-standard receivable account",
+ "description": "Mention if a non-standard receivable account",
"fieldname": "accounts",
"fieldtype": "Table",
- "label": "Accounts",
+ "label": "Receivable Accounts",
"options": "Party Account"
},
{
- "collapsible": 1,
"fieldname": "credit_limit_section",
"fieldtype": "Section Break",
"label": "Credit Limit and Payment Terms"
@@ -398,12 +394,6 @@
"label": "Is Frozen"
},
{
- "collapsible": 1,
- "fieldname": "column_break_38",
- "fieldtype": "Section Break",
- "label": "Loyalty Points"
- },
- {
"fieldname": "loyalty_program",
"fieldtype": "Link",
"label": "Loyalty Program",
@@ -418,15 +408,6 @@
"read_only": 1
},
{
- "collapsible": 1,
- "collapsible_depends_on": "default_sales_partner",
- "fieldname": "sales_team_section_break",
- "fieldtype": "Section Break",
- "label": "Sales Partner and Commission",
- "oldfieldtype": "Section Break",
- "options": "fa fa-group"
- },
- {
"fieldname": "default_sales_partner",
"fieldtype": "Link",
"ignore_user_permissions": 1,
@@ -446,13 +427,12 @@
"collapsible": 1,
"collapsible_depends_on": "sales_team",
"fieldname": "sales_team_section",
- "fieldtype": "Section Break",
- "label": "Sales Team"
+ "fieldtype": "Section Break"
},
{
"fieldname": "sales_team",
"fieldtype": "Table",
- "label": "Sales Team Details",
+ "label": "Sales Team",
"oldfieldname": "sales_team",
"oldfieldtype": "Table",
"options": "Sales Team"
@@ -498,6 +478,83 @@
"no_copy": 1,
"options": "Opportunity",
"print_hide": 1
+ },
+ {
+ "fieldname": "contact_and_address_tab",
+ "fieldtype": "Tab Break",
+ "label": "Contact & Address"
+ },
+ {
+ "fieldname": "defaults_tab",
+ "fieldtype": "Section Break",
+ "label": "Defaults"
+ },
+ {
+ "fieldname": "settings_tab",
+ "fieldtype": "Tab Break",
+ "label": "Settings"
+ },
+ {
+ "collapsible": 1,
+ "collapsible_depends_on": "default_sales_partner",
+ "fieldname": "sales_team_tab",
+ "fieldtype": "Tab Break",
+ "label": "Sales Team",
+ "oldfieldtype": "Section Break",
+ "options": "fa fa-group"
+ },
+ {
+ "fieldname": "column_break_66",
+ "fieldtype": "Column Break"
+ },
+ {
+ "fieldname": "column_break_21",
+ "fieldtype": "Column Break"
+ },
+ {
+ "fieldname": "dashboard_tab",
+ "fieldtype": "Tab Break",
+ "label": "Dashboard",
+ "show_dashboard": 1
+ },
+ {
+ "fieldname": "column_break_53",
+ "fieldtype": "Column Break"
+ },
+ {
+ "collapsible": 1,
+ "fieldname": "loyalty_points_tab",
+ "fieldtype": "Section Break",
+ "label": "Loyalty Points"
+ },
+ {
+ "fieldname": "taxation_section",
+ "fieldtype": "Section Break"
+ },
+ {
+ "fieldname": "accounting_tab",
+ "fieldtype": "Tab Break",
+ "label": "Accounting"
+ },
+ {
+ "fieldname": "tax_tab",
+ "fieldtype": "Tab Break",
+ "label": "Tax"
+ },
+ {
+ "collapsible": 1,
+ "collapsible_depends_on": "is_internal_customer",
+ "fieldname": "internal_customer_section",
+ "fieldtype": "Section Break",
+ "label": "Internal Customer"
+ },
+ {
+ "fieldname": "column_break_70",
+ "fieldtype": "Column Break"
+ },
+ {
+ "fieldname": "column_break_54",
+ "fieldtype": "Column Break"
}
],
"icon": "fa fa-user",
@@ -511,7 +568,7 @@
"link_fieldname": "party"
}
],
- "modified": "2022-04-16 20:32:34.000304",
+ "modified": "2022-11-08 15:52:34.462657",
"modified_by": "Administrator",
"module": "Selling",
"name": "Customer",
diff --git a/erpnext/selling/doctype/customer/customer.py b/erpnext/selling/doctype/customer/customer.py
index 6605685..d0eb377 100644
--- a/erpnext/selling/doctype/customer/customer.py
+++ b/erpnext/selling/doctype/customer/customer.py
@@ -294,7 +294,7 @@
def after_rename(self, olddn, newdn, merge=False):
if frappe.defaults.get_global_default("cust_master_name") == "Customer Name":
- frappe.db.set(self, "customer_name", newdn)
+ self.db_set("customer_name", newdn)
def set_loyalty_program(self):
if self.loyalty_program:
diff --git a/erpnext/selling/doctype/customer/test_customer.py b/erpnext/selling/doctype/customer/test_customer.py
index 7dc3fab..a621c73 100644
--- a/erpnext/selling/doctype/customer/test_customer.py
+++ b/erpnext/selling/doctype/customer/test_customer.py
@@ -3,6 +3,7 @@
import frappe
+from frappe.custom.doctype.property_setter.property_setter import make_property_setter
from frappe.test_runner import make_test_records
from frappe.tests.utils import FrappeTestCase
from frappe.utils import flt
@@ -341,6 +342,37 @@
due_date = get_due_date("2017-01-22", "Customer", "_Test Customer")
self.assertEqual(due_date, "2017-01-22")
+ def test_serach_fields_for_customer(self):
+ from erpnext.controllers.queries import customer_query
+
+ frappe.db.set_value("Selling Settings", None, "cust_master_name", "Naming Series")
+
+ make_property_setter(
+ "Customer", None, "search_fields", "customer_group", "Data", for_doctype="Doctype"
+ )
+
+ data = customer_query(
+ "Customer", "_Test Customer", "", 0, 20, filters={"name": "_Test Customer"}, as_dict=True
+ )
+
+ self.assertEqual(data[0].name, "_Test Customer")
+ self.assertEqual(data[0].customer_group, "_Test Customer Group")
+ self.assertTrue("territory" not in data[0])
+
+ make_property_setter(
+ "Customer", None, "search_fields", "customer_group, territory", "Data", for_doctype="Doctype"
+ )
+ data = customer_query(
+ "Customer", "_Test Customer", "", 0, 20, filters={"name": "_Test Customer"}, as_dict=True
+ )
+
+ self.assertEqual(data[0].name, "_Test Customer")
+ self.assertEqual(data[0].customer_group, "_Test Customer Group")
+ self.assertEqual(data[0].territory, "_Test Territory")
+ self.assertTrue("territory" in data[0])
+
+ frappe.db.set_value("Selling Settings", None, "cust_master_name", "Customer Name")
+
def get_customer_dict(customer_name):
return {
diff --git a/erpnext/selling/doctype/customer_credit_limit/customer_credit_limit.json b/erpnext/selling/doctype/customer_credit_limit/customer_credit_limit.json
index 800cb57..2fd0c67 100644
--- a/erpnext/selling/doctype/customer_credit_limit/customer_credit_limit.json
+++ b/erpnext/selling/doctype/customer_credit_limit/customer_credit_limit.json
@@ -12,7 +12,7 @@
],
"fields": [
{
- "columns": 4,
+ "columns": 3,
"fieldname": "credit_limit",
"fieldtype": "Currency",
"in_list_view": 1,
@@ -31,6 +31,7 @@
"options": "Company"
},
{
+ "columns": 3,
"default": "0",
"fieldname": "bypass_credit_limit_check",
"fieldtype": "Check",
@@ -40,7 +41,7 @@
],
"istable": 1,
"links": [],
- "modified": "2019-12-31 15:43:05.822328",
+ "modified": "2022-11-08 15:19:13.927194",
"modified_by": "Administrator",
"module": "Selling",
"name": "Customer Credit Limit",
@@ -48,5 +49,6 @@
"permissions": [],
"quick_entry": 1,
"sort_field": "modified",
- "sort_order": "DESC"
+ "sort_order": "DESC",
+ "states": []
}
\ No newline at end of file
diff --git a/erpnext/selling/doctype/installation_note/installation_note.py b/erpnext/selling/doctype/installation_note/installation_note.py
index dd0b1e8..0ef4754 100644
--- a/erpnext/selling/doctype/installation_note/installation_note.py
+++ b/erpnext/selling/doctype/installation_note/installation_note.py
@@ -87,13 +87,13 @@
frappe.throw(_("Please pull items from Delivery Note"))
def on_update(self):
- frappe.db.set(self, "status", "Draft")
+ self.db_set("status", "Draft")
def on_submit(self):
self.validate_serial_no()
self.update_prevdoc_status()
- frappe.db.set(self, "status", "Submitted")
+ self.db_set("status", "Submitted")
def on_cancel(self):
self.update_prevdoc_status()
- frappe.db.set(self, "status", "Cancelled")
+ self.db_set("status", "Cancelled")
diff --git a/erpnext/selling/doctype/quotation/quotation.js b/erpnext/selling/doctype/quotation/quotation.js
index 70ae085..6b42e4d 100644
--- a/erpnext/selling/doctype/quotation/quotation.js
+++ b/erpnext/selling/doctype/quotation/quotation.js
@@ -84,11 +84,12 @@
}
}
- if(doc.docstatus == 1 && !(['Lost', 'Ordered']).includes(doc.status)) {
- if(!doc.valid_till || frappe.datetime.get_diff(doc.valid_till, frappe.datetime.get_today()) >= 0) {
- cur_frm.add_custom_button(__('Sales Order'),
- cur_frm.cscript['Make Sales Order'], __('Create'));
- }
+ if (doc.docstatus == 1 && !["Lost", "Ordered"].includes(doc.status)) {
+ this.frm.add_custom_button(
+ __("Sales Order"),
+ this.frm.cscript["Make Sales Order"],
+ __("Create")
+ );
if(doc.status!=="Ordered") {
this.frm.add_custom_button(__('Set as Lost'), () => {
diff --git a/erpnext/selling/doctype/quotation/quotation.json b/erpnext/selling/doctype/quotation/quotation.json
index c58a46b..fa64b16 100644
--- a/erpnext/selling/doctype/quotation/quotation.json
+++ b/erpnext/selling/doctype/quotation/quotation.json
@@ -15,26 +15,13 @@
"quotation_to",
"party_name",
"customer_name",
- "column_break1",
- "amended_from",
- "company",
+ "column_break_7",
"transaction_date",
"valid_till",
+ "column_break1",
"order_type",
- "contact_section",
- "customer_address",
- "address_display",
- "contact_person",
- "contact_display",
- "contact_mobile",
- "contact_email",
- "col_break98",
- "shipping_address_name",
- "shipping_address",
- "company_address",
- "company_address_display",
- "customer_group",
- "territory",
+ "company",
+ "amended_from",
"currency_and_price_list",
"currency",
"conversion_rate",
@@ -43,79 +30,105 @@
"price_list_currency",
"plc_conversion_rate",
"ignore_pricing_rule",
- "section_break_33",
- "scan_barcode",
"items_section",
+ "scan_barcode",
"items",
- "bundle_items_section",
- "packed_items",
- "pricing_rule_details",
- "pricing_rules",
"sec_break23",
"total_qty",
+ "total_net_weight",
+ "column_break_28",
"base_total",
"base_net_total",
- "column_break_28",
+ "column_break_31",
"total",
"net_total",
- "total_net_weight",
"taxes_section",
+ "taxes_and_charges",
+ "column_break_36",
"tax_category",
"column_break_34",
"shipping_rule",
"section_break_36",
- "taxes_and_charges",
"taxes",
- "sec_tax_breakup",
- "other_charges_calculation",
"section_break_39",
"base_total_taxes_and_charges",
"column_break_42",
"total_taxes_and_charges",
- "section_break_44",
- "coupon_code",
- "referral_sales_partner",
- "apply_discount_on",
- "base_discount_amount",
- "column_break_46",
- "additional_discount_percentage",
- "discount_amount",
"totals",
"base_grand_total",
"base_rounding_adjustment",
- "base_in_words",
"base_rounded_total",
+ "base_in_words",
"column_break3",
"grand_total",
"rounding_adjustment",
"rounded_total",
"in_words",
+ "section_break_44",
+ "apply_discount_on",
+ "base_discount_amount",
+ "coupon_code",
+ "column_break_46",
+ "additional_discount_percentage",
+ "discount_amount",
+ "referral_sales_partner",
+ "sec_tax_breakup",
+ "other_charges_calculation",
+ "bundle_items_section",
+ "packed_items",
+ "pricing_rule_details",
+ "pricing_rules",
+ "address_and_contact_tab",
+ "billing_address_section",
+ "customer_address",
+ "address_display",
+ "col_break98",
+ "contact_person",
+ "contact_display",
+ "contact_mobile",
+ "contact_email",
+ "shipping_address_section",
+ "shipping_address_name",
+ "column_break_81",
+ "shipping_address",
+ "company_address_section",
+ "company_address",
+ "column_break_87",
+ "company_address_display",
+ "terms_tab",
"payment_schedule_section",
"payment_terms_template",
"payment_schedule",
"terms_section_break",
"tc_name",
"terms",
+ "more_info_tab",
+ "subscription_section",
+ "auto_repeat",
+ "update_auto_repeat_reference",
"print_settings",
"letter_head",
"group_same_items",
"column_break_73",
"select_print_heading",
"language",
- "subscription_section",
- "auto_repeat",
- "update_auto_repeat_reference",
- "more_info",
+ "lost_reasons_section",
+ "lost_reasons",
+ "competitors",
+ "column_break_117",
+ "order_lost_reason",
+ "additional_info_section",
+ "status",
+ "customer_group",
+ "territory",
+ "column_break_108",
"campaign",
"source",
- "order_lost_reason",
"column_break4",
- "status",
- "enq_det",
- "supplier_quotation",
"opportunity",
- "lost_reasons",
- "competitors"
+ "supplier_quotation",
+ "enq_det",
+ "connections_tab"
],
"fields": [
{
@@ -242,14 +255,6 @@
"reqd": 1
},
{
- "collapsible": 1,
- "depends_on": "party_name",
- "fieldname": "contact_section",
- "fieldtype": "Section Break",
- "label": "Address and Contact",
- "options": "fa fa-bullhorn"
- },
- {
"fieldname": "customer_address",
"fieldtype": "Link",
"label": "Customer Address",
@@ -296,7 +301,7 @@
"read_only": 1
},
{
- "depends_on": "eval:doc.quotation_to=='Customer' && doc.party_name",
+ "depends_on": "eval:(doc.quotation_to=='Customer' && doc.party_name)",
"fieldname": "col_break98",
"fieldtype": "Column Break",
"width": "50%"
@@ -316,7 +321,7 @@
"read_only": 1
},
{
- "depends_on": "eval:doc.quotation_to=='Customer' && doc.party_name",
+ "depends_on": "eval:(doc.quotation_to=='Customer' && doc.party_name)",
"fieldname": "customer_group",
"fieldtype": "Link",
"hidden": 1,
@@ -408,6 +413,8 @@
{
"fieldname": "items_section",
"fieldtype": "Section Break",
+ "hide_border": 1,
+ "label": "Items",
"oldfieldtype": "Section Break",
"options": "fa fa-shopping-cart"
},
@@ -415,7 +422,6 @@
"allow_bulk_edit": 1,
"fieldname": "items",
"fieldtype": "Table",
- "label": "Items",
"oldfieldname": "quotation_details",
"oldfieldtype": "Table",
"options": "Quotation Item",
@@ -423,6 +429,7 @@
"width": "40px"
},
{
+ "collapsible": 1,
"fieldname": "pricing_rule_details",
"fieldtype": "Section Break",
"label": "Pricing Rules"
@@ -483,6 +490,7 @@
"read_only": 1
},
{
+ "depends_on": "total_net_weight",
"fieldname": "total_net_weight",
"fieldtype": "Float",
"label": "Total Net Weight",
@@ -492,6 +500,7 @@
{
"fieldname": "taxes_section",
"fieldtype": "Section Break",
+ "hide_border": 1,
"label": "Taxes and Charges",
"oldfieldtype": "Section Break",
"options": "fa fa-money"
@@ -517,7 +526,8 @@
},
{
"fieldname": "section_break_36",
- "fieldtype": "Section Break"
+ "fieldtype": "Section Break",
+ "hide_border": 1
},
{
"fieldname": "taxes_and_charges",
@@ -579,10 +589,9 @@
},
{
"collapsible": 1,
- "collapsible_depends_on": "discount_amount",
"fieldname": "section_break_44",
"fieldtype": "Section Break",
- "label": "Additional Discount and Coupon Code"
+ "label": "Additional Discount"
},
{
"fieldname": "coupon_code",
@@ -632,6 +641,7 @@
{
"fieldname": "totals",
"fieldtype": "Section Break",
+ "label": "Totals",
"oldfieldtype": "Section Break",
"options": "fa fa-money",
"print_hide": 1
@@ -657,7 +667,6 @@
"read_only": 1
},
{
- "description": "In Words will be visible once you save the Quotation.",
"fieldname": "base_in_words",
"fieldtype": "Data",
"label": "In Words (Company Currency)",
@@ -665,8 +674,7 @@
"oldfieldname": "in_words",
"oldfieldtype": "Data",
"print_hide": 1,
- "read_only": 1,
- "width": "200px"
+ "read_only": 1
},
{
"fieldname": "base_rounded_total",
@@ -749,7 +757,6 @@
"print_hide": 1
},
{
- "collapsible": 1,
"collapsible_depends_on": "terms",
"fieldname": "terms_section_break",
"fieldtype": "Section Break",
@@ -824,7 +831,7 @@
{
"fieldname": "subscription_section",
"fieldtype": "Section Break",
- "label": "Auto Repeat Section"
+ "label": "Auto Repeat"
},
{
"fieldname": "auto_repeat",
@@ -837,21 +844,12 @@
},
{
"allow_on_submit": 1,
- "depends_on": "eval: doc.auto_repeat",
+ "depends_on": "eval:doc.auto_repeat",
"fieldname": "update_auto_repeat_reference",
"fieldtype": "Button",
"label": "Update Auto Repeat Reference"
},
{
- "collapsible": 1,
- "fieldname": "more_info",
- "fieldtype": "Section Break",
- "label": "More Information",
- "oldfieldtype": "Section Break",
- "options": "fa fa-file-text",
- "print_hide": 1
- },
- {
"fieldname": "campaign",
"fieldtype": "Link",
"label": "Campaign",
@@ -871,7 +869,7 @@
},
{
"allow_on_submit": 1,
- "depends_on": "eval:doc.status===\"Lost\"",
+ "depends_on": "eval:doc.status=='Lost'",
"fieldname": "order_lost_reason",
"fieldtype": "Small Text",
"label": "Detailed Reason",
@@ -934,7 +932,6 @@
"read_only": 1
},
{
- "depends_on": "packed_items",
"fieldname": "packed_items",
"fieldtype": "Table",
"label": "Bundle Items",
@@ -943,7 +940,6 @@
},
{
"collapsible": 1,
- "collapsible_depends_on": "packed_items",
"depends_on": "packed_items",
"fieldname": "bundle_items_section",
"fieldtype": "Section Break",
@@ -971,21 +967,98 @@
"read_only": 1
},
{
- "fieldname": "section_break_33",
- "fieldtype": "Section Break"
- },
- {
"fieldname": "scan_barcode",
"fieldtype": "Data",
"label": "Scan Barcode",
"options": "Barcode"
+ },
+ {
+ "fieldname": "address_and_contact_tab",
+ "fieldtype": "Tab Break",
+ "label": "Address & Contact"
+ },
+ {
+ "fieldname": "terms_tab",
+ "fieldtype": "Tab Break",
+ "label": "Terms"
+ },
+ {
+ "fieldname": "more_info_tab",
+ "fieldtype": "Tab Break",
+ "label": "More Info"
+ },
+ {
+ "fieldname": "connections_tab",
+ "fieldtype": "Tab Break",
+ "label": "Connections",
+ "show_dashboard": 1
+ },
+ {
+ "fieldname": "column_break_7",
+ "fieldtype": "Column Break"
+ },
+ {
+ "fieldname": "column_break_31",
+ "fieldtype": "Column Break"
+ },
+ {
+ "fieldname": "column_break_36",
+ "fieldtype": "Column Break"
+ },
+ {
+ "fieldname": "billing_address_section",
+ "fieldtype": "Section Break",
+ "label": "Billing Address",
+ "options": "fa fa-bullhorn"
+ },
+ {
+ "fieldname": "shipping_address_section",
+ "fieldtype": "Section Break",
+ "label": "Shipping Address"
+ },
+ {
+ "fieldname": "column_break_81",
+ "fieldtype": "Column Break"
+ },
+ {
+ "fieldname": "company_address_section",
+ "fieldtype": "Section Break",
+ "label": "Company Address"
+ },
+ {
+ "fieldname": "column_break_87",
+ "fieldtype": "Column Break"
+ },
+ {
+ "collapsible": 1,
+ "depends_on": "eval:(doc.lost_reasons || doc.order_lost_reason)",
+ "fieldname": "lost_reasons_section",
+ "fieldtype": "Section Break",
+ "label": "Lost Reasons"
+ },
+ {
+ "fieldname": "column_break_117",
+ "fieldtype": "Column Break"
+ },
+ {
+ "collapsible": 1,
+ "fieldname": "additional_info_section",
+ "fieldtype": "Section Break",
+ "label": "Additional Info",
+ "oldfieldtype": "Section Break",
+ "options": "fa fa-file-text",
+ "print_hide": 1
+ },
+ {
+ "fieldname": "column_break_108",
+ "fieldtype": "Column Break"
}
],
"icon": "fa fa-shopping-cart",
"idx": 82,
"is_submittable": 1,
"links": [],
- "modified": "2022-09-16 17:44:43.221804",
+ "modified": "2022-10-11 13:06:33.479650",
"modified_by": "Administrator",
"module": "Selling",
"name": "Quotation",
@@ -1083,4 +1156,4 @@
"states": [],
"timeline_field": "party_name",
"title_field": "title"
-}
+}
\ No newline at end of file
diff --git a/erpnext/selling/doctype/quotation/quotation.py b/erpnext/selling/doctype/quotation/quotation.py
index 96092b1..484b8c9 100644
--- a/erpnext/selling/doctype/quotation/quotation.py
+++ b/erpnext/selling/doctype/quotation/quotation.py
@@ -119,10 +119,10 @@
if not (self.is_fully_ordered() or self.is_partially_ordered()):
get_lost_reasons = frappe.get_list("Quotation Lost Reason", fields=["name"])
lost_reasons_lst = [reason.get("name") for reason in get_lost_reasons]
- frappe.db.set(self, "status", "Lost")
+ self.db_set("status", "Lost")
if detailed_reason:
- frappe.db.set(self, "order_lost_reason", detailed_reason)
+ self.db_set("order_lost_reason", detailed_reason)
for reason in lost_reasons_list:
if reason.get("lost_reason") in lost_reasons_lst:
@@ -247,7 +247,7 @@
"Quotation": {"doctype": "Sales Order", "validation": {"docstatus": ["=", 1]}},
"Quotation Item": {
"doctype": "Sales Order Item",
- "field_map": {"parent": "prevdoc_docname"},
+ "field_map": {"parent": "prevdoc_docname", "name": "quotation_item"},
"postprocess": update_item,
"condition": lambda doc: doc.qty > 0,
},
diff --git a/erpnext/selling/doctype/sales_order/sales_order.js b/erpnext/selling/doctype/sales_order/sales_order.js
index 386c12b..fb64772 100644
--- a/erpnext/selling/doctype/sales_order/sales_order.js
+++ b/erpnext/selling/doctype/sales_order/sales_order.js
@@ -124,6 +124,11 @@
return query;
});
+ // On cancel and amending a sales order with advance payment, reset advance paid amount
+ if (frm.is_new()) {
+ frm.set_value("advance_paid", 0)
+ }
+
frm.ignore_doctypes_on_cancel_all = ['Purchase Order'];
},
diff --git a/erpnext/selling/doctype/sales_order/sales_order.json b/erpnext/selling/doctype/sales_order/sales_order.json
index ff269d0..e6ff39d 100644
--- a/erpnext/selling/doctype/sales_order/sales_order.json
+++ b/erpnext/selling/doctype/sales_order/sales_order.json
@@ -15,37 +15,25 @@
"naming_series",
"customer",
"customer_name",
+ "tax_id",
"order_type",
- "skip_delivery_note",
- "column_break1",
- "amended_from",
- "company",
+ "column_break_7",
"transaction_date",
"delivery_date",
+ "column_break1",
"po_no",
"po_date",
- "tax_id",
+ "company",
+ "skip_delivery_note",
+ "amended_from",
"accounting_dimensions_section",
"cost_center",
"dimension_col_break",
"project",
- "contact_info",
- "customer_address",
- "address_display",
- "contact_person",
- "contact_display",
- "contact_phone",
- "contact_mobile",
- "contact_email",
- "company_address",
- "company_address_display",
- "col_break46",
- "shipping_address_name",
- "shipping_address",
- "dispatch_address_name",
- "dispatch_address",
- "customer_group",
- "territory",
+ "column_break_77",
+ "source",
+ "campaign",
+ "custom_dimensions_section",
"currency_and_price_list",
"currency",
"conversion_rate",
@@ -55,46 +43,32 @@
"plc_conversion_rate",
"ignore_pricing_rule",
"sec_warehouse",
+ "scan_barcode",
+ "column_break_28",
"set_warehouse",
"items_section",
- "scan_barcode",
"items",
- "packing_list",
- "packed_items",
- "pricing_rule_details",
- "pricing_rules",
"section_break_31",
- "column_break_33a",
"total_qty",
+ "total_net_weight",
+ "column_break_33",
"base_total",
"base_net_total",
- "column_break_33",
- "total_net_weight",
+ "column_break_33a",
"total",
"net_total",
"taxes_section",
- "tax_category",
+ "taxes_and_charges",
"column_break_38",
+ "tax_category",
+ "column_break_49",
"shipping_rule",
"section_break_40",
- "taxes_and_charges",
"taxes",
- "sec_tax_breakup",
- "other_charges_calculation",
"section_break_43",
"base_total_taxes_and_charges",
"column_break_46",
"total_taxes_and_charges",
- "loyalty_points_redemption",
- "loyalty_points",
- "loyalty_amount",
- "section_break_48",
- "coupon_code",
- "apply_discount_on",
- "base_discount_amount",
- "column_break_50",
- "additional_discount_percentage",
- "discount_amount",
"totals",
"base_grand_total",
"base_rounding_adjustment",
@@ -107,26 +81,49 @@
"in_words",
"advance_paid",
"disable_rounded_total",
+ "section_break_48",
+ "apply_discount_on",
+ "base_discount_amount",
+ "coupon_code",
+ "column_break_50",
+ "additional_discount_percentage",
+ "discount_amount",
+ "sec_tax_breakup",
+ "other_charges_calculation",
+ "packing_list",
+ "packed_items",
+ "pricing_rule_details",
+ "pricing_rules",
+ "contact_info",
+ "billing_address_column",
+ "customer_address",
+ "address_display",
+ "customer_group",
+ "territory",
+ "column_break_84",
+ "contact_person",
+ "contact_display",
+ "contact_phone",
+ "contact_mobile",
+ "contact_email",
+ "shipping_address_column",
+ "shipping_address_name",
+ "shipping_address",
+ "column_break_93",
+ "dispatch_address_name",
+ "dispatch_address",
+ "col_break46",
+ "company_address",
+ "column_break_92",
+ "company_address_display",
"payment_schedule_section",
+ "payment_terms_section",
"payment_terms_template",
"payment_schedule",
"terms_section_break",
"tc_name",
"terms",
"more_info",
- "is_internal_customer",
- "represents_company",
- "inter_company_order_reference",
- "party_account_currency",
- "column_break_77",
- "source",
- "campaign",
- "printing_details",
- "language",
- "letter_head",
- "column_break4",
- "select_print_heading",
- "group_same_items",
"section_break_78",
"status",
"delivery_status",
@@ -143,12 +140,29 @@
"total_commission",
"section_break1",
"sales_team",
+ "loyalty_points_redemption",
+ "loyalty_points",
+ "column_break_116",
+ "loyalty_amount",
"subscription_section",
"from_date",
"to_date",
"column_break_108",
"auto_repeat",
- "update_auto_repeat_reference"
+ "update_auto_repeat_reference",
+ "printing_details",
+ "letter_head",
+ "group_same_items",
+ "column_break4",
+ "select_print_heading",
+ "language",
+ "additional_info_section",
+ "is_internal_customer",
+ "represents_company",
+ "column_break_152",
+ "inter_company_order_reference",
+ "party_account_currency",
+ "connections_tab"
],
"fields": [
{
@@ -334,10 +348,10 @@
"collapsible": 1,
"depends_on": "customer",
"fieldname": "contact_info",
- "fieldtype": "Section Break",
+ "fieldtype": "Tab Break",
"hide_days": 1,
"hide_seconds": 1,
- "label": "Address and Contact",
+ "label": "Address & Contact",
"options": "fa fa-bullhorn"
},
{
@@ -414,9 +428,10 @@
},
{
"fieldname": "col_break46",
- "fieldtype": "Column Break",
+ "fieldtype": "Section Break",
"hide_days": 1,
"hide_seconds": 1,
+ "label": "Company Address",
"width": "50%"
},
{
@@ -550,8 +565,10 @@
{
"fieldname": "sec_warehouse",
"fieldtype": "Section Break",
+ "hide_border": 1,
"hide_days": 1,
- "hide_seconds": 1
+ "hide_seconds": 1,
+ "label": "Items"
},
{
"fieldname": "set_warehouse",
@@ -565,6 +582,7 @@
{
"fieldname": "items_section",
"fieldtype": "Section Break",
+ "hide_border": 1,
"hide_days": 1,
"hide_seconds": 1,
"oldfieldtype": "Section Break",
@@ -675,6 +693,7 @@
"read_only": 1
},
{
+ "depends_on": "total_net_weight",
"fieldname": "total_net_weight",
"fieldtype": "Float",
"hide_days": 1,
@@ -688,7 +707,7 @@
"fieldtype": "Section Break",
"hide_days": 1,
"hide_seconds": 1,
- "label": "Taxes and Charges",
+ "label": "Taxes",
"oldfieldtype": "Section Break",
"options": "fa fa-money"
},
@@ -720,6 +739,7 @@
{
"fieldname": "section_break_40",
"fieldtype": "Section Break",
+ "hide_border": 1,
"hide_days": 1,
"hide_seconds": 1
},
@@ -804,7 +824,7 @@
"hidden": 1,
"hide_days": 1,
"hide_seconds": 1,
- "label": "Loyalty Points Redemption",
+ "label": "Loyalty Points",
"print_hide": 1
},
{
@@ -828,12 +848,11 @@
},
{
"collapsible": 1,
- "collapsible_depends_on": "discount_amount",
"fieldname": "section_break_48",
"fieldtype": "Section Break",
"hide_days": 1,
"hide_seconds": 1,
- "label": "Additional Discount and Coupon Code"
+ "label": "Additional Discount"
},
{
"fieldname": "coupon_code",
@@ -891,6 +910,7 @@
"fieldtype": "Section Break",
"hide_days": 1,
"hide_seconds": 1,
+ "label": "Totals",
"oldfieldtype": "Section Break",
"options": "fa fa-money",
"print_hide": 1
@@ -1045,10 +1065,10 @@
},
{
"fieldname": "payment_schedule_section",
- "fieldtype": "Section Break",
+ "fieldtype": "Tab Break",
"hide_days": 1,
"hide_seconds": 1,
- "label": "Payment Terms"
+ "label": "Terms"
},
{
"fieldname": "payment_terms_template",
@@ -1070,13 +1090,12 @@
"print_hide": 1
},
{
- "collapsible": 1,
"collapsible_depends_on": "terms",
"fieldname": "terms_section_break",
"fieldtype": "Section Break",
"hide_days": 1,
"hide_seconds": 1,
- "label": "Terms and Conditions",
+ "label": "Terms & Conditions",
"oldfieldtype": "Section Break",
"options": "fa fa-legal"
},
@@ -1104,10 +1123,10 @@
"collapsible": 1,
"collapsible_depends_on": "project",
"fieldname": "more_info",
- "fieldtype": "Section Break",
+ "fieldtype": "Tab Break",
"hide_days": 1,
"hide_seconds": 1,
- "label": "More Information",
+ "label": "More Info",
"oldfieldtype": "Section Break",
"options": "fa fa-file-text",
"print_hide": 1
@@ -1122,7 +1141,6 @@
"read_only": 1
},
{
- "description": "Track this Sales Order against any Project",
"fieldname": "project",
"fieldtype": "Link",
"hide_days": 1,
@@ -1240,7 +1258,7 @@
"fieldtype": "Section Break",
"hide_days": 1,
"hide_seconds": 1,
- "label": "Billing and Delivery Status",
+ "label": "Status",
"oldfieldtype": "Column Break",
"print_hide": 1,
"width": "50%"
@@ -1410,7 +1428,7 @@
"fieldtype": "Section Break",
"hide_days": 1,
"hide_seconds": 1,
- "label": "Auto Repeat Section",
+ "label": "Auto Repeat",
"no_copy": 1,
"print_hide": 1,
"read_only": 1
@@ -1542,13 +1560,76 @@
{
"fieldname": "dimension_col_break",
"fieldtype": "Column Break"
+ },
+ {
+ "fieldname": "column_break_7",
+ "fieldtype": "Column Break"
+ },
+ {
+ "fieldname": "column_break_28",
+ "fieldtype": "Column Break"
+ },
+ {
+ "fieldname": "column_break_49",
+ "fieldtype": "Column Break"
+ },
+ {
+ "fieldname": "connections_tab",
+ "fieldtype": "Tab Break",
+ "label": "Connections",
+ "show_dashboard": 1
+ },
+ {
+ "fieldname": "payment_terms_section",
+ "fieldtype": "Section Break",
+ "label": "Payment Terms"
+ },
+ {
+ "fieldname": "column_break_116",
+ "fieldtype": "Column Break"
+ },
+ {
+ "fieldname": "billing_address_column",
+ "fieldtype": "Section Break",
+ "label": "Billing Address"
+ },
+ {
+ "fieldname": "shipping_address_column",
+ "fieldtype": "Section Break",
+ "label": "Shipping Address"
+ },
+ {
+ "fieldname": "column_break_93",
+ "fieldtype": "Column Break"
+ },
+ {
+ "fieldname": "column_break_84",
+ "fieldtype": "Column Break"
+ },
+ {
+ "fieldname": "column_break_92",
+ "fieldtype": "Column Break"
+ },
+ {
+ "fieldname": "custom_dimensions_section",
+ "fieldtype": "Section Break"
+ },
+ {
+ "collapsible": 1,
+ "fieldname": "additional_info_section",
+ "fieldtype": "Section Break",
+ "label": "Additional Info"
+ },
+ {
+ "fieldname": "column_break_152",
+ "fieldtype": "Column Break"
}
],
"icon": "fa fa-file-text",
"idx": 105,
"is_submittable": 1,
"links": [],
- "modified": "2022-09-16 17:43:57.007441",
+ "modified": "2022-10-11 13:06:10.469796",
"modified_by": "Administrator",
"module": "Selling",
"name": "Sales Order",
diff --git a/erpnext/selling/doctype/sales_order/sales_order.py b/erpnext/selling/doctype/sales_order/sales_order.py
index 25806d6..78e2370 100755
--- a/erpnext/selling/doctype/sales_order/sales_order.py
+++ b/erpnext/selling/doctype/sales_order/sales_order.py
@@ -18,6 +18,7 @@
update_linked_doc,
validate_inter_company_party,
)
+from erpnext.accounts.party import get_party_account
from erpnext.controllers.selling_controller import SellingController
from erpnext.manufacturing.doctype.production_plan.production_plan import (
get_items_for_material_requests,
@@ -192,6 +193,9 @@
{"Quotation": {"ref_dn_field": "prevdoc_docname", "compare_fields": [["company", "="]]}}
)
+ if cint(frappe.db.get_single_value("Selling Settings", "maintain_same_sales_rate")):
+ self.validate_rate_with_reference_doc([["Quotation", "prev_docname", "quotation_item"]])
+
def update_enquiry_status(self, prevdoc, flag):
enq = frappe.db.sql(
"select t2.prevdoc_docname from `tabQuotation` t1, `tabQuotation Item` t2 where t2.parent = t1.name and t1.name=%s",
@@ -245,7 +249,7 @@
self.update_project()
self.update_prevdoc_status("cancel")
- frappe.db.set(self, "status", "Cancelled")
+ self.db_set("status", "Cancelled")
self.update_blanket_order()
@@ -626,6 +630,7 @@
"field_map": {
"name": "sales_order",
"base_grand_total": "estimated_costing",
+ "net_total": "total_sales_amount",
},
},
},
@@ -727,6 +732,8 @@
if source.loyalty_points and source.order_type == "Shopping Cart":
target.redeem_loyalty_points = 1
+ target.debit_to = get_party_account("Customer", source.customer, source.company)
+
def update_item(source, target, source_parent):
target.amount = flt(source.amount) - flt(source.billed_amt)
target.base_amount = target.amount * flt(source_parent.conversion_rate)
diff --git a/erpnext/selling/doctype/sales_order/test_sales_order.py b/erpnext/selling/doctype/sales_order/test_sales_order.py
index adfb39c..e777f52 100644
--- a/erpnext/selling/doctype/sales_order/test_sales_order.py
+++ b/erpnext/selling/doctype/sales_order/test_sales_order.py
@@ -6,7 +6,7 @@
import frappe
import frappe.permissions
from frappe.core.doctype.user_permission.test_user_permission import create_user
-from frappe.tests.utils import FrappeTestCase
+from frappe.tests.utils import FrappeTestCase, change_settings
from frappe.utils import add_days, flt, getdate, nowdate, today
from erpnext.controllers.accounts_controller import update_child_qty_rate
@@ -1346,6 +1346,33 @@
self.assertRaises(frappe.LinkExistsError, so_doc.cancel)
+ @change_settings("Accounts Settings", {"unlink_advance_payment_on_cancelation_of_order": 1})
+ def test_advance_paid_upon_payment_cancellation(self):
+ from erpnext.accounts.doctype.payment_entry.test_payment_entry import get_payment_entry
+
+ so = make_sales_order()
+
+ pe = get_payment_entry("Sales Order", so.name, bank_account="_Test Bank - _TC")
+ pe.reference_no = "1"
+ pe.reference_date = nowdate()
+ pe.paid_from_account_currency = so.currency
+ pe.paid_to_account_currency = so.currency
+ pe.source_exchange_rate = 1
+ pe.target_exchange_rate = 1
+ pe.paid_amount = so.grand_total
+ pe.save(ignore_permissions=True)
+ pe.submit()
+ so.reload()
+
+ self.assertEqual(so.advance_paid, so.base_grand_total)
+
+ # cancel advance payment
+ pe.reload()
+ pe.cancel()
+
+ so.reload()
+ self.assertEqual(so.advance_paid, 0)
+
def test_cancel_sales_order_after_cancel_payment_entry(self):
from erpnext.accounts.doctype.payment_entry.test_payment_entry import get_payment_entry
@@ -1747,6 +1774,69 @@
sales_order.save()
self.assertEqual(sales_order.taxes[0].tax_amount, 0)
+ def test_sales_order_partial_advance_payment(self):
+ from erpnext.accounts.doctype.payment_entry.test_payment_entry import (
+ create_payment_entry,
+ get_payment_entry,
+ )
+ from erpnext.selling.doctype.customer.test_customer import get_customer_dict
+
+ # Make a customer
+ customer = get_customer_dict("QA Logistics")
+ frappe.get_doc(customer).insert()
+
+ # Make a Sales Order
+ so = make_sales_order(
+ customer="QA Logistics",
+ item_list=[
+ {"item_code": "_Test Item", "qty": 1, "rate": 200},
+ {"item_code": "_Test Item 2", "qty": 1, "rate": 300},
+ ],
+ )
+
+ # Create a advance payment against that Sales Order
+ pe = get_payment_entry("Sales Order", so.name, bank_account="_Test Bank - _TC")
+ pe.reference_no = "1"
+ pe.reference_date = nowdate()
+ pe.paid_from_account_currency = so.currency
+ pe.paid_to_account_currency = so.currency
+ pe.source_exchange_rate = 1
+ pe.target_exchange_rate = 1
+ pe.paid_amount = so.grand_total
+ pe.save(ignore_permissions=True)
+ pe.submit()
+
+ # Make standalone advance payment entry
+ create_payment_entry(
+ payment_type="Receive",
+ party_type="Customer",
+ party="QA Logistics",
+ paid_from="Debtors - _TC",
+ paid_to="_Test Bank - _TC",
+ save=1,
+ submit=1,
+ )
+
+ si = make_sales_invoice(so.name)
+
+ item = si.get("items")[1]
+ si.remove(item)
+
+ si.allocate_advances_automatically = 1
+ si.save()
+
+ self.assertEqual(len(si.get("advances")), 1)
+ self.assertEqual(si.get("advances")[0].allocated_amount, 200)
+ self.assertEqual(si.get("advances")[0].reference_name, pe.name)
+
+ si.submit()
+ pe.load_from_db()
+
+ self.assertEqual(pe.references[0].reference_name, si.name)
+ self.assertEqual(pe.references[0].allocated_amount, 200)
+ self.assertEqual(pe.references[1].reference_name, so.name)
+ self.assertEqual(pe.references[1].allocated_amount, 300)
+
def automatically_fetch_payment_terms(enable=1):
accounts_settings = frappe.get_doc("Accounts Settings")
diff --git a/erpnext/selling/doctype/sales_order_item/sales_order_item.json b/erpnext/selling/doctype/sales_order_item/sales_order_item.json
index 2cf836f..b801de3 100644
--- a/erpnext/selling/doctype/sales_order_item/sales_order_item.json
+++ b/erpnext/selling/doctype/sales_order_item/sales_order_item.json
@@ -70,6 +70,7 @@
"warehouse",
"target_warehouse",
"prevdoc_docname",
+ "quotation_item",
"col_break4",
"against_blanket_order",
"blanket_order",
@@ -94,8 +95,10 @@
"item_tax_rate",
"transaction_date",
"inter_transfer_reference_section",
+ "material_request",
"purchase_order",
"column_break_89",
+ "material_request_item",
"purchase_order_item"
],
"fields": [
@@ -272,6 +275,7 @@
},
{
"collapsible": 1,
+ "collapsible_depends_on": "eval: doc.margin_type || doc.discount_amount",
"fieldname": "discount_and_margin",
"fieldtype": "Section Break",
"label": "Discount and Margin"
@@ -837,12 +841,31 @@
"label": "Purchase Order Item",
"print_hide": 1,
"read_only": 1
+ },
+ {
+ "fieldname": "quotation_item",
+ "fieldtype": "Data",
+ "hidden": 1,
+ "label": "quotation_item",
+ "no_copy": 1,
+ "read_only": 1
+ },
+ {
+ "fieldname": "material_request",
+ "fieldtype": "Link",
+ "label": "Material Request",
+ "options": "Material Request"
+ },
+ {
+ "fieldname": "material_request_item",
+ "fieldtype": "Data",
+ "label": "Material Request Item"
}
],
"idx": 1,
"istable": 1,
"links": [],
- "modified": "2022-09-06 13:24:18.065312",
+ "modified": "2022-11-18 11:39:01.741665",
"modified_by": "Administrator",
"module": "Selling",
"name": "Sales Order Item",
diff --git a/erpnext/selling/page/point_of_sale/point_of_sale.py b/erpnext/selling/page/point_of_sale/point_of_sale.py
index c12a9f8..999ddc2 100644
--- a/erpnext/selling/page/point_of_sale/point_of_sale.py
+++ b/erpnext/selling/page/point_of_sale/point_of_sale.py
@@ -6,6 +6,7 @@
from typing import Dict, Optional
import frappe
+from frappe.utils import cint
from frappe.utils.nestedset import get_root_of
from erpnext.accounts.doctype.pos_invoice.pos_invoice import get_stock_availability
@@ -108,10 +109,10 @@
item.name asc
LIMIT
{page_length} offset {start}""".format(
- start=start,
- page_length=page_length,
- lft=lft,
- rgt=rgt,
+ start=cint(start),
+ page_length=cint(page_length),
+ lft=cint(lft),
+ rgt=cint(rgt),
condition=condition,
bin_join_selection=bin_join_selection,
bin_join_condition=bin_join_condition,
diff --git a/erpnext/selling/page/point_of_sale/pos_controller.js b/erpnext/selling/page/point_of_sale/pos_controller.js
index 24375d8..595b919 100644
--- a/erpnext/selling/page/point_of_sale/pos_controller.js
+++ b/erpnext/selling/page/point_of_sale/pos_controller.js
@@ -67,7 +67,7 @@
{
fieldtype: 'Link', label: __('POS Profile'),
options: 'POS Profile', fieldname: 'pos_profile', reqd: 1,
- get_query: () => pos_profile_query,
+ get_query: () => pos_profile_query(),
onchange: () => fetch_pos_payment_methods()
},
{
@@ -101,9 +101,11 @@
primary_action_label: __('Submit')
});
dialog.show();
- const pos_profile_query = {
- query: 'erpnext.accounts.doctype.pos_profile.pos_profile.pos_profile_query',
- filters: { company: dialog.fields_dict.company.get_value() }
+ const pos_profile_query = () => {
+ return {
+ query: 'erpnext.accounts.doctype.pos_profile.pos_profile.pos_profile_query',
+ filters: { company: dialog.fields_dict.company.get_value() }
+ }
};
}
diff --git a/erpnext/selling/page/point_of_sale/pos_item_selector.js b/erpnext/selling/page/point_of_sale/pos_item_selector.js
index 7a90fb0..b5eb048 100644
--- a/erpnext/selling/page/point_of_sale/pos_item_selector.js
+++ b/erpnext/selling/page/point_of_sale/pos_item_selector.js
@@ -103,9 +103,9 @@
<div class="flex items-center justify-center h-32 border-b-grey text-6xl text-grey-100">
<img
onerror="cur_pos.item_selector.handle_broken_image(this)"
- class="h-full" src="${item_image}"
+ class="h-full item-img" src="${item_image}"
alt="${frappe.get_abbr(item.item_name)}"
- style="object-fit: cover;">
+ >
</div>`;
} else {
return `<div class="item-qty-pill">
diff --git a/erpnext/selling/report/payment_terms_status_for_sales_order/payment_terms_status_for_sales_order.js b/erpnext/selling/report/payment_terms_status_for_sales_order/payment_terms_status_for_sales_order.js
index c068ae3..991ac71 100644
--- a/erpnext/selling/report/payment_terms_status_for_sales_order/payment_terms_status_for_sales_order.js
+++ b/erpnext/selling/report/payment_terms_status_for_sales_order/payment_terms_status_for_sales_order.js
@@ -74,7 +74,35 @@
]
}
}
- }
+ },
+ {
+ "fieldname":"from_due_date",
+ "label": __("From Due Date"),
+ "fieldtype": "Date",
+ },
+ {
+ "fieldname":"to_due_date",
+ "label": __("To Due Date"),
+ "fieldtype": "Date",
+ },
+ {
+ "fieldname":"status",
+ "label": __("Status"),
+ "fieldtype": "MultiSelectList",
+ "width": 100,
+ get_data: function(txt) {
+ let status = ["Overdue", "Unpaid", "Completed", "Partly Paid"]
+ let options = []
+ for (let option of status){
+ options.push({
+ "value": option,
+ "label": __(option),
+ "description": ""
+ })
+ }
+ return options
+ }
+ },
]
return filters;
}
diff --git a/erpnext/selling/report/payment_terms_status_for_sales_order/payment_terms_status_for_sales_order.py b/erpnext/selling/report/payment_terms_status_for_sales_order/payment_terms_status_for_sales_order.py
index 91f4a5e..8bf5686 100644
--- a/erpnext/selling/report/payment_terms_status_for_sales_order/payment_terms_status_for_sales_order.py
+++ b/erpnext/selling/report/payment_terms_status_for_sales_order/payment_terms_status_for_sales_order.py
@@ -162,6 +162,12 @@
if filters.item:
qb_criterions.append(qb.DocType("Sales Order Item").item_code == filters.item)
+ if filters.from_due_date:
+ qb_criterions.append(qb.DocType("Payment Schedule").due_date.gte(filters.from_due_date))
+
+ if filters.to_due_date:
+ qb_criterions.append(qb.DocType("Payment Schedule").due_date.lte(filters.to_due_date))
+
return qb_criterions
@@ -279,11 +285,19 @@
return chart
+def filter_on_calculated_status(filters, sales_orders):
+ if filters.status and sales_orders:
+ return [x for x in sales_orders if x.status in filters.status]
+ return sales_orders
+
+
def execute(filters=None):
columns = get_columns()
sales_orders, so_invoices = get_so_with_invoices(filters)
sales_orders, so_invoices = set_payment_terms_statuses(sales_orders, so_invoices, filters)
+ sales_orders = filter_on_calculated_status(filters, sales_orders)
+
prepare_chart(sales_orders)
data = sales_orders
diff --git a/erpnext/selling/report/payment_terms_status_for_sales_order/test_payment_terms_status_for_sales_order.py b/erpnext/selling/report/payment_terms_status_for_sales_order/test_payment_terms_status_for_sales_order.py
index 9d542f5..525ae8e 100644
--- a/erpnext/selling/report/payment_terms_status_for_sales_order/test_payment_terms_status_for_sales_order.py
+++ b/erpnext/selling/report/payment_terms_status_for_sales_order/test_payment_terms_status_for_sales_order.py
@@ -2,7 +2,7 @@
import frappe
from frappe.tests.utils import FrappeTestCase
-from frappe.utils import add_days
+from frappe.utils import add_days, nowdate
from erpnext.selling.doctype.sales_order.sales_order import make_sales_invoice
from erpnext.selling.doctype.sales_order.test_sales_order import make_sales_order
@@ -77,12 +77,14 @@
sinv.insert()
sinv.submit()
columns, data, message, chart = execute(
- {
- "company": "_Test Company",
- "period_start_date": "2021-06-01",
- "period_end_date": "2021-06-30",
- "item": item.item_code,
- }
+ frappe._dict(
+ {
+ "company": "_Test Company",
+ "period_start_date": "2021-06-01",
+ "period_end_date": "2021-06-30",
+ "item": item.item_code,
+ }
+ )
)
expected_value = [
@@ -167,12 +169,14 @@
sinv.insert()
sinv.submit()
columns, data, message, chart = execute(
- {
- "company": "_Test Company",
- "period_start_date": "2021-06-01",
- "period_end_date": "2021-06-30",
- "item": item.item_code,
- }
+ frappe._dict(
+ {
+ "company": "_Test Company",
+ "period_start_date": "2021-06-01",
+ "period_end_date": "2021-06-30",
+ "item": item.item_code,
+ }
+ )
)
# report defaults to company currency.
@@ -338,3 +342,60 @@
with self.subTest(filters=filters):
columns, data, message, chart = execute(filters)
self.assertEqual(data, expected_values_for_group_filters[idx])
+
+ def test_04_due_date_filter(self):
+ self.create_payment_terms_template()
+ item = create_item(item_code="_Test Excavator 1", is_stock_item=0)
+ transaction_date = nowdate()
+ so = make_sales_order(
+ transaction_date=add_days(transaction_date, -30),
+ delivery_date=add_days(transaction_date, -15),
+ item=item.item_code,
+ qty=10,
+ rate=100000,
+ do_not_save=True,
+ )
+ so.po_no = ""
+ so.taxes_and_charges = ""
+ so.taxes = ""
+ so.payment_terms_template = self.template.name
+ so.save()
+ so.submit()
+
+ # make invoice with 60% of the total sales order value
+ sinv = make_sales_invoice(so.name)
+ sinv.taxes_and_charges = ""
+ sinv.taxes = ""
+ sinv.items[0].qty = 6
+ sinv.insert()
+ sinv.submit()
+ columns, data, message, chart = execute(
+ frappe._dict(
+ {
+ "company": "_Test Company",
+ "item": item.item_code,
+ "from_due_date": add_days(transaction_date, -30),
+ "to_due_date": add_days(transaction_date, -15),
+ }
+ )
+ )
+
+ expected_value = [
+ {
+ "name": so.name,
+ "customer": so.customer,
+ "submitted": datetime.date.fromisoformat(add_days(transaction_date, -30)),
+ "status": "Completed",
+ "payment_term": None,
+ "description": "_Test 50-50",
+ "due_date": datetime.date.fromisoformat(add_days(transaction_date, -15)),
+ "invoice_portion": 50.0,
+ "currency": "INR",
+ "base_payment_amount": 500000.0,
+ "paid_amount": 500000.0,
+ "invoices": "," + sinv.name,
+ },
+ ]
+ # Only the first term should be pulled
+ self.assertEqual(len(data), 1)
+ self.assertEqual(data, expected_value)
diff --git a/erpnext/selling/report/sales_analytics/sales_analytics.py b/erpnext/selling/report/sales_analytics/sales_analytics.py
index 1863528..605d2fa 100644
--- a/erpnext/selling/report/sales_analytics/sales_analytics.py
+++ b/erpnext/selling/report/sales_analytics/sales_analytics.py
@@ -313,11 +313,13 @@
def get_period(self, posting_date):
if self.filters.range == "Weekly":
- period = "Week " + str(posting_date.isocalendar()[1]) + " " + str(posting_date.year)
+ period = _("Week {0} {1}").format(str(posting_date.isocalendar()[1]), str(posting_date.year))
elif self.filters.range == "Monthly":
- period = str(self.months[posting_date.month - 1]) + " " + str(posting_date.year)
+ period = _(str(self.months[posting_date.month - 1])) + " " + str(posting_date.year)
elif self.filters.range == "Quarterly":
- period = "Quarter " + str(((posting_date.month - 1) // 3) + 1) + " " + str(posting_date.year)
+ period = _("Quarter {0} {1}").format(
+ str(((posting_date.month - 1) // 3) + 1), str(posting_date.year)
+ )
else:
year = get_fiscal_year(posting_date, company=self.filters.company)
period = str(year[0])
diff --git a/erpnext/setup/doctype/brand/brand.js b/erpnext/setup/doctype/brand/brand.js
index 3680906..0abb71a 100644
--- a/erpnext/setup/doctype/brand/brand.js
+++ b/erpnext/setup/doctype/brand/brand.js
@@ -1,13 +1,71 @@
// Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
// License: GNU General Public License v3. See license.txt
+frappe.ui.form.on('Brand', {
+ setup: (frm) => {
+ frm.fields_dict["brand_defaults"].grid.get_field("default_warehouse").get_query = function(doc, cdt, cdn) {
+ const row = locals[cdt][cdn];
+ return {
+ filters: { company: row.company }
+ }
+ }
+ frm.fields_dict["brand_defaults"].grid.get_field("default_discount_account").get_query = function(doc, cdt, cdn) {
+ const row = locals[cdt][cdn];
+ return {
+ filters: {
+ 'report_type': 'Profit and Loss',
+ 'company': row.company,
+ "is_group": 0
+ }
+ };
+ }
-//--------- ONLOAD -------------
-cur_frm.cscript.onload = function(doc, cdt, cdn) {
+ frm.fields_dict["brand_defaults"].grid.get_field("buying_cost_center").get_query = function(doc, cdt, cdn) {
+ const row = locals[cdt][cdn];
+ return {
+ filters: {
+ "is_group": 0,
+ "company": row.company
+ }
+ }
+ }
-}
+ frm.fields_dict["brand_defaults"].grid.get_field("expense_account").get_query = function(doc, cdt, cdn) {
+ const row = locals[cdt][cdn];
+ return {
+ query: "erpnext.controllers.queries.get_expense_account",
+ filters: { company: row.company }
+ }
+ }
-cur_frm.cscript.refresh = function(doc, cdt, cdn) {
+ frm.fields_dict["brand_defaults"].grid.get_field("default_provisional_account").get_query = function(doc, cdt, cdn) {
+ const row = locals[cdt][cdn];
+ return {
+ filters: {
+ "company": row.company,
+ "root_type": ["in", ["Liability", "Asset"]],
+ "is_group": 0
+ }
+ };
+ }
-}
+ frm.fields_dict["brand_defaults"].grid.get_field("selling_cost_center").get_query = function(doc, cdt, cdn) {
+ const row = locals[cdt][cdn];
+ return {
+ filters: {
+ "is_group": 0,
+ "company": row.company
+ }
+ }
+ }
+
+ frm.fields_dict["brand_defaults"].grid.get_field("income_account").get_query = function(doc, cdt, cdn) {
+ const row = locals[cdt][cdn];
+ return {
+ query: "erpnext.controllers.queries.get_income_account",
+ filters: { company: row.company }
+ }
+ }
+ }
+});
\ No newline at end of file
diff --git a/erpnext/setup/doctype/company/company.py b/erpnext/setup/doctype/company/company.py
index 490504a..d6f2378 100644
--- a/erpnext/setup/doctype/company/company.py
+++ b/erpnext/setup/doctype/company/company.py
@@ -207,15 +207,14 @@
frappe.local.flags.ignore_root_company_validation = True
create_charts(self.name, self.chart_of_accounts, self.existing_company)
- frappe.db.set(
- self,
+ self.db_set(
"default_receivable_account",
frappe.db.get_value(
"Account", {"company": self.name, "account_type": "Receivable", "is_group": 0}
),
)
- frappe.db.set(
- self,
+
+ self.db_set(
"default_payable_account",
frappe.db.get_value(
"Account", {"company": self.name, "account_type": "Payable", "is_group": 0}
@@ -491,12 +490,12 @@
cc_doc.flags.ignore_mandatory = True
cc_doc.insert()
- frappe.db.set(self, "cost_center", _("Main") + " - " + self.abbr)
- frappe.db.set(self, "round_off_cost_center", _("Main") + " - " + self.abbr)
- frappe.db.set(self, "depreciation_cost_center", _("Main") + " - " + self.abbr)
+ self.db_set("cost_center", _("Main") + " - " + self.abbr)
+ self.db_set("round_off_cost_center", _("Main") + " - " + self.abbr)
+ self.db_set("depreciation_cost_center", _("Main") + " - " + self.abbr)
def after_rename(self, olddn, newdn, merge=False):
- frappe.db.set(self, "company_name", newdn)
+ self.db_set("company_name", newdn)
frappe.db.sql(
"""update `tabDefaultValue` set defvalue=%s
@@ -690,11 +689,11 @@
name as value,
is_group as expandable
from
- `tab{doctype}` comp
+ `tabCompany` comp
where
ifnull(parent_company, "")={parent}
""".format(
- doctype=doctype, parent=frappe.db.escape(parent)
+ parent=frappe.db.escape(parent)
),
as_dict=1,
)
diff --git a/erpnext/setup/doctype/department/department.py b/erpnext/setup/doctype/department/department.py
index c4766ee..1745178 100644
--- a/erpnext/setup/doctype/department/department.py
+++ b/erpnext/setup/doctype/department/department.py
@@ -63,7 +63,7 @@
else:
filters["parent_department"] = parent
- return frappe.get_all(doctype, fields=fields, filters=filters, order_by="name")
+ return frappe.get_all("Department", fields=fields, filters=filters, order_by="name")
@frappe.whitelist()
diff --git a/erpnext/startup/report_data_map.py b/erpnext/startup/report_data_map.py
deleted file mode 100644
index f8c1b6c..0000000
--- a/erpnext/startup/report_data_map.py
+++ /dev/null
@@ -1,327 +0,0 @@
-# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
-# License: GNU General Public License v3. See license.txt
-
-
-# mappings for table dumps
-# "remember to add indexes!"
-
-data_map = {
- "Company": {"columns": ["name"], "conditions": ["docstatus < 2"]},
- "Fiscal Year": {
- "columns": ["name", "year_start_date", "year_end_date"],
- "conditions": ["docstatus < 2"],
- },
- # Accounts
- "Account": {
- "columns": ["name", "parent_account", "lft", "rgt", "report_type", "company", "is_group"],
- "conditions": ["docstatus < 2"],
- "order_by": "lft",
- "links": {
- "company": ["Company", "name"],
- },
- },
- "Cost Center": {
- "columns": ["name", "lft", "rgt"],
- "conditions": ["docstatus < 2"],
- "order_by": "lft",
- },
- "GL Entry": {
- "columns": [
- "name",
- "account",
- "posting_date",
- "cost_center",
- "debit",
- "credit",
- "is_opening",
- "company",
- "voucher_type",
- "voucher_no",
- "remarks",
- ],
- "order_by": "posting_date, account",
- "links": {
- "account": ["Account", "name"],
- "company": ["Company", "name"],
- "cost_center": ["Cost Center", "name"],
- },
- },
- # Stock
- "Item": {
- "columns": [
- "name",
- "if(item_name=name, '', item_name) as item_name",
- "description",
- "item_group as parent_item_group",
- "stock_uom",
- "brand",
- "valuation_method",
- ],
- # "conditions": ["docstatus < 2"],
- "order_by": "name",
- "links": {"parent_item_group": ["Item Group", "name"], "brand": ["Brand", "name"]},
- },
- "Item Group": {
- "columns": ["name", "parent_item_group"],
- # "conditions": ["docstatus < 2"],
- "order_by": "lft",
- },
- "Brand": {"columns": ["name"], "conditions": ["docstatus < 2"], "order_by": "name"},
- "Project": {"columns": ["name"], "conditions": ["docstatus < 2"], "order_by": "name"},
- "Warehouse": {"columns": ["name"], "conditions": ["docstatus < 2"], "order_by": "name"},
- "Stock Ledger Entry": {
- "columns": [
- "name",
- "posting_date",
- "posting_time",
- "item_code",
- "warehouse",
- "actual_qty as qty",
- "voucher_type",
- "voucher_no",
- "project",
- "incoming_rate as incoming_rate",
- "stock_uom",
- "serial_no",
- "qty_after_transaction",
- "valuation_rate",
- ],
- "order_by": "posting_date, posting_time, creation",
- "links": {
- "item_code": ["Item", "name"],
- "warehouse": ["Warehouse", "name"],
- "project": ["Project", "name"],
- },
- "force_index": "posting_sort_index",
- },
- "Serial No": {
- "columns": ["name", "purchase_rate as incoming_rate"],
- "conditions": ["docstatus < 2"],
- "order_by": "name",
- },
- "Stock Entry": {
- "columns": ["name", "purpose"],
- "conditions": ["docstatus=1"],
- "order_by": "posting_date, posting_time, name",
- },
- "Material Request Item": {
- "columns": ["item.name as name", "item_code", "warehouse", "(qty - ordered_qty) as qty"],
- "from": "`tabMaterial Request Item` item, `tabMaterial Request` main",
- "conditions": [
- "item.parent = main.name",
- "main.docstatus=1",
- "main.status != 'Stopped'",
- "ifnull(warehouse, '')!=''",
- "qty > ordered_qty",
- ],
- "links": {"item_code": ["Item", "name"], "warehouse": ["Warehouse", "name"]},
- },
- "Purchase Order Item": {
- "columns": [
- "item.name as name",
- "item_code",
- "warehouse",
- "(qty - received_qty)*conversion_factor as qty",
- ],
- "from": "`tabPurchase Order Item` item, `tabPurchase Order` main",
- "conditions": [
- "item.parent = main.name",
- "main.docstatus=1",
- "main.status != 'Stopped'",
- "ifnull(warehouse, '')!=''",
- "qty > received_qty",
- ],
- "links": {"item_code": ["Item", "name"], "warehouse": ["Warehouse", "name"]},
- },
- "Sales Order Item": {
- "columns": [
- "item.name as name",
- "item_code",
- "(qty - delivered_qty)*conversion_factor as qty",
- "warehouse",
- ],
- "from": "`tabSales Order Item` item, `tabSales Order` main",
- "conditions": [
- "item.parent = main.name",
- "main.docstatus=1",
- "main.status != 'Stopped'",
- "ifnull(warehouse, '')!=''",
- "qty > delivered_qty",
- ],
- "links": {"item_code": ["Item", "name"], "warehouse": ["Warehouse", "name"]},
- },
- # Sales
- "Customer": {
- "columns": [
- "name",
- "if(customer_name=name, '', customer_name) as customer_name",
- "customer_group as parent_customer_group",
- "territory as parent_territory",
- ],
- "conditions": ["docstatus < 2"],
- "order_by": "name",
- "links": {
- "parent_customer_group": ["Customer Group", "name"],
- "parent_territory": ["Territory", "name"],
- },
- },
- "Customer Group": {
- "columns": ["name", "parent_customer_group"],
- "conditions": ["docstatus < 2"],
- "order_by": "lft",
- },
- "Territory": {
- "columns": ["name", "parent_territory"],
- "conditions": ["docstatus < 2"],
- "order_by": "lft",
- },
- "Sales Invoice": {
- "columns": ["name", "customer", "posting_date", "company"],
- "conditions": ["docstatus=1"],
- "order_by": "posting_date",
- "links": {"customer": ["Customer", "name"], "company": ["Company", "name"]},
- },
- "Sales Invoice Item": {
- "columns": ["name", "parent", "item_code", "stock_qty as qty", "base_net_amount"],
- "conditions": ["docstatus=1", "ifnull(parent, '')!=''"],
- "order_by": "parent",
- "links": {"parent": ["Sales Invoice", "name"], "item_code": ["Item", "name"]},
- },
- "Sales Order": {
- "columns": ["name", "customer", "transaction_date as posting_date", "company"],
- "conditions": ["docstatus=1"],
- "order_by": "transaction_date",
- "links": {"customer": ["Customer", "name"], "company": ["Company", "name"]},
- },
- "Sales Order Item[Sales Analytics]": {
- "columns": ["name", "parent", "item_code", "stock_qty as qty", "base_net_amount"],
- "conditions": ["docstatus=1", "ifnull(parent, '')!=''"],
- "order_by": "parent",
- "links": {"parent": ["Sales Order", "name"], "item_code": ["Item", "name"]},
- },
- "Delivery Note": {
- "columns": ["name", "customer", "posting_date", "company"],
- "conditions": ["docstatus=1"],
- "order_by": "posting_date",
- "links": {"customer": ["Customer", "name"], "company": ["Company", "name"]},
- },
- "Delivery Note Item[Sales Analytics]": {
- "columns": ["name", "parent", "item_code", "stock_qty as qty", "base_net_amount"],
- "conditions": ["docstatus=1", "ifnull(parent, '')!=''"],
- "order_by": "parent",
- "links": {"parent": ["Delivery Note", "name"], "item_code": ["Item", "name"]},
- },
- "Supplier": {
- "columns": [
- "name",
- "if(supplier_name=name, '', supplier_name) as supplier_name",
- "supplier_group as parent_supplier_group",
- ],
- "conditions": ["docstatus < 2"],
- "order_by": "name",
- "links": {
- "parent_supplier_group": ["Supplier Group", "name"],
- },
- },
- "Supplier Group": {
- "columns": ["name", "parent_supplier_group"],
- "conditions": ["docstatus < 2"],
- "order_by": "name",
- },
- "Purchase Invoice": {
- "columns": ["name", "supplier", "posting_date", "company"],
- "conditions": ["docstatus=1"],
- "order_by": "posting_date",
- "links": {"supplier": ["Supplier", "name"], "company": ["Company", "name"]},
- },
- "Purchase Invoice Item": {
- "columns": ["name", "parent", "item_code", "stock_qty as qty", "base_net_amount"],
- "conditions": ["docstatus=1", "ifnull(parent, '')!=''"],
- "order_by": "parent",
- "links": {"parent": ["Purchase Invoice", "name"], "item_code": ["Item", "name"]},
- },
- "Purchase Order": {
- "columns": ["name", "supplier", "transaction_date as posting_date", "company"],
- "conditions": ["docstatus=1"],
- "order_by": "posting_date",
- "links": {"supplier": ["Supplier", "name"], "company": ["Company", "name"]},
- },
- "Purchase Order Item[Purchase Analytics]": {
- "columns": ["name", "parent", "item_code", "stock_qty as qty", "base_net_amount"],
- "conditions": ["docstatus=1", "ifnull(parent, '')!=''"],
- "order_by": "parent",
- "links": {"parent": ["Purchase Order", "name"], "item_code": ["Item", "name"]},
- },
- "Purchase Receipt": {
- "columns": ["name", "supplier", "posting_date", "company"],
- "conditions": ["docstatus=1"],
- "order_by": "posting_date",
- "links": {"supplier": ["Supplier", "name"], "company": ["Company", "name"]},
- },
- "Purchase Receipt Item[Purchase Analytics]": {
- "columns": ["name", "parent", "item_code", "stock_qty as qty", "base_net_amount"],
- "conditions": ["docstatus=1", "ifnull(parent, '')!=''"],
- "order_by": "parent",
- "links": {"parent": ["Purchase Receipt", "name"], "item_code": ["Item", "name"]},
- },
- # Support
- "Issue": {
- "columns": ["name", "status", "creation", "resolution_date", "first_responded_on"],
- "conditions": ["docstatus < 2"],
- "order_by": "creation",
- },
- # Manufacturing
- "Work Order": {
- "columns": [
- "name",
- "status",
- "creation",
- "planned_start_date",
- "planned_end_date",
- "status",
- "actual_start_date",
- "actual_end_date",
- "modified",
- ],
- "conditions": ["docstatus = 1"],
- "order_by": "creation",
- },
- # Medical
- "Patient": {
- "columns": [
- "name",
- "creation",
- "owner",
- "if(patient_name=name, '', patient_name) as patient_name",
- ],
- "conditions": ["docstatus < 2"],
- "order_by": "name",
- "links": {"owner": ["User", "name"]},
- },
- "Patient Appointment": {
- "columns": [
- "name",
- "appointment_type",
- "patient",
- "practitioner",
- "appointment_date",
- "department",
- "status",
- "company",
- ],
- "order_by": "name",
- "links": {
- "practitioner": ["Healthcare Practitioner", "name"],
- "appointment_type": ["Appointment Type", "name"],
- },
- },
- "Healthcare Practitioner": {
- "columns": ["name", "department"],
- "order_by": "name",
- "links": {
- "department": ["Department", "name"],
- },
- },
- "Appointment Type": {"columns": ["name"], "order_by": "name"},
- "Medical Department": {"columns": ["name"], "order_by": "name"},
-}
diff --git a/erpnext/stock/doctype/batch/batch.py b/erpnext/stock/doctype/batch/batch.py
index 52854a0..f14288b 100644
--- a/erpnext/stock/doctype/batch/batch.py
+++ b/erpnext/stock/doctype/batch/batch.py
@@ -291,7 +291,7 @@
batches = get_batches(item_code, warehouse, qty, throw, serial_no)
for batch in batches:
- if cint(qty) <= cint(batch.qty):
+ if flt(qty) <= flt(batch.qty):
batch_no = batch.batch_id
break
diff --git a/erpnext/stock/doctype/bin/bin.py b/erpnext/stock/doctype/bin/bin.py
index 548df31..c28f45a 100644
--- a/erpnext/stock/doctype/bin/bin.py
+++ b/erpnext/stock/doctype/bin/bin.py
@@ -37,8 +37,10 @@
self.set_projected_qty()
- self.db_set("reserved_qty_for_production", flt(self.reserved_qty_for_production))
- self.db_set("projected_qty", self.projected_qty)
+ self.db_set(
+ "reserved_qty_for_production", flt(self.reserved_qty_for_production), update_modified=True
+ )
+ self.db_set("projected_qty", self.projected_qty, update_modified=True)
def update_reserved_qty_for_sub_contracting(self, subcontract_doctype="Subcontracting Order"):
# reserved qty
@@ -118,9 +120,9 @@
else:
reserved_qty_for_sub_contract = 0
- self.db_set("reserved_qty_for_sub_contract", reserved_qty_for_sub_contract)
+ self.db_set("reserved_qty_for_sub_contract", reserved_qty_for_sub_contract, update_modified=True)
self.set_projected_qty()
- self.db_set("projected_qty", self.projected_qty)
+ self.db_set("projected_qty", self.projected_qty, update_modified=True)
def on_doctype_update():
@@ -193,4 +195,5 @@
"planned_qty": planned_qty,
"projected_qty": projected_qty,
},
+ update_modified=True,
)
diff --git a/erpnext/stock/doctype/delivery_note/delivery_note.json b/erpnext/stock/doctype/delivery_note/delivery_note.json
index a8f907e..0ca3e69 100644
--- a/erpnext/stock/doctype/delivery_note/delivery_note.json
+++ b/erpnext/stock/doctype/delivery_note/delivery_note.json
@@ -8,46 +8,29 @@
"document_type": "Document",
"engine": "InnoDB",
"field_order": [
- "delivery_to_section",
- "column_break0",
"title",
"naming_series",
"customer",
+ "tax_id",
"customer_name",
"column_break1",
- "amended_from",
- "company",
"posting_date",
"posting_time",
"set_posting_time",
+ "column_break_10",
+ "company",
+ "amended_from",
"is_return",
"issue_credit_note",
"return_against",
"accounting_dimensions_section",
"cost_center",
- "dimension_col_break",
+ "column_break_18",
"project",
- "customer_po_details",
- "po_no",
- "column_break_17",
- "po_date",
- "section_break_18",
- "pick_list",
- "contact_info",
- "shipping_address_name",
- "shipping_address",
- "dispatch_address_name",
- "dispatch_address",
- "contact_person",
- "contact_display",
- "contact_mobile",
- "contact_email",
- "col_break21",
- "customer_address",
- "tax_id",
- "address_display",
- "company_address",
- "company_address_display",
+ "dimension_col_break",
+ "campaign",
+ "source",
+ "custom_dimensions_section",
"currency_and_price_list",
"currency",
"conversion_rate",
@@ -56,45 +39,35 @@
"price_list_currency",
"plc_conversion_rate",
"ignore_pricing_rule",
- "sec_warehouse",
- "set_warehouse",
- "col_break_warehouse",
- "set_target_warehouse",
"items_section",
"scan_barcode",
+ "pick_list",
+ "col_break_warehouse",
+ "set_warehouse",
+ "set_target_warehouse",
+ "section_break_30",
"items",
- "pricing_rule_details",
- "pricing_rules",
- "packing_list",
- "packed_items",
- "product_bundle_help",
"section_break_31",
"total_qty",
+ "total_net_weight",
+ "column_break_35",
"base_total",
"base_net_total",
"column_break_33",
- "total_net_weight",
"total",
"net_total",
"taxes_section",
+ "taxes_and_charges",
+ "column_break_43",
"tax_category",
"column_break_39",
"shipping_rule",
"section_break_41",
- "taxes_and_charges",
"taxes",
- "sec_tax_breakup",
- "other_charges_calculation",
"section_break_44",
"base_total_taxes_and_charges",
"column_break_47",
"total_taxes_and_charges",
- "section_break_49",
- "apply_discount_on",
- "base_discount_amount",
- "column_break_51",
- "additional_discount_percentage",
- "discount_amount",
"totals",
"base_grand_total",
"base_rounding_adjustment",
@@ -106,9 +79,50 @@
"rounded_total",
"in_words",
"disable_rounded_total",
- "terms_section_break",
+ "section_break_49",
+ "apply_discount_on",
+ "base_discount_amount",
+ "column_break_51",
+ "additional_discount_percentage",
+ "discount_amount",
+ "sec_tax_breakup",
+ "other_charges_calculation",
+ "packing_list",
+ "packed_items",
+ "product_bundle_help",
+ "pricing_rule_details",
+ "pricing_rules",
+ "address_and_contact_tab",
+ "contact_info",
+ "customer_address",
+ "address_display",
+ "col_break21",
+ "contact_person",
+ "contact_display",
+ "contact_mobile",
+ "contact_email",
+ "shipping_address_section",
+ "shipping_address_name",
+ "shipping_address",
+ "column_break_95",
+ "dispatch_address_name",
+ "dispatch_address",
+ "company_address_section",
+ "company_address",
+ "column_break_101",
+ "company_address_display",
+ "terms_tab",
"tc_name",
"terms",
+ "more_info_tab",
+ "section_break_83",
+ "per_billed",
+ "status",
+ "column_break_112",
+ "per_installed",
+ "installation_status",
+ "column_break_89",
+ "per_returned",
"transporter_info",
"transporter",
"driver",
@@ -118,57 +132,41 @@
"transporter_name",
"driver_name",
"lr_date",
- "more_info",
- "campaign",
- "source",
- "column_break5",
- "is_internal_customer",
- "represents_company",
- "inter_company_reference",
- "per_billed",
- "customer_group",
- "territory",
- "printing_details",
- "letter_head",
- "select_print_heading",
- "language",
- "column_break_88",
- "print_without_amount",
- "group_same_items",
- "section_break_83",
- "status",
- "per_installed",
- "installation_status",
- "column_break_89",
- "per_returned",
- "excise_page",
- "instructions",
- "subscription_section",
- "auto_repeat",
+ "customer_po_details",
+ "po_no",
+ "column_break_17",
+ "po_date",
"sales_team_section_break",
"sales_partner",
- "column_break7",
"amount_eligible_for_commission",
+ "column_break7",
"commission_rate",
"total_commission",
"section_break1",
- "sales_team"
+ "sales_team",
+ "subscription_section",
+ "auto_repeat",
+ "printing_details",
+ "letter_head",
+ "print_without_amount",
+ "group_same_items",
+ "column_break_88",
+ "select_print_heading",
+ "language",
+ "more_info",
+ "is_internal_customer",
+ "represents_company",
+ "inter_company_reference",
+ "customer_group",
+ "territory",
+ "column_break5",
+ "excise_page",
+ "instructions",
+ "connections_tab",
+ "column_break_25"
],
"fields": [
{
- "fieldname": "delivery_to_section",
- "fieldtype": "Section Break",
- "label": "Delivery To",
- "options": "fa fa-user"
- },
- {
- "fieldname": "column_break0",
- "fieldtype": "Column Break",
- "oldfieldtype": "Column Break",
- "print_width": "50%",
- "width": "50%"
- },
- {
"allow_on_submit": 1,
"default": "{customer_name}",
"fieldname": "title",
@@ -337,11 +335,10 @@
"width": "100px"
},
{
- "collapsible": 1,
"depends_on": "customer",
"fieldname": "contact_info",
"fieldtype": "Section Break",
- "label": "Address and Contact",
+ "label": "Billing Address",
"options": "fa fa-bullhorn"
},
{
@@ -494,10 +491,6 @@
"print_hide": 1
},
{
- "fieldname": "sec_warehouse",
- "fieldtype": "Section Break"
- },
- {
"fieldname": "set_warehouse",
"fieldtype": "Link",
"label": "Set Source Warehouse",
@@ -511,6 +504,8 @@
{
"fieldname": "items_section",
"fieldtype": "Section Break",
+ "hide_border": 1,
+ "label": "Items",
"oldfieldtype": "Section Break",
"options": "fa fa-shopping-cart"
},
@@ -524,7 +519,6 @@
"allow_bulk_edit": 1,
"fieldname": "items",
"fieldtype": "Table",
- "label": "Items",
"oldfieldname": "delivery_note_details",
"oldfieldtype": "Table",
"options": "Delivery Note Item",
@@ -619,6 +613,7 @@
"read_only": 1
},
{
+ "depends_on": "total_net_weight",
"fieldname": "total_net_weight",
"fieldtype": "Float",
"label": "Total Net Weight",
@@ -628,6 +623,7 @@
{
"fieldname": "taxes_section",
"fieldtype": "Section Break",
+ "hide_border": 1,
"label": "Taxes and Charges",
"oldfieldtype": "Section Break",
"options": "fa fa-money"
@@ -653,10 +649,10 @@
},
{
"fieldname": "section_break_41",
- "fieldtype": "Section Break"
+ "fieldtype": "Section Break",
+ "hide_border": 1
},
{
- "description": "If you have created a standard template in Sales Taxes and Charges Template, select one and click on the button below.",
"fieldname": "taxes_and_charges",
"fieldtype": "Link",
"label": "Sales Taxes and Charges Template",
@@ -668,7 +664,6 @@
{
"fieldname": "taxes",
"fieldtype": "Table",
- "label": "Sales Taxes and Charges",
"oldfieldname": "other_charges",
"oldfieldtype": "Table",
"options": "Sales Taxes and Charges"
@@ -718,7 +713,6 @@
},
{
"collapsible": 1,
- "collapsible_depends_on": "discount_amount",
"fieldname": "section_break_49",
"fieldtype": "Section Break",
"label": "Additional Discount"
@@ -759,6 +753,7 @@
{
"fieldname": "totals",
"fieldtype": "Section Break",
+ "label": "Totals",
"oldfieldtype": "Section Break",
"options": "fa fa-money"
},
@@ -864,15 +859,6 @@
"width": "150px"
},
{
- "collapsible": 1,
- "collapsible_depends_on": "terms",
- "fieldname": "terms_section_break",
- "fieldtype": "Section Break",
- "label": "Terms and Conditions",
- "oldfieldtype": "Section Break",
- "options": "fa fa-legal"
- },
- {
"fieldname": "tc_name",
"fieldtype": "Link",
"label": "Terms",
@@ -965,13 +951,12 @@
"collapsible": 1,
"fieldname": "more_info",
"fieldtype": "Section Break",
- "label": "More Information",
+ "label": "Additional Info",
"oldfieldtype": "Section Break",
"options": "fa fa-file-text",
"print_hide": 1
},
{
- "description": "Track this Delivery Note against any Project",
"fieldname": "project",
"fieldtype": "Link",
"label": "Project",
@@ -1110,7 +1095,6 @@
},
{
"depends_on": "eval:!doc.__islocal",
- "description": "% of materials delivered against this Delivery Note",
"fieldname": "per_installed",
"fieldtype": "Percent",
"in_list_view": 1,
@@ -1238,10 +1222,6 @@
"read_only": 1
},
{
- "fieldname": "section_break_18",
- "fieldtype": "Section Break"
- },
- {
"default": "0",
"fetch_from": "customer.is_internal_customer",
"fieldname": "is_internal_customer",
@@ -1329,13 +1309,85 @@
{
"fieldname": "dimension_col_break",
"fieldtype": "Column Break"
+ },
+ {
+ "fieldname": "address_and_contact_tab",
+ "fieldtype": "Tab Break",
+ "label": "Address & Contact"
+ },
+ {
+ "fieldname": "terms_tab",
+ "fieldtype": "Tab Break",
+ "label": "Terms"
+ },
+ {
+ "fieldname": "more_info_tab",
+ "fieldtype": "Tab Break",
+ "label": "More Info"
+ },
+ {
+ "fieldname": "connections_tab",
+ "fieldtype": "Tab Break",
+ "label": "Connections",
+ "show_dashboard": 1
+ },
+ {
+ "fieldname": "column_break_10",
+ "fieldtype": "Column Break"
+ },
+ {
+ "fieldname": "column_break_25",
+ "fieldtype": "Column Break"
+ },
+ {
+ "fieldname": "section_break_30",
+ "fieldtype": "Section Break",
+ "hide_border": 1
+ },
+ {
+ "fieldname": "column_break_35",
+ "fieldtype": "Column Break"
+ },
+ {
+ "fieldname": "column_break_43",
+ "fieldtype": "Column Break"
+ },
+ {
+ "fieldname": "custom_dimensions_section",
+ "fieldtype": "Section Break"
+ },
+ {
+ "fieldname": "shipping_address_section",
+ "fieldtype": "Section Break",
+ "label": "Shipping Address"
+ },
+ {
+ "fieldname": "column_break_95",
+ "fieldtype": "Column Break"
+ },
+ {
+ "fieldname": "company_address_section",
+ "fieldtype": "Section Break",
+ "label": "Company Address"
+ },
+ {
+ "fieldname": "column_break_101",
+ "fieldtype": "Column Break"
+ },
+ {
+ "fieldname": "column_break_112",
+ "fieldtype": "Column Break"
+ },
+ {
+ "fieldname": "column_break_18",
+ "fieldtype": "Column Break"
}
],
"icon": "fa fa-truck",
"idx": 146,
"is_submittable": 1,
"links": [],
- "modified": "2022-09-16 17:46:17.701904",
+ "modified": "2022-10-11 13:06:58.655635",
"modified_by": "Administrator",
"module": "Stock",
"name": "Delivery Note",
diff --git a/erpnext/stock/doctype/delivery_note/delivery_note.py b/erpnext/stock/doctype/delivery_note/delivery_note.py
index 36d5a6c..a1df764 100644
--- a/erpnext/stock/doctype/delivery_note/delivery_note.py
+++ b/erpnext/stock/doctype/delivery_note/delivery_note.py
@@ -842,6 +842,9 @@
update_address(
target_doc, "shipping_address", "shipping_address_display", source_doc.customer_address
)
+ update_address(
+ target_doc, "billing_address", "billing_address_display", source_doc.customer_address
+ )
update_taxes(
target_doc,
@@ -899,6 +902,8 @@
"serial_no": "serial_no",
"purchase_order": "purchase_order",
"purchase_order_item": "purchase_order_item",
+ "material_request": "material_request",
+ "Material_request_item": "material_request_item",
},
"field_no_map": ["warehouse"],
},
diff --git a/erpnext/stock/doctype/delivery_note/delivery_note_dashboard.py b/erpnext/stock/doctype/delivery_note/delivery_note_dashboard.py
index fd44e9c..b6b5ff4 100644
--- a/erpnext/stock/doctype/delivery_note/delivery_note_dashboard.py
+++ b/erpnext/stock/doctype/delivery_note/delivery_note_dashboard.py
@@ -11,11 +11,14 @@
},
"internal_links": {
"Sales Order": ["items", "against_sales_order"],
+ "Material Request": ["items", "material_request"],
+ "Purchase Order": ["items", "purchase_order"],
},
"transactions": [
{"label": _("Related"), "items": ["Sales Invoice", "Packing Slip", "Delivery Trip"]},
{"label": _("Reference"), "items": ["Sales Order", "Shipment", "Quality Inspection"]},
{"label": _("Returns"), "items": ["Stock Entry"]},
{"label": _("Subscription"), "items": ["Auto Repeat"]},
+ {"label": _("Internal Transfer"), "items": ["Material Request", "Purchase Order"]},
],
}
diff --git a/erpnext/stock/doctype/delivery_note/test_delivery_note.py b/erpnext/stock/doctype/delivery_note/test_delivery_note.py
index 1b9f168..d747383 100644
--- a/erpnext/stock/doctype/delivery_note/test_delivery_note.py
+++ b/erpnext/stock/doctype/delivery_note/test_delivery_note.py
@@ -1050,9 +1050,22 @@
do_not_submit=True,
)
+ dn.append(
+ "taxes",
+ {
+ "charge_type": "On Net Total",
+ "account_head": "_Test Account Service Tax - _TC",
+ "description": "Tax 1",
+ "rate": 14,
+ "cost_center": "_Test Cost Center - _TC",
+ "included_in_print_rate": 1,
+ },
+ )
+
self.assertEqual(dn.items[0].rate, 500) # haven't saved yet
dn.save()
self.assertEqual(dn.ignore_pricing_rule, 1)
+ self.assertEqual(dn.taxes[0].included_in_print_rate, 0)
# rate should reset to incoming rate
self.assertEqual(dn.items[0].rate, rate)
@@ -1063,6 +1076,7 @@
dn.save()
self.assertEqual(dn.items[0].rate, rate)
+ self.assertEqual(dn.items[0].net_rate, rate)
def test_internal_transfer_precision_gle(self):
from erpnext.selling.doctype.customer.test_customer import create_internal_customer
diff --git a/erpnext/stock/doctype/delivery_note_item/delivery_note_item.json b/erpnext/stock/doctype/delivery_note_item/delivery_note_item.json
index 0911cdb..916ab2a 100644
--- a/erpnext/stock/doctype/delivery_note_item/delivery_note_item.json
+++ b/erpnext/stock/doctype/delivery_note_item/delivery_note_item.json
@@ -8,6 +8,7 @@
"engine": "InnoDB",
"field_order": [
"barcode",
+ "has_item_scanned",
"item_code",
"item_name",
"col_break1",
@@ -87,9 +88,11 @@
"allow_zero_valuation_rate",
"column_break_71",
"internal_transfer_section",
+ "material_request",
"purchase_order",
"column_break_82",
"purchase_order_item",
+ "material_request_item",
"accounting_dimensions_section",
"cost_center",
"dimension_col_break",
@@ -261,6 +264,7 @@
},
{
"collapsible": 1,
+ "collapsible_depends_on": "eval: doc.margin_type || doc.discount_amount",
"fieldname": "discount_and_margin",
"fieldtype": "Section Break",
"label": "Discount and Margin"
@@ -753,6 +757,7 @@
"fieldtype": "Currency",
"label": "Incoming Rate",
"no_copy": 1,
+ "precision": "6",
"print_hide": 1,
"read_only": 1
},
@@ -807,13 +812,32 @@
"label": "Purchase Order Item",
"print_hide": 1,
"read_only": 1
+ },
+ {
+ "default": "0",
+ "depends_on": "barcode",
+ "fieldname": "has_item_scanned",
+ "fieldtype": "Check",
+ "label": "Has Item Scanned",
+ "read_only": 1
+ },
+ {
+ "fieldname": "material_request",
+ "fieldtype": "Link",
+ "label": "Material Request",
+ "options": "Material Request"
+ },
+ {
+ "fieldname": "material_request_item",
+ "fieldtype": "Data",
+ "label": "Material Request Item"
}
],
"idx": 1,
"index_web_pages_for_search": 1,
"istable": 1,
"links": [],
- "modified": "2022-09-06 14:19:42.876357",
+ "modified": "2022-11-09 12:17:50.850142",
"modified_by": "Administrator",
"module": "Stock",
"name": "Delivery Note Item",
diff --git a/erpnext/stock/doctype/inventory_dimension/inventory_dimension.py b/erpnext/stock/doctype/inventory_dimension/inventory_dimension.py
index 9e8c10b..7b99b00 100644
--- a/erpnext/stock/doctype/inventory_dimension/inventory_dimension.py
+++ b/erpnext/stock/doctype/inventory_dimension/inventory_dimension.py
@@ -121,18 +121,24 @@
if self.apply_to_all_doctypes:
for doctype in get_inventory_documents():
- custom_fields.setdefault(doctype[0], dimension_fields)
- else:
+ if not field_exists(doctype[0], self.source_fieldname):
+ custom_fields.setdefault(doctype[0], dimension_fields)
+ elif not field_exists(self.document_type, self.source_fieldname):
custom_fields.setdefault(self.document_type, dimension_fields)
if not frappe.db.get_value(
"Custom Field", {"dt": "Stock Ledger Entry", "fieldname": self.target_fieldname}
- ):
+ ) and not field_exists("Stock Ledger Entry", self.target_fieldname):
dimension_field = dimension_fields[1]
dimension_field["fieldname"] = self.target_fieldname
custom_fields["Stock Ledger Entry"] = dimension_field
- create_custom_fields(custom_fields)
+ if custom_fields:
+ create_custom_fields(custom_fields)
+
+
+def field_exists(doctype, fieldname) -> str or None:
+ return frappe.db.get_value("DocField", {"parent": doctype, "fieldname": fieldname}, "name")
@frappe.whitelist()
diff --git a/erpnext/stock/doctype/inventory_dimension/test_inventory_dimension.py b/erpnext/stock/doctype/inventory_dimension/test_inventory_dimension.py
index 19ddc44..52b3deb 100644
--- a/erpnext/stock/doctype/inventory_dimension/test_inventory_dimension.py
+++ b/erpnext/stock/doctype/inventory_dimension/test_inventory_dimension.py
@@ -191,6 +191,21 @@
self.assertEqual(sle_rack, "Rack 1")
+ def test_check_standard_dimensions(self):
+ create_inventory_dimension(
+ reference_document="Project",
+ type_of_transaction="Outward",
+ dimension_name="Project",
+ apply_to_all_doctypes=0,
+ document_type="Stock Ledger Entry",
+ )
+
+ self.assertFalse(
+ frappe.db.get_value(
+ "Custom Field", {"fieldname": "project", "dt": "Stock Ledger Entry"}, "name"
+ )
+ )
+
def prepare_test_data():
if not frappe.db.exists("DocType", "Shelf"):
diff --git a/erpnext/stock/doctype/item/item.py b/erpnext/stock/doctype/item/item.py
index c8bb1b9..20bc9d9 100644
--- a/erpnext/stock/doctype/item/item.py
+++ b/erpnext/stock/doctype/item/item.py
@@ -232,10 +232,10 @@
def clear_retain_sample(self):
if not self.has_batch_no:
- self.retain_sample = None
+ self.retain_sample = False
if not self.retain_sample:
- self.sample_quantity = None
+ self.sample_quantity = 0
def add_default_uom_in_conversion_factor_table(self):
if not self.is_new() and self.has_value_changed("stock_uom"):
diff --git a/erpnext/stock/doctype/item/test_item.py b/erpnext/stock/doctype/item/test_item.py
index e35c8bf..e1ee938 100644
--- a/erpnext/stock/doctype/item/test_item.py
+++ b/erpnext/stock/doctype/item/test_item.py
@@ -32,7 +32,7 @@
test_dependencies = ["Warehouse", "Item Group", "Item Tax Template", "Brand", "Item Attribute"]
-def make_item(item_code=None, properties=None):
+def make_item(item_code=None, properties=None, uoms=None):
if not item_code:
item_code = frappe.generate_hash(length=16)
@@ -56,6 +56,11 @@
for item_default in [doc for doc in item.get("item_defaults") if not doc.default_warehouse]:
item_default.default_warehouse = "_Test Warehouse - _TC"
item_default.company = "_Test Company"
+
+ if uoms:
+ for uom in uoms:
+ item.append("uoms", uom)
+
item.insert()
return item
@@ -717,8 +722,8 @@
item.has_batch_no = None
item.save()
- self.assertEqual(item.retain_sample, None)
- self.assertEqual(item.sample_quantity, None)
+ self.assertEqual(item.retain_sample, False)
+ self.assertEqual(item.sample_quantity, 0)
item.delete()
def consume_item_code_with_differet_stock_transactions(
diff --git a/erpnext/stock/doctype/material_request/material_request.json b/erpnext/stock/doctype/material_request/material_request.json
index 3593130..413c373 100644
--- a/erpnext/stock/doctype/material_request/material_request.json
+++ b/erpnext/stock/doctype/material_request/material_request.json
@@ -11,34 +11,40 @@
"naming_series",
"title",
"material_request_type",
- "transfer_status",
"customer",
- "status",
+ "company",
"column_break_2",
"transaction_date",
"schedule_date",
- "company",
"amended_from",
"warehouse_section",
+ "scan_barcode",
+ "column_break_13",
"set_from_warehouse",
"column_break5",
"set_warehouse",
"items_section",
- "scan_barcode",
"items",
- "more_info",
- "per_ordered",
- "column_break2",
- "per_received",
- "printing_details",
- "letter_head",
- "select_print_heading",
+ "terms_tab",
"terms_section_break",
"tc_name",
"terms",
+ "more_info_tab",
+ "status_section",
+ "status",
+ "per_ordered",
+ "column_break2",
+ "transfer_status",
+ "per_received",
+ "printing_details",
+ "letter_head",
+ "column_break_31",
+ "select_print_heading",
"reference",
"job_card",
- "work_order"
+ "column_break_35",
+ "work_order",
+ "connections_tab"
],
"fields": [
{
@@ -148,14 +154,6 @@
"reqd": 1
},
{
- "collapsible": 1,
- "fieldname": "more_info",
- "fieldtype": "Section Break",
- "label": "More Information",
- "oldfieldtype": "Section Break",
- "options": "fa fa-file-text"
- },
- {
"default": "Today",
"fieldname": "transaction_date",
"fieldtype": "Date",
@@ -239,7 +237,6 @@
"collapsible_depends_on": "terms",
"fieldname": "terms_section_break",
"fieldtype": "Section Break",
- "label": "Terms and Conditions",
"oldfieldtype": "Section Break",
"options": "fa fa-legal"
},
@@ -277,10 +274,10 @@
{
"fieldname": "warehouse_section",
"fieldtype": "Section Break",
- "label": "Warehouse"
+ "hide_border": 1,
+ "label": "Items"
},
{
- "description": "Sets 'Target Warehouse' in each row of the Items table.",
"fieldname": "set_warehouse",
"fieldtype": "Link",
"in_list_view": 1,
@@ -296,7 +293,6 @@
},
{
"depends_on": "eval:doc.material_request_type == 'Material Transfer'",
- "description": "Sets 'Source Warehouse' in each row of the Items table.",
"fieldname": "set_from_warehouse",
"fieldtype": "Link",
"label": "Set Source Warehouse",
@@ -317,13 +313,49 @@
"label": "Work Order",
"options": "Work Order",
"read_only": 1
+ },
+ {
+ "fieldname": "terms_tab",
+ "fieldtype": "Tab Break",
+ "label": "Terms"
+ },
+ {
+ "fieldname": "more_info_tab",
+ "fieldtype": "Tab Break",
+ "label": "More Info"
+ },
+ {
+ "fieldname": "connections_tab",
+ "fieldtype": "Tab Break",
+ "label": "Connections",
+ "show_dashboard": 1
+ },
+ {
+ "collapsible": 1,
+ "fieldname": "status_section",
+ "fieldtype": "Section Break",
+ "label": "Status",
+ "oldfieldtype": "Section Break",
+ "options": "fa fa-file-text"
+ },
+ {
+ "fieldname": "column_break_31",
+ "fieldtype": "Column Break"
+ },
+ {
+ "fieldname": "column_break_35",
+ "fieldtype": "Column Break"
+ },
+ {
+ "fieldname": "column_break_13",
+ "fieldtype": "Column Break"
}
],
"icon": "fa fa-ticket",
"idx": 70,
"is_submittable": 1,
"links": [],
- "modified": "2022-08-25 11:49:28.155048",
+ "modified": "2022-09-27 17:58:26.366469",
"modified_by": "Administrator",
"module": "Stock",
"name": "Material Request",
diff --git a/erpnext/stock/doctype/material_request/material_request.py b/erpnext/stock/doctype/material_request/material_request.py
index 2614a7f..04aee42 100644
--- a/erpnext/stock/doctype/material_request/material_request.py
+++ b/erpnext/stock/doctype/material_request/material_request.py
@@ -10,7 +10,7 @@
import frappe
from frappe import _, msgprint
from frappe.model.mapper import get_mapped_doc
-from frappe.utils import cstr, flt, get_link_to_form, getdate, new_line_sep, nowdate
+from frappe.utils import cint, cstr, flt, get_link_to_form, getdate, new_line_sep, nowdate
from erpnext.buying.utils import check_on_hold_or_closed_status, validate_for_items
from erpnext.controllers.buying_controller import BuyingController
@@ -120,7 +120,6 @@
self.title = _("{0} Request for {1}").format(self.material_request_type, items)[:100]
def on_submit(self):
- # frappe.db.set(self, 'status', 'Submitted')
self.update_requested_qty()
self.update_requested_qty_in_production_plan()
if self.material_request_type == "Purchase":
@@ -501,13 +500,13 @@
and mr.per_ordered < 99.99
and mr.docstatus = 1
and mr.status != 'Stopped'
- and mr.company = '{1}'
- {2}
+ and mr.company = %s
+ {1}
order by mr_item.item_code ASC
- limit {3} offset {4} """.format(
- ", ".join(["%s"] * len(supplier_items)), filters.get("company"), conditions, page_len, start
+ limit {2} offset {3} """.format(
+ ", ".join(["%s"] * len(supplier_items)), conditions, cint(page_len), cint(start)
),
- tuple(supplier_items),
+ tuple(supplier_items) + (filters.get("company"),),
as_dict=1,
)
diff --git a/erpnext/stock/doctype/material_request/material_request_dashboard.py b/erpnext/stock/doctype/material_request/material_request_dashboard.py
index b073e6a..2bba52a 100644
--- a/erpnext/stock/doctype/material_request/material_request_dashboard.py
+++ b/erpnext/stock/doctype/material_request/material_request_dashboard.py
@@ -4,12 +4,16 @@
def get_data():
return {
"fieldname": "material_request",
+ "internal_links": {
+ "Sales Order": ["items", "sales_order"],
+ },
"transactions": [
{
"label": _("Reference"),
- "items": ["Request for Quotation", "Supplier Quotation", "Purchase Order"],
+ "items": ["Sales Order", "Request for Quotation", "Supplier Quotation", "Purchase Order"],
},
{"label": _("Stock"), "items": ["Stock Entry", "Purchase Receipt", "Pick List"]},
{"label": _("Manufacturing"), "items": ["Work Order"]},
+ {"label": _("Internal Transfer"), "items": ["Sales Order"]},
],
}
diff --git a/erpnext/stock/doctype/material_request/test_material_request.py b/erpnext/stock/doctype/material_request/test_material_request.py
index 78af153..f0a9499 100644
--- a/erpnext/stock/doctype/material_request/test_material_request.py
+++ b/erpnext/stock/doctype/material_request/test_material_request.py
@@ -216,7 +216,7 @@
po.load_from_db()
mr.update_status("Stopped")
self.assertRaises(frappe.InvalidStatusError, po.submit)
- frappe.db.set(po, "docstatus", 1)
+ po.db_set("docstatus", 1)
self.assertRaises(frappe.InvalidStatusError, po.cancel)
# resubmit and check for per complete
@@ -590,6 +590,7 @@
mr = frappe.copy_doc(test_records[0])
mr.material_request_type = "Material Issue"
mr.submit()
+ frappe.db.value_cache = {}
# testing bin value after material request is submitted
self.assertEqual(_get_requested_qty(), existing_requested_qty - 54.0)
diff --git a/erpnext/stock/doctype/pick_list/pick_list.py b/erpnext/stock/doctype/pick_list/pick_list.py
index 9c1c7e5..5de7fed 100644
--- a/erpnext/stock/doctype/pick_list/pick_list.py
+++ b/erpnext/stock/doctype/pick_list/pick_list.py
@@ -10,6 +10,8 @@
from frappe import _
from frappe.model.document import Document
from frappe.model.mapper import map_child_doc
+from frappe.query_builder import Case
+from frappe.query_builder.functions import Locate
from frappe.utils import cint, floor, flt, today
from frappe.utils.nestedset import get_descendants_of
@@ -686,31 +688,22 @@
@frappe.whitelist()
def get_pending_work_orders(doctype, txt, searchfield, start, page_length, filters, as_dict):
- return frappe.db.sql(
- """
- SELECT
- `name`, `company`, `planned_start_date`
- FROM
- `tabWork Order`
- WHERE
- `status` not in ('Completed', 'Stopped')
- AND `qty` > `material_transferred_for_manufacturing`
- AND `docstatus` = 1
- AND `company` = %(company)s
- AND `name` like %(txt)s
- ORDER BY
- (case when locate(%(_txt)s, name) > 0 then locate(%(_txt)s, name) else 99999 end) name
- LIMIT
- %(start)s, %(page_length)s""",
- {
- "txt": "%%%s%%" % txt,
- "_txt": txt.replace("%", ""),
- "start": start,
- "page_length": frappe.utils.cint(page_length),
- "company": filters.get("company"),
- },
- as_dict=as_dict,
- )
+ wo = frappe.qb.DocType("Work Order")
+ return (
+ frappe.qb.from_(wo)
+ .select(wo.name, wo.company, wo.planned_start_date)
+ .where(
+ (wo.status.notin(["Completed", "Stopped"]))
+ & (wo.qty > wo.material_transferred_for_manufacturing)
+ & (wo.docstatus == 1)
+ & (wo.company == filters.get("company"))
+ & (wo.name.like("%{0}%".format(txt)))
+ )
+ .orderby(Case().when(Locate(txt, wo.name) > 0, Locate(txt, wo.name)).else_(99999))
+ .orderby(wo.name)
+ .limit(cint(page_length))
+ .offset(start)
+ ).run(as_dict=as_dict)
@frappe.whitelist()
diff --git a/erpnext/stock/doctype/purchase_receipt/purchase_receipt.json b/erpnext/stock/doctype/purchase_receipt/purchase_receipt.json
index acaac92..3141212 100755
--- a/erpnext/stock/doctype/purchase_receipt/purchase_receipt.json
+++ b/erpnext/stock/doctype/purchase_receipt/purchase_receipt.json
@@ -17,10 +17,11 @@
"supplier_name",
"supplier_delivery_note",
"column_break1",
- "company",
"posting_date",
"posting_time",
"set_posting_time",
+ "column_break_12",
+ "company",
"apply_putaway_rule",
"is_return",
"return_against",
@@ -28,18 +29,6 @@
"cost_center",
"dimension_col_break",
"project",
- "section_addresses",
- "supplier_address",
- "contact_person",
- "address_display",
- "contact_display",
- "contact_mobile",
- "contact_email",
- "col_break_address",
- "shipping_address",
- "shipping_address_display",
- "billing_address",
- "billing_address_display",
"currency_and_price_list",
"currency",
"conversion_rate",
@@ -49,37 +38,33 @@
"plc_conversion_rate",
"ignore_pricing_rule",
"sec_warehouse",
+ "scan_barcode",
+ "column_break_31",
"set_warehouse",
- "rejected_warehouse",
- "col_break_warehouse",
"set_from_warehouse",
+ "col_break_warehouse",
+ "rejected_warehouse",
"is_subcontracted",
"supplier_warehouse",
"items_section",
- "scan_barcode",
"items",
"section_break0",
"total_qty",
+ "total_net_weight",
+ "column_break_43",
"base_total",
"base_net_total",
"column_break_27",
- "total_net_weight",
"total",
"net_total",
- "pricing_rule_details",
- "pricing_rules",
- "raw_material_details",
- "get_current_stock",
- "supplied_items",
"taxes_charges_section",
- "tax_category",
+ "taxes_and_charges",
"shipping_col",
+ "tax_category",
+ "column_break_53",
"shipping_rule",
"taxes_section",
- "taxes_and_charges",
"taxes",
- "sec_tax_breakup",
- "other_charges_calculation",
"totals",
"base_taxes_and_charges_added",
"base_taxes_and_charges_deducted",
@@ -88,53 +73,81 @@
"taxes_and_charges_added",
"taxes_and_charges_deducted",
"total_taxes_and_charges",
- "section_break_42",
- "apply_discount_on",
- "base_discount_amount",
- "column_break_44",
- "additional_discount_percentage",
- "discount_amount",
"section_break_46",
"base_grand_total",
"base_rounding_adjustment",
- "base_in_words",
"base_rounded_total",
+ "base_in_words",
"column_break_50",
"grand_total",
"rounding_adjustment",
"rounded_total",
"in_words",
"disable_rounded_total",
- "terms_section_break",
+ "section_break_42",
+ "apply_discount_on",
+ "base_discount_amount",
+ "column_break_44",
+ "additional_discount_percentage",
+ "discount_amount",
+ "sec_tax_breakup",
+ "other_charges_calculation",
+ "pricing_rule_details",
+ "pricing_rules",
+ "raw_material_details",
+ "get_current_stock",
+ "supplied_items",
+ "address_and_contact_tab",
+ "section_addresses",
+ "supplier_address",
+ "address_display",
+ "col_break_address",
+ "contact_person",
+ "contact_display",
+ "contact_mobile",
+ "contact_email",
+ "section_break_98",
+ "shipping_address",
+ "column_break_100",
+ "shipping_address_display",
+ "billing_address_section",
+ "billing_address",
+ "column_break_104",
+ "billing_address_display",
+ "terms_tab",
"tc_name",
"terms",
- "more_info",
+ "more_info_tab",
+ "status_section",
"status",
- "amended_from",
- "range",
"column_break4",
"per_billed",
"per_returned",
- "is_internal_supplier",
- "inter_company_reference",
- "represents_company",
"subscription_detail",
"auto_repeat",
"printing_settings",
"letter_head",
- "language",
- "instructions",
+ "group_same_items",
"column_break_97",
"select_print_heading",
- "other_details",
- "remarks",
- "group_same_items",
+ "language",
"transporter_info",
"transporter_name",
"column_break5",
"lr_no",
"lr_date",
- "is_old_subcontracting_flow"
+ "additional_info_section",
+ "instructions",
+ "is_internal_supplier",
+ "represents_company",
+ "inter_company_reference",
+ "column_break_131",
+ "remarks",
+ "range",
+ "amended_from",
+ "is_old_subcontracting_flow",
+ "other_details",
+ "connections_tab"
],
"fields": [
{
@@ -223,7 +236,6 @@
"width": "100px"
},
{
- "description": "Time at which materials were received",
"fieldname": "posting_time",
"fieldtype": "Time",
"label": "Posting Time",
@@ -277,15 +289,14 @@
"read_only": 1
},
{
- "collapsible": 1,
"fieldname": "section_addresses",
"fieldtype": "Section Break",
- "label": "Address and Contact"
+ "label": "Supplier Address"
},
{
"fieldname": "supplier_address",
"fieldtype": "Link",
- "label": "Select Supplier Address",
+ "label": "Supplier Address",
"options": "Address",
"print_hide": 1
},
@@ -330,7 +341,7 @@
{
"fieldname": "shipping_address",
"fieldtype": "Link",
- "label": "Select Shipping Address",
+ "label": "Shipping Address Template",
"options": "Address",
"print_hide": 1
},
@@ -410,10 +421,11 @@
},
{
"fieldname": "sec_warehouse",
- "fieldtype": "Section Break"
+ "fieldtype": "Section Break",
+ "hide_border": 1,
+ "label": "Items"
},
{
- "description": "Sets 'Accepted Warehouse' in each row of the items table.",
"fieldname": "set_warehouse",
"fieldtype": "Link",
"label": "Accepted Warehouse",
@@ -421,7 +433,6 @@
"print_hide": 1
},
{
- "description": "Sets 'Rejected Warehouse' in each row of the items table.",
"fieldname": "rejected_warehouse",
"fieldtype": "Link",
"label": "Rejected Warehouse",
@@ -461,6 +472,7 @@
{
"fieldname": "items_section",
"fieldtype": "Section Break",
+ "hide_border": 1,
"oldfieldtype": "Section Break",
"options": "fa fa-shopping-cart"
},
@@ -571,6 +583,7 @@
"read_only": 1
},
{
+ "depends_on": "total_net_weight",
"fieldname": "total_net_weight",
"fieldtype": "Float",
"label": "Total Net Weight",
@@ -578,11 +591,11 @@
"read_only": 1
},
{
- "description": "Add / Edit Taxes and Charges",
"fieldname": "taxes_charges_section",
"fieldtype": "Section Break",
- "oldfieldtype": "Section Break",
- "options": "fa fa-money"
+ "hide_border": 1,
+ "label": "Taxes and Charges",
+ "oldfieldtype": "Section Break"
},
{
"fieldname": "tax_category",
@@ -603,7 +616,8 @@
},
{
"fieldname": "taxes_section",
- "fieldtype": "Section Break"
+ "fieldtype": "Section Break",
+ "hide_border": 1
},
{
"fieldname": "taxes_and_charges",
@@ -709,7 +723,6 @@
},
{
"collapsible": 1,
- "collapsible_depends_on": "discount_amount",
"fieldname": "section_break_42",
"fieldtype": "Section Break",
"label": "Additional Discount"
@@ -749,7 +762,8 @@
},
{
"fieldname": "section_break_46",
- "fieldtype": "Section Break"
+ "fieldtype": "Section Break",
+ "label": "Totals"
},
{
"fieldname": "base_grand_total",
@@ -842,15 +856,6 @@
"label": "Disable Rounded Total"
},
{
- "collapsible": 1,
- "collapsible_depends_on": "terms",
- "fieldname": "terms_section_break",
- "fieldtype": "Section Break",
- "label": "Terms and Conditions",
- "oldfieldtype": "Section Break",
- "options": "fa fa-legal"
- },
- {
"fieldname": "tc_name",
"fieldtype": "Link",
"label": "Terms",
@@ -867,14 +872,6 @@
"oldfieldtype": "Text Editor"
},
{
- "collapsible": 1,
- "fieldname": "more_info",
- "fieldtype": "Section Break",
- "label": "More Information",
- "oldfieldtype": "Section Break",
- "options": "fa fa-file-text"
- },
- {
"default": "Draft",
"fieldname": "status",
"fieldtype": "Select",
@@ -924,7 +921,6 @@
"width": "50%"
},
{
- "description": "Track this Purchase Receipt against any Project",
"fieldname": "project",
"fieldtype": "Link",
"label": "Project",
@@ -941,7 +937,7 @@
{
"fieldname": "subscription_detail",
"fieldtype": "Section Break",
- "label": "Auto Repeat Detail"
+ "label": "Auto Repeat"
},
{
"fieldname": "auto_repeat",
@@ -1025,7 +1021,7 @@
"collapsible_depends_on": "transporter_name",
"fieldname": "transporter_info",
"fieldtype": "Section Break",
- "label": "Transporter Details",
+ "label": "Transporter",
"options": "fa fa-truck"
},
{
@@ -1087,7 +1083,7 @@
{
"fieldname": "billing_address",
"fieldtype": "Link",
- "label": "Select Billing Address",
+ "label": "Billing Address",
"options": "Address"
},
{
@@ -1113,7 +1109,6 @@
},
{
"depends_on": "eval: doc.is_internal_supplier",
- "description": "Sets 'From Warehouse' in each row of the items table.",
"fieldname": "set_from_warehouse",
"fieldtype": "Link",
"label": "Set From Warehouse",
@@ -1151,13 +1146,85 @@
"hidden": 1,
"label": "Is Old Subcontracting Flow",
"read_only": 1
+ },
+ {
+ "fieldname": "address_and_contact_tab",
+ "fieldtype": "Tab Break",
+ "label": "Address & Contact"
+ },
+ {
+ "fieldname": "terms_tab",
+ "fieldtype": "Tab Break",
+ "label": "Terms"
+ },
+ {
+ "fieldname": "more_info_tab",
+ "fieldtype": "Tab Break",
+ "label": "More Info"
+ },
+ {
+ "fieldname": "connections_tab",
+ "fieldtype": "Tab Break",
+ "label": "Connections",
+ "show_dashboard": 1
+ },
+ {
+ "fieldname": "column_break_12",
+ "fieldtype": "Column Break"
+ },
+ {
+ "fieldname": "column_break_31",
+ "fieldtype": "Column Break"
+ },
+ {
+ "fieldname": "column_break_43",
+ "fieldtype": "Column Break"
+ },
+ {
+ "fieldname": "column_break_53",
+ "fieldtype": "Column Break"
+ },
+ {
+ "fieldname": "section_break_98",
+ "fieldtype": "Section Break",
+ "label": "Company Shipping Address"
+ },
+ {
+ "fieldname": "billing_address_section",
+ "fieldtype": "Section Break",
+ "label": "Company Billing Address"
+ },
+ {
+ "collapsible": 1,
+ "fieldname": "status_section",
+ "fieldtype": "Section Break",
+ "label": "Status",
+ "oldfieldtype": "Section Break",
+ "options": "fa fa-file-text"
+ },
+ {
+ "fieldname": "additional_info_section",
+ "fieldtype": "Section Break",
+ "label": "Additional Info"
+ },
+ {
+ "fieldname": "column_break_131",
+ "fieldtype": "Column Break"
+ },
+ {
+ "fieldname": "column_break_100",
+ "fieldtype": "Column Break"
+ },
+ {
+ "fieldname": "column_break_104",
+ "fieldtype": "Column Break"
}
],
"icon": "fa fa-truck",
"idx": 261,
"is_submittable": 1,
"links": [],
- "modified": "2022-09-16 17:45:58.430132",
+ "modified": "2022-10-11 13:02:31.776256",
"modified_by": "Administrator",
"module": "Stock",
"name": "Purchase Receipt",
diff --git a/erpnext/stock/doctype/purchase_receipt/purchase_receipt.py b/erpnext/stock/doctype/purchase_receipt/purchase_receipt.py
index f85c478..673fcb5 100644
--- a/erpnext/stock/doctype/purchase_receipt/purchase_receipt.py
+++ b/erpnext/stock/doctype/purchase_receipt/purchase_receipt.py
@@ -6,7 +6,9 @@
from frappe import _, throw
from frappe.desk.notifications import clear_doctype_notifications
from frappe.model.mapper import get_mapped_doc
+from frappe.query_builder.functions import CombineDatetime
from frappe.utils import cint, flt, getdate, nowdate
+from pypika import functions as fn
import erpnext
from erpnext.accounts.utils import get_account_currency
@@ -750,48 +752,38 @@
def update_billing_status(self, update_modified=True):
updated_pr = [self.name]
+ po_details = []
for d in self.get("items"):
if d.get("purchase_invoice") and d.get("purchase_invoice_item"):
d.db_set("billed_amt", d.amount, update_modified=update_modified)
elif d.purchase_order_item:
- updated_pr += update_billed_amount_based_on_po(d.purchase_order_item, update_modified)
+ po_details.append(d.purchase_order_item)
+
+ if po_details:
+ updated_pr += update_billed_amount_based_on_po(po_details, update_modified)
for pr in set(updated_pr):
- pr_doc = self if (pr == self.name) else frappe.get_doc("Purchase Receipt", pr)
+ pr_doc = self if (pr == self.name) else frappe.get_cached_doc("Purchase Receipt", pr)
update_billing_percentage(pr_doc, update_modified=update_modified)
self.load_from_db()
-def update_billed_amount_based_on_po(po_detail, update_modified=True):
- # Billed against Sales Order directly
- billed_against_po = frappe.db.sql(
- """select sum(amount) from `tabPurchase Invoice Item`
- where po_detail=%s and (pr_detail is null or pr_detail = '') and docstatus=1""",
- po_detail,
- )
- billed_against_po = billed_against_po and billed_against_po[0][0] or 0
+def update_billed_amount_based_on_po(po_details, update_modified=True):
+ po_billed_amt_details = get_billed_amount_against_po(po_details)
- # Get all Purchase Receipt Item rows against the Purchase Order Item row
- pr_details = frappe.db.sql(
- """select pr_item.name, pr_item.amount, pr_item.parent
- from `tabPurchase Receipt Item` pr_item, `tabPurchase Receipt` pr
- where pr.name=pr_item.parent and pr_item.purchase_order_item=%s
- and pr.docstatus=1 and pr.is_return = 0
- order by pr.posting_date asc, pr.posting_time asc, pr.name asc""",
- po_detail,
- as_dict=1,
- )
+ # Get all Purchase Receipt Item rows against the Purchase Order Items
+ pr_details = get_purchase_receipts_against_po_details(po_details)
+
+ pr_items = [pr_detail.name for pr_detail in pr_details]
+ pr_items_billed_amount = get_billed_amount_against_pr(pr_items)
updated_pr = []
for pr_item in pr_details:
+ billed_against_po = flt(po_billed_amt_details.get(pr_item.purchase_order_item))
+
# Get billed amount directly against Purchase Receipt
- billed_amt_agianst_pr = frappe.db.sql(
- """select sum(amount) from `tabPurchase Invoice Item`
- where pr_detail=%s and docstatus=1""",
- pr_item.name,
- )
- billed_amt_agianst_pr = billed_amt_agianst_pr and billed_amt_agianst_pr[0][0] or 0
+ billed_amt_agianst_pr = flt(pr_items_billed_amount.get(pr_item.name, 0))
# Distribute billed amount directly against PO between PRs based on FIFO
if billed_against_po and billed_amt_agianst_pr < pr_item.amount:
@@ -803,19 +795,90 @@
billed_amt_agianst_pr += billed_against_po
billed_against_po = 0
- frappe.db.set_value(
- "Purchase Receipt Item",
- pr_item.name,
- "billed_amt",
- billed_amt_agianst_pr,
- update_modified=update_modified,
- )
+ po_billed_amt_details[pr_item.purchase_order_item] = billed_against_po
- updated_pr.append(pr_item.parent)
+ if pr_item.billed_amt != billed_amt_agianst_pr:
+ frappe.db.set_value(
+ "Purchase Receipt Item",
+ pr_item.name,
+ "billed_amt",
+ billed_amt_agianst_pr,
+ update_modified=update_modified,
+ )
+
+ updated_pr.append(pr_item.parent)
return updated_pr
+def get_purchase_receipts_against_po_details(po_details):
+ # Get Purchase Receipts against Purchase Order Items
+
+ purchase_receipt = frappe.qb.DocType("Purchase Receipt")
+ purchase_receipt_item = frappe.qb.DocType("Purchase Receipt Item")
+
+ query = (
+ frappe.qb.from_(purchase_receipt)
+ .inner_join(purchase_receipt_item)
+ .on(purchase_receipt.name == purchase_receipt_item.parent)
+ .select(
+ purchase_receipt_item.name,
+ purchase_receipt_item.parent,
+ purchase_receipt_item.amount,
+ purchase_receipt_item.billed_amt,
+ purchase_receipt_item.purchase_order_item,
+ )
+ .where(
+ (purchase_receipt_item.purchase_order_item.isin(po_details))
+ & (purchase_receipt.docstatus == 1)
+ & (purchase_receipt.is_return == 0)
+ )
+ .orderby(CombineDatetime(purchase_receipt.posting_date, purchase_receipt.posting_time))
+ .orderby(purchase_receipt.name)
+ )
+
+ return query.run(as_dict=True)
+
+
+def get_billed_amount_against_pr(pr_items):
+ # Get billed amount directly against Purchase Receipt
+
+ if not pr_items:
+ return {}
+
+ purchase_invoice_item = frappe.qb.DocType("Purchase Invoice Item")
+
+ query = (
+ frappe.qb.from_(purchase_invoice_item)
+ .select(fn.Sum(purchase_invoice_item.amount).as_("billed_amt"), purchase_invoice_item.pr_detail)
+ .where((purchase_invoice_item.pr_detail.isin(pr_items)) & (purchase_invoice_item.docstatus == 1))
+ .groupby(purchase_invoice_item.pr_detail)
+ ).run(as_dict=1)
+
+ return {d.pr_detail: flt(d.billed_amt) for d in query}
+
+
+def get_billed_amount_against_po(po_items):
+ # Get billed amount directly against Purchase Order
+ if not po_items:
+ return {}
+
+ purchase_invoice_item = frappe.qb.DocType("Purchase Invoice Item")
+
+ query = (
+ frappe.qb.from_(purchase_invoice_item)
+ .select(fn.Sum(purchase_invoice_item.amount).as_("billed_amt"), purchase_invoice_item.po_detail)
+ .where(
+ (purchase_invoice_item.po_detail.isin(po_items))
+ & (purchase_invoice_item.docstatus == 1)
+ & (purchase_invoice_item.pr_detail.isnull())
+ )
+ .groupby(purchase_invoice_item.po_detail)
+ ).run(as_dict=1)
+
+ return {d.po_detail: flt(d.billed_amt) for d in query}
+
+
def update_billing_percentage(pr_doc, update_modified=True):
# Reload as billed amount was set in db directly
pr_doc.load_from_db()
diff --git a/erpnext/stock/doctype/purchase_receipt/purchase_receipt_dashboard.py b/erpnext/stock/doctype/purchase_receipt/purchase_receipt_dashboard.py
index 06ba936..b3ae7b5 100644
--- a/erpnext/stock/doctype/purchase_receipt/purchase_receipt_dashboard.py
+++ b/erpnext/stock/doctype/purchase_receipt/purchase_receipt_dashboard.py
@@ -12,13 +12,17 @@
"Purchase Receipt": "return_against",
},
"internal_links": {
+ "Material Request": ["items", "material_request"],
"Purchase Order": ["items", "purchase_order"],
"Project": ["items", "project"],
"Quality Inspection": ["items", "quality_inspection"],
},
"transactions": [
{"label": _("Related"), "items": ["Purchase Invoice", "Landed Cost Voucher", "Asset"]},
- {"label": _("Reference"), "items": ["Purchase Order", "Quality Inspection", "Project"]},
+ {
+ "label": _("Reference"),
+ "items": ["Material Request", "Purchase Order", "Quality Inspection", "Project"],
+ },
{"label": _("Returns"), "items": ["Purchase Receipt"]},
{"label": _("Subscription"), "items": ["Auto Repeat"]},
],
diff --git a/erpnext/stock/doctype/purchase_receipt/test_purchase_receipt.py b/erpnext/stock/doctype/purchase_receipt/test_purchase_receipt.py
index 6269724..dc9f2b2 100644
--- a/erpnext/stock/doctype/purchase_receipt/test_purchase_receipt.py
+++ b/erpnext/stock/doctype/purchase_receipt/test_purchase_receipt.py
@@ -1,7 +1,6 @@
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
-
import frappe
from frappe.tests.utils import FrappeTestCase, change_settings
from frappe.utils import add_days, cint, cstr, flt, today
@@ -1199,6 +1198,8 @@
self.assertEqual(pr1.items[0].rate, 100)
pr1.submit()
+ self.assertEqual(pr1.is_internal_supplier, 1)
+
# Backdated purchase receipt entry, the valuation rate should be updated for DN1 and PR1
make_purchase_receipt(
item_code=item_doc.name,
@@ -1241,6 +1242,234 @@
self.assertEqual(query[0].value, 0)
+ def test_backdated_transaction_for_internal_transfer_in_trasit_warehouse_for_purchase_receipt(
+ self,
+ ):
+ from erpnext.stock.doctype.delivery_note.delivery_note import make_inter_company_purchase_receipt
+ from erpnext.stock.doctype.delivery_note.test_delivery_note import create_delivery_note
+
+ prepare_data_for_internal_transfer()
+ customer = "_Test Internal Customer 2"
+ company = "_Test Company with perpetual inventory"
+
+ from_warehouse = create_warehouse("_Test Internal From Warehouse New", company=company)
+ to_warehouse = create_warehouse("_Test Internal To Warehouse New", company=company)
+ item_doc = create_item("Test Internal Transfer Item")
+
+ target_warehouse = create_warehouse("_Test Internal GIT Warehouse New", company=company)
+
+ make_purchase_receipt(
+ item_code=item_doc.name,
+ company=company,
+ posting_date=add_days(today(), -1),
+ warehouse=from_warehouse,
+ qty=1,
+ rate=100,
+ )
+
+ # Keep stock in advance and make sure that systen won't pick this stock while reposting backdated transaction
+ for i in range(1, 4):
+ make_purchase_receipt(
+ item_code=item_doc.name,
+ company=company,
+ posting_date=add_days(today(), -1 * i),
+ warehouse=target_warehouse,
+ qty=1,
+ rate=320 * i,
+ )
+
+ dn1 = create_delivery_note(
+ item_code=item_doc.name,
+ company=company,
+ customer=customer,
+ cost_center="Main - TCP1",
+ expense_account="Cost of Goods Sold - TCP1",
+ qty=1,
+ rate=500,
+ warehouse=from_warehouse,
+ target_warehouse=target_warehouse,
+ )
+
+ self.assertEqual(dn1.items[0].rate, 100)
+
+ pr1 = make_inter_company_purchase_receipt(dn1.name)
+ pr1.items[0].warehouse = to_warehouse
+ self.assertEqual(pr1.items[0].rate, 100)
+ pr1.submit()
+
+ stk_ledger = frappe.db.get_value(
+ "Stock Ledger Entry",
+ {"voucher_type": "Purchase Receipt", "voucher_no": pr1.name, "warehouse": target_warehouse},
+ ["stock_value_difference", "outgoing_rate"],
+ as_dict=True,
+ )
+
+ self.assertEqual(abs(stk_ledger.stock_value_difference), 100)
+ self.assertEqual(stk_ledger.outgoing_rate, 100)
+
+ # Backdated purchase receipt entry, the valuation rate should be updated for DN1 and PR1
+ make_purchase_receipt(
+ item_code=item_doc.name,
+ company=company,
+ posting_date=add_days(today(), -2),
+ warehouse=from_warehouse,
+ qty=1,
+ rate=200,
+ )
+
+ dn_value = frappe.db.get_value(
+ "Stock Ledger Entry",
+ {"voucher_type": "Delivery Note", "voucher_no": dn1.name, "warehouse": target_warehouse},
+ "stock_value_difference",
+ )
+
+ self.assertEqual(abs(dn_value), 200.00)
+
+ pr_value = frappe.db.get_value(
+ "Stock Ledger Entry",
+ {"voucher_type": "Purchase Receipt", "voucher_no": pr1.name, "warehouse": to_warehouse},
+ "stock_value_difference",
+ )
+
+ self.assertEqual(abs(pr_value), 200.00)
+ pr1.load_from_db()
+
+ self.assertEqual(pr1.items[0].valuation_rate, 200)
+ self.assertEqual(pr1.items[0].rate, 100)
+
+ Gl = frappe.qb.DocType("GL Entry")
+
+ query = (
+ frappe.qb.from_(Gl)
+ .select(
+ (fn.Sum(Gl.debit) - fn.Sum(Gl.credit)).as_("value"),
+ )
+ .where((Gl.voucher_type == pr1.doctype) & (Gl.voucher_no == pr1.name))
+ ).run(as_dict=True)
+
+ self.assertEqual(query[0].value, 0)
+
+ def test_backdated_transaction_for_internal_transfer_in_trasit_warehouse_for_purchase_invoice(
+ self,
+ ):
+ from erpnext.accounts.doctype.purchase_invoice.test_purchase_invoice import (
+ make_purchase_invoice as make_purchase_invoice_for_si,
+ )
+ from erpnext.accounts.doctype.sales_invoice.sales_invoice import (
+ make_inter_company_purchase_invoice,
+ )
+ from erpnext.accounts.doctype.sales_invoice.test_sales_invoice import create_sales_invoice
+
+ prepare_data_for_internal_transfer()
+ customer = "_Test Internal Customer 2"
+ company = "_Test Company with perpetual inventory"
+
+ from_warehouse = create_warehouse("_Test Internal From Warehouse New", company=company)
+ to_warehouse = create_warehouse("_Test Internal To Warehouse New", company=company)
+ item_doc = create_item("Test Internal Transfer Item")
+
+ target_warehouse = create_warehouse("_Test Internal GIT Warehouse New", company=company)
+
+ make_purchase_invoice_for_si(
+ item_code=item_doc.name,
+ company=company,
+ posting_date=add_days(today(), -1),
+ warehouse=from_warehouse,
+ qty=1,
+ update_stock=1,
+ expense_account="Cost of Goods Sold - TCP1",
+ cost_center="Main - TCP1",
+ rate=100,
+ )
+
+ # Keep stock in advance and make sure that systen won't pick this stock while reposting backdated transaction
+ for i in range(1, 4):
+ make_purchase_invoice_for_si(
+ item_code=item_doc.name,
+ company=company,
+ posting_date=add_days(today(), -1 * i),
+ warehouse=target_warehouse,
+ update_stock=1,
+ qty=1,
+ expense_account="Cost of Goods Sold - TCP1",
+ cost_center="Main - TCP1",
+ rate=320 * i,
+ )
+
+ si1 = create_sales_invoice(
+ item_code=item_doc.name,
+ company=company,
+ customer=customer,
+ cost_center="Main - TCP1",
+ income_account="Sales - TCP1",
+ qty=1,
+ rate=500,
+ update_stock=1,
+ warehouse=from_warehouse,
+ target_warehouse=target_warehouse,
+ )
+
+ self.assertEqual(si1.items[0].rate, 100)
+
+ pi1 = make_inter_company_purchase_invoice(si1.name)
+ pi1.items[0].warehouse = to_warehouse
+ self.assertEqual(pi1.items[0].rate, 100)
+ pi1.update_stock = 1
+ pi1.save()
+ pi1.submit()
+
+ stk_ledger = frappe.db.get_value(
+ "Stock Ledger Entry",
+ {"voucher_type": pi1.doctype, "voucher_no": pi1.name, "warehouse": target_warehouse},
+ ["stock_value_difference", "outgoing_rate"],
+ as_dict=True,
+ )
+
+ self.assertEqual(abs(stk_ledger.stock_value_difference), 100)
+ self.assertEqual(stk_ledger.outgoing_rate, 100)
+
+ # Backdated purchase receipt entry, the valuation rate should be updated for si1 and pi1
+ make_purchase_receipt(
+ item_code=item_doc.name,
+ company=company,
+ posting_date=add_days(today(), -2),
+ warehouse=from_warehouse,
+ qty=1,
+ rate=200,
+ )
+
+ si_value = frappe.db.get_value(
+ "Stock Ledger Entry",
+ {"voucher_type": si1.doctype, "voucher_no": si1.name, "warehouse": target_warehouse},
+ "stock_value_difference",
+ )
+
+ self.assertEqual(abs(si_value), 200.00)
+
+ pi_value = frappe.db.get_value(
+ "Stock Ledger Entry",
+ {"voucher_type": pi1.doctype, "voucher_no": pi1.name, "warehouse": to_warehouse},
+ "stock_value_difference",
+ )
+
+ self.assertEqual(abs(pi_value), 200.00)
+ pi1.load_from_db()
+
+ self.assertEqual(pi1.items[0].valuation_rate, 200)
+ self.assertEqual(pi1.items[0].rate, 100)
+
+ Gl = frappe.qb.DocType("GL Entry")
+
+ query = (
+ frappe.qb.from_(Gl)
+ .select(
+ (fn.Sum(Gl.debit) - fn.Sum(Gl.credit)).as_("value"),
+ )
+ .where((Gl.voucher_type == pi1.doctype) & (Gl.voucher_no == pi1.name))
+ ).run(as_dict=True)
+
+ self.assertEqual(query[0].value, 0)
+
def test_batch_expiry_for_purchase_receipt(self):
from erpnext.controllers.sales_and_purchase_return import make_return_doc
diff --git a/erpnext/stock/doctype/purchase_receipt_item/purchase_receipt_item.json b/erpnext/stock/doctype/purchase_receipt_item/purchase_receipt_item.json
index 39833b5..557bb59 100644
--- a/erpnext/stock/doctype/purchase_receipt_item/purchase_receipt_item.json
+++ b/erpnext/stock/doctype/purchase_receipt_item/purchase_receipt_item.json
@@ -8,6 +8,7 @@
"engine": "InnoDB",
"field_order": [
"barcode",
+ "has_item_scanned",
"section_break_2",
"item_code",
"product_bundle",
@@ -744,6 +745,7 @@
"oldfieldname": "valuation_rate",
"oldfieldtype": "Currency",
"options": "Company:company:default_currency",
+ "precision": "6",
"print_hide": 1,
"print_width": "80px",
"read_only": 1,
@@ -918,6 +920,7 @@
},
{
"collapsible": 1,
+ "collapsible_depends_on": "eval: doc.margin_type || doc.discount_amount",
"fieldname": "discount_and_margin_section",
"fieldtype": "Section Break",
"label": "Discount and Margin"
@@ -994,12 +997,20 @@
{
"fieldname": "column_break_102",
"fieldtype": "Column Break"
+ },
+ {
+ "default": "0",
+ "depends_on": "barcode",
+ "fieldname": "has_item_scanned",
+ "fieldtype": "Check",
+ "label": "Has Item Scanned",
+ "read_only": 1
}
],
"idx": 1,
"istable": 1,
"links": [],
- "modified": "2022-07-28 19:27:54.880781",
+ "modified": "2022-11-02 12:49:28.746701",
"modified_by": "Administrator",
"module": "Stock",
"name": "Purchase Receipt Item",
diff --git a/erpnext/stock/doctype/quality_inspection/quality_inspection.json b/erpnext/stock/doctype/quality_inspection/quality_inspection.json
index edfe7e9..db9322f 100644
--- a/erpnext/stock/doctype/quality_inspection/quality_inspection.json
+++ b/erpnext/stock/doctype/quality_inspection/quality_inspection.json
@@ -10,6 +10,7 @@
"naming_series",
"report_date",
"status",
+ "manual_inspection",
"column_break_4",
"inspection_type",
"reference_type",
@@ -231,6 +232,12 @@
"label": "Status",
"options": "\nAccepted\nRejected",
"reqd": 1
+ },
+ {
+ "default": "0",
+ "fieldname": "manual_inspection",
+ "fieldtype": "Check",
+ "label": "Manual Inspection"
}
],
"icon": "fa fa-search",
@@ -238,10 +245,11 @@
"index_web_pages_for_search": 1,
"is_submittable": 1,
"links": [],
- "modified": "2020-12-18 19:59:55.710300",
+ "modified": "2022-10-04 22:00:13.995221",
"modified_by": "Administrator",
"module": "Stock",
"name": "Quality Inspection",
+ "naming_rule": "By \"Naming Series\" field",
"owner": "Administrator",
"permissions": [
{
@@ -262,5 +270,6 @@
"search_fields": "item_code, report_date, reference_name",
"show_name_in_global_search": 1,
"sort_field": "modified",
- "sort_order": "ASC"
+ "sort_order": "ASC",
+ "states": []
}
\ No newline at end of file
diff --git a/erpnext/stock/doctype/quality_inspection/quality_inspection.py b/erpnext/stock/doctype/quality_inspection/quality_inspection.py
index 13abfad..9321c2c 100644
--- a/erpnext/stock/doctype/quality_inspection/quality_inspection.py
+++ b/erpnext/stock/doctype/quality_inspection/quality_inspection.py
@@ -6,7 +6,7 @@
from frappe import _
from frappe.model.document import Document
from frappe.model.mapper import get_mapped_doc
-from frappe.utils import cint, flt
+from frappe.utils import cint, cstr, flt
from erpnext.stock.doctype.quality_inspection_template.quality_inspection_template import (
get_template_details,
@@ -30,6 +30,9 @@
if self.readings:
self.inspect_and_set_status()
+ def before_submit(self):
+ self.validate_readings_status_mandatory()
+
@frappe.whitelist()
def get_item_specification_details(self):
if not self.quality_inspection_template:
@@ -65,6 +68,11 @@
def on_cancel(self):
self.update_qc_reference()
+ def validate_readings_status_mandatory(self):
+ for reading in self.readings:
+ if not reading.status:
+ frappe.throw(_("Row #{0}: Status is mandatory").format(reading.idx))
+
def update_qc_reference(self):
quality_inspection = self.name if self.docstatus == 1 else ""
@@ -124,6 +132,16 @@
# if not formula based check acceptance values set
self.set_status_based_on_acceptance_values(reading)
+ if not self.manual_inspection:
+ self.status = "Accepted"
+ for reading in self.readings:
+ if reading.status == "Rejected":
+ self.status = "Rejected"
+ frappe.msgprint(
+ _("Status set to rejected as there are one or more rejected readings."), alert=True
+ )
+ break
+
def set_status_based_on_acceptance_values(self, reading):
if not cint(reading.numeric):
result = reading.get("reading_value") == reading.get("value")
@@ -201,68 +219,71 @@
@frappe.whitelist()
@frappe.validate_and_sanitize_search_inputs
def item_query(doctype, txt, searchfield, start, page_len, filters):
- if filters.get("from"):
- from frappe.desk.reportview import get_match_cond
+ from frappe.desk.reportview import get_match_cond
- mcond = get_match_cond(filters["from"])
- cond, qi_condition = "", "and (quality_inspection is null or quality_inspection = '')"
+ from_doctype = cstr(filters.get("doctype"))
+ if not from_doctype or not frappe.db.exists("DocType", from_doctype):
+ return []
- if filters.get("parent"):
- if (
- filters.get("from") in ["Purchase Invoice Item", "Purchase Receipt Item"]
- and filters.get("inspection_type") != "In Process"
- ):
- cond = """and item_code in (select name from `tabItem` where
- inspection_required_before_purchase = 1)"""
- elif (
- filters.get("from") in ["Sales Invoice Item", "Delivery Note Item"]
- and filters.get("inspection_type") != "In Process"
- ):
- cond = """and item_code in (select name from `tabItem` where
- inspection_required_before_delivery = 1)"""
- elif filters.get("from") == "Stock Entry Detail":
- cond = """and s_warehouse is null"""
+ mcond = get_match_cond(from_doctype)
+ cond, qi_condition = "", "and (quality_inspection is null or quality_inspection = '')"
- if filters.get("from") in ["Supplier Quotation Item"]:
- qi_condition = ""
+ if filters.get("parent"):
+ if (
+ from_doctype in ["Purchase Invoice Item", "Purchase Receipt Item"]
+ and filters.get("inspection_type") != "In Process"
+ ):
+ cond = """and item_code in (select name from `tabItem` where
+ inspection_required_before_purchase = 1)"""
+ elif (
+ from_doctype in ["Sales Invoice Item", "Delivery Note Item"]
+ and filters.get("inspection_type") != "In Process"
+ ):
+ cond = """and item_code in (select name from `tabItem` where
+ inspection_required_before_delivery = 1)"""
+ elif from_doctype == "Stock Entry Detail":
+ cond = """and s_warehouse is null"""
- return frappe.db.sql(
- """
- SELECT item_code
- FROM `tab{doc}`
- WHERE parent=%(parent)s and docstatus < 2 and item_code like %(txt)s
- {qi_condition} {cond} {mcond}
- ORDER BY item_code limit {page_len} offset {start}
- """.format(
- doc=filters.get("from"),
- cond=cond,
- mcond=mcond,
- start=start,
- page_len=page_len,
- qi_condition=qi_condition,
- ),
- {"parent": filters.get("parent"), "txt": "%%%s%%" % txt},
- )
+ if from_doctype in ["Supplier Quotation Item"]:
+ qi_condition = ""
- elif filters.get("reference_name"):
- return frappe.db.sql(
- """
- SELECT production_item
- FROM `tab{doc}`
- WHERE name = %(reference_name)s and docstatus < 2 and production_item like %(txt)s
- {qi_condition} {cond} {mcond}
- ORDER BY production_item
- limit {page_len} offset {start}
- """.format(
- doc=filters.get("from"),
- cond=cond,
- mcond=mcond,
- start=start,
- page_len=page_len,
- qi_condition=qi_condition,
- ),
- {"reference_name": filters.get("reference_name"), "txt": "%%%s%%" % txt},
- )
+ return frappe.db.sql(
+ """
+ SELECT item_code
+ FROM `tab{doc}`
+ WHERE parent=%(parent)s and docstatus < 2 and item_code like %(txt)s
+ {qi_condition} {cond} {mcond}
+ ORDER BY item_code limit {page_len} offset {start}
+ """.format(
+ doc=from_doctype,
+ cond=cond,
+ mcond=mcond,
+ start=cint(start),
+ page_len=cint(page_len),
+ qi_condition=qi_condition,
+ ),
+ {"parent": filters.get("parent"), "txt": "%%%s%%" % txt},
+ )
+
+ elif filters.get("reference_name"):
+ return frappe.db.sql(
+ """
+ SELECT production_item
+ FROM `tab{doc}`
+ WHERE name = %(reference_name)s and docstatus < 2 and production_item like %(txt)s
+ {qi_condition} {cond} {mcond}
+ ORDER BY production_item
+ limit {page_len} offset {start}
+ """.format(
+ doc=from_doctype,
+ cond=cond,
+ mcond=mcond,
+ start=cint(start),
+ page_len=cint(page_len),
+ qi_condition=qi_condition,
+ ),
+ {"reference_name": filters.get("reference_name"), "txt": "%%%s%%" % txt},
+ )
@frappe.whitelist()
diff --git a/erpnext/stock/doctype/quality_inspection/test_quality_inspection.py b/erpnext/stock/doctype/quality_inspection/test_quality_inspection.py
index 144f138..4f19643 100644
--- a/erpnext/stock/doctype/quality_inspection/test_quality_inspection.py
+++ b/erpnext/stock/doctype/quality_inspection/test_quality_inspection.py
@@ -160,7 +160,7 @@
)
readings = [
- {"specification": "Iron Content", "min_value": 0.1, "max_value": 0.9, "reading_1": "0.4"}
+ {"specification": "Iron Content", "min_value": 0.1, "max_value": 0.9, "reading_1": "1.0"}
]
qa = create_quality_inspection(
@@ -184,6 +184,38 @@
se.cancel()
frappe.db.set_value("Stock Settings", None, "action_if_quality_inspection_is_rejected", "Stop")
+ def test_qi_status(self):
+ make_stock_entry(
+ item_code="_Test Item with QA", target="_Test Warehouse - _TC", qty=1, basic_rate=100
+ )
+ dn = create_delivery_note(item_code="_Test Item with QA", do_not_submit=True)
+ qa = create_quality_inspection(
+ reference_type="Delivery Note", reference_name=dn.name, status="Accepted", do_not_save=True
+ )
+ qa.readings[0].manual_inspection = 1
+ qa.save()
+
+ # Case - 1: When there are one or more readings with rejected status and parent manual inspection is unchecked, then parent status should be set to rejected.
+ qa.status = "Accepted"
+ qa.manual_inspection = 0
+ qa.readings[0].status = "Rejected"
+ qa.save()
+ self.assertEqual(qa.status, "Rejected")
+
+ # Case - 2: When all readings have accepted status and parent manual inspection is unchecked, then parent status should be set to accepted.
+ qa.status = "Rejected"
+ qa.manual_inspection = 0
+ qa.readings[0].status = "Accepted"
+ qa.save()
+ self.assertEqual(qa.status, "Accepted")
+
+ # Case - 3: When parent manual inspection is checked, then parent status should not be changed.
+ qa.status = "Accepted"
+ qa.manual_inspection = 1
+ qa.readings[0].status = "Rejected"
+ qa.save()
+ self.assertEqual(qa.status, "Accepted")
+
def create_quality_inspection(**args):
args = frappe._dict(args)
diff --git a/erpnext/stock/doctype/repost_item_valuation/test_repost_item_valuation.py b/erpnext/stock/doctype/repost_item_valuation/test_repost_item_valuation.py
index edd2553..e0f2479 100644
--- a/erpnext/stock/doctype/repost_item_valuation/test_repost_item_valuation.py
+++ b/erpnext/stock/doctype/repost_item_valuation/test_repost_item_valuation.py
@@ -9,6 +9,7 @@
from frappe.utils import nowdate
from frappe.utils.data import add_to_date, today
+from erpnext.accounts.doctype.sales_invoice.test_sales_invoice import create_sales_invoice
from erpnext.accounts.utils import repost_gle_for_stock_vouchers
from erpnext.controllers.stock_controller import create_item_wise_repost_entries
from erpnext.stock.doctype.item.test_item import make_item
@@ -272,3 +273,57 @@
[{"credit": 50, "debit": 0}],
gle_filters={"account": "Stock In Hand - TCP1"},
)
+
+ def test_duplicate_ple_on_repost(self):
+ from erpnext.accounts import utils
+
+ # lower numbers to simplify test
+ orig_chunk_size = utils.GL_REPOSTING_CHUNK
+ utils.GL_REPOSTING_CHUNK = 2
+ self.addCleanup(setattr, utils, "GL_REPOSTING_CHUNK", orig_chunk_size)
+
+ rate = 100
+ item = self.make_item()
+ item.valuation_rate = 90
+ item.allow_negative_stock = 1
+ item.save()
+
+ company = "_Test Company with perpetual inventory"
+
+ # consume non-existing stock
+ sinv = create_sales_invoice(
+ company=company,
+ posting_date=today(),
+ debit_to="Debtors - TCP1",
+ income_account="Sales - TCP1",
+ expense_account="Cost of Goods Sold - TCP1",
+ warehouse="Stores - TCP1",
+ update_stock=1,
+ currency="INR",
+ item_code=item.name,
+ cost_center="Main - TCP1",
+ qty=1,
+ rate=rate,
+ )
+
+ # backdated receipt triggers repost
+ make_stock_entry(
+ item=item.name,
+ company=company,
+ qty=5,
+ rate=rate,
+ target="Stores - TCP1",
+ posting_date=add_to_date(today(), days=-1),
+ )
+
+ ple_entries = frappe.db.get_list(
+ "Payment Ledger Entry",
+ filters={"voucher_type": sinv.doctype, "voucher_no": sinv.name, "delinked": 0},
+ )
+
+ # assert successful deduplication on PLE
+ self.assertEqual(len(ple_entries), 1)
+
+ # outstanding should not be affected
+ sinv.reload()
+ self.assertEqual(sinv.outstanding_amount, 100)
diff --git a/erpnext/stock/doctype/serial_no/serial_no.py b/erpnext/stock/doctype/serial_no/serial_no.py
index 6042ed4..a2748d0 100644
--- a/erpnext/stock/doctype/serial_no/serial_no.py
+++ b/erpnext/stock/doctype/serial_no/serial_no.py
@@ -846,16 +846,15 @@
pos_transacted_sr_nos = query.run(as_dict=True)
- reserved_sr_nos = []
- returned_sr_nos = []
+ reserved_sr_nos = set()
+ returned_sr_nos = set()
for d in pos_transacted_sr_nos:
if d.is_return == 0:
- reserved_sr_nos += get_serial_nos(d.serial_no)
+ [reserved_sr_nos.add(x) for x in get_serial_nos(d.serial_no)]
elif d.is_return == 1:
- returned_sr_nos += get_serial_nos(d.serial_no)
+ [returned_sr_nos.add(x) for x in get_serial_nos(d.serial_no)]
- for sr_no in returned_sr_nos:
- reserved_sr_nos.remove(sr_no)
+ reserved_sr_nos = list(reserved_sr_nos - returned_sr_nos)
return reserved_sr_nos
diff --git a/erpnext/stock/doctype/stock_entry/stock_entry.json b/erpnext/stock/doctype/stock_entry/stock_entry.json
index abe98e2..7e9420d 100644
--- a/erpnext/stock/doctype/stock_entry/stock_entry.json
+++ b/erpnext/stock/doctype/stock_entry/stock_entry.json
@@ -148,19 +148,19 @@
"search_index": 1
},
{
- "depends_on": "eval:doc.purpose==\"Send to Subcontractor\"",
- "fieldname": "purchase_order",
- "fieldtype": "Link",
- "label": "Purchase Order",
- "options": "Purchase Order"
+ "depends_on": "eval:doc.purpose==\"Send to Subcontractor\"",
+ "fieldname": "purchase_order",
+ "fieldtype": "Link",
+ "label": "Purchase Order",
+ "options": "Purchase Order"
},
{
- "depends_on": "eval:doc.purpose==\"Send to Subcontractor\"",
- "fieldname": "subcontracting_order",
- "fieldtype": "Link",
- "label": "Subcontracting Order",
- "options": "Subcontracting Order"
- },
+ "depends_on": "eval:doc.purpose==\"Send to Subcontractor\"",
+ "fieldname": "subcontracting_order",
+ "fieldtype": "Link",
+ "label": "Subcontracting Order",
+ "options": "Subcontracting Order"
+ },
{
"depends_on": "eval:doc.purpose==\"Sales Return\"",
"fieldname": "delivery_note_no",
@@ -616,6 +616,7 @@
"fieldname": "is_return",
"fieldtype": "Check",
"hidden": 1,
+ "in_list_view": 1,
"label": "Is Return",
"no_copy": 1,
"print_hide": 1,
@@ -627,7 +628,7 @@
"index_web_pages_for_search": 1,
"is_submittable": 1,
"links": [],
- "modified": "2022-05-02 05:21:39.060501",
+ "modified": "2022-10-07 14:39:51.943770",
"modified_by": "Administrator",
"module": "Stock",
"name": "Stock Entry",
diff --git a/erpnext/stock/doctype/stock_entry/stock_entry.py b/erpnext/stock/doctype/stock_entry/stock_entry.py
index 8bcd772..b116735 100644
--- a/erpnext/stock/doctype/stock_entry/stock_entry.py
+++ b/erpnext/stock/doctype/stock_entry/stock_entry.py
@@ -1212,13 +1212,19 @@
def update_work_order(self):
def _validate_work_order(pro_doc):
+ msg, title = "", ""
if flt(pro_doc.docstatus) != 1:
- frappe.throw(_("Work Order {0} must be submitted").format(self.work_order))
+ msg = f"Work Order {self.work_order} must be submitted"
if pro_doc.status == "Stopped":
- frappe.throw(
- _("Transaction not allowed against stopped Work Order {0}").format(self.work_order)
- )
+ msg = f"Transaction not allowed against stopped Work Order {self.work_order}"
+
+ if self.is_return and pro_doc.status not in ["Completed", "Closed"]:
+ title = _("Stock Return")
+ msg = f"Work Order {self.work_order} must be completed or closed"
+
+ if msg:
+ frappe.throw(_(msg), title=title)
if self.job_card:
job_doc = frappe.get_doc("Job Card", self.job_card)
@@ -1754,10 +1760,12 @@
for key, row in available_materials.items():
remaining_qty_to_produce = flt(wo_data.trans_qty) - flt(wo_data.produced_qty)
- if remaining_qty_to_produce <= 0:
+ if remaining_qty_to_produce <= 0 and not self.is_return:
continue
- qty = (flt(row.qty) * flt(self.fg_completed_qty)) / remaining_qty_to_produce
+ qty = flt(row.qty)
+ if not self.is_return:
+ qty = (flt(row.qty) * flt(self.fg_completed_qty)) / remaining_qty_to_produce
item = row.item_details
if cint(frappe.get_cached_value("UOM", item.stock_uom, "must_be_whole_number")):
@@ -1781,6 +1789,9 @@
self.update_item_in_stock_entry_detail(row, item, qty)
def update_item_in_stock_entry_detail(self, row, item, qty) -> None:
+ if not qty:
+ return
+
ste_item_details = {
"from_warehouse": item.warehouse,
"to_warehouse": "",
@@ -1794,6 +1805,9 @@
"original_item": item.original_item,
}
+ if self.is_return:
+ ste_item_details["to_warehouse"] = item.s_warehouse
+
if row.serial_nos:
serial_nos = row.serial_nos
if item.batch_no:
diff --git a/erpnext/stock/doctype/stock_entry/stock_entry_list.js b/erpnext/stock/doctype/stock_entry/stock_entry_list.js
index cbc3491..af29d49 100644
--- a/erpnext/stock/doctype/stock_entry/stock_entry_list.js
+++ b/erpnext/stock/doctype/stock_entry/stock_entry_list.js
@@ -1,8 +1,12 @@
frappe.listview_settings['Stock Entry'] = {
add_fields: ["`tabStock Entry`.`from_warehouse`", "`tabStock Entry`.`to_warehouse`",
- "`tabStock Entry`.`purpose`", "`tabStock Entry`.`work_order`", "`tabStock Entry`.`bom_no`"],
+ "`tabStock Entry`.`purpose`", "`tabStock Entry`.`work_order`", "`tabStock Entry`.`bom_no`",
+ "`tabStock Entry`.`is_return`"],
get_indicator: function (doc) {
- if (doc.docstatus === 0) {
+ if(doc.is_return===1 && doc.purpose === "Material Transfer for Manufacture") {
+ return [__("Material Returned from WIP"), "orange",
+ "is_return,=,1|purpose,=,Material Transfer for Manufacture|docstatus,<,2"];
+ } else if (doc.docstatus === 0) {
return [__("Draft"), "red", "docstatus,=,0"];
} else if (doc.purpose === 'Send to Warehouse' && doc.per_transferred < 100) {
diff --git a/erpnext/stock/doctype/stock_entry_detail/stock_entry_detail.json b/erpnext/stock/doctype/stock_entry_detail/stock_entry_detail.json
index 5fe11a2..95f4f5f 100644
--- a/erpnext/stock/doctype/stock_entry_detail/stock_entry_detail.json
+++ b/erpnext/stock/doctype/stock_entry_detail/stock_entry_detail.json
@@ -8,6 +8,7 @@
"engine": "InnoDB",
"field_order": [
"barcode",
+ "has_item_scanned",
"section_break_2",
"s_warehouse",
"col_break1",
@@ -498,14 +499,14 @@
"read_only": 1
},
{
- "fieldname": "sco_rm_detail",
- "fieldtype": "Data",
- "hidden": 1,
- "label": "SCO Supplied Item",
- "no_copy": 1,
- "print_hide": 1,
- "read_only": 1
- },
+ "fieldname": "sco_rm_detail",
+ "fieldtype": "Data",
+ "hidden": 1,
+ "label": "SCO Supplied Item",
+ "no_copy": 1,
+ "print_hide": 1,
+ "read_only": 1
+ },
{
"default": "0",
"depends_on": "eval:parent.purpose===\"Repack\" && doc.t_warehouse",
@@ -563,13 +564,21 @@
"fieldname": "is_process_loss",
"fieldtype": "Check",
"label": "Is Process Loss"
+ },
+ {
+ "default": "0",
+ "depends_on": "barcode",
+ "fieldname": "has_item_scanned",
+ "fieldtype": "Check",
+ "label": "Has Item Scanned",
+ "read_only": 1
}
],
"idx": 1,
"index_web_pages_for_search": 1,
"istable": 1,
"links": [],
- "modified": "2022-06-17 05:06:33.621264",
+ "modified": "2022-11-02 13:00:34.258828",
"modified_by": "Administrator",
"module": "Stock",
"name": "Stock Entry Detail",
diff --git a/erpnext/stock/doctype/stock_ledger_entry/test_stock_ledger_entry.py b/erpnext/stock/doctype/stock_ledger_entry/test_stock_ledger_entry.py
index 1410da5..6c341d9 100644
--- a/erpnext/stock/doctype/stock_ledger_entry/test_stock_ledger_entry.py
+++ b/erpnext/stock/doctype/stock_ledger_entry/test_stock_ledger_entry.py
@@ -1323,13 +1323,15 @@
item.save()
-def create_items():
- items = [
- "_Test Item for Reposting",
- "_Test Finished Item for Reposting",
- "_Test Subcontracted Item for Reposting",
- "_Test Bundled Item for Reposting",
- ]
+def create_items(items=None, uoms=None):
+ if not items:
+ items = [
+ "_Test Item for Reposting",
+ "_Test Finished Item for Reposting",
+ "_Test Subcontracted Item for Reposting",
+ "_Test Bundled Item for Reposting",
+ ]
+
for d in items:
properties = {"valuation_method": "FIFO"}
if d == "_Test Bundled Item for Reposting":
@@ -1337,7 +1339,7 @@
elif d == "_Test Subcontracted Item for Reposting":
properties.update({"is_sub_contracted_item": 1})
- make_item(d, properties=properties)
+ make_item(d, properties=properties, uoms=uoms)
return items
diff --git a/erpnext/stock/doctype/stock_reconciliation/stock_reconciliation.py b/erpnext/stock/doctype/stock_reconciliation/stock_reconciliation.py
index 23e0f1e..d92d0f1 100644
--- a/erpnext/stock/doctype/stock_reconciliation/stock_reconciliation.py
+++ b/erpnext/stock/doctype/stock_reconciliation/stock_reconciliation.py
@@ -132,7 +132,9 @@
key.append(row.get(field))
if key in item_warehouse_combinations:
- self.validation_messages.append(_get_msg(row_num, _("Duplicate entry")))
+ self.validation_messages.append(
+ _get_msg(row_num, _("Same item and warehouse combination already entered."))
+ )
else:
item_warehouse_combinations.append(key)
diff --git a/erpnext/stock/doctype/stock_reconciliation_item/stock_reconciliation_item.json b/erpnext/stock/doctype/stock_reconciliation_item/stock_reconciliation_item.json
index 79c2fcc..7c3e151 100644
--- a/erpnext/stock/doctype/stock_reconciliation_item/stock_reconciliation_item.json
+++ b/erpnext/stock/doctype/stock_reconciliation_item/stock_reconciliation_item.json
@@ -7,6 +7,7 @@
"engine": "InnoDB",
"field_order": [
"barcode",
+ "has_item_scanned",
"item_code",
"item_name",
"warehouse",
@@ -177,11 +178,18 @@
"label": "Allow Zero Valuation Rate",
"print_hide": 1,
"read_only": 1
+ },
+ {
+ "depends_on": "barcode",
+ "fieldname": "has_item_scanned",
+ "fieldtype": "Data",
+ "label": "Has Item Scanned",
+ "read_only": 1
}
],
"istable": 1,
"links": [],
- "modified": "2022-04-02 04:19:40.380587",
+ "modified": "2022-11-02 13:01:23.580937",
"modified_by": "Administrator",
"module": "Stock",
"name": "Stock Reconciliation Item",
diff --git a/erpnext/stock/doctype/warehouse/warehouse.py b/erpnext/stock/doctype/warehouse/warehouse.py
index ab784ca..6e06d23 100644
--- a/erpnext/stock/doctype/warehouse/warehouse.py
+++ b/erpnext/stock/doctype/warehouse/warehouse.py
@@ -9,6 +9,7 @@
from frappe.contacts.address_and_contact import load_address_and_contact
from frappe.utils import cint, flt
from frappe.utils.nestedset import NestedSet
+from pypika.terms import ExistsCriterion
from erpnext.stock import get_warehouse_account
@@ -266,3 +267,23 @@
frappe.throw(_("Warehouse not found against the account {0}").format(account))
return warehouses
+
+
+# Will be use for frappe.qb
+def apply_warehouse_filter(query, sle, filters):
+ if warehouse := filters.get("warehouse"):
+ warehouse_table = frappe.qb.DocType("Warehouse")
+
+ lft, rgt = frappe.db.get_value("Warehouse", warehouse, ["lft", "rgt"])
+ chilren_subquery = (
+ frappe.qb.from_(warehouse_table)
+ .select(warehouse_table.name)
+ .where(
+ (warehouse_table.lft >= lft)
+ & (warehouse_table.rgt <= rgt)
+ & (warehouse_table.name == sle.warehouse)
+ )
+ )
+ query = query.where(ExistsCriterion(chilren_subquery))
+
+ return query
diff --git a/erpnext/stock/get_item_details.py b/erpnext/stock/get_item_details.py
index e83182f..108611c 100644
--- a/erpnext/stock/get_item_details.py
+++ b/erpnext/stock/get_item_details.py
@@ -330,6 +330,9 @@
else:
args.uom = item.stock_uom
+ # Set stock UOM in args, so that it can be used while fetching item price
+ args.stock_uom = item.stock_uom
+
if args.get("batch_no") and item.name != frappe.get_cached_value(
"Batch", args.get("batch_no"), "item"
):
diff --git a/erpnext/stock/report/batch_item_expiry_status/batch_item_expiry_status.py b/erpnext/stock/report/batch_item_expiry_status/batch_item_expiry_status.py
index 3d9b046..ef7d6e6 100644
--- a/erpnext/stock/report/batch_item_expiry_status/batch_item_expiry_status.py
+++ b/erpnext/stock/report/batch_item_expiry_status/batch_item_expiry_status.py
@@ -4,6 +4,7 @@
import frappe
from frappe import _
+from frappe.query_builder.functions import IfNull
from frappe.utils import cint, getdate
@@ -54,31 +55,28 @@
return columns
-def get_conditions(filters):
- conditions = ""
+def get_stock_ledger_entries(filters):
if not filters.get("from_date"):
frappe.throw(_("'From Date' is required"))
- if filters.get("to_date"):
- conditions += " and posting_date <= '%s'" % filters["to_date"]
- else:
+ if not filters.get("to_date"):
frappe.throw(_("'To Date' is required"))
- return conditions
-
-
-def get_stock_ledger_entries(filters):
- conditions = get_conditions(filters)
- return frappe.db.sql(
- """select item_code, batch_no, warehouse,
- posting_date, actual_qty
- from `tabStock Ledger Entry`
- where is_cancelled = 0
- and docstatus < 2 and ifnull(batch_no, '') != '' %s order by item_code, warehouse"""
- % conditions,
- as_dict=1,
+ sle = frappe.qb.DocType("Stock Ledger Entry")
+ query = (
+ frappe.qb.from_(sle)
+ .select(sle.item_code, sle.batch_no, sle.warehouse, sle.posting_date, sle.actual_qty)
+ .where(
+ (sle.is_cancelled == 0)
+ & (sle.docstatus < 2)
+ & (IfNull(sle.batch_no, "") != "")
+ & (sle.posting_date <= filters["to_date"])
+ )
+ .orderby(sle.item_code, sle.warehouse)
)
+ return query.run(as_dict=True)
+
def get_item_warehouse_batch_map(filters, float_precision):
sle = get_stock_ledger_entries(filters)
@@ -112,7 +110,7 @@
def get_item_details(filters):
item_map = {}
- for d in frappe.db.sql("select name, item_name, description from tabItem", as_dict=1):
+ for d in (frappe.qb.from_("Item").select("name", "item_name", "description")).run(as_dict=True):
item_map.setdefault(d.name, d)
return item_map
diff --git a/erpnext/stock/report/batch_wise_balance_history/batch_wise_balance_history.py b/erpnext/stock/report/batch_wise_balance_history/batch_wise_balance_history.py
index 8a13300..0d57938 100644
--- a/erpnext/stock/report/batch_wise_balance_history/batch_wise_balance_history.py
+++ b/erpnext/stock/report/batch_wise_balance_history/batch_wise_balance_history.py
@@ -5,6 +5,9 @@
import frappe
from frappe import _
from frappe.utils import cint, flt, getdate
+from pypika import functions as fn
+
+from erpnext.stock.doctype.warehouse.warehouse import apply_warehouse_filter
def execute(filters=None):
@@ -64,37 +67,40 @@
return columns
-def get_conditions(filters):
- conditions = ""
- if not filters.get("from_date"):
- frappe.throw(_("'From Date' is required"))
-
- if filters.get("to_date"):
- conditions += " and posting_date <= '%s'" % filters["to_date"]
- else:
- frappe.throw(_("'To Date' is required"))
-
- for field in ["item_code", "warehouse", "batch_no", "company"]:
- if filters.get(field):
- conditions += " and {0} = {1}".format(field, frappe.db.escape(filters.get(field)))
-
- return conditions
-
-
# get all details
def get_stock_ledger_entries(filters):
- conditions = get_conditions(filters)
- return frappe.db.sql(
- """
- select item_code, batch_no, warehouse, posting_date, sum(actual_qty) as actual_qty
- from `tabStock Ledger Entry`
- where is_cancelled = 0 and docstatus < 2 and ifnull(batch_no, '') != '' %s
- group by voucher_no, batch_no, item_code, warehouse
- order by item_code, warehouse"""
- % conditions,
- as_dict=1,
+ if not filters.get("from_date"):
+ frappe.throw(_("'From Date' is required"))
+ if not filters.get("to_date"):
+ frappe.throw(_("'To Date' is required"))
+
+ sle = frappe.qb.DocType("Stock Ledger Entry")
+ query = (
+ frappe.qb.from_(sle)
+ .select(
+ sle.item_code,
+ sle.warehouse,
+ sle.batch_no,
+ sle.posting_date,
+ fn.Sum(sle.actual_qty).as_("actual_qty"),
+ )
+ .where(
+ (sle.docstatus < 2)
+ & (sle.is_cancelled == 0)
+ & (fn.IfNull(sle.batch_no, "") != "")
+ & (sle.posting_date <= filters["to_date"])
+ )
+ .groupby(sle.voucher_no, sle.batch_no, sle.item_code, sle.warehouse)
+ .orderby(sle.item_code, sle.warehouse)
)
+ query = apply_warehouse_filter(query, sle, filters)
+ for field in ["item_code", "batch_no", "company"]:
+ if filters.get(field):
+ query = query.where(sle[field] == filters.get(field))
+
+ return query.run(as_dict=True)
+
def get_item_warehouse_batch_map(filters, float_precision):
sle = get_stock_ledger_entries(filters)
@@ -127,7 +133,9 @@
def get_item_details(filters):
item_map = {}
- for d in frappe.db.sql("select name, item_name, description, stock_uom from tabItem", as_dict=1):
+ for d in (frappe.qb.from_("Item").select("name", "item_name", "description", "stock_uom")).run(
+ as_dict=1
+ ):
item_map.setdefault(d.name, d)
return item_map
diff --git a/erpnext/stock/report/delayed_item_report/delayed_item_report.py b/erpnext/stock/report/delayed_item_report/delayed_item_report.py
index 9df24d6..546a834 100644
--- a/erpnext/stock/report/delayed_item_report/delayed_item_report.py
+++ b/erpnext/stock/report/delayed_item_report/delayed_item_report.py
@@ -21,56 +21,54 @@
return self.get_columns(), self.get_data() or []
def get_data(self, consolidated=False):
- conditions = ""
-
doctype = self.filters.get("based_on")
- child_doc = "%s Item" % doctype
+ sales_order_field = "sales_order" if doctype == "Sales Invoice" else "against_sales_order"
+
+ parent = frappe.qb.DocType(doctype)
+ child = frappe.qb.DocType(f"{doctype} Item")
+
+ query = (
+ frappe.qb.from_(child)
+ .from_(parent)
+ .select(
+ child.item_code,
+ child.item_name,
+ child.item_group,
+ child.qty,
+ child.rate,
+ child.amount,
+ child.so_detail,
+ child[sales_order_field].as_("sales_order"),
+ parent.shipping_address_name,
+ parent.po_no,
+ parent.customer,
+ parent.posting_date,
+ parent.name,
+ parent.grand_total,
+ )
+ .where(
+ (child.parent == parent.name)
+ & (parent.docstatus == 1)
+ & (parent.posting_date.between(self.filters.get("from_date"), self.filters.get("to_date")))
+ & (child[sales_order_field].notnull())
+ & (child[sales_order_field] != "")
+ )
+ )
if doctype == "Sales Invoice":
- conditions = " and `tabSales Invoice`.update_stock = 1 and `tabSales Invoice`.is_pos = 0"
+ query = query.where((parent.update_stock == 1) & (parent.is_pos == 0))
if self.filters.get("item_group"):
- conditions += " and `tab%s`.item_group = %s" % (
- child_doc,
- frappe.db.escape(self.filters.get("item_group")),
- )
-
- for field in ["customer", "customer_group", "company"]:
- if self.filters.get(field):
- conditions += " and `tab%s`.%s = %s" % (
- doctype,
- field,
- frappe.db.escape(self.filters.get(field)),
- )
-
- sales_order_field = "against_sales_order"
- if doctype == "Sales Invoice":
- sales_order_field = "sales_order"
+ query = query.where(child.item_group == self.filters.get("item_group"))
if self.filters.get("sales_order"):
- conditions = " and `tab%s`.%s = '%s'" % (
- child_doc,
- sales_order_field,
- self.filters.get("sales_order"),
- )
+ query = query.where(child[sales_order_field] == self.filters.get("sales_order"))
- self.transactions = frappe.db.sql(
- """ SELECT `tab{child_doc}`.item_code, `tab{child_doc}`.item_name,
- `tab{child_doc}`.item_group, `tab{child_doc}`.qty, `tab{child_doc}`.rate, `tab{child_doc}`.amount,
- `tab{child_doc}`.so_detail, `tab{child_doc}`.{so_field} as sales_order,
- `tab{doctype}`.shipping_address_name, `tab{doctype}`.po_no, `tab{doctype}`.customer,
- `tab{doctype}`.posting_date, `tab{doctype}`.name, `tab{doctype}`.grand_total
- FROM `tab{child_doc}`, `tab{doctype}`
- WHERE
- `tab{child_doc}`.parent = `tab{doctype}`.name and `tab{doctype}`.docstatus = 1 and
- `tab{doctype}`.posting_date between %(from_date)s and %(to_date)s and
- `tab{child_doc}`.{so_field} is not null and `tab{child_doc}`.{so_field} != '' {cond}
- """.format(
- cond=conditions, doctype=doctype, child_doc=child_doc, so_field=sales_order_field
- ),
- {"from_date": self.filters.get("from_date"), "to_date": self.filters.get("to_date")},
- as_dict=1,
- )
+ for field in ("customer", "customer_group", "company"):
+ if self.filters.get(field):
+ query = query.where(parent[field] == self.filters.get(field))
+
+ self.transactions = query.run(as_dict=True)
if self.transactions:
self.filter_transactions_data(consolidated)
diff --git a/erpnext/stock/report/item_prices/item_prices.py b/erpnext/stock/report/item_prices/item_prices.py
index 87f1a42..ab47b4a 100644
--- a/erpnext/stock/report/item_prices/item_prices.py
+++ b/erpnext/stock/report/item_prices/item_prices.py
@@ -4,6 +4,7 @@
import frappe
from frappe import _
+from frappe.query_builder.functions import IfNull, Sum
from frappe.utils import flt
@@ -12,8 +13,7 @@
filters = {}
columns = get_columns(filters)
- conditions = get_condition(filters)
- item_map = get_item_details(conditions)
+ item_map = get_item_details(filters)
pl = get_price_list()
last_purchase_rate = get_last_purchase_rate()
bom_rate = get_item_bom_rate()
@@ -63,18 +63,24 @@
return columns
-def get_item_details(conditions):
+def get_item_details(filters):
"""returns all items details"""
item_map = {}
- for i in frappe.db.sql(
- """select name, item_group, item_name, description,
- brand, stock_uom from tabItem %s
- order by item_code, item_group"""
- % (conditions),
- as_dict=1,
- ):
+ item = frappe.qb.DocType("Item")
+ query = (
+ frappe.qb.from_(item)
+ .select(item.name, item.item_group, item.item_name, item.description, item.brand, item.stock_uom)
+ .orderby(item.item_code, item.item_group)
+ )
+
+ if filters.get("items") == "Enabled Items only":
+ query = query.where(item.disabled == 0)
+ elif filters.get("items") == "Disabled Items only":
+ query = query.where(item.disabled == 1)
+
+ for i in query.run(as_dict=True):
item_map.setdefault(i.name, i)
return item_map
@@ -85,19 +91,38 @@
rate = {}
- price_list = frappe.db.sql(
- """select ip.item_code, ip.buying, ip.selling,
- concat(ifnull(cu.symbol,ip.currency), " ", round(ip.price_list_rate,2), " - ", ip.price_list) as price
- from `tabItem Price` ip, `tabPrice List` pl, `tabCurrency` cu
- where ip.price_list=pl.name and pl.currency=cu.name and pl.enabled=1""",
- as_dict=1,
- )
+ ip = frappe.qb.DocType("Item Price")
+ pl = frappe.qb.DocType("Price List")
+ cu = frappe.qb.DocType("Currency")
- for j in price_list:
- if j.price:
- rate.setdefault(j.item_code, {}).setdefault("Buying" if j.buying else "Selling", []).append(
- j.price
+ price_list = (
+ frappe.qb.from_(ip)
+ .from_(pl)
+ .from_(cu)
+ .select(
+ ip.item_code,
+ ip.buying,
+ ip.selling,
+ (IfNull(cu.symbol, ip.currency)).as_("currency"),
+ ip.price_list_rate,
+ ip.price_list,
+ )
+ .where((ip.price_list == pl.name) & (pl.currency == cu.name) & (pl.enabled == 1))
+ ).run(as_dict=True)
+
+ for d in price_list:
+ d.update(
+ {"price": "{0} {1} - {2}".format(d.currency, round(d.price_list_rate, 2), d.price_list)}
+ )
+ d.pop("currency")
+ d.pop("price_list_rate")
+ d.pop("price_list")
+
+ if d.price:
+ rate.setdefault(d.item_code, {}).setdefault("Buying" if d.buying else "Selling", []).append(
+ d.price
)
+
item_rate_map = {}
for item in rate:
@@ -112,30 +137,39 @@
def get_last_purchase_rate():
item_last_purchase_rate_map = {}
- query = """select * from (
- (select
- po_item.item_code,
- po.transaction_date as posting_date,
- po_item.base_rate
- from `tabPurchase Order` po, `tabPurchase Order Item` po_item
- where po.name = po_item.parent and po.docstatus = 1)
- union
- (select
- pr_item.item_code,
- pr.posting_date,
- pr_item.base_rate
- from `tabPurchase Receipt` pr, `tabPurchase Receipt Item` pr_item
- where pr.name = pr_item.parent and pr.docstatus = 1)
- union
- (select
- pi_item.item_code,
- pi.posting_date,
- pi_item.base_rate
- from `tabPurchase Invoice` pi, `tabPurchase Invoice Item` pi_item
- where pi.name = pi_item.parent and pi.docstatus = 1 and pi.update_stock = 1)
- ) result order by result.item_code asc, result.posting_date asc"""
+ po = frappe.qb.DocType("Purchase Order")
+ pr = frappe.qb.DocType("Purchase Receipt")
+ pi = frappe.qb.DocType("Purchase Invoice")
+ po_item = frappe.qb.DocType("Purchase Order Item")
+ pr_item = frappe.qb.DocType("Purchase Receipt Item")
+ pi_item = frappe.qb.DocType("Purchase Invoice Item")
- for d in frappe.db.sql(query, as_dict=1):
+ query = (
+ frappe.qb.from_(
+ (
+ frappe.qb.from_(po)
+ .from_(po_item)
+ .select(po_item.item_code, po.transaction_date.as_("posting_date"), po_item.base_rate)
+ .where((po.name == po_item.parent) & (po.docstatus == 1))
+ )
+ + (
+ frappe.qb.from_(pr)
+ .from_(pr_item)
+ .select(pr_item.item_code, pr.posting_date, pr_item.base_rate)
+ .where((pr.name == pr_item.parent) & (pr.docstatus == 1))
+ )
+ + (
+ frappe.qb.from_(pi)
+ .from_(pi_item)
+ .select(pi_item.item_code, pi.posting_date, pi_item.base_rate)
+ .where((pi.name == pi_item.parent) & (pi.docstatus == 1) & (pi.update_stock == 1))
+ )
+ )
+ .select("*")
+ .orderby("item_code", "posting_date")
+ )
+
+ for d in query.run(as_dict=True):
item_last_purchase_rate_map[d.item_code] = d.base_rate
return item_last_purchase_rate_map
@@ -146,12 +180,15 @@
item_bom_map = {}
- for b in frappe.db.sql(
- """select item, (total_cost/quantity) as bom_rate
- from `tabBOM` where is_active=1 and is_default=1""",
- as_dict=1,
- ):
- item_bom_map.setdefault(b.item, flt(b.bom_rate))
+ bom = frappe.qb.DocType("BOM")
+ bom_data = (
+ frappe.qb.from_(bom)
+ .select(bom.item, (bom.total_cost / bom.quantity).as_("bom_rate"))
+ .where((bom.is_active == 1) & (bom.is_default == 1))
+ ).run(as_dict=True)
+
+ for d in bom_data:
+ item_bom_map.setdefault(d.item, flt(d.bom_rate))
return item_bom_map
@@ -161,25 +198,17 @@
item_val_rate_map = {}
- for d in frappe.db.sql(
- """select item_code,
- sum(actual_qty*valuation_rate)/sum(actual_qty) as val_rate
- from tabBin where actual_qty > 0 group by item_code""",
- as_dict=1,
- ):
+ bin = frappe.qb.DocType("Bin")
+ bin_data = (
+ frappe.qb.from_(bin)
+ .select(
+ bin.item_code, Sum(bin.actual_qty * bin.valuation_rate) / Sum(bin.actual_qty).as_("val_rate")
+ )
+ .where(bin.actual_qty > 0)
+ .groupby(bin.item_code)
+ ).run(as_dict=True)
+
+ for d in bin_data:
item_val_rate_map.setdefault(d.item_code, d.val_rate)
return item_val_rate_map
-
-
-def get_condition(filters):
- """Get Filter Items"""
-
- if filters.get("items") == "Enabled Items only":
- conditions = " where disabled=0 "
- elif filters.get("items") == "Disabled Items only":
- conditions = " where disabled=1 "
- else:
- conditions = ""
-
- return conditions
diff --git a/erpnext/stock/report/itemwise_recommended_reorder_level/itemwise_recommended_reorder_level.py b/erpnext/stock/report/itemwise_recommended_reorder_level/itemwise_recommended_reorder_level.py
index f308e9e..a6fc049 100644
--- a/erpnext/stock/report/itemwise_recommended_reorder_level/itemwise_recommended_reorder_level.py
+++ b/erpnext/stock/report/itemwise_recommended_reorder_level/itemwise_recommended_reorder_level.py
@@ -3,6 +3,7 @@
import frappe
from frappe import _
+from frappe.query_builder.functions import Abs, Sum
from frappe.utils import flt, getdate
@@ -11,8 +12,6 @@
filters = {}
float_precision = frappe.db.get_default("float_precision")
- condition = get_condition(filters)
-
avg_daily_outgoing = 0
diff = ((getdate(filters.get("to_date")) - getdate(filters.get("from_date"))).days) + 1
if diff <= 0:
@@ -20,8 +19,8 @@
columns = get_columns()
items = get_item_info(filters)
- consumed_item_map = get_consumed_items(condition)
- delivered_item_map = get_delivered_items(condition)
+ consumed_item_map = get_consumed_items(filters)
+ delivered_item_map = get_delivered_items(filters)
data = []
for item in items:
@@ -71,76 +70,86 @@
def get_item_info(filters):
from erpnext.stock.report.stock_ledger.stock_ledger import get_item_group_condition
- conditions = [get_item_group_condition(filters.get("item_group"))]
- if filters.get("brand"):
- conditions.append("item.brand=%(brand)s")
- conditions.append("is_stock_item = 1")
-
- return frappe.db.sql(
- """select name, item_name, description, brand, item_group,
- safety_stock, lead_time_days from `tabItem` item where {}""".format(
- " and ".join(conditions)
- ),
- filters,
- as_dict=1,
+ item = frappe.qb.DocType("Item")
+ query = (
+ frappe.qb.from_(item)
+ .select(
+ item.name,
+ item.item_name,
+ item.description,
+ item.brand,
+ item.item_group,
+ item.safety_stock,
+ item.lead_time_days,
+ )
+ .where(item.is_stock_item == 1)
)
+ if brand := filters.get("brand"):
+ query = query.where(item.brand == brand)
-def get_consumed_items(condition):
+ if conditions := get_item_group_condition(filters.get("item_group"), item):
+ query = query.where(conditions)
+
+ return query.run(as_dict=True)
+
+
+def get_consumed_items(filters):
purpose_to_exclude = [
"Material Transfer for Manufacture",
"Material Transfer",
"Send to Subcontractor",
]
- condition += """
- and (
- purpose is NULL
- or purpose not in ({})
+ se = frappe.qb.DocType("Stock Entry")
+ sle = frappe.qb.DocType("Stock Ledger Entry")
+ query = (
+ frappe.qb.from_(sle)
+ .left_join(se)
+ .on(sle.voucher_no == se.name)
+ .select(sle.item_code, Abs(Sum(sle.actual_qty)).as_("consumed_qty"))
+ .where(
+ (sle.actual_qty < 0)
+ & (sle.is_cancelled == 0)
+ & (sle.voucher_type.notin(["Delivery Note", "Sales Invoice"]))
+ & ((se.purpose.isnull()) | (se.purpose.notin(purpose_to_exclude)))
)
- """.format(
- ", ".join(f"'{p}'" for p in purpose_to_exclude)
+ .groupby(sle.item_code)
)
- condition = condition.replace("posting_date", "sle.posting_date")
+ query = get_filtered_query(filters, sle, query)
- consumed_items = frappe.db.sql(
- """
- select item_code, abs(sum(actual_qty)) as consumed_qty
- from `tabStock Ledger Entry` as sle left join `tabStock Entry` as se
- on sle.voucher_no = se.name
- where
- actual_qty < 0
- and is_cancelled = 0
- and voucher_type not in ('Delivery Note', 'Sales Invoice')
- %s
- group by item_code"""
- % condition,
- as_dict=1,
- )
+ consumed_items = query.run(as_dict=True)
consumed_items_map = {item.item_code: item.consumed_qty for item in consumed_items}
return consumed_items_map
-def get_delivered_items(condition):
- dn_items = frappe.db.sql(
- """select dn_item.item_code, sum(dn_item.stock_qty) as dn_qty
- from `tabDelivery Note` dn, `tabDelivery Note Item` dn_item
- where dn.name = dn_item.parent and dn.docstatus = 1 %s
- group by dn_item.item_code"""
- % (condition),
- as_dict=1,
+def get_delivered_items(filters):
+ parent = frappe.qb.DocType("Delivery Note")
+ child = frappe.qb.DocType("Delivery Note Item")
+ query = (
+ frappe.qb.from_(parent)
+ .from_(child)
+ .select(child.item_code, Sum(child.stock_qty).as_("dn_qty"))
+ .where((parent.name == child.parent) & (parent.docstatus == 1))
+ .groupby(child.item_code)
)
+ query = get_filtered_query(filters, parent, query)
- si_items = frappe.db.sql(
- """select si_item.item_code, sum(si_item.stock_qty) as si_qty
- from `tabSales Invoice` si, `tabSales Invoice Item` si_item
- where si.name = si_item.parent and si.docstatus = 1 and
- si.update_stock = 1 %s
- group by si_item.item_code"""
- % (condition),
- as_dict=1,
+ dn_items = query.run(as_dict=True)
+
+ parent = frappe.qb.DocType("Sales Invoice")
+ child = frappe.qb.DocType("Sales Invoice Item")
+ query = (
+ frappe.qb.from_(parent)
+ .from_(child)
+ .select(child.item_code, Sum(child.stock_qty).as_("si_qty"))
+ .where((parent.name == child.parent) & (parent.docstatus == 1) & (parent.update_stock == 1))
+ .groupby(child.item_code)
)
+ query = get_filtered_query(filters, parent, query)
+
+ si_items = query.run(as_dict=True)
dn_item_map = {}
for item in dn_items:
@@ -152,13 +161,10 @@
return dn_item_map
-def get_condition(filters):
- conditions = ""
+def get_filtered_query(filters, table, query):
if filters.get("from_date") and filters.get("to_date"):
- conditions += " and posting_date between '%s' and '%s'" % (
- filters["from_date"],
- filters["to_date"],
- )
+ query = query.where(table.posting_date.between(filters["from_date"], filters["to_date"]))
else:
- frappe.throw(_("From and To dates required"))
- return conditions
+ frappe.throw(_("From and To dates are required"))
+
+ return query
diff --git a/erpnext/stock/report/product_bundle_balance/product_bundle_balance.py b/erpnext/stock/report/product_bundle_balance/product_bundle_balance.py
index 854875a..9e75201 100644
--- a/erpnext/stock/report/product_bundle_balance/product_bundle_balance.py
+++ b/erpnext/stock/report/product_bundle_balance/product_bundle_balance.py
@@ -4,7 +4,9 @@
import frappe
from frappe import _
+from frappe.query_builder.functions import IfNull
from frappe.utils import flt
+from pypika.terms import ExistsCriterion
from erpnext.stock.report.stock_ledger.stock_ledger import get_item_group_condition
@@ -123,43 +125,65 @@
pb_details = frappe._dict()
item_details = frappe._dict()
- conditions = get_parent_item_conditions(filters)
- parent_item_details = frappe.db.sql(
- """
- select item.name as item_code, item.item_name, pb.description, item.item_group, item.brand, item.stock_uom
- from `tabItem` item
- inner join `tabProduct Bundle` pb on pb.new_item_code = item.name
- where ifnull(item.disabled, 0) = 0 {0}
- """.format(
- conditions
- ),
- filters,
- as_dict=1,
- ) # nosec
+ item = frappe.qb.DocType("Item")
+ pb = frappe.qb.DocType("Product Bundle")
+
+ query = (
+ frappe.qb.from_(item)
+ .inner_join(pb)
+ .on(pb.new_item_code == item.name)
+ .select(
+ item.name.as_("item_code"),
+ item.item_name,
+ pb.description,
+ item.item_group,
+ item.brand,
+ item.stock_uom,
+ )
+ .where(IfNull(item.disabled, 0) == 0)
+ )
+
+ if item_code := filters.get("item_code"):
+ query = query.where(item.item_code == item_code)
+ else:
+ if brand := filters.get("brand"):
+ query = query.where(item.brand == brand)
+ if item_group := filters.get("item_group"):
+ if conditions := get_item_group_condition(item_group, item):
+ query = query.where(conditions)
+
+ parent_item_details = query.run(as_dict=True)
parent_items = []
for d in parent_item_details:
parent_items.append(d.item_code)
item_details[d.item_code] = d
+ child_item_details = []
if parent_items:
- child_item_details = frappe.db.sql(
- """
- select
- pb.new_item_code as parent_item, pbi.item_code, item.item_name, pbi.description, item.item_group, item.brand,
- item.stock_uom, pbi.uom, pbi.qty
- from `tabProduct Bundle Item` pbi
- inner join `tabProduct Bundle` pb on pb.name = pbi.parent
- inner join `tabItem` item on item.name = pbi.item_code
- where pb.new_item_code in ({0})
- """.format(
- ", ".join(["%s"] * len(parent_items))
- ),
- parent_items,
- as_dict=1,
- ) # nosec
- else:
- child_item_details = []
+ item = frappe.qb.DocType("Item")
+ pb = frappe.qb.DocType("Product Bundle")
+ pbi = frappe.qb.DocType("Product Bundle Item")
+
+ child_item_details = (
+ frappe.qb.from_(pbi)
+ .inner_join(pb)
+ .on(pb.name == pbi.parent)
+ .inner_join(item)
+ .on(item.name == pbi.item_code)
+ .select(
+ pb.new_item_code.as_("parent_item"),
+ pbi.item_code,
+ item.item_name,
+ pbi.description,
+ item.item_group,
+ item.brand,
+ item.stock_uom,
+ pbi.uom,
+ pbi.qty,
+ )
+ .where(pb.new_item_code.isin(parent_items))
+ ).run(as_dict=1)
child_items = set()
for d in child_item_details:
@@ -184,58 +208,42 @@
if not items:
return []
- item_conditions_sql = " and sle.item_code in ({})".format(
- ", ".join(frappe.db.escape(i) for i in items)
+ sle = frappe.qb.DocType("Stock Ledger Entry")
+ sle2 = frappe.qb.DocType("Stock Ledger Entry")
+
+ query = (
+ frappe.qb.from_(sle)
+ .force_index("posting_sort_index")
+ .left_join(sle2)
+ .on(
+ (sle.item_code == sle2.item_code)
+ & (sle.warehouse == sle2.warehouse)
+ & (sle.posting_date < sle2.posting_date)
+ & (sle.posting_time < sle2.posting_time)
+ & (sle.name < sle2.name)
+ )
+ .select(sle.item_code, sle.warehouse, sle.qty_after_transaction, sle.company)
+ .where((sle2.name.isnull()) & (sle.docstatus < 2) & (sle.item_code.isin(items)))
)
- conditions = get_sle_conditions(filters)
-
- return frappe.db.sql(
- """
- select
- sle.item_code, sle.warehouse, sle.qty_after_transaction, sle.company
- from
- `tabStock Ledger Entry` sle force index (posting_sort_index)
- left join `tabStock Ledger Entry` sle2 on
- sle.item_code = sle2.item_code and sle.warehouse = sle2.warehouse
- and (sle.posting_date, sle.posting_time, sle.name) < (sle2.posting_date, sle2.posting_time, sle2.name)
- where sle2.name is null and sle.docstatus < 2 %s %s"""
- % (item_conditions_sql, conditions),
- as_dict=1,
- ) # nosec
-
-
-def get_parent_item_conditions(filters):
- conditions = []
-
- if filters.get("item_code"):
- conditions.append("item.item_code = %(item_code)s")
+ if date := filters.get("date"):
+ query = query.where(sle.posting_date <= date)
else:
- if filters.get("brand"):
- conditions.append("item.brand=%(brand)s")
- if filters.get("item_group"):
- conditions.append(get_item_group_condition(filters.get("item_group")))
-
- conditions = " and ".join(conditions)
- return "and {0}".format(conditions) if conditions else ""
-
-
-def get_sle_conditions(filters):
- conditions = ""
- if not filters.get("date"):
frappe.throw(_("'Date' is required"))
- conditions += " and sle.posting_date <= %s" % frappe.db.escape(filters.get("date"))
-
if filters.get("warehouse"):
warehouse_details = frappe.db.get_value(
"Warehouse", filters.get("warehouse"), ["lft", "rgt"], as_dict=1
)
- if warehouse_details:
- conditions += (
- " and exists (select name from `tabWarehouse` wh \
- where wh.lft >= %s and wh.rgt <= %s and sle.warehouse = wh.name)"
- % (warehouse_details.lft, warehouse_details.rgt)
- ) # nosec
- return conditions
+ if warehouse_details:
+ wh = frappe.qb.DocType("Warehouse")
+ query = query.where(
+ ExistsCriterion(
+ frappe.qb.from_(wh)
+ .select(wh.name)
+ .where((wh.lft >= warehouse_details.lft) & (wh.rgt <= warehouse_details.rgt))
+ )
+ )
+
+ return query.run(as_dict=True)
diff --git a/erpnext/stock/report/stock_ageing/stock_ageing.py b/erpnext/stock/report/stock_ageing/stock_ageing.py
index 7c430e4..2fa97ae 100644
--- a/erpnext/stock/report/stock_ageing/stock_ageing.py
+++ b/erpnext/stock/report/stock_ageing/stock_ageing.py
@@ -198,11 +198,11 @@
f"0 - {filters['range1']}",
f"{cint(filters['range1']) + 1} - {cint(filters['range2'])}",
f"{cint(filters['range2']) + 1} - {cint(filters['range3'])}",
- f"{cint(filters['range3']) + 1} - {_('Above')}",
+ _("{0} - Above").format(cint(filters["range3"]) + 1),
]
for i, label in enumerate(ranges):
fieldname = "range" + str(i + 1)
- add_column(range_columns, label=f"Age ({label})", fieldname=fieldname)
+ add_column(range_columns, label=_("Age ({0})").format(label), fieldname=fieldname)
def add_column(
diff --git a/erpnext/stock/report/stock_analytics/stock_analytics.py b/erpnext/stock/report/stock_analytics/stock_analytics.py
index 89ca9d9..27b94ab 100644
--- a/erpnext/stock/report/stock_analytics/stock_analytics.py
+++ b/erpnext/stock/report/stock_analytics/stock_analytics.py
@@ -114,11 +114,13 @@
months = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"]
if filters.range == "Weekly":
- period = "Week " + str(posting_date.isocalendar()[1]) + " " + str(posting_date.year)
+ period = _("Week {0} {1}").format(str(posting_date.isocalendar()[1]), str(posting_date.year))
elif filters.range == "Monthly":
- period = str(months[posting_date.month - 1]) + " " + str(posting_date.year)
+ period = _(str(months[posting_date.month - 1])) + " " + str(posting_date.year)
elif filters.range == "Quarterly":
- period = "Quarter " + str(((posting_date.month - 1) // 3) + 1) + " " + str(posting_date.year)
+ period = _("Quarter {0} {1}").format(
+ str(((posting_date.month - 1) // 3) + 1), str(posting_date.year)
+ )
else:
year = get_fiscal_year(posting_date, company=filters.company)
period = str(year[2])
diff --git a/erpnext/stock/report/stock_balance/stock_balance.py b/erpnext/stock/report/stock_balance/stock_balance.py
index 679d234..0fc642e 100644
--- a/erpnext/stock/report/stock_balance/stock_balance.py
+++ b/erpnext/stock/report/stock_balance/stock_balance.py
@@ -10,10 +10,10 @@
from frappe.query_builder.functions import CombineDatetime
from frappe.utils import cint, date_diff, flt, getdate
from frappe.utils.nestedset import get_descendants_of
-from pypika.terms import ExistsCriterion
import erpnext
from erpnext.stock.doctype.inventory_dimension.inventory_dimension import get_inventory_dimensions
+from erpnext.stock.doctype.warehouse.warehouse import apply_warehouse_filter
from erpnext.stock.report.stock_ageing.stock_ageing import FIFOSlots, get_average_age
from erpnext.stock.utils import add_additional_uom_columns, is_reposting_item_valuation_in_progress
@@ -270,18 +270,8 @@
if company := filters.get("company"):
query = query.where(sle.company == company)
- if warehouse := filters.get("warehouse"):
- lft, rgt = frappe.db.get_value("Warehouse", warehouse, ["lft", "rgt"])
- chilren_subquery = (
- frappe.qb.from_(warehouse_table)
- .select(warehouse_table.name)
- .where(
- (warehouse_table.lft >= lft)
- & (warehouse_table.rgt <= rgt)
- & (warehouse_table.name == sle.warehouse)
- )
- )
- query = query.where(ExistsCriterion(chilren_subquery))
+ if filters.get("warehouse"):
+ query = apply_warehouse_filter(query, sle, filters)
elif warehouse_type := filters.get("warehouse_type"):
query = (
query.join(warehouse_table)
diff --git a/erpnext/stock/report/stock_ledger/stock_ledger.py b/erpnext/stock/report/stock_ledger/stock_ledger.py
index e18d4c7..b725d49 100644
--- a/erpnext/stock/report/stock_ledger/stock_ledger.py
+++ b/erpnext/stock/report/stock_ledger/stock_ledger.py
@@ -6,11 +6,11 @@
from frappe import _
from frappe.query_builder.functions import CombineDatetime
from frappe.utils import cint, flt
-from pypika.terms import ExistsCriterion
from erpnext.stock.doctype.inventory_dimension.inventory_dimension import get_inventory_dimensions
from erpnext.stock.doctype.serial_no.serial_no import get_serial_nos
from erpnext.stock.doctype.stock_reconciliation.stock_reconciliation import get_stock_balance_for
+from erpnext.stock.doctype.warehouse.warehouse import apply_warehouse_filter
from erpnext.stock.utils import (
is_reposting_item_valuation_in_progress,
update_included_uom_in_report,
@@ -295,20 +295,7 @@
if filters.get(field):
query = query.where(sle[field] == filters.get(field))
- if warehouse := filters.get("warehouse"):
- lft, rgt = frappe.db.get_value("Warehouse", warehouse, ["lft", "rgt"])
-
- warehouse_table = frappe.qb.DocType("Warehouse")
- chilren_subquery = (
- frappe.qb.from_(warehouse_table)
- .select(warehouse_table.name)
- .where(
- (warehouse_table.lft >= lft)
- & (warehouse_table.rgt <= rgt)
- & (warehouse_table.name == sle.warehouse)
- )
- )
- query = query.where(ExistsCriterion(chilren_subquery))
+ query = apply_warehouse_filter(query, sle, filters)
return query.run(as_dict=True)
@@ -318,20 +305,25 @@
def get_items(filters):
+ item = frappe.qb.DocType("Item")
+ query = frappe.qb.from_(item).select(item.name)
conditions = []
- if filters.get("item_code"):
- conditions.append("item.name=%(item_code)s")
+
+ if item_code := filters.get("item_code"):
+ conditions.append(item.name == item_code)
else:
- if filters.get("brand"):
- conditions.append("item.brand=%(brand)s")
- if filters.get("item_group"):
- conditions.append(get_item_group_condition(filters.get("item_group")))
+ if brand := filters.get("brand"):
+ conditions.append(item.brand == brand)
+ if item_group := filters.get("item_group"):
+ if condition := get_item_group_condition(item_group, item):
+ conditions.append(condition)
items = []
if conditions:
- items = frappe.db.sql_list(
- """select name from `tabItem` item where {}""".format(" and ".join(conditions)), filters
- )
+ for condition in conditions:
+ query = query.where(condition)
+ items = [r[0] for r in query.run()]
+
return items
@@ -343,29 +335,22 @@
if not items:
return item_details
- cf_field = cf_join = ""
+ item = frappe.qb.DocType("Item")
+ query = (
+ frappe.qb.from_(item)
+ .select(item.name, item.item_name, item.description, item.item_group, item.brand, item.stock_uom)
+ .where(item.name.isin(items))
+ )
+
if include_uom:
- cf_field = ", ucd.conversion_factor"
- cf_join = (
- "left join `tabUOM Conversion Detail` ucd on ucd.parent=item.name and ucd.uom=%s"
- % frappe.db.escape(include_uom)
+ ucd = frappe.qb.DocType("UOM Conversion Detail")
+ query = (
+ query.left_join(ucd)
+ .on((ucd.parent == item.name) & (ucd.uom == include_uom))
+ .select(ucd.conversion_factor)
)
- res = frappe.db.sql(
- """
- select
- item.name, item.item_name, item.description, item.item_group, item.brand, item.stock_uom {cf_field}
- from
- `tabItem` item
- {cf_join}
- where
- item.name in ({item_codes})
- """.format(
- cf_field=cf_field, cf_join=cf_join, item_codes=",".join(["%s"] * len(items))
- ),
- items,
- as_dict=1,
- )
+ res = query.run(as_dict=True)
for item in res:
item_details.setdefault(item.name, item)
@@ -409,7 +394,7 @@
)
# check if any SLEs are actually Opening Stock Reconciliation
- for sle in sl_entries:
+ for sle in list(sl_entries):
if (
sle.get("voucher_type") == "Stock Reconciliation"
and sle.posting_date == filters.from_date
@@ -440,16 +425,28 @@
return ""
-def get_item_group_condition(item_group):
+def get_item_group_condition(item_group, item_table=None):
item_group_details = frappe.db.get_value("Item Group", item_group, ["lft", "rgt"], as_dict=1)
if item_group_details:
- return (
- "item.item_group in (select ig.name from `tabItem Group` ig \
- where ig.lft >= %s and ig.rgt <= %s and item.item_group = ig.name)"
- % (item_group_details.lft, item_group_details.rgt)
- )
-
- return ""
+ if item_table:
+ ig = frappe.qb.DocType("Item Group")
+ return item_table.item_group.isin(
+ (
+ frappe.qb.from_(ig)
+ .select(ig.name)
+ .where(
+ (ig.lft >= item_group_details.lft)
+ & (ig.rgt <= item_group_details.rgt)
+ & (item_table.item_group == ig.name)
+ )
+ )
+ )
+ else:
+ return (
+ "item.item_group in (select ig.name from `tabItem Group` ig \
+ where ig.lft >= %s and ig.rgt <= %s and item.item_group = ig.name)"
+ % (item_group_details.lft, item_group_details.rgt)
+ )
def check_inventory_dimension_filters_applied(filters) -> bool:
diff --git a/erpnext/stock/report/stock_projected_qty/stock_projected_qty.py b/erpnext/stock/report/stock_projected_qty/stock_projected_qty.py
index 49e797d..f477d8f 100644
--- a/erpnext/stock/report/stock_projected_qty/stock_projected_qty.py
+++ b/erpnext/stock/report/stock_projected_qty/stock_projected_qty.py
@@ -5,6 +5,7 @@
import frappe
from frappe import _
from frappe.utils import flt, today
+from pypika.terms import ExistsCriterion
from erpnext.accounts.doctype.pos_invoice.pos_invoice import get_pos_reserved_qty
from erpnext.stock.utils import (
@@ -218,10 +219,26 @@
def get_bin_list(filters):
- conditions = []
+ bin = frappe.qb.DocType("Bin")
+ query = (
+ frappe.qb.from_(bin)
+ .select(
+ bin.item_code,
+ bin.warehouse,
+ bin.actual_qty,
+ bin.planned_qty,
+ bin.indented_qty,
+ bin.ordered_qty,
+ bin.reserved_qty,
+ bin.reserved_qty_for_production,
+ bin.reserved_qty_for_sub_contract,
+ bin.projected_qty,
+ )
+ .orderby(bin.item_code, bin.warehouse)
+ )
if filters.item_code:
- conditions.append("item_code = '%s' " % filters.item_code)
+ query = query.where(bin.item_code == filters.item_code)
if filters.warehouse:
warehouse_details = frappe.db.get_value(
@@ -229,21 +246,20 @@
)
if warehouse_details:
- conditions.append(
- " exists (select name from `tabWarehouse` wh \
- where wh.lft >= %s and wh.rgt <= %s and bin.warehouse = wh.name)"
- % (warehouse_details.lft, warehouse_details.rgt)
+ wh = frappe.qb.DocType("Warehouse")
+ query = query.where(
+ ExistsCriterion(
+ frappe.qb.from_(wh)
+ .select(wh.name)
+ .where(
+ (wh.lft >= warehouse_details.lft)
+ & (wh.rgt <= warehouse_details.rgt)
+ & (bin.warehouse == wh.name)
+ )
+ )
)
- bin_list = frappe.db.sql(
- """select item_code, warehouse, actual_qty, planned_qty, indented_qty,
- ordered_qty, reserved_qty, reserved_qty_for_production, reserved_qty_for_sub_contract, projected_qty
- from tabBin bin {conditions} order by item_code, warehouse
- """.format(
- conditions=" where " + " and ".join(conditions) if conditions else ""
- ),
- as_dict=1,
- )
+ bin_list = query.run(as_dict=True)
return bin_list
@@ -251,45 +267,43 @@
def get_item_map(item_code, include_uom):
"""Optimization: get only the item doc and re_order_levels table"""
- condition = ""
- if item_code:
- condition = "and item_code = {0}".format(frappe.db.escape(item_code, percent=False))
+ bin = frappe.qb.DocType("Bin")
+ item = frappe.qb.DocType("Item")
- cf_field = cf_join = ""
- if include_uom:
- cf_field = ", ucd.conversion_factor"
- cf_join = (
- "left join `tabUOM Conversion Detail` ucd on ucd.parent=item.name and ucd.uom=%(include_uom)s"
+ query = (
+ frappe.qb.from_(item)
+ .select(item.name, item.item_name, item.description, item.item_group, item.brand, item.stock_uom)
+ .where(
+ (item.is_stock_item == 1)
+ & (item.disabled == 0)
+ & (
+ (item.end_of_life > today()) | (item.end_of_life.isnull()) | (item.end_of_life == "0000-00-00")
+ )
+ & (ExistsCriterion(frappe.qb.from_(bin).select(bin.name).where(bin.item_code == item.name)))
)
-
- items = frappe.db.sql(
- """
- select item.name, item.item_name, item.description, item.item_group, item.brand, item.stock_uom{cf_field}
- from `tabItem` item
- {cf_join}
- where item.is_stock_item = 1
- and item.disabled=0
- {condition}
- and (item.end_of_life > %(today)s or item.end_of_life is null or item.end_of_life='0000-00-00')
- and exists (select name from `tabBin` bin where bin.item_code=item.name)""".format(
- cf_field=cf_field, cf_join=cf_join, condition=condition
- ),
- {"today": today(), "include_uom": include_uom},
- as_dict=True,
)
- condition = ""
if item_code:
- condition = "where parent={0}".format(frappe.db.escape(item_code, percent=False))
+ query = query.where(item.item_code == item_code)
+
+ if include_uom:
+ ucd = frappe.qb.DocType("UOM Conversion Detail")
+ query = query.left_join(ucd).on((ucd.parent == item.name) & (ucd.uom == include_uom))
+
+ items = query.run(as_dict=True)
+
+ ir = frappe.qb.DocType("Item Reorder")
+ query = frappe.qb.from_(ir).select("*")
+
+ if item_code:
+ query = query.where(ir.parent == item_code)
reorder_levels = frappe._dict()
- for ir in frappe.db.sql(
- """select * from `tabItem Reorder` {condition}""".format(condition=condition), as_dict=1
- ):
- if ir.parent not in reorder_levels:
- reorder_levels[ir.parent] = []
+ for d in query.run(as_dict=True):
+ if d.parent not in reorder_levels:
+ reorder_levels[d.parent] = []
- reorder_levels[ir.parent].append(ir)
+ reorder_levels[d.parent].append(d)
item_map = frappe._dict()
for item in items:
diff --git a/erpnext/stock/report/supplier_wise_sales_analytics/supplier_wise_sales_analytics.py b/erpnext/stock/report/supplier_wise_sales_analytics/supplier_wise_sales_analytics.py
index 5430fe6..8c76908 100644
--- a/erpnext/stock/report/supplier_wise_sales_analytics/supplier_wise_sales_analytics.py
+++ b/erpnext/stock/report/supplier_wise_sales_analytics/supplier_wise_sales_analytics.py
@@ -4,6 +4,7 @@
import frappe
from frappe import _
+from frappe.query_builder.functions import IfNull
from frappe.utils import flt
@@ -70,31 +71,33 @@
return columns
-def get_conditions(filters):
- conditions = ""
- values = []
+def get_consumed_details(filters):
+ item = frappe.qb.DocType("Item")
+ sle = frappe.qb.DocType("Stock Ledger Entry")
+
+ query = (
+ frappe.qb.from_(sle)
+ .from_(item)
+ .select(
+ sle.item_code,
+ item.item_name,
+ item.description,
+ item.stock_uom,
+ sle.actual_qty,
+ sle.stock_value_difference,
+ sle.voucher_no,
+ sle.voucher_type,
+ )
+ .where((sle.is_cancelled == 0) & (sle.item_code == item.name) & (sle.actual_qty < 0))
+ )
if filters.get("from_date") and filters.get("to_date"):
- conditions = "and sle.posting_date>=%s and sle.posting_date<=%s"
- values = [filters.get("from_date"), filters.get("to_date")]
+ query = query.where(
+ (sle.posting_date >= filters.get("from_date")) & (sle.posting_date <= filters.get("to_date"))
+ )
- return conditions, values
-
-
-def get_consumed_details(filters):
- conditions, values = get_conditions(filters)
consumed_details = {}
-
- for d in frappe.db.sql(
- """select sle.item_code, i.item_name, i.description,
- i.stock_uom, sle.actual_qty, sle.stock_value_difference,
- sle.voucher_no, sle.voucher_type
- from `tabStock Ledger Entry` sle, `tabItem` i
- where sle.is_cancelled = 0 and sle.item_code=i.name and sle.actual_qty < 0 %s"""
- % conditions,
- values,
- as_dict=1,
- ):
+ for d in query.run(as_dict=True):
consumed_details.setdefault(d.item_code, []).append(d)
return consumed_details
@@ -104,24 +107,54 @@
item_supplier_map = {}
supplier = filters.get("supplier")
- for d in frappe.db.sql(
- """select pr.supplier, pri.item_code from
- `tabPurchase Receipt` pr, `tabPurchase Receipt Item` pri
- where pr.name=pri.parent and pr.docstatus=1 and
- pri.item_code=(select name from `tabItem` where
- is_stock_item=1 and name=pri.item_code)""",
- as_dict=1,
- ):
+ item = frappe.qb.DocType("Item")
+ pr = frappe.qb.DocType("Purchase Receipt")
+ pr_item = frappe.qb.DocType("Purchase Receipt Item")
+
+ query = (
+ frappe.qb.from_(pr)
+ .from_(pr_item)
+ .select(pr.supplier, pr_item.item_code)
+ .where(
+ (pr.name == pr_item.parent)
+ & (pr.docstatus == 1)
+ & (
+ pr_item.item_code
+ == (
+ frappe.qb.from_(item)
+ .select(item.name)
+ .where((item.is_stock_item == 1) & (item.name == pr_item.item_code))
+ )
+ )
+ )
+ )
+
+ for d in query.run(as_dict=True):
item_supplier_map.setdefault(d.item_code, []).append(d.supplier)
- for d in frappe.db.sql(
- """select pr.supplier, pri.item_code from
- `tabPurchase Invoice` pr, `tabPurchase Invoice Item` pri
- where pr.name=pri.parent and pr.docstatus=1 and
- ifnull(pr.update_stock, 0) = 1 and pri.item_code=(select name from `tabItem`
- where is_stock_item=1 and name=pri.item_code)""",
- as_dict=1,
- ):
+ pi = frappe.qb.DocType("Purchase Invoice")
+ pi_item = frappe.qb.DocType("Purchase Invoice Item")
+
+ query = (
+ frappe.qb.from_(pi)
+ .from_(pi_item)
+ .select(pi.supplier, pi_item.item_code)
+ .where(
+ (pi.name == pi_item.parent)
+ & (pi.docstatus == 1)
+ & (IfNull(pi.update_stock, 0) == 1)
+ & (
+ pi_item.item_code
+ == (
+ frappe.qb.from_(item)
+ .select(item.name)
+ .where((item.is_stock_item == 1) & (item.name == pi_item.item_code))
+ )
+ )
+ )
+ )
+
+ for d in query.run(as_dict=True):
if d.item_code not in item_supplier_map:
item_supplier_map.setdefault(d.item_code, []).append(d.supplier)
@@ -138,7 +171,11 @@
def get_material_transfer_vouchers():
- return frappe.db.sql_list(
- """select name from `tabStock Entry` where
- purpose='Material Transfer' and docstatus=1"""
+ se = frappe.qb.DocType("Stock Entry")
+ query = (
+ frappe.qb.from_(se)
+ .select(se.name)
+ .where((se.purpose == "Material Transfer") & (se.docstatus == 1))
)
+
+ return [r[0] for r in query.run()]
diff --git a/erpnext/stock/report/total_stock_summary/total_stock_summary.py b/erpnext/stock/report/total_stock_summary/total_stock_summary.py
index 21529da..c3155bd 100644
--- a/erpnext/stock/report/total_stock_summary/total_stock_summary.py
+++ b/erpnext/stock/report/total_stock_summary/total_stock_summary.py
@@ -4,60 +4,58 @@
import frappe
from frappe import _
+from frappe.query_builder.functions import Sum
def execute(filters=None):
if not filters:
filters = {}
- columns = get_columns()
+ columns = get_columns(filters)
stock = get_total_stock(filters)
return columns, stock
-def get_columns():
+def get_columns(filters):
columns = [
- _("Company") + ":Link/Company:250",
- _("Warehouse") + ":Link/Warehouse:150",
_("Item") + ":Link/Item:150",
_("Description") + "::300",
_("Current Qty") + ":Float:100",
]
+ if filters.get("group_by") == "Warehouse":
+ columns.insert(0, _("Warehouse") + ":Link/Warehouse:150")
+ else:
+ columns.insert(0, _("Company") + ":Link/Company:250")
+
return columns
def get_total_stock(filters):
- conditions = ""
- columns = ""
+ bin = frappe.qb.DocType("Bin")
+ item = frappe.qb.DocType("Item")
+ wh = frappe.qb.DocType("Warehouse")
+
+ query = (
+ frappe.qb.from_(bin)
+ .inner_join(item)
+ .on(bin.item_code == item.item_code)
+ .inner_join(wh)
+ .on(wh.name == bin.warehouse)
+ .where(bin.actual_qty != 0)
+ )
if filters.get("group_by") == "Warehouse":
if filters.get("company"):
- conditions += " AND warehouse.company = %s" % frappe.db.escape(
- filters.get("company"), percent=False
- )
+ query = query.where(wh.company == filters.get("company"))
- conditions += " GROUP BY ledger.warehouse, item.item_code"
- columns += "'' as company, ledger.warehouse"
+ query = query.select(bin.warehouse).groupby(bin.warehouse)
else:
- conditions += " GROUP BY warehouse.company, item.item_code"
- columns += " warehouse.company, '' as warehouse"
+ query = query.select(wh.company).groupby(wh.company)
- return frappe.db.sql(
- """
- SELECT
- %s,
- item.item_code,
- item.description,
- sum(ledger.actual_qty) as actual_qty
- FROM
- `tabBin` AS ledger
- INNER JOIN `tabItem` AS item
- ON ledger.item_code = item.item_code
- INNER JOIN `tabWarehouse` warehouse
- ON warehouse.name = ledger.warehouse
- WHERE
- ledger.actual_qty != 0 %s"""
- % (columns, conditions)
- )
+ query = query.select(
+ item.item_code, item.description, Sum(bin.actual_qty).as_("actual_qty")
+ ).groupby(item.item_code)
+
+ return query.run()
diff --git a/erpnext/stock/report/warehouse_wise_item_balance_age_and_value/warehouse_wise_item_balance_age_and_value.py b/erpnext/stock/report/warehouse_wise_item_balance_age_and_value/warehouse_wise_item_balance_age_and_value.py
index a54373f..b5c6764 100644
--- a/erpnext/stock/report/warehouse_wise_item_balance_age_and_value/warehouse_wise_item_balance_age_and_value.py
+++ b/erpnext/stock/report/warehouse_wise_item_balance_age_and_value/warehouse_wise_item_balance_age_and_value.py
@@ -7,6 +7,7 @@
import frappe
from frappe import _
+from frappe.query_builder.functions import Count
from frappe.utils import flt
from erpnext.stock.report.stock_ageing.stock_ageing import FIFOSlots, get_average_age
@@ -90,15 +91,15 @@
columns = [
_("Item") + ":Link/Item:180",
_("Item Group") + "::100",
- _("Value") + ":Currency:100",
- _("Age") + ":Float:60",
+ _("Value") + ":Currency:120",
+ _("Age") + ":Float:80",
]
return columns
def validate_filters(filters):
if not (filters.get("item_code") or filters.get("warehouse")):
- sle_count = flt(frappe.db.sql("""select count(name) from `tabStock Ledger Entry`""")[0][0])
+ sle_count = flt(frappe.qb.from_("Stock Ledger Entry").select(Count("name")).run()[0][0])
if sle_count > 500000:
frappe.throw(_("Please set filter based on Item or Warehouse"))
if not filters.get("company"):
@@ -108,30 +109,21 @@
def get_warehouse_list(filters):
from frappe.core.doctype.user_permission.user_permission import get_permitted_documents
- condition = ""
- user_permitted_warehouse = get_permitted_documents("Warehouse")
- value = ()
- if user_permitted_warehouse:
- condition = "and name in %s"
- value = set(user_permitted_warehouse)
- elif not user_permitted_warehouse and filters.get("warehouse"):
- condition = "and name = %s"
- value = filters.get("warehouse")
+ wh = frappe.qb.DocType("Warehouse")
+ query = frappe.qb.from_(wh).select(wh.name).where(wh.is_group == 0)
- return frappe.db.sql(
- """select name
- from `tabWarehouse` where is_group = 0
- {condition}""".format(
- condition=condition
- ),
- value,
- as_dict=1,
- )
+ user_permitted_warehouse = get_permitted_documents("Warehouse")
+ if user_permitted_warehouse:
+ query = query.where(wh.name.isin(set(user_permitted_warehouse)))
+ elif filters.get("warehouse"):
+ query = query.where(wh.name == filters.get("warehouse"))
+
+ return query.run(as_dict=True)
def add_warehouse_column(columns, warehouse_list):
if len(warehouse_list) > 1:
- columns += [_("Total Qty") + ":Int:50"]
+ columns += [_("Total Qty") + ":Int:90"]
for wh in warehouse_list:
- columns += [_(wh.name) + ":Int:54"]
+ columns += [_(wh.name) + ":Int:120"]
diff --git a/erpnext/stock/stock_ledger.py b/erpnext/stock/stock_ledger.py
index 5030964..cdf6e89 100644
--- a/erpnext/stock/stock_ledger.py
+++ b/erpnext/stock/stock_ledger.py
@@ -542,6 +542,14 @@
if not self.args.get("sle_id"):
self.get_dynamic_incoming_outgoing_rate(sle)
+ if (
+ sle.voucher_type in ["Purchase Receipt", "Purchase Invoice"]
+ and sle.voucher_detail_no
+ and sle.actual_qty < 0
+ and frappe.get_cached_value(sle.voucher_type, sle.voucher_no, "is_internal_supplier")
+ ):
+ sle.outgoing_rate = get_incoming_rate_for_inter_company_transfer(sle)
+
if get_serial_nos(sle.serial_no):
self.get_serialized_values(sle)
self.wh_data.qty_after_transaction += flt(sle.actual_qty)
@@ -589,6 +597,7 @@
sle.stock_queue = json.dumps(self.wh_data.stock_queue)
sle.stock_value_difference = stock_value_difference
sle.doctype = "Stock Ledger Entry"
+
frappe.get_doc(sle).db_update()
if not self.args.get("sle_id"):
@@ -652,22 +661,7 @@
and sle.voucher_detail_no
and frappe.get_cached_value(sle.voucher_type, sle.voucher_no, "is_internal_supplier")
):
- field = (
- "delivery_note_item" if sle.voucher_type == "Purchase Receipt" else "sales_invoice_item"
- )
- doctype = (
- "Delivery Note Item" if sle.voucher_type == "Purchase Receipt" else "Sales Invoice Item"
- )
- refernce_name = frappe.get_cached_value(
- sle.voucher_type + " Item", sle.voucher_detail_no, field
- )
-
- if refernce_name:
- rate = frappe.get_cached_value(
- doctype,
- refernce_name,
- "incoming_rate",
- )
+ rate = get_incoming_rate_for_inter_company_transfer(sle)
else:
if sle.voucher_type in ("Purchase Receipt", "Purchase Invoice"):
rate_field = "valuation_rate"
@@ -748,14 +742,12 @@
def update_rate_on_purchase_receipt(self, sle, outgoing_rate):
if frappe.db.exists(sle.voucher_type + " Item", sle.voucher_detail_no):
- frappe.db.set_value(
- sle.voucher_type + " Item",
- sle.voucher_detail_no,
- {
- "base_net_rate": outgoing_rate,
- "valuation_rate": outgoing_rate,
- },
- )
+ if sle.voucher_type in ["Purchase Receipt", "Purchase Invoice"] and frappe.get_cached_value(
+ sle.voucher_type, sle.voucher_no, "is_internal_supplier"
+ ):
+ frappe.db.set_value(
+ f"{sle.voucher_type} Item", sle.voucher_detail_no, "valuation_rate", sle.outgoing_rate
+ )
else:
frappe.db.set_value(
"Purchase Receipt Item Supplied", sle.voucher_detail_no, "rate", outgoing_rate
@@ -1053,7 +1045,7 @@
updated_values = {"actual_qty": data.qty_after_transaction, "stock_value": data.stock_value}
if data.valuation_rate is not None:
updated_values["valuation_rate"] = data.valuation_rate
- frappe.db.set_value("Bin", bin_name, updated_values)
+ frappe.db.set_value("Bin", bin_name, updated_values, update_modified=True)
def get_previous_sle_of_current_voucher(args, exclude_current_voucher=False):
@@ -1546,3 +1538,25 @@
if item_code and cint(frappe.db.get_value("Item", item_code, "allow_negative_stock", cache=True)):
return True
return False
+
+
+def get_incoming_rate_for_inter_company_transfer(sle) -> float:
+ """
+ For inter company transfer, incoming rate is the average of the outgoing rate
+ """
+ rate = 0.0
+
+ field = "delivery_note_item" if sle.voucher_type == "Purchase Receipt" else "sales_invoice_item"
+
+ doctype = "Delivery Note Item" if sle.voucher_type == "Purchase Receipt" else "Sales Invoice Item"
+
+ reference_name = frappe.get_cached_value(sle.voucher_type + " Item", sle.voucher_detail_no, field)
+
+ if reference_name:
+ rate = frappe.get_cached_value(
+ doctype,
+ reference_name,
+ "incoming_rate",
+ )
+
+ return rate
diff --git a/erpnext/stock/utils.py b/erpnext/stock/utils.py
index 9fb3be5..b8c5187 100644
--- a/erpnext/stock/utils.py
+++ b/erpnext/stock/utils.py
@@ -13,6 +13,8 @@
import erpnext
from erpnext.stock.valuation import FIFOValuation, LIFOValuation
+BarcodeScanResult = Dict[str, Optional[str]]
+
class InvalidWarehouseCompany(frappe.ValidationError):
pass
@@ -552,7 +554,16 @@
@frappe.whitelist()
-def scan_barcode(search_value: str) -> Dict[str, Optional[str]]:
+def scan_barcode(search_value: str) -> BarcodeScanResult:
+ def set_cache(data: BarcodeScanResult):
+ frappe.cache().set_value(f"erpnext:barcode_scan:{search_value}", data, expires_in_sec=120)
+
+ def get_cache() -> Optional[BarcodeScanResult]:
+ if data := frappe.cache().get_value(f"erpnext:barcode_scan:{search_value}"):
+ return data
+
+ if scan_data := get_cache():
+ return scan_data
# search barcode no
barcode_data = frappe.db.get_value(
@@ -562,7 +573,9 @@
as_dict=True,
)
if barcode_data:
- return _update_item_info(barcode_data)
+ _update_item_info(barcode_data)
+ set_cache(barcode_data)
+ return barcode_data
# search serial no
serial_no_data = frappe.db.get_value(
@@ -572,7 +585,9 @@
as_dict=True,
)
if serial_no_data:
- return _update_item_info(serial_no_data)
+ _update_item_info(serial_no_data)
+ set_cache(serial_no_data)
+ return serial_no_data
# search batch no
batch_no_data = frappe.db.get_value(
@@ -582,7 +597,9 @@
as_dict=True,
)
if batch_no_data:
- return _update_item_info(batch_no_data)
+ _update_item_info(batch_no_data)
+ set_cache(batch_no_data)
+ return batch_no_data
return {}
diff --git a/erpnext/subcontracting/doctype/subcontracting_receipt/subcontracting_receipt.js b/erpnext/subcontracting/doctype/subcontracting_receipt/subcontracting_receipt.js
index aff76eb..b6bef8c 100644
--- a/erpnext/subcontracting/doctype/subcontracting_receipt/subcontracting_receipt.js
+++ b/erpnext/subcontracting/doctype/subcontracting_receipt/subcontracting_receipt.js
@@ -57,6 +57,18 @@
filters: { 'company': frm.doc.company }
};
});
+
+ frappe.db.get_single_value('Buying Settings', 'backflush_raw_materials_of_subcontract_based_on').then(val => {
+ if (val == 'Material Transferred for Subcontract') {
+ frm.fields_dict['supplied_items'].grid.grid_rows.forEach((grid_row) => {
+ grid_row.docfields.forEach((df) => {
+ if (df.fieldname == 'consumed_qty') {
+ df.read_only = 0;
+ }
+ });
+ });
+ }
+ });
},
refresh: (frm) => {
diff --git a/erpnext/subcontracting/doctype/subcontracting_receipt/subcontracting_receipt.json b/erpnext/subcontracting/doctype/subcontracting_receipt/subcontracting_receipt.json
index 5cd4e63..3385eac 100644
--- a/erpnext/subcontracting/doctype/subcontracting_receipt/subcontracting_receipt.json
+++ b/erpnext/subcontracting/doctype/subcontracting_receipt/subcontracting_receipt.json
@@ -1,700 +1,701 @@
{
- "actions": [],
- "autoname": "naming_series:",
- "creation": "2022-04-18 11:20:44.226738",
- "doctype": "DocType",
- "document_type": "Document",
- "editable_grid": 1,
- "engine": "InnoDB",
- "field_order": [
- "title",
- "naming_series",
- "supplier",
- "supplier_name",
- "column_break1",
- "company",
- "posting_date",
- "posting_time",
- "set_posting_time",
- "is_return",
- "return_against",
- "accounting_dimensions_section",
- "cost_center",
- "dimension_col_break",
- "project",
- "section_addresses",
- "supplier_address",
- "contact_person",
- "address_display",
- "contact_display",
- "contact_mobile",
- "contact_email",
- "col_break_address",
- "shipping_address",
- "shipping_address_display",
- "billing_address",
- "billing_address_display",
- "sec_warehouse",
- "set_warehouse",
- "rejected_warehouse",
- "col_break_warehouse",
- "supplier_warehouse",
- "items_section",
- "items",
- "section_break0",
- "total_qty",
- "column_break_27",
- "total",
- "raw_material_details",
- "get_current_stock",
- "supplied_items",
- "additional_costs_section",
- "distribute_additional_costs_based_on",
- "additional_costs",
- "total_additional_costs",
- "section_break_46",
- "in_words",
- "bill_no",
- "bill_date",
- "more_info",
- "status",
- "column_break_39",
- "per_returned",
- "section_break_47",
- "amended_from",
- "range",
- "column_break4",
- "represents_company",
- "subscription_detail",
- "auto_repeat",
- "printing_settings",
- "letter_head",
- "language",
- "instructions",
- "column_break_97",
- "select_print_heading",
- "other_details",
- "remarks",
- "transporter_info",
- "transporter_name",
- "column_break5",
- "lr_no",
- "lr_date"
- ],
- "fields": [
- {
- "allow_on_submit": 1,
- "default": "{supplier_name}",
- "fieldname": "title",
- "fieldtype": "Data",
- "hidden": 1,
- "label": "Title",
- "no_copy": 1,
- "print_hide": 1
- },
- {
- "fieldname": "naming_series",
- "fieldtype": "Select",
- "label": "Series",
- "no_copy": 1,
- "options": "MAT-SCR-.YYYY.-\nMAT-SCR-RET-.YYYY.-",
- "print_hide": 1,
- "reqd": 1,
- "set_only_once": 1
- },
- {
- "bold": 1,
- "fieldname": "supplier",
- "fieldtype": "Link",
- "in_global_search": 1,
- "label": "Supplier",
- "options": "Supplier",
- "print_hide": 1,
- "print_width": "150px",
- "reqd": 1,
- "search_index": 1,
- "width": "150px"
- },
- {
- "bold": 1,
- "depends_on": "supplier",
- "fetch_from": "supplier.supplier_name",
- "fieldname": "supplier_name",
- "fieldtype": "Data",
- "in_global_search": 1,
- "label": "Supplier Name",
- "read_only": 1
- },
- {
- "fieldname": "column_break1",
- "fieldtype": "Column Break",
- "print_width": "50%",
- "width": "50%"
- },
- {
- "default": "Today",
- "fieldname": "posting_date",
- "fieldtype": "Date",
- "in_list_view": 1,
- "label": "Date",
- "no_copy": 1,
- "print_width": "100px",
- "read_only_depends_on": "eval: !doc.set_posting_time",
- "reqd": 1,
- "search_index": 1,
- "width": "100px"
- },
- {
- "description": "Time at which materials were received",
- "fieldname": "posting_time",
- "fieldtype": "Time",
- "label": "Posting Time",
- "no_copy": 1,
- "print_hide": 1,
- "print_width": "100px",
- "read_only_depends_on": "eval: !doc.set_posting_time",
- "reqd": 1,
- "width": "100px"
- },
- {
- "fieldname": "company",
- "fieldtype": "Link",
- "in_standard_filter": 1,
- "label": "Company",
- "options": "Company",
- "print_hide": 1,
- "print_width": "150px",
- "remember_last_selected_value": 1,
- "reqd": 1,
- "width": "150px"
- },
- {
- "collapsible": 1,
- "fieldname": "section_addresses",
- "fieldtype": "Section Break",
- "label": "Address and Contact"
- },
- {
- "fieldname": "supplier_address",
- "fieldtype": "Link",
- "label": "Select Supplier Address",
- "options": "Address",
- "print_hide": 1
- },
- {
- "fieldname": "contact_person",
- "fieldtype": "Link",
- "label": "Contact Person",
- "options": "Contact",
- "print_hide": 1
- },
- {
- "fieldname": "address_display",
- "fieldtype": "Small Text",
- "label": "Address",
- "read_only": 1
- },
- {
- "fieldname": "contact_display",
- "fieldtype": "Small Text",
- "in_global_search": 1,
- "label": "Contact",
- "read_only": 1
- },
- {
- "fieldname": "contact_mobile",
- "fieldtype": "Small Text",
- "label": "Mobile No",
- "read_only": 1
- },
- {
- "fieldname": "contact_email",
- "fieldtype": "Small Text",
- "label": "Contact Email",
- "options": "Email",
- "print_hide": 1,
- "read_only": 1
- },
- {
- "fieldname": "col_break_address",
- "fieldtype": "Column Break"
- },
- {
- "fieldname": "shipping_address",
- "fieldtype": "Link",
- "label": "Select Shipping Address",
- "options": "Address",
- "print_hide": 1
- },
- {
- "fieldname": "shipping_address_display",
- "fieldtype": "Small Text",
- "label": "Shipping Address",
- "print_hide": 1,
- "read_only": 1
- },
- {
- "fieldname": "sec_warehouse",
- "fieldtype": "Section Break"
- },
- {
- "description": "Sets 'Accepted Warehouse' in each row of the Items table.",
- "fieldname": "set_warehouse",
- "fieldtype": "Link",
- "label": "Accepted Warehouse",
- "options": "Warehouse",
- "print_hide": 1
- },
- {
- "description": "Sets 'Rejected Warehouse' in each row of the Items table.",
- "fieldname": "rejected_warehouse",
- "fieldtype": "Link",
- "label": "Rejected Warehouse",
- "no_copy": 1,
- "options": "Warehouse",
- "print_hide": 1
- },
- {
- "fieldname": "col_break_warehouse",
- "fieldtype": "Column Break"
- },
- {
- "fieldname": "supplier_warehouse",
- "fieldtype": "Link",
- "label": "Supplier Warehouse",
- "no_copy": 1,
- "options": "Warehouse",
- "print_hide": 1,
- "print_width": "50px",
- "width": "50px"
- },
- {
- "fieldname": "items_section",
- "fieldtype": "Section Break",
- "options": "fa fa-shopping-cart"
- },
- {
- "allow_bulk_edit": 1,
- "fieldname": "items",
- "fieldtype": "Table",
- "label": "Items",
- "options": "Subcontracting Receipt Item",
- "reqd": 1
- },
- {
- "depends_on": "supplied_items",
- "fieldname": "get_current_stock",
- "fieldtype": "Button",
- "label": "Get Current Stock",
- "options": "get_current_stock",
- "print_hide": 1
- },
- {
- "collapsible": 1,
- "collapsible_depends_on": "supplied_items",
- "depends_on": "supplied_items",
- "fieldname": "raw_material_details",
- "fieldtype": "Section Break",
- "label": "Raw Materials Consumed",
- "options": "fa fa-table",
- "print_hide": 1,
- "read_only": 1
- },
- {
- "fieldname": "supplied_items",
- "fieldtype": "Table",
- "label": "Consumed Items",
- "no_copy": 1,
- "options": "Subcontracting Receipt Supplied Item",
- "print_hide": 1
- },
- {
- "fieldname": "section_break0",
- "fieldtype": "Section Break"
- },
- {
- "fieldname": "total_qty",
- "fieldtype": "Float",
- "label": "Total Quantity",
- "read_only": 1
- },
- {
- "fieldname": "column_break_27",
- "fieldtype": "Column Break"
- },
- {
- "fieldname": "total",
- "fieldtype": "Currency",
- "label": "Total",
- "options": "currency",
- "read_only": 1
- },
- {
- "fieldname": "section_break_46",
- "fieldtype": "Section Break"
- },
- {
- "fieldname": "in_words",
- "fieldtype": "Data",
- "label": "In Words",
- "length": 240,
- "print_hide": 1,
- "read_only": 1
- },
- {
- "fieldname": "bill_no",
- "fieldtype": "Data",
- "hidden": 1,
- "label": "Bill No",
- "print_hide": 1
- },
- {
- "fieldname": "bill_date",
- "fieldtype": "Date",
- "hidden": 1,
- "label": "Bill Date",
- "print_hide": 1
- },
- {
- "collapsible": 1,
- "fieldname": "more_info",
- "fieldtype": "Section Break",
- "label": "More Information",
- "options": "fa fa-file-text"
- },
- {
- "default": "Draft",
- "fieldname": "status",
- "fieldtype": "Select",
- "in_standard_filter": 1,
- "label": "Status",
- "no_copy": 1,
- "options": "\nDraft\nCompleted\nReturn\nReturn Issued\nCancelled\nClosed",
- "print_hide": 1,
- "print_width": "150px",
- "read_only": 1,
- "reqd": 1,
- "search_index": 1,
- "width": "150px"
- },
- {
- "fieldname": "amended_from",
- "fieldtype": "Link",
- "hidden": 1,
- "ignore_user_permissions": 1,
- "label": "Amended From",
- "no_copy": 1,
- "options": "Subcontracting Receipt",
- "print_hide": 1,
- "print_width": "150px",
- "read_only": 1,
- "width": "150px"
- },
- {
- "fieldname": "range",
- "fieldtype": "Data",
- "hidden": 1,
- "label": "Range",
- "print_hide": 1
- },
- {
- "fieldname": "column_break4",
- "fieldtype": "Column Break",
- "print_hide": 1,
- "print_width": "50%",
- "width": "50%"
- },
- {
- "fieldname": "subscription_detail",
- "fieldtype": "Section Break",
- "label": "Auto Repeat Detail"
- },
- {
- "fieldname": "auto_repeat",
- "fieldtype": "Link",
- "label": "Auto Repeat",
- "no_copy": 1,
- "options": "Auto Repeat",
- "print_hide": 1,
- "read_only": 1
- },
- {
- "collapsible": 1,
- "fieldname": "printing_settings",
- "fieldtype": "Section Break",
- "label": "Printing Settings"
- },
- {
- "allow_on_submit": 1,
- "fieldname": "letter_head",
- "fieldtype": "Link",
- "label": "Letter Head",
- "options": "Letter Head",
- "print_hide": 1
- },
- {
- "allow_on_submit": 1,
- "fieldname": "select_print_heading",
- "fieldtype": "Link",
- "label": "Print Heading",
- "no_copy": 1,
- "options": "Print Heading",
- "print_hide": 1,
- "report_hide": 1
- },
- {
- "fieldname": "language",
- "fieldtype": "Data",
- "label": "Print Language",
- "read_only": 1
- },
- {
- "fieldname": "column_break_97",
- "fieldtype": "Column Break"
- },
- {
- "fieldname": "other_details",
- "fieldtype": "HTML",
- "hidden": 1,
- "label": "Other Details",
- "options": "<div class=\"columnHeading\">Other Details</div>",
- "print_hide": 1,
- "print_width": "30%",
- "width": "30%"
- },
- {
- "fieldname": "instructions",
- "fieldtype": "Small Text",
- "label": "Instructions"
- },
- {
- "fieldname": "remarks",
- "fieldtype": "Small Text",
- "label": "Remarks",
- "print_hide": 1
- },
- {
- "collapsible": 1,
- "collapsible_depends_on": "transporter_name",
- "fieldname": "transporter_info",
- "fieldtype": "Section Break",
- "label": "Transporter Details",
- "options": "fa fa-truck"
- },
- {
- "fieldname": "transporter_name",
- "fieldtype": "Data",
- "label": "Transporter Name"
- },
- {
- "fieldname": "column_break5",
- "fieldtype": "Column Break",
- "print_width": "50%",
- "width": "50%"
- },
- {
- "fieldname": "lr_no",
- "fieldtype": "Data",
- "label": "Vehicle Number",
- "no_copy": 1,
- "print_width": "100px",
- "width": "100px"
- },
- {
- "fieldname": "lr_date",
- "fieldtype": "Date",
- "label": "Vehicle Date",
- "no_copy": 1,
- "print_width": "100px",
- "width": "100px"
- },
- {
- "fieldname": "billing_address",
- "fieldtype": "Link",
- "label": "Select Billing Address",
- "options": "Address"
- },
- {
- "fieldname": "billing_address_display",
- "fieldtype": "Small Text",
- "label": "Billing Address",
- "read_only": 1
- },
- {
- "fetch_from": "supplier.represents_company",
- "fieldname": "represents_company",
- "fieldtype": "Link",
- "ignore_user_permissions": 1,
- "label": "Represents Company",
- "options": "Company",
- "read_only": 1
- },
- {
- "default": "0",
- "fieldname": "is_return",
- "fieldtype": "Check",
- "label": "Is Return",
- "no_copy": 1,
- "print_hide": 1,
- "read_only": 1
- },
- {
- "depends_on": "is_return",
- "fieldname": "return_against",
- "fieldtype": "Link",
- "label": "Return Against Subcontracting Receipt",
- "no_copy": 1,
- "options": "Subcontracting Receipt",
- "print_hide": 1,
- "read_only": 1
- },
- {
- "fieldname": "column_break_39",
- "fieldtype": "Column Break"
- },
- {
- "depends_on": "eval:(!doc.__islocal && doc.is_return==0)",
- "fieldname": "per_returned",
- "fieldtype": "Percent",
- "in_list_view": 1,
- "label": "% Returned",
- "no_copy": 1,
- "print_hide": 1,
- "read_only": 1
- },
- {
- "fieldname": "section_break_47",
- "fieldtype": "Section Break"
- },
- {
- "collapsible": 1,
- "fieldname": "accounting_dimensions_section",
- "fieldtype": "Section Break",
- "label": "Accounting Dimensions "
- },
- {
- "fieldname": "cost_center",
- "fieldtype": "Link",
- "label": "Cost Center",
- "options": "Cost Center"
- },
- {
- "fieldname": "dimension_col_break",
- "fieldtype": "Column Break"
- },
- {
- "fieldname": "project",
- "fieldtype": "Link",
- "label": "Project",
- "options": "Project"
- },
- {
- "collapsible": 1,
- "collapsible_depends_on": "total_additional_costs",
- "depends_on": "eval:(doc.docstatus == 0 || doc.total_additional_costs)",
- "fieldname": "additional_costs_section",
- "fieldtype": "Section Break",
- "label": "Additional Costs"
- },
- {
- "default": "Qty",
- "fieldname": "distribute_additional_costs_based_on",
- "fieldtype": "Select",
- "label": "Distribute Additional Costs Based On ",
- "options": "Qty\nAmount"
- },
- {
- "fieldname": "additional_costs",
- "fieldtype": "Table",
- "label": "Additional Costs",
- "options": "Landed Cost Taxes and Charges"
- },
- {
- "fieldname": "total_additional_costs",
- "fieldtype": "Currency",
- "label": "Total Additional Costs",
- "print_hide_if_no_value": 1,
- "read_only": 1
- },
- {
- "default": "0",
- "depends_on": "eval:doc.docstatus==0",
- "fieldname": "set_posting_time",
- "fieldtype": "Check",
- "label": "Edit Posting Date and Time",
- "print_hide": 1
- }
- ],
- "in_create": 1,
- "is_submittable": 1,
- "links": [],
- "modified": "2022-08-26 21:02:26.353870",
- "modified_by": "Administrator",
- "module": "Subcontracting",
- "name": "Subcontracting Receipt",
- "naming_rule": "By \"Naming Series\" field",
- "owner": "Administrator",
- "permissions": [
- {
- "amend": 1,
- "cancel": 1,
- "create": 1,
- "delete": 1,
- "email": 1,
- "print": 1,
- "read": 1,
- "report": 1,
- "role": "Stock Manager",
- "share": 1,
- "submit": 1,
- "write": 1
- },
- {
- "amend": 1,
- "cancel": 1,
- "create": 1,
- "delete": 1,
- "email": 1,
- "print": 1,
- "read": 1,
- "report": 1,
- "role": "Stock User",
- "share": 1,
- "submit": 1,
- "write": 1
- },
- {
- "amend": 1,
- "cancel": 1,
- "create": 1,
- "delete": 1,
- "email": 1,
- "print": 1,
- "read": 1,
- "report": 1,
- "role": "Purchase User",
- "share": 1,
- "submit": 1,
- "write": 1
- },
- {
- "read": 1,
- "report": 1,
- "role": "Accounts User"
- },
- {
- "permlevel": 1,
- "read": 1,
- "role": "Stock Manager",
- "write": 1
- }
- ],
- "search_fields": "status, posting_date, supplier",
- "show_name_in_global_search": 1,
- "sort_field": "modified",
- "sort_order": "DESC",
- "states": [],
- "timeline_field": "supplier",
- "title_field": "title",
- "track_changes": 1
+ "actions": [],
+ "autoname": "naming_series:",
+ "creation": "2022-04-18 11:20:44.226738",
+ "doctype": "DocType",
+ "document_type": "Document",
+ "editable_grid": 1,
+ "engine": "InnoDB",
+ "field_order": [
+ "title",
+ "naming_series",
+ "supplier",
+ "supplier_name",
+ "column_break1",
+ "company",
+ "posting_date",
+ "posting_time",
+ "set_posting_time",
+ "is_return",
+ "return_against",
+ "accounting_dimensions_section",
+ "cost_center",
+ "dimension_col_break",
+ "project",
+ "section_addresses",
+ "supplier_address",
+ "contact_person",
+ "address_display",
+ "contact_display",
+ "contact_mobile",
+ "contact_email",
+ "col_break_address",
+ "shipping_address",
+ "shipping_address_display",
+ "billing_address",
+ "billing_address_display",
+ "sec_warehouse",
+ "set_warehouse",
+ "rejected_warehouse",
+ "col_break_warehouse",
+ "supplier_warehouse",
+ "items_section",
+ "items",
+ "section_break0",
+ "total_qty",
+ "column_break_27",
+ "total",
+ "raw_material_details",
+ "get_current_stock",
+ "supplied_items",
+ "additional_costs_section",
+ "distribute_additional_costs_based_on",
+ "additional_costs",
+ "total_additional_costs",
+ "section_break_46",
+ "in_words",
+ "bill_no",
+ "bill_date",
+ "more_info",
+ "status",
+ "column_break_39",
+ "per_returned",
+ "section_break_47",
+ "amended_from",
+ "range",
+ "column_break4",
+ "represents_company",
+ "subscription_detail",
+ "auto_repeat",
+ "printing_settings",
+ "letter_head",
+ "language",
+ "instructions",
+ "column_break_97",
+ "select_print_heading",
+ "other_details",
+ "remarks",
+ "transporter_info",
+ "transporter_name",
+ "column_break5",
+ "lr_no",
+ "lr_date"
+ ],
+ "fields": [
+ {
+ "allow_on_submit": 1,
+ "default": "{supplier_name}",
+ "fieldname": "title",
+ "fieldtype": "Data",
+ "hidden": 1,
+ "label": "Title",
+ "no_copy": 1,
+ "print_hide": 1
+ },
+ {
+ "fieldname": "naming_series",
+ "fieldtype": "Select",
+ "label": "Series",
+ "no_copy": 1,
+ "options": "MAT-SCR-.YYYY.-\nMAT-SCR-RET-.YYYY.-",
+ "print_hide": 1,
+ "reqd": 1,
+ "set_only_once": 1
+ },
+ {
+ "bold": 1,
+ "fieldname": "supplier",
+ "fieldtype": "Link",
+ "in_global_search": 1,
+ "label": "Supplier",
+ "options": "Supplier",
+ "print_hide": 1,
+ "print_width": "150px",
+ "reqd": 1,
+ "search_index": 1,
+ "width": "150px"
+ },
+ {
+ "bold": 1,
+ "depends_on": "supplier",
+ "fetch_from": "supplier.supplier_name",
+ "fieldname": "supplier_name",
+ "fieldtype": "Data",
+ "in_global_search": 1,
+ "label": "Supplier Name",
+ "read_only": 1
+ },
+ {
+ "fieldname": "column_break1",
+ "fieldtype": "Column Break",
+ "print_width": "50%",
+ "width": "50%"
+ },
+ {
+ "default": "Today",
+ "fieldname": "posting_date",
+ "fieldtype": "Date",
+ "in_list_view": 1,
+ "label": "Date",
+ "no_copy": 1,
+ "print_width": "100px",
+ "read_only_depends_on": "eval: !doc.set_posting_time",
+ "reqd": 1,
+ "search_index": 1,
+ "width": "100px"
+ },
+ {
+ "description": "Time at which materials were received",
+ "fieldname": "posting_time",
+ "fieldtype": "Time",
+ "label": "Posting Time",
+ "no_copy": 1,
+ "print_hide": 1,
+ "print_width": "100px",
+ "read_only_depends_on": "eval: !doc.set_posting_time",
+ "reqd": 1,
+ "width": "100px"
+ },
+ {
+ "fieldname": "company",
+ "fieldtype": "Link",
+ "in_standard_filter": 1,
+ "label": "Company",
+ "options": "Company",
+ "print_hide": 1,
+ "print_width": "150px",
+ "remember_last_selected_value": 1,
+ "reqd": 1,
+ "width": "150px"
+ },
+ {
+ "collapsible": 1,
+ "fieldname": "section_addresses",
+ "fieldtype": "Section Break",
+ "label": "Address and Contact"
+ },
+ {
+ "fieldname": "supplier_address",
+ "fieldtype": "Link",
+ "label": "Select Supplier Address",
+ "options": "Address",
+ "print_hide": 1
+ },
+ {
+ "fieldname": "contact_person",
+ "fieldtype": "Link",
+ "label": "Contact Person",
+ "options": "Contact",
+ "print_hide": 1
+ },
+ {
+ "fieldname": "address_display",
+ "fieldtype": "Small Text",
+ "label": "Address",
+ "read_only": 1
+ },
+ {
+ "fieldname": "contact_display",
+ "fieldtype": "Small Text",
+ "in_global_search": 1,
+ "label": "Contact",
+ "read_only": 1
+ },
+ {
+ "fieldname": "contact_mobile",
+ "fieldtype": "Small Text",
+ "label": "Mobile No",
+ "read_only": 1
+ },
+ {
+ "fieldname": "contact_email",
+ "fieldtype": "Small Text",
+ "label": "Contact Email",
+ "options": "Email",
+ "print_hide": 1,
+ "read_only": 1
+ },
+ {
+ "fieldname": "col_break_address",
+ "fieldtype": "Column Break"
+ },
+ {
+ "fieldname": "shipping_address",
+ "fieldtype": "Link",
+ "label": "Select Shipping Address",
+ "options": "Address",
+ "print_hide": 1
+ },
+ {
+ "fieldname": "shipping_address_display",
+ "fieldtype": "Small Text",
+ "label": "Shipping Address",
+ "print_hide": 1,
+ "read_only": 1
+ },
+ {
+ "fieldname": "sec_warehouse",
+ "fieldtype": "Section Break"
+ },
+ {
+ "description": "Sets 'Accepted Warehouse' in each row of the Items table.",
+ "fieldname": "set_warehouse",
+ "fieldtype": "Link",
+ "label": "Accepted Warehouse",
+ "options": "Warehouse",
+ "print_hide": 1
+ },
+ {
+ "depends_on": "eval: !doc.is_return",
+ "description": "Sets 'Rejected Warehouse' in each row of the Items table.",
+ "fieldname": "rejected_warehouse",
+ "fieldtype": "Link",
+ "label": "Rejected Warehouse",
+ "no_copy": 1,
+ "options": "Warehouse",
+ "print_hide": 1
+ },
+ {
+ "fieldname": "col_break_warehouse",
+ "fieldtype": "Column Break"
+ },
+ {
+ "fieldname": "supplier_warehouse",
+ "fieldtype": "Link",
+ "label": "Supplier Warehouse",
+ "no_copy": 1,
+ "options": "Warehouse",
+ "print_hide": 1,
+ "print_width": "50px",
+ "width": "50px"
+ },
+ {
+ "fieldname": "items_section",
+ "fieldtype": "Section Break",
+ "options": "fa fa-shopping-cart"
+ },
+ {
+ "allow_bulk_edit": 1,
+ "fieldname": "items",
+ "fieldtype": "Table",
+ "label": "Items",
+ "options": "Subcontracting Receipt Item",
+ "reqd": 1
+ },
+ {
+ "depends_on": "supplied_items",
+ "fieldname": "get_current_stock",
+ "fieldtype": "Button",
+ "label": "Get Current Stock",
+ "options": "get_current_stock",
+ "print_hide": 1
+ },
+ {
+ "collapsible": 1,
+ "collapsible_depends_on": "supplied_items",
+ "depends_on": "supplied_items",
+ "fieldname": "raw_material_details",
+ "fieldtype": "Section Break",
+ "label": "Raw Materials Consumed",
+ "options": "fa fa-table",
+ "print_hide": 1,
+ "read_only": 1
+ },
+ {
+ "fieldname": "supplied_items",
+ "fieldtype": "Table",
+ "label": "Consumed Items",
+ "no_copy": 1,
+ "options": "Subcontracting Receipt Supplied Item",
+ "print_hide": 1
+ },
+ {
+ "fieldname": "section_break0",
+ "fieldtype": "Section Break"
+ },
+ {
+ "fieldname": "total_qty",
+ "fieldtype": "Float",
+ "label": "Total Quantity",
+ "read_only": 1
+ },
+ {
+ "fieldname": "column_break_27",
+ "fieldtype": "Column Break"
+ },
+ {
+ "fieldname": "total",
+ "fieldtype": "Currency",
+ "label": "Total",
+ "options": "currency",
+ "read_only": 1
+ },
+ {
+ "fieldname": "section_break_46",
+ "fieldtype": "Section Break"
+ },
+ {
+ "fieldname": "in_words",
+ "fieldtype": "Data",
+ "label": "In Words",
+ "length": 240,
+ "print_hide": 1,
+ "read_only": 1
+ },
+ {
+ "fieldname": "bill_no",
+ "fieldtype": "Data",
+ "hidden": 1,
+ "label": "Bill No",
+ "print_hide": 1
+ },
+ {
+ "fieldname": "bill_date",
+ "fieldtype": "Date",
+ "hidden": 1,
+ "label": "Bill Date",
+ "print_hide": 1
+ },
+ {
+ "collapsible": 1,
+ "fieldname": "more_info",
+ "fieldtype": "Section Break",
+ "label": "More Information",
+ "options": "fa fa-file-text"
+ },
+ {
+ "default": "Draft",
+ "fieldname": "status",
+ "fieldtype": "Select",
+ "in_standard_filter": 1,
+ "label": "Status",
+ "no_copy": 1,
+ "options": "\nDraft\nCompleted\nReturn\nReturn Issued\nCancelled\nClosed",
+ "print_hide": 1,
+ "print_width": "150px",
+ "read_only": 1,
+ "reqd": 1,
+ "search_index": 1,
+ "width": "150px"
+ },
+ {
+ "fieldname": "amended_from",
+ "fieldtype": "Link",
+ "hidden": 1,
+ "ignore_user_permissions": 1,
+ "label": "Amended From",
+ "no_copy": 1,
+ "options": "Subcontracting Receipt",
+ "print_hide": 1,
+ "print_width": "150px",
+ "read_only": 1,
+ "width": "150px"
+ },
+ {
+ "fieldname": "range",
+ "fieldtype": "Data",
+ "hidden": 1,
+ "label": "Range",
+ "print_hide": 1
+ },
+ {
+ "fieldname": "column_break4",
+ "fieldtype": "Column Break",
+ "print_hide": 1,
+ "print_width": "50%",
+ "width": "50%"
+ },
+ {
+ "fieldname": "subscription_detail",
+ "fieldtype": "Section Break",
+ "label": "Auto Repeat Detail"
+ },
+ {
+ "fieldname": "auto_repeat",
+ "fieldtype": "Link",
+ "label": "Auto Repeat",
+ "no_copy": 1,
+ "options": "Auto Repeat",
+ "print_hide": 1,
+ "read_only": 1
+ },
+ {
+ "collapsible": 1,
+ "fieldname": "printing_settings",
+ "fieldtype": "Section Break",
+ "label": "Printing Settings"
+ },
+ {
+ "allow_on_submit": 1,
+ "fieldname": "letter_head",
+ "fieldtype": "Link",
+ "label": "Letter Head",
+ "options": "Letter Head",
+ "print_hide": 1
+ },
+ {
+ "allow_on_submit": 1,
+ "fieldname": "select_print_heading",
+ "fieldtype": "Link",
+ "label": "Print Heading",
+ "no_copy": 1,
+ "options": "Print Heading",
+ "print_hide": 1,
+ "report_hide": 1
+ },
+ {
+ "fieldname": "language",
+ "fieldtype": "Data",
+ "label": "Print Language",
+ "read_only": 1
+ },
+ {
+ "fieldname": "column_break_97",
+ "fieldtype": "Column Break"
+ },
+ {
+ "fieldname": "other_details",
+ "fieldtype": "HTML",
+ "hidden": 1,
+ "label": "Other Details",
+ "options": "<div class=\"columnHeading\">Other Details</div>",
+ "print_hide": 1,
+ "print_width": "30%",
+ "width": "30%"
+ },
+ {
+ "fieldname": "instructions",
+ "fieldtype": "Small Text",
+ "label": "Instructions"
+ },
+ {
+ "fieldname": "remarks",
+ "fieldtype": "Small Text",
+ "label": "Remarks",
+ "print_hide": 1
+ },
+ {
+ "collapsible": 1,
+ "collapsible_depends_on": "transporter_name",
+ "fieldname": "transporter_info",
+ "fieldtype": "Section Break",
+ "label": "Transporter Details",
+ "options": "fa fa-truck"
+ },
+ {
+ "fieldname": "transporter_name",
+ "fieldtype": "Data",
+ "label": "Transporter Name"
+ },
+ {
+ "fieldname": "column_break5",
+ "fieldtype": "Column Break",
+ "print_width": "50%",
+ "width": "50%"
+ },
+ {
+ "fieldname": "lr_no",
+ "fieldtype": "Data",
+ "label": "Vehicle Number",
+ "no_copy": 1,
+ "print_width": "100px",
+ "width": "100px"
+ },
+ {
+ "fieldname": "lr_date",
+ "fieldtype": "Date",
+ "label": "Vehicle Date",
+ "no_copy": 1,
+ "print_width": "100px",
+ "width": "100px"
+ },
+ {
+ "fieldname": "billing_address",
+ "fieldtype": "Link",
+ "label": "Select Billing Address",
+ "options": "Address"
+ },
+ {
+ "fieldname": "billing_address_display",
+ "fieldtype": "Small Text",
+ "label": "Billing Address",
+ "read_only": 1
+ },
+ {
+ "fetch_from": "supplier.represents_company",
+ "fieldname": "represents_company",
+ "fieldtype": "Link",
+ "ignore_user_permissions": 1,
+ "label": "Represents Company",
+ "options": "Company",
+ "read_only": 1
+ },
+ {
+ "default": "0",
+ "fieldname": "is_return",
+ "fieldtype": "Check",
+ "label": "Is Return",
+ "no_copy": 1,
+ "print_hide": 1,
+ "read_only": 1
+ },
+ {
+ "depends_on": "is_return",
+ "fieldname": "return_against",
+ "fieldtype": "Link",
+ "label": "Return Against Subcontracting Receipt",
+ "no_copy": 1,
+ "options": "Subcontracting Receipt",
+ "print_hide": 1,
+ "read_only": 1
+ },
+ {
+ "fieldname": "column_break_39",
+ "fieldtype": "Column Break"
+ },
+ {
+ "depends_on": "eval:(!doc.__islocal && doc.is_return==0)",
+ "fieldname": "per_returned",
+ "fieldtype": "Percent",
+ "in_list_view": 1,
+ "label": "% Returned",
+ "no_copy": 1,
+ "print_hide": 1,
+ "read_only": 1
+ },
+ {
+ "fieldname": "section_break_47",
+ "fieldtype": "Section Break"
+ },
+ {
+ "collapsible": 1,
+ "fieldname": "accounting_dimensions_section",
+ "fieldtype": "Section Break",
+ "label": "Accounting Dimensions "
+ },
+ {
+ "fieldname": "cost_center",
+ "fieldtype": "Link",
+ "label": "Cost Center",
+ "options": "Cost Center"
+ },
+ {
+ "fieldname": "dimension_col_break",
+ "fieldtype": "Column Break"
+ },
+ {
+ "fieldname": "project",
+ "fieldtype": "Link",
+ "label": "Project",
+ "options": "Project"
+ },
+ {
+ "collapsible": 1,
+ "collapsible_depends_on": "total_additional_costs",
+ "depends_on": "eval:(doc.docstatus == 0 || doc.total_additional_costs)",
+ "fieldname": "additional_costs_section",
+ "fieldtype": "Section Break",
+ "label": "Additional Costs"
+ },
+ {
+ "default": "Qty",
+ "fieldname": "distribute_additional_costs_based_on",
+ "fieldtype": "Select",
+ "label": "Distribute Additional Costs Based On ",
+ "options": "Qty\nAmount"
+ },
+ {
+ "fieldname": "additional_costs",
+ "fieldtype": "Table",
+ "label": "Additional Costs",
+ "options": "Landed Cost Taxes and Charges"
+ },
+ {
+ "fieldname": "total_additional_costs",
+ "fieldtype": "Currency",
+ "label": "Total Additional Costs",
+ "print_hide_if_no_value": 1,
+ "read_only": 1
+ },
+ {
+ "default": "0",
+ "depends_on": "eval:doc.docstatus==0",
+ "fieldname": "set_posting_time",
+ "fieldtype": "Check",
+ "label": "Edit Posting Date and Time",
+ "print_hide": 1
+ }
+ ],
+ "in_create": 1,
+ "is_submittable": 1,
+ "links": [],
+ "modified": "2022-11-16 14:18:57.001239",
+ "modified_by": "Administrator",
+ "module": "Subcontracting",
+ "name": "Subcontracting Receipt",
+ "naming_rule": "By \"Naming Series\" field",
+ "owner": "Administrator",
+ "permissions": [
+ {
+ "amend": 1,
+ "cancel": 1,
+ "create": 1,
+ "delete": 1,
+ "email": 1,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "Stock Manager",
+ "share": 1,
+ "submit": 1,
+ "write": 1
+ },
+ {
+ "amend": 1,
+ "cancel": 1,
+ "create": 1,
+ "delete": 1,
+ "email": 1,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "Stock User",
+ "share": 1,
+ "submit": 1,
+ "write": 1
+ },
+ {
+ "amend": 1,
+ "cancel": 1,
+ "create": 1,
+ "delete": 1,
+ "email": 1,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "Purchase User",
+ "share": 1,
+ "submit": 1,
+ "write": 1
+ },
+ {
+ "read": 1,
+ "report": 1,
+ "role": "Accounts User"
+ },
+ {
+ "permlevel": 1,
+ "read": 1,
+ "role": "Stock Manager",
+ "write": 1
+ }
+ ],
+ "search_fields": "status, posting_date, supplier",
+ "show_name_in_global_search": 1,
+ "sort_field": "modified",
+ "sort_order": "DESC",
+ "states": [],
+ "timeline_field": "supplier",
+ "title_field": "title",
+ "track_changes": 1
}
\ No newline at end of file
diff --git a/erpnext/subcontracting/doctype/subcontracting_receipt/subcontracting_receipt.py b/erpnext/subcontracting/doctype/subcontracting_receipt/subcontracting_receipt.py
index cd05b74..bce5360 100644
--- a/erpnext/subcontracting/doctype/subcontracting_receipt/subcontracting_receipt.py
+++ b/erpnext/subcontracting/doctype/subcontracting_receipt/subcontracting_receipt.py
@@ -57,6 +57,7 @@
def before_validate(self):
super(SubcontractingReceipt, self).before_validate()
+ self.set_items_bom()
self.set_items_cost_center()
self.set_items_expense_account()
@@ -193,6 +194,24 @@
).format(item.idx)
)
+ def set_items_bom(self):
+ if self.is_return:
+ for item in self.items:
+ if not item.bom:
+ item.bom = frappe.db.get_value(
+ "Subcontracting Receipt Item",
+ {"name": item.subcontracting_receipt_item, "parent": self.return_against},
+ "bom",
+ )
+ else:
+ for item in self.items:
+ if not item.bom:
+ item.bom = frappe.db.get_value(
+ "Subcontracting Order Item",
+ {"name": item.subcontracting_order_item, "parent": item.subcontracting_order},
+ "bom",
+ )
+
def set_items_cost_center(self):
if self.company:
cost_center = frappe.get_cached_value("Company", self.company, "cost_center")
diff --git a/erpnext/subcontracting/doctype/subcontracting_receipt/subcontracting_receipt_dashboard.py b/erpnext/subcontracting/doctype/subcontracting_receipt/subcontracting_receipt_dashboard.py
index a9e5193..deb8342 100644
--- a/erpnext/subcontracting/doctype/subcontracting_receipt/subcontracting_receipt_dashboard.py
+++ b/erpnext/subcontracting/doctype/subcontracting_receipt/subcontracting_receipt_dashboard.py
@@ -4,6 +4,9 @@
def get_data():
return {
"fieldname": "subcontracting_receipt_no",
+ "non_standard_fieldnames": {
+ "Subcontracting Receipt": "return_against",
+ },
"internal_links": {
"Subcontracting Order": ["items", "subcontracting_order"],
"Project": ["items", "project"],
@@ -11,5 +14,6 @@
},
"transactions": [
{"label": _("Reference"), "items": ["Subcontracting Order", "Quality Inspection", "Project"]},
+ {"label": _("Returns"), "items": ["Subcontracting Receipt"]},
],
}
diff --git a/erpnext/subcontracting/doctype/subcontracting_receipt/test_subcontracting_receipt.py b/erpnext/subcontracting/doctype/subcontracting_receipt/test_subcontracting_receipt.py
index 090f145..72ed4d4 100644
--- a/erpnext/subcontracting/doctype/subcontracting_receipt/test_subcontracting_receipt.py
+++ b/erpnext/subcontracting/doctype/subcontracting_receipt/test_subcontracting_receipt.py
@@ -327,7 +327,7 @@
for row in scr.supplied_items:
self.assertEqual(transferred_batch.get(row.batch_no), row.consumed_qty)
- def test_subcontracting_order_partial_return(self):
+ def test_subcontracting_receipt_partial_return(self):
sco = get_subcontracting_order()
rm_items = get_rm_items(sco.supplied_items)
itemwise_details = make_stock_in_entry(rm_items=rm_items)
@@ -343,15 +343,17 @@
scr1_return = make_return_subcontracting_receipt(scr_name=scr1.name, qty=-3)
scr1.load_from_db()
self.assertEqual(scr1_return.status, "Return")
+ self.assertIsNotNone(scr1_return.items[0].bom)
self.assertEqual(scr1.items[0].returned_qty, 3)
scr2_return = make_return_subcontracting_receipt(scr_name=scr1.name, qty=-7)
scr1.load_from_db()
self.assertEqual(scr2_return.status, "Return")
+ self.assertIsNotNone(scr2_return.items[0].bom)
self.assertEqual(scr1.status, "Return Issued")
self.assertEqual(scr1.items[0].returned_qty, 10)
- def test_subcontracting_order_over_return(self):
+ def test_subcontracting_receipt_over_return(self):
sco = get_subcontracting_order()
rm_items = get_rm_items(sco.supplied_items)
itemwise_details = make_stock_in_entry(rm_items=rm_items)
@@ -402,8 +404,8 @@
"stock_value_difference",
)
- # Service Cost(100 * 10) + Raw Materials Cost(50 * 10) + Additional Costs(100) = 1600
- self.assertEqual(stock_value_difference, 1600)
+ # Service Cost(100 * 10) + Raw Materials Cost(100 * 10) + Additional Costs(10 * 10) = 2100
+ self.assertEqual(stock_value_difference, 2100)
self.assertFalse(get_gl_entries("Subcontracting Receipt", scr.name))
def test_subcontracting_receipt_gl_entry(self):
@@ -466,6 +468,66 @@
scr.cancel()
self.assertTrue(get_gl_entries("Subcontracting Receipt", scr.name))
+ def test_supplied_items_consumed_qty(self):
+ # Set Backflush Based On as "Material Transferred for Subcontracting" to transfer RM's more than the required qty
+ set_backflush_based_on("Material Transferred for Subcontract")
+
+ # Create Material Receipt for RM's
+ make_stock_entry(
+ item_code="_Test Item", qty=100, target="_Test Warehouse 1 - _TC", basic_rate=100
+ )
+ make_stock_entry(
+ item_code="_Test Item Home Desktop 100",
+ qty=100,
+ target="_Test Warehouse 1 - _TC",
+ basic_rate=100,
+ )
+
+ service_items = [
+ {
+ "warehouse": "_Test Warehouse - _TC",
+ "item_code": "Subcontracted Service Item 1",
+ "qty": 10,
+ "rate": 100,
+ "fg_item": "_Test FG Item",
+ "fg_item_qty": 10,
+ },
+ ]
+
+ # Create Subcontracting Order
+ sco = get_subcontracting_order(service_items=service_items)
+
+ # Transfer RM's
+ rm_items = get_rm_items(sco.supplied_items)
+ rm_items[0]["qty"] = 20 # Extra 10 Qty
+ itemwise_details = make_stock_in_entry(rm_items=rm_items)
+ make_stock_transfer_entry(
+ sco_no=sco.name,
+ rm_items=rm_items,
+ itemwise_details=copy.deepcopy(itemwise_details),
+ )
+
+ # Create Subcontracting Receipt
+ scr = make_subcontracting_receipt(sco.name)
+ scr.rejected_warehouse = "_Test Warehouse 1 - _TC"
+
+ scr.items[0].qty = 5 # Accepted Qty
+ scr.items[0].rejected_qty = 3
+ scr.save()
+
+ # consumed_qty should be (accepted_qty * (transfered_qty / qty)) = (5 * (20 / 10)) = 10
+ self.assertEqual(scr.supplied_items[0].consumed_qty, 10)
+
+ # Set Backflush Based On as "BOM"
+ set_backflush_based_on("BOM")
+
+ scr.items[0].qty = 6 # Accepted Qty
+ scr.items[0].rejected_qty = 4
+ scr.save()
+
+ # consumed_qty should be (accepted_qty * qty_consumed_per_unit) = (6 * 1) = 6
+ self.assertEqual(scr.supplied_items[0].consumed_qty, 6)
+
def make_return_subcontracting_receipt(**args):
args = frappe._dict(args)
diff --git a/erpnext/subcontracting/doctype/subcontracting_receipt_item/subcontracting_receipt_item.json b/erpnext/subcontracting/doctype/subcontracting_receipt_item/subcontracting_receipt_item.json
index fd86895..4b64e4b 100644
--- a/erpnext/subcontracting/doctype/subcontracting_receipt_item/subcontracting_receipt_item.json
+++ b/erpnext/subcontracting/doctype/subcontracting_receipt_item/subcontracting_receipt_item.json
@@ -1,488 +1,490 @@
{
- "actions": [],
- "autoname": "hash",
- "creation": "2022-04-13 16:05:55.395695",
- "doctype": "DocType",
- "document_type": "Document",
- "editable_grid": 1,
- "engine": "InnoDB",
- "field_order": [
- "item_code",
- "column_break_2",
- "item_name",
- "section_break_4",
- "description",
- "brand",
- "image_column",
- "image",
- "image_view",
- "received_and_accepted",
- "received_qty",
- "qty",
- "rejected_qty",
- "returned_qty",
- "col_break2",
- "stock_uom",
- "conversion_factor",
- "tracking_section",
- "col_break_tracking_section",
- "rate_and_amount",
- "rate",
- "amount",
- "recalculate_rate",
- "column_break_19",
- "rm_cost_per_qty",
- "service_cost_per_qty",
- "additional_cost_per_qty",
- "rm_supp_cost",
- "warehouse_and_reference",
- "warehouse",
- "rejected_warehouse",
- "subcontracting_order",
- "column_break_40",
- "schedule_date",
- "quality_inspection",
- "subcontracting_order_item",
- "subcontracting_receipt_item",
- "section_break_45",
- "bom",
- "serial_no",
- "col_break5",
- "batch_no",
- "rejected_serial_no",
- "manufacture_details",
- "manufacturer",
- "column_break_16",
- "manufacturer_part_no",
- "accounting_details_section",
- "expense_account",
- "accounting_dimensions_section",
- "cost_center",
- "dimension_col_break",
- "project",
- "section_break_80",
- "page_break"
- ],
- "fields": [
- {
- "bold": 1,
- "columns": 3,
- "fieldname": "item_code",
- "fieldtype": "Link",
- "in_global_search": 1,
- "in_list_view": 1,
- "label": "Item Code",
- "options": "Item",
- "print_width": "100px",
- "reqd": 1,
- "search_index": 1,
- "width": "100px"
- },
- {
- "fieldname": "column_break_2",
- "fieldtype": "Column Break"
- },
- {
- "fieldname": "item_name",
- "fieldtype": "Data",
- "in_global_search": 1,
- "label": "Item Name",
- "print_hide": 1,
- "reqd": 1
- },
- {
- "collapsible": 1,
- "fieldname": "section_break_4",
- "fieldtype": "Section Break",
- "label": "Description"
- },
- {
- "fieldname": "description",
- "fieldtype": "Text Editor",
- "label": "Description",
- "print_width": "300px",
- "reqd": 1,
- "width": "300px"
- },
- {
- "fieldname": "image",
- "fieldtype": "Attach",
- "hidden": 1,
- "label": "Image"
- },
- {
- "fieldname": "image_view",
- "fieldtype": "Image",
- "label": "Image View",
- "options": "image",
- "print_hide": 1
- },
- {
- "fieldname": "received_and_accepted",
- "fieldtype": "Section Break",
- "label": "Received and Accepted"
- },
- {
- "bold": 1,
- "default": "0",
- "fieldname": "received_qty",
- "fieldtype": "Float",
- "label": "Received Quantity",
- "no_copy": 1,
- "print_hide": 1,
- "print_width": "100px",
- "read_only": 1,
- "reqd": 1,
- "width": "100px"
- },
- {
- "columns": 2,
- "fieldname": "qty",
- "fieldtype": "Float",
- "in_list_view": 1,
- "label": "Accepted Quantity",
- "no_copy": 1,
- "print_width": "100px",
- "width": "100px"
- },
- {
- "columns": 1,
- "fieldname": "rejected_qty",
- "fieldtype": "Float",
- "in_list_view": 1,
- "label": "Rejected Quantity",
- "no_copy": 1,
- "print_hide": 1,
- "print_width": "100px",
- "width": "100px"
- },
- {
- "fieldname": "col_break2",
- "fieldtype": "Column Break",
- "print_hide": 1
- },
- {
- "fieldname": "stock_uom",
- "fieldtype": "Link",
- "label": "Stock UOM",
- "options": "UOM",
- "print_hide": 1,
- "print_width": "100px",
- "read_only": 1,
- "reqd": 1,
- "width": "100px"
- },
- {
- "default": "1",
- "fieldname": "conversion_factor",
- "fieldtype": "Float",
- "hidden": 1,
- "label": "Conversion Factor",
- "read_only": 1
- },
- {
- "fieldname": "rate_and_amount",
- "fieldtype": "Section Break",
- "label": "Rate and Amount"
- },
- {
- "bold": 1,
- "columns": 2,
- "fieldname": "rate",
- "fieldtype": "Currency",
- "in_list_view": 1,
- "label": "Rate",
- "options": "currency",
- "print_width": "100px",
- "read_only": 1,
- "read_only_depends_on": "eval: doc.recalculate_rate",
- "width": "100px"
- },
- {
- "fieldname": "amount",
- "fieldtype": "Currency",
- "in_list_view": 1,
- "label": "Amount",
- "options": "currency",
- "read_only": 1
- },
- {
- "fieldname": "column_break_19",
- "fieldtype": "Column Break"
- },
- {
- "fieldname": "rm_cost_per_qty",
- "fieldtype": "Currency",
- "label": "Raw Material Cost Per Qty",
- "no_copy": 1,
- "read_only": 1
- },
- {
- "fieldname": "service_cost_per_qty",
- "fieldtype": "Currency",
- "label": "Service Cost Per Qty",
- "read_only": 1,
- "reqd": 1
- },
- {
- "default": "0",
- "fieldname": "additional_cost_per_qty",
- "fieldtype": "Currency",
- "label": "Additional Cost Per Qty",
- "read_only": 1
- },
- {
- "fieldname": "warehouse_and_reference",
- "fieldtype": "Section Break",
- "label": "Warehouse and Reference"
- },
- {
- "bold": 1,
- "fieldname": "warehouse",
- "fieldtype": "Link",
- "in_list_view": 1,
- "label": "Accepted Warehouse",
- "options": "Warehouse",
- "print_hide": 1,
- "print_width": "100px",
- "width": "100px"
- },
- {
- "fieldname": "rejected_warehouse",
- "fieldtype": "Link",
- "label": "Rejected Warehouse",
- "no_copy": 1,
- "options": "Warehouse",
- "print_hide": 1,
- "print_width": "100px",
- "width": "100px"
- },
- {
- "depends_on": "eval:!doc.__islocal",
- "fieldname": "quality_inspection",
- "fieldtype": "Link",
- "label": "Quality Inspection",
- "no_copy": 1,
- "options": "Quality Inspection",
- "print_hide": 1
- },
- {
- "fieldname": "column_break_40",
- "fieldtype": "Column Break"
- },
- {
- "fieldname": "subcontracting_order",
- "fieldtype": "Link",
- "label": "Subcontracting Order",
- "no_copy": 1,
- "options": "Subcontracting Order",
- "print_width": "150px",
- "read_only": 1,
- "search_index": 1,
- "width": "150px"
- },
- {
- "fieldname": "schedule_date",
- "fieldtype": "Date",
- "label": "Required By",
- "print_hide": 1,
- "read_only": 1
- },
- {
- "fieldname": "section_break_45",
- "fieldtype": "Section Break"
- },
- {
- "depends_on": "eval:!doc.is_fixed_asset",
- "fieldname": "serial_no",
- "fieldtype": "Small Text",
- "in_list_view": 1,
- "label": "Serial No",
- "no_copy": 1
- },
- {
- "depends_on": "eval:!doc.is_fixed_asset",
- "fieldname": "batch_no",
- "fieldtype": "Link",
- "in_list_view": 1,
- "label": "Batch No",
- "no_copy": 1,
- "options": "Batch",
- "print_hide": 1
- },
- {
- "depends_on": "eval:!doc.is_fixed_asset",
- "fieldname": "rejected_serial_no",
- "fieldtype": "Small Text",
- "label": "Rejected Serial No",
- "no_copy": 1,
- "print_hide": 1
- },
- {
- "fieldname": "subcontracting_order_item",
- "fieldtype": "Data",
- "hidden": 1,
- "label": "Subcontracting Order Item",
- "no_copy": 1,
- "print_hide": 1,
- "print_width": "150px",
- "read_only": 1,
- "search_index": 1,
- "width": "150px"
- },
- {
- "fieldname": "col_break5",
- "fieldtype": "Column Break"
- },
- {
- "fieldname": "bom",
- "fieldtype": "Link",
- "label": "BOM",
- "no_copy": 1,
- "options": "BOM",
- "print_hide": 1
- },
- {
- "fetch_from": "item_code.brand",
- "fieldname": "brand",
- "fieldtype": "Link",
- "hidden": 1,
- "label": "Brand",
- "options": "Brand",
- "print_hide": 1,
- "read_only": 1
- },
- {
- "fieldname": "rm_supp_cost",
- "fieldtype": "Currency",
- "hidden": 1,
- "label": "Raw Materials Supplied Cost",
- "no_copy": 1,
- "options": "Company:company:default_currency",
- "print_hide": 1,
- "print_width": "150px",
- "read_only": 1,
- "width": "150px"
- },
- {
- "fieldname": "expense_account",
- "fieldtype": "Link",
- "label": "Expense Account",
- "options": "Account"
- },
- {
- "collapsible": 1,
- "fieldname": "manufacture_details",
- "fieldtype": "Section Break",
- "label": "Manufacture"
- },
- {
- "fieldname": "manufacturer",
- "fieldtype": "Link",
- "label": "Manufacturer",
- "options": "Manufacturer"
- },
- {
- "fieldname": "column_break_16",
- "fieldtype": "Column Break"
- },
- {
- "fieldname": "manufacturer_part_no",
- "fieldtype": "Data",
- "label": "Manufacturer Part Number"
- },
- {
- "fieldname": "subcontracting_receipt_item",
- "fieldtype": "Data",
- "hidden": 1,
- "label": "Subcontracting Receipt Item",
- "no_copy": 1,
- "print_hide": 1,
- "read_only": 1
- },
- {
- "collapsible": 1,
- "fieldname": "image_column",
- "fieldtype": "Column Break"
- },
- {
- "fieldname": "tracking_section",
- "fieldtype": "Section Break"
- },
- {
- "fieldname": "col_break_tracking_section",
- "fieldtype": "Column Break"
- },
- {
- "fieldname": "accounting_dimensions_section",
- "fieldtype": "Section Break",
- "label": "Accounting Dimensions"
- },
- {
- "fieldname": "project",
- "fieldtype": "Link",
- "label": "Project",
- "options": "Project",
- "print_hide": 1
- },
- {
- "fieldname": "dimension_col_break",
- "fieldtype": "Column Break"
- },
- {
- "default": ":Company",
- "depends_on": "eval:cint(erpnext.is_perpetual_inventory_enabled(parent.company))",
- "fieldname": "cost_center",
- "fieldtype": "Link",
- "label": "Cost Center",
- "options": "Cost Center",
- "print_hide": 1
- },
- {
- "fieldname": "section_break_80",
- "fieldtype": "Section Break"
- },
- {
- "allow_on_submit": 1,
- "default": "0",
- "fieldname": "page_break",
- "fieldtype": "Check",
- "label": "Page Break",
- "print_hide": 1
- },
- {
- "depends_on": "returned_qty",
- "fieldname": "returned_qty",
- "fieldtype": "Float",
- "label": "Returned Qty",
- "no_copy": 1,
- "print_hide": 1,
- "read_only": 1
- },
- {
- "fieldname": "accounting_details_section",
- "fieldtype": "Section Break",
- "label": "Accounting Details"
- },
- {
- "default": "1",
- "fieldname": "recalculate_rate",
- "fieldtype": "Check",
- "label": "Recalculate Rate"
- }
- ],
- "idx": 1,
- "istable": 1,
- "links": [],
- "modified": "2022-08-20 17:16:48.269164",
- "modified_by": "Administrator",
- "module": "Subcontracting",
- "name": "Subcontracting Receipt Item",
- "naming_rule": "Random",
- "owner": "Administrator",
- "permissions": [],
- "quick_entry": 1,
- "sort_field": "modified",
- "sort_order": "DESC",
- "states": []
+ "actions": [],
+ "autoname": "hash",
+ "creation": "2022-04-13 16:05:55.395695",
+ "doctype": "DocType",
+ "document_type": "Document",
+ "editable_grid": 1,
+ "engine": "InnoDB",
+ "field_order": [
+ "item_code",
+ "column_break_2",
+ "item_name",
+ "section_break_4",
+ "description",
+ "brand",
+ "image_column",
+ "image",
+ "image_view",
+ "received_and_accepted",
+ "received_qty",
+ "qty",
+ "rejected_qty",
+ "returned_qty",
+ "col_break2",
+ "stock_uom",
+ "conversion_factor",
+ "tracking_section",
+ "col_break_tracking_section",
+ "rate_and_amount",
+ "rate",
+ "amount",
+ "recalculate_rate",
+ "column_break_19",
+ "rm_cost_per_qty",
+ "service_cost_per_qty",
+ "additional_cost_per_qty",
+ "rm_supp_cost",
+ "warehouse_and_reference",
+ "warehouse",
+ "rejected_warehouse",
+ "subcontracting_order",
+ "column_break_40",
+ "schedule_date",
+ "quality_inspection",
+ "subcontracting_order_item",
+ "subcontracting_receipt_item",
+ "section_break_45",
+ "bom",
+ "serial_no",
+ "col_break5",
+ "batch_no",
+ "rejected_serial_no",
+ "manufacture_details",
+ "manufacturer",
+ "column_break_16",
+ "manufacturer_part_no",
+ "accounting_details_section",
+ "expense_account",
+ "accounting_dimensions_section",
+ "cost_center",
+ "dimension_col_break",
+ "project",
+ "section_break_80",
+ "page_break"
+ ],
+ "fields": [
+ {
+ "bold": 1,
+ "columns": 3,
+ "fieldname": "item_code",
+ "fieldtype": "Link",
+ "in_global_search": 1,
+ "in_list_view": 1,
+ "label": "Item Code",
+ "options": "Item",
+ "print_width": "100px",
+ "reqd": 1,
+ "search_index": 1,
+ "width": "100px"
+ },
+ {
+ "fieldname": "column_break_2",
+ "fieldtype": "Column Break"
+ },
+ {
+ "fieldname": "item_name",
+ "fieldtype": "Data",
+ "in_global_search": 1,
+ "label": "Item Name",
+ "print_hide": 1,
+ "reqd": 1
+ },
+ {
+ "collapsible": 1,
+ "fieldname": "section_break_4",
+ "fieldtype": "Section Break",
+ "label": "Description"
+ },
+ {
+ "fieldname": "description",
+ "fieldtype": "Text Editor",
+ "label": "Description",
+ "print_width": "300px",
+ "reqd": 1,
+ "width": "300px"
+ },
+ {
+ "fieldname": "image",
+ "fieldtype": "Attach",
+ "hidden": 1,
+ "label": "Image"
+ },
+ {
+ "fieldname": "image_view",
+ "fieldtype": "Image",
+ "label": "Image View",
+ "options": "image",
+ "print_hide": 1
+ },
+ {
+ "fieldname": "received_and_accepted",
+ "fieldtype": "Section Break",
+ "label": "Received and Accepted"
+ },
+ {
+ "bold": 1,
+ "default": "0",
+ "fieldname": "received_qty",
+ "fieldtype": "Float",
+ "label": "Received Quantity",
+ "no_copy": 1,
+ "print_hide": 1,
+ "print_width": "100px",
+ "read_only": 1,
+ "reqd": 1,
+ "width": "100px"
+ },
+ {
+ "columns": 2,
+ "fieldname": "qty",
+ "fieldtype": "Float",
+ "in_list_view": 1,
+ "label": "Accepted Quantity",
+ "no_copy": 1,
+ "print_width": "100px",
+ "width": "100px"
+ },
+ {
+ "columns": 1,
+ "depends_on": "eval: !parent.is_return",
+ "fieldname": "rejected_qty",
+ "fieldtype": "Float",
+ "in_list_view": 1,
+ "label": "Rejected Quantity",
+ "no_copy": 1,
+ "print_hide": 1,
+ "print_width": "100px",
+ "width": "100px"
+ },
+ {
+ "fieldname": "col_break2",
+ "fieldtype": "Column Break",
+ "print_hide": 1
+ },
+ {
+ "fieldname": "stock_uom",
+ "fieldtype": "Link",
+ "label": "Stock UOM",
+ "options": "UOM",
+ "print_hide": 1,
+ "print_width": "100px",
+ "read_only": 1,
+ "reqd": 1,
+ "width": "100px"
+ },
+ {
+ "default": "1",
+ "fieldname": "conversion_factor",
+ "fieldtype": "Float",
+ "hidden": 1,
+ "label": "Conversion Factor",
+ "read_only": 1
+ },
+ {
+ "fieldname": "rate_and_amount",
+ "fieldtype": "Section Break",
+ "label": "Rate and Amount"
+ },
+ {
+ "bold": 1,
+ "columns": 2,
+ "fieldname": "rate",
+ "fieldtype": "Currency",
+ "in_list_view": 1,
+ "label": "Rate",
+ "options": "currency",
+ "print_width": "100px",
+ "read_only": 1,
+ "read_only_depends_on": "eval: doc.recalculate_rate",
+ "width": "100px"
+ },
+ {
+ "fieldname": "amount",
+ "fieldtype": "Currency",
+ "in_list_view": 1,
+ "label": "Amount",
+ "options": "currency",
+ "read_only": 1
+ },
+ {
+ "fieldname": "column_break_19",
+ "fieldtype": "Column Break"
+ },
+ {
+ "fieldname": "rm_cost_per_qty",
+ "fieldtype": "Currency",
+ "label": "Raw Material Cost Per Qty",
+ "no_copy": 1,
+ "read_only": 1
+ },
+ {
+ "fieldname": "service_cost_per_qty",
+ "fieldtype": "Currency",
+ "label": "Service Cost Per Qty",
+ "read_only": 1,
+ "reqd": 1
+ },
+ {
+ "default": "0",
+ "fieldname": "additional_cost_per_qty",
+ "fieldtype": "Currency",
+ "label": "Additional Cost Per Qty",
+ "read_only": 1
+ },
+ {
+ "fieldname": "warehouse_and_reference",
+ "fieldtype": "Section Break",
+ "label": "Warehouse and Reference"
+ },
+ {
+ "bold": 1,
+ "fieldname": "warehouse",
+ "fieldtype": "Link",
+ "in_list_view": 1,
+ "label": "Accepted Warehouse",
+ "options": "Warehouse",
+ "print_hide": 1,
+ "print_width": "100px",
+ "width": "100px"
+ },
+ {
+ "depends_on": "eval: !parent.is_return",
+ "fieldname": "rejected_warehouse",
+ "fieldtype": "Link",
+ "label": "Rejected Warehouse",
+ "no_copy": 1,
+ "options": "Warehouse",
+ "print_hide": 1,
+ "print_width": "100px",
+ "width": "100px"
+ },
+ {
+ "depends_on": "eval:!doc.__islocal",
+ "fieldname": "quality_inspection",
+ "fieldtype": "Link",
+ "label": "Quality Inspection",
+ "no_copy": 1,
+ "options": "Quality Inspection",
+ "print_hide": 1
+ },
+ {
+ "fieldname": "column_break_40",
+ "fieldtype": "Column Break"
+ },
+ {
+ "fieldname": "subcontracting_order",
+ "fieldtype": "Link",
+ "label": "Subcontracting Order",
+ "no_copy": 1,
+ "options": "Subcontracting Order",
+ "print_width": "150px",
+ "read_only": 1,
+ "search_index": 1,
+ "width": "150px"
+ },
+ {
+ "fieldname": "schedule_date",
+ "fieldtype": "Date",
+ "label": "Required By",
+ "print_hide": 1,
+ "read_only": 1
+ },
+ {
+ "fieldname": "section_break_45",
+ "fieldtype": "Section Break"
+ },
+ {
+ "depends_on": "eval:!doc.is_fixed_asset",
+ "fieldname": "serial_no",
+ "fieldtype": "Small Text",
+ "in_list_view": 1,
+ "label": "Serial No",
+ "no_copy": 1
+ },
+ {
+ "depends_on": "eval:!doc.is_fixed_asset",
+ "fieldname": "batch_no",
+ "fieldtype": "Link",
+ "in_list_view": 1,
+ "label": "Batch No",
+ "no_copy": 1,
+ "options": "Batch",
+ "print_hide": 1
+ },
+ {
+ "depends_on": "eval: !parent.is_return",
+ "fieldname": "rejected_serial_no",
+ "fieldtype": "Small Text",
+ "label": "Rejected Serial No",
+ "no_copy": 1,
+ "print_hide": 1
+ },
+ {
+ "fieldname": "subcontracting_order_item",
+ "fieldtype": "Data",
+ "hidden": 1,
+ "label": "Subcontracting Order Item",
+ "no_copy": 1,
+ "print_hide": 1,
+ "print_width": "150px",
+ "read_only": 1,
+ "search_index": 1,
+ "width": "150px"
+ },
+ {
+ "fieldname": "col_break5",
+ "fieldtype": "Column Break"
+ },
+ {
+ "fieldname": "bom",
+ "fieldtype": "Link",
+ "label": "BOM",
+ "no_copy": 1,
+ "options": "BOM",
+ "print_hide": 1
+ },
+ {
+ "fetch_from": "item_code.brand",
+ "fieldname": "brand",
+ "fieldtype": "Link",
+ "hidden": 1,
+ "label": "Brand",
+ "options": "Brand",
+ "print_hide": 1,
+ "read_only": 1
+ },
+ {
+ "fieldname": "rm_supp_cost",
+ "fieldtype": "Currency",
+ "hidden": 1,
+ "label": "Raw Materials Supplied Cost",
+ "no_copy": 1,
+ "options": "Company:company:default_currency",
+ "print_hide": 1,
+ "print_width": "150px",
+ "read_only": 1,
+ "width": "150px"
+ },
+ {
+ "fieldname": "expense_account",
+ "fieldtype": "Link",
+ "label": "Expense Account",
+ "options": "Account"
+ },
+ {
+ "collapsible": 1,
+ "fieldname": "manufacture_details",
+ "fieldtype": "Section Break",
+ "label": "Manufacture"
+ },
+ {
+ "fieldname": "manufacturer",
+ "fieldtype": "Link",
+ "label": "Manufacturer",
+ "options": "Manufacturer"
+ },
+ {
+ "fieldname": "column_break_16",
+ "fieldtype": "Column Break"
+ },
+ {
+ "fieldname": "manufacturer_part_no",
+ "fieldtype": "Data",
+ "label": "Manufacturer Part Number"
+ },
+ {
+ "fieldname": "subcontracting_receipt_item",
+ "fieldtype": "Data",
+ "hidden": 1,
+ "label": "Subcontracting Receipt Item",
+ "no_copy": 1,
+ "print_hide": 1,
+ "read_only": 1
+ },
+ {
+ "collapsible": 1,
+ "fieldname": "image_column",
+ "fieldtype": "Column Break"
+ },
+ {
+ "fieldname": "tracking_section",
+ "fieldtype": "Section Break"
+ },
+ {
+ "fieldname": "col_break_tracking_section",
+ "fieldtype": "Column Break"
+ },
+ {
+ "fieldname": "accounting_dimensions_section",
+ "fieldtype": "Section Break",
+ "label": "Accounting Dimensions"
+ },
+ {
+ "fieldname": "project",
+ "fieldtype": "Link",
+ "label": "Project",
+ "options": "Project",
+ "print_hide": 1
+ },
+ {
+ "fieldname": "dimension_col_break",
+ "fieldtype": "Column Break"
+ },
+ {
+ "default": ":Company",
+ "depends_on": "eval:cint(erpnext.is_perpetual_inventory_enabled(parent.company))",
+ "fieldname": "cost_center",
+ "fieldtype": "Link",
+ "label": "Cost Center",
+ "options": "Cost Center",
+ "print_hide": 1
+ },
+ {
+ "fieldname": "section_break_80",
+ "fieldtype": "Section Break"
+ },
+ {
+ "allow_on_submit": 1,
+ "default": "0",
+ "fieldname": "page_break",
+ "fieldtype": "Check",
+ "label": "Page Break",
+ "print_hide": 1
+ },
+ {
+ "depends_on": "returned_qty",
+ "fieldname": "returned_qty",
+ "fieldtype": "Float",
+ "label": "Returned Qty",
+ "no_copy": 1,
+ "print_hide": 1,
+ "read_only": 1
+ },
+ {
+ "fieldname": "accounting_details_section",
+ "fieldtype": "Section Break",
+ "label": "Accounting Details"
+ },
+ {
+ "default": "1",
+ "fieldname": "recalculate_rate",
+ "fieldtype": "Check",
+ "label": "Recalculate Rate"
+ }
+ ],
+ "idx": 1,
+ "istable": 1,
+ "links": [],
+ "modified": "2022-11-16 14:21:26.125815",
+ "modified_by": "Administrator",
+ "module": "Subcontracting",
+ "name": "Subcontracting Receipt Item",
+ "naming_rule": "Random",
+ "owner": "Administrator",
+ "permissions": [],
+ "quick_entry": 1,
+ "sort_field": "modified",
+ "sort_order": "DESC",
+ "states": []
}
\ No newline at end of file
diff --git a/erpnext/subcontracting/doctype/subcontracting_receipt_supplied_item/subcontracting_receipt_supplied_item.json b/erpnext/subcontracting/doctype/subcontracting_receipt_supplied_item/subcontracting_receipt_supplied_item.json
index ddbb806..d21bc22 100644
--- a/erpnext/subcontracting/doctype/subcontracting_receipt_supplied_item/subcontracting_receipt_supplied_item.json
+++ b/erpnext/subcontracting/doctype/subcontracting_receipt_supplied_item/subcontracting_receipt_supplied_item.json
@@ -1,207 +1,208 @@
{
- "actions": [],
- "creation": "2022-04-18 10:45:16.538479",
- "doctype": "DocType",
- "editable_grid": 1,
- "engine": "InnoDB",
- "field_order": [
- "main_item_code",
- "rm_item_code",
- "item_name",
- "bom_detail_no",
- "col_break1",
- "description",
- "stock_uom",
- "conversion_factor",
- "reference_name",
- "secbreak_1",
- "rate",
- "col_break2",
- "amount",
- "secbreak_2",
- "available_qty_for_consumption",
- "required_qty",
- "col_break3",
- "consumed_qty",
- "current_stock",
- "secbreak_3",
- "batch_no",
- "col_break4",
- "serial_no",
- "subcontracting_order"
- ],
- "fields": [
- {
- "fieldname": "main_item_code",
- "fieldtype": "Link",
- "in_list_view": 1,
- "label": "Item Code",
- "options": "Item",
- "read_only": 1
- },
- {
- "fieldname": "rm_item_code",
- "fieldtype": "Link",
- "in_list_view": 1,
- "label": "Raw Material Item Code",
- "options": "Item",
- "read_only": 1
- },
- {
- "fieldname": "description",
- "fieldtype": "Text Editor",
- "in_global_search": 1,
- "label": "Description",
- "print_width": "300px",
- "read_only": 1,
- "width": "300px"
- },
- {
- "fieldname": "batch_no",
- "fieldtype": "Link",
- "label": "Batch No",
- "no_copy": 1,
- "options": "Batch"
- },
- {
- "fieldname": "serial_no",
- "fieldtype": "Text",
- "label": "Serial No",
- "no_copy": 1
- },
- {
- "fieldname": "col_break1",
- "fieldtype": "Column Break"
- },
- {
- "fieldname": "required_qty",
- "fieldtype": "Float",
- "label": "Required Qty",
- "print_hide": 1,
- "read_only": 1
- },
- {
- "columns": 2,
- "fieldname": "consumed_qty",
- "fieldtype": "Float",
- "in_list_view": 1,
- "label": "Consumed Qty",
- "reqd": 1
- },
- {
- "fieldname": "stock_uom",
- "fieldtype": "Link",
- "label": "Stock Uom",
- "options": "UOM",
- "read_only": 1
- },
- {
- "fieldname": "rate",
- "fieldtype": "Currency",
- "label": "Rate",
- "options": "Company:company:default_currency",
- "read_only": 1
- },
- {
- "fieldname": "amount",
- "fieldtype": "Currency",
- "label": "Amount",
- "options": "Company:company:default_currency",
- "read_only": 1
- },
- {
- "default": "1",
- "fieldname": "conversion_factor",
- "fieldtype": "Float",
- "hidden": 1,
- "label": "Conversion Factor",
- "read_only": 1
- },
- {
- "fieldname": "current_stock",
- "fieldtype": "Float",
- "in_list_view": 1,
- "label": "Current Stock",
- "read_only": 1
- },
- {
- "fieldname": "reference_name",
- "fieldtype": "Data",
- "hidden": 1,
- "in_list_view": 1,
- "label": "Reference Name",
- "read_only": 1
- },
- {
- "fieldname": "bom_detail_no",
- "fieldtype": "Data",
- "hidden": 1,
- "in_list_view": 1,
- "label": "BOM Detail No",
- "read_only": 1
- },
- {
- "fieldname": "secbreak_1",
- "fieldtype": "Section Break"
- },
- {
- "fieldname": "col_break2",
- "fieldtype": "Column Break"
- },
- {
- "fieldname": "secbreak_2",
- "fieldtype": "Section Break"
- },
- {
- "fieldname": "col_break3",
- "fieldtype": "Column Break"
- },
- {
- "fieldname": "secbreak_3",
- "fieldtype": "Section Break"
- },
- {
- "fieldname": "col_break4",
- "fieldtype": "Column Break"
- },
- {
- "fieldname": "item_name",
- "fieldtype": "Data",
- "label": "Item Name",
- "read_only": 1
- },
- {
- "fieldname": "subcontracting_order",
- "fieldtype": "Link",
- "hidden": 1,
- "label": "Subcontracting Order",
- "no_copy": 1,
- "options": "Subcontracting Order",
- "print_hide": 1,
- "read_only": 1
- },
- {
- "default": "0",
- "fieldname": "available_qty_for_consumption",
- "fieldtype": "Float",
- "in_list_view": 1,
- "label": "Available Qty For Consumption",
- "print_hide": 1,
- "read_only": 1
- }
- ],
- "idx": 1,
- "istable": 1,
- "links": [],
- "modified": "2022-09-02 22:28:53.392381",
- "modified_by": "Administrator",
- "module": "Subcontracting",
- "name": "Subcontracting Receipt Supplied Item",
- "naming_rule": "Autoincrement",
- "owner": "Administrator",
- "permissions": [],
- "sort_field": "modified",
- "sort_order": "DESC",
- "states": [],
- "track_changes": 1
+ "actions": [],
+ "creation": "2022-04-18 10:45:16.538479",
+ "doctype": "DocType",
+ "editable_grid": 1,
+ "engine": "InnoDB",
+ "field_order": [
+ "main_item_code",
+ "rm_item_code",
+ "item_name",
+ "bom_detail_no",
+ "col_break1",
+ "description",
+ "stock_uom",
+ "conversion_factor",
+ "reference_name",
+ "secbreak_1",
+ "rate",
+ "col_break2",
+ "amount",
+ "secbreak_2",
+ "available_qty_for_consumption",
+ "required_qty",
+ "col_break3",
+ "consumed_qty",
+ "current_stock",
+ "secbreak_3",
+ "batch_no",
+ "col_break4",
+ "serial_no",
+ "subcontracting_order"
+ ],
+ "fields": [
+ {
+ "fieldname": "main_item_code",
+ "fieldtype": "Link",
+ "in_list_view": 1,
+ "label": "Item Code",
+ "options": "Item",
+ "read_only": 1
+ },
+ {
+ "fieldname": "rm_item_code",
+ "fieldtype": "Link",
+ "in_list_view": 1,
+ "label": "Raw Material Item Code",
+ "options": "Item",
+ "read_only": 1
+ },
+ {
+ "fieldname": "description",
+ "fieldtype": "Text Editor",
+ "in_global_search": 1,
+ "label": "Description",
+ "print_width": "300px",
+ "read_only": 1,
+ "width": "300px"
+ },
+ {
+ "fieldname": "batch_no",
+ "fieldtype": "Link",
+ "label": "Batch No",
+ "no_copy": 1,
+ "options": "Batch"
+ },
+ {
+ "fieldname": "serial_no",
+ "fieldtype": "Text",
+ "label": "Serial No",
+ "no_copy": 1
+ },
+ {
+ "fieldname": "col_break1",
+ "fieldtype": "Column Break"
+ },
+ {
+ "fieldname": "required_qty",
+ "fieldtype": "Float",
+ "label": "Required Qty",
+ "print_hide": 1,
+ "read_only": 1
+ },
+ {
+ "columns": 2,
+ "fieldname": "consumed_qty",
+ "fieldtype": "Float",
+ "in_list_view": 1,
+ "label": "Consumed Qty",
+ "read_only": 1,
+ "reqd": 1
+ },
+ {
+ "fieldname": "stock_uom",
+ "fieldtype": "Link",
+ "label": "Stock Uom",
+ "options": "UOM",
+ "read_only": 1
+ },
+ {
+ "fieldname": "rate",
+ "fieldtype": "Currency",
+ "label": "Rate",
+ "options": "Company:company:default_currency",
+ "read_only": 1
+ },
+ {
+ "fieldname": "amount",
+ "fieldtype": "Currency",
+ "label": "Amount",
+ "options": "Company:company:default_currency",
+ "read_only": 1
+ },
+ {
+ "default": "1",
+ "fieldname": "conversion_factor",
+ "fieldtype": "Float",
+ "hidden": 1,
+ "label": "Conversion Factor",
+ "read_only": 1
+ },
+ {
+ "fieldname": "current_stock",
+ "fieldtype": "Float",
+ "in_list_view": 1,
+ "label": "Current Stock",
+ "read_only": 1
+ },
+ {
+ "fieldname": "reference_name",
+ "fieldtype": "Data",
+ "hidden": 1,
+ "in_list_view": 1,
+ "label": "Reference Name",
+ "read_only": 1
+ },
+ {
+ "fieldname": "bom_detail_no",
+ "fieldtype": "Data",
+ "hidden": 1,
+ "in_list_view": 1,
+ "label": "BOM Detail No",
+ "read_only": 1
+ },
+ {
+ "fieldname": "secbreak_1",
+ "fieldtype": "Section Break"
+ },
+ {
+ "fieldname": "col_break2",
+ "fieldtype": "Column Break"
+ },
+ {
+ "fieldname": "secbreak_2",
+ "fieldtype": "Section Break"
+ },
+ {
+ "fieldname": "col_break3",
+ "fieldtype": "Column Break"
+ },
+ {
+ "fieldname": "secbreak_3",
+ "fieldtype": "Section Break"
+ },
+ {
+ "fieldname": "col_break4",
+ "fieldtype": "Column Break"
+ },
+ {
+ "fieldname": "item_name",
+ "fieldtype": "Data",
+ "label": "Item Name",
+ "read_only": 1
+ },
+ {
+ "fieldname": "subcontracting_order",
+ "fieldtype": "Link",
+ "hidden": 1,
+ "label": "Subcontracting Order",
+ "no_copy": 1,
+ "options": "Subcontracting Order",
+ "print_hide": 1,
+ "read_only": 1
+ },
+ {
+ "default": "0",
+ "fieldname": "available_qty_for_consumption",
+ "fieldtype": "Float",
+ "in_list_view": 1,
+ "label": "Available Qty For Consumption",
+ "print_hide": 1,
+ "read_only": 1
+ }
+ ],
+ "idx": 1,
+ "istable": 1,
+ "links": [],
+ "modified": "2022-11-07 17:17:21.670761",
+ "modified_by": "Administrator",
+ "module": "Subcontracting",
+ "name": "Subcontracting Receipt Supplied Item",
+ "naming_rule": "Autoincrement",
+ "owner": "Administrator",
+ "permissions": [],
+ "sort_field": "modified",
+ "sort_order": "DESC",
+ "states": [],
+ "track_changes": 1
}
\ No newline at end of file
diff --git a/erpnext/support/doctype/service_level_agreement/test_service_level_agreement.py b/erpnext/support/doctype/service_level_agreement/test_service_level_agreement.py
index 4e00138..472f6bc 100644
--- a/erpnext/support/doctype/service_level_agreement/test_service_level_agreement.py
+++ b/erpnext/support/doctype/service_level_agreement/test_service_level_agreement.py
@@ -15,8 +15,30 @@
class TestServiceLevelAgreement(unittest.TestCase):
def setUp(self):
+ self.create_company()
frappe.db.set_value("Support Settings", None, "track_service_level_agreement", 1)
- frappe.db.sql("delete from `tabLead`")
+ lead = frappe.qb.DocType("Lead")
+ frappe.qb.from_(lead).delete().where(lead.company == self.company).run()
+
+ def create_company(self):
+ name = "_Test Support SLA"
+ company = None
+ if frappe.db.exists("Company", name):
+ company = frappe.get_doc("Company", name)
+ else:
+ company = frappe.get_doc(
+ {
+ "doctype": "Company",
+ "company_name": name,
+ "country": "India",
+ "default_currency": "INR",
+ "create_chart_of_accounts_based_on": "Standard Template",
+ "chart_of_accounts": "Standard",
+ }
+ )
+ company = company.save()
+
+ self.company = company.name
def test_service_level_agreement(self):
# Default Service Level Agreement
@@ -205,7 +227,7 @@
# make lead with default SLA
creation = datetime.datetime(2019, 3, 4, 12, 0)
- lead = make_lead(creation=creation, index=1)
+ lead = make_lead(creation=creation, index=1, company=self.company)
self.assertEqual(lead.service_level_agreement, lead_sla.name)
self.assertEqual(lead.response_by, datetime.datetime(2019, 3, 4, 16, 0))
@@ -233,7 +255,7 @@
)
creation = datetime.datetime(2020, 3, 4, 4, 0)
- lead = make_lead(creation, index=2)
+ lead = make_lead(creation, index=2, company=self.company)
frappe.flags.current_time = datetime.datetime(2020, 3, 4, 4, 15)
lead.reload()
@@ -267,7 +289,7 @@
)
creation = datetime.datetime(2019, 3, 4, 12, 0)
- lead = make_lead(creation=creation, index=1)
+ lead = make_lead(creation=creation, index=1, company=self.company)
self.assertEqual(lead.response_by, datetime.datetime(2019, 3, 4, 16, 0))
# failed with response time only
@@ -294,7 +316,7 @@
# fulfilled with response time only
creation = datetime.datetime(2019, 3, 4, 12, 0)
- lead = make_lead(creation=creation, index=2)
+ lead = make_lead(creation=creation, index=2, company=self.company)
self.assertEqual(lead.service_level_agreement, lead_sla.name)
self.assertEqual(lead.response_by, datetime.datetime(2019, 3, 4, 16, 0))
@@ -321,7 +343,7 @@
apply_sla_for_resolution=0,
)
creation = datetime.datetime(2019, 3, 4, 12, 0)
- lead = make_lead(creation=creation, index=4)
+ lead = make_lead(creation=creation, index=4, company=self.company)
applied_sla = frappe.db.get_value("Lead", lead.name, "service_level_agreement")
self.assertFalse(applied_sla)
@@ -611,7 +633,7 @@
return frappe.get_doc("DocType", "Test SLA on Custom Dt")
-def make_lead(creation=None, index=0):
+def make_lead(creation=None, index=0, company=None):
return frappe.get_doc(
{
"doctype": "Lead",
@@ -621,5 +643,6 @@
"creation": creation,
"service_level_agreement_creation": creation,
"priority": "Medium",
+ "company": company,
}
).insert(ignore_permissions=True)
diff --git a/erpnext/support/doctype/warranty_claim/warranty_claim.py b/erpnext/support/doctype/warranty_claim/warranty_claim.py
index 5e2ea06..c86356f 100644
--- a/erpnext/support/doctype/warranty_claim/warranty_claim.py
+++ b/erpnext/support/doctype/warranty_claim/warranty_claim.py
@@ -35,7 +35,7 @@
lst1 = ",".join(x[0] for x in lst)
frappe.throw(_("Cancel Material Visit {0} before cancelling this Warranty Claim").format(lst1))
else:
- frappe.db.set(self, "status", "Cancelled")
+ self.db_set("status", "Cancelled")
def on_update(self):
pass
diff --git a/erpnext/templates/pages/demo.html b/erpnext/templates/pages/demo.html
deleted file mode 100644
index f9934a3..0000000
--- a/erpnext/templates/pages/demo.html
+++ /dev/null
@@ -1,77 +0,0 @@
-{% extends "templates/web.html" %}
-
-{% block script %}
-<script>
-$(document).ready(function() {
- $("#login_btn").click(function() {
- var me = this;
- $(this).html("Logging In...").prop("disabled", true);
- frappe.call({
- "method": "login",
- args: {
- usr: "demo@erpnext.com",
- pwd: "Demo1234567!!!",
- lead_email: $("#lead-email").val(),
- },
- callback: function(r) {
- $(me).prop("disabled", false);
- if(r.exc) {
- alert("Error, please contact support@erpnext.com");
- } else {
- console.log("Logged In");
- window.location.href = "desk";
- }
- }
- })
- return false;
- })
- .prop("disabled", false);
-})
-
-</script>
-{% endblock %}
-
-{% block style %}
-<style>
- footer, .navbar {
- display: none;
- }
- .page-content {
- right: 0%;
- width: 100%;
- }
- {% include "templates/styles/card_style.css" %}
- header, footer {
- display: none;
- }
- html, body {
- background-color: #f5f7fa;
- }
-</style>
-{% endblock %}
-
-{% block title %}
-{{ _("ERPNext Demo") }}
-{% endblock %}
-
-{% block page_content %}
-<div class='page-card'>
-
- <div class='page-card-head'>
- <span class='indicator blue'>
- {{ _("ERPNext Demo") }}</span>
- </div>
- <!-- <img src="/assets/erpnext/images/erp-icon.svg" style="max-width: 40px; max-height: 40px;"> -->
- <p>Some functionality is disabled for the demo and the data will be cleared regularly.</p>
- <div><button type="submit" id="login_btn" class="btn btn-primary btn-sm">Launch Demo</button></div>
-</div>
-
-
-<p class='text-muted text-center small' style='margin-top: -20px;'><a href="https://erpnext.com/pricing">Start a free 14-day trial </a>
-</p>
-<style>
-html, body {
- background-color: #f5f7fa;
-}
-</style>
-{% endblock %}
diff --git a/erpnext/translations/de.csv b/erpnext/translations/de.csv
index ca16403..0caea25 100644
--- a/erpnext/translations/de.csv
+++ b/erpnext/translations/de.csv
@@ -9899,3 +9899,7 @@
Website Item,Webseiten-Artikel,
Update Property,Eigenschaft aktualisieren,
Recurring Sales Invoice,Wiederkehrende Ausgangsrechnung,
+Total Asset,Aktiva,
+Total Liability,Verbindlichkeiten,
+Total Equity,Eigenkapital,
+Warehouse wise Stock Value,Warenwert nach Lager,
diff --git a/erpnext/translations/fr.csv b/erpnext/translations/fr.csv
index 7989bf7..3ba5ade 100644
--- a/erpnext/translations/fr.csv
+++ b/erpnext/translations/fr.csv
@@ -4946,7 +4946,7 @@
Max Amt,Montant Max,
"If rate is zero them item will be treated as ""Free Item""",Si le prix est à 0 alors l'article sera traité comme article gratuit
Is Recursive,Est récursif
-"Discounts to be applied in sequential ranges like buy 1 get 1, buy 2 get 2, buy 3 get 3 and so on",La remise sera appliquée séquentiellement telque : acheter 1 => recupérer 1, acheter 2 => recupérer 2, acheter 3 => recupérer 3, etc...
+"Discounts to be applied in sequential ranges like buy 1 get 1, buy 2 get 2, buy 3 get 3 and so on","La remise sera appliquée séquentiellement telque : acheter 1 => recupérer 1, acheter 2 => recupérer 2, acheter 3 => recupérer 3, etc..."
Period Settings,Paramètres de période,
Margin,Marge,
Margin Type,Type de Marge,
diff --git a/erpnext/translations/zh-TW.csv b/erpnext/translations/zh-TW.csv
index de1d763..c30dd72 100644
--- a/erpnext/translations/zh-TW.csv
+++ b/erpnext/translations/zh-TW.csv
@@ -10,20 +10,20 @@
apps/erpnext/erpnext/accounts/report/payment_period_based_on_invoice_date/payment_period_based_on_invoice_date.js +52,Please select Party Type first,請選擇黨第一型
DocType: Item,Customer Items,客戶項目
DocType: Project,Costing and Billing,成本核算和計費
-apps/erpnext/erpnext/hr/doctype/employee_advance/employee_advance.py +43,Advance account currency should be same as company currency {0},預付帳戶貨幣應與公司貨幣{0}相同
+apps/erpnext/erpnext/hr/doctype/employee_advance/employee_advance.py +43,Advance account currency should be same as company currency {0},預付科目貨幣應與公司貨幣{0}相同
DocType: QuickBooks Migrator,Token Endpoint,令牌端點
-apps/erpnext/erpnext/accounts/doctype/account/account.py +55,Account {0}: Parent account {1} can not be a ledger,帳戶{0}:父帳戶{1}不能是總帳
+apps/erpnext/erpnext/accounts/doctype/account/account.py +55,Account {0}: Parent account {1} can not be a ledger,科目{0}:上層科目{1}不能是總帳
DocType: Item,Publish Item to hub.erpnext.com,發布項目hub.erpnext.com
apps/erpnext/erpnext/hr/doctype/leave_application/leave_application.py +270,Cannot find active Leave Period,找不到有效的休假期
apps/erpnext/erpnext/hr/doctype/employee/employee_dashboard.py +22,Evaluation,評估
DocType: Item,Default Unit of Measure,預設的計量單位
DocType: SMS Center,All Sales Partner Contact,所有的銷售合作夥伴聯絡
DocType: Department,Leave Approvers,休假審批人
-DocType: Employee,Bio / Cover Letter,生物/求職信
+DocType: Employee,Bio / Cover Letter,自傳/求職信
DocType: Patient Encounter,Investigations,調查
DocType: Restaurant Order Entry,Click Enter To Add,點擊輸入要添加
apps/erpnext/erpnext/erpnext_integrations/doctype/shopify_settings/shopify_settings.py +29,"Missing value for Password, API Key or Shopify URL",缺少密碼,API密鑰或Shopify網址的值
-apps/erpnext/erpnext/public/js/setup_wizard.js +243,All Accounts,所有帳戶
+apps/erpnext/erpnext/public/js/setup_wizard.js +243,All Accounts,所有科目
apps/erpnext/erpnext/hr/doctype/employee_transfer/employee_transfer.py +15,Cannot transfer Employee with status Left,無法轉移狀態為左的員工
apps/erpnext/erpnext/manufacturing/doctype/production_order/production_order.py +216,"Stopped Production Order cannot be cancelled, Unstop it first to cancel",停止生產訂單無法取消,首先Unstop它取消
apps/erpnext/erpnext/assets/doctype/asset/asset.js +338,Do you really want to scrap this asset?,難道你真的想放棄這項資產?
@@ -48,12 +48,12 @@
DocType: Bank Guarantee,Customer,客戶
DocType: Purchase Receipt Item,Required By,需求來自
DocType: Delivery Note,Return Against Delivery Note,射向送貨單
-DocType: Asset Category,Finance Book Detail,財務圖書細節
+DocType: Asset Category,Finance Book Detail,財務帳簿細節
DocType: Purchase Order,% Billed,%已開立帳單
apps/erpnext/erpnext/controllers/sales_and_purchase_return.py +41,Exchange Rate must be same as {0} {1} ({2}),匯率必須一致{0} {1}({2})
DocType: Sales Invoice,Customer Name,客戶名稱
DocType: Vehicle,Natural Gas,天然氣
-apps/erpnext/erpnext/setup/setup_wizard/operations/company_setup.py +63,Bank account cannot be named as {0},銀行賬戶不能命名為{0}
+apps/erpnext/erpnext/setup/setup_wizard/operations/company_setup.py +63,Bank account cannot be named as {0},銀行科目不能命名為{0}
DocType: Employee Tax Exemption Declaration,HRA as per Salary Structure,HRA根據薪資結構
DocType: Account,Heads (or groups) against which Accounting Entries are made and balances are maintained.,頭(或組)針對其會計分錄是由和平衡得以維持。
apps/erpnext/erpnext/accounts/doctype/gl_entry/gl_entry.py +197,Outstanding for {0} cannot be less than zero ({1}),傑出的{0}不能小於零( {1} )
@@ -142,11 +142,11 @@
apps/erpnext/erpnext/hr/doctype/attendance/attendance.py +46,Attendance date can not be less than employee's joining date,考勤日期不得少於員工的加盟日期
DocType: Grading Scale,Grading Scale Name,分級標準名稱
apps/erpnext/erpnext/public/js/hub/marketplace.js +147,Add Users to Marketplace,將用戶添加到市場
-apps/erpnext/erpnext/accounts/doctype/account/account.js +37,This is a root account and cannot be edited.,這是一個 root 帳戶,不能被編輯。
-DocType: BOM,Operations,作業
+apps/erpnext/erpnext/accounts/doctype/account/account.js +37,This is a root account and cannot be edited.,這是一個 root 科目,不能被編輯。
+DocType: BOM,Operations,操作
apps/erpnext/erpnext/setup/doctype/authorization_rule/authorization_rule.py +38,Cannot set authorization on basis of Discount for {0},不能在折扣的基礎上設置授權{0}
DocType: Subscription,Subscription Start Date,訂閱開始日期
-DocType: Healthcare Settings,Default receivable accounts to be used if not set in Patient to book Appointment charges.,如果未在患者中設置預約費用,則使用默認應收帳戶。
+DocType: Healthcare Settings,Default receivable accounts to be used if not set in Patient to book Appointment charges.,如果未在患者中設置預約費用,則使用默認應收科目。
DocType: Rename Tool,"Attach .csv file with two columns, one for the old name and one for the new name",附加.csv文件有兩列,一為舊名稱,一個用於新名稱
apps/erpnext/erpnext/regional/report/eway_bill/eway_bill.py +195,From Address 2,來自地址2
apps/erpnext/erpnext/accounts/utils.py +74,{0} {1} not in any active Fiscal Year.,{0} {1} 不在任何有效的會計年度
@@ -216,14 +216,14 @@
apps/erpnext/erpnext/setup/setup_wizard/setup_wizard.py +51,Failed to setup taxes,無法設置稅收
DocType: Item,Copy From Item Group,從項目群組複製
DocType: Journal Entry,Opening Entry,開放報名
-apps/erpnext/erpnext/accounts/doctype/cheque_print_template/cheque_print_template.js +25,Account Pay Only,賬戶只需支付
+apps/erpnext/erpnext/accounts/doctype/cheque_print_template/cheque_print_template.js +25,Account Pay Only,科目只需支付
DocType: Loan,Repay Over Number of Periods,償還期的超過數
DocType: Stock Entry,Additional Costs,額外費用
-apps/erpnext/erpnext/accounts/doctype/account/account.py +145,Account with existing transaction can not be converted to group.,帳戶與現有的交易不能被轉換到群組。
+apps/erpnext/erpnext/accounts/doctype/account/account.py +145,Account with existing transaction can not be converted to group.,科目與現有的交易不能被轉換到群組。
DocType: Lead,Product Enquiry,產品查詢
DocType: Education Settings,Validate Batch for Students in Student Group,驗證學生組學生的批次
apps/erpnext/erpnext/hr/doctype/attendance/attendance.py +38,No leave record found for employee {0} for {1},未找到員工的假期記錄{0} {1}
-DocType: Company,Unrealized Exchange Gain/Loss Account,未實現的匯兌收益/損失賬戶
+DocType: Company,Unrealized Exchange Gain/Loss Account,未實現的匯兌收益/損失科目
apps/erpnext/erpnext/stock/doctype/landed_cost_voucher/landed_cost_voucher.js +23,Please enter company first,請先輸入公司
apps/erpnext/erpnext/accounts/doctype/journal_entry/journal_entry.js +626,Please select Company first,請首先選擇公司
DocType: Employee Education,Under Graduate,根據研究生
@@ -236,7 +236,7 @@
apps/erpnext/erpnext/manufacturing/doctype/bom/bom.py +282,Item {0} does not exist in the system or has expired,項目{0}不存在於系統中或已過期
DocType: Supplier,Leave blank if the Supplier is blocked indefinitely,如果供應商被無限期封鎖,請留空
apps/erpnext/erpnext/setup/setup_wizard/data/industry_type.py +44,Real Estate,房地產
-apps/erpnext/erpnext/accounts/report/general_ledger/general_ledger.html +1,Statement of Account,帳戶狀態
+apps/erpnext/erpnext/accounts/report/general_ledger/general_ledger.html +1,Statement of Account,科目狀態
apps/erpnext/erpnext/setup/setup_wizard/data/industry_type.py +41,Pharmaceuticals,製藥
DocType: Purchase Invoice Item,Is Fixed Asset,是固定的資產
apps/erpnext/erpnext/stock/doctype/stock_entry/stock_entry.py +355,"Available qty is {0}, you need {1}",可用數量是{0},則需要{1}
@@ -284,7 +284,7 @@
DocType: Selling Settings,Default Quotation Validity Days,默認報價有效天數
apps/erpnext/erpnext/controllers/accounts_controller.py +886,"To include tax in row {0} in Item rate, taxes in rows {1} must also be included",要包括稅款,行{0}項率,稅收行{1}也必須包括在內
DocType: Payroll Entry,Validate Attendance,驗證出席
-DocType: Sales Invoice,Change Amount,漲跌額
+DocType: Sales Invoice,Change Amount,變動金額
DocType: Party Tax Withholding Config,Certificate Received,已收到證書
DocType: GST Settings,Set Invoice Value for B2C. B2CL and B2CS calculated based on this invoice value.,設置B2C的發票值。 B2CL和B2CS根據此發票值計算。
DocType: BOM Update Tool,New BOM,新的物料清單
@@ -294,7 +294,7 @@
DocType: Driver,Driving License Categories,駕駛執照類別
apps/erpnext/erpnext/selling/doctype/sales_order/sales_order.py +124,Please enter Delivery Date,請輸入交貨日期
DocType: Depreciation Schedule,Make Depreciation Entry,計提折舊進入
-DocType: Closed Document,Closed Document,封閉文件
+DocType: Closed Document,Closed Document,關閉文件
DocType: HR Settings,Leave Settings,保留設置
apps/erpnext/erpnext/hr/doctype/staffing_plan/staffing_plan.js +76,Number of positions cannot be less then current count of employees,職位數量不能少於當前員工人數
DocType: Lead,Request Type,請求類型
@@ -308,7 +308,7 @@
apps/erpnext/erpnext/config/manufacturing.py +62,Details of the operations carried out.,進行的作業細節。
DocType: Asset Maintenance Log,Maintenance Status,維修狀態
apps/erpnext/erpnext/non_profit/doctype/member/member_dashboard.py +10,Membership Details,會員資格
-apps/erpnext/erpnext/accounts/doctype/gl_entry/gl_entry.py +56,{0} {1}: Supplier is required against Payable account {2},{0} {1}:需要對供應商應付賬款{2}
+apps/erpnext/erpnext/accounts/doctype/gl_entry/gl_entry.py +56,{0} {1}: Supplier is required against Payable account {2},{0} {1}:需要對供應商應付帳款{2}
apps/erpnext/erpnext/config/selling.py +52,Items and Pricing,項目和定價
apps/erpnext/erpnext/projects/doctype/project/project_dashboard.html +2,Total hours: {0},總時間:{0}
apps/erpnext/erpnext/accounts/report/trial_balance/trial_balance.py +43,From Date should be within the Fiscal Year. Assuming From Date = {0},從日期應該是在財政年度內。假設起始日期={0}
@@ -369,12 +369,12 @@
apps/erpnext/erpnext/education/doctype/student_group/student_group.js +51,Update Email Group,更新電子郵件組
DocType: Sales Invoice,Is Opening Entry,是開放登錄
DocType: Lab Test Template,"If unchecked, the item wont be appear in Sales Invoice, but can be used in group test creation. ",如果取消選中,該項目不會出現在銷售發票中,但可用於創建組測試。
-DocType: Customer Group,Mention if non-standard receivable account applicable,何況,如果不規範應收賬款適用
+DocType: Customer Group,Mention if non-standard receivable account applicable,何況,如果不規範應收帳款適用
DocType: Course Schedule,Instructor Name,導師姓名
DocType: Company,Arrear Component,欠費組件
DocType: Supplier Scorecard,Criteria Setup,條件設置
apps/erpnext/erpnext/manufacturing/doctype/production_order/production_order.py +199,For Warehouse is required before Submit,對於倉庫之前,需要提交
-DocType: Codification Table,Medical Code,醫療法
+DocType: Codification Table,Medical Code,醫療代號
apps/erpnext/erpnext/config/integrations.py +37,Connect Amazon with ERPNext,將Amazon與ERPNext連接起來
apps/erpnext/erpnext/manufacturing/doctype/production_planning_tool/production_planning_tool.py +20,Please enter Company,請輸入公司名稱
DocType: Delivery Note Item,Against Sales Invoice Item,對銷售發票項目
@@ -406,9 +406,9 @@
apps/erpnext/erpnext/hr/doctype/employee/employee.py +138,Relieving Date must be greater than Date of Joining,解除日期必須大於加入的日期
DocType: POS Closing Voucher,Cashier,出納員
apps/erpnext/erpnext/setup/setup_wizard/operations/install_fixtures.py +198,Leaves per Year,每年葉
-apps/erpnext/erpnext/accounts/doctype/journal_entry/journal_entry.py +162,Row {0}: Please check 'Is Advance' against Account {1} if this is an advance entry.,行{0}:請檢查'是推進'對帳戶{1},如果這是一個進步條目。
+apps/erpnext/erpnext/accounts/doctype/journal_entry/journal_entry.py +162,Row {0}: Please check 'Is Advance' against Account {1} if this is an advance entry.,行{0}:請檢查'是進階'對科目{1},如果這是一個進階條目。
apps/erpnext/erpnext/stock/utils.py +243,Warehouse {0} does not belong to company {1},倉庫{0}不屬於公司{1}
-DocType: Email Digest,Profit & Loss,利潤損失
+DocType: Email Digest,Profit & Loss,收益與損失
DocType: Task,Total Costing Amount (via Time Sheet),總成本計算量(通過時間表)
apps/erpnext/erpnext/education/doctype/fee_schedule/fee_schedule.py +76,Please setup Students under Student Groups,請設置學生組的學生
DocType: Item Website Specification,Item Website Specification,項目網站規格
@@ -479,7 +479,7 @@
DocType: Purchase Invoice Item,Enable Deferred Expense,啟用延期費用
DocType: Asset,Next Depreciation Date,接下來折舊日期
apps/erpnext/erpnext/projects/doctype/activity_type/activity_type.js +3,Activity Cost per Employee,每個員工活動費用
-DocType: Accounts Settings,Settings for Accounts,設置帳戶
+DocType: Accounts Settings,Settings for Accounts,會計設定
apps/erpnext/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py +800,Supplier Invoice No exists in Purchase Invoice {0},供應商發票不存在採購發票{0}
apps/erpnext/erpnext/config/selling.py +118,Manage Sales Person Tree.,管理銷售人員樹。
apps/erpnext/erpnext/stock/doctype/delivery_trip/delivery_trip.py +105,"Cannot process route, since Google Maps Settings is disabled.",由於禁用了Google地圖設置,因此無法處理路線。
@@ -521,7 +521,7 @@
apps/erpnext/erpnext/public/js/templates/item_quick_entry.html +1,Variant Attributes,變量屬性
apps/erpnext/erpnext/hr/report/monthly_attendance_sheet/monthly_attendance_sheet.py +114,Please select month and year,請選擇年份和月份
DocType: Employee,Company Email,企業郵箱
-DocType: GL Entry,Debit Amount in Account Currency,在賬戶幣種借記金額
+DocType: GL Entry,Debit Amount in Account Currency,在科目幣種借記金額
apps/erpnext/erpnext/crm/report/campaign_efficiency/campaign_efficiency.py +21,Order Value,訂單價值
apps/erpnext/erpnext/crm/report/campaign_efficiency/campaign_efficiency.py +21,Order Value,訂單價值
DocType: Certified Consultant,Certified Consultant,認證顧問
@@ -550,7 +550,7 @@
DocType: Project Update,Good/Steady,好/穩定
DocType: Bank Statement Transaction Invoice Item,Invoice Date,發票日期
DocType: GL Entry,Debit Amount,借方金額
-apps/erpnext/erpnext/accounts/party.py +277,There can only be 1 Account per Company in {0} {1},只能有每公司1帳戶{0} {1}
+apps/erpnext/erpnext/accounts/party.py +277,There can only be 1 Account per Company in {0} {1},只能有每公司1科目{0} {1}
DocType: Support Search Source,Response Result Key Path,響應結果關鍵路徑
DocType: Journal Entry,Inter Company Journal Entry,Inter公司日記帳分錄
apps/erpnext/erpnext/stock/doctype/stock_entry/stock_entry.py +534,For quantity {0} should not be grater than work order quantity {1},數量{0}不應超過工單數量{1}
@@ -562,7 +562,7 @@
DocType: Setup Progress Action,Action Document,行動文件
DocType: Chapter Member,Website URL,網站網址
DocType: Delivery Note,Instructions,說明
-DocType: Quality Inspection,Inspected By,視察
+DocType: Quality Inspection,Inspected By,檢查
DocType: Asset Maintenance Log,Maintenance Type,維護類型
apps/erpnext/erpnext/education/doctype/student_group/student_group.py +45,{0} - {1} is not enrolled in the Course {2},{0} - {1} 未在課程中註冊 {2}
apps/erpnext/erpnext/education/doctype/student_report_generation_tool/student_report_generation_tool.html +225,Student Name: ,學生姓名:
@@ -642,17 +642,17 @@
DocType: Certification Application,Non Profit,非營利
DocType: Production Plan,Not Started,未啟動
DocType: Lead,Channel Partner,渠道合作夥伴
-DocType: Account,Old Parent,老家長
+DocType: Account,Old Parent,舊上級
apps/erpnext/erpnext/education/doctype/program_enrollment_tool/program_enrollment_tool.py +24,Mandatory field - Academic Year,必修課 - 學年
apps/erpnext/erpnext/education/doctype/program_enrollment_tool/program_enrollment_tool.py +24,Mandatory field - Academic Year,必修課 - 學年
apps/erpnext/erpnext/accounts/doctype/payment_entry/payment_entry.py +221,{0} {1} is not associated with {2} {3},{0} {1} 未與 {2} {3} 關聯
DocType: Notification Control,Customize the introductory text that goes as a part of that email. Each transaction has a separate introductory text.,自定義去作為郵件的一部分的介紹文字。每筆交易都有一個單獨的介紹性文字。
apps/erpnext/erpnext/manufacturing/doctype/job_card/job_card.py +56,Row {0} : Operation is required against the raw material item {1},行{0}:對原材料項{1}需要操作
-apps/erpnext/erpnext/hr/doctype/expense_claim/expense_claim.py +180,Please set default payable account for the company {0},請為公司{0}設置預設應付賬款
+apps/erpnext/erpnext/hr/doctype/expense_claim/expense_claim.py +180,Please set default payable account for the company {0},請為公司{0}設置預設應付帳款
apps/erpnext/erpnext/stock/doctype/stock_entry/stock_entry.py +608,Transaction not allowed against stopped Work Order {0},不允許對停止的工單{0}進行交易
DocType: Setup Progress Action,Min Doc Count,最小文件計數
apps/erpnext/erpnext/config/manufacturing.py +84,Global settings for all manufacturing processes.,所有製造過程中的全域設定。
-DocType: Accounts Settings,Accounts Frozen Upto,帳戶被凍結到
+DocType: Accounts Settings,Accounts Frozen Upto,科目被凍結到
DocType: SMS Log,Sent On,發送於
apps/erpnext/erpnext/stock/doctype/item/item.py +778,Attribute {0} selected multiple times in Attributes Table,屬性{0}多次選擇在屬性表
DocType: HR Settings,Employee record is created using selected field. ,使用所選欄位創建員工記錄。
@@ -717,7 +717,7 @@
DocType: Codification Table,Codification Table,編纂表
DocType: Timesheet Detail,Hrs,小時
apps/erpnext/erpnext/accounts/doctype/journal_entry/journal_entry.js +410,Please select Company,請選擇公司
-DocType: Stock Entry Detail,Difference Account,差異帳戶
+DocType: Stock Entry Detail,Difference Account,差異科目
DocType: Purchase Invoice,Supplier GSTIN,供應商GSTIN
apps/erpnext/erpnext/projects/doctype/task/task.py +50,Cannot close task as its dependant task {0} is not closed.,不能因為其依賴的任務{0}沒有關閉關閉任務。
apps/erpnext/erpnext/manufacturing/doctype/production_planning_tool/production_planning_tool.py +435,Please enter Warehouse for which Material Request will be raised,請輸入物料需求欲增加的倉庫
@@ -759,7 +759,7 @@
DocType: Vital Signs,Body Temperature,體溫
DocType: Project,Project will be accessible on the website to these users,項目將在網站向這些用戶上訪問
apps/erpnext/erpnext/stock/doctype/serial_no/serial_no.py +292,Cannot cancel {0} {1} because Serial No {2} does not belong to the warehouse {3},無法取消{0} {1},因為序列號{2}不屬於倉庫{3}
-DocType: Company,Default Deferred Expense Account,默認遞延費用帳戶
+DocType: Company,Default Deferred Expense Account,默認遞延費用科目
apps/erpnext/erpnext/config/projects.py +29,Define Project type.,定義項目類型。
DocType: Supplier Scorecard,Weighting Function,加權函數
DocType: Healthcare Practitioner,OP Consulting Charge,OP諮詢費
@@ -767,7 +767,7 @@
DocType: Student Report Generation Tool,Show Marks,顯示標記
DocType: Support Settings,Get Latest Query,獲取最新查詢
DocType: Quotation,Rate at which Price list currency is converted to company's base currency,價目表貨幣被換算成公司基礎貨幣的匯率
-apps/erpnext/erpnext/setup/doctype/company/company.py +74,Account {0} does not belong to company: {1},帳戶{0}不屬於公司:{1}
+apps/erpnext/erpnext/setup/doctype/company/company.py +74,Account {0} does not belong to company: {1},科目{0}不屬於公司:{1}
apps/erpnext/erpnext/setup/doctype/company/company.py +56,Abbreviation already used for another company,另一家公司已使用此縮寫
DocType: Selling Settings,Default Customer Group,預設客戶群組
DocType: Employee,IFSC Code,IFSC代碼
@@ -792,20 +792,20 @@
DocType: Installation Note Item,Installation Note Item,安裝注意項
DocType: Production Plan Item,Pending Qty,待定數量
apps/erpnext/erpnext/accounts/party.py +429,{0} {1} is not active,{0} {1}是不活動
-DocType: Woocommerce Settings,Freight and Forwarding Account,貨運和轉運帳戶
+DocType: Woocommerce Settings,Freight and Forwarding Account,貨運和轉運科目
apps/erpnext/erpnext/config/accounts.py +240,Setup cheque dimensions for printing,設置檢查尺寸打印
apps/erpnext/erpnext/hr/doctype/payroll_entry/payroll_entry.js +33,Create Salary Slips,創建工資單
DocType: Vital Signs,Bloated,脹
DocType: Salary Slip,Salary Slip Timesheet,工資單時間表
apps/erpnext/erpnext/controllers/buying_controller.py +200,Supplier Warehouse mandatory for sub-contracted Purchase Receipt,對於轉包的採購入庫單,供應商倉庫是強制性輸入的。
DocType: Sales Invoice,Total Commission,佣金總計
-DocType: Tax Withholding Account,Tax Withholding Account,扣繳稅款賬戶
+DocType: Tax Withholding Account,Tax Withholding Account,扣繳稅款科目
DocType: Pricing Rule,Sales Partner,銷售合作夥伴
apps/erpnext/erpnext/config/buying.py +150,All Supplier scorecards.,所有供應商記分卡。
DocType: Buying Settings,Purchase Receipt Required,需要採購入庫單
DocType: Delivery Note,Rail,軌
apps/erpnext/erpnext/stock/doctype/stock_entry/stock_entry.py +267,Target warehouse in row {0} must be same as Work Order,行{0}中的目標倉庫必須與工單相同
-apps/erpnext/erpnext/stock/doctype/item/item.py +183,Valuation Rate is mandatory if Opening Stock entered,估價費用是強制性的,如果打開股票進入
+apps/erpnext/erpnext/stock/doctype/item/item.py +183,Valuation Rate is mandatory if Opening Stock entered,估價費用是強制性的,如果打開庫存進入
apps/erpnext/erpnext/accounts/doctype/payment_reconciliation/payment_reconciliation.py +143,No records found in the Invoice table,沒有在發票表中找到記錄
apps/erpnext/erpnext/accounts/doctype/payment_reconciliation/payment_reconciliation.js +36,Please select Company and Party Type first,請選擇公司和黨的第一型
apps/erpnext/erpnext/accounts/doctype/pos_profile/pos_profile.py +31,"Already set default in pos profile {0} for user {1}, kindly disabled default",已經在用戶{1}的pos配置文件{0}中設置了默認值,請禁用默認值
@@ -828,7 +828,7 @@
apps/erpnext/erpnext/public/js/pos/pos.html +4,Item Cart,項目車
apps/erpnext/erpnext/accounts/doctype/fiscal_year/fiscal_year.py +38,Fiscal Year Start Date should not be greater than Fiscal Year End Date,會計年度開始日期應不大於財政年度結束日期
DocType: Issue,Resolution,決議
-DocType: Employee,Personal Bio,個人生物
+DocType: Employee,Personal Bio,個人自傳
apps/erpnext/erpnext/non_profit/report/expiring_memberships/expiring_memberships.py +15,Membership ID,會員ID
apps/erpnext/erpnext/templates/pages/order.html +77,Delivered: {0},交貨:{0}
DocType: QuickBooks Migrator,Connected to QuickBooks,連接到QuickBooks
@@ -868,7 +868,7 @@
apps/erpnext/erpnext/education/doctype/fee_schedule/fee_schedule.js +58,Total Outstanding: {0},總計:{0}
DocType: Sales Invoice Timesheet,Sales Invoice Timesheet,銷售發票時間表
apps/erpnext/erpnext/accounts/doctype/journal_entry/journal_entry.py +150,Reference No & Reference Date is required for {0},參考號與參考日期須為{0}
-DocType: Payroll Entry,Select Payment Account to make Bank Entry,選擇付款賬戶,使銀行進入
+DocType: Payroll Entry,Select Payment Account to make Bank Entry,選擇付款科目,使銀行進入
DocType: Hotel Settings,Default Invoice Naming Series,默認發票命名系列
apps/erpnext/erpnext/utilities/activation.py +136,"Create Employee records to manage leaves, expense claims and payroll",建立員工檔案管理葉,報銷和工資
apps/erpnext/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.js +712,An error occurred during the update process,更新過程中發生錯誤
@@ -898,7 +898,7 @@
DocType: Batch,Batch Description,批次說明
apps/erpnext/erpnext/education/doctype/student_group_creation_tool/student_group_creation_tool.js +12,Creating student groups,創建學生組
apps/erpnext/erpnext/education/doctype/student_group_creation_tool/student_group_creation_tool.js +12,Creating student groups,創建學生組
-apps/erpnext/erpnext/accounts/utils.py +763,"Payment Gateway Account not created, please create one manually.",支付網關帳戶沒有創建,請手動創建一個。
+apps/erpnext/erpnext/accounts/utils.py +763,"Payment Gateway Account not created, please create one manually.",支付閘道科目沒有創建,請手動創建一個。
apps/erpnext/erpnext/education/doctype/student_applicant/student_applicant.py +51,Not eligible for the admission in this program as per DOB,按照DOB的規定,沒有資格參加本計劃
DocType: Sales Invoice,Sales Taxes and Charges,銷售稅金及費用
DocType: Student,Sibling Details,兄弟姐妹詳情
@@ -922,7 +922,7 @@
apps/erpnext/erpnext/setup/setup_wizard/operations/install_fixtures.py +87,Manager,經理
apps/erpnext/erpnext/accounts/report/budget_variance_report/budget_variance_report.js +8,From Fiscal Year,從財政年度開始
apps/erpnext/erpnext/selling/doctype/customer/customer.py +185,New credit limit is less than current outstanding amount for the customer. Credit limit has to be atleast {0},新的信用額度小於當前餘額為客戶著想。信用額度是ATLEAST {0}
-apps/erpnext/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py +453,Please set account in Warehouse {0},請在倉庫{0}中設置帳戶
+apps/erpnext/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py +453,Please set account in Warehouse {0},請在倉庫{0}中設置會計科目
apps/erpnext/erpnext/controllers/trends.py +39,'Based On' and 'Group By' can not be same,“根據”和“分組依據”不能相同
DocType: Sales Person,Sales Person Targets,銷售人員目標
DocType: Work Order Operation,In minutes,在幾分鐘內
@@ -970,7 +970,7 @@
DocType: Loan,Total Interest Payable,合計應付利息
DocType: Landed Cost Taxes and Charges,Landed Cost Taxes and Charges,到岸成本稅費
DocType: Work Order Operation,Actual Start Time,實際開始時間
-DocType: Purchase Invoice Item,Deferred Expense Account,遞延費用帳戶
+DocType: Purchase Invoice Item,Deferred Expense Account,遞延費用科目
DocType: BOM Operation,Operation Time,操作時間
apps/erpnext/erpnext/manufacturing/doctype/work_order/work_order.js +466,Finish,完
apps/erpnext/erpnext/hr/doctype/salary_structure/salary_structure.js +441,Base,基礎
@@ -979,7 +979,7 @@
apps/erpnext/erpnext/selling/page/point_of_sale/point_of_sale.js +1659,Write Off Amount,核銷金額
DocType: Leave Block List Allow,Allow User,允許用戶
DocType: Journal Entry,Bill No,帳單號碼
-DocType: Company,Gain/Loss Account on Asset Disposal,在資產處置收益/損失帳戶
+DocType: Company,Gain/Loss Account on Asset Disposal,在資產處置收益/損失科目
DocType: Vehicle Log,Service Details,服務細節
DocType: Vehicle Log,Service Details,服務細節
DocType: Lab Test Template,Grouped,分組
@@ -1013,7 +1013,7 @@
apps/erpnext/erpnext/accounts/doctype/budget/budget.py +64,Account {0} has been entered multiple times,帳戶{0}已多次輸入
DocType: Account,Expenses Included In Valuation,支出計入估值
apps/erpnext/erpnext/non_profit/doctype/membership/membership.py +38,You can only renew if your membership expires within 30 days,如果您的會員資格在30天內到期,您只能續訂
-DocType: Shopping Cart Settings,Show Stock Availability,顯示股票可用性
+DocType: Shopping Cart Settings,Show Stock Availability,顯示庫存可用性
apps/erpnext/erpnext/assets/doctype/asset/asset.py +519,Set {0} in asset category {1} or company {2},在資產類別{1}或公司{2}中設置{0}
DocType: Location,Longitude,經度
,Absent Student Report,缺席學生報告
@@ -1038,7 +1038,7 @@
DocType: Project,Estimated Cost,估計成本
DocType: Request for Quotation,Link to material requests,鏈接到材料請求
DocType: Journal Entry,Credit Card Entry,信用卡進入
-apps/erpnext/erpnext/config/accounts.py +35,Company and Accounts,公司與賬戶
+apps/erpnext/erpnext/config/accounts.py +35,Company and Accounts,公司與科目
apps/erpnext/erpnext/stock/report/stock_balance/stock_balance.py +85,In Value,在數值
DocType: Asset Settings,Depreciation Options,折舊選項
apps/erpnext/erpnext/assets/doctype/asset_movement/asset_movement.py +28,Either location or employee must be required,必須要求地點或員工
@@ -1055,7 +1055,7 @@
apps/erpnext/erpnext/accounts/doctype/account/chart_of_accounts/verified/standard_chart_of_accounts.py +10,Current Assets,流動資產
apps/erpnext/erpnext/stock/doctype/stock_entry/stock_entry.py +161,{0} is not a stock Item,{0}不是庫存項目
apps/erpnext/erpnext/hr/notification/training_feedback/training_feedback.html +6,Please share your feedback to the training by clicking on 'Training Feedback' and then 'New',請通過點擊“培訓反饋”,然後點擊“新建”
-DocType: Mode of Payment Account,Default Account,預設帳戶
+DocType: Mode of Payment Account,Default Account,預設科目
apps/erpnext/erpnext/stock/doctype/item/item.py +302,Please select Sample Retention Warehouse in Stock Settings first,請先在庫存設置中選擇樣品保留倉庫
apps/erpnext/erpnext/accounts/doctype/loyalty_program/loyalty_program.js +62,Please select the Multiple Tier Program type for more than one collection rules.,請為多個收集規則選擇多層程序類型。
DocType: Payment Entry,Received Amount (Company Currency),收到的款項(公司幣種)
@@ -1069,7 +1069,7 @@
apps/erpnext/erpnext/accounts/doctype/account/account.py +100,Account with existing transaction cannot be converted to ledger,帳戶與現有的交易不能被轉換為總賬
apps/erpnext/erpnext/config/non_profit.py +33,Memebership Type Details,Memebership類型詳細信息
DocType: Delivery Note,Customer's Purchase Order No,客戶的採購訂單編號
-DocType: Clinical Procedure,Consume Stock,消費股票
+DocType: Clinical Procedure,Consume Stock,消費庫存
DocType: Budget,Budget Against,反對財政預算案
apps/erpnext/erpnext/stock/reorder_item.py +194,Auto Material Requests Generated,汽車材料的要求生成
apps/erpnext/erpnext/buying/doctype/supplier_quotation/supplier_quotation_list.js +7,Lost,丟失
@@ -1084,7 +1084,7 @@
apps/erpnext/erpnext/hr/doctype/leave_application/leave_application.py +23,{0}: From {0} of type {1},{0}:從{0}類型{1}
apps/erpnext/erpnext/controllers/buying_controller.py +399,Row {0}: Conversion Factor is mandatory,列#{0}:轉換係數是強制性的
apps/erpnext/erpnext/accounts/doctype/pricing_rule/pricing_rule.py +353,"Multiple Price Rules exists with same criteria, please resolve conflict by assigning priority. Price Rules: {0}",海報價格規則,同樣的標準存在,請通過分配優先解決衝突。價格規則:{0}
-DocType: Exchange Rate Revaluation,Exchange Rate Revaluation Account,匯率重估賬戶
+DocType: Exchange Rate Revaluation,Exchange Rate Revaluation Account,匯率重估科目
apps/erpnext/erpnext/manufacturing/doctype/bom/bom.py +539,Cannot deactivate or cancel BOM as it is linked with other BOMs,無法關閉或取消BOM,因為它是與其他材料明細表鏈接
apps/erpnext/erpnext/accounts/doctype/exchange_rate_revaluation/exchange_rate_revaluation.js +106,Please select Company and Posting Date to getting entries,請選擇公司和發布日期以獲取條目
DocType: Asset,Maintenance,維護
@@ -1146,9 +1146,9 @@
DocType: Expense Claim Detail,Expense Claim Type,費用報銷型
DocType: Shopping Cart Settings,Default settings for Shopping Cart,對購物車的預設設定
apps/erpnext/erpnext/healthcare/doctype/practitioner_schedule/practitioner_schedule.js +27,Add Timeslots,添加時代
-apps/erpnext/erpnext/stock/__init__.py +57,Please set Account in Warehouse {0} or Default Inventory Account in Company {1},請在倉庫{0}中設置帳戶或在公司{1}中設置默認庫存帳戶
+apps/erpnext/erpnext/stock/__init__.py +57,Please set Account in Warehouse {0} or Default Inventory Account in Company {1},請在倉庫{0}中設科目或在公司{1}中設置默認庫存科目
apps/erpnext/erpnext/assets/doctype/asset/depreciation.py +143,Asset scrapped via Journal Entry {0},通過資產日記帳分錄報廢{0}
-DocType: Loan,Interest Income Account,利息收入賬戶
+DocType: Loan,Interest Income Account,利息收入科目
apps/erpnext/erpnext/hr/doctype/salary_structure/salary_structure.py +61,Max benefits should be greater than zero to dispense benefits,最大的好處應該大於零來分配好處
apps/erpnext/erpnext/non_profit/doctype/grant_application/grant_application.py +58,Review Invitation Sent,審核邀請已發送
DocType: Shift Assignment,Shift Assignment,班次分配
@@ -1167,7 +1167,7 @@
apps/erpnext/erpnext/hr/doctype/expense_claim/expense_claim.py +228,Sanctioned Amount cannot be greater than Claim Amount in Row {0}.,制裁金額不能大於索賠額行{0}。
apps/erpnext/erpnext/education/report/course_wise_assessment_report/course_wise_assessment_report.html +14,Academic Term: ,學術期限:
DocType: Salary Component,Do not include in total,不包括在內
-DocType: Company,Default Cost of Goods Sold Account,銷貨帳戶的預設成本
+DocType: Company,Default Cost of Goods Sold Account,銷貨成本科目
apps/erpnext/erpnext/stock/doctype/stock_entry/stock_entry.py +1287,Sample quantity {0} cannot be more than received quantity {1},採樣數量{0}不能超過接收數量{1}
apps/erpnext/erpnext/stock/get_item_details.py +523,Price List not selected,未選擇價格列表
DocType: Request for Quotation Supplier,Send Email,發送電子郵件
@@ -1176,7 +1176,7 @@
apps/erpnext/erpnext/accounts/doctype/journal_entry/journal_entry.py +810,No Permission,無權限
DocType: Contract Fulfilment Checklist,Contract Fulfilment Checklist,合同履行清單
DocType: Vital Signs,Heart Rate / Pulse,心率/脈搏
-DocType: Company,Default Bank Account,預設銀行帳戶
+DocType: Company,Default Bank Account,預設銀行會計科目
apps/erpnext/erpnext/accounts/report/general_ledger/general_ledger.py +76,"To filter based on Party, select Party Type first",要根據黨的篩選,選擇黨第一類型
apps/erpnext/erpnext/controllers/sales_and_purchase_return.py +46,'Update Stock' can not be checked because items are not delivered via {0},不能勾選`更新庫存',因為項目未交付{0}
DocType: Vehicle,Acquisition Date,採集日期
@@ -1202,7 +1202,7 @@
DocType: Payment Reconciliation,Minimum Invoice Amount,最小發票金額
apps/erpnext/erpnext/accounts/doctype/gl_entry/gl_entry.py +112,{0} {1}: Cost Center {2} does not belong to Company {3},{0} {1}:成本中心{2}不屬於公司{3}
apps/erpnext/erpnext/utilities/user_progress.py +92,Upload your letter head (Keep it web friendly as 900px by 100px),上傳你的信頭(保持網頁友好,900px乘100px)
-apps/erpnext/erpnext/accounts/doctype/gl_entry/gl_entry.py +89,{0} {1}: Account {2} cannot be a Group,{0} {1}帳戶{2}不能是一個組
+apps/erpnext/erpnext/accounts/doctype/gl_entry/gl_entry.py +89,{0} {1}: Account {2} cannot be a Group,{0} {1}科目{2}不能是一個群組科目
apps/erpnext/erpnext/accounts/doctype/sales_invoice/sales_invoice.py +367,Timesheet {0} is already completed or cancelled,時間表{0}已完成或取消
apps/erpnext/erpnext/templates/pages/projects.html +42,No tasks,沒有任務
apps/erpnext/erpnext/healthcare/doctype/patient_appointment/patient_appointment.py +81,Sales Invoice {0} created as paid,銷售發票{0}已創建為已付款
@@ -1282,7 +1282,7 @@
apps/erpnext/erpnext/config/selling.py +332,Point-of-Sale,銷售點
DocType: Fee Schedule,Fee Creation Status,費用創建狀態
DocType: Vehicle Log,Odometer Reading,里程表讀數
-apps/erpnext/erpnext/accounts/doctype/account/account.py +123,"Account balance already in Credit, you are not allowed to set 'Balance Must Be' as 'Debit'",帳戶餘額已歸為信用帳戶,不允許設為借方帳戶
+apps/erpnext/erpnext/accounts/doctype/account/account.py +123,"Account balance already in Credit, you are not allowed to set 'Balance Must Be' as 'Debit'",科目餘額已歸為貸方,不允許設為借方
DocType: Account,Balance must be,餘額必須
DocType: Notification Control,Expense Claim Rejected Message,報銷回絕訊息
,Available Qty,可用數量
@@ -1349,9 +1349,9 @@
DocType: Healthcare Settings,"If checked, a customer will be created, mapped to Patient.
Patient Invoices will be created against this Customer. You can also select existing Customer while creating Patient.",如果選中,將創建一個客戶,映射到患者。將針對該客戶創建病人發票。您也可以在創建患者時選擇現有客戶。
apps/erpnext/erpnext/accounts/doctype/loyalty_program/loyalty_program.py +63,Customer isn't enrolled in any Loyalty Program,客戶未加入任何忠誠度計劃
-DocType: Bank Reconciliation,Account Currency,賬戶幣種
+DocType: Bank Reconciliation,Account Currency,科目幣種
DocType: Lab Test,Sample ID,樣品編號
-apps/erpnext/erpnext/accounts/general_ledger.py +178,Please mention Round Off Account in Company,請註明舍入賬戶的公司
+apps/erpnext/erpnext/accounts/general_ledger.py +178,Please mention Round Off Account in Company,請註明舍入科目的公司
DocType: Purchase Receipt,Range,範圍
DocType: Supplier,Default Payable Accounts,預設應付帳款
apps/erpnext/erpnext/hr/doctype/attendance/attendance.py +52,Employee {0} is not active or does not exist,員工{0}不活躍或不存在
@@ -1471,7 +1471,7 @@
apps/erpnext/erpnext/hr/doctype/employee_promotion/employee_promotion.js +132,Added to details,添加到細節
apps/erpnext/erpnext/education/doctype/course_scheduling_tool/course_scheduling_tool.js +14,Schedule Course,課程時間表
DocType: Budget,Applicable on Material Request,適用於材料請求
-apps/erpnext/erpnext/setup/setup_wizard/operations/install_fixtures.py +194,Stock Options,股票期權
+apps/erpnext/erpnext/setup/setup_wizard/operations/install_fixtures.py +194,Stock Options,庫存期權
apps/erpnext/erpnext/selling/page/point_of_sale/point_of_sale.js +628,No Items added to cart,沒有項目已添加到購物車
DocType: Journal Entry Account,Expense Claim,報銷
apps/erpnext/erpnext/assets/doctype/asset/asset.js +352,Do you really want to restore this scrapped asset?,難道你真的想恢復這個報廢的資產?
@@ -1491,7 +1491,7 @@
DocType: Company,Default Terms,默認條款
DocType: Supplier Scorecard Period,Criteria,標準
DocType: Packing Slip Item,Packing Slip Item,包裝單項目
-DocType: Purchase Invoice,Cash/Bank Account,現金/銀行帳戶
+DocType: Purchase Invoice,Cash/Bank Account,現金/銀行會計科目
DocType: Travel Itinerary,Train,培養
apps/erpnext/erpnext/public/js/queries.js +96,Please specify a {0},請指定{0}
apps/erpnext/erpnext/stock/doctype/stock_reconciliation/stock_reconciliation.py +74,Removed items with no change in quantity or value.,刪除的項目在數量或價值沒有變化。
@@ -1516,7 +1516,7 @@
apps/erpnext/erpnext/accounts/doctype/payment_entry/payment_entry.js +187,Please specify a valid Row ID for row {0} in table {1},請指定行{0}在表中的有效行ID {1}
apps/erpnext/erpnext/buying/doctype/supplier_scorecard_criteria/supplier_scorecard_criteria.py +84,Unable to find variable: ,無法找到變量:
apps/erpnext/erpnext/selling/page/point_of_sale/point_of_sale.js +893,Please select a field to edit from numpad,請選擇要從數字鍵盤編輯的字段
-apps/erpnext/erpnext/stock/doctype/item/item.py +293,Cannot be a fixed asset item as Stock Ledger is created.,不能成為股票分類賬創建的固定資產項目。
+apps/erpnext/erpnext/stock/doctype/item/item.py +293,Cannot be a fixed asset item as Stock Ledger is created.,不能成為庫存分類賬創建的固定資產項目。
apps/erpnext/erpnext/healthcare/doctype/inpatient_record/inpatient_record.js +7,Admit,承認
apps/erpnext/erpnext/setup/page/welcome_to_erpnext/welcome_to_erpnext.html +23,Go to the Desktop and start using ERPNext,轉到桌面和開始使用ERPNext
apps/erpnext/erpnext/templates/pages/order.js +31,Pay Remaining,支付剩餘
@@ -1563,7 +1563,7 @@
DocType: Email Digest,Purchase Orders Items Overdue,採購訂單項目逾期
apps/erpnext/erpnext/accounts/page/pos/pos.js +1638,ZIP Code,郵政編碼
apps/erpnext/erpnext/controllers/selling_controller.py +265,Sales Order {0} is {1},銷售訂單{0} {1}
-apps/erpnext/erpnext/hr/doctype/payroll_entry/payroll_entry.py +260,Select interest income account in loan {0},選擇貸款{0}中的利息收入帳戶
+apps/erpnext/erpnext/hr/doctype/payroll_entry/payroll_entry.py +260,Select interest income account in loan {0},選擇貸款{0}中的利息收入科目
DocType: Opportunity,Contact Info,聯絡方式
apps/erpnext/erpnext/config/stock.py +322,Making Stock Entries,製作Stock條目
apps/erpnext/erpnext/hr/doctype/employee_promotion/employee_promotion.py +15,Cannot promote Employee with status Left,無法提升狀態為Left的員工
@@ -1681,10 +1681,10 @@
apps/erpnext/erpnext/buying/utils.py +74,Same item cannot be entered multiple times.,同一項目不能輸入多次。
apps/erpnext/erpnext/accounts/doctype/account/account_tree.js +30,"Further accounts can be made under Groups, but entries can be made against non-Groups",進一步帳戶可以根據組進行,但條目可針對非組進行
DocType: Lead,Lead,潛在客戶
-DocType: Email Digest,Payables,應付賬款
+DocType: Email Digest,Payables,應付帳款
DocType: Course,Course Intro,課程介紹
DocType: Amazon MWS Settings,MWS Auth Token,MWS Auth Token
-apps/erpnext/erpnext/stock/doctype/batch/batch.js +105,Stock Entry {0} created,股票輸入{0}創建
+apps/erpnext/erpnext/stock/doctype/batch/batch.js +105,Stock Entry {0} created,庫存輸入{0}創建
apps/erpnext/erpnext/accounts/doctype/loyalty_program/loyalty_program.py +110,You don't have enought Loyalty Points to redeem,您沒有獲得忠誠度積分兌換
apps/erpnext/erpnext/accounts/doctype/tax_withholding_category/tax_withholding_category.py +23,Please set associated account in Tax Withholding Category {0} against Company {1},請在針對公司{1}的預扣稅分類{0}中設置關聯帳戶
apps/erpnext/erpnext/controllers/buying_controller.py +405,Row #{0}: Rejected Qty can not be entered in Purchase Return,行#{0}:駁回採購退貨數量不能進入
@@ -1764,11 +1764,11 @@
DocType: Buying Settings,Maintain same rate throughout purchase cycle,在整個採購週期價格保持一致
DocType: Opportunity Item,Opportunity Item,項目的機會
,Student and Guardian Contact Details,學生和監護人聯繫方式
-apps/erpnext/erpnext/accounts/doctype/account/account.js +51,Merge Account,合併帳戶
+apps/erpnext/erpnext/accounts/doctype/account/account.js +51,Merge Account,合併科目
apps/erpnext/erpnext/buying/doctype/request_for_quotation/request_for_quotation.py +53,Row {0}: For supplier {0} Email Address is required to send email,行{0}:對於供應商{0}的電郵地址發送電子郵件
apps/erpnext/erpnext/accounts/doctype/account/chart_of_accounts/verified/standard_chart_of_accounts.py +76,Temporary Opening,臨時開通
,Employee Leave Balance,員工休假餘額
-apps/erpnext/erpnext/accounts/doctype/gl_entry/gl_entry.py +148,Balance for Account {0} must always be {1},帳戶{0}的餘額必須始終為{1}
+apps/erpnext/erpnext/accounts/doctype/gl_entry/gl_entry.py +148,Balance for Account {0} must always be {1},科目{0}的餘額必須始終為{1}
DocType: Patient Appointment,More Info,更多訊息
apps/erpnext/erpnext/stock/doctype/stock_reconciliation/stock_reconciliation.py +181,Valuation Rate required for Item in row {0},行對項目所需的估值速率{0}
DocType: Supplier Scorecard,Scorecard Actions,記分卡操作
@@ -1841,7 +1841,7 @@
apps/erpnext/erpnext/regional/report/eway_bill/eway_bill.py +176,From Party Name,來自黨名
DocType: Student Group Student,Group Roll Number,組卷編號
DocType: Student Group Student,Group Roll Number,組卷編號
-apps/erpnext/erpnext/accounts/doctype/journal_entry/journal_entry.py +177,"For {0}, only credit accounts can be linked against another debit entry",{0},只有貸方帳戶可以連接另一個借方分錄
+apps/erpnext/erpnext/accounts/doctype/journal_entry/journal_entry.py +177,"For {0}, only credit accounts can be linked against another debit entry",{0},只有貸方科目可以連接另一個借方分錄
apps/erpnext/erpnext/accounts/doctype/sales_invoice/sales_invoice.py +660,Delivery Note {0} is not submitted,送貨單{0}未提交
apps/erpnext/erpnext/stock/get_item_details.py +167,Item {0} must be a Sub-contracted Item,項{0}必須是一個小項目簽約
apps/erpnext/erpnext/accounts/doctype/account/chart_of_accounts/verified/standard_chart_of_accounts.py +44,Capital Equipments,資本設備
@@ -1856,7 +1856,7 @@
DocType: Sales Invoice Item,Edit Description,編輯說明
,Team Updates,團隊更新
apps/erpnext/erpnext/accounts/doctype/payment_order/payment_order.js +39,For Supplier,對供應商
-DocType: Account,Setting Account Type helps in selecting this Account in transactions.,設置帳戶類型有助於在交易中選擇該帳戶。
+DocType: Account,Setting Account Type helps in selecting this Account in transactions.,設置會計科目類型有助於在交易中選擇該科目。
DocType: Purchase Invoice,Grand Total (Company Currency),總計(公司貨幣)
apps/erpnext/erpnext/accounts/doctype/cheque_print_template/cheque_print_template.js +9,Create Print Format,創建打印格式
apps/erpnext/erpnext/education/doctype/fee_schedule/fee_schedule_list.js +5,Fee Created,創建費用
@@ -1914,7 +1914,7 @@
DocType: Appraisal Template Goal,Appraisal Template Goal,考核目標模板
DocType: Salary Component,Earning,盈利
DocType: Supplier Scorecard,Scoring Criteria,評分標準
-DocType: Purchase Invoice,Party Account Currency,黨的賬戶幣種
+DocType: Purchase Invoice,Party Account Currency,黨的科目幣種
DocType: Delivery Trip,Total Estimated Distance,總估計距離
,BOM Browser,BOM瀏覽器
apps/erpnext/erpnext/templates/emails/training_event.html +13,Please update your status for this training event,請更新此培訓活動的狀態
@@ -1929,7 +1929,7 @@
DocType: Maintenance Schedule Item,No of Visits,沒有訪問量的
apps/erpnext/erpnext/maintenance/doctype/maintenance_schedule/maintenance_schedule.py +165,Maintenance Schedule {0} exists against {1},針對{1}存在維護計劃{0}
apps/erpnext/erpnext/education/doctype/student_applicant/student_applicant.js +36,Enrolling student,招生學生
-apps/erpnext/erpnext/accounts/doctype/period_closing_voucher/period_closing_voucher.py +33,Currency of the Closing Account must be {0},在關閉帳戶的貨幣必須是{0}
+apps/erpnext/erpnext/accounts/doctype/period_closing_voucher/period_closing_voucher.py +33,Currency of the Closing Account must be {0},關閉科目的貨幣必須是{0}
apps/erpnext/erpnext/hr/doctype/appraisal_template/appraisal_template.py +21,Sum of points for all goals should be 100. It is {0},對所有目標點的總和應該是100。{0}
DocType: Project,Start and End Dates,開始和結束日期
DocType: Contract Template Fulfilment Terms,Contract Template Fulfilment Terms,合同模板履行條款
@@ -2027,7 +2027,7 @@
DocType: Journal Entry Account,Account Balance,帳戶餘額
apps/erpnext/erpnext/config/accounts.py +179,Tax Rule for transactions.,稅收規則進行的交易。
DocType: Rename Tool,Type of document to rename.,的文件類型進行重命名。
-apps/erpnext/erpnext/accounts/doctype/gl_entry/gl_entry.py +53,{0} {1}: Customer is required against Receivable account {2},{0} {1}:需要客戶對應收賬款{2}
+apps/erpnext/erpnext/accounts/doctype/gl_entry/gl_entry.py +53,{0} {1}: Customer is required against Receivable account {2},{0} {1}:需要客戶對應收帳款{2}
DocType: Purchase Invoice,Total Taxes and Charges (Company Currency),總稅費和費用(公司貨幣)
DocType: Weather,Weather Parameter,天氣參數
apps/erpnext/erpnext/accounts/report/trial_balance/trial_balance.js +76,Show unclosed fiscal year's P&L balances,顯示未關閉的會計年度的盈虧平衡
@@ -2036,8 +2036,8 @@
DocType: Clinical Procedure Template,Collection Details,收集細節
DocType: POS Profile,Allow Print Before Pay,付款前允許打印
DocType: Linked Soil Texture,Linked Soil Texture,連接的土壤紋理
-DocType: Shipping Rule,Shipping Account,送貨帳戶
-apps/erpnext/erpnext/accounts/doctype/gl_entry/gl_entry.py +93,{0} {1}: Account {2} is inactive,{0} {1}帳戶{2}無效
+DocType: Shipping Rule,Shipping Account,送貨科目
+apps/erpnext/erpnext/accounts/doctype/gl_entry/gl_entry.py +93,{0} {1}: Account {2} is inactive,{0} {1}科目{2}無效
apps/erpnext/erpnext/utilities/activation.py +82,Make Sales Orders to help you plan your work and deliver on-time,製作銷售訂單,以幫助你計劃你的工作和按時交付
DocType: Bank Statement Transaction Entry,Bank Transaction Entries,銀行交易分錄
DocType: Quality Inspection,Readings,閱讀
@@ -2130,7 +2130,7 @@
apps/erpnext/erpnext/config/non_profit.py +28,Memebership Details,Memebership細節
DocType: Leave Block List,Block Holidays on important days.,重要的日子中封鎖假期。
apps/erpnext/erpnext/healthcare/doctype/lab_test/lab_test.js +194,Please input all required Result Value(s),請輸入所有必需的結果值(s)
-apps/erpnext/erpnext/accounts/report/accounts_receivable/accounts_receivable.js +142,Accounts Receivable Summary,應收賬款匯總
+apps/erpnext/erpnext/accounts/report/accounts_receivable/accounts_receivable.js +142,Accounts Receivable Summary,應收帳款匯總
DocType: POS Closing Voucher,Linked Invoices,鏈接的發票
DocType: Loan,Monthly Repayment Amount,每月還款額
apps/erpnext/erpnext/accounts/doctype/opening_invoice_creation_tool/opening_invoice_creation_tool_dashboard.html +9,Opening Invoices,打開發票
@@ -2257,11 +2257,11 @@
DocType: Purchase Invoice,03-Deficiency in services,03-服務不足
DocType: Healthcare Settings,Default Medical Code Standard,默認醫療代碼標準
apps/erpnext/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py +267,Purchase Receipt {0} is not submitted,採購入庫單{0}未提交
-DocType: Company,Default Payable Account,預設應付賬款
+DocType: Company,Default Payable Account,預設應付帳款科目
apps/erpnext/erpnext/config/website.py +17,"Settings for online shopping cart such as shipping rules, price list etc.",設定線上購物車,如航運規則,價格表等
apps/erpnext/erpnext/controllers/website_list_for_contact.py +113,{0}% Billed,{0}%已開立帳單
apps/erpnext/erpnext/stock/report/stock_projected_qty/stock_projected_qty.py +73,Reserved Qty,保留數量
-DocType: Party Account,Party Account,黨的帳戶
+DocType: Party Account,Party Account,參與者科目
apps/erpnext/erpnext/hr/doctype/staffing_plan/staffing_plan.py +142,Please select Company and Designation,請選擇公司和指定
apps/erpnext/erpnext/config/setup.py +116,Human Resources,人力資源
apps/erpnext/erpnext/education/doctype/student_applicant/student_applicant.js +17,Reject,拒絕
@@ -2283,7 +2283,7 @@
apps/erpnext/erpnext/assets/doctype/asset/asset.py +492,Asset Movement record {0} created,資產運動記錄{0}創建
apps/erpnext/erpnext/utilities/page/leaderboard/leaderboard.js +175,No items found.,未找到任何項目。
apps/erpnext/erpnext/accounts/doctype/fiscal_year/fiscal_year.py +51,You cannot delete Fiscal Year {0}. Fiscal Year {0} is set as default in Global Settings,您不能刪除會計年度{0}。會計年度{0}設置為默認的全局設置
-DocType: Share Transfer,Equity/Liability Account,股票/負債賬戶
+DocType: Share Transfer,Equity/Liability Account,庫存/負債科目
apps/erpnext/erpnext/setup/doctype/customer_group/customer_group.py +20,A customer with the same name already exists,一個同名的客戶已經存在
DocType: Contract,Inactive,待用
apps/erpnext/erpnext/hr/doctype/payroll_entry/payroll_entry.js +224,This will submit Salary Slips and create accrual Journal Entry. Do you want to proceed?,這將提交工資單,並創建權責發生製日記賬分錄。你想繼續嗎?
@@ -2292,7 +2292,7 @@
DocType: Purchase Invoice,Eligibility For ITC,適用於ITC的資格
DocType: Journal Entry,Entry Type,條目類型
,Customer Credit Balance,客戶信用平衡
-apps/erpnext/erpnext/accounts/report/cash_flow/cash_flow.py +82,Net Change in Accounts Payable,應付賬款淨額變化
+apps/erpnext/erpnext/accounts/report/cash_flow/cash_flow.py +82,Net Change in Accounts Payable,應付帳款淨額變化
apps/erpnext/erpnext/selling/doctype/customer/customer.py +257,Credit limit has been crossed for customer {0} ({1}/{2}),客戶{0}({1} / {2})的信用額度已超過
apps/erpnext/erpnext/setup/doctype/authorization_rule/authorization_rule.py +42,Customer required for 'Customerwise Discount',需要' Customerwise折扣“客戶
apps/erpnext/erpnext/config/accounts.py +136,Update bank payment dates with journals.,更新與日記帳之銀行付款日期。
@@ -2313,7 +2313,7 @@
apps/erpnext/erpnext/maintenance/doctype/maintenance_visit/maintenance_visit.js +46,Warranty Claim,保修索賠
,Lead Details,潛在客戶詳情
DocType: Salary Slip,Loan repayment,償還借款
-DocType: Share Transfer,Asset Account,資產賬戶
+DocType: Share Transfer,Asset Account,資產科目
DocType: Purchase Invoice,End date of current invoice's period,當前發票的期限的最後一天
DocType: Pricing Rule,Applicable For,適用
DocType: Lab Test,Technician Name,技術員姓名
@@ -2347,7 +2347,7 @@
DocType: Employee,Salary Details,薪資明細
DocType: Territory,Territory Manager,區域經理
DocType: Packed Item,To Warehouse (Optional),倉庫(可選)
-DocType: GST Settings,GST Accounts,GST賬戶
+DocType: GST Settings,GST Accounts,GST科目
DocType: Payment Entry,Paid Amount (Company Currency),支付的金額(公司貨幣)
DocType: Purchase Invoice,Additional Discount,更多優惠
DocType: Selling Settings,Selling Settings,銷售設置
@@ -2382,12 +2382,12 @@
DocType: Vehicle,Doors,門
apps/erpnext/erpnext/setup/setup_wizard/operations/defaults_setup.py +118,ERPNext Setup Complete!,ERPNext設定完成!
DocType: Healthcare Settings,Collect Fee for Patient Registration,收取病人登記費
-apps/erpnext/erpnext/stock/doctype/item/item.py +737,Cannot change Attributes after stock transaction. Make a new Item and transfer stock to the new Item,股票交易後不能更改屬性。創建一個新項目並將庫存轉移到新項目
+apps/erpnext/erpnext/stock/doctype/item/item.py +737,Cannot change Attributes after stock transaction. Make a new Item and transfer stock to the new Item,庫存交易後不能更改屬性。創建一個新項目並將庫存轉移到新項目
DocType: Course Assessment Criteria,Weightage,權重
DocType: Purchase Invoice,Tax Breakup,稅收分解
DocType: Employee,Joining Details,加入詳情
DocType: Member,Non Profit Member,非盈利會員
-apps/erpnext/erpnext/accounts/doctype/gl_entry/gl_entry.py +67,{0} {1}: Cost Center is required for 'Profit and Loss' account {2}. Please set up a default Cost Center for the Company.,{0} {1}:需要的損益“賬戶成本中心{2}。請設置為公司默認的成本中心。
+apps/erpnext/erpnext/accounts/doctype/gl_entry/gl_entry.py +67,{0} {1}: Cost Center is required for 'Profit and Loss' account {2}. Please set up a default Cost Center for the Company.,{0} {1}:需要的損益“科目成本中心{2}。請設置為公司默認的成本中心。
apps/erpnext/erpnext/selling/doctype/customer/customer.py +175,A Customer Group exists with same name please change the Customer name or rename the Customer Group,客戶群組存在相同名稱,請更改客戶名稱或重新命名客戶群組
DocType: Location,Area,區
apps/erpnext/erpnext/public/js/templates/contact_list.html +37,New Contact,新建聯絡人
@@ -2474,11 +2474,11 @@
apps/erpnext/erpnext/accounts/doctype/cost_center/cost_center_tree.js +26,"Number of new Cost Center, it will be included in the cost center name as a prefix",新成本中心的數量,它將作為前綴包含在成本中心名稱中
DocType: Sales Order,To Deliver and Bill,準備交貨及開立發票
DocType: Student Group,Instructors,教師
-DocType: GL Entry,Credit Amount in Account Currency,在賬戶幣金額
+DocType: GL Entry,Credit Amount in Account Currency,在科目幣金額
apps/erpnext/erpnext/manufacturing/doctype/bom/bom.py +631,BOM {0} must be submitted,BOM {0}必須提交
DocType: Authorization Control,Authorization Control,授權控制
apps/erpnext/erpnext/controllers/buying_controller.py +416,Row #{0}: Rejected Warehouse is mandatory against rejected Item {1},行#{0}:拒絕倉庫是強制性的反對否決項{1}
-apps/erpnext/erpnext/controllers/stock_controller.py +96,"Warehouse {0} is not linked to any account, please mention the account in the warehouse record or set default inventory account in company {1}.",倉庫{0}未與任何帳戶關聯,請在倉庫記錄中提及該帳戶,或在公司{1}中設置默認庫存帳戶。
+apps/erpnext/erpnext/controllers/stock_controller.py +96,"Warehouse {0} is not linked to any account, please mention the account in the warehouse record or set default inventory account in company {1}.",倉庫{0}未與任何科目關聯,請在倉庫記錄中設定科目,或在公司{1}中設置默認庫存科目。
apps/erpnext/erpnext/utilities/activation.py +81,Manage your orders,管理您的訂單
DocType: Work Order Operation,Actual Time and Cost,實際時間和成本
apps/erpnext/erpnext/stock/doctype/material_request/material_request.py +57,Material Request of maximum {0} can be made for Item {1} against Sales Order {2},針對銷售訂單{2}的項目{1},最多可以有 {0} 被完成。
@@ -2514,14 +2514,14 @@
apps/erpnext/erpnext/assets/doctype/asset/asset.py +98,Available-for-use Date should be after purchase date,可供使用的日期應在購買日期之後
DocType: Vehicle,Wheels,車輪
DocType: Packing Slip,To Package No.,以包號
-DocType: Sales Invoice Item,Deferred Revenue Account,遞延收入帳戶
+DocType: Sales Invoice Item,Deferred Revenue Account,遞延收入科目
DocType: Production Plan,Material Requests,材料要求
DocType: Warranty Claim,Issue Date,發行日期
DocType: Activity Cost,Activity Cost,項目成本
DocType: Sales Invoice Timesheet,Timesheet Detail,詳細時間表
DocType: Purchase Receipt Item Supplied,Consumed Qty,消耗的數量
apps/erpnext/erpnext/setup/setup_wizard/data/industry_type.py +52,Telecommunications,電信
-apps/erpnext/erpnext/accounts/party.py +292,Billing currency must be equal to either default company's currency or party account currency,帳單貨幣必須等於默認公司的貨幣或帳戶幣種
+apps/erpnext/erpnext/accounts/party.py +292,Billing currency must be equal to either default company's currency or party account currency,帳單貨幣必須等於默認公司的貨幣或科目幣種
DocType: Packing Slip,Indicates that the package is a part of this delivery (Only Draft),表示該包是這個交付的一部分(僅草案)
apps/erpnext/erpnext/controllers/accounts_controller.py +786,Row {0}: Due Date cannot be before posting date,行{0}:到期日期不能在發布日期之前
apps/erpnext/erpnext/accounts/doctype/payment_request/payment_request.js +37,Make Payment Entry,製作付款分錄
@@ -2535,7 +2535,7 @@
apps/erpnext/erpnext/regional/report/eway_bill/eway_bill.py +151,Sub Type,子類型
DocType: Serial No,Delivery Document No,交貨證明文件號碼
DocType: Sales Order Item,Ensure Delivery Based on Produced Serial No,確保基於生產的序列號的交貨
-apps/erpnext/erpnext/assets/doctype/asset/depreciation.py +197,Please set 'Gain/Loss Account on Asset Disposal' in Company {0},請公司制定“關於資產處置收益/損失帳戶”{0}
+apps/erpnext/erpnext/assets/doctype/asset/depreciation.py +197,Please set 'Gain/Loss Account on Asset Disposal' in Company {0},請公司制定“關於資產處置收益/損失科目”{0}
DocType: Landed Cost Voucher,Get Items From Purchase Receipts,從採購入庫單取得項目
DocType: Serial No,Creation Date,創建日期
apps/erpnext/erpnext/assets/doctype/asset_movement/asset_movement.py +55,Target Location is required for the asset {0},目標位置是資產{0}所必需的
@@ -2569,7 +2569,7 @@
DocType: Budget,Budget,預算
apps/erpnext/erpnext/healthcare/doctype/patient_appointment/patient_appointment.js +83,Set Open,設置打開
apps/erpnext/erpnext/stock/doctype/item/item.py +287,Fixed Asset Item must be a non-stock item.,固定資產項目必須是一個非庫存項目。
-apps/erpnext/erpnext/accounts/doctype/budget/budget.py +60,"Budget cannot be assigned against {0}, as it's not an Income or Expense account",財政預算案不能對{0}指定的,因為它不是一個收入或支出帳戶
+apps/erpnext/erpnext/accounts/doctype/budget/budget.py +60,"Budget cannot be assigned against {0}, as it's not an Income or Expense account",財政預算案不能對{0}指定的,因為它不是一個收入或支出科目
apps/erpnext/erpnext/hr/utils.py +228,Max exemption amount for {0} is {1},{0}的最大免除金額為{1}
apps/erpnext/erpnext/selling/report/sales_person_target_variance_item_group_wise/sales_person_target_variance_item_group_wise.py +51,Achieved,已實現
DocType: Student Admission,Application Form Route,申請表路線
@@ -2644,15 +2644,15 @@
DocType: Task,Expected Time (in hours),預期時間(以小時計)
DocType: Item Reorder,Check in (group),檢查(組)
,Qty to Order,訂購數量
-DocType: Period Closing Voucher,"The account head under Liability or Equity, in which Profit/Loss will be booked",負債或權益下的帳戶頭,其中利潤/虧損將被黃牌警告
-apps/erpnext/erpnext/accounts/doctype/budget/budget.py +44,Another Budget record '{0}' already exists against {1} '{2}' and account '{3}' for fiscal year {4},對於財務年度{4},{1}'{2}'和帳戶“{3}”已存在另一個預算記錄“{0}”
+DocType: Period Closing Voucher,"The account head under Liability or Equity, in which Profit/Loss will be booked",負債或權益下的科目頭,其中利潤/虧損將被黃牌警告
+apps/erpnext/erpnext/accounts/doctype/budget/budget.py +44,Another Budget record '{0}' already exists against {1} '{2}' and account '{3}' for fiscal year {4},對於財務年度{4},{1}'{2}'和科目“{3}”已存在另一個預算記錄“{0}”
apps/erpnext/erpnext/config/projects.py +36,Gantt chart of all tasks.,所有任務的甘特圖。
DocType: Opportunity,Mins to First Response,分鐘為第一個反應
DocType: Pricing Rule,Margin Type,保證金類型
apps/erpnext/erpnext/projects/doctype/project/project_dashboard.html +15,{0} hours,{0}小時
DocType: Course,Default Grading Scale,默認等級規模
DocType: Appraisal,For Employee Name,對於員工姓名
-DocType: Woocommerce Settings,Tax Account,稅收帳戶
+DocType: Woocommerce Settings,Tax Account,稅收科目
DocType: C-Form Invoice Detail,Invoice No,發票號碼
DocType: Room,Room Name,房間名稱
DocType: Prescription Duration,Prescription Duration,處方時間
@@ -2704,7 +2704,7 @@
,Quotation Trends,報價趨勢
apps/erpnext/erpnext/accounts/doctype/pricing_rule/pricing_rule.py +166,Item Group not mentioned in item master for item {0},項目{0}之項目主檔未提及之項目群組
DocType: GoCardless Mandate,GoCardless Mandate,GoCardless任務
-apps/erpnext/erpnext/accounts/doctype/sales_invoice/sales_invoice.py +440,Debit To account must be a Receivable account,借方帳戶必須是應收帳款帳戶
+apps/erpnext/erpnext/accounts/doctype/sales_invoice/sales_invoice.py +440,Debit To account must be a Receivable account,借方科目必須是應收帳款科目
DocType: Shipping Rule,Shipping Amount,航運量
DocType: Supplier Scorecard Period,Period Score,期間得分
apps/erpnext/erpnext/public/js/event.js +19,Add Customers,添加客戶
@@ -2777,7 +2777,7 @@
apps/erpnext/erpnext/projects/doctype/task/task.js +45,Expense Claims,報銷
DocType: Employee Tax Exemption Declaration,Total Exemption Amount,免稅總額
,BOM Search,BOM搜索
-DocType: Project,Total Consumed Material Cost (via Stock Entry),總消耗材料成本(通過股票輸入)
+DocType: Project,Total Consumed Material Cost (via Stock Entry),總消耗材料成本(通過庫存輸入)
DocType: Subscription,Subscription Period,訂閱期
apps/erpnext/erpnext/hr/doctype/leave_application/leave_application.js +169,To Date cannot be less than From Date,迄今不能少於起始日期
DocType: Item,"Publish ""In Stock"" or ""Not in Stock"" on Hub based on stock available in this warehouse.",基於倉庫中的庫存,在Hub上發布“庫存”或“庫存”。
@@ -2786,7 +2786,7 @@
DocType: Workstation,Wages per hour,時薪
apps/erpnext/erpnext/stock/doctype/stock_ledger_entry/stock_ledger_entry.py +47,Stock balance in Batch {0} will become negative {1} for Item {2} at Warehouse {3},在批量庫存餘額{0}將成為負{1}的在倉庫項目{2} {3}
apps/erpnext/erpnext/templates/emails/reorder_item.html +1,Following Material Requests have been raised automatically based on Item's re-order level,下列資料的要求已自動根據項目的重新排序水平的提高
-apps/erpnext/erpnext/controllers/accounts_controller.py +376,Account {0} is invalid. Account Currency must be {1},帳戶{0}是無效的。帳戶貨幣必須是{1}
+apps/erpnext/erpnext/controllers/accounts_controller.py +376,Account {0} is invalid. Account Currency must be {1},科目{0}是無效的。科目貨幣必須是{1}
apps/erpnext/erpnext/hr/doctype/salary_structure_assignment/salary_structure_assignment.py +31,From Date {0} cannot be after employee's relieving Date {1},起始日期{0}不能在員工解除日期之後{1}
DocType: Supplier,Is Internal Supplier,是內部供應商
DocType: Employee,Create User Permission,創建用戶權限
@@ -2813,7 +2813,7 @@
apps/erpnext/erpnext/accounts/doctype/sales_invoice/sales_invoice.js +970,Quotation,報價
apps/erpnext/erpnext/buying/doctype/request_for_quotation/request_for_quotation.js +1041,Cannot set a received RFQ to No Quote,無法將收到的詢價單設置為無報價
DocType: Salary Slip,Total Deduction,扣除總額
-apps/erpnext/erpnext/accounts/report/general_ledger/general_ledger.py +22,Select an account to print in account currency,選擇一個賬戶以賬戶貨幣進行打印
+apps/erpnext/erpnext/accounts/report/general_ledger/general_ledger.py +22,Select an account to print in account currency,選擇一個科目以科目貨幣進行打印
,Production Analytics,生產Analytics(分析)
apps/erpnext/erpnext/healthcare/doctype/patient/patient_dashboard.py +6,This is based on transactions against this Patient. See timeline below for details,這是基於對這個病人的交易。有關詳情,請參閱下面的時間表
apps/erpnext/erpnext/controllers/sales_and_purchase_return.py +136,Item {0} has already been returned,項{0}已被退回
@@ -2852,7 +2852,7 @@
apps/erpnext/erpnext/stock/doctype/serial_no/serial_no.py +243,Serial No {0} does not belong to any Warehouse,序列號{0}不屬於任何倉庫
DocType: Grant Application,Email Notification Sent,電子郵件通知已發送
DocType: Purchase Invoice,In Words (Company Currency),大寫(Company Currency)
-apps/erpnext/erpnext/accounts/doctype/bank_account/bank_account.py +24,Company is manadatory for company account,公司是公司賬戶的管理者
+apps/erpnext/erpnext/accounts/doctype/bank_account/bank_account.py +24,Company is manadatory for company account,公司是公司科目的管理者
apps/erpnext/erpnext/buying/doctype/purchase_order/purchase_order.js +1092,"Item Code, warehouse, quantity are required on row",在行上需要項目代碼,倉庫,數量
DocType: Bank Guarantee,Supplier,供應商
apps/erpnext/erpnext/hr/doctype/department/department.js +9,This is a root department and cannot be edited.,這是根部門,無法編輯。
@@ -2861,7 +2861,7 @@
apps/erpnext/erpnext/accounts/doctype/account/chart_of_accounts/verified/standard_chart_of_accounts.py +113,Miscellaneous Expenses,雜項開支
DocType: Global Defaults,Default Company,預設公司
DocType: Company,Transactions Annual History,交易年曆
-apps/erpnext/erpnext/controllers/stock_controller.py +231,Expense or Difference account is mandatory for Item {0} as it impacts overall stock value,對項目{0}而言, 費用或差異帳戶是強制必填的,因為它影響整個庫存總值。
+apps/erpnext/erpnext/controllers/stock_controller.py +231,Expense or Difference account is mandatory for Item {0} as it impacts overall stock value,對項目{0}而言, 費用或差異科目是強制必填的,因為它影響整個庫存總值。
DocType: Bank,Bank Name,銀行名稱
apps/erpnext/erpnext/accounts/report/accounts_receivable_summary/accounts_receivable_summary.py +78,-Above,-以上
apps/erpnext/erpnext/selling/doctype/sales_order/sales_order.js +1301,Leave the field empty to make purchase orders for all suppliers,將該字段留空以為所有供應商下達採購訂單
@@ -2891,7 +2891,7 @@
apps/erpnext/erpnext/accounts/doctype/budget/budget.py +77,Please enable Applicable on Purchase Order and Applicable on Booking Actual Expenses,請啟用適用於採購訂單並適用於預訂實際費用
apps/erpnext/erpnext/templates/includes/product_page.js +101,Cannot find a matching Item. Please select some other value for {0}.,無法找到匹配的項目。請選擇其他值{0}。
DocType: POS Profile,Taxes and Charges,稅收和收費
-DocType: Item,"A Product or a Service that is bought, sold or kept in stock.",產品或服務已購買,出售或持有的股票。
+DocType: Item,"A Product or a Service that is bought, sold or kept in stock.",產品或服務已購買,出售或持有的庫存。
apps/erpnext/erpnext/hr/page/team_updates/team_updates.js +44,No more updates,沒有更多的更新
apps/erpnext/erpnext/accounts/doctype/payment_entry/payment_entry.js +184,Cannot select charge type as 'On Previous Row Amount' or 'On Previous Row Total' for first row,不能選擇充電式為'在上一行量'或'在上一行總'的第一行
apps/erpnext/erpnext/buying/doctype/supplier_scorecard/supplier_scorecard_dashboard.py +6,This covers all scorecards tied to this Setup,這涵蓋了與此安裝程序相關的所有記分卡
@@ -2929,7 +2929,7 @@
apps/erpnext/erpnext/education/doctype/student_group_creation_tool/student_group_creation_tool.py +77,{0} Student Groups created.,{0}創建學生組。
DocType: Sales Invoice,Total Billing Amount,總結算金額
apps/erpnext/erpnext/education/doctype/fee_schedule/fee_schedule.py +50,Program in the Fee Structure and Student Group {0} are different.,費用結構和學生組{0}中的課程是不同的。
-DocType: Bank Statement Transaction Entry,Receivable Account,應收賬款
+DocType: Bank Statement Transaction Entry,Receivable Account,應收帳款
apps/erpnext/erpnext/stock/doctype/item_price/item_price.py +31,Valid From Date must be lesser than Valid Upto Date.,有效起始日期必須小於有效起始日期。
apps/erpnext/erpnext/controllers/accounts_controller.py +689,Row #{0}: Asset {1} is already {2},行#{0}:資產{1}已經是{2}
DocType: Quotation Item,Stock Balance,庫存餘額
@@ -2939,13 +2939,13 @@
DocType: Purchase Invoice,TRIPLICATE FOR SUPPLIER,供應商提供服務
DocType: Exchange Rate Revaluation Account,New Balance In Base Currency,基礎貨幣的新平衡
DocType: Crop Cycle,This will be day 1 of the crop cycle,這將是作物週期的第一天
-apps/erpnext/erpnext/accounts/doctype/journal_entry/journal_entry.py +915,Please select correct account,請選擇正確的帳戶
+apps/erpnext/erpnext/accounts/doctype/journal_entry/journal_entry.py +915,Please select correct account,請選擇正確的科目
DocType: Salary Structure Assignment,Salary Structure Assignment,薪酬結構分配
DocType: Purchase Invoice Item,Weight UOM,重量計量單位
apps/erpnext/erpnext/config/accounts.py +435,List of available Shareholders with folio numbers,包含folio號碼的可用股東名單
DocType: Salary Structure Employee,Salary Structure Employee,薪資結構員工
apps/erpnext/erpnext/stock/report/stock_balance/stock_balance.js +62,Show Variant Attributes,顯示變體屬性
-apps/erpnext/erpnext/accounts/doctype/payment_request/payment_request.py +48,The payment gateway account in plan {0} is different from the payment gateway account in this payment request,計劃{0}中的支付網關帳戶與此付款請求中的支付網關帳戶不同
+apps/erpnext/erpnext/accounts/doctype/payment_request/payment_request.py +48,The payment gateway account in plan {0} is different from the payment gateway account in this payment request,計劃{0}中的支付閘道科目與此付款請求中的支付閘道科目不同
DocType: Course,Course Name,課程名
apps/erpnext/erpnext/accounts/doctype/tax_withholding_category/tax_withholding_category.py +50,No Tax Withholding data found for the current Fiscal Year.,未找到當前財年的預扣稅數據。
DocType: Employee Leave Approver,Users who can approve a specific employee's leave applications,用戶可以批准特定員工的休假申請
@@ -2989,14 +2989,14 @@
DocType: Cashier Closing,To Time,要時間
apps/erpnext/erpnext/hr/utils.py +202,) for {0},)為{0}
DocType: Authorization Rule,Approving Role (above authorized value),批准角色(上述授權值)
-apps/erpnext/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py +147,Credit To account must be a Payable account,信用帳戶必須是應付賬款
+apps/erpnext/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py +147,Credit To account must be a Payable account,信用科目必須是應付帳款
DocType: Loan,Total Amount Paid,總金額支付
DocType: Asset,Insurance End Date,保險終止日期
apps/erpnext/erpnext/education/doctype/student_applicant/student_applicant.py +43,Please select Student Admission which is mandatory for the paid student applicant,請選擇付費學生申請者必須入學的學生
apps/erpnext/erpnext/manufacturing/doctype/bom/bom.py +370,BOM recursion: {0} cannot be parent or child of {2},BOM遞歸: {0}不能父母或兒童{2}
apps/erpnext/erpnext/accounts/doctype/cost_center/cost_center_tree.js +40,Budget List,預算清單
DocType: Work Order Operation,Completed Qty,完成數量
-apps/erpnext/erpnext/accounts/doctype/journal_entry/journal_entry.py +180,"For {0}, only debit accounts can be linked against another credit entry",{0},只有借方帳戶可以連接另一個貸方分錄
+apps/erpnext/erpnext/accounts/doctype/journal_entry/journal_entry.py +180,"For {0}, only debit accounts can be linked against another credit entry",{0},只有借方科目可以連接另一個貸方分錄
DocType: Manufacturing Settings,Allow Overtime,允許加班
apps/erpnext/erpnext/stock/doctype/stock_reconciliation/stock_reconciliation.py +149,"Serialized Item {0} cannot be updated using Stock Reconciliation, please use Stock Entry",序列化項目{0}無法使用庫存調節更新,請使用庫存條目
apps/erpnext/erpnext/stock/doctype/stock_reconciliation/stock_reconciliation.py +149,"Serialized Item {0} cannot be updated using Stock Reconciliation, please use Stock Entry",序列化項目{0}無法使用庫存調節更新,請使用庫存條目
@@ -3010,7 +3010,7 @@
apps/erpnext/erpnext/accounts/doctype/account/chart_of_accounts/verified/standard_chart_of_accounts.py +129,Exchange Gain/Loss,兌換收益/損失
DocType: Opportunity,Lost Reason,失落的原因
DocType: Amazon MWS Settings,Enable Amazon,啟用亞馬遜
-apps/erpnext/erpnext/controllers/accounts_controller.py +322,Row #{0}: Account {1} does not belong to company {2},行#{0}:帳戶{1}不屬於公司{2}
+apps/erpnext/erpnext/controllers/accounts_controller.py +322,Row #{0}: Account {1} does not belong to company {2},行#{0}:科目{1}不屬於公司{2}
apps/erpnext/erpnext/setup/doctype/naming_series/naming_series.py +30,Unable to find DocType {0},無法找到DocType {0}
DocType: Quality Inspection,Sample Size,樣本大小
apps/erpnext/erpnext/stock/doctype/landed_cost_voucher/landed_cost_voucher.py +47,Please enter Receipt Document,請輸入收據憑證
@@ -3056,7 +3056,7 @@
DocType: Student Admission Program,Application Fee,報名費
apps/erpnext/erpnext/hr/doctype/payroll_entry/payroll_entry.js +75,Submit Salary Slip,提交工資單
apps/erpnext/erpnext/accounts/doctype/purchase_invoice/purchase_invoice_list.js +13,On Hold,等候接聽
-DocType: Account,Inter Company Account,Inter公司帳戶
+DocType: Account,Inter Company Account,公司內帳戶
apps/erpnext/erpnext/stock/doctype/item_price/item_price.js +17,Import in Bulk,進口散裝
DocType: Sales Partner,Address & Contacts,地址及聯絡方式
DocType: SMS Log,Sender Name,發件人名稱
@@ -3108,7 +3108,7 @@
DocType: Travel Request,Any other details,任何其他細節
apps/erpnext/erpnext/controllers/status_updater.py +207,This document is over limit by {0} {1} for item {4}. Are you making another {3} against the same {2}?,這份文件是超過限制,通過{0} {1}項{4}。你在做另一個{3}對同一{2}?
apps/erpnext/erpnext/public/js/controllers/transaction.js +1288,Please set recurring after saving,請設置保存後復發
-apps/erpnext/erpnext/accounts/doctype/sales_invoice/sales_invoice.py +874,Select change amount account,選擇變化量賬戶
+apps/erpnext/erpnext/accounts/doctype/sales_invoice/sales_invoice.py +874,Select change amount account,選擇變化量科目
DocType: Purchase Invoice,Price List Currency,價格表之貨幣
DocType: Naming Series,User must always select,用戶必須始終選擇
DocType: Stock Settings,Allow Negative Stock,允許負庫存
@@ -3148,7 +3148,7 @@
apps/erpnext/erpnext/healthcare/doctype/patient_appointment/patient_appointment.js +391,Are you sure you want to cancel this appointment?,你確定要取消這個預約嗎?
DocType: Hotel Room Pricing Package,Hotel Room Pricing Package,酒店房間價格套餐
apps/erpnext/erpnext/selling/page/sales_funnel/sales_funnel.js +42,Sales Pipeline,銷售渠道
-apps/erpnext/erpnext/hr/doctype/payroll_entry/payroll_entry.py +167,Please set default account in Salary Component {0},請薪酬部分設置默認帳戶{0}
+apps/erpnext/erpnext/hr/doctype/payroll_entry/payroll_entry.py +167,Please set default account in Salary Component {0},請薪酬部分設置默認科目{0}
apps/erpnext/erpnext/manufacturing/doctype/production_planning_tool/production_planning_tool.py +200,Please select BOM for Item in Row {0},請行選擇BOM為項目{0}
apps/erpnext/erpnext/accounts/doctype/subscription/subscription.js +13,Fetch Subscription Updates,獲取訂閱更新
apps/erpnext/erpnext/accounts/doctype/mode_of_payment/mode_of_payment.py +28,Account {0} does not match with Company {1} in Mode of Account: {2},帳戶{0}與帳戶模式{2}中的公司{1}不符
@@ -3183,7 +3183,7 @@
apps/erpnext/erpnext/accounts/doctype/sales_invoice/sales_invoice.js +1556,Prescriptions,處方
DocType: Payment Gateway Account,Payment Account,付款帳號
apps/erpnext/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.js +1112,Please specify Company to proceed,請註明公司以處理
-apps/erpnext/erpnext/accounts/report/cash_flow/cash_flow.py +81,Net Change in Accounts Receivable,應收賬款淨額變化
+apps/erpnext/erpnext/accounts/report/cash_flow/cash_flow.py +81,Net Change in Accounts Receivable,應收帳款淨額變化
apps/erpnext/erpnext/setup/setup_wizard/operations/install_fixtures.py +66,Compensatory Off,補假
DocType: Job Offer,Accepted,接受的
DocType: POS Closing Voucher,Sales Invoices Summary,銷售發票摘要
@@ -3225,7 +3225,7 @@
DocType: Item Price,Packing Unit,包裝單位
DocType: Subscription,Trialling,試用
DocType: Sales Invoice Item,Deferred Revenue,遞延收入
-DocType: Shopify Settings,Cash Account will used for Sales Invoice creation,現金帳戶將用於創建銷售發票
+DocType: Shopify Settings,Cash Account will used for Sales Invoice creation,現金科目將用於創建銷售發票
DocType: Employee Tax Exemption Declaration Category,Exemption Sub Category,豁免子類別
DocType: Member,Membership Expiry Date,會員到期日
apps/erpnext/erpnext/controllers/sales_and_purchase_return.py +134,{0} must be negative in return document,{0}必須返回文檔中負
@@ -3355,17 +3355,17 @@
DocType: BOM Item,Original Item,原始項目
DocType: Purchase Receipt Item,Recd Quantity,到貨數量
apps/erpnext/erpnext/education/doctype/program_enrollment/program_enrollment.py +64,Fee Records Created - {0},費紀錄創造 - {0}
-DocType: Asset Category Account,Asset Category Account,資產類別的帳戶
+DocType: Asset Category Account,Asset Category Account,資產類別的科目
apps/erpnext/erpnext/accounts/doctype/sales_invoice/sales_invoice.py +1024,Row #{0} (Payment Table): Amount must be positive,行#{0}(付款表):金額必須為正值
apps/erpnext/erpnext/manufacturing/doctype/production_order/production_order.py +137,Cannot produce more Item {0} than Sales Order quantity {1},無法產生更多的項目{0}不是銷售訂單數量{1}
apps/erpnext/erpnext/stock/doctype/item/item.js +446,Select Attribute Values,選擇屬性值
DocType: Purchase Invoice,Reason For Issuing document,簽發文件的原因
-apps/erpnext/erpnext/accounts/doctype/journal_entry/journal_entry.py +583,Stock Entry {0} is not submitted,股票輸入{0}不提交
-DocType: Payment Reconciliation,Bank / Cash Account,銀行/現金帳戶
+apps/erpnext/erpnext/accounts/doctype/journal_entry/journal_entry.py +583,Stock Entry {0} is not submitted,庫存輸入{0}不提交
+DocType: Payment Reconciliation,Bank / Cash Account,銀行/現金科目
apps/erpnext/erpnext/crm/doctype/lead/lead.py +47,Next Contact By cannot be same as the Lead Email Address,接著聯繫到不能相同鉛郵箱地址
DocType: Tax Rule,Billing City,結算城市
DocType: Asset,Manual,手冊
-DocType: Salary Component Account,Salary Component Account,薪金部分賬戶
+DocType: Salary Component Account,Salary Component Account,薪金部分科目
DocType: Global Defaults,Hide Currency Symbol,隱藏貨幣符號
apps/erpnext/erpnext/selling/page/sales_funnel/sales_funnel.js +281,Sales Opportunities by Source,來源的銷售機會
apps/erpnext/erpnext/config/accounts.py +287,"e.g. Bank, Cash, Credit Card",例如:銀行,現金,信用卡
@@ -3449,7 +3449,7 @@
DocType: Stock Entry Detail,Serial No / Batch,序列號/批次
apps/erpnext/erpnext/selling/doctype/sales_order/sales_order.py +359,Not Paid and Not Delivered,沒有支付,未送達
DocType: Product Bundle,Parent Item,父項目
-DocType: Account,Account Type,帳戶類型
+DocType: Account,Account Type,科目類型
DocType: Shopify Settings,Webhooks Details,Webhooks詳細信息
apps/erpnext/erpnext/templates/pages/projects.html +58,No time sheets,沒有考勤表
DocType: GoCardless Mandate,GoCardless Customer,GoCardless客戶
@@ -3476,7 +3476,7 @@
apps/erpnext/erpnext/assets/doctype/asset_movement/asset_movement.py +32,Serial no is required for the asset {0},資產{0}需要序列號
apps/erpnext/erpnext/accounts/doctype/sales_taxes_and_charges_template/sales_taxes_and_charges_template.py +43,Disabled template must not be default template,殘疾人模板必須不能默認模板
apps/erpnext/erpnext/manufacturing/doctype/production_plan/production_plan.py +542,For row {0}: Enter planned qty,對於行{0}:輸入計劃的數量
-DocType: Account,Income Account,收入帳戶
+DocType: Account,Income Account,收入科目
DocType: Payment Request,Amount in customer's currency,量客戶的貨幣
apps/erpnext/erpnext/accounts/doctype/sales_invoice/sales_invoice.js +880,Delivery,交貨
DocType: Stock Reconciliation Item,Current Qty,目前數量
@@ -3488,7 +3488,7 @@
DocType: Delivery Trip,Distance UOM,距離UOM
apps/erpnext/erpnext/utilities/activation.py +127,"Student Batches help you track attendance, assessments and fees for students",學生批幫助您跟踪學生的出勤,評估和費用
DocType: Payment Entry,Total Allocated Amount,總撥款額
-apps/erpnext/erpnext/setup/doctype/company/company.py +163,Set default inventory account for perpetual inventory,設置永久庫存的默認庫存帳戶
+apps/erpnext/erpnext/setup/doctype/company/company.py +163,Set default inventory account for perpetual inventory,設置永久庫存的默認庫存科目
apps/erpnext/erpnext/stock/doctype/serial_no/serial_no.py +261,"Cannot deliver Serial No {0} of item {1} as it is reserved to \
fullfill Sales Order {2}",無法提供項目{1}的序列號{0},因為它保留在\ fullfill銷售訂單{2}中
DocType: Item Reorder,Material Request Type,材料需求類型
@@ -3532,7 +3532,7 @@
apps/erpnext/erpnext/accounts/doctype/account/chart_of_accounts/verified/standard_chart_of_accounts.py +130,Gain/Loss on Asset Disposal,在資產處置收益/損失
apps/erpnext/erpnext/education/doctype/program_enrollment_tool/program_enrollment_tool.js +24,"Only the Student Applicant with the status ""Approved"" will be selected in the table below.",下表中將只選擇狀態為“已批准”的學生申請人。
DocType: Tax Withholding Category,Rates,價格
-apps/erpnext/erpnext/regional/report/fichier_des_ecritures_comptables_[fec]/fichier_des_ecritures_comptables_[fec].py +121,Account number for account {0} is not available.<br> Please setup your Chart of Accounts correctly.,帳戶{0}的帳戶號碼不可用。 <br>請正確設置您的會計科目表。
+apps/erpnext/erpnext/regional/report/fichier_des_ecritures_comptables_[fec]/fichier_des_ecritures_comptables_[fec].py +121,Account number for account {0} is not available.<br> Please setup your Chart of Accounts correctly.,科目{0}的科目號碼不可用。 <br>請正確設置您的會計科目表。
DocType: Task,Depends on Tasks,取決於任務
apps/erpnext/erpnext/config/selling.py +36,Manage Customer Group Tree.,管理客戶群組樹。
DocType: Normal Test Items,Result Value,結果值
@@ -3657,7 +3657,7 @@
DocType: Issue,Issue Type,發行類型
DocType: Attendance,Leave Type,休假類型
DocType: Purchase Invoice,Supplier Invoice Details,供應商發票明細
-apps/erpnext/erpnext/controllers/stock_controller.py +237,Expense / Difference account ({0}) must be a 'Profit or Loss' account,費用/差異帳戶({0})必須是一個'溢利或虧損的帳戶
+apps/erpnext/erpnext/controllers/stock_controller.py +237,Expense / Difference account ({0}) must be a 'Profit or Loss' account,費用/差異科目({0})必須是一個'收益或損失'的科目
DocType: Project,Copied From,複製自
DocType: Project,Copied From,複製自
apps/erpnext/erpnext/projects/doctype/timesheet/timesheet.py +265,Invoice already created for all billing hours,發票已在所有結算時間創建
@@ -3701,7 +3701,7 @@
DocType: Amazon MWS Settings,Click this button to pull your Sales Order data from Amazon MWS.,單擊此按鈕可從亞馬遜MWS中提取銷售訂單數據。
DocType: Purchase Invoice,Overdue,過期的
DocType: Account,Stock Received But Not Billed,庫存接收,但不付款
-apps/erpnext/erpnext/accounts/doctype/account/account.py +91,Root Account must be a group,根帳戶必須是一組
+apps/erpnext/erpnext/accounts/doctype/account/account.py +91,Root Account must be a group,Root 科目必須是群組科目
DocType: Drug Prescription,Drug Prescription,藥物處方
DocType: Loan,Repaid/Closed,償還/關閉
DocType: Item,Total Projected Qty,預計總數量
@@ -3737,7 +3737,7 @@
DocType: Sales Invoice,Customer Address,客戶地址
DocType: Loan,Loan Details,貸款詳情
apps/erpnext/erpnext/setup/setup_wizard/setup_wizard.py +62,Failed to setup post company fixtures,未能設置公司固定裝置
-DocType: Company,Default Inventory Account,默認庫存帳戶
+DocType: Company,Default Inventory Account,默認庫存科目
apps/erpnext/erpnext/accounts/doctype/share_transfer/share_transfer.py +193,The folio numbers are not matching,作品集編號不匹配
apps/erpnext/erpnext/accounts/doctype/payment_request/payment_request.py +304,Payment Request for {0},付款申請{0}
DocType: Item Barcode,Barcode Type,條碼類型
@@ -3786,7 +3786,7 @@
apps/erpnext/erpnext/utilities/user_progress.py +47,Set a Target,設定目標
DocType: Dosage Strength,Dosage Strength,劑量強度
DocType: Healthcare Practitioner,Inpatient Visit Charge,住院訪問費用
-DocType: Account,Expense Account,費用帳戶
+DocType: Account,Expense Account,費用科目
apps/erpnext/erpnext/setup/setup_wizard/data/industry_type.py +49,Software,軟件
apps/erpnext/erpnext/setup/setup_wizard/operations/install_fixtures.py +155,Colour,顏色
DocType: Assessment Plan Criteria,Assessment Plan Criteria,評估計劃標準
@@ -3860,7 +3860,7 @@
DocType: Sales Invoice,Time Sheet List,時間表列表
DocType: Employee,You can enter any date manually,您可以手動輸入任何日期
DocType: Healthcare Settings,Result Printed,結果打印
-DocType: Asset Category Account,Depreciation Expense Account,折舊費用帳戶
+DocType: Asset Category Account,Depreciation Expense Account,折舊費用科目
apps/erpnext/erpnext/setup/setup_wizard/operations/install_fixtures.py +191,Probationary Period,試用期
DocType: Purchase Taxes and Charges Template,Is Inter State,是國際
apps/erpnext/erpnext/config/hr.py +269,Shift Management,班次管理
@@ -3900,7 +3900,7 @@
apps/erpnext/erpnext/support/page/support_analytics/support_analytics.js +30,Select Fiscal Year,選擇財政年度
apps/erpnext/erpnext/selling/doctype/sales_order/sales_order.py +119,Expected Delivery Date should be after Sales Order Date,預計交貨日期應在銷售訂單日期之後
apps/erpnext/erpnext/stock/report/itemwise_recommended_reorder_level/itemwise_recommended_reorder_level.py +43,Reorder Level,重新排序級別
-DocType: Company,Chart Of Accounts Template,圖表帳戶模板
+DocType: Company,Chart Of Accounts Template,會計科目模板
apps/erpnext/erpnext/assets/doctype/asset/asset.py +80,Update stock must be enable for the purchase invoice {0},必須為購買發票{0}啟用更新庫存
apps/erpnext/erpnext/stock/get_item_details.py +405,Item Price updated for {0} in Price List {1},項目價格更新{0}價格表{1}
DocType: Salary Structure,Salary breakup based on Earning and Deduction.,工資分手基於盈利和演繹。
@@ -3957,7 +3957,7 @@
DocType: QuickBooks Migrator,Authorization URL,授權URL
apps/erpnext/erpnext/accounts/doctype/payment_entry/payment_entry.py +376,Amount {0} {1} {2} {3},金額{0} {1} {2} {3}
DocType: Account,Depreciation,折舊
-apps/erpnext/erpnext/accounts/doctype/share_transfer/share_transfer.py +103,The number of shares and the share numbers are inconsistent,股份數量和股票數量不一致
+apps/erpnext/erpnext/accounts/doctype/share_transfer/share_transfer.py +103,The number of shares and the share numbers are inconsistent,股份數量和庫存數量不一致
apps/erpnext/erpnext/stock/report/supplier_wise_sales_analytics/supplier_wise_sales_analytics.py +50,Supplier(s),供應商(S)
DocType: Employee Attendance Tool,Employee Attendance Tool,員工考勤工具
DocType: Guardian Student,Guardian Student,學生監護人
@@ -3981,8 +3981,8 @@
DocType: Restaurant Reservation,No of People,沒有人
apps/erpnext/erpnext/config/selling.py +164,Template of terms or contract.,模板條款或合同。
DocType: Bank Account,Address and Contact,地址和聯絡方式
-DocType: Cheque Print Template,Is Account Payable,為應付賬款
-apps/erpnext/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py +306,Stock cannot be updated against Purchase Receipt {0},股票不能對外購入庫單進行更新{0}
+DocType: Cheque Print Template,Is Account Payable,為應付帳款
+apps/erpnext/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py +306,Stock cannot be updated against Purchase Receipt {0},庫存不能對外購入庫單進行更新{0}
DocType: Support Settings,Auto close Issue after 7 days,7天之後自動關閉問題
apps/erpnext/erpnext/hr/doctype/leave_allocation/leave_allocation.py +85,"Leave cannot be allocated before {0}, as leave balance has already been carry-forwarded in the future leave allocation record {1}",假,不是之前分配{0},因為休假餘額已經結轉轉發在未來的假期分配記錄{1}
apps/erpnext/erpnext/accounts/party.py +350,Note: Due / Reference Date exceeds allowed customer credit days by {0} day(s),註:由於/參考日期由{0}天超過了允許客戶的信用天數(S)
@@ -4035,7 +4035,7 @@
apps/erpnext/erpnext/stock/doctype/serial_no/serial_no.py +284,Serial No {0} not in stock,序列號{0}無貨
apps/erpnext/erpnext/config/selling.py +169,Tax template for selling transactions.,稅務模板賣出的交易。
DocType: Sales Invoice,Write Off Outstanding Amount,核銷額(億元)
-apps/erpnext/erpnext/hr/doctype/expense_claim_type/expense_claim_type.py +27,Account {0} does not match with Company {1},帳戶{0}與公司{1}不符
+apps/erpnext/erpnext/hr/doctype/expense_claim_type/expense_claim_type.py +27,Account {0} does not match with Company {1},科目{0}與公司{1}不符
DocType: Education Settings,Current Academic Year,當前學年
DocType: Education Settings,Current Academic Year,當前學年
DocType: Stock Settings,Default Stock UOM,預設庫存計量單位
@@ -4055,13 +4055,13 @@
apps/erpnext/erpnext/controllers/accounts_controller.py +703,'Update Stock' cannot be checked for fixed asset sale,"""更新庫存"" 無法檢查固定資產銷售"
DocType: Bank Reconciliation,Bank Reconciliation,銀行對帳
apps/erpnext/erpnext/templates/includes/footer/footer_extension.html +7,Get Updates,獲取更新
-apps/erpnext/erpnext/accounts/doctype/gl_entry/gl_entry.py +97,{0} {1}: Account {2} does not belong to Company {3},{0} {1}帳戶{2}不屬於公司{3}
+apps/erpnext/erpnext/accounts/doctype/gl_entry/gl_entry.py +97,{0} {1}: Account {2} does not belong to Company {3},{0} {1}科目{2}不屬於公司{3}
apps/erpnext/erpnext/stock/doctype/item/item.js +452,Select at least one value from each of the attributes.,從每個屬性中至少選擇一個值。
apps/erpnext/erpnext/buying/doctype/purchase_order/purchase_order.py +164,Material Request {0} is cancelled or stopped,材料需求{0}被取消或停止
apps/erpnext/erpnext/regional/report/eway_bill/eway_bill.py +219,Dispatch State,派遣國
apps/erpnext/erpnext/config/hr.py +399,Leave Management,離開管理
apps/erpnext/erpnext/stock/doctype/item/item_dashboard.py +17,Groups,組
-apps/erpnext/erpnext/accounts/report/general_ledger/general_ledger.py +51,Group by Account,以帳戶分群組
+apps/erpnext/erpnext/accounts/report/general_ledger/general_ledger.py +51,Group by Account,以科目分群組
DocType: Purchase Invoice,Hold Invoice,保留發票
apps/erpnext/erpnext/hr/doctype/employee_promotion/employee_promotion.js +37,Please select Employee,請選擇員工
apps/erpnext/erpnext/setup/setup_wizard/operations/install_fixtures.py +214,Lower Income,較低的收入
@@ -4069,7 +4069,7 @@
apps/erpnext/erpnext/assets/doctype/asset_movement/asset_movement.py +25,Number of serial nos and quantity must be the same,序列號和數量必須相同
apps/erpnext/erpnext/stock/doctype/stock_entry/stock_entry.py +275,Source and target warehouse cannot be same for row {0},列{0}的來源和目標倉庫不可相同
DocType: Account,Asset Received But Not Billed,已收到但未收費的資產
-apps/erpnext/erpnext/stock/doctype/stock_reconciliation/stock_reconciliation.py +244,"Difference Account must be a Asset/Liability type account, since this Stock Reconciliation is an Opening Entry",差異帳戶必須是資產/負債類型的帳戶,因為此庫存調整是一個開始分錄
+apps/erpnext/erpnext/stock/doctype/stock_reconciliation/stock_reconciliation.py +244,"Difference Account must be a Asset/Liability type account, since this Stock Reconciliation is an Opening Entry",差異科目必須是資產/負債類型的科目,因為此庫存調整是一個開帳分錄
apps/erpnext/erpnext/hr/doctype/loan/loan.py +116,Disbursed Amount cannot be greater than Loan Amount {0},支付額不能超過貸款金額較大的{0}
apps/erpnext/erpnext/utilities/user_progress.py +176,Go to Programs,轉到程序
apps/erpnext/erpnext/hr/doctype/expense_claim/expense_claim.py +212,Row {0}# Allocated amount {1} cannot be greater than unclaimed amount {2},行{0}#分配的金額{1}不能大於無人認領的金額{2}
@@ -4117,7 +4117,7 @@
apps/erpnext/erpnext/accounts/doctype/sales_invoice/sales_invoice.py +1303,No {0} found for Inter Company Transactions.,Inter公司沒有找到{0}。
DocType: Travel Itinerary,Rented Car,租車
apps/erpnext/erpnext/public/js/hub/components/profile_dialog.js +15,About your Company,關於貴公司
-apps/erpnext/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py +144,Credit To account must be a Balance Sheet account,信用帳戶必須是資產負債表科目
+apps/erpnext/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py +144,Credit To account must be a Balance Sheet account,貸方科目必須是資產負債表科目
DocType: Donor,Donor,捐贈者
DocType: Global Defaults,Disable In Words,禁用詞
apps/erpnext/erpnext/stock/doctype/item/item.py +74,Item Code is mandatory because Item is not automatically numbered,產品編號是強制性的,因為項目沒有自動編號
@@ -4136,7 +4136,7 @@
apps/erpnext/erpnext/manufacturing/doctype/bom/bom.js +84,Browse BOM,瀏覽BOM
apps/erpnext/erpnext/accounts/doctype/account/chart_of_accounts/verified/standard_chart_of_accounts.py +165,Secured Loans,抵押貸款
DocType: Purchase Invoice,Edit Posting Date and Time,編輯投稿時間
-apps/erpnext/erpnext/assets/doctype/asset/depreciation.py +106,Please set Depreciation related Accounts in Asset Category {0} or Company {1},請設置在資產類別{0}或公司折舊相關帳戶{1}
+apps/erpnext/erpnext/assets/doctype/asset/depreciation.py +106,Please set Depreciation related Accounts in Asset Category {0} or Company {1},請設置在資產類別{0}或公司折舊相關科目{1}
DocType: Lab Test Groups,Normal Range,普通範圍
DocType: Academic Term,Academic Year,學年
apps/erpnext/erpnext/stock/report/item_variant_details/item_variant_details.py +79,Available Selling,可用銷售
@@ -4145,7 +4145,7 @@
DocType: Purchase Invoice,N,ñ
apps/erpnext/erpnext/education/report/assessment_plan_status/assessment_plan_status.py +175,Remaining,剩餘
DocType: Appraisal,Appraisal,評價
-DocType: Loan,Loan Account,貸款帳戶
+DocType: Loan,Loan Account,貸款科目
DocType: Purchase Invoice,GST Details,消費稅細節
apps/erpnext/erpnext/healthcare/doctype/healthcare_practitioner/healthcare_practitioner_dashboard.py +6,This is based on transactions against this Healthcare Practitioner.,這是基於針對此醫療保健從業者的交易。
apps/erpnext/erpnext/buying/doctype/request_for_quotation/request_for_quotation.py +156,Email sent to supplier {0},電子郵件發送到供應商{0}
@@ -4168,9 +4168,9 @@
apps/erpnext/erpnext/manufacturing/doctype/bom/bom.py +187,{0} not found for Item {1},找不到項目{1} {0}
apps/erpnext/erpnext/utilities/user_progress.py +197,Go to Courses,去課程
DocType: Accounts Settings,Show Inclusive Tax In Print,在打印中顯示包含稅
-apps/erpnext/erpnext/accounts/doctype/bank_reconciliation/bank_reconciliation.py +17,"Bank Account, From Date and To Date are Mandatory",銀行賬戶,從日期到日期是強制性的
+apps/erpnext/erpnext/accounts/doctype/bank_reconciliation/bank_reconciliation.py +17,"Bank Account, From Date and To Date are Mandatory",銀行科目,從日期到日期是強制性的
apps/erpnext/erpnext/accounts/doctype/payment_request/payment_request.js +29,Message Sent,發送訊息
-apps/erpnext/erpnext/accounts/doctype/account/account.py +105,Account with child nodes cannot be set as ledger,帳戶與子節點不能被設置為分類帳
+apps/erpnext/erpnext/accounts/doctype/account/account.py +105,Account with child nodes cannot be set as ledger,科目與子節點不能被設置為分類帳
DocType: Sales Invoice,Rate at which Price list currency is converted to customer's base currency,價目表貨幣被換算成客戶基礎貨幣的匯率
DocType: Purchase Invoice Item,Net Amount (Company Currency),淨金額(公司貨幣)
apps/erpnext/erpnext/hr/doctype/expense_claim/expense_claim.py +223,Total advance amount cannot be greater than total sanctioned amount,總預付金額不得超過全部認可金額
@@ -4178,7 +4178,7 @@
DocType: Stock Settings,Item Naming By,產品命名規則
apps/erpnext/erpnext/accounts/doctype/period_closing_voucher/period_closing_voucher.py +46,Another Period Closing Entry {0} has been made after {1},另一個期末錄入{0}作出後{1}
DocType: Work Order,Material Transferred for Manufacturing,物料轉倉用於製造
-apps/erpnext/erpnext/accounts/report/general_ledger/general_ledger.py +49,Account {0} does not exists,帳戶{0}不存在
+apps/erpnext/erpnext/accounts/report/general_ledger/general_ledger.py +49,Account {0} does not exists,科目{0}不存在
apps/erpnext/erpnext/accounts/doctype/sales_invoice/sales_invoice.js +1608,Select Loyalty Program,選擇忠誠度計劃
DocType: Project,Project Type,專案類型
apps/erpnext/erpnext/projects/doctype/task/task.py +157,Child Task exists for this Task. You can not delete this Task.,子任務存在這個任務。你不能刪除這個任務。
@@ -4199,7 +4199,7 @@
apps/erpnext/erpnext/accounts/doctype/account/chart_of_accounts/verified/standard_chart_of_accounts.py +20,Cash In Hand,手頭現金
apps/erpnext/erpnext/selling/doctype/sales_order/sales_order.py +143,Delivery warehouse required for stock item {0},需要的庫存項目交割倉庫{0}
DocType: Packing Slip,The gross weight of the package. Usually net weight + packaging material weight. (for print),包裹的總重量。通常為淨重+包裝材料的重量。 (用於列印)
-DocType: Accounts Settings,Users with this role are allowed to set frozen accounts and create / modify accounting entries against frozen accounts,具有此角色的用戶可以設置凍結帳戶,並新增/修改對凍結帳戶的會計分錄
+DocType: Accounts Settings,Users with this role are allowed to set frozen accounts and create / modify accounting entries against frozen accounts,具有此角色的用戶可以設置凍結科目,並新增/修改對凍結科目的會計分錄
DocType: Vital Signs,Cuts,削減
DocType: Serial No,Is Cancelled,被註銷
DocType: Student Group,Group Based On,基於組
@@ -4218,7 +4218,7 @@
,Issued Items Against Work Order,針對工單發布物品
,BOM Stock Calculated,BOM庫存計算
DocType: Vehicle Log,Invoice Ref,發票編號
-DocType: Company,Default Income Account,預設之收入帳戶
+DocType: Company,Default Income Account,預設收入科目
apps/erpnext/erpnext/accounts/report/balance_sheet/balance_sheet.py +39,Unclosed Fiscal Years Profit / Loss (Credit),未關閉的財年利潤/損失(信用)
DocType: Sales Invoice,Time Sheets,考勤表
DocType: Healthcare Service Unit Type,Change In Item,更改項目
@@ -4258,7 +4258,7 @@
DocType: Journal Entry,Remark,備註
DocType: Healthcare Settings,Avoid Confirmation,避免確認
DocType: Purchase Receipt Item,Rate and Amount,率及金額
-apps/erpnext/erpnext/accounts/doctype/payment_entry/payment_entry.py +177,Account Type for {0} must be {1},帳戶類型為{0}必須{1}
+apps/erpnext/erpnext/accounts/doctype/payment_entry/payment_entry.py +177,Account Type for {0} must be {1},科目類型為{0}必須{1}
apps/erpnext/erpnext/config/hr.py +34,Leaves and Holiday,休假及假日
DocType: Education Settings,Current Academic Term,當前學術期限
DocType: Education Settings,Current Academic Term,當前學術期限
@@ -4272,7 +4272,7 @@
apps/erpnext/erpnext/config/accounts.py +19,Bills raised by Suppliers.,由供應商提出的帳單。
DocType: POS Profile,Write Off Account,核銷帳戶
DocType: Patient Appointment,Get prescribed procedures,獲取規定的程序
-DocType: Sales Invoice,Redemption Account,贖回賬戶
+DocType: Sales Invoice,Redemption Account,贖回科目
DocType: Purchase Invoice Item,Discount Amount,折扣金額
DocType: Purchase Invoice,Return Against Purchase Invoice,回到對採購發票
DocType: Item,Warranty Period (in days),保修期限(天數)
@@ -4372,7 +4372,7 @@
apps/erpnext/erpnext/hr/report/salary_register/salary_register.py +47,Salary Slip ID,工資單編號
apps/erpnext/erpnext/hr/doctype/employee/employee.py +135,Date Of Retirement must be greater than Date of Joining,日期退休必須大於加入的日期
apps/erpnext/erpnext/stock/doctype/item/item.js +70,Multiple Variants,多種變體
-DocType: Sales Invoice,Against Income Account,對收入帳戶
+DocType: Sales Invoice,Against Income Account,對收入科目
DocType: Subscription,Trial Period Start Date,試用期開始日期
apps/erpnext/erpnext/buying/doctype/purchase_order/purchase_order.py +106,Item {0}: Ordered qty {1} cannot be less than minimum order qty {2} (defined in Item).,項目{0}:有序數量{1}不能低於最低訂貨量{2}(項中定義)。
DocType: Certification Application,Certified,認證
@@ -4402,7 +4402,7 @@
apps/erpnext/erpnext/selling/doctype/installation_note/installation_note.py +83,Please pull items from Delivery Note,請送貨單拉項目
apps/erpnext/erpnext/manufacturing/doctype/work_order/work_order.py +242,Row {0}: select the workstation against the operation {1},行{0}:根據操作{1}選擇工作站
apps/erpnext/erpnext/accounts/utils.py +496,Journal Entries {0} are un-linked,日記條目{0}都是非聯
-apps/erpnext/erpnext/accounts/utils.py +825,{0} Number {1} already used in account {2},已在{2}帳戶中使用的{0}號碼{1}
+apps/erpnext/erpnext/accounts/utils.py +825,{0} Number {1} already used in account {2},已在{2}科目中使用的{0}號碼{1}
apps/erpnext/erpnext/config/crm.py +92,"Record of all communications of type email, phone, chat, visit, etc.",類型電子郵件,電話,聊天,訪問等所有通信記錄
DocType: Supplier Scorecard Scoring Standing,Supplier Scorecard Scoring Standing,供應商記分卡
DocType: Manufacturer,Manufacturers used in Items,在項目中使用製造商
@@ -4428,7 +4428,7 @@
DocType: Asset Settings,Number of Days in Fiscal Year,會計年度的天數
,Stock Ledger,庫存總帳
apps/erpnext/erpnext/templates/includes/cart/cart_items.html +29,Rate: {0},價格:{0}
-DocType: Company,Exchange Gain / Loss Account,兌換收益/損失帳戶
+DocType: Company,Exchange Gain / Loss Account,匯兌損益科目
DocType: Amazon MWS Settings,MWS Credentials,MWS憑證
apps/erpnext/erpnext/config/hr.py +7,Employee and Attendance,員工考勤
apps/erpnext/erpnext/stock/doctype/stock_entry/stock_entry.py +123,Purpose must be one of {0},目的必須是一個{0}
@@ -4450,7 +4450,7 @@
apps/erpnext/erpnext/stock/report/stock_balance/stock_balance.py +92,Reorder Qty,再訂購數量
apps/erpnext/erpnext/assets/doctype/asset/asset.py +292,Depreciation Row {0}: Expected value after useful life must be greater than or equal to {1},折舊行{0}:使用壽命後的預期值必須大於或等於{1}
apps/erpnext/erpnext/hr/doctype/job_opening/job_opening.py +55,Current Job Openings,當前職位空缺
-DocType: Company,Stock Adjustment Account,庫存調整帳戶
+DocType: Company,Stock Adjustment Account,庫存調整科目
apps/erpnext/erpnext/public/js/payment/pos_payment.html +17,Write Off,註銷項款
DocType: Healthcare Service Unit,Allow Overlap,允許重疊
DocType: Employee,"System User (login) ID. If set, it will become default for all HR forms.",系統用戶(登錄)的標識。如果設定,這將成為的所有人力資源的預設形式。
@@ -4497,7 +4497,7 @@
apps/erpnext/erpnext/maintenance/doctype/maintenance_schedule/maintenance_schedule.js +47,Make Maintenance Visit,使維護訪問
DocType: Employee Transfer,Employee Transfer Details,員工轉移詳情
apps/erpnext/erpnext/selling/doctype/customer/customer.py +263,Please contact to the user who have Sales Master Manager {0} role,請聯絡,誰擁有碩士學位的銷售經理{0}角色的用戶
-DocType: Company,Default Cash Account,預設的現金帳戶
+DocType: Company,Default Cash Account,預設的現金科目
apps/erpnext/erpnext/config/accounts.py +40,Company (not Customer or Supplier) master.,公司(不是客戶或供應商)的主人。
apps/erpnext/erpnext/education/doctype/student/student_dashboard.py +6,This is based on the attendance of this Student,這是基於這名學生出席
apps/erpnext/erpnext/education/doctype/student_attendance_tool/student_attendance_tool.js +179,No Students in,沒有學生
@@ -4515,12 +4515,12 @@
DocType: Asset Movement,To Employee,給員工
DocType: Employee Transfer,New Company,新公司
apps/erpnext/erpnext/setup/doctype/company/delete_company_transactions.py +19,Transactions can only be deleted by the creator of the Company,交易只能由公司的創建者被刪除
-apps/erpnext/erpnext/accounts/general_ledger.py +21,Incorrect number of General Ledger Entries found. You might have selected a wrong Account in the transaction.,不正確的數字總帳條目中找到。你可能會在交易中選擇了錯誤的帳戶。
+apps/erpnext/erpnext/accounts/general_ledger.py +21,Incorrect number of General Ledger Entries found. You might have selected a wrong Account in the transaction.,不正確的數字總帳條目中找到。你可能會在交易中選擇了錯誤的科目。
DocType: Employee,Prefered Contact Email,首選聯繫郵箱
DocType: Cheque Print Template,Cheque Width,支票寬度
DocType: Selling Settings,Validate Selling Price for Item against Purchase Rate or Valuation Rate,驗證售價反對預訂價或估價RATE項目
DocType: Fee Schedule,Fee Schedule,收費表
-DocType: Company,Create Chart Of Accounts Based On,創建圖表的帳戶根據
+DocType: Company,Create Chart Of Accounts Based On,基於會計科目表創建
apps/erpnext/erpnext/hr/doctype/employee/employee.py +129,Date of Birth cannot be greater than today.,出生日期不能大於今天。
,Stock Ageing,存貨帳齡分析表
DocType: Travel Request,"Partially Sponsored, Require Partial Funding",部分贊助,需要部分資金
@@ -4541,7 +4541,7 @@
DocType: Warranty Claim,Item and Warranty Details,項目和保修細節
DocType: Chapter,Chapter Members,章節成員
DocType: Sales Team,Contribution (%),貢獻(%)
-apps/erpnext/erpnext/controllers/accounts_controller.py +143,Note: Payment Entry will not be created since 'Cash or Bank Account' was not specified,注:付款項將不會被創建因為“現金或銀行帳戶”未指定
+apps/erpnext/erpnext/controllers/accounts_controller.py +143,Note: Payment Entry will not be created since 'Cash or Bank Account' was not specified,注:付款項將不會被創建因為“現金或銀行科目”未指定
apps/erpnext/erpnext/projects/doctype/project/project.py +79,Project {0} already exists,項目{0}已經存在
DocType: Clinical Procedure,Nursing User,護理用戶
DocType: Employee Benefit Application,Payroll Period,工資期
@@ -4549,7 +4549,7 @@
apps/erpnext/erpnext/stock/doctype/serial_no/serial_no.py +239,Serial No {0} does not belong to Batch {1},序列號{0}不屬於批次{1}
apps/erpnext/erpnext/setup/setup_wizard/operations/install_fixtures.py +197,Responsibilities,職責
apps/erpnext/erpnext/selling/doctype/quotation/quotation.py +125,Validity period of this quotation has ended.,此報價的有效期已經結束。
-DocType: Expense Claim Account,Expense Claim Account,報銷賬戶
+DocType: Expense Claim Account,Expense Claim Account,報銷科目
DocType: Account,Capital Work in Progress,資本工作正在進行中
DocType: Accounts Settings,Allow Stale Exchange Rates,允許陳舊的匯率
DocType: Sales Person,Sales Person Name,銷售人員的姓名
@@ -4565,7 +4565,7 @@
apps/erpnext/erpnext/projects/doctype/task/task.py +57,Progress % for a task cannot be more than 100.,為任務進度百分比不能超過100個。
DocType: Stock Reconciliation Item,Before reconciliation,調整前
DocType: Purchase Invoice,Taxes and Charges Added (Company Currency),稅收和收費上架(公司貨幣)
-apps/erpnext/erpnext/stock/doctype/item/item.py +507,Item Tax Row {0} must have account of type Tax or Income or Expense or Chargeable,商品稅行{0}必須有帳戶類型稅或收入或支出或課稅的
+apps/erpnext/erpnext/stock/doctype/item/item.py +507,Item Tax Row {0} must have account of type Tax or Income or Expense or Chargeable,商品稅行{0}必須有科目類型為"稅" 或 "收入" 或 "支出" 或 "課稅的"
DocType: Sales Order,Partly Billed,天色帳單
apps/erpnext/erpnext/assets/doctype/asset/asset.py +54,Item {0} must be a Fixed Asset Item,項{0}必須是固定資產項目
apps/erpnext/erpnext/stock/doctype/item/item.js +427,Make Variants,變種
@@ -4577,13 +4577,13 @@
apps/erpnext/erpnext/setup/doctype/company/company.js +109,Please re-type company name to confirm,請確認重新輸入公司名稱
apps/erpnext/erpnext/accounts/report/accounts_receivable_summary/accounts_receivable_summary.py +50,Total Outstanding Amt,總街貨量金額
DocType: Journal Entry,Printing Settings,列印設定
-DocType: Employee Advance,Advance Account,預付帳戶
+DocType: Employee Advance,Advance Account,預付款科目
DocType: Job Offer,Job Offer Terms,招聘條款
DocType: Sales Invoice,Include Payment (POS),包括支付(POS)
apps/erpnext/erpnext/accounts/doctype/journal_entry/journal_entry.py +324,Total Debit must be equal to Total Credit. The difference is {0},借方總額必須等於貸方總額。差額為{0}
apps/erpnext/erpnext/setup/setup_wizard/data/industry_type.py +11,Automotive,汽車
DocType: Vehicle,Insurance Company,保險公司
-DocType: Asset Category Account,Fixed Asset Account,固定資產帳戶
+DocType: Asset Category Account,Fixed Asset Account,固定資產科目
apps/erpnext/erpnext/hr/doctype/salary_structure/salary_structure.js +442,Variable,變量
apps/erpnext/erpnext/selling/doctype/installation_note/installation_note.js +47,From Delivery Note,從送貨單
DocType: Chapter,Members,會員
@@ -4595,14 +4595,14 @@
DocType: Notification Control,Custom Message,自定義訊息
apps/erpnext/erpnext/setup/setup_wizard/data/industry_type.py +33,Investment Banking,投資銀行業務
DocType: Purchase Invoice,input,輸入
-apps/erpnext/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py +107,Cash or Bank Account is mandatory for making payment entry,製作付款分錄時,現金或銀行帳戶是強制性輸入的欄位。
+apps/erpnext/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py +107,Cash or Bank Account is mandatory for making payment entry,製作付款分錄時,現金或銀行科目是強制性輸入的欄位。
DocType: Loyalty Program,Multiple Tier Program,多層計劃
apps/erpnext/erpnext/education/report/student_and_guardian_contact_details/student_and_guardian_contact_details.py +54,Student Address,學生地址
apps/erpnext/erpnext/education/report/student_and_guardian_contact_details/student_and_guardian_contact_details.py +54,Student Address,學生地址
DocType: Purchase Invoice,Price List Exchange Rate,價目表匯率
apps/erpnext/erpnext/patches/v11_0/rename_supplier_type_to_supplier_group.py +27,All Supplier Groups,所有供應商組織
DocType: Employee Boarding Activity,Required for Employee Creation,員工創建需要
-apps/erpnext/erpnext/accounts/doctype/account/account.py +214,Account Number {0} already used in account {1},已在帳戶{1}中使用的帳號{0}
+apps/erpnext/erpnext/accounts/doctype/account/account.py +214,Account Number {0} already used in account {1},已在科目{1}中使用的帳號{0}
DocType: Hotel Room Reservation,Booked,預訂
DocType: Detected Disease,Tasks Created,創建的任務
DocType: Purchase Invoice Item,Rate,單價
@@ -4840,7 +4840,7 @@
apps/erpnext/erpnext/selling/page/point_of_sale/point_of_sale.js +542,Form View,表單視圖
DocType: HR Settings,Expense Approver Mandatory In Expense Claim,費用審批人必須在費用索賠中
apps/erpnext/erpnext/setup/doctype/email_digest/email_digest.py +124,Summary for this month and pending activities,本月和待活動總結
-apps/erpnext/erpnext/accounts/doctype/exchange_rate_revaluation/exchange_rate_revaluation.py +91,Please set Unrealized Exchange Gain/Loss Account in Company {0},請在公司{0}中設置未實現的匯兌收益/損失帳戶
+apps/erpnext/erpnext/accounts/doctype/exchange_rate_revaluation/exchange_rate_revaluation.py +91,Please set Unrealized Exchange Gain/Loss Account in Company {0},請在公司{0}中設置未實現的匯兌收益/損失科目
apps/erpnext/erpnext/utilities/user_progress.py +248,"Add users to your organization, other than yourself.",將用戶添加到您的組織,而不是您自己。
DocType: Customer Group,Customer Group Name,客戶群組名稱
apps/erpnext/erpnext/public/js/pos/pos.html +109,No Customers yet!,還沒有客戶!
@@ -4856,7 +4856,7 @@
apps/erpnext/erpnext/healthcare/doctype/practitioner_schedule/practitioner_schedule.js +104,Time slots added,添加時隙
DocType: Item,Attributes,屬性
apps/erpnext/erpnext/healthcare/doctype/clinical_procedure_template/clinical_procedure_template.js +36,Enable Template,啟用模板
-apps/erpnext/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py +256,Please enter Write Off Account,請輸入核銷帳戶
+apps/erpnext/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py +256,Please enter Write Off Account,請輸入核銷科目
apps/erpnext/erpnext/selling/report/inactive_customers/inactive_customers.py +71,Last Order Date,最後訂購日期
DocType: Salary Component,Is Payable,應付
DocType: Inpatient Record,B Negative,B負面
@@ -4865,7 +4865,7 @@
DocType: Holiday List,Add Weekly Holidays,添加每週假期
DocType: Staffing Plan Detail,Vacancies,職位空缺
DocType: Hotel Room,Hotel Room,旅館房間
-apps/erpnext/erpnext/accounts/doctype/budget/budget.py +57,Account {0} does not belongs to company {1},帳戶{0}不屬於公司{1}
+apps/erpnext/erpnext/accounts/doctype/budget/budget.py +57,Account {0} does not belongs to company {1},科目{0}不屬於公司{1}
DocType: Leave Type,Rounding,四捨五入
apps/erpnext/erpnext/accounts/doctype/sales_invoice/sales_invoice.py +994,Serial Numbers in row {0} does not match with Delivery Note,行{0}中的序列號與交貨單不匹配
DocType: Employee Benefit Application,Dispensed Amount (Pro-rated),分配金額(按比例分配)
@@ -4896,7 +4896,7 @@
DocType: Employee Tax Exemption Proof Submission,House Rent Payment Amount,房屋租金付款金額
DocType: Student Admission Program,Student Admission Program,學生入學計劃
DocType: Employee Tax Exemption Sub Category,Tax Exemption Category,免稅類別
-DocType: Payment Entry,Account Paid To,賬戶付至
+DocType: Payment Entry,Account Paid To,科目付至
DocType: Subscription Settings,Grace Period,寬限期
DocType: Item Alternative,Alternative Item Name,替代項目名稱
apps/erpnext/erpnext/selling/doctype/product_bundle/product_bundle.py +24,Parent Item {0} must not be a Stock Item,父項{0}不能是庫存產品
@@ -4905,7 +4905,7 @@
DocType: Email Digest,Open Quotations,打開報價單
DocType: Expense Claim,More Details,更多詳情
DocType: Supplier Quotation,Supplier Address,供應商地址
-apps/erpnext/erpnext/accounts/doctype/budget/budget.py +168,{0} Budget for Account {1} against {2} {3} is {4}. It will exceed by {5},{0}預算帳戶{1}對{2} {3}是{4}。這將超過{5}
+apps/erpnext/erpnext/accounts/doctype/budget/budget.py +168,{0} Budget for Account {1} against {2} {3} is {4}. It will exceed by {5},{0}預算科目{1}對{2} {3}是{4}。這將超過{5}
apps/erpnext/erpnext/stock/report/batch_wise_balance_history/batch_wise_balance_history.py +37,Out Qty,輸出數量
apps/erpnext/erpnext/buying/doctype/supplier/supplier.py +49,Series is mandatory,系列是強制性的
apps/erpnext/erpnext/setup/setup_wizard/data/industry_type.py +28,Financial Services,金融服務
@@ -4991,7 +4991,7 @@
DocType: Support Search Source,Link Options,鏈接選項
apps/erpnext/erpnext/selling/page/point_of_sale/point_of_sale.js +1557,Total Amount {0},總金額{0}
apps/erpnext/erpnext/controllers/item_variant.py +323,Invalid attribute {0} {1},無效的屬性{0} {1}
-DocType: Supplier,Mention if non-standard payable account,如果非標準應付賬款提到
+DocType: Supplier,Mention if non-standard payable account,如果非標準應付帳款提到
apps/erpnext/erpnext/education/report/course_wise_assessment_report/course_wise_assessment_report.py +25,Please select the assessment group other than 'All Assessment Groups',請選擇“所有評估組”以外的評估組
apps/erpnext/erpnext/stock/doctype/landed_cost_voucher/landed_cost_voucher.py +67,Row {0}: Cost center is required for an item {1},行{0}:項目{1}需要費用中心
DocType: Training Event Employee,Optional,可選的
@@ -5047,7 +5047,7 @@
DocType: Item Group,HTML / Banner that will show on the top of product list.,HTML/橫幅,將顯示在產品列表的頂部。
DocType: Shipping Rule,Specify conditions to calculate shipping amount,指定條件來計算運費金額
DocType: Program Enrollment,Institute's Bus,學院的巴士
-DocType: Accounts Settings,Role Allowed to Set Frozen Accounts & Edit Frozen Entries,允許設定凍結帳戶和編輯凍結分錄的角色
+DocType: Accounts Settings,Role Allowed to Set Frozen Accounts & Edit Frozen Entries,允許設定凍結科目和編輯凍結分錄的角色
DocType: Supplier Scorecard Scoring Variable,Path,路徑
apps/erpnext/erpnext/accounts/doctype/cost_center/cost_center.py +30,Cannot convert Cost Center to ledger as it has child nodes,不能成本中心轉換為總賬,因為它有子節點
DocType: Production Plan,Total Planned Qty,總計劃數量
@@ -5055,7 +5055,7 @@
DocType: Salary Component,Formula,式
apps/erpnext/erpnext/stock/report/stock_ledger/stock_ledger.py +59,Serial #,序列號
DocType: Lab Test Template,Lab Test Template,實驗室測試模板
-apps/erpnext/erpnext/setup/doctype/company/company.py +196,Sales Account,銷售帳戶
+apps/erpnext/erpnext/setup/doctype/company/company.py +196,Sales Account,銷售科目
DocType: Purchase Invoice Item,Total Weight,總重量
apps/erpnext/erpnext/accounts/doctype/account/chart_of_accounts/verified/standard_chart_of_accounts.py +101,Commission on Sales,銷售佣金
DocType: Job Offer Term,Value / Description,值/說明
@@ -5078,7 +5078,7 @@
apps/erpnext/erpnext/stock/doctype/packing_slip/packing_slip.js +84,Invalid quantity specified for item {0}. Quantity should be greater than 0.,為項目指定了無效的數量{0} 。量應大於0 。
DocType: Company,Default Employee Advance Account,默認員工高級帳戶
apps/erpnext/erpnext/selling/page/point_of_sale/point_of_sale.js +1181,Search Item (Ctrl + i),搜索項目(Ctrl + i)
-apps/erpnext/erpnext/accounts/doctype/account/account.py +171,Account with existing transaction can not be deleted,帳戶與現有的交易不能被刪除
+apps/erpnext/erpnext/accounts/doctype/account/account.py +171,Account with existing transaction can not be deleted,科目與現有的交易不能被刪除
DocType: Vehicle,Last Carbon Check,最後檢查炭
apps/erpnext/erpnext/accounts/doctype/account/chart_of_accounts/verified/standard_chart_of_accounts.py +109,Legal Expenses,法律費用
apps/erpnext/erpnext/public/js/utils/serial_no_batch_selector.js +147,Please select quantity on row ,請選擇行數量
@@ -5100,7 +5100,7 @@
DocType: Bank Statement Transaction Settings Item,Bank Data,銀行數據
DocType: Purchase Receipt Item,Sample Quantity,樣品數量
DocType: Manufacturing Settings,"Update BOM cost automatically via Scheduler, based on latest valuation rate / price list rate / last purchase rate of raw materials.",根據最新的估值/價格清單率/最近的原材料採購率,通過計劃程序自動更新BOM成本。
-apps/erpnext/erpnext/accounts/doctype/account/account.py +57,Account {0}: Parent account {1} does not belong to company: {2},帳戶{0}:父帳戶{1}不屬於公司:{2}
+apps/erpnext/erpnext/accounts/doctype/account/account.py +57,Account {0}: Parent account {1} does not belong to company: {2},科目{0}:上層科目{1}不屬於公司:{2}
apps/erpnext/erpnext/setup/doctype/company/company.js +126,Successfully deleted all transactions related to this company!,成功刪除與該公司相關的所有交易!
apps/erpnext/erpnext/accounts/report/accounts_payable/accounts_payable.js +22,As on Date,隨著對日
DocType: Program Enrollment,Enrollment Date,報名日期
@@ -5126,7 +5126,7 @@
apps/erpnext/erpnext/accounts/doctype/sales_invoice/sales_invoice.py +1182,{0} not allowed to transact with {1}. Please change the Company.,不允許{0}與{1}進行交易。請更改公司。
DocType: Sales Partner,Contact Desc,聯絡倒序
DocType: Email Digest,Send regular summary reports via Email.,使用電子郵件發送定期匯總報告。
-apps/erpnext/erpnext/hr/doctype/expense_claim/expense_claim.py +289,Please set default account in Expense Claim Type {0},請報銷類型設置默認帳戶{0}
+apps/erpnext/erpnext/hr/doctype/expense_claim/expense_claim.py +289,Please set default account in Expense Claim Type {0},請報銷類型設置默認科目{0}
apps/erpnext/erpnext/hr/doctype/leave_application/leave_application_dashboard.html +11,Available Leaves,可用的葉子
DocType: Assessment Result,Student Name,學生姓名
DocType: Hub Tracked Item,Item Manager,項目經理
@@ -5169,17 +5169,17 @@
apps/erpnext/erpnext/controllers/accounts_controller.py +864,{0} is mandatory. Maybe Currency Exchange record is not created for {1} to {2}.,{0}是強制性的。也許外幣兌換記錄為{1}到{2}尚未建立。
apps/erpnext/erpnext/hr/doctype/staffing_plan/staffing_plan.py +51,Staffing Plan {0} already exist for designation {1},已存在人員配置計劃{0}以用於指定{1}
apps/erpnext/erpnext/accounts/doctype/tax_rule/tax_rule.py +46,Tax Template is mandatory.,稅務模板是強制性的。
-apps/erpnext/erpnext/accounts/doctype/account/account.py +51,Account {0}: Parent account {1} does not exist,帳戶{0}:父帳戶{1}不存在
+apps/erpnext/erpnext/accounts/doctype/account/account.py +51,Account {0}: Parent account {1} does not exist,科目{0}:上層科目{1}不存在
DocType: POS Closing Voucher,Period Start Date,期間開始日期
DocType: Purchase Invoice Item,Price List Rate (Company Currency),價格列表費率(公司貨幣)
DocType: Products Settings,Products Settings,產品設置
-,Item Price Stock,項目價格股票
+,Item Price Stock,項目價格庫存
apps/erpnext/erpnext/config/accounts.py +550,To make Customer based incentive schemes.,制定基於客戶的激勵計劃。
DocType: Lab Prescription,Test Created,測試創建
DocType: Healthcare Settings,Custom Signature in Print,自定義簽名打印
DocType: Account,Temporary,臨時
apps/erpnext/erpnext/accounts/report/accounts_receivable/accounts_receivable.html +127,Customer LPO No.,客戶LPO號
-DocType: Amazon MWS Settings,Market Place Account Group,市場賬戶組
+DocType: Amazon MWS Settings,Market Place Account Group,市場科目組
apps/erpnext/erpnext/accounts/doctype/payment_order/payment_order.js +14,Make Payment Entries,付款條目
DocType: Program,Courses,培訓班
DocType: Monthly Distribution Percentage,Percentage Allocation,百分比分配
@@ -5215,7 +5215,7 @@
apps/erpnext/erpnext/stock/doctype/item/item.py +523,Barcode {0} already used in Item {1},條碼{0}已經用在項目{1}
apps/erpnext/erpnext/config/selling.py +86,Rules for adding shipping costs.,增加運輸成本的規則。
apps/erpnext/erpnext/accounts/report/budget_variance_report/budget_variance_report.py +72,Varaiance ,Varaiance
-DocType: Item,Opening Stock,打開股票
+DocType: Item,Opening Stock,打開庫存
apps/erpnext/erpnext/support/doctype/warranty_claim/warranty_claim.py +20,Customer is required,客戶是必需的
DocType: Lab Test,Result Date,結果日期
apps/erpnext/erpnext/accounts/report/accounts_receivable/accounts_receivable.html +129,PDC/LC Date,PDC / LC日期
@@ -5250,7 +5250,7 @@
apps/erpnext/erpnext/accounts/doctype/journal_entry/journal_entry.py +396,{0} against Sales Invoice {1},{0}針對銷售發票{1}
DocType: Antibiotic,Laboratory User,實驗室用戶
DocType: Request for Quotation Item,Project Name,專案名稱
-DocType: Customer,Mention if non-standard receivable account,提到如果不規範應收賬款
+DocType: Customer,Mention if non-standard receivable account,提到如果不規範應收帳款
apps/erpnext/erpnext/hr/doctype/employee_benefit_application/employee_benefit_application.py +63,Please add the remaining benefits {0} to any of the existing component,請將其餘好處{0}添加到任何現有組件
DocType: Journal Entry Account,If Income or Expense,如果收入或支出
DocType: Bank Statement Transaction Entry,Matching Invoices,匹配發票
@@ -5260,7 +5260,7 @@
apps/erpnext/erpnext/config/learn.py +229,Human Resource,人力資源
DocType: Payment Reconciliation Payment,Payment Reconciliation Payment,付款方式付款對賬
DocType: Disease,Treatment Task,治療任務
-DocType: Payment Order Reference,Bank Account Details,銀行賬戶明細
+DocType: Payment Order Reference,Bank Account Details,銀行科目明細
DocType: Purchase Order Item,Blanket Order,總訂單
apps/erpnext/erpnext/accounts/doctype/account/chart_of_accounts/verified/standard_chart_of_accounts.py +39,Tax Assets,所得稅資產
apps/erpnext/erpnext/manufacturing/doctype/production_order/production_order.py +631,Production Order has been {0},生產訂單已經{0}
@@ -5322,7 +5322,7 @@
,Employee Information,僱員資料
apps/erpnext/erpnext/healthcare/doctype/patient_appointment/patient_appointment.py +242,Healthcare Practitioner not available on {0},醫療從業者在{0}上不可用
DocType: Stock Entry Detail,Additional Cost,額外費用
-apps/erpnext/erpnext/accounts/report/general_ledger/general_ledger.py +57,"Can not filter based on Voucher No, if grouped by Voucher",是冷凍的帳戶。要禁止該帳戶創建/編輯事務,你需要角色
+apps/erpnext/erpnext/accounts/report/general_ledger/general_ledger.py +57,"Can not filter based on Voucher No, if grouped by Voucher",是凍結的帳戶。要禁止該帳戶創建/編輯事務,你需要有指定的身份
apps/erpnext/erpnext/buying/doctype/request_for_quotation/request_for_quotation.js +975,Make Supplier Quotation,讓供應商報價
DocType: Quality Inspection,Incoming,來
apps/erpnext/erpnext/setup/doctype/company/company.js +90,Default tax templates for sales and purchase are created.,銷售和採購的默認稅收模板被創建。
@@ -5340,7 +5340,7 @@
apps/erpnext/erpnext/manufacturing/report/bom_stock_report/bom_stock_report.py +24,In Stock Qty,庫存數量
,Daily Work Summary Replies,日常工作總結回复
DocType: Delivery Trip,Calculate Estimated Arrival Times,計算預計到達時間
-apps/erpnext/erpnext/accounts/general_ledger.py +113,Account: {0} can only be updated via Stock Transactions,帳號:{0}只能通過股票的交易進行更新
+apps/erpnext/erpnext/accounts/general_ledger.py +113,Account: {0} can only be updated via Stock Transactions,帳號:{0}只能通過庫存的交易進行更新
DocType: Student Group Creation Tool,Get Courses,獲取課程
DocType: Shopify Settings,Webhooks,網絡掛接
DocType: Bank Account,Party,黨
@@ -5376,7 +5376,7 @@
DocType: Department,Leave Block List,休假區塊清單
DocType: Purchase Invoice,Tax ID,稅號
apps/erpnext/erpnext/stock/doctype/serial_no/serial_no.py +198,Item {0} is not setup for Serial Nos. Column must be blank,項目{0}不是設定為序列號,此列必須為空白
-DocType: Accounts Settings,Accounts Settings,帳戶設定
+DocType: Accounts Settings,Accounts Settings,會計設定
DocType: Loyalty Program,Customer Territory,客戶地區
DocType: Email Digest,Sales Orders to Deliver,要交付的銷售訂單
apps/erpnext/erpnext/accounts/doctype/account/account_tree.js +28,"Number of new Account, it will be included in the account name as a prefix",新帳號的數量,將作為前綴包含在帳號名稱中
@@ -5388,7 +5388,7 @@
DocType: Opportunity,To Discuss,為了討論
apps/erpnext/erpnext/stock/stock_ledger.py +382,{0} units of {1} needed in {2} to complete this transaction.,{0}單位{1}在{2}完成此交易所需。
DocType: Support Settings,Forum URL,論壇URL
-apps/erpnext/erpnext/accounts/doctype/account/chart_of_accounts/verified/standard_chart_of_accounts.py +75,Temporary Accounts,臨時帳戶
+apps/erpnext/erpnext/accounts/doctype/account/chart_of_accounts/verified/standard_chart_of_accounts.py +75,Temporary Accounts,臨時科目
apps/erpnext/erpnext/assets/doctype/asset_movement/asset_movement.py +40,Source Location is required for the asset {0},源位置對資產{0}是必需的
DocType: BOM Explosion Item,BOM Explosion Item,BOM展開項目
DocType: Shareholder,Contact List,聯繫人列表
@@ -5426,7 +5426,7 @@
DocType: Purchase Order Item,Last Purchase Rate,最後預訂價
DocType: Account,Asset,財富
DocType: Project Task,Task ID,任務ID
-apps/erpnext/erpnext/stock/doctype/stock_ledger_entry/stock_ledger_entry.py +84,Stock cannot exist for Item {0} since has variants,股票可以為項目不存在{0},因為有變種
+apps/erpnext/erpnext/stock/doctype/stock_ledger_entry/stock_ledger_entry.py +84,Stock cannot exist for Item {0} since has variants,庫存可以為項目不存在{0},因為有變種
DocType: Healthcare Practitioner,Mobile,移動
,Sales Person-wise Transaction Summary,銷售人員相關的交易匯總
DocType: Training Event,Contact Number,聯繫電話
@@ -5444,7 +5444,7 @@
DocType: Payment Entry,Paid Amount,支付的金額
apps/erpnext/erpnext/utilities/user_progress.py +158,Explore Sales Cycle,探索銷售週期
DocType: Assessment Plan,Supervisor,監
-apps/erpnext/erpnext/stock/doctype/purchase_receipt/purchase_receipt.js +934,Retention Stock Entry,保留股票入場
+apps/erpnext/erpnext/stock/doctype/purchase_receipt/purchase_receipt.js +934,Retention Stock Entry,保留庫存入場
,Available Stock for Packing Items,可用庫存包裝項目
DocType: Item Variant,Item Variant,項目變
,Work Order Stock Report,工單庫存報表
@@ -5454,7 +5454,7 @@
DocType: Leave Policy Detail,Leave Policy Detail,退出政策細節
DocType: BOM Scrap Item,BOM Scrap Item,BOM項目廢料
apps/erpnext/erpnext/accounts/page/pos/pos.js +906,Submitted orders can not be deleted,提交的訂單不能被刪除
-apps/erpnext/erpnext/accounts/doctype/account/account.py +121,"Account balance already in Debit, you are not allowed to set 'Balance Must Be' as 'Credit'",帳戶餘額已歸為借方帳戶,不允許設為信用帳戶
+apps/erpnext/erpnext/accounts/doctype/account/account.py +121,"Account balance already in Debit, you are not allowed to set 'Balance Must Be' as 'Credit'",科目餘額已歸為借方科目,不允許設為貸方
apps/erpnext/erpnext/setup/setup_wizard/operations/install_fixtures.py +391,Quality Management,品質管理
apps/erpnext/erpnext/assets/doctype/asset/asset.py +52,Item {0} has been disabled,項{0}已被禁用
DocType: Project,Total Billable Amount (via Timesheets),總計費用金額(通過時間表)
@@ -5484,15 +5484,15 @@
DocType: Purchase Invoice Item,Allow Zero Valuation Rate,允許零估值
DocType: Purchase Invoice Item,Allow Zero Valuation Rate,允許零估值
DocType: Training Event Employee,Invited,邀請
-apps/erpnext/erpnext/config/accounts.py +276,Setup Gateway accounts.,設置網關帳戶。
+apps/erpnext/erpnext/config/accounts.py +276,Setup Gateway accounts.,設置閘道科目。
DocType: Employee,Employment Type,就業類型
apps/erpnext/erpnext/accounts/doctype/account/chart_of_accounts/verified/standard_chart_of_accounts.py +43,Fixed Assets,固定資產
DocType: Payment Entry,Set Exchange Gain / Loss,設置兌換收益/損失
,GST Purchase Register,消費稅購買登記冊
,Cash Flow,現金周轉
apps/erpnext/erpnext/accounts/doctype/payment_terms_template/payment_terms_template.py +25,Combined invoice portion must equal 100%,合併發票部分必須等於100%
-DocType: Item Default,Default Expense Account,預設費用帳戶
-DocType: GST Account,CGST Account,CGST賬戶
+DocType: Item Default,Default Expense Account,預設費用科目
+DocType: GST Account,CGST Account,CGST科目
apps/erpnext/erpnext/education/report/student_and_guardian_contact_details/student_and_guardian_contact_details.py +53,Student Email ID,學生的電子郵件ID
DocType: POS Closing Voucher Invoices,POS Closing Voucher Invoices,POS關閉憑證發票
DocType: Tax Rule,Sales Tax Template,銷售稅模板
@@ -5523,7 +5523,7 @@
For Example: If you are selling Laptops and Backpacks separately and have a special price if the customer buys both, then the Laptop + Backpack will be a new Product Bundle Item.
-Note: BOM = Bill of Materials",聚合組** **項目到另一個項目** **的。如果你是捆綁了一定**項目你保持股票的包裝**項目的**,而不是聚集**項這是一個有用的**到一個包和**。包** **項目將有“是股票項目”為“否”和“是銷售項目”為“是”。例如:如果你是銷售筆記本電腦和背包分開,並有一個特殊的價格,如果客戶購買兩個,那麼筆記本電腦+背包將是一個新的產品包項目。注:物料BOM =比爾
+Note: BOM = Bill of Materials",聚合組** **項目到另一個項目** **的。如果你是捆綁了一定**項目你保持庫存的包裝**項目的**,而不是聚集**項這是一個有用的**到一個包和**。包** **項目將有“是庫存項目”為“否”和“是銷售項目”為“是”。例如:如果你是銷售筆記本電腦和背包分開,並有一個特殊的價格,如果客戶購買兩個,那麼筆記本電腦+背包將是一個新的產品包項目。注:物料BOM =比爾
apps/erpnext/erpnext/selling/doctype/installation_note/installation_note.py +42,Serial No is mandatory for Item {0},項目{0}的序列號是強制性的
DocType: Item Variant Attribute,Attribute,屬性
DocType: Staffing Plan Detail,Current Count,當前計數
@@ -5564,7 +5564,7 @@
apps/erpnext/erpnext/accounts/report/asset_depreciations_and_balances/asset_depreciations_and_balances.py +191,Net Asset value as on,淨資產值作為
DocType: Crop,Produce,生產
DocType: Hotel Settings,Default Taxes and Charges,默認稅費
-DocType: Account,Receivable,應收賬款
+DocType: Account,Receivable,應收帳款
apps/erpnext/erpnext/selling/doctype/sales_order/sales_order.py +325,Row #{0}: Not allowed to change Supplier as Purchase Order already exists,行#{0}:不能更改供應商的採購訂單已經存在
DocType: Stock Entry,Material Consumption for Manufacture,材料消耗製造
DocType: Item Alternative,Alternative Item Code,替代項目代碼
@@ -5603,7 +5603,7 @@
apps/erpnext/erpnext/accounts/report/trial_balance/trial_balance.py +49,To Date should be within the Fiscal Year. Assuming To Date = {0},日期應該是在財政年度內。假設終止日期= {0}
DocType: Employee,"Here you can maintain height, weight, allergies, medical concerns etc",在這裡,你可以保持身高,體重,過敏,醫療問題等
DocType: Leave Block List,Applies to Company,適用於公司
-apps/erpnext/erpnext/manufacturing/doctype/production_order/production_order.py +222,Cannot cancel because submitted Stock Entry {0} exists,不能取消,因為提交股票輸入{0}存在
+apps/erpnext/erpnext/manufacturing/doctype/production_order/production_order.py +222,Cannot cancel because submitted Stock Entry {0} exists,不能取消,因為提交庫存輸入{0}存在
DocType: BOM Update Tool,Update latest price in all BOMs,更新所有BOM的最新價格
apps/erpnext/erpnext/healthcare/doctype/patient/patient.js +24,Medical Record,醫療記錄
DocType: Vehicle,Vehicle,車輛
@@ -5613,13 +5613,13 @@
DocType: POS Profile,Item Groups,項目組
DocType: Sales Order Item,For Production,對於生產
DocType: Payment Request,payment_url,payment_url
-DocType: Exchange Rate Revaluation Account,Balance In Account Currency,賬戶貨幣餘額
-apps/erpnext/erpnext/accounts/doctype/opening_invoice_creation_tool/opening_invoice_creation_tool.py +188,Please add a Temporary Opening account in Chart of Accounts,請在會計科目表中添加一個臨時開戶賬戶
+DocType: Exchange Rate Revaluation Account,Balance In Account Currency,科目貨幣餘額
+apps/erpnext/erpnext/accounts/doctype/opening_invoice_creation_tool/opening_invoice_creation_tool.py +188,Please add a Temporary Opening account in Chart of Accounts,請在會計科目表中添加一個臨時開戶科目
DocType: Customer,Customer Primary Contact,客戶主要聯繫人
DocType: Project Task,View Task,查看任務
apps/erpnext/erpnext/crm/report/campaign_efficiency/campaign_efficiency.py +22,Opp/Lead %,Opp / Lead%
apps/erpnext/erpnext/crm/report/campaign_efficiency/campaign_efficiency.py +22,Opp/Lead %,Opp / Lead%
-DocType: Bank Guarantee,Bank Account Info,銀行賬戶信息
+DocType: Bank Guarantee,Bank Account Info,銀行科目信息
DocType: Bank Guarantee,Bank Guarantee Type,銀行擔保類型
DocType: Payment Schedule,Invoice Portion,發票部分
,Asset Depreciations and Balances,資產折舊和平衡
@@ -5701,7 +5701,7 @@
DocType: Delivery Stop,Email Sent To,電子郵件發送給
DocType: Job Card Item,Job Card Item,工作卡項目
DocType: Accounts Settings,Allow Cost Center In Entry of Balance Sheet Account,允許成本中心輸入資產負債表科目
-apps/erpnext/erpnext/accounts/doctype/account/account.js +102,Merge with Existing Account,與現有帳戶合併
+apps/erpnext/erpnext/accounts/doctype/account/account.js +102,Merge with Existing Account,與現有科目合併
apps/erpnext/erpnext/stock/doctype/stock_entry/stock_entry.py +992,All items have already been transferred for this Work Order.,所有項目已經為此工作單轉移。
DocType: Appraisal,"Any other remarks, noteworthy effort that should go in the records.",任何其他言論,值得一提的努力,應該在記錄中。
DocType: Asset Maintenance,Manufacturing User,製造業用戶
@@ -5739,14 +5739,14 @@
DocType: Certification Application,Name of Applicant,申請人名稱
apps/erpnext/erpnext/config/manufacturing.py +27,Time Sheet for manufacturing.,時間表製造。
apps/erpnext/erpnext/templates/pages/cart.html +37,Subtotal,小計
-apps/erpnext/erpnext/stock/doctype/item/item.py +731,Cannot change Variant properties after stock transaction. You will have to make a new Item to do this.,股票交易後不能更改Variant屬性。你將不得不做一個新的項目來做到這一點。
+apps/erpnext/erpnext/stock/doctype/item/item.py +731,Cannot change Variant properties after stock transaction. You will have to make a new Item to do this.,庫存交易後不能更改Variant屬性。你將不得不做一個新的項目來做到這一點。
apps/erpnext/erpnext/config/integrations.py +18,GoCardless SEPA Mandate,GoCardless SEPA授權
DocType: Healthcare Practitioner,Charges,收費
DocType: Production Plan,Get Items For Work Order,獲取工作訂單的物品
DocType: Salary Detail,Default Amount,預設數量
apps/erpnext/erpnext/stock/doctype/stock_reconciliation/stock_reconciliation.py +96,Warehouse not found in the system,倉庫系統中未找到
DocType: Quality Inspection Reading,Quality Inspection Reading,質量檢驗閱讀
-apps/erpnext/erpnext/stock/doctype/stock_settings/stock_settings.py +26,`Freeze Stocks Older Than` should be smaller than %d days.,`凍結股票早於`應該是少於%d天。
+apps/erpnext/erpnext/stock/doctype/stock_settings/stock_settings.py +26,`Freeze Stocks Older Than` should be smaller than %d days.,`凍結庫存早於`應該是少於%d天。
DocType: Tax Rule,Purchase Tax Template,購置稅模板
apps/erpnext/erpnext/utilities/user_progress.py +48,Set a sales goal you'd like to achieve for your company.,為您的公司設定您想要實現的銷售目標。
apps/erpnext/erpnext/accounts/doctype/sales_invoice/sales_invoice.js +1553,Healthcare Services,醫療服務
@@ -5781,7 +5781,7 @@
DocType: Warranty Claim,Resolved By,議決
apps/erpnext/erpnext/healthcare/doctype/patient_encounter/patient_encounter.js +32,Schedule Discharge,附表卸貨
apps/erpnext/erpnext/accounts/report/bank_reconciliation_statement/bank_reconciliation_statement.py +42,Cheques and Deposits incorrectly cleared,支票及存款不正確清除
-apps/erpnext/erpnext/accounts/doctype/account/account.py +53,Account {0}: You can not assign itself as parent account,帳戶{0}:你不能指定自己為父帳戶
+apps/erpnext/erpnext/accounts/doctype/account/account.py +53,Account {0}: You can not assign itself as parent account,科目{0}:你不能指定自己為上層科目
DocType: Purchase Invoice Item,Price List Rate,價格列表費率
apps/erpnext/erpnext/utilities/activation.py +72,Create customer quotes,創建客戶報價
apps/erpnext/erpnext/public/js/controllers/transaction.js +885,Service Stop Date cannot be after Service End Date,服務停止日期不能在服務結束日期之後
@@ -5817,7 +5817,7 @@
DocType: Employee Leave Approver,Employee Leave Approver,員工請假審批
apps/erpnext/erpnext/stock/doctype/item/item.py +541,Row {0}: An Reorder entry already exists for this warehouse {1},行{0}:一個重新排序條目已存在這個倉庫{1}
apps/erpnext/erpnext/crm/doctype/opportunity/opportunity.py +99,"Cannot declare as lost, because Quotation has been made.",不能聲明為丟失,因為報價已經取得進展。
-apps/erpnext/erpnext/accounts/doctype/account/chart_of_accounts/verified/standard_chart_of_accounts.py +68,CWIP Account,CWIP賬戶
+apps/erpnext/erpnext/accounts/doctype/account/chart_of_accounts/verified/standard_chart_of_accounts.py +68,CWIP Account,CWIP科目
apps/erpnext/erpnext/hr/doctype/training_event/training_event.js +16,Training Feedback,培訓反饋
apps/erpnext/erpnext/config/accounts.py +184,Tax Withholding rates to be applied on transactions.,稅收預扣稅率適用於交易。
DocType: Supplier Scorecard Criteria,Supplier Scorecard Criteria,供應商記分卡標準
@@ -5850,7 +5850,7 @@
apps/erpnext/erpnext/stock/stock_ledger.py +386,{0} units of {1} needed in {2} on {3} {4} for {5} to complete this transaction.,{0} {1}在需要{2}在{3} {4}:{5}來完成這一交易單位。
DocType: Fee Schedule,Student Category,學生組
DocType: Announcement,Student,學生
-apps/erpnext/erpnext/healthcare/doctype/clinical_procedure/clinical_procedure.js +98,Stock quantity to start procedure is not available in the warehouse. Do you want to record a Stock Transfer,倉庫中不提供開始操作的庫存數量。你想記錄股票轉移嗎?
+apps/erpnext/erpnext/healthcare/doctype/clinical_procedure/clinical_procedure.js +98,Stock quantity to start procedure is not available in the warehouse. Do you want to record a Stock Transfer,倉庫中不提供開始操作的庫存數量。你想記錄庫存轉移嗎?
DocType: Shipping Rule,Shipping Rule Type,運輸規則類型
apps/erpnext/erpnext/utilities/user_progress.py +239,Go to Rooms,去房間
apps/erpnext/erpnext/hr/doctype/payroll_entry/payroll_entry.js +259,"Company, Payment Account, From Date and To Date is mandatory",公司,付款帳戶,從日期和日期是強制性的
@@ -5871,7 +5871,7 @@
DocType: Staffing Plan,Staffing Plan Details,人員配置計劃詳情
,Serial No Service Contract Expiry,序號服務合同到期
DocType: Employee Health Insurance,Employee Health Insurance,員工健康保險
-apps/erpnext/erpnext/accounts/doctype/journal_entry/journal_entry.py +331,You cannot credit and debit same account at the same time,你無法將貸方與借方在同一時間記在同一帳戶
+apps/erpnext/erpnext/accounts/doctype/journal_entry/journal_entry.py +331,You cannot credit and debit same account at the same time,你無法將貸方與借方在同一時間記在同一科目
DocType: Vital Signs,Adults' pulse rate is anywhere between 50 and 80 beats per minute.,成年人的脈率在每分鐘50到80次之間。
DocType: Naming Series,Help HTML,HTML幫助
DocType: Student Group Creation Tool,Student Group Creation Tool,學生組創建工具
@@ -5954,7 +5954,7 @@
DocType: Student Attendance,Present,現在
apps/erpnext/erpnext/stock/doctype/packing_slip/packing_slip.py +37,Delivery Note {0} must not be submitted,送貨單{0}不能提交
DocType: Notification Control,Sales Invoice Message,銷售發票訊息
-apps/erpnext/erpnext/accounts/doctype/period_closing_voucher/period_closing_voucher.py +27,Closing Account {0} must be of type Liability / Equity,關閉帳戶{0}的類型必須是負債/權益
+apps/erpnext/erpnext/accounts/doctype/period_closing_voucher/period_closing_voucher.py +27,Closing Account {0} must be of type Liability / Equity,關閉科目{0}的類型必須是負債/權益
apps/erpnext/erpnext/hr/doctype/salary_slip/salary_slip.py +407,Salary Slip of employee {0} already created for time sheet {1},員工的工資單{0}已為時間表創建{1}
DocType: Production Plan Item,Ordered Qty,訂購數量
apps/erpnext/erpnext/stock/doctype/item/item.py +822,Item {0} is disabled,項目{0}無效
@@ -5997,11 +5997,11 @@
DocType: Employee External Work History,Salary,薪水
DocType: Serial No,Delivery Document Type,交付文件類型
DocType: Item Variant Settings,Do not update variants on save,不要在保存時更新變體
-DocType: Email Digest,Receivables,應收賬款
+DocType: Email Digest,Receivables,應收帳款
DocType: Lead Source,Lead Source,主導來源
DocType: Customer,Additional information regarding the customer.,對於客戶的其他訊息。
DocType: Quality Inspection Reading,Reading 5,閱讀5
-apps/erpnext/erpnext/accounts/doctype/payment_entry/payment_entry.py +237,"{0} {1} is associated with {2}, but Party Account is {3}","{0} {1} 與 {2} 關聯, 但當事方帳戶為 {3}"
+apps/erpnext/erpnext/accounts/doctype/payment_entry/payment_entry.py +237,"{0} {1} is associated with {2}, but Party Account is {3}","{0} {1} 與 {2} 關聯, 但當事方科目為 {3}"
DocType: Bank Statement Settings Item,Bank Header,銀行標題
apps/erpnext/erpnext/healthcare/doctype/sample_collection/sample_collection.js +7,View Lab Tests,查看實驗室測試
DocType: Hub Users,Hub Users,Hub用戶
@@ -6060,12 +6060,12 @@
DocType: Fees,Student Details,學生細節
DocType: Purchase Invoice Item,Stock Qty,庫存數量
DocType: Purchase Invoice Item,Stock Qty,庫存數量
-DocType: QuickBooks Migrator,Default Shipping Account,默認運輸帳戶
+DocType: QuickBooks Migrator,Default Shipping Account,默認運輸科目
DocType: Loan,Repayment Period in Months,在月還款期
apps/erpnext/erpnext/templates/includes/footer/footer_extension.html +26,Error: Not a valid id?,錯誤:沒有有效的身份證?
DocType: Naming Series,Update Series Number,更新序列號
DocType: Account,Equity,公平
-apps/erpnext/erpnext/accounts/doctype/gl_entry/gl_entry.py +79,{0} {1}: 'Profit and Loss' type account {2} not allowed in Opening Entry,{0} {1}:“損益”帳戶類型{2}不允許進入開
+apps/erpnext/erpnext/accounts/doctype/gl_entry/gl_entry.py +79,{0} {1}: 'Profit and Loss' type account {2} not allowed in Opening Entry,{0} {1}:“損益”科目類型{2}不允許進入開
DocType: Job Offer,Printing Details,印刷詳情
DocType: Task,Closing Date,截止日期
DocType: Sales Order Item,Produced Quantity,生產的產品數量
@@ -6075,14 +6075,14 @@
DocType: Journal Entry,Total Amount Currency,總金額幣種
apps/erpnext/erpnext/stock/report/bom_search/bom_search.js +38,Search Sub Assemblies,搜索子組件
apps/erpnext/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py +200,Item Code required at Row No {0},於列{0}需要產品編號
-DocType: GST Account,SGST Account,SGST賬戶
+DocType: GST Account,SGST Account,SGST科目
apps/erpnext/erpnext/utilities/user_progress.py +154,Go to Items,轉到項目
DocType: Sales Partner,Partner Type,合作夥伴類型
apps/erpnext/erpnext/accounts/report/budget_variance_report/budget_variance_report.py +72,Actual,實際
DocType: Restaurant Menu,Restaurant Manager,餐廳經理
DocType: Authorization Rule,Customerwise Discount,Customerwise折扣
apps/erpnext/erpnext/config/projects.py +46,Timesheet for tasks.,時間表的任務。
-DocType: Purchase Invoice,Against Expense Account,對費用帳戶
+DocType: Purchase Invoice,Against Expense Account,對費用科目
apps/erpnext/erpnext/stock/doctype/delivery_note/delivery_note.py +287,Installation Note {0} has already been submitted,安裝注意{0}已提交
DocType: Bank Reconciliation,Get Payment Entries,獲取付款項
DocType: Quotation Item,Against Docname,對Docname
@@ -6098,7 +6098,7 @@
apps/erpnext/erpnext/setup/doctype/naming_series/naming_series.py +67,Series Updated,系列更新
apps/erpnext/erpnext/accounts/doctype/account/account.py +166,Report Type is mandatory,報告類型是強制性的
DocType: Item,Serial Number Series,序列號系列
-apps/erpnext/erpnext/buying/utils.py +68,Warehouse is mandatory for stock Item {0} in row {1},倉庫是強制性的股票項目{0}行{1}
+apps/erpnext/erpnext/buying/utils.py +68,Warehouse is mandatory for stock Item {0} in row {1},倉庫是強制性的庫存項目{0}行{1}
apps/erpnext/erpnext/setup/setup_wizard/data/industry_type.py +45,Retail & Wholesale,零售及批發
DocType: Issue,First Responded On,首先作出回應
DocType: Website Item Group,Cross Listing of Item in multiple groups,在多組項目的交叉上市
@@ -6146,7 +6146,7 @@
DocType: Employee Tax Exemption Declaration Category,Exemption Category,豁免類別
apps/erpnext/erpnext/accounts/doctype/account/account.py +131,Currency can not be changed after making entries using some other currency,貨幣不能使用其他貨幣進行輸入後更改
DocType: Vehicle Service,Clutch Plate,離合器壓盤
-DocType: Company,Round Off Account,四捨五入賬戶
+DocType: Company,Round Off Account,四捨五入科目
apps/erpnext/erpnext/accounts/doctype/account/chart_of_accounts/verified/standard_chart_of_accounts.py +100,Administrative Expenses,行政開支
apps/erpnext/erpnext/setup/setup_wizard/data/industry_type.py +18,Consulting,諮詢
DocType: Subscription Plan,Based on price list,基於價格表
@@ -6157,7 +6157,7 @@
apps/erpnext/erpnext/education/doctype/fee_schedule/fee_schedule_list.js +11,Fee Creation Pending,費用創作待定
DocType: Appraisal Goal,Score Earned,得分
DocType: Asset Category,Asset Category Name,資產類別名稱
-apps/erpnext/erpnext/setup/doctype/territory/territory.js +13,This is a root territory and cannot be edited.,集團或Ledger ,借方或貸方,是特等帳戶
+apps/erpnext/erpnext/setup/doctype/territory/territory.js +13,This is a root territory and cannot be edited.,集團或Ledger ,借方或貸方,是特等科目
apps/erpnext/erpnext/setup/doctype/sales_person/sales_person_tree.js +5,New Sales Person Name,新銷售人員的姓名
DocType: Packing Slip,Gross Weight UOM,毛重計量單位
DocType: Employee Transfer,Create New Employee Id,創建新的員工ID
@@ -6170,12 +6170,12 @@
DocType: Student Group Creation Tool,Leave unchecked if you don't want to consider batch while making course based groups. ,如果您不想在製作基於課程的組時考慮批量,請不要選中。
DocType: Student Group Creation Tool,Leave unchecked if you don't want to consider batch while making course based groups. ,如果您不想在製作基於課程的組時考慮批量,請不要選中。
DocType: Asset,Frequency of Depreciation (Months),折舊率(月)
-apps/erpnext/erpnext/accounts/doctype/journal_entry/journal_entry.js +542,Credit Account,信用賬戶
+apps/erpnext/erpnext/accounts/doctype/journal_entry/journal_entry.js +542,Credit Account,信用科目
DocType: Landed Cost Item,Landed Cost Item,到岸成本項目
apps/erpnext/erpnext/accounts/report/profitability_analysis/profitability_analysis.js +58,Show zero values,顯示零值
DocType: BOM,Quantity of item obtained after manufacturing / repacking from given quantities of raw materials,製造/從原材料數量給予重新包裝後獲得的項目數量
DocType: Lab Test,Test Group,測試組
-DocType: Payment Reconciliation,Receivable / Payable Account,應收/應付賬款
+DocType: Payment Reconciliation,Receivable / Payable Account,應收/應付帳款
DocType: Delivery Note Item,Against Sales Order Item,對銷售訂單項目
DocType: Company,Company Logo,公司標誌
apps/erpnext/erpnext/stock/doctype/item/item.py +787,Please specify Attribute Value for attribute {0},請指定屬性值的屬性{0}
@@ -6199,10 +6199,10 @@
apps/erpnext/erpnext/accounts/doctype/opening_invoice_creation_tool/opening_invoice_creation_tool.py +66,Please select the Company,請選擇公司
DocType: Room,Seating Capacity,座位數
DocType: Lab Test Groups,Lab Test Groups,實驗室測試組
-apps/erpnext/erpnext/accounts/doctype/exchange_rate_revaluation/exchange_rate_revaluation.py +151,Party Type and Party is mandatory for {0} account,{0}帳戶必須使用派對類型和派對
+apps/erpnext/erpnext/accounts/doctype/exchange_rate_revaluation/exchange_rate_revaluation.py +151,Party Type and Party is mandatory for {0} account,{0}科目的參與方以及類型為必填
DocType: Project,Total Expense Claim (via Expense Claims),總費用報銷(通過費用報銷)
DocType: GST Settings,GST Summary,消費稅總結
-apps/erpnext/erpnext/hr/doctype/daily_work_summary_group/daily_work_summary_group.py +16,Please enable default incoming account before creating Daily Work Summary Group,請在創建日常工作摘要組之前啟用默認傳入帳戶
+apps/erpnext/erpnext/hr/doctype/daily_work_summary_group/daily_work_summary_group.py +16,Please enable default incoming account before creating Daily Work Summary Group,請在創建日常工作摘要組之前啟用默認傳入科目
DocType: Assessment Result,Total Score,總得分
DocType: Crop Cycle,ISO 8601 standard,ISO 8601標準
DocType: Journal Entry,Debit Note,繳費單
@@ -6222,7 +6222,7 @@
apps/erpnext/erpnext/healthcare/doctype/patient_appointment/patient_appointment.js +380,Please select Patient,請選擇患者
apps/erpnext/erpnext/accounts/report/gross_profit/gross_profit.py +74,Sales Person,銷售人員
DocType: Hotel Room Package,Amenities,設施
-DocType: QuickBooks Migrator,Undeposited Funds Account,未存入資金賬戶
+DocType: QuickBooks Migrator,Undeposited Funds Account,未存入資金科目
apps/erpnext/erpnext/config/accounts.py +201,Budget and Cost Center,預算和成本中心
apps/erpnext/erpnext/accounts/doctype/pos_profile/pos_profile.py +65,Multiple default mode of payment is not allowed,不允許多種默認付款方式
DocType: Sales Invoice,Loyalty Points Redemption,忠誠積分兌換
@@ -6230,7 +6230,7 @@
DocType: Lead,Blog Subscriber,網誌訂閱者
DocType: Guardian,Alternate Number,備用號碼
apps/erpnext/erpnext/config/setup.py +83,Create rules to restrict transactions based on values.,創建規則來限制基於價值的交易。
-DocType: Cash Flow Mapping Accounts,Cash Flow Mapping Accounts,現金流量映射賬戶
+DocType: Cash Flow Mapping Accounts,Cash Flow Mapping Accounts,現金流量映射科目
apps/erpnext/erpnext/education/report/student_and_guardian_contact_details/student_and_guardian_contact_details.py +49, Group Roll No,組卷號
DocType: Batch,Manufacturing Date,生產日期
apps/erpnext/erpnext/education/doctype/fee_schedule/fee_schedule_list.js +9,Fee Creation Failed,費用創作失敗
@@ -6283,7 +6283,7 @@
DocType: Additional Salary,Employee Name,員工姓名
DocType: Restaurant Order Entry Item,Restaurant Order Entry Item,餐廳訂單錄入項目
DocType: Purchase Invoice,Rounded Total (Company Currency),整數總計(公司貨幣)
-apps/erpnext/erpnext/accounts/doctype/account/account.py +103,Cannot covert to Group because Account Type is selected.,不能隱蔽到組,因為帳戶類型選擇的。
+apps/erpnext/erpnext/accounts/doctype/account/account.py +103,Cannot covert to Group because Account Type is selected.,不能轉換到群組科目,因為科目類型選擇的。
apps/erpnext/erpnext/selling/doctype/sales_order/sales_order.py +276,{0} {1} has been modified. Please refresh.,{0} {1} 已修改。請更新。
DocType: Leave Block List,Stop users from making Leave Applications on following days.,停止用戶在下面日期提出休假申請。
apps/erpnext/erpnext/accounts/doctype/loyalty_program/loyalty_program.js +24,"If unlimited expiry for the Loyalty Points, keep the Expiry Duration empty or 0.",如果忠誠度積分無限期到期,請將到期時間保持為空或0。
@@ -6312,7 +6312,7 @@
apps/erpnext/erpnext/accounts/doctype/journal_entry/journal_entry.py +578,Row No {0}: Amount cannot be greater than Pending Amount against Expense Claim {1}. Pending Amount is {2},行無{0}:金額不能大於金額之前對報銷{1}。待審核金額為{2}
DocType: Patient Service Unit,Medical Administrator,醫療管理員
DocType: Assessment Plan,Schedule,時間表
-DocType: Account,Parent Account,父帳戶
+DocType: Account,Parent Account,上層科目
DocType: Quality Inspection Reading,Reading 3,閱讀3
DocType: Stock Entry,Source Warehouse Address,來源倉庫地址
DocType: GL Entry,Voucher Type,憑證類型
@@ -6356,7 +6356,7 @@
DocType: Employee Promotion,Employee Promotion,員工晉升
DocType: Maintenance Team Member,Maintenance Team Member,維護團隊成員
apps/erpnext/erpnext/education/report/course_wise_assessment_report/course_wise_assessment_report.html +16,Course Code: ,課程編號:
-apps/erpnext/erpnext/stock/doctype/stock_reconciliation/stock_reconciliation.py +241,Please enter Expense Account,請輸入您的費用帳戶
+apps/erpnext/erpnext/stock/doctype/stock_reconciliation/stock_reconciliation.py +241,Please enter Expense Account,請輸入您的費用科目
DocType: Account,Stock,庫存
apps/erpnext/erpnext/accounts/doctype/payment_entry/payment_entry.js +1128,"Row #{0}: Reference Document Type must be one of Purchase Order, Purchase Invoice or Journal Entry",行#{0}:參考文件類型必須是採購訂單之一,購買發票或日記帳分錄
DocType: Employee,Current Address,當前地址
@@ -6372,7 +6372,7 @@
DocType: Bank Statement Transaction Entry,Bank Statement Transaction Entry,銀行對賬單交易分錄
DocType: Sales Invoice Item,Discount and Margin,折扣和保證金
DocType: Lab Test,Prescription,處方
-DocType: Company,Default Deferred Revenue Account,默認遞延收入賬戶
+DocType: Company,Default Deferred Revenue Account,默認遞延收入科目
DocType: Project,Second Email,第二封郵件
DocType: Budget,Action if Annual Budget Exceeded on Actual,年度預算超出實際的行動
DocType: Pricing Rule,Min Qty,最小數量
@@ -6394,7 +6394,7 @@
apps/erpnext/erpnext/accounts/doctype/pos_profile/pos_profile.py +62,Set default mode of payment,設置默認付款方式
DocType: BOM,With Operations,加入作業
DocType: Support Search Source,Post Route Key List,發布路由密鑰列表
-apps/erpnext/erpnext/accounts/party.py +288,Accounting entries have already been made in currency {0} for company {1}. Please select a receivable or payable account with currency {0}.,會計分錄已取得貨幣{0}為公司{1}。請選擇一個應收或應付賬戶幣種{0}。
+apps/erpnext/erpnext/accounts/party.py +288,Accounting entries have already been made in currency {0} for company {1}. Please select a receivable or payable account with currency {0}.,會計分錄已取得貨幣{0}為公司{1}。請選擇一個應收或應付科目幣種{0}。
DocType: Asset,Is Existing Asset,是對現有資產
DocType: Salary Component,Statistical Component,統計組成部分
DocType: Salary Component,Statistical Component,統計組成部分
@@ -6482,7 +6482,7 @@
DocType: Packing Slip,Package Weight Details,包裝重量詳情
DocType: Leave Type,Is Compensatory,是有補償的
DocType: Restaurant Reservation,Reservation Time,預訂時間
-DocType: Payment Gateway Account,Payment Gateway Account,網路支付閘道帳戶
+DocType: Payment Gateway Account,Payment Gateway Account,網路支付閘道科目
DocType: Shopping Cart Settings,After payment completion redirect user to selected page.,支付完成後重定向用戶選擇的頁面。
DocType: Company,Existing Company,現有的公司
DocType: Healthcare Settings,Result Emailed,電子郵件結果
@@ -6507,7 +6507,7 @@
,Item-wise Purchase Register,項目明智的購買登記
DocType: Loyalty Point Entry,Expiry Date,到期時間
DocType: Healthcare Settings,Employee name and designation in print,員工姓名和印刷品名稱
-,accounts-browser,賬戶瀏覽器
+,accounts-browser,科目瀏覽器
apps/erpnext/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.js +381,Please select Category first,請先選擇分類
apps/erpnext/erpnext/config/projects.py +13,Project master.,專案主持。
apps/erpnext/erpnext/controllers/status_updater.py +215,"To allow over-billing or over-ordering, update ""Allowance"" in Stock Settings or the Item.",要允許對賬單或過度訂貨,庫存設置或更新項目“津貼”。
@@ -6526,11 +6526,11 @@
apps/erpnext/erpnext/controllers/accounts_controller.py +693,Row #{0}: Posting Date must be same as purchase date {1} of asset {2},行#{0}:過帳日期必須是相同的購買日期{1}資產的{2}
DocType: Program Enrollment,Check this if the Student is residing at the Institute's Hostel.,如果學生住在學院的旅館,請檢查。
apps/erpnext/erpnext/manufacturing/doctype/production_planning_tool/production_planning_tool.py +125,Please enter Sales Orders in the above table,請在上表中輸入銷售訂單
-,Stock Summary,股票摘要
+,Stock Summary,庫存摘要
apps/erpnext/erpnext/config/assets.py +62,Transfer an asset from one warehouse to another,從一個倉庫轉移資產到另一
DocType: Employee Benefit Application,Remaining Benefits (Yearly),剩餘福利(每年)
apps/erpnext/erpnext/stock/doctype/material_request/material_request.js +873,Bill of Materials,材料清單
-apps/erpnext/erpnext/accounts/doctype/journal_entry/journal_entry.py +137,Row {0}: Party Type and Party is required for Receivable / Payable account {1},行{0}:黨的類型和黨的需要應收/應付帳戶{1}
+apps/erpnext/erpnext/accounts/doctype/journal_entry/journal_entry.py +137,Row {0}: Party Type and Party is required for Receivable / Payable account {1},行{0}:參與方類型和參與方需要應收/應付科目{1}
DocType: Employee,Leave Policy,離開政策
apps/erpnext/erpnext/buying/doctype/purchase_order/purchase_order.js +865,Update Items,更新項目
apps/erpnext/erpnext/accounts/report/bank_reconciliation_statement/bank_reconciliation_statement.py +94,Ref Date,參考日期
@@ -6542,7 +6542,7 @@
DocType: Department,Expense Approvers,費用審批人
apps/erpnext/erpnext/accounts/doctype/journal_entry/journal_entry.py +228,Row {0}: Debit entry can not be linked with a {1},行{0}:借方條目不能與{1}連接
DocType: Journal Entry,Subscription Section,認購科
-apps/erpnext/erpnext/accounts/doctype/account/account.py +238,Account {0} does not exist,帳戶{0}不存在
+apps/erpnext/erpnext/accounts/doctype/account/account.py +238,Account {0} does not exist,科目{0}不存在
DocType: Training Event,Training Program,培訓計劃
DocType: Account,Cash,現金
DocType: Employee,Short biography for website and other publications.,網站和其他出版物的短的傳記。
diff --git a/erpnext/utilities/bulk_transaction.py b/erpnext/utilities/bulk_transaction.py
index eed7c12..c1579b3 100644
--- a/erpnext/utilities/bulk_transaction.py
+++ b/erpnext/utilities/bulk_transaction.py
@@ -73,7 +73,7 @@
},
"Sales Invoice": {
"Delivery Note": sales_invoice.make_delivery_note,
- "Payment": payment_entry.get_payment_entry,
+ "Payment Entry": payment_entry.get_payment_entry,
},
"Delivery Note": {
"Sales Invoice": delivery_note.make_sales_invoice,
@@ -94,11 +94,11 @@
},
"Purchase Invoice": {
"Purchase Receipt": purchase_invoice.make_purchase_receipt,
- "Payment": payment_entry.get_payment_entry,
+ "Payment Entry": payment_entry.get_payment_entry,
},
"Purchase Receipt": {"Purchase Invoice": purchase_receipt.make_purchase_invoice},
}
- if to_doctype in ["Advance Payment", "Payment"]:
+ if to_doctype in ["Advance Payment", "Payment Entry"]:
obj = mapper[from_doctype][to_doctype](from_doctype, doc_name)
else:
obj = mapper[from_doctype][to_doctype](doc_name)
@@ -151,7 +151,9 @@
def show_job_status(fail_count, deserialized_data_count, to_doctype):
if not fail_count:
frappe.msgprint(
- _("Creation of {0} successful").format(to_doctype),
+ _("Creation of <b><a href='/app/{0}'>{1}(s)</a></b> successful").format(
+ to_doctype.lower().replace(" ", "-"), to_doctype
+ ),
title="Successful",
indicator="green",
)
diff --git a/erpnext/utilities/doctype/video/video.py b/erpnext/utilities/doctype/video/video.py
index 15dbccd..13b7877 100644
--- a/erpnext/utilities/doctype/video/video.py
+++ b/erpnext/utilities/doctype/video/video.py
@@ -59,7 +59,7 @@
"Video Settings", "Video Settings", ["enable_youtube_tracking", "frequency"]
)
- if not enable_youtube_tracking:
+ if not cint(enable_youtube_tracking):
return
frequency = get_frequency(frequency)