diff --git a/.github/workflows/server-tests-mariadb.yml b/.github/workflows/server-tests-mariadb.yml index e3b92fd269..ed731b8a31 100644 --- a/.github/workflows/server-tests-mariadb.yml +++ b/.github/workflows/server-tests-mariadb.yml @@ -120,7 +120,7 @@ jobs: 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/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 3b07d5181e..58d67beb67 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/bank_clearance/bank_clearance.js b/erpnext/accounts/doctype/bank_clearance/bank_clearance.js index 63cc46518f..7e57c2fc47 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 @@ frappe.ui.form.on("Bank Clearance", { 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/budget/budget.json b/erpnext/accounts/doctype/budget/budget.json index fc4dd200ea..f0566f4436 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 5527f9fb99..637ac7a04c 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 DuplicateBudgetError(frappe.ValidationError): 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 @@ class Budget(Document): ): 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 @@ def validate_expense_against_budget(args): ) # 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 c48c7d97a2..11af9a29f6 100644 --- a/erpnext/accounts/doctype/budget/test_budget.py +++ b/erpnext/accounts/doctype/budget/test_budget.py @@ -334,6 +334,39 @@ class TestBudget(unittest.TestCase): 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/journal_entry/journal_entry.js b/erpnext/accounts/doctype/journal_entry/journal_entry.js index 7af41f398a..a5ff7f1aa7 100644 --- a/erpnext/accounts/doctype/journal_entry/journal_entry.js +++ b/erpnext/accounts/doctype/journal_entry/journal_entry.js @@ -173,8 +173,8 @@ frappe.ui.form.on("Journal Entry", { var update_jv_details = function(doc, r) { $.each(r, function(i, d) { var row = frappe.model.add_child(doc, "Journal Entry Account", "accounts"); - row.account = d.account; - row.balance = d.balance; + frappe.model.set_value(row.doctype, row.name, "account", d.account) + frappe.model.set_value(row.doctype, row.name, "balance", d.balance) }); refresh_field("accounts"); } @@ -312,8 +312,7 @@ erpnext.accounts.JournalEntry = class JournalEntry extends frappe.ui.form.Contro } } - 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 52690e1e66..de012b28ec 100644 --- a/erpnext/accounts/doctype/journal_entry/journal_entry.py +++ b/erpnext/accounts/doctype/journal_entry/journal_entry.py @@ -1210,6 +1210,7 @@ def get_outstanding(args): 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 @@ def get_outstanding(args): 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 @@ def get_outstanding(args): "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 dff883aef9..47ad19e0f9 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/opening_invoice_creation_tool/opening_invoice_creation_tool.js b/erpnext/accounts/doctype/opening_invoice_creation_tool/opening_invoice_creation_tool.js index 7eb5c4234d..1f4166151a 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 @@ -22,13 +22,13 @@ frappe.ui.form.on('Opening Invoice Creation Tool', { } 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 +51,6 @@ frappe.ui.form.on('Opening Invoice Creation Tool', { 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 f7df1ff4a1..57fe4059c7 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,8 +255,6 @@ def start_import(invoices): def publish(index, total, doctype): - if total < 50: - return frappe.publish_realtime( "opening_invoice_creation_progress", dict( diff --git a/erpnext/accounts/doctype/payment_entry/payment_entry.py b/erpnext/accounts/doctype/payment_entry/payment_entry.py index 7f245fd083..94874894b0 100644 --- a/erpnext/accounts/doctype/payment_entry/payment_entry.py +++ b/erpnext/accounts/doctype/payment_entry/payment_entry.py @@ -995,7 +995,9 @@ class PaymentEntry(AccountsController): 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 a71b19e092..fc6dbba7e7 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 @@ class TestPaymentLedgerEntry(FrappeTestCase): 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 @@ class TestPaymentLedgerEntry(FrappeTestCase): ] 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_invoice/pos_invoice.json b/erpnext/accounts/doctype/pos_invoice/pos_invoice.json index 6f8b3822c2..eedaaaf338 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 fbe0ef39f8..54a3e934b2 100644 --- a/erpnext/accounts/doctype/pos_invoice/pos_invoice.py +++ b/erpnext/accounts/doctype/pos_invoice/pos_invoice.py @@ -743,7 +743,3 @@ def add_return_modes(doc, pos_profile): ]: 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 70f128e0e3..3132fdd259 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 @@ class TestPOSInvoice(unittest.TestCase): 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/pricing_rule/pricing_rule.json b/erpnext/accounts/doctype/pricing_rule/pricing_rule.json index 6e7ebd1414..ce9ce647db 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 9af3188e47..ed46d85e3a 100644 --- a/erpnext/accounts/doctype/pricing_rule/pricing_rule.py +++ b/erpnext/accounts/doctype/pricing_rule/pricing_rule.py @@ -24,6 +24,7 @@ class PricingRule(Document): 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 @@ class PricingRule(Document): 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 @@ def get_serial_no_for_item(args): 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 @@ def get_pricing_rule_for_item(args, price_list_rate=0, doc=None, for_validate=Fa 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 @@ def apply_price_discount_rule(pricing_rule, item_details, args): 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 0a9db6b0f5..d27f65eba0 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 @@ class TestPricingRule(unittest.TestCase): 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 @@ class TestPricingRule(unittest.TestCase): 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 1f29d732ba..bb54b23e26 100644 --- a/erpnext/accounts/doctype/pricing_rule/utils.py +++ b/erpnext/accounts/doctype/pricing_rule/utils.py @@ -111,6 +111,12 @@ def _get_pricing_rules(apply_on, args, values): ) 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 @@ def _get_pricing_rules(apply_on, args, values): 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 @@ def get_product_discount_rule(pricing_rule, item_details, args=None, doc=None): 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 7dd77fbb3c..7dd5ef36f2 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 @@ frappe.ui.form.on('Process Statement Of Accounts', { 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 @@ frappe.ui.form.on('Process Statement Of Accounts', { }); }); 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 a26267ba5e..83e637077e 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 @@ -27,6 +27,7 @@ "customers", "preferences", "orientation", + "include_break", "include_ageing", "ageing_based_on", "section_break_14", @@ -284,10 +285,16 @@ "fieldtype": "Link", "label": "Terms and Conditions", "options": "Terms and Conditions" + }, + { + "default": "1", + "fieldname": "include_break", + "fieldtype": "Check", + "label": "Page Break After Each SoA" } ], "links": [], - "modified": "2021-09-06 21:00:45.732505", + "modified": "2022-10-17 17:47:08.662475", "modified_by": "Administrator", "module": "Accounts", "name": "Process Statement Of Accounts", @@ -321,5 +328,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 01f716daa2..c6b0c57ce5 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 copy 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 @@ -128,7 +129,8 @@ def get_report_pdf(doc, consolidated=True): if not bool(statement_dict): return False elif consolidated: - result = "".join(list(statement_dict.values())) + delimiter = '
' 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 +242,6 @@ def fetch_customers(customer_collection, collection_name, primary_mandatory): 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 +273,12 @@ def get_customer_emails(customer_name, primary_mandatory, billing_and_primary=Tr 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 +317,8 @@ def send_emails(document_name, from_scheduler=False): 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 ec861a2787..39a623519a 100644 --- a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.js +++ b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.js @@ -31,7 +31,7 @@ erpnext.accounts.PurchaseInvoice = class PurchaseInvoice extends erpnext.buying. 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 @@ frappe.ui.form.on("Purchase Invoice", { 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 4fb879c0d2..25b128b893 100644 --- a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.json +++ b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.json @@ -1,1515 +1,1586 @@ { - "actions": [], - "allow_import": 1, - "autoname": "naming_series:", - "creation": "2013-05-21 16:16:39", - "doctype": "DocType", - "document_type": "Document", - "engine": "InnoDB", - "field_order": [ - "title", - "naming_series", - "supplier", - "supplier_name", - "tax_id", - "due_date", - "tax_withholding_category", - "column_break1", - "company", - "posting_date", - "posting_time", - "set_posting_time", - "is_paid", - "is_return", - "apply_tds", - "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", - "column_break2", - "buying_price_list", - "price_list_currency", - "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", - "items", - "pricing_rule_details", - "pricing_rules", - "raw_materials_supplied", - "supplied_items", - "section_break_26", - "total_qty", - "base_total", - "base_net_total", - "column_break_28", - "total_net_weight", - "total", - "net_total", - "tax_withholding_net_total", - "taxes_section", - "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", - "base_total_taxes_and_charges", - "column_break_40", - "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", - "base_rounded_total", - "base_in_words", - "column_break8", - "grand_total", - "rounding_adjustment", - "rounded_total", - "in_words", - "total_advance", - "outstanding_amount", - "disable_rounded_total", - "payments_section", - "mode_of_payment", - "cash_bank_account", - "clearance_date", - "col_br_payments", - "paid_amount", - "base_paid_amount", - "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", - "payment_schedule_section", - "payment_terms_template", - "ignore_default_payment_terms_template", - "payment_schedule", - "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", - "status", - "inter_company_invoice_reference", - "represents_company", - "column_break_147", - "is_internal_supplier", - "accounting_details_section", - "credit_to", - "party_account_currency", - "is_opening", - "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" - ], - "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, - "oldfieldname": "naming_series", - "oldfieldtype": "Select", - "options": "ACC-PINV-.YYYY.-\nACC-PINV-RET-.YYYY.-", - "print_hide": 1, - "reqd": 1, - "set_only_once": 1 - }, - { - "fieldname": "supplier", - "fieldtype": "Link", - "in_standard_filter": 1, - "label": "Supplier", - "oldfieldname": "supplier", - "oldfieldtype": "Link", - "options": "Supplier", - "print_hide": 1, - "reqd": 1, - "search_index": 1 - }, - { - "bold": 1, - "depends_on": "supplier", - "fetch_from": "supplier.supplier_name", - "fieldname": "supplier_name", - "fieldtype": "Data", - "in_global_search": 1, - "label": "Supplier Name", - "oldfieldname": "supplier_name", - "oldfieldtype": "Data", - "read_only": 1 - }, - { - "fetch_from": "supplier.tax_id", - "fieldname": "tax_id", - "fieldtype": "Read Only", - "label": "Tax Id", - "print_hide": 1, - "read_only": 1 - }, - { - "fieldname": "due_date", - "fieldtype": "Date", - "label": "Due Date", - "oldfieldname": "due_date", - "oldfieldtype": "Date" - }, - { - "default": "0", - "fieldname": "is_paid", - "fieldtype": "Check", - "label": "Is Paid", - "print_hide": 1 - }, - { - "default": "0", - "fieldname": "is_return", - "fieldtype": "Check", - "label": "Is Return (Debit Note)", - "no_copy": 1, - "print_hide": 1 - }, - { - "default": "0", - "fieldname": "apply_tds", - "fieldtype": "Check", - "label": "Apply Tax Withholding Amount", - "print_hide": 1 - }, - { - "fieldname": "column_break1", - "fieldtype": "Column Break", - "oldfieldtype": "Column Break", - "width": "50%" - }, - { - "fieldname": "company", - "fieldtype": "Link", - "in_standard_filter": 1, - "label": "Company", - "options": "Company", - "print_hide": 1, - "remember_last_selected_value": 1 - }, - { - "fieldname": "cost_center", - "fieldtype": "Link", - "label": "Cost Center", - "options": "Cost Center" - }, - { - "default": "Today", - "fieldname": "posting_date", - "fieldtype": "Date", - "in_list_view": 1, - "label": "Date", - "oldfieldname": "posting_date", - "oldfieldtype": "Date", - "print_hide": 1, - "reqd": 1, - "search_index": 1 - }, - { - "fieldname": "posting_time", - "fieldtype": "Time", - "label": "Posting Time", - "no_copy": 1, - "print_hide": 1, - "print_width": "100px", - "width": "100px" - }, - { - "default": "0", - "depends_on": "eval:doc.docstatus==0", - "fieldname": "set_posting_time", - "fieldtype": "Check", - "label": "Edit Posting Date and Time", - "print_hide": 1 - }, - { - "fieldname": "amended_from", - "fieldtype": "Link", - "ignore_user_permissions": 1, - "label": "Amended From", - "no_copy": 1, - "oldfieldname": "amended_from", - "oldfieldtype": "Link", - "options": "Purchase Invoice", - "print_hide": 1, - "read_only": 1 - }, - { - "collapsible": 1, - "collapsible_depends_on": "eval:doc.on_hold", - "fieldname": "sb_14", - "fieldtype": "Section Break", - "label": "Hold Invoice" - }, - { - "default": "0", - "fieldname": "on_hold", - "fieldtype": "Check", - "label": "Hold Invoice" - }, - { - "depends_on": "eval:doc.on_hold", - "description": "Once set, this invoice will be on hold till the set date", - "fieldname": "release_date", - "fieldtype": "Date", - "label": "Release Date" - }, - { - "fieldname": "cb_17", - "fieldtype": "Column Break" - }, - { - "depends_on": "eval:doc.on_hold", - "fieldname": "hold_comment", - "fieldtype": "Small Text", - "label": "Reason For Putting On Hold" - }, - { - "collapsible": 1, - "collapsible_depends_on": "bill_no", - "fieldname": "supplier_invoice_details", - "fieldtype": "Section Break", - "label": "Supplier Invoice Details" - }, - { - "fieldname": "bill_no", - "fieldtype": "Data", - "label": "Supplier Invoice No", - "oldfieldname": "bill_no", - "oldfieldtype": "Data", - "print_hide": 1 - }, - { - "fieldname": "column_break_15", - "fieldtype": "Column Break" - }, - { - "fieldname": "bill_date", - "fieldtype": "Date", - "label": "Supplier Invoice Date", - "no_copy": 1, - "oldfieldname": "bill_date", - "oldfieldtype": "Date", - "print_hide": 1 - }, - { - "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", - "no_copy": 1, - "options": "Purchase Invoice", - "print_hide": 1, - "read_only": 1 - }, - { - "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": "address_display", - "fieldtype": "Small Text", - "label": "Address", - "read_only": 1 - }, - { - "fieldname": "contact_person", - "fieldtype": "Link", - "in_global_search": 1, - "label": "Contact Person", - "options": "Contact", - "print_hide": 1 - }, - { - "fieldname": "contact_display", - "fieldtype": "Small Text", - "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", - "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 - }, - { - "collapsible": 1, - "fieldname": "currency_and_price_list", - "fieldtype": "Section Break", - "label": "Currency and Price List", - "options": "fa fa-tag" - }, - { - "fieldname": "currency", - "fieldtype": "Link", - "label": "Currency", - "oldfieldname": "currency", - "oldfieldtype": "Select", - "options": "Currency", - "print_hide": 1 - }, - { - "fieldname": "conversion_rate", - "fieldtype": "Float", - "label": "Exchange Rate", - "oldfieldname": "conversion_rate", - "oldfieldtype": "Currency", - "precision": "9", - "print_hide": 1 - }, - { - "fieldname": "column_break2", - "fieldtype": "Column Break" - }, - { - "fieldname": "buying_price_list", - "fieldtype": "Link", - "label": "Price List", - "options": "Price List", - "print_hide": 1 - }, - { - "fieldname": "price_list_currency", - "fieldtype": "Link", - "label": "Price List Currency", - "options": "Currency", - "print_hide": 1, - "read_only": 1 - }, - { - "fieldname": "plc_conversion_rate", - "fieldtype": "Float", - "label": "Price List Exchange Rate", - "precision": "9", - "print_hide": 1 - }, - { - "default": "0", - "fieldname": "ignore_pricing_rule", - "fieldtype": "Check", - "label": "Ignore Pricing Rule", - "permlevel": 1, - "print_hide": 1 - }, - { - "fieldname": "sec_warehouse", - "fieldtype": "Section Break" - }, - { - "depends_on": "update_stock", - "description": "Sets 'Accepted Warehouse' in each row of the items table.", - "fieldname": "set_warehouse", - "fieldtype": "Link", - "label": "Set Accepted Warehouse", - "options": "Warehouse", - "print_hide": 1 - }, - { - "depends_on": "update_stock", - "description": "Warehouse where you are maintaining stock of rejected items", - "fieldname": "rejected_warehouse", - "fieldtype": "Link", - "label": "Rejected Warehouse", - "no_copy": 1, - "options": "Warehouse", - "print_hide": 1 - }, - { - "fieldname": "col_break_warehouse", - "fieldtype": "Column Break" - }, - { - "default": "0", - "fieldname": "is_subcontracted", - "fieldtype": "Check", - "label": "Is Subcontracted", - "print_hide": 1, - "read_only": 1 - }, - { - "fieldname": "items_section", - "fieldtype": "Section Break", - "oldfieldtype": "Section Break", - "options": "fa fa-shopping-cart" - }, - { - "default": "0", - "fieldname": "update_stock", - "fieldtype": "Check", - "label": "Update Stock", - "print_hide": 1 - }, - { - "fieldname": "scan_barcode", - "fieldtype": "Data", - "label": "Scan Barcode", - "options": "Barcode" - }, - { - "allow_bulk_edit": 1, - "fieldname": "items", - "fieldtype": "Table", - "label": "Items", - "oldfieldname": "entries", - "oldfieldtype": "Table", - "options": "Purchase Invoice Item", - "reqd": 1 - }, - { - "fieldname": "pricing_rule_details", - "fieldtype": "Section Break", - "label": "Pricing Rules" - }, - { - "fieldname": "pricing_rules", - "fieldtype": "Table", - "label": "Pricing Rule Detail", - "options": "Pricing Rule Detail", - "read_only": 1 - }, - { - "collapsible_depends_on": "supplied_items", - "fieldname": "raw_materials_supplied", - "fieldtype": "Section Break", - "label": "Raw Materials Supplied" - }, - { - "depends_on": "update_stock", - "fieldname": "supplied_items", - "fieldtype": "Table", - "label": "Supplied Items", - "no_copy": 1, - "options": "Purchase Receipt Item Supplied" - }, - { - "fieldname": "section_break_26", - "fieldtype": "Section Break" - }, - { - "fieldname": "total_qty", - "fieldtype": "Float", - "label": "Total Quantity", - "read_only": 1 - }, - { - "fieldname": "base_total", - "fieldtype": "Currency", - "label": "Total (Company Currency)", - "options": "Company:company:default_currency", - "print_hide": 1, - "read_only": 1 - }, - { - "fieldname": "base_net_total", - "fieldtype": "Currency", - "label": "Net Total (Company Currency)", - "oldfieldname": "net_total", - "oldfieldtype": "Currency", - "options": "Company:company:default_currency", - "print_hide": 1, - "read_only": 1 - }, - { - "fieldname": "column_break_28", - "fieldtype": "Column Break" - }, - { - "fieldname": "total", - "fieldtype": "Currency", - "label": "Total", - "options": "currency", - "read_only": 1 - }, - { - "fieldname": "net_total", - "fieldtype": "Currency", - "label": "Net Total", - "oldfieldname": "net_total_import", - "oldfieldtype": "Currency", - "options": "currency", - "print_hide": 1, - "read_only": 1 - }, - { - "fieldname": "total_net_weight", - "fieldtype": "Float", - "label": "Total Net Weight", - "print_hide": 1, - "read_only": 1 - }, - { - "fieldname": "taxes_section", - "fieldtype": "Section Break", - "oldfieldtype": "Section Break", - "options": "fa fa-money" - }, - { - "fieldname": "tax_category", - "fieldtype": "Link", - "label": "Tax Category", - "options": "Tax Category", - "print_hide": 1 - }, - { - "fieldname": "column_break_49", - "fieldtype": "Column Break" - }, - { - "fieldname": "shipping_rule", - "fieldtype": "Link", - "label": "Shipping Rule", - "options": "Shipping Rule", - "print_hide": 1 - }, - { - "fieldname": "section_break_51", - "fieldtype": "Section Break" - }, - { - "fieldname": "taxes_and_charges", - "fieldtype": "Link", - "label": "Purchase Taxes and Charges Template", - "oldfieldname": "purchase_other_charges", - "oldfieldtype": "Link", - "options": "Purchase Taxes and Charges Template", - "print_hide": 1 - }, - { - "fieldname": "taxes", - "fieldtype": "Table", - "label": "Purchase Taxes and Charges", - "oldfieldname": "purchase_tax_details", - "oldfieldtype": "Table", - "options": "Purchase Taxes and Charges" - }, - { - "collapsible": 1, - "fieldname": "sec_tax_breakup", - "fieldtype": "Section Break", - "label": "Tax Breakup" - }, - { - "fieldname": "other_charges_calculation", - "fieldtype": "Long Text", - "label": "Taxes and Charges Calculation", - "no_copy": 1, - "oldfieldtype": "HTML", - "print_hide": 1, - "read_only": 1 - }, - { - "fieldname": "totals", - "fieldtype": "Section Break", - "oldfieldtype": "Section Break", - "options": "fa fa-money" - }, - { - "fieldname": "base_taxes_and_charges_added", - "fieldtype": "Currency", - "label": "Taxes and Charges Added (Company Currency)", - "oldfieldname": "other_charges_added", - "oldfieldtype": "Currency", - "options": "Company:company:default_currency", - "print_hide": 1, - "read_only": 1 - }, - { - "fieldname": "base_taxes_and_charges_deducted", - "fieldtype": "Currency", - "label": "Taxes and Charges Deducted (Company Currency)", - "oldfieldname": "other_charges_deducted", - "oldfieldtype": "Currency", - "options": "Company:company:default_currency", - "print_hide": 1, - "read_only": 1 - }, - { - "fieldname": "base_total_taxes_and_charges", - "fieldtype": "Currency", - "label": "Total Taxes and Charges (Company Currency)", - "oldfieldname": "total_tax", - "oldfieldtype": "Currency", - "options": "Company:company:default_currency", - "print_hide": 1, - "read_only": 1 - }, - { - "fieldname": "column_break_40", - "fieldtype": "Column Break" - }, - { - "fieldname": "taxes_and_charges_added", - "fieldtype": "Currency", - "label": "Taxes and Charges Added", - "oldfieldname": "other_charges_added_import", - "oldfieldtype": "Currency", - "options": "currency", - "print_hide": 1, - "read_only": 1 - }, - { - "fieldname": "taxes_and_charges_deducted", - "fieldtype": "Currency", - "label": "Taxes and Charges Deducted", - "oldfieldname": "other_charges_deducted_import", - "oldfieldtype": "Currency", - "options": "currency", - "print_hide": 1, - "read_only": 1 - }, - { - "fieldname": "total_taxes_and_charges", - "fieldtype": "Currency", - "label": "Total Taxes and Charges", - "options": "currency", - "print_hide": 1, - "read_only": 1 - }, - { - "collapsible": 1, - "collapsible_depends_on": "discount_amount", - "fieldname": "section_break_44", - "fieldtype": "Section Break", - "label": "Additional Discount" - }, - { - "default": "Grand Total", - "fieldname": "apply_discount_on", - "fieldtype": "Select", - "label": "Apply Additional Discount On", - "options": "\nGrand Total\nNet Total", - "print_hide": 1 - }, - { - "fieldname": "base_discount_amount", - "fieldtype": "Currency", - "label": "Additional Discount Amount (Company Currency)", - "options": "Company:company:default_currency", - "print_hide": 1, - "read_only": 1 - }, - { - "fieldname": "column_break_46", - "fieldtype": "Column Break" - }, - { - "fieldname": "additional_discount_percentage", - "fieldtype": "Float", - "label": "Additional Discount Percentage", - "print_hide": 1 - }, - { - "fieldname": "discount_amount", - "fieldtype": "Currency", - "label": "Additional Discount Amount", - "options": "currency", - "print_hide": 1 - }, - { - "fieldname": "section_break_49", - "fieldtype": "Section Break" - }, - { - "fieldname": "base_grand_total", - "fieldtype": "Currency", - "label": "Grand Total (Company Currency)", - "oldfieldname": "grand_total", - "oldfieldtype": "Currency", - "options": "Company:company:default_currency", - "print_hide": 1, - "read_only": 1 - }, - { - "depends_on": "eval:!doc.disable_rounded_total", - "fieldname": "base_rounding_adjustment", - "fieldtype": "Currency", - "label": "Rounding Adjustment (Company Currency)", - "no_copy": 1, - "options": "Company:company:default_currency", - "print_hide": 1, - "read_only": 1 - }, - { - "depends_on": "eval:!doc.disable_rounded_total", - "fieldname": "base_rounded_total", - "fieldtype": "Currency", - "label": "Rounded Total (Company Currency)", - "no_copy": 1, - "options": "Company:company:default_currency", - "print_hide": 1, - "read_only": 1 - }, - { - "fieldname": "base_in_words", - "fieldtype": "Data", - "label": "In Words (Company Currency)", - "length": 240, - "oldfieldname": "in_words", - "oldfieldtype": "Data", - "print_hide": 1, - "read_only": 1 - }, - { - "fieldname": "column_break8", - "fieldtype": "Column Break", - "oldfieldtype": "Column Break", - "print_hide": 1, - "width": "50%" - }, - { - "fieldname": "grand_total", - "fieldtype": "Currency", - "in_list_view": 1, - "label": "Grand Total", - "oldfieldname": "grand_total_import", - "oldfieldtype": "Currency", - "options": "currency", - "read_only": 1 - }, - { - "depends_on": "eval:!doc.disable_rounded_total", - "fieldname": "rounding_adjustment", - "fieldtype": "Currency", - "label": "Rounding Adjustment", - "no_copy": 1, - "options": "currency", - "print_hide": 1, - "read_only": 1 - }, - { - "depends_on": "eval:!doc.disable_rounded_total", - "fieldname": "rounded_total", - "fieldtype": "Currency", - "label": "Rounded Total", - "no_copy": 1, - "options": "currency", - "print_hide": 1, - "read_only": 1 - }, - { - "fieldname": "in_words", - "fieldtype": "Data", - "label": "In Words", - "length": 240, - "oldfieldname": "in_words_import", - "oldfieldtype": "Data", - "print_hide": 1, - "read_only": 1 - }, - { - "fieldname": "total_advance", - "fieldtype": "Currency", - "label": "Total Advance", - "no_copy": 1, - "oldfieldname": "total_advance", - "oldfieldtype": "Currency", - "options": "party_account_currency", - "print_hide": 1, - "read_only": 1 - }, - { - "fieldname": "outstanding_amount", - "fieldtype": "Currency", - "label": "Outstanding Amount", - "no_copy": 1, - "oldfieldname": "outstanding_amount", - "oldfieldtype": "Currency", - "options": "party_account_currency", - "print_hide": 1, - "read_only": 1 - }, - { - "default": "0", - "depends_on": "grand_total", - "fieldname": "disable_rounded_total", - "fieldtype": "Check", - "label": "Disable Rounded Total" - }, - { - "collapsible": 1, - "collapsible_depends_on": "paid_amount", - "depends_on": "eval:doc.is_paid===1||(doc.advances && doc.advances.length>0)", - "fieldname": "payments_section", - "fieldtype": "Section Break", - "label": "Payments" - }, - { - "fieldname": "mode_of_payment", - "fieldtype": "Link", - "label": "Mode of Payment", - "options": "Mode of Payment", - "print_hide": 1 - }, - { - "fieldname": "cash_bank_account", - "fieldtype": "Link", - "label": "Cash/Bank Account", - "options": "Account" - }, - { - "fieldname": "clearance_date", - "fieldtype": "Date", - "label": "Clearance Date", - "no_copy": 1, - "print_hide": 1, - "read_only": 1 - }, - { - "fieldname": "col_br_payments", - "fieldtype": "Column Break" - }, - { - "depends_on": "is_paid", - "fieldname": "paid_amount", - "fieldtype": "Currency", - "label": "Paid Amount", - "no_copy": 1, - "options": "currency", - "print_hide": 1 - }, - { - "fieldname": "base_paid_amount", - "fieldtype": "Currency", - "label": "Paid Amount (Company Currency)", - "no_copy": 1, - "options": "Company:company:default_currency", - "print_hide": 1, - "read_only": 1 - }, - { - "collapsible": 1, - "collapsible_depends_on": "write_off_amount", - "depends_on": "grand_total", - "fieldname": "write_off", - "fieldtype": "Section Break", - "label": "Write Off" - }, - { - "fieldname": "write_off_amount", - "fieldtype": "Currency", - "label": "Write Off Amount", - "no_copy": 1, - "options": "currency", - "print_hide": 1 - }, - { - "fieldname": "base_write_off_amount", - "fieldtype": "Currency", - "label": "Write Off Amount (Company Currency)", - "no_copy": 1, - "options": "Company:company:default_currency", - "print_hide": 1, - "read_only": 1 - }, - { - "fieldname": "column_break_61", - "fieldtype": "Column Break" - }, - { - "depends_on": "eval:flt(doc.write_off_amount)!=0", - "fieldname": "write_off_account", - "fieldtype": "Link", - "label": "Write Off Account", - "options": "Account", - "print_hide": 1 - }, - { - "depends_on": "eval:flt(doc.write_off_amount)!=0", - "fieldname": "write_off_cost_center", - "fieldtype": "Link", - "label": "Write Off Cost Center", - "options": "Cost Center", - "print_hide": 1 - }, - { - "collapsible": 1, - "collapsible_depends_on": "advances", - "fieldname": "advances_section", - "fieldtype": "Section Break", - "label": "Advance Payments", - "oldfieldtype": "Section Break", - "options": "fa fa-money", - "print_hide": 1 - }, - { - "default": "0", - "fieldname": "allocate_advances_automatically", - "fieldtype": "Check", - "label": "Set Advances and Allocate (FIFO)" - }, - { - "depends_on": "eval:!doc.allocate_advances_automatically", - "fieldname": "get_advances", - "fieldtype": "Button", - "label": "Get Advances Paid", - "oldfieldtype": "Button", - "print_hide": 1 - }, - { - "fieldname": "advances", - "fieldtype": "Table", - "label": "Advances", - "no_copy": 1, - "oldfieldname": "advance_allocation_details", - "oldfieldtype": "Table", - "options": "Purchase Invoice Advance", - "print_hide": 1 - }, - { - "collapsible": 1, - "collapsible_depends_on": "eval:(!doc.is_return)", - "fieldname": "payment_schedule_section", - "fieldtype": "Section Break", - "label": "Payment Terms" - }, - { - "fieldname": "payment_terms_template", - "fieldtype": "Link", - "label": "Payment Terms Template", - "options": "Payment Terms Template" - }, - { - "fieldname": "payment_schedule", - "fieldtype": "Table", - "label": "Payment Schedule", - "no_copy": 1, - "options": "Payment Schedule", - "print_hide": 1 - }, - { - "collapsible": 1, - "collapsible_depends_on": "terms", - "fieldname": "terms_section_break", - "fieldtype": "Section Break", - "label": "Terms and Conditions", - "options": "fa fa-legal" - }, - { - "fieldname": "tc_name", - "fieldtype": "Link", - "label": "Terms", - "options": "Terms and Conditions", - "print_hide": 1 - }, - { - "fieldname": "terms", - "fieldtype": "Text Editor", - "label": "Terms and Conditions1" - }, - { - "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, - "default": "0", - "fieldname": "group_same_items", - "fieldtype": "Check", - "label": "Group same items", - "print_hide": 1 - }, - { - "fieldname": "column_break_112", - "fieldtype": "Column Break" - }, - { - "allow_on_submit": 1, - "fieldname": "select_print_heading", - "fieldtype": "Link", - "label": "Print Heading", - "no_copy": 1, - "oldfieldname": "select_print_heading", - "oldfieldtype": "Link", - "options": "Print Heading", - "print_hide": 1, - "report_hide": 1 - }, - { - "fieldname": "language", - "fieldtype": "Data", - "label": "Print Language", - "print_hide": 1, - "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", - "fieldtype": "Check", - "ignore_user_permissions": 1, - "label": "Is Internal Supplier", - "read_only": 1 - }, - { - "fieldname": "credit_to", - "fieldtype": "Link", - "label": "Credit To", - "oldfieldname": "credit_to", - "oldfieldtype": "Link", - "options": "Account", - "print_hide": 1, - "reqd": 1, - "search_index": 1 - }, - { - "fieldname": "party_account_currency", - "fieldtype": "Link", - "hidden": 1, - "label": "Party Account Currency", - "no_copy": 1, - "options": "Currency", - "print_hide": 1, - "read_only": 1 - }, - { - "default": "No", - "fieldname": "is_opening", - "fieldtype": "Select", - "label": "Is Opening Entry", - "oldfieldname": "is_opening", - "oldfieldtype": "Select", - "options": "No\nYes", - "print_hide": 1 - }, - { - "fieldname": "against_expense_account", - "fieldtype": "Small Text", - "hidden": 1, - "label": "Against Expense Account", - "no_copy": 1, - "oldfieldname": "against_expense_account", - "oldfieldtype": "Small Text", - "print_hide": 1 - }, - { - "fieldname": "column_break_63", - "fieldtype": "Column Break" - }, - { - "default": "Draft", - "fieldname": "status", - "fieldtype": "Select", - "in_standard_filter": 1, - "label": "Status", - "options": "\nDraft\nReturn\nDebit Note Issued\nSubmitted\nPaid\nPartly Paid\nUnpaid\nOverdue\nCancelled\nInternal Transfer", - "print_hide": 1 - }, - { - "fieldname": "inter_company_invoice_reference", - "fieldtype": "Link", - "label": "Inter Company Invoice Reference", - "no_copy": 1, - "options": "Sales Invoice", - "print_hide": 1, - "read_only": 1 - }, - { - "fieldname": "remarks", - "fieldtype": "Small Text", - "label": "Remarks", - "no_copy": 1, - "oldfieldname": "remarks", - "oldfieldtype": "Text", - "print_hide": 1 - }, - { - "collapsible": 1, - "fieldname": "subscription_section", - "fieldtype": "Section Break", - "label": "Subscription Section", - "print_hide": 1 - }, - { - "allow_on_submit": 1, - "description": "Start date of current invoice's period", - "fieldname": "from_date", - "fieldtype": "Date", - "label": "From Date", - "no_copy": 1, - "print_hide": 1 - }, - { - "allow_on_submit": 1, - "description": "End date of current invoice's period", - "fieldname": "to_date", - "fieldtype": "Date", - "label": "To Date", - "no_copy": 1, - "print_hide": 1 - }, - { - "fieldname": "column_break_114", - "fieldtype": "Column Break" - }, - { - "fieldname": "auto_repeat", - "fieldtype": "Link", - "label": "Auto Repeat", - "no_copy": 1, - "options": "Auto Repeat", - "print_hide": 1, - "read_only": 1 - }, - { - "allow_on_submit": 1, - "depends_on": "eval: doc.auto_repeat", - "fieldname": "update_auto_repeat_reference", - "fieldtype": "Button", - "label": "Update Auto Repeat Reference" - }, - { - "collapsible": 1, - "fieldname": "accounting_dimensions_section", - "fieldtype": "Section Break", - "label": "Accounting Dimensions " - }, - { - "fieldname": "dimension_col_break", - "fieldtype": "Column Break" - }, - { - "fieldname": "tax_withholding_category", - "fieldtype": "Link", - "hidden": 1, - "label": "Tax Withholding Category", - "options": "Tax Withholding Category", - "print_hide": 1 - }, - { - "fieldname": "billing_address", - "fieldtype": "Link", - "label": "Select Billing Address", - "options": "Address" - }, - { - "fieldname": "billing_address_display", - "fieldtype": "Small Text", - "label": "Billing Address", - "read_only": 1 - }, - { - "fieldname": "project", - "fieldtype": "Link", - "label": "Project", - "options": "Project" - }, - { - "depends_on": "eval:doc.is_internal_supplier", - "description": "Unrealized Profit / Loss account for intra-company transfers", - "fieldname": "unrealized_profit_loss_account", - "fieldtype": "Link", - "label": "Unrealized Profit / Loss Account", - "options": "Account" - }, - { - "depends_on": "eval:doc.is_internal_supplier", - "description": "Company which internal supplier represents", - "fetch_from": "supplier.represents_company", - "fieldname": "represents_company", - "fieldtype": "Link", - "label": "Represents Company", - "options": "Company" - }, - { - "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", - "no_copy": 1, - "options": "Warehouse", - "print_hide": 1, - "print_width": "50px", - "width": "50px" - }, - { - "depends_on": "eval:doc.is_subcontracted", - "fieldname": "supplier_warehouse", - "fieldtype": "Link", - "label": "Supplier Warehouse", - "no_copy": 1, - "options": "Warehouse", - "print_hide": 1, - "print_width": "50px", - "width": "50px" - }, - { - "fieldname": "per_received", - "fieldtype": "Percent", - "hidden": 1, - "label": "Per Received", - "no_copy": 1, - "print_hide": 1, - "read_only": 1 - }, - { - "default": "0", - "fieldname": "ignore_default_payment_terms_template", - "fieldtype": "Check", - "hidden": 1, - "label": "Ignore Default Payment Terms Template", - "read_only": 1 - }, - { - "collapsible": 1, - "fieldname": "accounting_details_section", - "fieldtype": "Section Break", - "label": "Accounting Details", - "print_hide": 1 - }, - { - "fieldname": "column_break_147", - "fieldtype": "Column Break" - }, - { - "fieldname": "advance_tax", - "fieldtype": "Table", - "hidden": 1, - "label": "Advance Tax", - "options": "Advance Tax", - "read_only": 1 - }, - { - "default": "0", - "fieldname": "is_old_subcontracting_flow", - "fieldtype": "Check", - "hidden": 1, - "label": "Is Old Subcontracting Flow", - "read_only": 1 - }, - { - "default": "0", - "fieldname": "tax_withholding_net_total", - "fieldtype": "Currency", - "label": "Tax Withholding Net Total", - "no_copy": 1, - "options": "currency", - "read_only": 1 - }, - { - "fieldname": "tax_withheld_vouchers_section", - "fieldtype": "Section Break", - "label": "Tax Withheld Vouchers" - }, - { - "fieldname": "tax_withheld_vouchers", - "fieldtype": "Table", - "label": "Tax Withheld Vouchers", - "options": "Tax Withheld Vouchers", - "read_only": 1 - } - ], - "icon": "fa fa-file-text", - "idx": 204, - "is_submittable": 1, - "links": [], - "modified": "2022-09-27 13:52:55.766844", - "modified_by": "Administrator", - "module": "Accounts", - "name": "Purchase Invoice", - "name_case": "Title Case", - "naming_rule": "By \"Naming Series\" field", - "owner": "Administrator", - "permissions": [ - { - "amend": 1, - "cancel": 1, - "create": 1, - "email": 1, - "print": 1, - "read": 1, - "report": 1, - "role": "Accounts User", - "share": 1, - "submit": 1, - "write": 1 - }, - { - "email": 1, - "print": 1, - "read": 1, - "report": 1, - "role": "Purchase User" - }, - { - "amend": 1, - "cancel": 1, - "create": 1, - "delete": 1, - "email": 1, - "print": 1, - "read": 1, - "report": 1, - "role": "Accounts Manager", - "share": 1, - "submit": 1, - "write": 1 - }, - { - "email": 1, - "print": 1, - "read": 1, - "report": 1, - "role": "Auditor" - }, - { - "permlevel": 1, - "read": 1, - "role": "Accounts Manager", - "write": 1 - } - ], - "search_fields": "posting_date, supplier, bill_no, base_grand_total, outstanding_amount", - "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 + "actions": [], + "allow_import": 1, + "autoname": "naming_series:", + "creation": "2013-05-21 16:16:39", + "doctype": "DocType", + "document_type": "Document", + "engine": "InnoDB", + "field_order": [ + "title", + "naming_series", + "supplier", + "supplier_name", + "tax_id", + "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", + "currency_and_price_list", + "currency", + "conversion_rate", + "column_break2", + "buying_price_list", + "price_list_currency", + "plc_conversion_rate", + "ignore_pricing_rule", + "sec_warehouse", + "scan_barcode", + "col_break_warehouse", + "update_stock", + "set_warehouse", + "set_from_warehouse", + "is_subcontracted", + "rejected_warehouse", + "supplier_warehouse", + "items_section", + "items", + "section_break_26", + "total_qty", + "total_net_weight", + "column_break_50", + "base_total", + "base_net_total", + "column_break_28", + "total", + "net_total", + "taxes_section", + "taxes_and_charges", + "column_break_58", + "tax_category", + "column_break_49", + "shipping_rule", + "section_break_51", + "taxes", + "totals", + "base_taxes_and_charges_added", + "base_taxes_and_charges_deducted", + "base_total_taxes_and_charges", + "column_break_40", + "taxes_and_charges_added", + "taxes_and_charges_deducted", + "total_taxes_and_charges", + "section_break_49", + "base_grand_total", + "base_rounding_adjustment", + "base_rounded_total", + "base_in_words", + "column_break8", + "grand_total", + "rounding_adjustment", + "rounded_total", + "in_words", + "total_advance", + "outstanding_amount", + "disable_rounded_total", + "section_break_44", + "apply_discount_on", + "base_discount_amount", + "additional_discount_account", + "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", + "base_paid_amount", + "clearance_date", + "col_br_payments", + "cash_bank_account", + "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", + "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", + "payment_schedule", + "terms_section_break", + "tc_name", + "terms", + "more_info_tab", + "status_section", + "status", + "column_break_177", + "per_received", + "supplier_invoice_details", + "bill_no", + "column_break_15", + "bill_date", + "accounting_details_section", + "credit_to", + "party_account_currency", + "is_opening", + "against_expense_account", + "column_break_63", + "unrealized_profit_loss_account", + "subscription_section", + "auto_repeat", + "update_auto_repeat_reference", + "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": [ + { + "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, + "oldfieldname": "naming_series", + "oldfieldtype": "Select", + "options": "ACC-PINV-.YYYY.-\nACC-PINV-RET-.YYYY.-", + "print_hide": 1, + "reqd": 1, + "set_only_once": 1 + }, + { + "fieldname": "supplier", + "fieldtype": "Link", + "in_standard_filter": 1, + "label": "Supplier", + "oldfieldname": "supplier", + "oldfieldtype": "Link", + "options": "Supplier", + "print_hide": 1, + "reqd": 1, + "search_index": 1 + }, + { + "bold": 1, + "depends_on": "supplier", + "fetch_from": "supplier.supplier_name", + "fieldname": "supplier_name", + "fieldtype": "Data", + "in_global_search": 1, + "label": "Supplier Name", + "oldfieldname": "supplier_name", + "oldfieldtype": "Data", + "read_only": 1 + }, + { + "fetch_from": "supplier.tax_id", + "fieldname": "tax_id", + "fieldtype": "Read Only", + "label": "Tax Id", + "print_hide": 1, + "read_only": 1 + }, + { + "fieldname": "due_date", + "fieldtype": "Date", + "label": "Due Date", + "oldfieldname": "due_date", + "oldfieldtype": "Date" + }, + { + "default": "0", + "fieldname": "is_paid", + "fieldtype": "Check", + "label": "Is Paid", + "print_hide": 1 + }, + { + "default": "0", + "fieldname": "is_return", + "fieldtype": "Check", + "label": "Is Return (Debit Note)", + "no_copy": 1, + "print_hide": 1 + }, + { + "default": "0", + "fieldname": "apply_tds", + "fieldtype": "Check", + "label": "Apply Tax Withholding Amount", + "print_hide": 1 + }, + { + "fieldname": "column_break1", + "fieldtype": "Column Break", + "oldfieldtype": "Column Break", + "width": "50%" + }, + { + "fieldname": "company", + "fieldtype": "Link", + "in_standard_filter": 1, + "label": "Company", + "options": "Company", + "print_hide": 1, + "remember_last_selected_value": 1 + }, + { + "fieldname": "cost_center", + "fieldtype": "Link", + "label": "Cost Center", + "options": "Cost Center" + }, + { + "default": "Today", + "fieldname": "posting_date", + "fieldtype": "Date", + "in_list_view": 1, + "label": "Date", + "oldfieldname": "posting_date", + "oldfieldtype": "Date", + "print_hide": 1, + "reqd": 1, + "search_index": 1 + }, + { + "fieldname": "posting_time", + "fieldtype": "Time", + "label": "Posting Time", + "no_copy": 1, + "print_hide": 1, + "print_width": "100px", + "width": "100px" + }, + { + "default": "0", + "depends_on": "eval:doc.docstatus==0", + "fieldname": "set_posting_time", + "fieldtype": "Check", + "label": "Edit Posting Date and Time", + "print_hide": 1 + }, + { + "fieldname": "amended_from", + "fieldtype": "Link", + "ignore_user_permissions": 1, + "label": "Amended From", + "no_copy": 1, + "oldfieldname": "amended_from", + "oldfieldtype": "Link", + "options": "Purchase Invoice", + "print_hide": 1, + "read_only": 1 + }, + { + "collapsible": 1, + "collapsible_depends_on": "eval:doc.on_hold", + "fieldname": "sb_14", + "fieldtype": "Section Break", + "label": "Hold Invoice" + }, + { + "default": "0", + "fieldname": "on_hold", + "fieldtype": "Check", + "label": "Hold Invoice" + }, + { + "depends_on": "eval:doc.on_hold", + "description": "Once set, this invoice will be on hold till the set date", + "fieldname": "release_date", + "fieldtype": "Date", + "label": "Release Date" + }, + { + "fieldname": "cb_17", + "fieldtype": "Column Break" + }, + { + "depends_on": "eval:doc.on_hold", + "fieldname": "hold_comment", + "fieldtype": "Small Text", + "label": "Reason For Putting On Hold" + }, + { + "collapsible": 1, + "collapsible_depends_on": "bill_no", + "fieldname": "supplier_invoice_details", + "fieldtype": "Section Break", + "label": "Supplier Invoice" + }, + { + "fieldname": "bill_no", + "fieldtype": "Data", + "label": "Supplier Invoice No", + "oldfieldname": "bill_no", + "oldfieldtype": "Data", + "print_hide": 1 + }, + { + "fieldname": "column_break_15", + "fieldtype": "Column Break" + }, + { + "fieldname": "bill_date", + "fieldtype": "Date", + "label": "Supplier Invoice Date", + "no_copy": 1, + "oldfieldname": "bill_date", + "oldfieldtype": "Date", + "print_hide": 1 + }, + { + "depends_on": "return_against", + "fieldname": "return_against", + "fieldtype": "Link", + "label": "Return Against Purchase Invoice", + "no_copy": 1, + "options": "Purchase Invoice", + "print_hide": 1, + "read_only": 1 + }, + { + "fieldname": "section_addresses", + "fieldtype": "Section Break", + "label": "Supplier Address" + }, + { + "fieldname": "supplier_address", + "fieldtype": "Link", + "label": "Select Supplier Address", + "options": "Address", + "print_hide": 1 + }, + { + "fieldname": "address_display", + "fieldtype": "Small Text", + "label": "Address", + "read_only": 1 + }, + { + "fieldname": "contact_person", + "fieldtype": "Link", + "in_global_search": 1, + "label": "Contact Person", + "options": "Contact", + "print_hide": 1 + }, + { + "fieldname": "contact_display", + "fieldtype": "Small Text", + "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", + "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 + }, + { + "collapsible": 1, + "fieldname": "currency_and_price_list", + "fieldtype": "Section Break", + "label": "Currency and Price List", + "options": "fa fa-tag" + }, + { + "fieldname": "currency", + "fieldtype": "Link", + "label": "Currency", + "oldfieldname": "currency", + "oldfieldtype": "Select", + "options": "Currency", + "print_hide": 1 + }, + { + "fieldname": "conversion_rate", + "fieldtype": "Float", + "label": "Exchange Rate", + "oldfieldname": "conversion_rate", + "oldfieldtype": "Currency", + "precision": "9", + "print_hide": 1 + }, + { + "fieldname": "column_break2", + "fieldtype": "Column Break" + }, + { + "fieldname": "buying_price_list", + "fieldtype": "Link", + "label": "Price List", + "options": "Price List", + "print_hide": 1 + }, + { + "fieldname": "price_list_currency", + "fieldtype": "Link", + "label": "Price List Currency", + "options": "Currency", + "print_hide": 1, + "read_only": 1 + }, + { + "fieldname": "plc_conversion_rate", + "fieldtype": "Float", + "label": "Price List Exchange Rate", + "precision": "9", + "print_hide": 1 + }, + { + "default": "0", + "fieldname": "ignore_pricing_rule", + "fieldtype": "Check", + "label": "Ignore Pricing Rule", + "permlevel": 1, + "print_hide": 1 + }, + { + "fieldname": "sec_warehouse", + "fieldtype": "Section Break", + "hide_border": 1, + "label": "Items" + }, + { + "depends_on": "update_stock", + "fieldname": "set_warehouse", + "fieldtype": "Link", + "label": "Set Accepted Warehouse", + "options": "Warehouse", + "print_hide": 1 + }, + { + "depends_on": "update_stock", + "fieldname": "rejected_warehouse", + "fieldtype": "Link", + "label": "Rejected Warehouse", + "no_copy": 1, + "options": "Warehouse", + "print_hide": 1 + }, + { + "fieldname": "col_break_warehouse", + "fieldtype": "Column Break" + }, + { + "default": "0", + "fieldname": "is_subcontracted", + "fieldtype": "Check", + "label": "Is Subcontracted", + "print_hide": 1, + "read_only": 1 + }, + { + "fieldname": "items_section", + "fieldtype": "Section Break", + "hide_border": 1, + "oldfieldtype": "Section Break", + "options": "fa fa-shopping-cart" + }, + { + "default": "0", + "fieldname": "update_stock", + "fieldtype": "Check", + "label": "Update Stock", + "print_hide": 1 + }, + { + "fieldname": "scan_barcode", + "fieldtype": "Data", + "label": "Scan Barcode", + "options": "Barcode" + }, + { + "allow_bulk_edit": 1, + "fieldname": "items", + "fieldtype": "Table", + "label": "Items", + "oldfieldname": "entries", + "oldfieldtype": "Table", + "options": "Purchase Invoice Item", + "reqd": 1 + }, + { + "collapsible": 1, + "fieldname": "pricing_rule_details", + "fieldtype": "Section Break", + "label": "Pricing Rules" + }, + { + "fieldname": "pricing_rules", + "fieldtype": "Table", + "label": "Pricing Rule Detail", + "options": "Pricing Rule Detail", + "read_only": 1 + }, + { + "collapsible": 1, + "collapsible_depends_on": "supplied_items", + "fieldname": "raw_materials_supplied", + "fieldtype": "Section Break", + "label": "Raw Materials Supplied" + }, + { + "depends_on": "update_stock", + "fieldname": "supplied_items", + "fieldtype": "Table", + "label": "Supplied Items", + "no_copy": 1, + "options": "Purchase Receipt Item Supplied" + }, + { + "fieldname": "section_break_26", + "fieldtype": "Section Break" + }, + { + "fieldname": "total_qty", + "fieldtype": "Float", + "label": "Total Quantity", + "read_only": 1 + }, + { + "fieldname": "base_total", + "fieldtype": "Currency", + "label": "Total (Company Currency)", + "options": "Company:company:default_currency", + "print_hide": 1, + "read_only": 1 + }, + { + "fieldname": "base_net_total", + "fieldtype": "Currency", + "label": "Net Total (Company Currency)", + "oldfieldname": "net_total", + "oldfieldtype": "Currency", + "options": "Company:company:default_currency", + "print_hide": 1, + "read_only": 1 + }, + { + "fieldname": "column_break_28", + "fieldtype": "Column Break" + }, + { + "fieldname": "total", + "fieldtype": "Currency", + "label": "Total", + "options": "currency", + "read_only": 1 + }, + { + "fieldname": "net_total", + "fieldtype": "Currency", + "label": "Net Total", + "oldfieldname": "net_total_import", + "oldfieldtype": "Currency", + "options": "currency", + "print_hide": 1, + "read_only": 1 + }, + { + "depends_on": "total_net_weight", + "fieldname": "total_net_weight", + "fieldtype": "Float", + "label": "Total Net Weight", + "print_hide": 1, + "read_only": 1 + }, + { + "fieldname": "taxes_section", + "fieldtype": "Section Break", + "hide_border": 1, + "label": "Taxes and Charges", + "oldfieldtype": "Section Break", + "options": "fa fa-money" + }, + { + "fieldname": "tax_category", + "fieldtype": "Link", + "label": "Tax Category", + "options": "Tax Category", + "print_hide": 1 + }, + { + "fieldname": "column_break_49", + "fieldtype": "Column Break" + }, + { + "fieldname": "shipping_rule", + "fieldtype": "Link", + "label": "Shipping Rule", + "options": "Shipping Rule", + "print_hide": 1 + }, + { + "fieldname": "section_break_51", + "fieldtype": "Section Break", + "hide_border": 1 + }, + { + "fieldname": "taxes_and_charges", + "fieldtype": "Link", + "label": "Purchase Taxes and Charges Template", + "oldfieldname": "purchase_other_charges", + "oldfieldtype": "Link", + "options": "Purchase Taxes and Charges Template", + "print_hide": 1 + }, + { + "fieldname": "taxes", + "fieldtype": "Table", + "label": "Purchase Taxes and Charges", + "oldfieldname": "purchase_tax_details", + "oldfieldtype": "Table", + "options": "Purchase Taxes and Charges" + }, + { + "collapsible": 1, + "fieldname": "sec_tax_breakup", + "fieldtype": "Section Break", + "label": "Tax Breakup" + }, + { + "fieldname": "other_charges_calculation", + "fieldtype": "Long Text", + "label": "Taxes and Charges Calculation", + "no_copy": 1, + "oldfieldtype": "HTML", + "print_hide": 1, + "read_only": 1 + }, + { + "fieldname": "totals", + "fieldtype": "Section Break", + "oldfieldtype": "Section Break", + "options": "fa fa-money" + }, + { + "fieldname": "base_taxes_and_charges_added", + "fieldtype": "Currency", + "label": "Taxes and Charges Added (Company Currency)", + "oldfieldname": "other_charges_added", + "oldfieldtype": "Currency", + "options": "Company:company:default_currency", + "print_hide": 1, + "read_only": 1 + }, + { + "fieldname": "base_taxes_and_charges_deducted", + "fieldtype": "Currency", + "label": "Taxes and Charges Deducted (Company Currency)", + "oldfieldname": "other_charges_deducted", + "oldfieldtype": "Currency", + "options": "Company:company:default_currency", + "print_hide": 1, + "read_only": 1 + }, + { + "fieldname": "base_total_taxes_and_charges", + "fieldtype": "Currency", + "label": "Total Taxes and Charges (Company Currency)", + "oldfieldname": "total_tax", + "oldfieldtype": "Currency", + "options": "Company:company:default_currency", + "print_hide": 1, + "read_only": 1 + }, + { + "fieldname": "column_break_40", + "fieldtype": "Column Break" + }, + { + "fieldname": "taxes_and_charges_added", + "fieldtype": "Currency", + "label": "Taxes and Charges Added", + "oldfieldname": "other_charges_added_import", + "oldfieldtype": "Currency", + "options": "currency", + "print_hide": 1, + "read_only": 1 + }, + { + "fieldname": "taxes_and_charges_deducted", + "fieldtype": "Currency", + "label": "Taxes and Charges Deducted", + "oldfieldname": "other_charges_deducted_import", + "oldfieldtype": "Currency", + "options": "currency", + "print_hide": 1, + "read_only": 1 + }, + { + "fieldname": "total_taxes_and_charges", + "fieldtype": "Currency", + "label": "Total Taxes and Charges", + "options": "currency", + "print_hide": 1, + "read_only": 1 + }, + { + "collapsible": 1, + "fieldname": "section_break_44", + "fieldtype": "Section Break", + "label": "Additional Discount" + }, + { + "default": "Grand Total", + "fieldname": "apply_discount_on", + "fieldtype": "Select", + "label": "Apply Additional Discount On", + "options": "\nGrand Total\nNet Total", + "print_hide": 1 + }, + { + "fieldname": "base_discount_amount", + "fieldtype": "Currency", + "label": "Additional Discount Amount (Company Currency)", + "options": "Company:company:default_currency", + "print_hide": 1, + "read_only": 1 + }, + { + "fieldname": "column_break_46", + "fieldtype": "Column Break" + }, + { + "fieldname": "additional_discount_percentage", + "fieldtype": "Float", + "label": "Additional Discount Percentage", + "print_hide": 1 + }, + { + "fieldname": "discount_amount", + "fieldtype": "Currency", + "label": "Additional Discount Amount", + "options": "currency", + "print_hide": 1 + }, + { + "fieldname": "section_break_49", + "fieldtype": "Section Break", + "label": "Totals" + }, + { + "fieldname": "base_grand_total", + "fieldtype": "Currency", + "label": "Grand Total (Company Currency)", + "oldfieldname": "grand_total", + "oldfieldtype": "Currency", + "options": "Company:company:default_currency", + "print_hide": 1, + "read_only": 1 + }, + { + "depends_on": "eval:!doc.disable_rounded_total", + "fieldname": "base_rounding_adjustment", + "fieldtype": "Currency", + "label": "Rounding Adjustment (Company Currency)", + "no_copy": 1, + "options": "Company:company:default_currency", + "print_hide": 1, + "read_only": 1 + }, + { + "depends_on": "eval:!doc.disable_rounded_total", + "fieldname": "base_rounded_total", + "fieldtype": "Currency", + "label": "Rounded Total (Company Currency)", + "no_copy": 1, + "options": "Company:company:default_currency", + "print_hide": 1, + "read_only": 1 + }, + { + "fieldname": "base_in_words", + "fieldtype": "Data", + "label": "In Words (Company Currency)", + "length": 240, + "oldfieldname": "in_words", + "oldfieldtype": "Data", + "print_hide": 1, + "read_only": 1 + }, + { + "fieldname": "column_break8", + "fieldtype": "Column Break", + "oldfieldtype": "Column Break", + "print_hide": 1, + "width": "50%" + }, + { + "fieldname": "grand_total", + "fieldtype": "Currency", + "in_list_view": 1, + "label": "Grand Total", + "oldfieldname": "grand_total_import", + "oldfieldtype": "Currency", + "options": "currency", + "read_only": 1 + }, + { + "depends_on": "eval:!doc.disable_rounded_total", + "fieldname": "rounding_adjustment", + "fieldtype": "Currency", + "label": "Rounding Adjustment", + "no_copy": 1, + "options": "currency", + "print_hide": 1, + "read_only": 1 + }, + { + "depends_on": "eval:!doc.disable_rounded_total", + "fieldname": "rounded_total", + "fieldtype": "Currency", + "label": "Rounded Total", + "no_copy": 1, + "options": "currency", + "print_hide": 1, + "read_only": 1 + }, + { + "fieldname": "in_words", + "fieldtype": "Data", + "label": "In Words", + "length": 240, + "oldfieldname": "in_words_import", + "oldfieldtype": "Data", + "print_hide": 1, + "read_only": 1 + }, + { + "fieldname": "total_advance", + "fieldtype": "Currency", + "label": "Total Advance", + "no_copy": 1, + "oldfieldname": "total_advance", + "oldfieldtype": "Currency", + "options": "party_account_currency", + "print_hide": 1, + "read_only": 1 + }, + { + "fieldname": "outstanding_amount", + "fieldtype": "Currency", + "label": "Outstanding Amount", + "no_copy": 1, + "oldfieldname": "outstanding_amount", + "oldfieldtype": "Currency", + "options": "party_account_currency", + "print_hide": 1, + "read_only": 1 + }, + { + "default": "0", + "depends_on": "grand_total", + "fieldname": "disable_rounded_total", + "fieldtype": "Check", + "label": "Disable Rounded Total" + }, + { + "collapsible": 1, + "collapsible_depends_on": "paid_amount", + "depends_on": "eval:doc.is_paid===1||(doc.advances && doc.advances.length>0)", + "fieldname": "payments_section", + "fieldtype": "Section Break", + "label": "Payments" + }, + { + "fieldname": "mode_of_payment", + "fieldtype": "Link", + "label": "Mode of Payment", + "options": "Mode of Payment", + "print_hide": 1 + }, + { + "fieldname": "cash_bank_account", + "fieldtype": "Link", + "label": "Cash/Bank Account", + "options": "Account" + }, + { + "fieldname": "clearance_date", + "fieldtype": "Date", + "label": "Clearance Date", + "no_copy": 1, + "print_hide": 1, + "read_only": 1 + }, + { + "fieldname": "col_br_payments", + "fieldtype": "Column Break" + }, + { + "depends_on": "is_paid", + "fieldname": "paid_amount", + "fieldtype": "Currency", + "label": "Paid Amount", + "no_copy": 1, + "options": "currency", + "print_hide": 1 + }, + { + "fieldname": "base_paid_amount", + "fieldtype": "Currency", + "label": "Paid Amount (Company Currency)", + "no_copy": 1, + "options": "Company:company:default_currency", + "print_hide": 1, + "read_only": 1 + }, + { + "collapsible": 1, + "fieldname": "write_off", + "fieldtype": "Section Break", + "label": "Write Off" + }, + { + "fieldname": "write_off_amount", + "fieldtype": "Currency", + "label": "Write Off Amount", + "no_copy": 1, + "options": "currency", + "print_hide": 1 + }, + { + "fieldname": "base_write_off_amount", + "fieldtype": "Currency", + "label": "Write Off Amount (Company Currency)", + "no_copy": 1, + "options": "Company:company:default_currency", + "print_hide": 1, + "read_only": 1 + }, + { + "fieldname": "column_break_61", + "fieldtype": "Column Break" + }, + { + "depends_on": "eval:flt(doc.write_off_amount)!=0", + "fieldname": "write_off_account", + "fieldtype": "Link", + "label": "Write Off Account", + "options": "Account", + "print_hide": 1 + }, + { + "depends_on": "eval:flt(doc.write_off_amount)!=0", + "fieldname": "write_off_cost_center", + "fieldtype": "Link", + "label": "Write Off Cost Center", + "options": "Cost Center", + "print_hide": 1 + }, + { + "collapsible": 1, + "collapsible_depends_on": "advances", + "fieldname": "advances_section", + "fieldtype": "Section Break", + "label": "Advance Payments", + "oldfieldtype": "Section Break", + "options": "fa fa-money", + "print_hide": 1 + }, + { + "default": "0", + "fieldname": "allocate_advances_automatically", + "fieldtype": "Check", + "label": "Set Advances and Allocate (FIFO)" + }, + { + "depends_on": "eval:!doc.allocate_advances_automatically", + "fieldname": "get_advances", + "fieldtype": "Button", + "label": "Get Advances Paid", + "oldfieldtype": "Button", + "print_hide": 1 + }, + { + "fieldname": "advances", + "fieldtype": "Table", + "label": "Advances", + "no_copy": 1, + "oldfieldname": "advance_allocation_details", + "oldfieldtype": "Table", + "options": "Purchase Invoice Advance", + "print_hide": 1 + }, + { + "collapsible_depends_on": "eval:(!doc.is_return)", + "fieldname": "payment_schedule_section", + "fieldtype": "Section Break", + "label": "Payment Terms" + }, + { + "fieldname": "payment_terms_template", + "fieldtype": "Link", + "label": "Payment Terms Template", + "options": "Payment Terms Template" + }, + { + "fieldname": "payment_schedule", + "fieldtype": "Table", + "label": "Payment Schedule", + "no_copy": 1, + "options": "Payment Schedule", + "print_hide": 1 + }, + { + "fieldname": "terms_section_break", + "fieldtype": "Section Break", + "label": "Terms and Conditions", + "options": "fa fa-legal" + }, + { + "fieldname": "tc_name", + "fieldtype": "Link", + "label": "Terms", + "options": "Terms and Conditions", + "print_hide": 1 + }, + { + "fieldname": "terms", + "fieldtype": "Text Editor", + "label": "Terms and Conditions" + }, + { + "collapsible": 1, + "fieldname": "printing_settings", + "fieldtype": "Section Break", + "label": "Print Settings" + }, + { + "allow_on_submit": 1, + "fieldname": "letter_head", + "fieldtype": "Link", + "label": "Letter Head", + "options": "Letter Head", + "print_hide": 1 + }, + { + "allow_on_submit": 1, + "default": "0", + "fieldname": "group_same_items", + "fieldtype": "Check", + "label": "Group same items", + "print_hide": 1 + }, + { + "fieldname": "column_break_112", + "fieldtype": "Column Break" + }, + { + "allow_on_submit": 1, + "fieldname": "select_print_heading", + "fieldtype": "Link", + "label": "Print Heading", + "no_copy": 1, + "oldfieldname": "select_print_heading", + "oldfieldtype": "Link", + "options": "Print Heading", + "print_hide": 1, + "report_hide": 1 + }, + { + "fieldname": "language", + "fieldtype": "Data", + "label": "Print Language", + "print_hide": 1, + "read_only": 1 + }, + { + "default": "0", + "fetch_from": "supplier.is_internal_supplier", + "fieldname": "is_internal_supplier", + "fieldtype": "Check", + "ignore_user_permissions": 1, + "label": "Is Internal Supplier", + "read_only": 1 + }, + { + "fieldname": "credit_to", + "fieldtype": "Link", + "label": "Credit To", + "oldfieldname": "credit_to", + "oldfieldtype": "Link", + "options": "Account", + "print_hide": 1, + "reqd": 1, + "search_index": 1 + }, + { + "fieldname": "party_account_currency", + "fieldtype": "Link", + "hidden": 1, + "label": "Party Account Currency", + "no_copy": 1, + "options": "Currency", + "print_hide": 1, + "read_only": 1 + }, + { + "default": "No", + "fieldname": "is_opening", + "fieldtype": "Select", + "label": "Is Opening Entry", + "oldfieldname": "is_opening", + "oldfieldtype": "Select", + "options": "No\nYes", + "print_hide": 1 + }, + { + "fieldname": "against_expense_account", + "fieldtype": "Small Text", + "hidden": 1, + "label": "Against Expense Account", + "no_copy": 1, + "oldfieldname": "against_expense_account", + "oldfieldtype": "Small Text", + "print_hide": 1 + }, + { + "fieldname": "column_break_63", + "fieldtype": "Column Break" + }, + { + "default": "Draft", + "fieldname": "status", + "fieldtype": "Select", + "in_standard_filter": 1, + "label": "Status", + "options": "\nDraft\nReturn\nDebit Note Issued\nSubmitted\nPaid\nPartly Paid\nUnpaid\nOverdue\nCancelled\nInternal Transfer", + "print_hide": 1 + }, + { + "fieldname": "inter_company_invoice_reference", + "fieldtype": "Link", + "label": "Inter Company Invoice Reference", + "no_copy": 1, + "options": "Sales Invoice", + "print_hide": 1, + "read_only": 1 + }, + { + "fieldname": "remarks", + "fieldtype": "Small Text", + "label": "Remarks", + "no_copy": 1, + "oldfieldname": "remarks", + "oldfieldtype": "Text", + "print_hide": 1 + }, + { + "collapsible": 1, + "fieldname": "subscription_section", + "fieldtype": "Section Break", + "label": "Subscription", + "print_hide": 1 + }, + { + "allow_on_submit": 1, + "description": "Start date of current invoice's period", + "fieldname": "from_date", + "fieldtype": "Date", + "label": "From Date", + "no_copy": 1, + "print_hide": 1 + }, + { + "allow_on_submit": 1, + "description": "End date of current invoice's period", + "fieldname": "to_date", + "fieldtype": "Date", + "label": "To Date", + "no_copy": 1, + "print_hide": 1 + }, + { + "fieldname": "column_break_114", + "fieldtype": "Column Break" + }, + { + "fieldname": "auto_repeat", + "fieldtype": "Link", + "label": "Auto Repeat", + "no_copy": 1, + "options": "Auto Repeat", + "print_hide": 1, + "read_only": 1 + }, + { + "allow_on_submit": 1, + "depends_on": "eval: doc.auto_repeat", + "fieldname": "update_auto_repeat_reference", + "fieldtype": "Button", + "label": "Update Auto Repeat Reference" + }, + { + "collapsible": 1, + "fieldname": "accounting_dimensions_section", + "fieldtype": "Section Break", + "label": "Accounting Dimensions " + }, + { + "fieldname": "dimension_col_break", + "fieldtype": "Column Break" + }, + { + "fieldname": "tax_withholding_category", + "fieldtype": "Link", + "hidden": 1, + "label": "Tax Withholding Category", + "options": "Tax Withholding Category", + "print_hide": 1 + }, + { + "fieldname": "billing_address", + "fieldtype": "Link", + "label": "Select Billing Address", + "options": "Address" + }, + { + "fieldname": "billing_address_display", + "fieldtype": "Small Text", + "label": "Billing Address", + "read_only": 1 + }, + { + "fieldname": "project", + "fieldtype": "Link", + "label": "Project", + "options": "Project" + }, + { + "depends_on": "eval:doc.is_internal_supplier", + "description": "Unrealized Profit/Loss account for intra-company transfers", + "fieldname": "unrealized_profit_loss_account", + "fieldtype": "Link", + "label": "Unrealized Profit / Loss Account", + "options": "Account" + }, + { + "depends_on": "eval:doc.is_internal_supplier", + "description": "Company which internal supplier represents", + "fetch_from": "supplier.represents_company", + "fieldname": "represents_company", + "fieldtype": "Link", + "label": "Represents Company", + "options": "Company" + }, + { + "depends_on": "eval:doc.update_stock && doc.is_internal_supplier", + "fieldname": "set_from_warehouse", + "fieldtype": "Link", + "label": "Set From Warehouse", + "no_copy": 1, + "options": "Warehouse", + "print_hide": 1, + "print_width": "50px", + "width": "50px" + }, + { + "depends_on": "eval:doc.is_subcontracted", + "fieldname": "supplier_warehouse", + "fieldtype": "Link", + "label": "Supplier Warehouse", + "no_copy": 1, + "options": "Warehouse", + "print_hide": 1, + "print_width": "50px", + "width": "50px" + }, + { + "fieldname": "per_received", + "fieldtype": "Percent", + "hidden": 1, + "label": "Per Received", + "no_copy": 1, + "print_hide": 1, + "read_only": 1 + }, + { + "default": "0", + "fieldname": "ignore_default_payment_terms_template", + "fieldtype": "Check", + "hidden": 1, + "label": "Ignore Default Payment Terms Template", + "read_only": 1 + }, + { + "collapsible": 1, + "fieldname": "accounting_details_section", + "fieldtype": "Section Break", + "label": "Accounting Details", + "print_hide": 1 + }, + { + "fieldname": "column_break_147", + "fieldtype": "Column Break" + }, + { + "fieldname": "advance_tax", + "fieldtype": "Table", + "hidden": 1, + "label": "Advance Tax", + "options": "Advance Tax", + "read_only": 1 + }, + { + "default": "0", + "fieldname": "is_old_subcontracting_flow", + "fieldtype": "Check", + "hidden": 1, + "label": "Is Old Subcontracting Flow", + "read_only": 1 + }, + { + "collapsible_depends_on": "tax_withheld_vouchers", + "fieldname": "tax_withheld_vouchers_section", + "fieldtype": "Section Break", + "label": "Tax Withheld Vouchers" + }, + { + "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-10-11 13:04:44.304389", + "modified_by": "Administrator", + "module": "Accounts", + "name": "Purchase Invoice", + "name_case": "Title Case", + "naming_rule": "By \"Naming Series\" field", + "owner": "Administrator", + "permissions": [ + { + "amend": 1, + "cancel": 1, + "create": 1, + "email": 1, + "print": 1, + "read": 1, + "report": 1, + "role": "Accounts User", + "share": 1, + "submit": 1, + "write": 1 + }, + { + "email": 1, + "print": 1, + "read": 1, + "report": 1, + "role": "Purchase User" + }, + { + "amend": 1, + "cancel": 1, + "create": 1, + "delete": 1, + "email": 1, + "print": 1, + "read": 1, + "report": 1, + "role": "Accounts Manager", + "share": 1, + "submit": 1, + "write": 1 + }, + { + "email": 1, + "print": 1, + "read": 1, + "report": 1, + "role": "Auditor" + }, + { + "permlevel": 1, + "read": 1, + "role": "Accounts Manager", + "write": 1 + } + ], + "search_fields": "posting_date, supplier, bill_no, base_grand_total, outstanding_amount", + "show_name_in_global_search": 1, + "sort_field": "modified", + "sort_order": "DESC", + "states": [], + "timeline_field": "supplier", + "title_field": "title", + "track_changes": 1 +} diff --git a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py index 2b633cb8c3..882a374046 100644 --- a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py +++ b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py @@ -71,6 +71,9 @@ class PurchaseInvoice(BuyingController): 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 @@ class PurchaseInvoice(BuyingController): ) ) + 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 @@ class PurchaseInvoice(BuyingController): "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, @@ -1411,6 +1418,7 @@ class PurchaseInvoice(BuyingController): "Stock Ledger Entry", "Repost Item Valuation", "Payment Ledger Entry", + "Tax Withheld Vouchers", ) self.update_advance_tax_references(cancel=1) 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 bee6e0982f..5c1cb0dcc6 100644 --- a/erpnext/accounts/doctype/purchase_invoice_item/purchase_invoice_item.json +++ b/erpnext/accounts/doctype/purchase_invoice_item/purchase_invoice_item.json @@ -215,6 +215,7 @@ "reqd": 1 }, { + "default": "1", "depends_on": "eval:doc.uom != doc.stock_uom", "fieldname": "conversion_factor", "fieldtype": "Float", @@ -712,6 +713,7 @@ "label": "Valuation Rate", "no_copy": 1, "options": "Company:company:default_currency", + "precision": "6", "print_hide": 1, "read_only": 1 }, @@ -820,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" @@ -877,7 +880,7 @@ "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/sales_invoice/sales_invoice.json b/erpnext/accounts/doctype/sales_invoice/sales_invoice.json index 2da515737a..97e5f4017e 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,95 @@ "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", + "connections_tab" ], "fields": [ { @@ -453,12 +468,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 +574,6 @@ { "fieldname": "company_address_display", "fieldtype": "Small Text", - "hidden": 1, "hide_days": 1, "hide_seconds": 1, "label": "Company Address", @@ -651,13 +664,6 @@ "label": "Ignore Pricing Rule", "print_hide": 1 }, - { - "fieldname": "sec_warehouse", - "fieldtype": "Section Break", - "hide_days": 1, - "hide_seconds": 1, - "label": "Warehouse" - }, { "depends_on": "update_stock", "fieldname": "set_warehouse", @@ -671,6 +677,7 @@ { "fieldname": "items_section", "fieldtype": "Section Break", + "hide_border": 1, "hide_days": 1, "hide_seconds": 1, "label": "Items", @@ -702,7 +709,6 @@ "fieldtype": "Table", "hide_days": 1, "hide_seconds": 1, - "label": "Items", "oldfieldname": "entries", "oldfieldtype": "Table", "options": "Sales Invoice Item", @@ -755,9 +761,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 +852,7 @@ "read_only": 1 }, { + "depends_on": "total_net_weight", "fieldname": "total_net_weight", "fieldtype": "Float", "hide_days": 1, @@ -856,8 +864,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 +910,7 @@ { "fieldname": "section_break_40", "fieldtype": "Section Break", + "hide_border": 1, "hide_days": 1, "hide_seconds": 1 }, @@ -908,7 +919,6 @@ "fieldtype": "Table", "hide_days": 1, "hide_seconds": 1, - "label": "Sales Taxes and Charges", "oldfieldname": "other_charges", "oldfieldtype": "Table", "options": "Sales Taxes and Charges" @@ -1046,7 +1056,6 @@ }, { "collapsible": 1, - "collapsible_depends_on": "discount_amount", "fieldname": "section_break_49", "fieldtype": "Section Break", "hide_days": 1, @@ -1102,6 +1111,7 @@ "fieldtype": "Section Break", "hide_days": 1, "hide_seconds": 1, + "label": "Totals", "oldfieldtype": "Section Break", "options": "fa fa-money", "print_hide": 1 @@ -1283,8 +1293,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 +1322,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, @@ -1352,6 +1362,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 +1394,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", @@ -1427,17 +1441,6 @@ "options": "Account", "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", @@ -1495,8 +1498,6 @@ "print_hide": 1 }, { - "collapsible": 1, - "collapsible_depends_on": "terms", "fieldname": "terms_section_break", "fieldtype": "Section Break", "hide_days": 1, @@ -1530,7 +1531,7 @@ "fieldtype": "Section Break", "hide_days": 1, "hide_seconds": 1, - "label": "Printing Settings" + "label": "Print Settings" }, { "allow_on_submit": 1, @@ -1591,7 +1592,7 @@ "fieldtype": "Section Break", "hide_days": 1, "hide_seconds": 1, - "label": "More Information" + "label": "Additional Info" }, { "fieldname": "inter_company_invoice_reference", @@ -1814,7 +1815,7 @@ "fieldtype": "Section Break", "hide_days": 1, "hide_seconds": 1, - "label": "Subscription Section" + "label": "Subscription" }, { "allow_on_submit": 1, @@ -1935,10 +1936,6 @@ "options": "Company", "read_only": 1 }, - { - "fieldname": "column_break_55", - "fieldtype": "Column Break" - }, { "depends_on": "eval: doc.is_internal_customer && doc.update_stock", "fieldname": "set_target_warehouse", @@ -2009,6 +2006,97 @@ "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": "grand_total", + "fieldname": "write_off_section", + "fieldtype": "Section Break", + "hide_days": 1, + "hide_seconds": 1, + "label": "Write Off", + "width": "50%" } ], "icon": "fa fa-file-text", @@ -2021,7 +2109,7 @@ "link_fieldname": "consolidated_invoice" } ], - "modified": "2022-09-16 17:44:22.227332", + "modified": "2022-10-11 13:07:36.488095", "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 afd5a59df4..0c03c550ba 100644 --- a/erpnext/accounts/doctype/sales_invoice/sales_invoice.py +++ b/erpnext/accounts/doctype/sales_invoice/sales_invoice.py @@ -2017,6 +2017,9 @@ def make_inter_company_transaction(doctype, source_name, target_doc=None): 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 diff --git a/erpnext/accounts/doctype/sales_invoice/test_sales_invoice.py b/erpnext/accounts/doctype/sales_invoice/test_sales_invoice.py index ce44ae304b..cb0d1a75a0 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 @@ from erpnext.stock.doctype.stock_entry.test_stock_entry import ( 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 @@ class TestSalesInvoice(unittest.TestCase): 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 @@ class TestSalesInvoice(unittest.TestCase): 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 @@ class TestSalesInvoice(unittest.TestCase): 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 @@ class TestSalesInvoice(unittest.TestCase): 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 @@ class TestSalesInvoice(unittest.TestCase): "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 @@ class TestSalesInvoice(unittest.TestCase): 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 @@ class TestSalesInvoice(unittest.TestCase): 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 @@ class TestSalesInvoice(unittest.TestCase): 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") @@ -3077,7 +3079,7 @@ class TestSalesInvoice(unittest.TestCase): [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 +3229,22 @@ class TestSalesInvoice(unittest.TestCase): 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() @@ -3306,6 +3324,7 @@ def create_sales_invoice(**args): "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 +3337,7 @@ def create_sales_invoice(**args): "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 +3450,34 @@ def get_taxes_and_charges(): ] +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 +3500,19 @@ def create_internal_supplier(supplier_name, represents_company, allowed_to_inter 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 4f97b63789..7f1a1eccc4 100644 --- a/erpnext/accounts/doctype/sales_invoice_item/sales_invoice_item.json +++ b/erpnext/accounts/doctype/sales_invoice_item/sales_invoice_item.json @@ -247,6 +247,7 @@ }, { "collapsible": 1, + "collapsible_depends_on": "eval: doc.margin_type || doc.discount_amount", "fieldname": "discount_and_margin", "fieldtype": "Section Break", "label": "Discount and Margin" @@ -820,6 +821,7 @@ "label": "Incoming Rate (Costing)", "no_copy": 1, "options": "Company:company:default_currency", + "precision": "6", "print_hide": 1 }, { @@ -875,7 +877,7 @@ "idx": 1, "istable": 1, "links": [], - "modified": "2022-09-06 14:17:43.394309", + "modified": "2022-10-26 11:38:36.119339", "modified_by": "Administrator", "module": "Accounts", "name": "Sales Invoice Item", diff --git a/erpnext/accounts/doctype/subscription_plan/subscription_plan.py b/erpnext/accounts/doctype/subscription_plan/subscription_plan.py index a95e0a9c2d..f3acdc5aa8 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 @@ def get_plan_rate( 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 92cb9489e0..737338e04f 100644 --- a/erpnext/accounts/doctype/tax_withholding_category/tax_withholding_category.py +++ b/erpnext/accounts/doctype/tax_withholding_category/tax_withholding_category.py @@ -252,6 +252,9 @@ def get_tax_amount(party_type, parties, inv, tax_details, posting_date, pan_no=N ) 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) @@ -428,8 +431,11 @@ def get_tds_amount(ldc, parties, inv, tax_details, tax_deducted, vouchers): ): # 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(tax_withholding_net_total)") or 0.0 - net_total += inv.tax_withholding_net_total + net_total = 0 + if vouchers: + net_total = frappe.db.get_value("Purchase Invoice", invoice_filters, "sum(net_total)") + + net_total += inv.net_total supp_credit_amt = net_total - cumulative_threshold if ldc and is_valid_certificate( diff --git a/erpnext/accounts/general_ledger.py b/erpnext/accounts/general_ledger.py index f4a50a5f91..6d164eef2b 100644 --- a/erpnext/accounts/general_ledger.py +++ b/erpnext/accounts/general_ledger.py @@ -128,6 +128,12 @@ def distribute_gl_based_on_cost_center_allocation(gl_map, precision=None): 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 7cf14e6738..e1a30a4b77 100644 --- a/erpnext/accounts/report/accounts_payable/accounts_payable.js +++ b/erpnext/accounts/report/accounts_payable/accounts_payable.js @@ -51,6 +51,8 @@ frappe.query_reports["Accounts Payable"] = { } 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 8557c03bd5..f2ee1eb10e 100755 --- a/erpnext/accounts/report/accounts_receivable/accounts_receivable.py +++ b/erpnext/accounts/report/accounts_receivable/accounts_receivable.py @@ -748,7 +748,7 @@ class ReceivablePayableReport(object): 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 diff --git a/erpnext/accounts/report/general_ledger/general_ledger.html b/erpnext/accounts/report/general_ledger/general_ledger.html index 378fa3791c..c04f518d7e 100644 --- a/erpnext/accounts/report/general_ledger/general_ledger.html +++ b/erpnext/accounts/report/general_ledger/general_ledger.html @@ -52,22 +52,22 @@ {% } %}Some functionality is disabled for the demo and the data will be cleared regularly.
- -+ {{ _("Valid Till") }}: {{ frappe.utils.format_date(doc.valid_till, 'medium') }} +
{% endif %} - +- {{ _("Valid Till") }}: {{ frappe.utils.format_date(doc.valid_till, 'medium') }} -
- {% endif %} -
- {%- set party_name = doc.supplier_name if doc.doctype in ['Supplier Quotation', 'Purchase Invoice', 'Purchase Order'] else doc.customer_name %}
- {{ party_name }}
-
- {% if doc.contact_display and doc.contact_display != party_name %}
-
- {{ doc.contact_display }}
- {% endif %}
-
- {{ _("Item") }} - | -- {{ _("Quantity") }} - | -- {{ _("Amount") }} - | - - - {% for d in doc.items %} -
---|---|---|
- {{ item_name_and_description(d) }} - | -
- {{ d.qty }}
- {% if d.delivered_qty is defined and d.delivered_qty != None %}
- {{ _("Delivered") }} {{ d.delivered_qty }} +
+
+
+ {% if doc.doctype == "Quotation" and not doc.docstatus %}
+ {{ _("Pending") }}
+ {% else %}
+ {{ _(doc.get('indicator_title')) or _(doc.status) or _("Submitted") }}
{% endif %}
- |
-
- {{ d.get_formatted("amount") }}
- {{ _("Rate:") }} {{ d.get_formatted("rate") }} - |
-
Available Points: {{ available_loyalty_points }}
+Available Points: {{ + available_loyalty_points }}
{{ doc.terms }}
+{{ doc.terms }}