From b75aae99caa5175f16f90304f8b5b56a46ae4773 Mon Sep 17 00:00:00 2001 From: barredterra <14891507+barredterra@users.noreply.github.com> Date: Wed, 27 Sep 2023 18:51:09 +0200 Subject: [PATCH 01/95] fix: german translations of Accounts Settings (cherry picked from commit b3486b43c45df03697b13a4f0fc655d70bc52407) # Conflicts: # erpnext/translations/de.csv --- erpnext/translations/de.csv | 80 ++++++++++++++++++++++++++++++++++--- 1 file changed, 74 insertions(+), 6 deletions(-) diff --git a/erpnext/translations/de.csv b/erpnext/translations/de.csv index 4cd4f0edf15f..44adc555df4b 100644 --- a/erpnext/translations/de.csv +++ b/erpnext/translations/de.csv @@ -3671,7 +3671,7 @@ Cannot Optimize Route as Driver Address is Missing.,"Route kann nicht optimiert Cannot complete task {0} as its dependant task {1} are not ccompleted / cancelled.,"Aufgabe {0} kann nicht abgeschlossen werden, da die abhängige Aufgabe {1} nicht abgeschlossen / abgebrochen wurde.", Cannot create loan until application is approved,"Darlehen kann erst erstellt werden, wenn der Antrag genehmigt wurde", Cannot find a matching Item. Please select some other value for {0}.,Ein passender Artikel kann nicht gefunden werden. Bitte einen anderen Wert für {0} auswählen., -"Cannot overbill for Item {0} in row {1} more than {2}. To allow over-billing, please set allowance in Accounts Settings","Artikel {0} in Zeile {1} kann nicht mehr als {2} in Rechnung gestellt werden. Um eine Überberechnung zuzulassen, legen Sie die Überberechnung in den Kontoeinstellungen fest", +"Cannot overbill for Item {0} in row {1} more than {2}. To allow over-billing, please set allowance in Accounts Settings","Artikel {0} in Zeile {1} kann nicht mehr als {2} in Rechnung gestellt werden. Um eine Überberechnung zuzulassen, legen Sie die Überberechnung in den Buchhaltungseinstellungen fest", "Capacity Planning Error, planned start time can not be same as end time","Kapazitätsplanungsfehler, die geplante Startzeit darf nicht mit der Endzeit übereinstimmen", Categories,Kategorien, Changes in {0},Änderungen in {0}, @@ -4125,7 +4125,7 @@ This page keeps track of your items in which buyers have showed some interest.," Thursday,Donnerstag, Timing,Zeitliche Koordinierung, Title,Bezeichnung, -"To allow over billing, update ""Over Billing Allowance"" in Accounts Settings or the Item.","Aktualisieren Sie "Over Billing Allowance" in den Kontoeinstellungen oder im Artikel, um eine Überberechnung zuzulassen.", +"To allow over billing, update ""Over Billing Allowance"" in Accounts Settings or the Item.","Aktualisieren Sie "Over Billing Allowance" in den Buchhaltungseinstellungen oder im Artikel, um eine Überberechnung zuzulassen.", "To allow over receipt / delivery, update ""Over Receipt/Delivery Allowance"" in Stock Settings or the Item.","Um eine Überbestätigung / Überlieferung zu ermöglichen, aktualisieren Sie "Überbestätigung / Überlieferung" in den Lagereinstellungen oder im Artikel.", To date needs to be before from date,Das Datum muss vor dem Datum liegen, Total,Summe, @@ -4533,8 +4533,8 @@ Mandatory For Profit and Loss Account,Obligatorisch für Gewinn- und Verlustrech Accounting Period,Abrechnungszeitraum, Period Name,Zeitraumname, Closed Documents,Geschlossene Dokumente, -Accounts Settings,Konteneinstellungen, -Settings for Accounts,Konteneinstellungen, +Accounts Settings,Buchhaltungseinstellungen, +Settings for Accounts,Einstellungen für das Buchhaltungsmodul, Make Accounting Entry For Every Stock Movement,Eine Buchung für jede Lagerbewegung erstellen, Users with this role are allowed to set frozen accounts and create / modify accounting entries against frozen accounts,Benutzer mit dieser Rolle sind berechtigt Konten zu sperren und Buchungen zu gesperrten Konten zu erstellen/verändern, Determine Address Tax Category From,Adresssteuerkategorie bestimmen von, @@ -8622,7 +8622,7 @@ Template Title,Vorlagentitel, Journal Entry Type,Buchungssatz-Typ, Journal Entry Template Account,Buchungssatzvorlagenkonto, Process Deferred Accounting,Aufgeschobene Buchhaltung verarbeiten, -Manual entry cannot be created! Disable automatic entry for deferred accounting in accounts settings and try again,Manuelle Eingabe kann nicht erstellt werden! Deaktivieren Sie die automatische Eingabe für die verzögerte Buchhaltung in den Konteneinstellungen und versuchen Sie es erneut, +Manual entry cannot be created! Disable automatic entry for deferred accounting in accounts settings and try again,Manuelle Eingabe kann nicht erstellt werden! Deaktivieren Sie die automatische Eingabe für die verzögerte Buchhaltung in den Buchhaltungseinstellungen und versuchen Sie es erneut, End date cannot be before start date,Das Enddatum darf nicht vor dem Startdatum liegen, Total Counts Targeted,Gesamtzahl der anvisierten Zählungen, Total Counts Completed,Gesamtzahl der abgeschlossenen Zählungen, @@ -8924,7 +8924,7 @@ Checking this will automatically create a Sales Invoice whenever an appointment Healthcare Service Items,Artikel im Gesundheitswesen, "You can create a service item for Inpatient Visit Charge and set it here. Similarly, you can set up other Healthcare Service Items for billing in this section. Click ",Sie können ein Serviceelement für die Gebühr für stationäre Besuche erstellen und hier festlegen. Ebenso können Sie in diesem Abschnitt andere Gesundheitsposten für die Abrechnung einrichten. Klicken, Set up default Accounts for the Healthcare Facility,Richten Sie Standardkonten für die Gesundheitseinrichtung ein, -"If you wish to override default accounts settings and configure the Income and Receivable accounts for Healthcare, you can do so here.","Wenn Sie die Standardkonteneinstellungen überschreiben und die Einkommens- und Debitorenkonten für das Gesundheitswesen konfigurieren möchten, können Sie dies hier tun.", +"If you wish to override default accounts settings and configure the Income and Receivable accounts for Healthcare, you can do so here.","Wenn Sie die Buchhaltungseinstellungen überschreiben und spezielle Einkommens- und Debitorenkonten für das Gesundheitswesen konfigurieren möchten, können Sie dies hier tun.", Out Patient SMS alerts,Out Patient SMS-Benachrichtigungen, "If you want to send SMS alert on Patient Registration, you can enable this option. Similary, you can set up Out Patient SMS alerts for other functionalities in this section. Click ","Wenn Sie bei der Patientenregistrierung eine SMS-Benachrichtigung senden möchten, können Sie diese Option aktivieren. Ebenso können Sie in diesem Abschnitt SMS-Benachrichtigungen für andere Patienten einrichten. Klicken", Admission Order Details,Details zur Zulassungsbestellung, @@ -9931,3 +9931,71 @@ Select Alternative Items for Sales Order,Alternativpositionen für Auftragsbest Select an item from each set to be used in the Sales Order.,"Wählen Sie aus den Alternativen jeweils einen Artikel aus, der in die Auftragsbestätigung übernommen werden soll.", Is Alternative,Ist Alternative, Alternative Items,Alternativpositionen, +<<<<<<< HEAD +======= +Add Template,Vorlage einfügen, +Add Comment,Kommentar hinzufügen, +More...,Mehr..., +Notes,Hinweise, +Payment Gateway,Zahlungs-Gateways, +Payment Gateway Name,Name des Zahlungsgateways, +Payments,Zahlungen, +Plan Name,Planname, +Portal,Portal, +Scan Barcode,Barcode scannen, +Some information is missing,Einige Informationen fehlen, +Successful,Erfolgreich, +Tools,Werkzeuge, +Use Sandbox,Sandkastenmodus verwenden, +Busy,Beschäftigt, +Completed By,Vervollständigt von, +Is Template, Ist Vorlage, +Payment Failed,Bezahlung fehlgeschlagen, +Column {0},Spalte {0}, +Field Mapping,Feldzuordnung, +Not Specified,Keine Angabe, +Update Type,Aktualisierungsart, +Dr,Soll, +End Time,Endzeit, +Fetching...,Abrufen ..., +"It seems that there is an issue with the server's stripe configuration. In case of failure, the amount will get refunded to your account.","Es scheint, dass ein Problem mit der Stripe-Konfiguration des Servers vorliegt. Im Falle eines Fehlers wird der Betrag Ihrem Konto gutgeschrieben.", +Looks like someone sent you to an incomplete URL. Please ask them to look into it.,"Sieht aus wie jemand, den Sie zu einer unvollständigen URL gesendet. Bitte fragen Sie sie, sich in sie.", +Master,Vorlage, +Pay,Zahlen, +You can also copy-paste this link in your browser,Sie können diese Verknüpfung in Ihren Browser kopieren, +Verified By,Überprüft von, +Invalid naming series (. missing) for {0},Ungültige Namensreihe (. Fehlt) für {0}, +Phone Number,Telefonnummer, +Account SID,Konto-SID, +Global Defaults,Allgemeine Voreinstellungen, +Is Mandatory,Ist obligatorisch, +WhatsApp,WhatsApp, +Make a call,Einen Anruf tätigen, +Enable Automatic Party Matching,Automatisches Zuordnen von Parteien aktivieren, +Auto match and set the Party in Bank Transactions,"Partei automatisch anhand der Kontonummer bzw. IBAN zuordnen", +Enable Fuzzy Matching,Unscharfe Zuordnung aktivieren, +Approximately match the description/party name against parties,"Partei automatisch anhand grober Übereinstimmung des Names zuordnen" +Accounts Closing,Kontoabschluss, +Period Closing Settings,Periodenabschlusseinstellungen, +Ignore Account Closing Balance,Saldo des Kontos zum Periodenabschluss ignorieren, +Financial reports will be generated using GL Entry doctypes (should be enabled if Period Closing Voucher is not posted for all years sequentially or missing),"Finanzberichte werden anhand des Hauptbuchs erstellt (sollte aktiviert sein, wenn Periodenabschlüsse fehlen oder nicht sequentiell für alle Jahre gebucht werden)", +Asset Settings,Vermögenswerteinstellungen, +POS Setting,POS-Einstellungen, +Create Ledger Entries for Change Amount,Buchungssätze für Wechselgeld erstellen, +"If enabled, ledger entries will be posted for change amount in POS transactions","Wenn aktiviert, werden Buchungssätze für Wechselgeld in POS-Transaktionen erstellt", +Credit Limit Settings,Kreditlimit-Einstellungen, +Role Allowed to Over Bill, +Users with this role are allowed to over bill above the allowance percentage,"Roll, die mehr als den erlaubten Prozentsatz zusätzlich abrechnen darf", +Role allowed to bypass Credit Limit,"Rolle, die das Kreditlimit umgehen darf", +Invoice Cancellation,Rechnungsstornierung, +Delete Accounting and Stock Ledger Entries on deletion of Transaction,Beim Löschen einer Transaktion auch die entsprechenden Buchungs- und Lagerbuchungssätze löschen, +Enable Common Party Accounting,Verknüpfung von Kunden und Liefeanten erlauben, +Allow multi-currency invoices against single party account,Rechnungsbeträge in Fremdwährungen dürfen umgerechnet und in der Hauptwährung gebucht werden, +Enabling this will allow creation of multi-currency invoices against single party account in company currency,Bei Aktivierung können Rechnungen in Fremdwährungen gegen ein Konto in der Hauptwährung gebucht werden, +Payment Terms from orders will be fetched into the invoices as is,Die Zahlungsbedingungen aus einem Auftragen werden eins zu eins in die Rechnungen übernommen, +Automatically Fetch Payment Terms from Order,Zahlungsbedingungen aus Auftrag in die Rechnung übernehmen, +Enable Custom Cash Flow Format,Individuelles Cashflow-Format aktivieren, +Tax Settings,Umsatzsteuer-Einstellungen, +Book Tax Loss on Early Payment Discount,Umsatzsteueranteil bei Skonto berücksichtigen, +Split Early Payment Discount Loss into Income and Tax Loss,"Skontobetrag in Aufwand und Umsatzsteuerkorrektur aufteilen", +>>>>>>> b3486b43c4 (fix: german translations of Accounts Settings) From 4d2169e48e3738b21e16cb1418b3127df1b05883 Mon Sep 17 00:00:00 2001 From: barredterra <14891507+barredterra@users.noreply.github.com> Date: Tue, 3 Oct 2023 23:06:48 +0200 Subject: [PATCH 02/95] fix(translations): suggestions from review (cherry picked from commit 115f0242600a519209a7acd0e59fba434fd8c1c5) --- erpnext/translations/de.csv | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/erpnext/translations/de.csv b/erpnext/translations/de.csv index 44adc555df4b..99630c2391a1 100644 --- a/erpnext/translations/de.csv +++ b/erpnext/translations/de.csv @@ -3671,7 +3671,7 @@ Cannot Optimize Route as Driver Address is Missing.,"Route kann nicht optimiert Cannot complete task {0} as its dependant task {1} are not ccompleted / cancelled.,"Aufgabe {0} kann nicht abgeschlossen werden, da die abhängige Aufgabe {1} nicht abgeschlossen / abgebrochen wurde.", Cannot create loan until application is approved,"Darlehen kann erst erstellt werden, wenn der Antrag genehmigt wurde", Cannot find a matching Item. Please select some other value for {0}.,Ein passender Artikel kann nicht gefunden werden. Bitte einen anderen Wert für {0} auswählen., -"Cannot overbill for Item {0} in row {1} more than {2}. To allow over-billing, please set allowance in Accounts Settings","Artikel {0} in Zeile {1} kann nicht mehr als {2} in Rechnung gestellt werden. Um eine Überberechnung zuzulassen, legen Sie die Überberechnung in den Buchhaltungseinstellungen fest", +"Cannot overbill for Item {0} in row {1} more than {2}. To allow over-billing, please set allowance in Accounts Settings","Für Artikel {0} in Zeile {1} kann nicht mehr als {2} zusätzlich in Rechnung gestellt werden. Um diese Überfakturierung zuzulassen, passen Sie bitte die Grenzwerte in den Buchhaltungseinstellungen an.", "Capacity Planning Error, planned start time can not be same as end time","Kapazitätsplanungsfehler, die geplante Startzeit darf nicht mit der Endzeit übereinstimmen", Categories,Kategorien, Changes in {0},Änderungen in {0}, @@ -4534,7 +4534,7 @@ Accounting Period,Abrechnungszeitraum, Period Name,Zeitraumname, Closed Documents,Geschlossene Dokumente, Accounts Settings,Buchhaltungseinstellungen, -Settings for Accounts,Einstellungen für das Buchhaltungsmodul, +Settings for Accounts,Einstellungen für die Buchhaltung, Make Accounting Entry For Every Stock Movement,Eine Buchung für jede Lagerbewegung erstellen, Users with this role are allowed to set frozen accounts and create / modify accounting entries against frozen accounts,Benutzer mit dieser Rolle sind berechtigt Konten zu sperren und Buchungen zu gesperrten Konten zu erstellen/verändern, Determine Address Tax Category From,Adresssteuerkategorie bestimmen von, @@ -8924,7 +8924,7 @@ Checking this will automatically create a Sales Invoice whenever an appointment Healthcare Service Items,Artikel im Gesundheitswesen, "You can create a service item for Inpatient Visit Charge and set it here. Similarly, you can set up other Healthcare Service Items for billing in this section. Click ",Sie können ein Serviceelement für die Gebühr für stationäre Besuche erstellen und hier festlegen. Ebenso können Sie in diesem Abschnitt andere Gesundheitsposten für die Abrechnung einrichten. Klicken, Set up default Accounts for the Healthcare Facility,Richten Sie Standardkonten für die Gesundheitseinrichtung ein, -"If you wish to override default accounts settings and configure the Income and Receivable accounts for Healthcare, you can do so here.","Wenn Sie die Buchhaltungseinstellungen überschreiben und spezielle Einkommens- und Debitorenkonten für das Gesundheitswesen konfigurieren möchten, können Sie dies hier tun.", +"If you wish to override default accounts settings and configure the Income and Receivable accounts for Healthcare, you can do so here.","Wenn Sie die Standardkonteneinstellungen überschreiben und die Einkommens- und Debitorenkonten für das Gesundheitswesen konfigurieren möchten, können Sie dies hier tun.", Out Patient SMS alerts,Out Patient SMS-Benachrichtigungen, "If you want to send SMS alert on Patient Registration, you can enable this option. Similary, you can set up Out Patient SMS alerts for other functionalities in this section. Click ","Wenn Sie bei der Patientenregistrierung eine SMS-Benachrichtigung senden möchten, können Sie diese Option aktivieren. Ebenso können Sie in diesem Abschnitt SMS-Benachrichtigungen für andere Patienten einrichten. Klicken", Admission Order Details,Details zur Zulassungsbestellung, @@ -9973,9 +9973,9 @@ WhatsApp,WhatsApp, Make a call,Einen Anruf tätigen, Enable Automatic Party Matching,Automatisches Zuordnen von Parteien aktivieren, Auto match and set the Party in Bank Transactions,"Partei automatisch anhand der Kontonummer bzw. IBAN zuordnen", -Enable Fuzzy Matching,Unscharfe Zuordnung aktivieren, -Approximately match the description/party name against parties,"Partei automatisch anhand grober Übereinstimmung des Names zuordnen" -Accounts Closing,Kontoabschluss, +Enable Fuzzy Matching,Fuzzy Matching aktivieren, +Approximately match the description/party name against parties,"Partei automatisch anhand grober Übereinstimmung des Namens zuordnen" +Accounts Closing,Kontenabschluss, Period Closing Settings,Periodenabschlusseinstellungen, Ignore Account Closing Balance,Saldo des Kontos zum Periodenabschluss ignorieren, Financial reports will be generated using GL Entry doctypes (should be enabled if Period Closing Voucher is not posted for all years sequentially or missing),"Finanzberichte werden anhand des Hauptbuchs erstellt (sollte aktiviert sein, wenn Periodenabschlüsse fehlen oder nicht sequentiell für alle Jahre gebucht werden)", @@ -9992,7 +9992,7 @@ Delete Accounting and Stock Ledger Entries on deletion of Transaction,Beim Lösc Enable Common Party Accounting,Verknüpfung von Kunden und Liefeanten erlauben, Allow multi-currency invoices against single party account,Rechnungsbeträge in Fremdwährungen dürfen umgerechnet und in der Hauptwährung gebucht werden, Enabling this will allow creation of multi-currency invoices against single party account in company currency,Bei Aktivierung können Rechnungen in Fremdwährungen gegen ein Konto in der Hauptwährung gebucht werden, -Payment Terms from orders will be fetched into the invoices as is,Die Zahlungsbedingungen aus einem Auftragen werden eins zu eins in die Rechnungen übernommen, +Payment Terms from orders will be fetched into the invoices as is,Zahlungsbedingungen aus Aufträgen werden eins zu eins in Rechnungen übernommen, Automatically Fetch Payment Terms from Order,Zahlungsbedingungen aus Auftrag in die Rechnung übernehmen, Enable Custom Cash Flow Format,Individuelles Cashflow-Format aktivieren, Tax Settings,Umsatzsteuer-Einstellungen, From 2c1fdecc913301845da735c1e20051d29903a116 Mon Sep 17 00:00:00 2001 From: Raffael Meyer <14891507+barredterra@users.noreply.github.com> Date: Wed, 1 Nov 2023 11:54:29 +0100 Subject: [PATCH 03/95] chore: resolve merge conflicts --- erpnext/translations/de.csv | 68 ------------------------------------- 1 file changed, 68 deletions(-) diff --git a/erpnext/translations/de.csv b/erpnext/translations/de.csv index 99630c2391a1..63d78adc6a43 100644 --- a/erpnext/translations/de.csv +++ b/erpnext/translations/de.csv @@ -9931,71 +9931,3 @@ Select Alternative Items for Sales Order,Alternativpositionen für Auftragsbest Select an item from each set to be used in the Sales Order.,"Wählen Sie aus den Alternativen jeweils einen Artikel aus, der in die Auftragsbestätigung übernommen werden soll.", Is Alternative,Ist Alternative, Alternative Items,Alternativpositionen, -<<<<<<< HEAD -======= -Add Template,Vorlage einfügen, -Add Comment,Kommentar hinzufügen, -More...,Mehr..., -Notes,Hinweise, -Payment Gateway,Zahlungs-Gateways, -Payment Gateway Name,Name des Zahlungsgateways, -Payments,Zahlungen, -Plan Name,Planname, -Portal,Portal, -Scan Barcode,Barcode scannen, -Some information is missing,Einige Informationen fehlen, -Successful,Erfolgreich, -Tools,Werkzeuge, -Use Sandbox,Sandkastenmodus verwenden, -Busy,Beschäftigt, -Completed By,Vervollständigt von, -Is Template, Ist Vorlage, -Payment Failed,Bezahlung fehlgeschlagen, -Column {0},Spalte {0}, -Field Mapping,Feldzuordnung, -Not Specified,Keine Angabe, -Update Type,Aktualisierungsart, -Dr,Soll, -End Time,Endzeit, -Fetching...,Abrufen ..., -"It seems that there is an issue with the server's stripe configuration. In case of failure, the amount will get refunded to your account.","Es scheint, dass ein Problem mit der Stripe-Konfiguration des Servers vorliegt. Im Falle eines Fehlers wird der Betrag Ihrem Konto gutgeschrieben.", -Looks like someone sent you to an incomplete URL. Please ask them to look into it.,"Sieht aus wie jemand, den Sie zu einer unvollständigen URL gesendet. Bitte fragen Sie sie, sich in sie.", -Master,Vorlage, -Pay,Zahlen, -You can also copy-paste this link in your browser,Sie können diese Verknüpfung in Ihren Browser kopieren, -Verified By,Überprüft von, -Invalid naming series (. missing) for {0},Ungültige Namensreihe (. Fehlt) für {0}, -Phone Number,Telefonnummer, -Account SID,Konto-SID, -Global Defaults,Allgemeine Voreinstellungen, -Is Mandatory,Ist obligatorisch, -WhatsApp,WhatsApp, -Make a call,Einen Anruf tätigen, -Enable Automatic Party Matching,Automatisches Zuordnen von Parteien aktivieren, -Auto match and set the Party in Bank Transactions,"Partei automatisch anhand der Kontonummer bzw. IBAN zuordnen", -Enable Fuzzy Matching,Fuzzy Matching aktivieren, -Approximately match the description/party name against parties,"Partei automatisch anhand grober Übereinstimmung des Namens zuordnen" -Accounts Closing,Kontenabschluss, -Period Closing Settings,Periodenabschlusseinstellungen, -Ignore Account Closing Balance,Saldo des Kontos zum Periodenabschluss ignorieren, -Financial reports will be generated using GL Entry doctypes (should be enabled if Period Closing Voucher is not posted for all years sequentially or missing),"Finanzberichte werden anhand des Hauptbuchs erstellt (sollte aktiviert sein, wenn Periodenabschlüsse fehlen oder nicht sequentiell für alle Jahre gebucht werden)", -Asset Settings,Vermögenswerteinstellungen, -POS Setting,POS-Einstellungen, -Create Ledger Entries for Change Amount,Buchungssätze für Wechselgeld erstellen, -"If enabled, ledger entries will be posted for change amount in POS transactions","Wenn aktiviert, werden Buchungssätze für Wechselgeld in POS-Transaktionen erstellt", -Credit Limit Settings,Kreditlimit-Einstellungen, -Role Allowed to Over Bill, -Users with this role are allowed to over bill above the allowance percentage,"Roll, die mehr als den erlaubten Prozentsatz zusätzlich abrechnen darf", -Role allowed to bypass Credit Limit,"Rolle, die das Kreditlimit umgehen darf", -Invoice Cancellation,Rechnungsstornierung, -Delete Accounting and Stock Ledger Entries on deletion of Transaction,Beim Löschen einer Transaktion auch die entsprechenden Buchungs- und Lagerbuchungssätze löschen, -Enable Common Party Accounting,Verknüpfung von Kunden und Liefeanten erlauben, -Allow multi-currency invoices against single party account,Rechnungsbeträge in Fremdwährungen dürfen umgerechnet und in der Hauptwährung gebucht werden, -Enabling this will allow creation of multi-currency invoices against single party account in company currency,Bei Aktivierung können Rechnungen in Fremdwährungen gegen ein Konto in der Hauptwährung gebucht werden, -Payment Terms from orders will be fetched into the invoices as is,Zahlungsbedingungen aus Aufträgen werden eins zu eins in Rechnungen übernommen, -Automatically Fetch Payment Terms from Order,Zahlungsbedingungen aus Auftrag in die Rechnung übernehmen, -Enable Custom Cash Flow Format,Individuelles Cashflow-Format aktivieren, -Tax Settings,Umsatzsteuer-Einstellungen, -Book Tax Loss on Early Payment Discount,Umsatzsteueranteil bei Skonto berücksichtigen, -Split Early Payment Discount Loss into Income and Tax Loss,"Skontobetrag in Aufwand und Umsatzsteuerkorrektur aufteilen", ->>>>>>> b3486b43c4 (fix: german translations of Accounts Settings) From 21b430a575143a258726386c430be4207ed5979d Mon Sep 17 00:00:00 2001 From: marination Date: Fri, 29 Sep 2023 15:19:09 +0530 Subject: [PATCH 04/95] fix: Set right party name in bank transaction - If party name and docname are different, set the docname in Bank Transaction (cherry picked from commit ff1dc72d740f32d75deb7fa6294e70b488f146b2) --- .../doctype/bank_transaction/auto_match_party.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/erpnext/accounts/doctype/bank_transaction/auto_match_party.py b/erpnext/accounts/doctype/bank_transaction/auto_match_party.py index 5d94a08f2f08..671cde58a922 100644 --- a/erpnext/accounts/doctype/bank_transaction/auto_match_party.py +++ b/erpnext/accounts/doctype/bank_transaction/auto_match_party.py @@ -1,6 +1,7 @@ from typing import Tuple, Union import frappe +from frappe.core.utils import find from frappe.utils import flt from rapidfuzz import fuzz, process @@ -112,7 +113,8 @@ def match_party_name_desc_in_party(self) -> Union[Tuple, None]: for party in parties: filters = {"status": "Active"} if party == "Employee" else {"disabled": 0} - names = frappe.get_all(party, filters=filters, pluck=party.lower() + "_name") + field = party.lower() + "_name" + names = frappe.get_all(party, filters=filters, fields=[f"{field} as party_name", "name"]) for field in ["bank_party_name", "description"]: if not self.get(field): @@ -131,12 +133,18 @@ def match_party_name_desc_in_party(self) -> Union[Tuple, None]: def fuzzy_search_and_return_result(self, party, names, field) -> Union[Tuple, None]: skip = False - result = process.extract(query=self.get(field), choices=names, scorer=fuzz.token_set_ratio) + result = process.extract( + query=self.get(field), + choices=[name.get("party_name") for name in names], + scorer=fuzz.token_set_ratio, + ) party_name, skip = self.process_fuzzy_result(result) if not party_name: return None, skip + # Get Party Docname from the list of dicts + party_name = find(names, lambda x: x["party_name"] == party_name).get("name") return ( party, party_name, From b0a184e937553195862607b945f90b66148120d7 Mon Sep 17 00:00:00 2001 From: marination Date: Tue, 31 Oct 2023 16:53:08 +0100 Subject: [PATCH 05/95] fix: Use `process.extract` to get the corresponding party doc name of the result - rapidfuzz accepts an iterable or a dict. dict input gives the dict key and value in the result (cherry picked from commit e0a03789aef1891273ed6fe5a83b182d3f76e1b7) --- .../doctype/bank_transaction/auto_match_party.py | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/erpnext/accounts/doctype/bank_transaction/auto_match_party.py b/erpnext/accounts/doctype/bank_transaction/auto_match_party.py index 671cde58a922..04dab4c28a05 100644 --- a/erpnext/accounts/doctype/bank_transaction/auto_match_party.py +++ b/erpnext/accounts/doctype/bank_transaction/auto_match_party.py @@ -1,7 +1,6 @@ from typing import Tuple, Union import frappe -from frappe.core.utils import find from frappe.utils import flt from rapidfuzz import fuzz, process @@ -135,7 +134,7 @@ def fuzzy_search_and_return_result(self, party, names, field) -> Union[Tuple, No skip = False result = process.extract( query=self.get(field), - choices=[name.get("party_name") for name in names], + choices={row.get("name"): row.get("party_name") for row in names}, scorer=fuzz.token_set_ratio, ) party_name, skip = self.process_fuzzy_result(result) @@ -143,8 +142,6 @@ def fuzzy_search_and_return_result(self, party, names, field) -> Union[Tuple, No if not party_name: return None, skip - # Get Party Docname from the list of dicts - party_name = find(names, lambda x: x["party_name"] == party_name).get("name") return ( party, party_name, @@ -157,14 +154,14 @@ def process_fuzzy_result(self, result: Union[list, None]): Returns: Result, Skip (whether or not to discontinue matching) """ - PARTY, SCORE, CUTOFF = 0, 1, 80 + SCORE, PARTY_ID, CUTOFF = 1, 2, 80 if not result or not len(result): return None, False first_result = result[0] if len(result) == 1: - return (first_result[PARTY] if first_result[SCORE] > CUTOFF else None), True + return (first_result[PARTY_ID] if first_result[SCORE] > CUTOFF else None), True second_result = result[1] if first_result[SCORE] > CUTOFF: @@ -173,7 +170,7 @@ def process_fuzzy_result(self, result: Union[list, None]): if first_result[SCORE] == second_result[SCORE]: return None, True - return first_result[PARTY], True + return first_result[PARTY_ID], True else: return None, False From 043dc1b14bbcf85a2c87f062a538fc34c731af50 Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Wed, 8 Nov 2023 23:36:17 +0530 Subject: [PATCH 06/95] fix: asset depreciation ledger (backport #37991) (#37992) * fix: asset depreciation ledger (#37991) * fix: include opening acc depr while calculating asset depr ledger report * chore: include opening acc depr properly in acc depr amt * chore: add cost_center in asset depr ledger report * fix: handle finance books properly in asset depr ledger report * chore: rename 'include default book entries' to 'include default FB entries' (cherry picked from commit 9a171db97f67f88fad1589016afb4e808571d04c) # Conflicts: # erpnext/accounts/report/balance_sheet/balance_sheet.js # erpnext/accounts/report/cash_flow/cash_flow.js # erpnext/accounts/report/consolidated_financial_statement/consolidated_financial_statement.js # erpnext/accounts/report/trial_balance/trial_balance.js # erpnext/translations/pl.csv # erpnext/translations/tr.csv * chore: fix conflict in balance_sheet.js * chore: fix conflict in cash_flow.js * chore: fix conflict in consolidated_financial_statement.js * chore: fix conflict in trial_balance.js * chore: fix conflict in tr.csv * chore: fix conflict in pl.csv --------- Co-authored-by: Anand Baburajan --- .../asset_depreciation_ledger.js | 22 ++++++-- .../asset_depreciation_ledger.json | 6 +-- .../asset_depreciation_ledger.py | 51 ++++++++++++++----- .../report/balance_sheet/balance_sheet.js | 2 +- .../accounts/report/cash_flow/cash_flow.js | 2 +- .../consolidated_financial_statement.js | 2 +- .../accounts/report/financial_statements.py | 4 +- .../report/general_ledger/general_ledger.js | 2 +- .../report/general_ledger/general_ledger.py | 4 +- .../report/trial_balance/trial_balance.js | 2 +- .../report/trial_balance/trial_balance.py | 4 +- .../fixed_asset_register.js | 2 +- .../fixed_asset_register.py | 2 +- erpnext/translations/af.csv | 2 +- erpnext/translations/am.csv | 2 +- erpnext/translations/ar.csv | 2 +- erpnext/translations/bg.csv | 2 +- erpnext/translations/bn.csv | 2 +- erpnext/translations/bs.csv | 2 +- erpnext/translations/ca.csv | 2 +- erpnext/translations/cs.csv | 2 +- erpnext/translations/da.csv | 2 +- erpnext/translations/de.csv | 2 +- erpnext/translations/el.csv | 2 +- erpnext/translations/es.csv | 2 +- erpnext/translations/et.csv | 2 +- erpnext/translations/fa.csv | 2 +- erpnext/translations/fi.csv | 2 +- erpnext/translations/fr.csv | 2 +- erpnext/translations/gu.csv | 2 +- erpnext/translations/he.csv | 2 +- erpnext/translations/hi.csv | 2 +- erpnext/translations/hr.csv | 2 +- erpnext/translations/hu.csv | 2 +- erpnext/translations/id.csv | 2 +- erpnext/translations/is.csv | 2 +- erpnext/translations/it.csv | 2 +- erpnext/translations/ja.csv | 2 +- erpnext/translations/km.csv | 2 +- erpnext/translations/kn.csv | 2 +- erpnext/translations/ko.csv | 2 +- erpnext/translations/ku.csv | 2 +- erpnext/translations/lo.csv | 2 +- erpnext/translations/lt.csv | 2 +- erpnext/translations/lv.csv | 2 +- erpnext/translations/mk.csv | 2 +- erpnext/translations/ml.csv | 2 +- erpnext/translations/mr.csv | 2 +- erpnext/translations/ms.csv | 2 +- erpnext/translations/my.csv | 2 +- erpnext/translations/nl.csv | 2 +- erpnext/translations/no.csv | 2 +- erpnext/translations/pl.csv | 2 +- erpnext/translations/ps.csv | 2 +- erpnext/translations/pt-BR.csv | 2 +- erpnext/translations/pt.csv | 2 +- erpnext/translations/ro.csv | 2 +- erpnext/translations/ru.csv | 2 +- erpnext/translations/rw.csv | 2 +- erpnext/translations/si.csv | 2 +- erpnext/translations/sk.csv | 2 +- erpnext/translations/sl.csv | 2 +- erpnext/translations/sq.csv | 2 +- erpnext/translations/sr.csv | 2 +- erpnext/translations/sv.csv | 2 +- erpnext/translations/sw.csv | 2 +- erpnext/translations/ta.csv | 2 +- erpnext/translations/te.csv | 2 +- erpnext/translations/th.csv | 2 +- erpnext/translations/tr.csv | 2 +- erpnext/translations/uk.csv | 2 +- erpnext/translations/ur.csv | 2 +- erpnext/translations/uz.csv | 2 +- erpnext/translations/vi.csv | 2 +- erpnext/translations/zh.csv | 2 +- erpnext/translations/zh_tw.csv | 2 +- 76 files changed, 131 insertions(+), 100 deletions(-) diff --git a/erpnext/accounts/report/asset_depreciation_ledger/asset_depreciation_ledger.js b/erpnext/accounts/report/asset_depreciation_ledger/asset_depreciation_ledger.js index 126cd037955e..12b94347e00f 100644 --- a/erpnext/accounts/report/asset_depreciation_ledger/asset_depreciation_ledger.js +++ b/erpnext/accounts/report/asset_depreciation_ledger/asset_depreciation_ledger.js @@ -31,6 +31,18 @@ frappe.query_reports["Asset Depreciation Ledger"] = { "fieldtype": "Link", "options": "Asset" }, + { + "fieldname":"asset_category", + "label": __("Asset Category"), + "fieldtype": "Link", + "options": "Asset Category" + }, + { + "fieldname":"cost_center", + "label": __("Cost Center"), + "fieldtype": "Link", + "options": "Cost Center" + }, { "fieldname":"finance_book", "label": __("Finance Book"), @@ -38,10 +50,10 @@ frappe.query_reports["Asset Depreciation Ledger"] = { "options": "Finance Book" }, { - "fieldname":"asset_category", - "label": __("Asset Category"), - "fieldtype": "Link", - "options": "Asset Category" - } + "fieldname": "include_default_book_assets", + "label": __("Include Default FB Assets"), + "fieldtype": "Check", + "default": 1 + }, ] } diff --git a/erpnext/accounts/report/asset_depreciation_ledger/asset_depreciation_ledger.json b/erpnext/accounts/report/asset_depreciation_ledger/asset_depreciation_ledger.json index 0ef9d858dd5b..9002e23ed33a 100644 --- a/erpnext/accounts/report/asset_depreciation_ledger/asset_depreciation_ledger.json +++ b/erpnext/accounts/report/asset_depreciation_ledger/asset_depreciation_ledger.json @@ -1,15 +1,15 @@ { - "add_total_row": 1, + "add_total_row": 0, "columns": [], "creation": "2016-04-08 14:49:58.133098", "disabled": 0, "docstatus": 0, "doctype": "Report", "filters": [], - "idx": 2, + "idx": 6, "is_standard": "Yes", "letterhead": null, - "modified": "2023-07-26 21:05:33.554778", + "modified": "2023-11-08 20:17:05.774211", "modified_by": "Administrator", "module": "Accounts", "name": "Asset Depreciation Ledger", diff --git a/erpnext/accounts/report/asset_depreciation_ledger/asset_depreciation_ledger.py b/erpnext/accounts/report/asset_depreciation_ledger/asset_depreciation_ledger.py index f21c94b4940c..d285f28d8e35 100644 --- a/erpnext/accounts/report/asset_depreciation_ledger/asset_depreciation_ledger.py +++ b/erpnext/accounts/report/asset_depreciation_ledger/asset_depreciation_ledger.py @@ -4,7 +4,7 @@ import frappe from frappe import _ -from frappe.utils import flt +from frappe.utils import cstr, flt def execute(filters=None): @@ -32,7 +32,6 @@ def get_data(filters): filters_data.append(["against_voucher", "=", filters.get("asset")]) if filters.get("asset_category"): - assets = frappe.db.sql_list( """select name from tabAsset where asset_category = %s and docstatus=1""", @@ -41,12 +40,27 @@ def get_data(filters): filters_data.append(["against_voucher", "in", assets]) - if filters.get("finance_book"): - filters_data.append(["finance_book", "in", ["", filters.get("finance_book")]]) + company_fb = frappe.get_cached_value("Company", filters.get("company"), "default_finance_book") + + if filters.get("include_default_book_assets") and company_fb: + if filters.get("finance_book") and cstr(filters.get("finance_book")) != cstr(company_fb): + frappe.throw(_("To use a different finance book, please uncheck 'Include Default FB Assets'")) + else: + finance_book = company_fb + elif filters.get("finance_book"): + finance_book = filters.get("finance_book") + else: + finance_book = None + + if finance_book: + or_filters_data = [["finance_book", "in", ["", finance_book]], ["finance_book", "is", "not set"]] + else: + or_filters_data = [["finance_book", "in", [""]], ["finance_book", "is", "not set"]] gl_entries = frappe.get_all( "GL Entry", filters=filters_data, + or_filters=or_filters_data, fields=["against_voucher", "debit_in_account_currency as debit", "voucher_no", "posting_date"], order_by="against_voucher, posting_date", ) @@ -61,7 +75,9 @@ def get_data(filters): asset_data = assets_details.get(d.against_voucher) if asset_data: if not asset_data.get("accumulated_depreciation_amount"): - asset_data.accumulated_depreciation_amount = d.debit + asset_data.accumulated_depreciation_amount = d.debit + asset_data.get( + "opening_accumulated_depreciation" + ) else: asset_data.accumulated_depreciation_amount += d.debit @@ -70,7 +86,7 @@ def get_data(filters): { "depreciation_amount": d.debit, "depreciation_date": d.posting_date, - "amount_after_depreciation": ( + "value_after_depreciation": ( flt(row.gross_purchase_amount) - flt(row.accumulated_depreciation_amount) ), "depreciation_entry": d.voucher_no, @@ -88,10 +104,12 @@ def get_assets_details(assets): fields = [ "name as asset", "gross_purchase_amount", + "opening_accumulated_depreciation", "asset_category", "status", "depreciation_method", "purchase_date", + "cost_center", ] for d in frappe.get_all("Asset", fields=fields, filters={"name": ("in", assets)}): @@ -121,6 +139,12 @@ def get_columns(): "fieldtype": "Currency", "width": 120, }, + { + "label": _("Opening Accumulated Depreciation"), + "fieldname": "opening_accumulated_depreciation", + "fieldtype": "Currency", + "width": 140, + }, { "label": _("Depreciation Amount"), "fieldname": "depreciation_amount", @@ -134,8 +158,8 @@ def get_columns(): "width": 210, }, { - "label": _("Amount After Depreciation"), - "fieldname": "amount_after_depreciation", + "label": _("Value After Depreciation"), + "fieldname": "value_after_depreciation", "fieldtype": "Currency", "width": 180, }, @@ -153,12 +177,13 @@ def get_columns(): "options": "Asset Category", "width": 120, }, - {"label": _("Current Status"), "fieldname": "status", "fieldtype": "Data", "width": 120}, { - "label": _("Depreciation Method"), - "fieldname": "depreciation_method", - "fieldtype": "Data", - "width": 130, + "label": _("Cost Center"), + "fieldtype": "Link", + "fieldname": "cost_center", + "options": "Cost Center", + "width": 100, }, + {"label": _("Current Status"), "fieldname": "status", "fieldtype": "Data", "width": 120}, {"label": _("Purchase Date"), "fieldname": "purchase_date", "fieldtype": "Date", "width": 120}, ] diff --git a/erpnext/accounts/report/balance_sheet/balance_sheet.js b/erpnext/accounts/report/balance_sheet/balance_sheet.js index 4a4ad4d71cba..f1f8e5f6e7c2 100644 --- a/erpnext/accounts/report/balance_sheet/balance_sheet.js +++ b/erpnext/accounts/report/balance_sheet/balance_sheet.js @@ -15,7 +15,7 @@ frappe.require("assets/erpnext/js/financial_statements.js", function() { frappe.query_reports["Balance Sheet"]["filters"].push({ "fieldname": "include_default_book_entries", - "label": __("Include Default Book Entries"), + "label": __("Include Default FB Entries"), "fieldtype": "Check", "default": 1 }); diff --git a/erpnext/accounts/report/cash_flow/cash_flow.js b/erpnext/accounts/report/cash_flow/cash_flow.js index a2c34c6ee267..b9c62b528619 100644 --- a/erpnext/accounts/report/cash_flow/cash_flow.js +++ b/erpnext/accounts/report/cash_flow/cash_flow.js @@ -16,7 +16,7 @@ frappe.require("assets/erpnext/js/financial_statements.js", function() { frappe.query_reports["Cash Flow"]["filters"].push( { "fieldname": "include_default_book_entries", - "label": __("Include Default Book Entries"), + "label": __("Include Default FB Entries"), "fieldtype": "Check", "default": 1 } diff --git a/erpnext/accounts/report/consolidated_financial_statement/consolidated_financial_statement.js b/erpnext/accounts/report/consolidated_financial_statement/consolidated_financial_statement.js index d58fd95a8403..b7d25c419820 100644 --- a/erpnext/accounts/report/consolidated_financial_statement/consolidated_financial_statement.js +++ b/erpnext/accounts/report/consolidated_financial_statement/consolidated_financial_statement.js @@ -105,7 +105,7 @@ frappe.require("assets/erpnext/js/financial_statements.js", function() { }, { "fieldname": "include_default_book_entries", - "label": __("Include Default Book Entries"), + "label": __("Include Default FB Entries"), "fieldtype": "Check", "default": 1 }, diff --git a/erpnext/accounts/report/financial_statements.py b/erpnext/accounts/report/financial_statements.py index 693725d8f504..096bb107069a 100644 --- a/erpnext/accounts/report/financial_statements.py +++ b/erpnext/accounts/report/financial_statements.py @@ -561,9 +561,7 @@ def apply_additional_conditions(doctype, query, from_date, ignore_closing_entrie company_fb = frappe.get_cached_value("Company", filters.company, "default_finance_book") if filters.finance_book and company_fb and cstr(filters.finance_book) != cstr(company_fb): - frappe.throw( - _("To use a different finance book, please uncheck 'Include Default Book Entries'") - ) + frappe.throw(_("To use a different finance book, please uncheck 'Include Default FB Entries'")) query = query.where( (gl_entry.finance_book.isin([cstr(filters.finance_book), cstr(company_fb), ""])) diff --git a/erpnext/accounts/report/general_ledger/general_ledger.js b/erpnext/accounts/report/general_ledger/general_ledger.js index 3bc2ced32fb0..f0ac3d0ffdb8 100644 --- a/erpnext/accounts/report/general_ledger/general_ledger.js +++ b/erpnext/accounts/report/general_ledger/general_ledger.js @@ -175,7 +175,7 @@ frappe.query_reports["General Ledger"] = { }, { "fieldname": "include_default_book_entries", - "label": __("Include Default Book Entries"), + "label": __("Include Default FB Entries"), "fieldtype": "Check", "default": 1 }, diff --git a/erpnext/accounts/report/general_ledger/general_ledger.py b/erpnext/accounts/report/general_ledger/general_ledger.py index 8b938d3d83ce..754f17c118ef 100644 --- a/erpnext/accounts/report/general_ledger/general_ledger.py +++ b/erpnext/accounts/report/general_ledger/general_ledger.py @@ -252,9 +252,7 @@ def get_conditions(filters): if filters.get("company_fb") and cstr(filters.get("finance_book")) != cstr( filters.get("company_fb") ): - frappe.throw( - _("To use a different finance book, please uncheck 'Include Default Book Entries'") - ) + frappe.throw(_("To use a different finance book, please uncheck 'Include Default FB Entries'")) else: conditions.append("(finance_book in (%(finance_book)s, '') OR finance_book IS NULL)") else: diff --git a/erpnext/accounts/report/trial_balance/trial_balance.js b/erpnext/accounts/report/trial_balance/trial_balance.js index 6e233c802f0b..ffb2931e902e 100644 --- a/erpnext/accounts/report/trial_balance/trial_balance.js +++ b/erpnext/accounts/report/trial_balance/trial_balance.js @@ -96,7 +96,7 @@ frappe.require("assets/erpnext/js/financial_statements.js", function() { }, { "fieldname": "include_default_book_entries", - "label": __("Include Default Book Entries"), + "label": __("Include Default FB Entries"), "fieldtype": "Check", "default": 1 }, diff --git a/erpnext/accounts/report/trial_balance/trial_balance.py b/erpnext/accounts/report/trial_balance/trial_balance.py index 2a8aa0c202fc..8b7f0bbc006e 100644 --- a/erpnext/accounts/report/trial_balance/trial_balance.py +++ b/erpnext/accounts/report/trial_balance/trial_balance.py @@ -275,9 +275,7 @@ def get_opening_balance( company_fb = frappe.get_cached_value("Company", filters.company, "default_finance_book") if filters.finance_book and company_fb and cstr(filters.finance_book) != cstr(company_fb): - frappe.throw( - _("To use a different finance book, please uncheck 'Include Default Book Entries'") - ) + frappe.throw(_("To use a different finance book, please uncheck 'Include Default FB Entries'")) opening_balance = opening_balance.where( (closing_balance.finance_book.isin([cstr(filters.finance_book), cstr(company_fb), ""])) diff --git a/erpnext/assets/report/fixed_asset_register/fixed_asset_register.js b/erpnext/assets/report/fixed_asset_register/fixed_asset_register.js index 48b17f58fb2d..0497addf44a7 100644 --- a/erpnext/assets/report/fixed_asset_register/fixed_asset_register.js +++ b/erpnext/assets/report/fixed_asset_register/fixed_asset_register.js @@ -52,7 +52,7 @@ frappe.query_reports["Fixed Asset Register"] = { }, { "fieldname": "include_default_book_assets", - "label": __("Include Default Book Assets"), + "label": __("Include Default FB Assets"), "fieldtype": "Check", "default": 1 }, diff --git a/erpnext/assets/report/fixed_asset_register/fixed_asset_register.py b/erpnext/assets/report/fixed_asset_register/fixed_asset_register.py index 383be973477d..45811a934444 100644 --- a/erpnext/assets/report/fixed_asset_register/fixed_asset_register.py +++ b/erpnext/assets/report/fixed_asset_register/fixed_asset_register.py @@ -223,7 +223,7 @@ def get_assets_linked_to_fb(filters): company_fb = frappe.get_cached_value("Company", filters.company, "default_finance_book") if filters.finance_book and company_fb and cstr(filters.finance_book) != cstr(company_fb): - frappe.throw(_("To use a different finance book, please uncheck 'Include Default Book Assets'")) + frappe.throw(_("To use a different finance book, please uncheck 'Include Default FB Assets'")) query = query.where( (afb.finance_book.isin([cstr(filters.finance_book), cstr(company_fb), ""])) diff --git a/erpnext/translations/af.csv b/erpnext/translations/af.csv index 10e1cba349e4..7c3c6afca478 100644 --- a/erpnext/translations/af.csv +++ b/erpnext/translations/af.csv @@ -1260,7 +1260,7 @@ In Value,In Waarde, "In the case of multi-tier program, Customers will be auto assigned to the concerned tier as per their spent",In die geval van 'n multi-vlak program sal kliënte outomaties toegewys word aan die betrokke vlak volgens hul besteding, Inactive,onaktiewe, Incentives,aansporings, -Include Default Book Entries,Sluit standaardboekinskrywings in, +Include Default FB Entries,Sluit standaardboekinskrywings in, Include Exploded Items,Sluit ontplofte items in, Include POS Transactions,Sluit POS-transaksies in, Include UOM,Sluit UOM in, diff --git a/erpnext/translations/am.csv b/erpnext/translations/am.csv index f1d979205eca..f6e0fb56f105 100644 --- a/erpnext/translations/am.csv +++ b/erpnext/translations/am.csv @@ -1260,7 +1260,7 @@ In Value,እሴት ውስጥ, "In the case of multi-tier program, Customers will be auto assigned to the concerned tier as per their spent","በባለብዙ ደረጃ መርሃግብር ሁኔታ, ደንበኞች በተጠቀሱት ወጪ መሰረት ለተሰጣቸው ደረጃ ደረጃ በራስ መተላለፍ ይኖራቸዋል", Inactive,ገባሪ አይደለም, Incentives,ማበረታቻዎች, -Include Default Book Entries,ነባሪ የመጽሐፍ ግቤቶችን አካትት።, +Include Default FB Entries,ነባሪ የመጽሐፍ ግቤቶችን አካትት።, Include Exploded Items,የተበተኑ ንጥሎችን አካት, Include POS Transactions,የ POS ሽግግሮችን አክል, Include UOM,UOM አካት, diff --git a/erpnext/translations/ar.csv b/erpnext/translations/ar.csv index d4df088c778a..4028ca7817cb 100644 --- a/erpnext/translations/ar.csv +++ b/erpnext/translations/ar.csv @@ -1260,7 +1260,7 @@ In Value,القيمة القادمة, "In the case of multi-tier program, Customers will be auto assigned to the concerned tier as per their spent",في حالة البرنامج متعدد المستويات ، سيتم تعيين العملاء تلقائيًا إلى الطبقة المعنية وفقًا للإنفاق, Inactive,غير نشط, Incentives,الحوافز, -Include Default Book Entries,تضمين إدخالات دفتر افتراضي, +Include Default FB Entries,تضمين إدخالات دفتر افتراضي, Include Exploded Items,تشمل البنود المستبعدة, Include POS Transactions,تشمل معاملات نقطه البيع, Include UOM,تضمين UOM, diff --git a/erpnext/translations/bg.csv b/erpnext/translations/bg.csv index 24a397210e1d..7e26ba222ce0 100644 --- a/erpnext/translations/bg.csv +++ b/erpnext/translations/bg.csv @@ -1260,7 +1260,7 @@ In Value,В стойност, "In the case of multi-tier program, Customers will be auto assigned to the concerned tier as per their spent","В случай на многостепенна програма, клиентите ще бъдат автоматично зададени на съответния подреждан по тяхна сметка", Inactive,неактивен, Incentives,Стимули, -Include Default Book Entries,Включете записи по подразбиране на книги, +Include Default FB Entries,Включете записи по подразбиране на книги, Include Exploded Items,Включете експлодираните елементи, Include POS Transactions,Включете POS транзакции, Include UOM,Включете UOM, diff --git a/erpnext/translations/bn.csv b/erpnext/translations/bn.csv index 75532418ea40..3cf3317a3071 100644 --- a/erpnext/translations/bn.csv +++ b/erpnext/translations/bn.csv @@ -1260,7 +1260,7 @@ In Value,মান, "In the case of multi-tier program, Customers will be auto assigned to the concerned tier as per their spent","মাল্টি-টিয়ার প্রোগ্রামের ক্ষেত্রে, গ্রাহকরা তাদের ব্যয় অনুযায়ী সংশ্লিষ্ট টায়ারে স্বয়ংক্রিয়ভাবে নিয়োগ পাবেন", Inactive,নিষ্ক্রিয়, Incentives,ইনসেনটিভ, -Include Default Book Entries,ডিফল্ট বুক এন্ট্রি অন্তর্ভুক্ত করুন, +Include Default FB Entries,ডিফল্ট বুক এন্ট্রি অন্তর্ভুক্ত করুন, Include Exploded Items,বিস্ফোরিত আইটেম অন্তর্ভুক্ত করুন, Include POS Transactions,পিওএস লেনদেন অন্তর্ভুক্ত করুন, Include UOM,UOM অন্তর্ভুক্ত করুন, diff --git a/erpnext/translations/bs.csv b/erpnext/translations/bs.csv index ab82d0fc1072..cd7700fa591f 100644 --- a/erpnext/translations/bs.csv +++ b/erpnext/translations/bs.csv @@ -1260,7 +1260,7 @@ In Value,u vrijednost, "In the case of multi-tier program, Customers will be auto assigned to the concerned tier as per their spent","U slučaju višeslojnog programa, Korisnici će automatski biti dodeljeni za dotičnu grupu po njihovom trošenju", Inactive,Neaktivan, Incentives,Poticaji, -Include Default Book Entries,Uključite zadane unose knjiga, +Include Default FB Entries,Uključite zadane unose knjiga, Include Exploded Items,Uključite eksplodirane predmete, Include POS Transactions,Uključite POS transakcije, Include UOM,Uključite UOM, diff --git a/erpnext/translations/ca.csv b/erpnext/translations/ca.csv index afac395efa94..162fd60cae78 100644 --- a/erpnext/translations/ca.csv +++ b/erpnext/translations/ca.csv @@ -1260,7 +1260,7 @@ In Value,En valor, "In the case of multi-tier program, Customers will be auto assigned to the concerned tier as per their spent","En el cas del programa de diversos nivells, els clients seran assignats automàticament al nivell corresponent segons el seu gastat", Inactive,Inactiu, Incentives,Incentius, -Include Default Book Entries,Inclou les entrades de llibres predeterminats, +Include Default FB Entries,Inclou les entrades de llibres predeterminats, Include Exploded Items,Inclou articles explotats, Include POS Transactions,Inclou transaccions de POS, Include UOM,Inclou UOM, diff --git a/erpnext/translations/cs.csv b/erpnext/translations/cs.csv index 64dec565400b..11fa70b4babb 100644 --- a/erpnext/translations/cs.csv +++ b/erpnext/translations/cs.csv @@ -1260,7 +1260,7 @@ In Value,v Hodnota, "In the case of multi-tier program, Customers will be auto assigned to the concerned tier as per their spent",V případě víceúrovňového programu budou zákazníci automaticky přiděleni danému vrstvě podle svých vynaložených nákladů, Inactive,Neaktivní, Incentives,Pobídky, -Include Default Book Entries,Zahrnout výchozí položky knihy, +Include Default FB Entries,Zahrnout výchozí položky knihy, Include Exploded Items,Zahrnout výbušné položky, Include POS Transactions,Zahrnout POS transakce, Include UOM,Zahrnout UOM, diff --git a/erpnext/translations/da.csv b/erpnext/translations/da.csv index 8a735b1e2714..007d46d2dcf0 100644 --- a/erpnext/translations/da.csv +++ b/erpnext/translations/da.csv @@ -1260,7 +1260,7 @@ In Value,I Value, "In the case of multi-tier program, Customers will be auto assigned to the concerned tier as per their spent","I tilfælde af multi-tier program, vil kunder automatisk blive tildelt den pågældende tier som per deres brugt", Inactive,inaktive, Incentives,Incitamenter, -Include Default Book Entries,Inkluder standardbogsindlæg, +Include Default FB Entries,Inkluder standardbogsindlæg, Include Exploded Items,Inkluder eksploderede elementer, Include POS Transactions,Inkluder POS-transaktioner, Include UOM,Inkluder UOM, diff --git a/erpnext/translations/de.csv b/erpnext/translations/de.csv index 63d78adc6a43..038db208a2ce 100644 --- a/erpnext/translations/de.csv +++ b/erpnext/translations/de.csv @@ -1268,7 +1268,7 @@ In Value,Wert bei, "In the case of multi-tier program, Customers will be auto assigned to the concerned tier as per their spent",Im Falle eines mehrstufigen Programms werden Kunden automatisch der betroffenen Ebene entsprechend ihrer Ausgaben zugewiesen, Inactive,Inaktiv, Incentives,Anreize, -Include Default Book Entries,Standardbucheinträge einschließen, +Include Default FB Entries,Standardbucheinträge einschließen, Include Exploded Items,Unterartikel einbeziehen, Include POS Transactions,POS-Transaktionen einschließen, Include UOM,Fügen Sie UOM hinzu, diff --git a/erpnext/translations/el.csv b/erpnext/translations/el.csv index cacce1efadac..74cba44b1d16 100644 --- a/erpnext/translations/el.csv +++ b/erpnext/translations/el.csv @@ -1260,7 +1260,7 @@ In Value,στην Αξία, "In the case of multi-tier program, Customers will be auto assigned to the concerned tier as per their spent","Στην περίπτωση προγράμματος πολλαπλών βαθμίδων, οι Πελάτες θα αντιστοιχούν αυτόματα στη σχετική βαθμίδα σύμφωνα με το ποσό που δαπανώνται", Inactive,Αδρανής, Incentives,Κίνητρα, -Include Default Book Entries,Συμπεριλάβετε τις προεπιλεγμένες καταχωρίσεις βιβλίων, +Include Default FB Entries,Συμπεριλάβετε τις προεπιλεγμένες καταχωρίσεις βιβλίων, Include Exploded Items,Συμπεριλάβετε εκραγμένα στοιχεία, Include POS Transactions,Συμπεριλάβετε τις συναλλαγές POS, Include UOM,Συμπεριλάβετε UOM, diff --git a/erpnext/translations/es.csv b/erpnext/translations/es.csv index 8999d90ae876..be2bededf5c4 100644 --- a/erpnext/translations/es.csv +++ b/erpnext/translations/es.csv @@ -1260,7 +1260,7 @@ In Value,En valor, "In the case of multi-tier program, Customers will be auto assigned to the concerned tier as per their spent","En el caso del programa de varios niveles, los Clientes se asignarán automáticamente al nivel correspondiente según su gasto", Inactive,Inactivo, Incentives,Incentivos, -Include Default Book Entries,Incluir entradas de libro predeterminadas, +Include Default FB Entries,Incluir entradas de libro predeterminadas, Include Exploded Items,Incluir Elementos Estallados, Include POS Transactions,Incluir transacciones POS, Include UOM,Incluir UOM, diff --git a/erpnext/translations/et.csv b/erpnext/translations/et.csv index 0d509deda1aa..180d97cbb8e1 100644 --- a/erpnext/translations/et.csv +++ b/erpnext/translations/et.csv @@ -1260,7 +1260,7 @@ In Value,väärtuse, "In the case of multi-tier program, Customers will be auto assigned to the concerned tier as per their spent",Mitmekordsete programmide korral määratakse Kliendid automaatselt asjaomasele tasemele vastavalt nende kasutatud kuludele, Inactive,Mitteaktiivne, Incentives,Soodustused, -Include Default Book Entries,Lisage vaikeraamatu kanded, +Include Default FB Entries,Lisage vaikeraamatu kanded, Include Exploded Items,Kaasa lõhutud esemed, Include POS Transactions,Kaasa POS-tehingud, Include UOM,Lisa UOM, diff --git a/erpnext/translations/fa.csv b/erpnext/translations/fa.csv index 3e054606fc74..21354935f23d 100644 --- a/erpnext/translations/fa.csv +++ b/erpnext/translations/fa.csv @@ -1260,7 +1260,7 @@ In Value,با ارزش, "In the case of multi-tier program, Customers will be auto assigned to the concerned tier as per their spent",در مورد برنامه چند لایه، مشتریان به صورت خودکار به سطر مربوطه اختصاص داده می شوند، همانطور که در هزینه های خود هستند, Inactive,غیر فعال, Incentives,انگیزه, -Include Default Book Entries,شامل ورودی های پیش فرض کتاب, +Include Default FB Entries,شامل ورودی های پیش فرض کتاب, Include Exploded Items,شامل موارد انفجار, Include POS Transactions,شامل معاملات POS, Include UOM,شامل UOM, diff --git a/erpnext/translations/fi.csv b/erpnext/translations/fi.csv index 892261d01784..5801a4904e21 100644 --- a/erpnext/translations/fi.csv +++ b/erpnext/translations/fi.csv @@ -1260,7 +1260,7 @@ In Value,in Arvo, "In the case of multi-tier program, Customers will be auto assigned to the concerned tier as per their spent",Monitasoisen ohjelman tapauksessa asiakkaat määräytyvät automaattisesti kyseiselle tasolle niiden kulutuksen mukaan, Inactive,Epäaktiivinen, Incentives,kannustimet/bonukset, -Include Default Book Entries,Sisällytä oletustiedot, +Include Default FB Entries,Sisällytä oletustiedot, Include Exploded Items,Sisällytä räjähtämättömiä kohteita, Include POS Transactions,Sisällytä POS-tapahtumia, Include UOM,Sisällytä UOM, diff --git a/erpnext/translations/fr.csv b/erpnext/translations/fr.csv index 0865e2f7a7d9..ee14868b4d34 100644 --- a/erpnext/translations/fr.csv +++ b/erpnext/translations/fr.csv @@ -1260,7 +1260,7 @@ In Value,En valeur, "In the case of multi-tier program, Customers will be auto assigned to the concerned tier as per their spent","Dans le cas d'un programme à plusieurs échelons, les clients seront automatiquement affectés au niveau approprié en fonction de leurs dépenses", Inactive,Inactif, Incentives,Incitations, -Include Default Book Entries,Inclure les entrées de livre par défaut, +Include Default FB Entries,Inclure les entrées de livre par défaut, Include Exploded Items,Inclure les articles éclatés, Include POS Transactions,Inclure les transactions du point de vente, Include UOM,Inclure UdM, diff --git a/erpnext/translations/gu.csv b/erpnext/translations/gu.csv index 787e29d62192..81437b5fc4c4 100644 --- a/erpnext/translations/gu.csv +++ b/erpnext/translations/gu.csv @@ -1260,7 +1260,7 @@ In Value,ભાવ, "In the case of multi-tier program, Customers will be auto assigned to the concerned tier as per their spent","મલ્ટિ-ટાયર પ્રોગ્રામના કિસ્સામાં, ગ્રાહક તેમના ખર્ચ મુજબ સંબંધિત ટાયરમાં ઓટો હશે", Inactive,નિષ્ક્રિય, Incentives,ઇનસેન્ટીવ્સ, -Include Default Book Entries,ડિફaultલ્ટ બુક એન્ટ્રીઓ શામેલ કરો, +Include Default FB Entries,ડિફaultલ્ટ બુક એન્ટ્રીઓ શામેલ કરો, Include Exploded Items,વિસ્ફોટ થયેલ આઇટમ્સ શામેલ કરો, Include POS Transactions,POS વ્યવહારો શામેલ કરો, Include UOM,યુએમએમ શામેલ કરો, diff --git a/erpnext/translations/he.csv b/erpnext/translations/he.csv index c8a9c7546e10..4805f2059332 100644 --- a/erpnext/translations/he.csv +++ b/erpnext/translations/he.csv @@ -1260,7 +1260,7 @@ In Value,ערך, "In the case of multi-tier program, Customers will be auto assigned to the concerned tier as per their spent","במקרה של תוכנית רב-שכבתית, הלקוחות יוקצו אוטומטית לשכבה הנוגעת בדבר שהוצאו", Inactive,לֹא פָּעִיל, Incentives,תמריצים, -Include Default Book Entries,כלול רשומות ברירת מחדל לספרים, +Include Default FB Entries,כלול רשומות ברירת מחדל לספרים, Include Exploded Items,כלול פריטים מפוצצים, Include POS Transactions,כלול עסקאות קופה, Include UOM,כלול UOM, diff --git a/erpnext/translations/hi.csv b/erpnext/translations/hi.csv index 21e659aabec6..a1cfd8dbb726 100644 --- a/erpnext/translations/hi.csv +++ b/erpnext/translations/hi.csv @@ -1260,7 +1260,7 @@ In Value,मूल्य में, "In the case of multi-tier program, Customers will be auto assigned to the concerned tier as per their spent","मल्टी-स्तरीय कार्यक्रम के मामले में, ग्राहक अपने खर्च के अनुसार संबंधित स्तर को स्वचालित रूप से सौंपा जाएगा", Inactive,निष्क्रिय, Incentives,प्रोत्साहन, -Include Default Book Entries,डिफ़ॉल्ट बुक प्रविष्टियाँ शामिल करें, +Include Default FB Entries,डिफ़ॉल्ट बुक प्रविष्टियाँ शामिल करें, Include Exploded Items,विस्फोट किए गए आइटम शामिल करें, Include POS Transactions,पीओएस लेनदेन शामिल करें, Include UOM,यूओएम शामिल करें, diff --git a/erpnext/translations/hr.csv b/erpnext/translations/hr.csv index 9d0b9526f797..55379d4105ec 100644 --- a/erpnext/translations/hr.csv +++ b/erpnext/translations/hr.csv @@ -1260,7 +1260,7 @@ In Value,u vrijednost, "In the case of multi-tier program, Customers will be auto assigned to the concerned tier as per their spent","U slučaju višerazinskog programa, Kupci će biti automatski dodijeljeni odgovarajućem stupcu po njihovu potrošenom", Inactive,neaktivan, Incentives,poticaji, -Include Default Book Entries,Uključite zadane unose u knjige, +Include Default FB Entries,Uključite zadane unose u knjige, Include Exploded Items,Uključi eksplodirane predmete, Include POS Transactions,Uključi POS transakcije, Include UOM,Uključi UOM, diff --git a/erpnext/translations/hu.csv b/erpnext/translations/hu.csv index c7966b5113e2..bdd2e1278c99 100644 --- a/erpnext/translations/hu.csv +++ b/erpnext/translations/hu.csv @@ -1260,7 +1260,7 @@ In Value,Az Értékben, "In the case of multi-tier program, Customers will be auto assigned to the concerned tier as per their spent","Többszintű program esetében az ügyfeleket automatikusan az adott kategóriába sorolják, az általuk elköltöttek szerint", Inactive,Inaktív, Incentives,Ösztönzők, -Include Default Book Entries,Tartalmazza az alapértelmezett könyvbejegyzéseket, +Include Default FB Entries,Tartalmazza az alapértelmezett könyvbejegyzéseket, Include Exploded Items,Tartalmazza a robbantott elemeket, Include POS Transactions,Tartalmazza a POS kassza tranzakciókat, Include UOM,Ide tartozik az ANYJ, diff --git a/erpnext/translations/id.csv b/erpnext/translations/id.csv index de44c6fd7826..2d83bc3703be 100644 --- a/erpnext/translations/id.csv +++ b/erpnext/translations/id.csv @@ -1260,7 +1260,7 @@ In Value,Nilai, "In the case of multi-tier program, Customers will be auto assigned to the concerned tier as per their spent","Dalam kasus program multi-tier, Pelanggan akan ditugaskan secara otomatis ke tingkat yang bersangkutan sesuai yang mereka habiskan", Inactive,Tidak aktif, Incentives,Insentif, -Include Default Book Entries,Sertakan Entri Buku Default, +Include Default FB Entries,Sertakan Entri Buku Default, Include Exploded Items,Sertakan barang yang meledak, Include POS Transactions,Sertakan Transaksi POS, Include UOM,Termasuk UOM, diff --git a/erpnext/translations/is.csv b/erpnext/translations/is.csv index b9174e26e51f..2d48ca51a666 100644 --- a/erpnext/translations/is.csv +++ b/erpnext/translations/is.csv @@ -1260,7 +1260,7 @@ In Value,Virði, "In the case of multi-tier program, Customers will be auto assigned to the concerned tier as per their spent","Þegar um er að ræða fjölþættaráætlun, verða viðskiptavinir sjálfkrafa tengdir viðkomandi flokka eftir því sem þeir eru í", Inactive,Óvirkt, Incentives,Incentives, -Include Default Book Entries,Hafa sjálfgefnar bókarfærslur með, +Include Default FB Entries,Hafa sjálfgefnar bókarfærslur með, Include Exploded Items,Inniheldur sprauta hluti, Include POS Transactions,Innifalið POS-viðskipti, Include UOM,Innifalið UOM, diff --git a/erpnext/translations/it.csv b/erpnext/translations/it.csv index d432eaf1e96c..2ea39ad67e90 100644 --- a/erpnext/translations/it.csv +++ b/erpnext/translations/it.csv @@ -1260,7 +1260,7 @@ In Value,In valore, "In the case of multi-tier program, Customers will be auto assigned to the concerned tier as per their spent","Nel caso di un programma multilivello, i clienti verranno assegnati automaticamente al livello interessato come da loro speso", Inactive,Inattivo, Incentives,Incentivi, -Include Default Book Entries,Includi voci di libro predefinite, +Include Default FB Entries,Includi voci di libro predefinite, Include Exploded Items,Includi elementi esplosi, Include POS Transactions,Includi transazioni POS, Include UOM,Includi UOM, diff --git a/erpnext/translations/ja.csv b/erpnext/translations/ja.csv index 2bf91fbe2515..31e2360ed069 100644 --- a/erpnext/translations/ja.csv +++ b/erpnext/translations/ja.csv @@ -1260,7 +1260,7 @@ In Value,値内, "In the case of multi-tier program, Customers will be auto assigned to the concerned tier as per their spent",マルチティアプログラムの場合、顧客は、消費されるごとに自動的に関係する層に割り当てられます, Inactive,非アクティブ, Incentives,インセンティブ, -Include Default Book Entries,デフォルトのブックエントリを含める, +Include Default FB Entries,デフォルトのブックエントリを含める, Include Exploded Items,分解された項目を含める, Include POS Transactions,POSトランザクションを含める, Include UOM,UOMを含める, diff --git a/erpnext/translations/km.csv b/erpnext/translations/km.csv index 8b25f9983560..efd30df21259 100644 --- a/erpnext/translations/km.csv +++ b/erpnext/translations/km.csv @@ -1260,7 +1260,7 @@ In Value,នៅក្នុងតម្លៃ, "In the case of multi-tier program, Customers will be auto assigned to the concerned tier as per their spent",ក្នុងករណីមានកម្មវិធីពហុលំដាប់អតិថិជននឹងត្រូវបានចាត់តាំងដោយខ្លួនឯងទៅថ្នាក់ដែលពាក់ព័ន្ធដោយចំណាយរបស់ពួកគេ, Inactive,អសកម្ម, Incentives,ការលើកទឹកចិត្ត, -Include Default Book Entries,រួមបញ្ចូលធាតុសៀវភៅលំនាំដើម។, +Include Default FB Entries,រួមបញ្ចូលធាតុសៀវភៅលំនាំដើម។, Include Exploded Items,រួមបញ្ចូលធាតុផ្ទុះ, Include POS Transactions,បញ្ចូលប្រតិបត្តិការ POS, Include UOM,រួមបញ្ចូល UOM, diff --git a/erpnext/translations/kn.csv b/erpnext/translations/kn.csv index 944a59ef3362..7372e1b9bac9 100644 --- a/erpnext/translations/kn.csv +++ b/erpnext/translations/kn.csv @@ -1260,7 +1260,7 @@ In Value,ಮೌಲ್ಯ, "In the case of multi-tier program, Customers will be auto assigned to the concerned tier as per their spent","ಮಲ್ಟಿ-ಟೈರ್ ಪ್ರೋಗ್ರಾಂನ ಸಂದರ್ಭದಲ್ಲಿ, ಗ್ರಾಹಕರು ತಮ್ಮ ಖರ್ಚುಗೆ ಅನುಗುಣವಾಗಿ ಆಯಾ ಶ್ರೇಣಿಗೆ ಸ್ವಯಂ ನಿಯೋಜಿಸಲಾಗುವುದು", Inactive,ನಿಷ್ಕ್ರಿಯವಾಗಿದೆ, Incentives,ಪ್ರೋತ್ಸಾಹ, -Include Default Book Entries,ಡೀಫಾಲ್ಟ್ ಪುಸ್ತಕ ನಮೂದುಗಳನ್ನು ಸೇರಿಸಿ, +Include Default FB Entries,ಡೀಫಾಲ್ಟ್ ಪುಸ್ತಕ ನಮೂದುಗಳನ್ನು ಸೇರಿಸಿ, Include Exploded Items,ಸ್ಫೋಟಗೊಂಡ ವಸ್ತುಗಳನ್ನು ಸೇರಿಸಿ, Include POS Transactions,ಪಿಒಎಸ್ ಟ್ರಾನ್ಸಾಕ್ಷನ್ಸ್ ಸೇರಿಸಿ, Include UOM,UOM ಸೇರಿಸಿ, diff --git a/erpnext/translations/ko.csv b/erpnext/translations/ko.csv index 66b8692afe8c..8c0285bc28a3 100644 --- a/erpnext/translations/ko.csv +++ b/erpnext/translations/ko.csv @@ -1260,7 +1260,7 @@ In Value,값에서, "In the case of multi-tier program, Customers will be auto assigned to the concerned tier as per their spent",다중 계층 프로그램의 경우 고객은 지출 한대로 해당 계층에 자동으로 할당됩니다., Inactive,비활성, Incentives,장려책, -Include Default Book Entries,기본 도서 항목 포함, +Include Default FB Entries,기본 도서 항목 포함, Include Exploded Items,분해 된 항목 포함, Include POS Transactions,POS 트랜잭션 포함, Include UOM,UOM 포함, diff --git a/erpnext/translations/ku.csv b/erpnext/translations/ku.csv index 325a0a7d2560..35f593a509e7 100644 --- a/erpnext/translations/ku.csv +++ b/erpnext/translations/ku.csv @@ -1260,7 +1260,7 @@ In Value,di Nirx, "In the case of multi-tier program, Customers will be auto assigned to the concerned tier as per their spent","Di rewşê de bernameya pir-tier, Ewrûpa dê ji hêla xercê xwe ve girêdayî xerîb be", Inactive,Bêkar, Incentives,aborîve, -Include Default Book Entries,Navnîşanên Pirtûka Pêvek Bawer bikin, +Include Default FB Entries,Navnîşanên Pirtûka Pêvek Bawer bikin, Include Exploded Items,Included Dead Items, Include POS Transactions,Têkiliyên POSê de, Include UOM,UOM, diff --git a/erpnext/translations/lo.csv b/erpnext/translations/lo.csv index b8b7a5d623ba..73a33440bbc7 100644 --- a/erpnext/translations/lo.csv +++ b/erpnext/translations/lo.csv @@ -1260,7 +1260,7 @@ In Value,ໃນມູນຄ່າ, "In the case of multi-tier program, Customers will be auto assigned to the concerned tier as per their spent","ໃນກໍລະນີຂອງໂຄງການຫຼາຍຂັ້ນ, ລູກຄ້າຈະໄດ້ຮັບການມອບຫມາຍໂດຍອັດຕະໂນມັດໃຫ້ກັບຂັ້ນຕອນທີ່ກ່ຽວຂ້ອງຕາມການໃຊ້ຈ່າຍຂອງເຂົາເຈົ້າ", Inactive,Inactive, Incentives,ສິ່ງຈູງໃຈ, -Include Default Book Entries,ລວມທັງການອອກສຽງປື້ມແບບເລີ່ມຕົ້ນ, +Include Default FB Entries,ລວມທັງການອອກສຽງປື້ມແບບເລີ່ມຕົ້ນ, Include Exploded Items,ລວມເອົາສິ່ງທີ່ເກີດຂື້ນ, Include POS Transactions,ລວມທຸລະກໍາ POS, Include UOM,ລວມ UOM, diff --git a/erpnext/translations/lt.csv b/erpnext/translations/lt.csv index 5f249a742df3..aeeef9af5b12 100644 --- a/erpnext/translations/lt.csv +++ b/erpnext/translations/lt.csv @@ -1260,7 +1260,7 @@ In Value,vertės, "In the case of multi-tier program, Customers will be auto assigned to the concerned tier as per their spent","Kalbant apie daugiapakopę programą, klientai bus automatiškai priskirti atitinkamam lygmeniui, atsižvelgiant į jų išleidimą", Inactive,Neaktyvus, Incentives,Paskatos, -Include Default Book Entries,Įtraukite numatytuosius knygų įrašus, +Include Default FB Entries,Įtraukite numatytuosius knygų įrašus, Include Exploded Items,Įtraukti sprogus elementus, Include POS Transactions,Įtraukti POS operacijas, Include UOM,Įtraukti UOM, diff --git a/erpnext/translations/lv.csv b/erpnext/translations/lv.csv index f7a3d356f803..b3db9019afd9 100644 --- a/erpnext/translations/lv.csv +++ b/erpnext/translations/lv.csv @@ -1260,7 +1260,7 @@ In Value,Vērtībā, "In the case of multi-tier program, Customers will be auto assigned to the concerned tier as per their spent","Daudzpakāpju programmas gadījumā Klienti tiks automātiski piešķirti attiecīgajam līmenim, salīdzinot ar viņu iztērēto", Inactive,Neaktīvs, Incentives,Stimuli, -Include Default Book Entries,Iekļaujiet noklusējuma grāmatas ierakstus, +Include Default FB Entries,Iekļaujiet noklusējuma grāmatas ierakstus, Include Exploded Items,Iekļaut izpūstas preces, Include POS Transactions,Iekļaut POS darījumus, Include UOM,Iekļaut UOM, diff --git a/erpnext/translations/mk.csv b/erpnext/translations/mk.csv index 06c2aff0b442..212d5d7a8342 100644 --- a/erpnext/translations/mk.csv +++ b/erpnext/translations/mk.csv @@ -1260,7 +1260,7 @@ In Value,Во вредност, "In the case of multi-tier program, Customers will be auto assigned to the concerned tier as per their spent","Во случај на повеќеслојна програма, корисниците ќе бидат автоматски доделени на засегнатите нивоа, како на нивните потрошени", Inactive,Неактивен, Incentives,Стимулации, -Include Default Book Entries,Вклучете стандардни записи за книги, +Include Default FB Entries,Вклучете стандардни записи за книги, Include Exploded Items,Вклучи експлодирани елементи, Include POS Transactions,Вклучете POS-трансакции, Include UOM,Вклучете UOM, diff --git a/erpnext/translations/ml.csv b/erpnext/translations/ml.csv index f28ea330402e..036ec78b847f 100644 --- a/erpnext/translations/ml.csv +++ b/erpnext/translations/ml.csv @@ -1260,7 +1260,7 @@ In Value,മൂല്യത്തിൽ, "In the case of multi-tier program, Customers will be auto assigned to the concerned tier as per their spent","മൾട്ടി-ടയർ പരിപാടിയുടെ കാര്യത്തിൽ, കസ്റ്റമർമാർ ചെലവഴിച്ച തുക പ്രകാരം ബന്ധപ്പെട്ട ടീമിൽ ഓട്ടോ നിർണ്ണയിക്കും", Inactive,നിഷ്ക്രിയം, Incentives,ഇൻസെന്റീവ്സ്, -Include Default Book Entries,സ്ഥിരസ്ഥിതി പുസ്തക എൻ‌ട്രികൾ‌ ഉൾ‌പ്പെടുത്തുക, +Include Default FB Entries,സ്ഥിരസ്ഥിതി പുസ്തക എൻ‌ട്രികൾ‌ ഉൾ‌പ്പെടുത്തുക, Include Exploded Items,എക്സ്പ്ലോഡഡ് ഇനങ്ങൾ ഉൾപ്പെടുത്തുക, Include POS Transactions,POS ഇടപാടുകൾ ഉൾപ്പെടുത്തുക, Include UOM,UOM ഉൾപ്പെടുത്തുക, diff --git a/erpnext/translations/mr.csv b/erpnext/translations/mr.csv index 64b074882965..89915b746939 100644 --- a/erpnext/translations/mr.csv +++ b/erpnext/translations/mr.csv @@ -1260,7 +1260,7 @@ In Value,मूल्य, "In the case of multi-tier program, Customers will be auto assigned to the concerned tier as per their spent",बहु-स्तरीय कार्यक्रमाच्या बाबतीत ग्राहक त्यांच्या खर्चानुसार संबंधित टायरला स्वयंचलितरित्या नियुक्त केले जातील, Inactive,निष्क्रिय, Incentives,प्रोत्साहन, -Include Default Book Entries,डीफॉल्ट पुस्तक नोंदी समाविष्ट करा, +Include Default FB Entries,डीफॉल्ट पुस्तक नोंदी समाविष्ट करा, Include Exploded Items,विस्फोट केलेल्या वस्तू समाविष्ट करा, Include POS Transactions,पीओएस व्यवहार समाविष्ट करा, Include UOM,यूओएम समाविष्ट करा, diff --git a/erpnext/translations/ms.csv b/erpnext/translations/ms.csv index 5d2c2a890e7a..0f9cc036efd8 100644 --- a/erpnext/translations/ms.csv +++ b/erpnext/translations/ms.csv @@ -1260,7 +1260,7 @@ In Value,Dalam Nilai, "In the case of multi-tier program, Customers will be auto assigned to the concerned tier as per their spent","Dalam hal program multi-tier, Pelanggan akan ditugaskan secara automatik ke peringkat yang bersangkutan seperti yang dibelanjakannya", Inactive,Tidak aktif, Incentives,Insentif, -Include Default Book Entries,Sertakan Penyertaan Buku Lalai, +Include Default FB Entries,Sertakan Penyertaan Buku Lalai, Include Exploded Items,Termasuk Item Meletup, Include POS Transactions,Termasuk Transaksi POS, Include UOM,Termasuk UOM, diff --git a/erpnext/translations/my.csv b/erpnext/translations/my.csv index 0471f66bc55e..3f6038db8d5e 100644 --- a/erpnext/translations/my.csv +++ b/erpnext/translations/my.csv @@ -1260,7 +1260,7 @@ In Value,Value တစ်ခုအတွက်, "In the case of multi-tier program, Customers will be auto assigned to the concerned tier as per their spent","Multi-tier အစီအစဉ်၏အမှု၌, Customer များအလိုအလျောက်သူတို့ရဲ့သုံးစွဲနှုန်းအတိုင်းစိုးရိမ်ပူပန်ဆင့်မှတာဝန်ပေးအပ်ပါလိမ့်မည်", Inactive,မလှုပ်ရှားတတ်သော, Incentives,မက်လုံးတွေပေးပြီး, -Include Default Book Entries,ပုံမှန်စာအုပ် Entries Include, +Include Default FB Entries,ပုံမှန်စာအုပ် Entries Include, Include Exploded Items,ပေါက်ကွဲပစ္စည်းများ Include, Include POS Transactions,POS အရောင်းအဝယ် Include, Include UOM,UOM Include, diff --git a/erpnext/translations/nl.csv b/erpnext/translations/nl.csv index 92671115bfc6..9b2b54b5ded6 100644 --- a/erpnext/translations/nl.csv +++ b/erpnext/translations/nl.csv @@ -1260,7 +1260,7 @@ In Value,in Value, "In the case of multi-tier program, Customers will be auto assigned to the concerned tier as per their spent",In het geval van een meerlagig programma worden klanten automatisch toegewezen aan de betreffende laag op basis van hun bestede tijd, Inactive,Inactief, Incentives,Incentives, -Include Default Book Entries,Standaard boekvermeldingen opnemen, +Include Default FB Entries,Standaard boekvermeldingen opnemen, Include Exploded Items,Exploded Items opnemen, Include POS Transactions,POS-transacties opnemen, Include UOM,Inclusief UOM, diff --git a/erpnext/translations/no.csv b/erpnext/translations/no.csv index 2642a9c70876..bd7735aa6a55 100644 --- a/erpnext/translations/no.csv +++ b/erpnext/translations/no.csv @@ -1260,7 +1260,7 @@ In Value,I verdi, "In the case of multi-tier program, Customers will be auto assigned to the concerned tier as per their spent","Når det gjelder flerlagsprogram, vil kundene automatisk bli tilordnet den aktuelle delen som brukt", Inactive,inaktiv, Incentives,Motivasjon, -Include Default Book Entries,Inkluder standardbokoppføringer, +Include Default FB Entries,Inkluder standardbokoppføringer, Include Exploded Items,Inkluder eksploderte elementer, Include POS Transactions,Inkluder POS-transaksjoner, Include UOM,Inkluder UOM, diff --git a/erpnext/translations/pl.csv b/erpnext/translations/pl.csv index ca820258f439..0507e2e24366 100644 --- a/erpnext/translations/pl.csv +++ b/erpnext/translations/pl.csv @@ -1260,7 +1260,7 @@ In Value,w polu Wartość, "In the case of multi-tier program, Customers will be auto assigned to the concerned tier as per their spent","W przypadku programu wielowarstwowego Klienci zostaną automatycznie przypisani do danego poziomu, zgodnie z wydatkami", Inactive,Nieaktywny, Incentives,, -Include Default Book Entries,Dołącz domyślne wpisy książki, +Include Default FB Entries,Dołącz domyślne wpisy książki, Include Exploded Items,Dołącz rozstrzelone przedmioty, Include POS Transactions,Uwzględnij transakcje POS, Include UOM,Dołącz UOM, diff --git a/erpnext/translations/ps.csv b/erpnext/translations/ps.csv index ed15740e3781..ffb5511fac4e 100644 --- a/erpnext/translations/ps.csv +++ b/erpnext/translations/ps.csv @@ -1260,7 +1260,7 @@ In Value,په ارزښت, "In the case of multi-tier program, Customers will be auto assigned to the concerned tier as per their spent",د څو اړخیز پروګرام په صورت کې، پیرودونکي به د خپل مصرف په اساس اړوند ټیټ ته ګمارل کیږي, Inactive,غیر فعال, Incentives,هڅوونکي, -Include Default Book Entries,د ډیفالټ کتاب ننوتل شامل کړئ, +Include Default FB Entries,د ډیفالټ کتاب ننوتل شامل کړئ, Include Exploded Items,چاودیدونکي توکي شامل کړئ, Include POS Transactions,د POS تعاملات شامل کړئ, Include UOM,UOM شامل کړئ, diff --git a/erpnext/translations/pt-BR.csv b/erpnext/translations/pt-BR.csv index 503a16f7ebea..28ad958955e4 100644 --- a/erpnext/translations/pt-BR.csv +++ b/erpnext/translations/pt-BR.csv @@ -1260,7 +1260,7 @@ In Value,Valor Entrada, "In the case of multi-tier program, Customers will be auto assigned to the concerned tier as per their spent","No caso do programa multicamadas, os Clientes serão atribuídos automaticamente ao nível em questão de acordo com o gasto", Inactive,Inativo, Incentives,Incentivos, -Include Default Book Entries,Incluir Entradas de Livro Padrão, +Include Default FB Entries,Incluir Entradas de Livro Padrão, Include Exploded Items,Incluir Itens Explodidos, Include POS Transactions,Incluir Transações PDV, Include UOM,Incluir UDM, diff --git a/erpnext/translations/pt.csv b/erpnext/translations/pt.csv index 3e83df5f6933..a0d11eecd5ee 100644 --- a/erpnext/translations/pt.csv +++ b/erpnext/translations/pt.csv @@ -1260,7 +1260,7 @@ In Value,No Valor, "In the case of multi-tier program, Customers will be auto assigned to the concerned tier as per their spent","No caso do programa multicamadas, os Clientes serão atribuídos automaticamente ao nível em questão de acordo com o gasto", Inactive,Inativo, Incentives,Incentivos, -Include Default Book Entries,Incluir entradas de livro padrão, +Include Default FB Entries,Incluir entradas de livro padrão, Include Exploded Items,Incluir itens explodidos, Include POS Transactions,Incluir transações POS, Include UOM,Incluir UOM, diff --git a/erpnext/translations/ro.csv b/erpnext/translations/ro.csv index 91c92070758f..01ac73d60deb 100644 --- a/erpnext/translations/ro.csv +++ b/erpnext/translations/ro.csv @@ -1260,7 +1260,7 @@ In Value,În valoare, "In the case of multi-tier program, Customers will be auto assigned to the concerned tier as per their spent","În cazul unui program cu mai multe niveluri, Clienții vor fi automat alocați nivelului respectiv în funcție de cheltuielile efectuate", Inactive,Inactiv, Incentives,stimulente, -Include Default Book Entries,Includeți intrări implicite în cărți, +Include Default FB Entries,Includeți intrări implicite în cărți, Include Exploded Items,Includeți articole explodate, Include POS Transactions,Includeți tranzacțiile POS, Include UOM,Includeți UOM, diff --git a/erpnext/translations/ru.csv b/erpnext/translations/ru.csv index 00641159e064..75c721dcc015 100644 --- a/erpnext/translations/ru.csv +++ b/erpnext/translations/ru.csv @@ -1258,7 +1258,7 @@ In Value,В цене, "In the case of multi-tier program, Customers will be auto assigned to the concerned tier as per their spent",В случае многоуровневой программы Клиенты будут автоматически назначены соответствующему уровню в соответствии с затраченными, Inactive,Неактивный, Incentives,Стимулирование, -Include Default Book Entries,Включить записи в книгу по умолчанию, +Include Default FB Entries,Включить записи в книгу по умолчанию, Include Exploded Items,Включить раздробленные элементы, Include POS Transactions,Включить POS-транзакции, Include UOM,Включить UOM, diff --git a/erpnext/translations/rw.csv b/erpnext/translations/rw.csv index 2d8c07ee58dd..da3915bb2712 100644 --- a/erpnext/translations/rw.csv +++ b/erpnext/translations/rw.csv @@ -1260,7 +1260,7 @@ In Value,Agaciro, "In the case of multi-tier program, Customers will be auto assigned to the concerned tier as per their spent","Kubijyanye na gahunda yo mu byiciro byinshi, Abakiriya bazahabwa imodoka bashinzwe urwego bireba nkuko bakoresheje", Inactive,Kudakora, Incentives,Inkunga, -Include Default Book Entries,Shyiramo Ibisanzwe Byanditswe, +Include Default FB Entries,Shyiramo Ibisanzwe Byanditswe, Include Exploded Items,Shyiramo Ibintu Biturika, Include POS Transactions,Shyiramo ibikorwa bya POS, Include UOM,Shyiramo UOM, diff --git a/erpnext/translations/si.csv b/erpnext/translations/si.csv index 67fa6ae51dde..63d1d539b74a 100644 --- a/erpnext/translations/si.csv +++ b/erpnext/translations/si.csv @@ -1260,7 +1260,7 @@ In Value,අගය දී, "In the case of multi-tier program, Customers will be auto assigned to the concerned tier as per their spent","බහු ස්ථරයේ වැඩසටහනක දී, පාරිභෝගිකයින් විසින් වැය කරනු ලබන පරිදි පාරිභෝගිකයින්ට අදාල ස්ථානයට ස්වයංක්රීයව පවරනු ලැබේ", Inactive,අක්රියයි, Incentives,සහන, -Include Default Book Entries,පෙරනිමි පොත් ඇතුළත් කිරීම් ඇතුළත් කරන්න, +Include Default FB Entries,පෙරනිමි පොත් ඇතුළත් කිරීම් ඇතුළත් කරන්න, Include Exploded Items,පුපුරණ ද්රව්ය අඩංගු කරන්න, Include POS Transactions,POS ගනුදෙනු, Include UOM,UOM ඇතුළත් කරන්න, diff --git a/erpnext/translations/sk.csv b/erpnext/translations/sk.csv index 7bdfdffbaf95..d4ff8ee18458 100644 --- a/erpnext/translations/sk.csv +++ b/erpnext/translations/sk.csv @@ -1260,7 +1260,7 @@ In Value,v Hodnota, "In the case of multi-tier program, Customers will be auto assigned to the concerned tier as per their spent",V prípade viacvrstvového programu budú zákazníci automaticky priradení príslušnému vrstvu podľa ich vynaložených prostriedkov, Inactive,neaktívne, Incentives,Pobídky, -Include Default Book Entries,Zahrnúť predvolené položky knihy, +Include Default FB Entries,Zahrnúť predvolené položky knihy, Include Exploded Items,Zahrňte explodované položky, Include POS Transactions,Zahrňte POS transakcie, Include UOM,Zahrňte UOM, diff --git a/erpnext/translations/sl.csv b/erpnext/translations/sl.csv index 370c3c61ae7a..1c562e312ce7 100644 --- a/erpnext/translations/sl.csv +++ b/erpnext/translations/sl.csv @@ -1260,7 +1260,7 @@ In Value,V vrednosti, "In the case of multi-tier program, Customers will be auto assigned to the concerned tier as per their spent",V primeru večstopenjskega programa bodo stranke samodejno dodeljene zadevni stopnji glede na porabljene, Inactive,Neaktivno, Incentives,Spodbude, -Include Default Book Entries,Vključi privzete vnose v knjige, +Include Default FB Entries,Vključi privzete vnose v knjige, Include Exploded Items,Vključi eksplodirane elemente, Include POS Transactions,Vključite POS transakcije, Include UOM,Vključi UOM, diff --git a/erpnext/translations/sq.csv b/erpnext/translations/sq.csv index f069a059d4e4..fdf34d1fd2bd 100644 --- a/erpnext/translations/sq.csv +++ b/erpnext/translations/sq.csv @@ -1260,7 +1260,7 @@ In Value,Në Vlera, "In the case of multi-tier program, Customers will be auto assigned to the concerned tier as per their spent","Në rastin e programit multi-shtresor, Konsumatorët do të caktohen automatikisht në nivelin përkatës sipas shpenzimeve të tyre", Inactive,joaktiv, Incentives,Nxitjet, -Include Default Book Entries,Përfshini hyrje të librave të paracaktuar, +Include Default FB Entries,Përfshini hyrje të librave të paracaktuar, Include Exploded Items,Përfshirja e artikujve të eksploduar, Include POS Transactions,Përfshi transaksione POS, Include UOM,Përfshi UOM, diff --git a/erpnext/translations/sr.csv b/erpnext/translations/sr.csv index 9558e07797b1..34889f04f34d 100644 --- a/erpnext/translations/sr.csv +++ b/erpnext/translations/sr.csv @@ -1260,7 +1260,7 @@ In Value,У вредности, "In the case of multi-tier program, Customers will be auto assigned to the concerned tier as per their spent","У случају мулти-тиер програма, Корисници ће аутоматски бити додијељени за одређени ниво према њиховом потрошеном", Inactive,Неактиван, Incentives,Подстицаји, -Include Default Book Entries,Укључивање заданих уноса у књиге, +Include Default FB Entries,Укључивање заданих уноса у књиге, Include Exploded Items,Укључите експлодиране ставке, Include POS Transactions,Укључите ПОС трансакције, Include UOM,Укључите УОМ, diff --git a/erpnext/translations/sv.csv b/erpnext/translations/sv.csv index 7d9b70024cd6..28188a5efc4e 100644 --- a/erpnext/translations/sv.csv +++ b/erpnext/translations/sv.csv @@ -1260,7 +1260,7 @@ In Value,Värde, "In the case of multi-tier program, Customers will be auto assigned to the concerned tier as per their spent",När det gäller program med flera nivåer kommer kunderna automatiskt att tilldelas den aktuella tiern enligt deras tillbringade, Inactive,Inaktiv, Incentives,Sporen, -Include Default Book Entries,Inkludera standardbokposter, +Include Default FB Entries,Inkludera standardbokposter, Include Exploded Items,Inkludera explosiva artiklar, Include POS Transactions,Inkludera POS-transaktioner, Include UOM,Inkludera UOM, diff --git a/erpnext/translations/sw.csv b/erpnext/translations/sw.csv index 6a0ef8cc7c1e..261396c1f770 100644 --- a/erpnext/translations/sw.csv +++ b/erpnext/translations/sw.csv @@ -1260,7 +1260,7 @@ In Value,Kwa Thamani, "In the case of multi-tier program, Customers will be auto assigned to the concerned tier as per their spent","Katika kesi ya mpango wa mipango mbalimbali, Wateja watapatiwa auto kwa tier husika kama kwa matumizi yao", Inactive,Haikufanya kazi, Incentives,Vidokezo, -Include Default Book Entries,Jumuisha Ingizo Mbadala za Kitabu, +Include Default FB Entries,Jumuisha Ingizo Mbadala za Kitabu, Include Exploded Items,Jumuisha Vipengee Vipengee, Include POS Transactions,Jumuisha Shughuli za POS, Include UOM,Jumuisha UOM, diff --git a/erpnext/translations/ta.csv b/erpnext/translations/ta.csv index 35cdc92b374b..51008fdb801d 100644 --- a/erpnext/translations/ta.csv +++ b/erpnext/translations/ta.csv @@ -1260,7 +1260,7 @@ In Value,மதிப்பு, "In the case of multi-tier program, Customers will be auto assigned to the concerned tier as per their spent","பல அடுக்கு திட்டத்தின் விஷயத்தில், வாடிக்கையாளர்கள் தங்கள் செலவினங்களின்படி சம்பந்தப்பட்ட அடுக்குக்கு கார் ஒதுக்கப்படுவார்கள்", Inactive,செயல்படா, Incentives,செயல் தூண்டுதல், -Include Default Book Entries,இயல்புநிலை புத்தக உள்ளீடுகளைச் சேர்க்கவும், +Include Default FB Entries,இயல்புநிலை புத்தக உள்ளீடுகளைச் சேர்க்கவும், Include Exploded Items,வெடித்துள்ள பொருட்கள் அடங்கும், Include POS Transactions,POS பரிமாற்றங்களைச் சேர்க்கவும், Include UOM,UOM ஐ சேர்க்கவும், diff --git a/erpnext/translations/te.csv b/erpnext/translations/te.csv index 9b8b2d7d1ae1..c86db9cca14f 100644 --- a/erpnext/translations/te.csv +++ b/erpnext/translations/te.csv @@ -1260,7 +1260,7 @@ In Value,విలువ, "In the case of multi-tier program, Customers will be auto assigned to the concerned tier as per their spent","మల్టీ-టైర్ ప్రోగ్రామ్ విషయంలో, కస్టమర్లు వారి గడువు ప్రకారం, సంబంధిత స్థాయికి కేటాయించబడతారు", Inactive,క్రియారహిత, Incentives,ఇన్సెంటివ్స్, -Include Default Book Entries,డిఫాల్ట్ బుక్ ఎంట్రీలను చేర్చండి, +Include Default FB Entries,డిఫాల్ట్ బుక్ ఎంట్రీలను చేర్చండి, Include Exploded Items,ఎక్స్ప్లోడ్ ఐటెమ్లను చేర్చండి, Include POS Transactions,POS లావాదేవీలను చేర్చండి, Include UOM,UOM ని చేర్చండి, diff --git a/erpnext/translations/th.csv b/erpnext/translations/th.csv index a97be2b8bf06..2285ea47641b 100644 --- a/erpnext/translations/th.csv +++ b/erpnext/translations/th.csv @@ -1260,7 +1260,7 @@ In Value,ในราคา, "In the case of multi-tier program, Customers will be auto assigned to the concerned tier as per their spent",ในกรณีของโปรแกรมแบบหลายชั้นลูกค้าจะได้รับการกำหนดให้โดยอัตโนมัติตามระดับที่เกี่ยวข้องตามการใช้จ่าย, Inactive,เฉื่อยชา, Incentives,แรงจูงใจ, -Include Default Book Entries,รวมรายการหนังสือเริ่มต้น, +Include Default FB Entries,รวมรายการหนังสือเริ่มต้น, Include Exploded Items,รวมรายการที่ระเบิดแล้ว, Include POS Transactions,รวมธุรกรรม POS, Include UOM,รวม UOM, diff --git a/erpnext/translations/tr.csv b/erpnext/translations/tr.csv index 14d842425e31..3fae8bdfc336 100644 --- a/erpnext/translations/tr.csv +++ b/erpnext/translations/tr.csv @@ -1260,7 +1260,7 @@ In Value,Değer, "In the case of multi-tier program, Customers will be auto assigned to the concerned tier as per their spent","Çok katmanlı program söz konusu olduğunda, Müşteriler harcanan esasa göre ilgili kademeye otomatik olarak atanacaktır.", Inactive,etkisiz, Incentives,Teşvikler, -Include Default Book Entries,Varsayılan Kitap Girişlerini Dahil Et, +Include Default FB Entries,Varsayılan Kitap Girişlerini Dahil Et, Include Exploded Items,Patlatılmış Öğeleri Dahil Et, Include POS Transactions,POS İşlemlerini Dahil Et, Include UOM,UOM'yi dahil et, diff --git a/erpnext/translations/uk.csv b/erpnext/translations/uk.csv index d25b242c7d2c..35f166a35f5d 100644 --- a/erpnext/translations/uk.csv +++ b/erpnext/translations/uk.csv @@ -1260,7 +1260,7 @@ In Value,У Сумі, "In the case of multi-tier program, Customers will be auto assigned to the concerned tier as per their spent","У випадку багаторівневої програми, Клієнти будуть автоматично призначені для відповідного рівня відповідно до витрачених ними витрат", Inactive,Неактивний, Incentives,Стимули, -Include Default Book Entries,Включити записи за замовчуванням, +Include Default FB Entries,Включити записи за замовчуванням, Include Exploded Items,Включити вибухнуті елементи, Include POS Transactions,Включити POS-транзакції, Include UOM,Включити UOM, diff --git a/erpnext/translations/ur.csv b/erpnext/translations/ur.csv index eb26f7cee278..2f5f2e1bf094 100644 --- a/erpnext/translations/ur.csv +++ b/erpnext/translations/ur.csv @@ -1260,7 +1260,7 @@ In Value,قدر میں, "In the case of multi-tier program, Customers will be auto assigned to the concerned tier as per their spent",کثیر درجے کے پروگرام کے معاملے میں، صارفین اپنے اخراجات کے مطابق متعلقہ درجے کو خود کار طریقے سے تفویض کریں گے, Inactive,غیر فعال, Incentives,ترغیبات, -Include Default Book Entries,ڈیفالٹ کتاب اندراجات شامل کریں۔, +Include Default FB Entries,ڈیفالٹ کتاب اندراجات شامل کریں۔, Include Exploded Items,دھماکہ خیز اشیاء شامل کریں, Include POS Transactions,پی او ایس کے لین دین میں شامل کریں, Include UOM,UOM شامل کریں, diff --git a/erpnext/translations/uz.csv b/erpnext/translations/uz.csv index 95141bdb993f..dfc34f8ab2ee 100644 --- a/erpnext/translations/uz.csv +++ b/erpnext/translations/uz.csv @@ -1260,7 +1260,7 @@ In Value,Qiymatida, "In the case of multi-tier program, Customers will be auto assigned to the concerned tier as per their spent",Ko'p qatlamli dasturda mijozlar o'zlari sarflagan xarajatlariga muvofiq tegishli darajaga avtomatik tarzda topshiriladi, Inactive,Faol emas, Incentives,Rag'batlantirish, -Include Default Book Entries,Odatiy kitob yozuvlarini qo'shing, +Include Default FB Entries,Odatiy kitob yozuvlarini qo'shing, Include Exploded Items,Portlatilgan narsalarni qo'shish, Include POS Transactions,Qalin operatsiyalarni qo'shish, Include UOM,UOM ni qo'shing, diff --git a/erpnext/translations/vi.csv b/erpnext/translations/vi.csv index de35891698dd..6714e67fe5b0 100644 --- a/erpnext/translations/vi.csv +++ b/erpnext/translations/vi.csv @@ -1260,7 +1260,7 @@ In Value,Trong giá trị, "In the case of multi-tier program, Customers will be auto assigned to the concerned tier as per their spent","Trong trường hợp chương trình nhiều tầng, Khách hàng sẽ được tự động chỉ định cho cấp có liên quan theo mức chi tiêu của họ", Inactive,Không hoạt động, Incentives,Ưu đãi, -Include Default Book Entries,Bao gồm các mục sách mặc định, +Include Default FB Entries,Bao gồm các mục sách mặc định, Include Exploded Items,Bao gồm các mục đã Phát hiện, Include POS Transactions,Bao gồm giao dịch POS, Include UOM,Bao gồm UOM, diff --git a/erpnext/translations/zh.csv b/erpnext/translations/zh.csv index e2e6899ed5e2..3e95226d3e1a 100644 --- a/erpnext/translations/zh.csv +++ b/erpnext/translations/zh.csv @@ -1260,7 +1260,7 @@ In Value,金额, "In the case of multi-tier program, Customers will be auto assigned to the concerned tier as per their spent",在多层程序的情况下,客户将根据其花费自动分配到相关层, Inactive,非活动的, Incentives,激励政策, -Include Default Book Entries,包括默认工作簿条目, +Include Default FB Entries,包括默认工作簿条目, Include Exploded Items,包含爆炸物料, Include POS Transactions,包括POS交易, Include UOM,包括基本计量单位, diff --git a/erpnext/translations/zh_tw.csv b/erpnext/translations/zh_tw.csv index 9fd737bed29f..b6d0adf57b53 100644 --- a/erpnext/translations/zh_tw.csv +++ b/erpnext/translations/zh_tw.csv @@ -1166,7 +1166,7 @@ In Value,在數值, "In the case of multi-tier program, Customers will be auto assigned to the concerned tier as per their spent",在多層程序的情況下,客戶將根據其花費自動分配到相關層, Inactive,待用, Incentives,獎勵, -Include Default Book Entries,包括默認工作簿條目, +Include Default FB Entries,包括默認工作簿條目, Include Exploded Items,包含爆炸物品, Include UOM,包括UOM, Included in Gross Profit,包含在毛利潤中, From 3f7f5bd8f0cb0ffec19ccf2680293cc22bef2247 Mon Sep 17 00:00:00 2001 From: ruthra kumar Date: Thu, 2 Nov 2023 17:19:06 +0530 Subject: [PATCH 07/95] refactor: ignore disabled account while selecting Income Accounts (cherry picked from commit 6e3e094c957d8c2b71ed522e9a8034364345e5a7) --- .../doctype/sales_invoice/sales_invoice.js | 20 +++++++++---------- erpnext/controllers/queries.py | 2 ++ 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/erpnext/accounts/doctype/sales_invoice/sales_invoice.js b/erpnext/accounts/doctype/sales_invoice/sales_invoice.js index a411889fbddb..75b87421dd78 100644 --- a/erpnext/accounts/doctype/sales_invoice/sales_invoice.js +++ b/erpnext/accounts/doctype/sales_invoice/sales_invoice.js @@ -181,7 +181,6 @@ erpnext.accounts.SalesInvoiceController = class SalesInvoiceController extends e erpnext.accounts.unreconcile_payments.add_unreconcile_btn(me.frm); } - make_maintenance_schedule() { frappe.model.open_mapped_doc({ method: "erpnext.accounts.doctype.sales_invoice.sales_invoice.make_maintenance_schedule", @@ -557,15 +556,6 @@ cur_frm.fields_dict.write_off_cost_center.get_query = function(doc) { } } -// Income Account in Details Table -// -------------------------------- -cur_frm.set_query("income_account", "items", function(doc) { - return{ - query: "erpnext.controllers.queries.get_income_account", - filters: {'company': doc.company} - } -}); - // Cost Center in Details Table // ----------------------------- cur_frm.fields_dict["items"].grid.get_field("cost_center").get_query = function(doc) { @@ -660,6 +650,16 @@ frappe.ui.form.on('Sales Invoice', { }; }); + frm.set_query("income_account", "items", function() { + return{ + query: "erpnext.controllers.queries.get_income_account", + filters: { + 'company': frm.doc.company, + "disabled": 0 + } + } + }); + frm.custom_make_buttons = { 'Delivery Note': 'Delivery', 'Sales Invoice': 'Return / Credit Note', diff --git a/erpnext/controllers/queries.py b/erpnext/controllers/queries.py index 36225e3dd5e0..b73ebf53ae81 100644 --- a/erpnext/controllers/queries.py +++ b/erpnext/controllers/queries.py @@ -560,6 +560,8 @@ def get_income_account(doctype, txt, searchfield, start, page_len, filters): if filters.get("company"): condition += "and tabAccount.company = %(company)s" + condition += f"and tabAccount.disabled = {filters.get('disabled', 0)}" + return frappe.db.sql( """select tabAccount.name from `tabAccount` where (tabAccount.report_type = "Profit and Loss" From db29180eec052c865f82c31a08d84303a002279b Mon Sep 17 00:00:00 2001 From: s-aga-r Date: Thu, 9 Nov 2023 12:30:22 +0530 Subject: [PATCH 08/95] fix: pick serial nos from selected batch only (#37988) * fix: pick current serial nos from selected batch only * test: add test case for current qty and current serial nos --- .../stock_reconciliation.py | 1 + .../test_stock_reconciliation.py | 46 +++++++++++++++++++ erpnext/stock/utils.py | 21 ++++++--- 3 files changed, 61 insertions(+), 7 deletions(-) diff --git a/erpnext/stock/doctype/stock_reconciliation/stock_reconciliation.py b/erpnext/stock/doctype/stock_reconciliation/stock_reconciliation.py index d37b2a67e118..118c3a1d0292 100644 --- a/erpnext/stock/doctype/stock_reconciliation/stock_reconciliation.py +++ b/erpnext/stock/doctype/stock_reconciliation/stock_reconciliation.py @@ -890,6 +890,7 @@ def get_stock_balance_for( with_valuation_rate=with_valuation_rate, with_serial_no=has_serial_no, inventory_dimensions_dict=inventory_dimensions_dict, + batch_no=batch_no, ) if has_serial_no: diff --git a/erpnext/stock/doctype/stock_reconciliation/test_stock_reconciliation.py b/erpnext/stock/doctype/stock_reconciliation/test_stock_reconciliation.py index dd1220a0ddb6..05c60175f512 100644 --- a/erpnext/stock/doctype/stock_reconciliation/test_stock_reconciliation.py +++ b/erpnext/stock/doctype/stock_reconciliation/test_stock_reconciliation.py @@ -1009,6 +1009,52 @@ def test_backdated_stock_reco_for_batch_item_dont_have_future_sle(self): self.assertEqual(sr2.docstatus, 1) + def test_current_qty_and_current_serial_no_count(self): + # Step - 1: Create a Serial Batch Item + item = self.make_item( + properties={ + "is_stock_item": 1, + "has_serial_no": 1, + "serial_no_series": "TEST-SERIAL-.###", + "has_batch_no": 1, + "create_new_batch": 1, + "batch_number_series": "TEST-BATCH-.###", + } + ).name + + # Step - 2: Inward stock in multiple Batches + from erpnext.stock.doctype.stock_entry.test_stock_entry import make_stock_entry + + se1 = make_stock_entry( + item_code=item, + target="_Test Warehouse - _TC", + qty=10, + ) + se2 = make_stock_entry( + item_code=item, + target="_Test Warehouse - _TC", + qty=5, + ) + + # Step - 3: Create Stock Reconciliation + sr = create_stock_reconciliation( + item_code=item, + warehouse="_Test Warehouse - _TC", + qty=0, + batch_no=se1.items[0].batch_no, + do_not_submit=True, + ) + + # Test - 1: Current Serial No Count should be equal to Current Qty + self.assertEqual(sr.items[0].current_qty, se1.items[0].qty) + self.assertEqual(len(sr.items[0].current_serial_no.split("\n")), sr.items[0].current_qty) + + sr.items[0].batch_no = se2.items[0].batch_no + sr.save() + + self.assertEqual(sr.items[0].current_qty, se2.items[0].qty) + self.assertEqual(len(sr.items[0].current_serial_no.split("\n")), sr.items[0].current_qty) + def create_batch_item_with_batch(item_name, batch_id): batch_item_doc = create_item(item_name, is_stock_item=1) diff --git a/erpnext/stock/utils.py b/erpnext/stock/utils.py index 9f654fc6632b..e019c572daff 100644 --- a/erpnext/stock/utils.py +++ b/erpnext/stock/utils.py @@ -95,6 +95,7 @@ def get_stock_balance( with_valuation_rate=False, with_serial_no=False, inventory_dimensions_dict=None, + batch_no=None, ): """Returns stock balance quantity at given warehouse on given posting date or current date. @@ -124,6 +125,9 @@ def get_stock_balance( if with_valuation_rate: if with_serial_no: + if batch_no: + args["batch_no"] = batch_no + serial_nos = get_serial_nos_data_after_transactions(args) return ( @@ -140,27 +144,30 @@ def get_stock_balance( def get_serial_nos_data_after_transactions(args): - serial_nos = set() args = frappe._dict(args) - sle = frappe.qb.DocType("Stock Ledger Entry") - stock_ledger_entries = ( + sle = frappe.qb.DocType("Stock Ledger Entry") + query = ( frappe.qb.from_(sle) - .select("serial_no", "actual_qty") + .select(sle.serial_no, sle.actual_qty) .where( - (sle.item_code == args.item_code) + (sle.is_cancelled == 0) + & (sle.item_code == args.item_code) & (sle.warehouse == args.warehouse) & ( CombineDatetime(sle.posting_date, sle.posting_time) < CombineDatetime(args.posting_date, args.posting_time) ) - & (sle.is_cancelled == 0) ) .orderby(sle.posting_date, sle.posting_time, sle.creation) - .run(as_dict=1) ) + if args.batch_no: + query = query.where(sle.batch_no == args.batch_no) + + stock_ledger_entries = query.run(as_dict=True) + for stock_ledger_entry in stock_ledger_entries: changed_serial_no = get_serial_nos_data(stock_ledger_entry.serial_no) if stock_ledger_entry.actual_qty > 0: From 935286ff94a6779c16e0a9ee5fcbe1a9a5c7f985 Mon Sep 17 00:00:00 2001 From: vishal Date: Fri, 27 Oct 2023 11:12:55 +0530 Subject: [PATCH 09/95] feat: multi-select customer group in AR Report (cherry picked from commit 8903c1bc6f24c4e0187f05739887ac6f4af6a7b6) --- .../accounts_receivable.js | 9 ++++++--- .../accounts_receivable.py | 19 ++++++++++++++++++- 2 files changed, 24 insertions(+), 4 deletions(-) diff --git a/erpnext/accounts/report/accounts_receivable/accounts_receivable.js b/erpnext/accounts/report/accounts_receivable/accounts_receivable.js index 786aad601ba7..ba21d8a3eb01 100644 --- a/erpnext/accounts/report/accounts_receivable/accounts_receivable.js +++ b/erpnext/accounts/report/accounts_receivable/accounts_receivable.js @@ -114,10 +114,13 @@ frappe.query_reports["Accounts Receivable"] = { "reqd": 1 }, { - "fieldname": "customer_group", + "fieldname":"customer_group", "label": __("Customer Group"), - "fieldtype": "Link", - "options": "Customer Group" + "fieldtype": "MultiSelectList", + "options": "Customer Group", + get_data: function(txt) { + return frappe.db.get_link_options('Customer Group', txt); + } }, { "fieldname": "payment_terms_template", diff --git a/erpnext/accounts/report/accounts_receivable/accounts_receivable.py b/erpnext/accounts/report/accounts_receivable/accounts_receivable.py index 12e40037f1ed..a9b2fb2a4761 100755 --- a/erpnext/accounts/report/accounts_receivable/accounts_receivable.py +++ b/erpnext/accounts/report/accounts_receivable/accounts_receivable.py @@ -840,7 +840,9 @@ def add_customer_filters( self.customer = qb.DocType("Customer") if self.filters.get("customer_group"): - self.get_hierarchical_filters("Customer Group", "customer_group") + groups = get_customer_group_with_children(self.filters.customer_group) + customers = qb.from_(self.customer).select(self.customer.name).where(self.customer['customer_group'].isin(groups)) + self.qb_selection_filter.append(self.ple.party.isin(customers)) if self.filters.get("territory"): self.get_hierarchical_filters("Territory", "territory") @@ -1132,3 +1134,18 @@ def get_exchange_rate_revaluations(self): .run() ) self.err_journals = [x[0] for x in results] if results else [] + +def get_customer_group_with_children(customer_groups): + if not isinstance(customer_groups, list): + customer_groups = [d.strip() for d in customer_groups.strip().split(",") if d] + + all_customer_groups = [] + for d in customer_groups: + if frappe.db.exists("Customer Group", d): + lft, rgt = frappe.db.get_value("Customer Group", d, ["lft", "rgt"]) + children = frappe.get_all("Customer Group", filters={"lft": [">=", lft], "rgt": ["<=", rgt]}) + all_customer_groups += [c.name for c in children] + else: + frappe.throw(_("Customer Group: {0} does not exist").format(d)) + + return list(set(all_customer_groups)) From 0eab723243d0a79ae511896313621add0741a97b Mon Sep 17 00:00:00 2001 From: vishal Date: Fri, 27 Oct 2023 11:22:55 +0530 Subject: [PATCH 10/95] fix: minor issue (cherry picked from commit b60c57a97dee1ab1a2b1654d4cc2d146e0141ff2) --- .../report/accounts_receivable/accounts_receivable.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/erpnext/accounts/report/accounts_receivable/accounts_receivable.py b/erpnext/accounts/report/accounts_receivable/accounts_receivable.py index a9b2fb2a4761..da956aa38449 100755 --- a/erpnext/accounts/report/accounts_receivable/accounts_receivable.py +++ b/erpnext/accounts/report/accounts_receivable/accounts_receivable.py @@ -841,7 +841,11 @@ def add_customer_filters( if self.filters.get("customer_group"): groups = get_customer_group_with_children(self.filters.customer_group) - customers = qb.from_(self.customer).select(self.customer.name).where(self.customer['customer_group'].isin(groups)) + customers = ( + qb.from_(self.customer) + .select(self.customer.name) + .where(self.customer["customer_group"].isin(groups)) + ) self.qb_selection_filter.append(self.ple.party.isin(customers)) if self.filters.get("territory"): @@ -1135,6 +1139,7 @@ def get_exchange_rate_revaluations(self): ) self.err_journals = [x[0] for x in results] if results else [] + def get_customer_group_with_children(customer_groups): if not isinstance(customer_groups, list): customer_groups = [d.strip() for d in customer_groups.strip().split(",") if d] From cf0d936195401d4098592a4db5c41ac54e7a55ce Mon Sep 17 00:00:00 2001 From: vishal Date: Mon, 6 Nov 2023 12:21:47 +0530 Subject: [PATCH 11/95] feat(accounts_receivable): test_case added for multi-select customer group (cherry picked from commit de445b32f5a13d115ce3f49c190f23b1efdf6632) --- .../test_accounts_receivable.py | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/erpnext/accounts/report/accounts_receivable/test_accounts_receivable.py b/erpnext/accounts/report/accounts_receivable/test_accounts_receivable.py index cbeb6d3106d4..3582fe0c4a97 100644 --- a/erpnext/accounts/report/accounts_receivable/test_accounts_receivable.py +++ b/erpnext/accounts/report/accounts_receivable/test_accounts_receivable.py @@ -475,6 +475,30 @@ def test_customer_group_filter(self): report = execute(filters)[1] self.assertEqual(len(report), 0) + def test_multi_customer_group_filter(self): + si = self.create_sales_invoice() + cus_group = frappe.db.get_value("Customer", self.customer, "customer_group") + # Create a list of customer groups, e.g., ["Group1", "Group2"] + cus_groups_list = [cus_group, "Group2"] + + filters = { + "company": self.company, + "report_date": today(), + "range1": 30, + "range2": 60, + "range3": 90, + "range4": 120, + "customer_group": cus_groups_list, # Use the list of customer groups + } + report = execute(filters)[1] + + # Assert that the report contains data for the specified customer groups + self.assertTrue(len(report) > 0) + + for row in report: + # Assert that the customer group of each row is in the list of customer groups + self.assertIn(row.customer_group, cus_groups_list) + def test_party_account_filter(self): si1 = self.create_sales_invoice() self.customer2 = ( From 6b3456812869c5f288914fdf9bbfd7ab9dcfb5f1 Mon Sep 17 00:00:00 2001 From: vishal Date: Mon, 6 Nov 2023 13:02:04 +0530 Subject: [PATCH 12/95] fix: minor change added to test_case (cherry picked from commit 30402033bc06296a32ffaf98fd28f18974be2248) --- .../report/accounts_receivable/test_accounts_receivable.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/accounts/report/accounts_receivable/test_accounts_receivable.py b/erpnext/accounts/report/accounts_receivable/test_accounts_receivable.py index 3582fe0c4a97..f83285a1a72d 100644 --- a/erpnext/accounts/report/accounts_receivable/test_accounts_receivable.py +++ b/erpnext/accounts/report/accounts_receivable/test_accounts_receivable.py @@ -479,7 +479,7 @@ def test_multi_customer_group_filter(self): si = self.create_sales_invoice() cus_group = frappe.db.get_value("Customer", self.customer, "customer_group") # Create a list of customer groups, e.g., ["Group1", "Group2"] - cus_groups_list = [cus_group, "Group2"] + cus_groups_list = [cus_group, "_Test Customer Group 1"] filters = { "company": self.company, From 984703c3c9e0201cd17d444da6f549884943d960 Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Thu, 9 Nov 2023 13:40:14 +0530 Subject: [PATCH 13/95] fix: make adjustment entry using stock reconciliation (backport #37995) (#38008) * fix: make adjustment entry using stock reconciliation (#37995) fix: do adjustment entry using stock reconciliation (cherry picked from commit a8216b9727401bfb6900f15447ab935756d7f353) # Conflicts: # erpnext/stock/doctype/stock_ledger_entry/stock_ledger_entry.json # erpnext/stock/doctype/stock_reconciliation/stock_reconciliation.py * chore: fix conflicts * fix: conflicts * chore: fix conflicts --------- Co-authored-by: rohitwaghchaure --- .../stock_ledger_entry.json | 11 +++++-- .../stock_reconciliation.py | 19 ++++++++++++ erpnext/stock/stock_ledger.py | 30 +++++++++++++++++-- 3 files changed, 56 insertions(+), 4 deletions(-) diff --git a/erpnext/stock/doctype/stock_ledger_entry/stock_ledger_entry.json b/erpnext/stock/doctype/stock_ledger_entry/stock_ledger_entry.json index 46ce9debf3b3..b07c0876a25b 100644 --- a/erpnext/stock/doctype/stock_ledger_entry/stock_ledger_entry.json +++ b/erpnext/stock/doctype/stock_ledger_entry/stock_ledger_entry.json @@ -11,6 +11,7 @@ "warehouse", "posting_date", "posting_time", + "is_adjustment_entry", "column_break_6", "voucher_type", "voucher_no", @@ -309,6 +310,12 @@ "label": "Recalculate Incoming/Outgoing Rate", "no_copy": 1, "read_only": 1 + }, + { + "default": "0", + "fieldname": "is_adjustment_entry", + "fieldtype": "Check", + "label": "Is Adjustment Entry" } ], "hide_toolbar": 1, @@ -317,7 +324,7 @@ "in_create": 1, "index_web_pages_for_search": 1, "links": [], - "modified": "2021-12-21 06:25:30.040801", + "modified": "2023-10-23 18:07:42.063615", "modified_by": "Administrator", "module": "Stock", "name": "Stock Ledger Entry", @@ -341,4 +348,4 @@ "sort_field": "modified", "sort_order": "DESC", "states": [] -} \ No newline at end of file +} diff --git a/erpnext/stock/doctype/stock_reconciliation/stock_reconciliation.py b/erpnext/stock/doctype/stock_reconciliation/stock_reconciliation.py index 118c3a1d0292..dd39f103cd71 100644 --- a/erpnext/stock/doctype/stock_reconciliation/stock_reconciliation.py +++ b/erpnext/stock/doctype/stock_reconciliation/stock_reconciliation.py @@ -269,6 +269,10 @@ def update_stock_ledger(self): if item.has_batch_no: has_batch_no = True + if not row.qty and not row.valuation_rate and not row.current_qty: + self.make_adjustment_entry(row, sl_entries) + continue + if item.has_serial_no or item.has_batch_no: has_serial_no = True self.get_sle_for_serialized_items(row, sl_entries, item) @@ -402,6 +406,21 @@ def get_sle_for_serialized_items(self, row, sl_entries, item): # update valuation rate self.update_valuation_rate_for_serial_nos(row, serial_nos) + def make_adjustment_entry(self, row, sl_entries): + from erpnext.stock.stock_ledger import get_stock_value_difference + + difference_amount = get_stock_value_difference( + row.item_code, row.warehouse, self.posting_date, self.posting_time + ) + + if not difference_amount: + return + + args = self.get_sle_for_items(row) + args.update({"stock_value_difference": -1 * difference_amount, "is_adjustment_entry": 1}) + + sl_entries.append(args) + def update_valuation_rate_for_serial_no(self): for d in self.items: if not d.serial_no: diff --git a/erpnext/stock/stock_ledger.py b/erpnext/stock/stock_ledger.py index bdae87c7ee7e..8a2624979261 100644 --- a/erpnext/stock/stock_ledger.py +++ b/erpnext/stock/stock_ledger.py @@ -635,9 +635,11 @@ def process_sle(self, sle): sle.valuation_rate = self.wh_data.valuation_rate sle.stock_value = self.wh_data.stock_value sle.stock_queue = json.dumps(self.wh_data.stock_queue) - sle.stock_value_difference = stock_value_difference - sle.doctype = "Stock Ledger Entry" + if not sle.is_adjustment_entry or not self.args.get("sle_id"): + sle.stock_value_difference = stock_value_difference + + sle.doctype = "Stock Ledger Entry" frappe.get_doc(sle).db_update() if not self.args.get("sle_id"): @@ -1711,3 +1713,27 @@ def is_internal_transfer(sle): if data.is_internal_supplier and data.represents_company == data.company: return True + + +def get_stock_value_difference(item_code, warehouse, posting_date, posting_time, voucher_no=None): + table = frappe.qb.DocType("Stock Ledger Entry") + + query = ( + frappe.qb.from_(table) + .select(Sum(table.stock_value_difference).as_("value")) + .where( + (table.is_cancelled == 0) + & (table.item_code == item_code) + & (table.warehouse == warehouse) + & ( + (table.posting_date < posting_date) + | ((table.posting_date == posting_date) & (table.posting_time <= posting_time)) + ) + ) + ) + + if voucher_no: + query = query.where(table.voucher_no != voucher_no) + + difference_amount = query.run() + return flt(difference_amount[0][0]) if difference_amount else 0 From 620f4f2c109f3b073e578247331ab50280a24100 Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Thu, 9 Nov 2023 21:52:43 +0530 Subject: [PATCH 14/95] fix: sales order not assigned to territory orders (#37905) (#38024) fix: sales order not assigned to territory orders (#37905) filtered sales order are not assigned to 'territory_orders' which results in 0 order amount and 0 billing amount in the output (cherry picked from commit 45b4bfc94783bb0180c0a57a2f3a5bb7086008a3) Co-authored-by: jabir-elat <44110258+jabir-elat@users.noreply.github.com> --- .../selling/report/territory_wise_sales/territory_wise_sales.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/selling/report/territory_wise_sales/territory_wise_sales.py b/erpnext/selling/report/territory_wise_sales/territory_wise_sales.py index 5dfc1db09762..ecb63d890a75 100644 --- a/erpnext/selling/report/territory_wise_sales/territory_wise_sales.py +++ b/erpnext/selling/report/territory_wise_sales/territory_wise_sales.py @@ -80,7 +80,7 @@ def get_data(filters=None): territory_orders = [] if t_quotation_names and sales_orders: - list(filter(lambda x: x.quotation in t_quotation_names, sales_orders)) + territory_orders = list(filter(lambda x: x.quotation in t_quotation_names, sales_orders)) t_order_names = [] if territory_orders: t_order_names = [t.name for t in territory_orders] From 9c0d80cef4fdeb673bc05acdd3e4f3855ab761b2 Mon Sep 17 00:00:00 2001 From: ruthra kumar Date: Fri, 10 Nov 2023 09:49:55 +0530 Subject: [PATCH 15/95] fix: new logic for handling revaluation journals (cherry picked from commit 1d8fcd66e6ca6d17a274a8b18699b40a7ac93e1a) --- .../accounts_receivable/accounts_receivable.js | 6 ++++++ .../accounts_receivable/accounts_receivable.py | 17 +++++++++++++---- 2 files changed, 19 insertions(+), 4 deletions(-) diff --git a/erpnext/accounts/report/accounts_receivable/accounts_receivable.js b/erpnext/accounts/report/accounts_receivable/accounts_receivable.js index ba21d8a3eb01..d6e3098e1715 100644 --- a/erpnext/accounts/report/accounts_receivable/accounts_receivable.js +++ b/erpnext/accounts/report/accounts_receivable/accounts_receivable.js @@ -176,12 +176,18 @@ frappe.query_reports["Accounts Receivable"] = { "label": __("Show Remarks"), "fieldtype": "Check", }, + { + "fieldname": "for_revaluation_journals", + "label": __("Revaluation Journals"), + "fieldtype": "Check", + }, { "fieldname": "ignore_accounts", "label": __("Group by Voucher"), "fieldtype": "Check", } + ], "formatter": function(value, row, column, data, default_formatter) { diff --git a/erpnext/accounts/report/accounts_receivable/accounts_receivable.py b/erpnext/accounts/report/accounts_receivable/accounts_receivable.py index da956aa38449..c077d829939d 100755 --- a/erpnext/accounts/report/accounts_receivable/accounts_receivable.py +++ b/erpnext/accounts/report/accounts_receivable/accounts_receivable.py @@ -281,11 +281,20 @@ def build_data(self): row.invoice_grand_total = row.invoiced - if (abs(row.outstanding) > 1.0 / 10**self.currency_precision) and ( - (abs(row.outstanding_in_account_currency) > 1.0 / 10**self.currency_precision) - or (row.voucher_no in self.err_journals) - ): + must_consider = False + if self.filters.get("for_revaluation_journals"): + if (abs(row.outstanding) > 1.0 / 10**self.currency_precision) or ( + (abs(row.outstanding_in_account_currency) > 1.0 / 10**self.currency_precision) + ): + must_consider = True + else: + if (abs(row.outstanding) > 1.0 / 10**self.currency_precision) and ( + (abs(row.outstanding_in_account_currency) > 1.0 / 10**self.currency_precision) + or (row.voucher_no in self.err_journals) + ): + must_consider = True + if must_consider: # non-zero oustanding, we must consider this row if self.is_invoice(row) and self.filters.based_on_payment_terms: From 424ebd154a2c9a5dbe4d096871c7e9b2e87af529 Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Sat, 11 Nov 2023 10:51:36 +0530 Subject: [PATCH 16/95] fix: make item field read-only in batch (backport #38010) (#38033) * fix: make item field read-only in batch (cherry picked from commit 779260fb497d6ac8000a89b7b762145c58e84471) # Conflicts: # erpnext/stock/doctype/batch/batch.json * chore: `conflicts` --------- Co-authored-by: s-aga-r --- erpnext/stock/doctype/batch/batch.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/erpnext/stock/doctype/batch/batch.json b/erpnext/stock/doctype/batch/batch.json index 967c5729bf49..4bc14a976d69 100644 --- a/erpnext/stock/doctype/batch/batch.json +++ b/erpnext/stock/doctype/batch/batch.json @@ -61,6 +61,7 @@ "oldfieldname": "item", "oldfieldtype": "Link", "options": "Item", + "read_only_depends_on": "eval:!doc.__islocal", "reqd": 1 }, { @@ -207,7 +208,7 @@ "image_field": "image", "links": [], "max_attachments": 5, - "modified": "2022-02-21 08:08:23.999236", + "modified": "2023-11-09 12:17:28.339975", "modified_by": "Administrator", "module": "Stock", "name": "Batch", From 57ce73d5400f9ef5f9e51b061a2a7e73a9e384b2 Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Sun, 12 Nov 2023 17:40:56 +0530 Subject: [PATCH 17/95] fix: COA Importer app related issues (#37238) fix: COA Importer app related issues (#37238) * fix: COA Importer app related issues * fix: Clear all account links fields befor import * fix: Attribute error (cherry picked from commit 8634abc0210fdb259c8b0e7ffc93976ea0099057) Co-authored-by: Deepesh Garg --- .../chart_of_accounts_importer.js | 15 ++++-- .../chart_of_accounts_importer.py | 52 ++++++------------- .../coa_sample_template.csv | 17 ++++++ 3 files changed, 44 insertions(+), 40 deletions(-) create mode 100644 erpnext/accounts/doctype/chart_of_accounts_importer/coa_sample_template.csv diff --git a/erpnext/accounts/doctype/chart_of_accounts_importer/chart_of_accounts_importer.js b/erpnext/accounts/doctype/chart_of_accounts_importer/chart_of_accounts_importer.js index d61f8a6c01c6..56fa6ce2f307 100644 --- a/erpnext/accounts/doctype/chart_of_accounts_importer/chart_of_accounts_importer.js +++ b/erpnext/accounts/doctype/chart_of_accounts_importer/chart_of_accounts_importer.js @@ -53,10 +53,18 @@ frappe.ui.form.on('Chart of Accounts Importer', { of Accounts. Please enter the account names and add more rows as per your requirement.`); } } - } + }, + { + label : "Company", + fieldname: "company", + fieldtype: "Link", + reqd: 1, + hidden: 1, + default: frm.doc.company, + }, ], primary_action: function() { - var data = d.get_values(); + let data = d.get_values(); if (!data.template_type) { frappe.throw(__('Please select Template Type to download template')); @@ -66,7 +74,8 @@ frappe.ui.form.on('Chart of Accounts Importer', { '/api/method/erpnext.accounts.doctype.chart_of_accounts_importer.chart_of_accounts_importer.download_template', { file_type: data.file_type, - template_type: data.template_type + template_type: data.template_type, + company: data.company } ); diff --git a/erpnext/accounts/doctype/chart_of_accounts_importer/chart_of_accounts_importer.py b/erpnext/accounts/doctype/chart_of_accounts_importer/chart_of_accounts_importer.py index e78f5f46dbc1..8c2e0f87f82e 100644 --- a/erpnext/accounts/doctype/chart_of_accounts_importer/chart_of_accounts_importer.py +++ b/erpnext/accounts/doctype/chart_of_accounts_importer/chart_of_accounts_importer.py @@ -8,6 +8,7 @@ import frappe from frappe import _ +from frappe.desk.form.linked_with import get_linked_fields from frappe.model.document import Document from frappe.utils import cint, cstr from frappe.utils.csvutils import UnicodeWriter @@ -294,10 +295,8 @@ def build_response_as_excel(writer): @frappe.whitelist() -def download_template(file_type, template_type): - data = frappe._dict(frappe.local.form_dict) - - writer = get_template(template_type) +def download_template(file_type, template_type, company): + writer = get_template(template_type, company) if file_type == "CSV": # download csv file @@ -308,8 +307,7 @@ def download_template(file_type, template_type): build_response_as_excel(writer) -def get_template(template_type): - +def get_template(template_type, company): fields = [ "Account Name", "Parent Account", @@ -335,34 +333,17 @@ def get_template(template_type): ["", "", "", "", 0, account_type.get("account_type"), account_type.get("root_type")] ) else: - writer = get_sample_template(writer) + writer = get_sample_template(writer, company) return writer -def get_sample_template(writer): - template = [ - ["Application Of Funds(Assets)", "", "", "", 1, "", "Asset"], - ["Sources Of Funds(Liabilities)", "", "", "", 1, "", "Liability"], - ["Equity", "", "", "", 1, "", "Equity"], - ["Expenses", "", "", "", 1, "", "Expense"], - ["Income", "", "", "", 1, "", "Income"], - ["Bank Accounts", "Application Of Funds(Assets)", "", "", 1, "Bank", "Asset"], - ["Cash In Hand", "Application Of Funds(Assets)", "", "", 1, "Cash", "Asset"], - ["Stock Assets", "Application Of Funds(Assets)", "", "", 1, "Stock", "Asset"], - ["Cost Of Goods Sold", "Expenses", "", "", 0, "Cost of Goods Sold", "Expense"], - ["Asset Depreciation", "Expenses", "", "", 0, "Depreciation", "Expense"], - ["Fixed Assets", "Application Of Funds(Assets)", "", "", 0, "Fixed Asset", "Asset"], - ["Accounts Payable", "Sources Of Funds(Liabilities)", "", "", 0, "Payable", "Liability"], - ["Accounts Receivable", "Application Of Funds(Assets)", "", "", 1, "Receivable", "Asset"], - ["Stock Expenses", "Expenses", "", "", 0, "Stock Adjustment", "Expense"], - ["Sample Bank", "Bank Accounts", "", "", 0, "Bank", "Asset"], - ["Cash", "Cash In Hand", "", "", 0, "Cash", "Asset"], - ["Stores", "Stock Assets", "", "", 0, "Stock", "Asset"], - ] - - for row in template: - writer.writerow(row) +def get_sample_template(writer, company): + currency = frappe.db.get_value("Company", company, "default_currency") + with open(os.path.join(os.path.dirname(__file__), "coa_sample_template.csv"), "r") as f: + for row in f: + row = row.strip().split(",") + [currency] + writer.writerow(row) return writer @@ -453,14 +434,11 @@ def get_mandatory_account_types(): def unset_existing_data(company): - linked = frappe.db.sql( - '''select fieldname from tabDocField - where fieldtype="Link" and options="Account" and parent="Company"''', - as_dict=True, - ) - # remove accounts data from company - update_values = {d.fieldname: "" for d in linked} + + fieldnames = get_linked_fields("Account").get("Company", {}).get("fieldname", []) + linked = [{"fieldname": name} for name in fieldnames] + update_values = {d.get("fieldname"): "" for d in linked} frappe.db.set_value("Company", company, update_values, update_values) # remove accounts data from various doctypes diff --git a/erpnext/accounts/doctype/chart_of_accounts_importer/coa_sample_template.csv b/erpnext/accounts/doctype/chart_of_accounts_importer/coa_sample_template.csv new file mode 100644 index 000000000000..85a2f2112f1e --- /dev/null +++ b/erpnext/accounts/doctype/chart_of_accounts_importer/coa_sample_template.csv @@ -0,0 +1,17 @@ +Application Of Funds(Assets),,,,1,,Asset +Sources Of Funds(Liabilities),,,,1,,Liability +Equity,,,,1,,Equity +Expenses,,,,1,Expense Account,Expense +Income,,,,1,Income Account,Income +Bank Accounts,Application Of Funds(Assets),,,1,Bank,Asset +Cash In Hand,Application Of Funds(Assets),,,1,Cash,Asset +Stock Assets,Application Of Funds(Assets),,,1,Stock,Asset +Cost Of Goods Sold,Expenses,,,0,Cost of Goods Sold,Expense +Asset Depreciation,Expenses,,,0,Depreciation,Expense +Fixed Assets,Application Of Funds(Assets),,,0,Fixed Asset,Asset +Accounts Payable,Sources Of Funds(Liabilities),,,0,Payable,Liability +Accounts Receivable,Application Of Funds(Assets),,,1,Receivable,Asset +Stock Expenses,Expenses,,,0,Stock Adjustment,Expense +Sample Bank,Bank Accounts,,,0,Bank,Asset +Cash,Cash In Hand,,,0,Cash,Asset +Stores,Stock Assets,,,0,Stock,Asset \ No newline at end of file From 6979c3e490beecdd890eddd33b4e2acb9ba66af7 Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Sun, 12 Nov 2023 18:07:31 +0530 Subject: [PATCH 18/95] fix: close `Credit Limit Crossed` dialog (backport #38052) (#38058) fix: close `Credit Limit Crossed` dialog (#38052) (cherry picked from commit 94faa44697144157940a874090fd1bd02c1eb981) Co-authored-by: Arjun --- erpnext/selling/doctype/customer/customer.py | 1 + 1 file changed, 1 insertion(+) diff --git a/erpnext/selling/doctype/customer/customer.py b/erpnext/selling/doctype/customer/customer.py index 18fd8ff8ef71..20d6268d739f 100644 --- a/erpnext/selling/doctype/customer/customer.py +++ b/erpnext/selling/doctype/customer/customer.py @@ -541,6 +541,7 @@ def check_credit_limit(customer, company, ignore_outstanding_sales_order=False, primary_action={ "label": "Send Email", "server_action": "erpnext.selling.doctype.customer.customer.send_emails", + "hide_on_success": True, "args": { "customer": customer, "customer_outstanding": customer_outstanding, From a104a4bca60c5fc3999c8581228f61e10fe877be Mon Sep 17 00:00:00 2001 From: ruthra kumar Date: Mon, 13 Nov 2023 11:56:43 +0530 Subject: [PATCH 19/95] refactor: add revaluation journal checkbox in AR/AP summary reports (cherry picked from commit 95edd82638c5cb5aabefd871966d558f51095f94) --- .../accounts_payable_summary/accounts_payable_summary.js | 5 +++++ .../accounts_receivable_summary.js | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/erpnext/accounts/report/accounts_payable_summary/accounts_payable_summary.js b/erpnext/accounts/report/accounts_payable_summary/accounts_payable_summary.js index 9e575e669d22..0f206b1cf421 100644 --- a/erpnext/accounts/report/accounts_payable_summary/accounts_payable_summary.js +++ b/erpnext/accounts/report/accounts_payable_summary/accounts_payable_summary.js @@ -110,6 +110,11 @@ frappe.query_reports["Accounts Payable Summary"] = { "fieldname":"based_on_payment_terms", "label": __("Based On Payment Terms"), "fieldtype": "Check", + }, + { + "fieldname": "for_revaluation_journals", + "label": __("Revaluation Journals"), + "fieldtype": "Check", } ], diff --git a/erpnext/accounts/report/accounts_receivable_summary/accounts_receivable_summary.js b/erpnext/accounts/report/accounts_receivable_summary/accounts_receivable_summary.js index 5ad10c7890a0..2f6d2582b338 100644 --- a/erpnext/accounts/report/accounts_receivable_summary/accounts_receivable_summary.js +++ b/erpnext/accounts/report/accounts_receivable_summary/accounts_receivable_summary.js @@ -139,6 +139,11 @@ frappe.query_reports["Accounts Receivable Summary"] = { "label": __("Show GL Balance"), "fieldtype": "Check", }, + { + "fieldname": "for_revaluation_journals", + "label": __("Revaluation Journals"), + "fieldtype": "Check", + } ], onload: function(report) { From 7ab18fc43447d1bb64c33b1c5883976d8f20998d Mon Sep 17 00:00:00 2001 From: ruthra kumar Date: Mon, 13 Nov 2023 11:56:43 +0530 Subject: [PATCH 20/95] refactor: add revaluation journal checkbox in AR/AP summary reports (cherry picked from commit 95edd82638c5cb5aabefd871966d558f51095f94) --- .../accounts_payable_summary/accounts_payable_summary.js | 5 +++++ .../accounts_receivable_summary.js | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/erpnext/accounts/report/accounts_payable_summary/accounts_payable_summary.js b/erpnext/accounts/report/accounts_payable_summary/accounts_payable_summary.js index 9e575e669d22..0f206b1cf421 100644 --- a/erpnext/accounts/report/accounts_payable_summary/accounts_payable_summary.js +++ b/erpnext/accounts/report/accounts_payable_summary/accounts_payable_summary.js @@ -110,6 +110,11 @@ frappe.query_reports["Accounts Payable Summary"] = { "fieldname":"based_on_payment_terms", "label": __("Based On Payment Terms"), "fieldtype": "Check", + }, + { + "fieldname": "for_revaluation_journals", + "label": __("Revaluation Journals"), + "fieldtype": "Check", } ], diff --git a/erpnext/accounts/report/accounts_receivable_summary/accounts_receivable_summary.js b/erpnext/accounts/report/accounts_receivable_summary/accounts_receivable_summary.js index 5ad10c7890a0..2f6d2582b338 100644 --- a/erpnext/accounts/report/accounts_receivable_summary/accounts_receivable_summary.js +++ b/erpnext/accounts/report/accounts_receivable_summary/accounts_receivable_summary.js @@ -139,6 +139,11 @@ frappe.query_reports["Accounts Receivable Summary"] = { "label": __("Show GL Balance"), "fieldtype": "Check", }, + { + "fieldname": "for_revaluation_journals", + "label": __("Revaluation Journals"), + "fieldtype": "Check", + } ], onload: function(report) { From c5528844fd30e229e6b4064bd93075b1b8fa0a90 Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Mon, 13 Nov 2023 14:03:45 +0530 Subject: [PATCH 21/95] fix: indentation issue in the Production Plan Summary report (backport #38019) (#38068) fix: indentation issue in the Production Plan Summary report (#38019) fix: Production Plan Summary report (cherry picked from commit 4a111f73620136cda022e030c58d7d58b0c22a8e) Co-authored-by: rohitwaghchaure --- .../production_plan/production_plan.js | 4 -- .../production_plan/production_plan.py | 2 - .../production_plan/test_production_plan.py | 43 ------------------- .../production_plan_summary.js | 4 +- .../production_plan_summary.py | 26 ++++++++--- 5 files changed, 22 insertions(+), 57 deletions(-) diff --git a/erpnext/manufacturing/doctype/production_plan/production_plan.js b/erpnext/manufacturing/doctype/production_plan/production_plan.js index 72438ddceeae..dd102b0fae05 100644 --- a/erpnext/manufacturing/doctype/production_plan/production_plan.js +++ b/erpnext/manufacturing/doctype/production_plan/production_plan.js @@ -89,10 +89,6 @@ frappe.ui.form.on('Production Plan', { frm.trigger("show_progress"); if (frm.doc.status !== "Completed") { - frm.add_custom_button(__("Work Order Tree"), ()=> { - frappe.set_route('Tree', 'Work Order', {production_plan: frm.doc.name}); - }, __('View')); - frm.add_custom_button(__("Production Plan Summary"), ()=> { frappe.set_route('query-report', 'Production Plan Summary', {production_plan: frm.doc.name}); }, __('View')); diff --git a/erpnext/manufacturing/doctype/production_plan/production_plan.py b/erpnext/manufacturing/doctype/production_plan/production_plan.py index 2d202386263c..8d12ba92103b 100644 --- a/erpnext/manufacturing/doctype/production_plan/production_plan.py +++ b/erpnext/manufacturing/doctype/production_plan/production_plan.py @@ -827,8 +827,6 @@ def get_sub_assembly_items(self, manufacturing_type=None): # Combine subassembly items sub_assembly_items_store = self.combine_subassembly_items(sub_assembly_items_store) - sub_assembly_items_store.sort(key=lambda d: d.bom_level, reverse=True) # sort by bom level - for idx, row in enumerate(sub_assembly_items_store): row.idx = idx + 1 self.append("sub_assembly_items", row) diff --git a/erpnext/manufacturing/doctype/production_plan/test_production_plan.py b/erpnext/manufacturing/doctype/production_plan/test_production_plan.py index 749c33f01bba..4ad7d06c7078 100644 --- a/erpnext/manufacturing/doctype/production_plan/test_production_plan.py +++ b/erpnext/manufacturing/doctype/production_plan/test_production_plan.py @@ -653,49 +653,6 @@ def test_get_sales_order_with_variant(self): frappe.db.rollback() - def test_subassmebly_sorting(self): - "Test subassembly sorting in case of multiple items with nested BOMs." - from erpnext.manufacturing.doctype.bom.test_bom import create_nested_bom - - prefix = "_TestLevel_" - boms = { - "Assembly": { - "SubAssembly1": { - "ChildPart1": {}, - "ChildPart2": {}, - }, - "ChildPart6": {}, - "SubAssembly4": {"SubSubAssy2": {"ChildPart7": {}}}, - }, - "MegaDeepAssy": { - "SecretSubassy": { - "SecretPart": {"VerySecret": {"SuperSecret": {"Classified": {}}}}, - }, - # ^ assert that this is - # first item in subassy table - }, - } - create_nested_bom(boms, prefix=prefix) - - items = [prefix + item_code for item_code in boms.keys()] - plan = create_production_plan(item_code=items[0], do_not_save=True) - plan.append( - "po_items", - { - "use_multi_level_bom": 1, - "item_code": items[1], - "bom_no": frappe.db.get_value("Item", items[1], "default_bom"), - "planned_qty": 1, - "planned_start_date": now_datetime(), - }, - ) - plan.get_sub_assembly_items() - - bom_level_order = [d.bom_level for d in plan.sub_assembly_items] - self.assertEqual(bom_level_order, sorted(bom_level_order, reverse=True)) - # lowest most level of subassembly should be first - self.assertIn("SuperSecret", plan.sub_assembly_items[0].production_item) - def test_multiple_work_order_for_production_plan_item(self): "Test producing Prod Plan (making WO) in parts." diff --git a/erpnext/manufacturing/report/production_plan_summary/production_plan_summary.js b/erpnext/manufacturing/report/production_plan_summary/production_plan_summary.js index 59396fef16e1..a4d7fae45604 100644 --- a/erpnext/manufacturing/report/production_plan_summary/production_plan_summary.js +++ b/erpnext/manufacturing/report/production_plan_summary/production_plan_summary.js @@ -22,9 +22,9 @@ frappe.query_reports["Production Plan Summary"] = { "formatter": function(value, row, column, data, default_formatter) { value = default_formatter(value, row, column, data); - if (column.fieldname == "document_name") { + if (column.fieldname == "item_code") { var color = data.pending_qty > 0 ? 'red': 'green'; - value = `${data['document_name']}`; + value = `${data['item_code']}`; } return value; diff --git a/erpnext/manufacturing/report/production_plan_summary/production_plan_summary.py b/erpnext/manufacturing/report/production_plan_summary/production_plan_summary.py index 2c8f82f2cc66..076690ff0907 100644 --- a/erpnext/manufacturing/report/production_plan_summary/production_plan_summary.py +++ b/erpnext/manufacturing/report/production_plan_summary/production_plan_summary.py @@ -44,6 +44,7 @@ def get_production_plan_item_details(filters, data, order_details): { "indent": 0, "item_code": row.item_code, + "sales_order": row.get("sales_order"), "item_name": frappe.get_cached_value("Item", row.item_code, "item_name"), "qty": row.planned_qty, "document_type": "Work Order", @@ -80,7 +81,7 @@ def get_production_plan_sub_assembly_item_details( data.append( { - "indent": 1, + "indent": 1 + item.indent, "item_code": item.production_item, "item_name": item.item_name, "qty": item.qty, @@ -98,7 +99,7 @@ def get_work_order_details(filters, order_details): for row in frappe.get_all( "Work Order", filters={"production_plan": filters.get("production_plan")}, - fields=["name", "produced_qty", "production_plan", "production_item"], + fields=["name", "produced_qty", "production_plan", "production_item", "sales_order"], ): order_details.setdefault((row.name, row.production_item), row) @@ -118,10 +119,17 @@ def get_column(filters): "label": _("Finished Good"), "fieldtype": "Link", "fieldname": "item_code", - "width": 300, + "width": 240, "options": "Item", }, - {"label": _("Item Name"), "fieldtype": "data", "fieldname": "item_name", "width": 100}, + {"label": _("Item Name"), "fieldtype": "data", "fieldname": "item_name", "width": 150}, + { + "label": _("Sales Order"), + "options": "Sales Order", + "fieldtype": "Link", + "fieldname": "sales_order", + "width": 100, + }, { "label": _("Document Type"), "fieldtype": "Link", @@ -133,10 +141,16 @@ def get_column(filters): "label": _("Document Name"), "fieldtype": "Dynamic Link", "fieldname": "document_name", - "width": 150, + "options": "document_type", + "width": 180, }, {"label": _("BOM Level"), "fieldtype": "Int", "fieldname": "bom_level", "width": 100}, {"label": _("Order Qty"), "fieldtype": "Float", "fieldname": "qty", "width": 120}, - {"label": _("Received Qty"), "fieldtype": "Float", "fieldname": "produced_qty", "width": 160}, + { + "label": _("Produced / Received Qty"), + "fieldtype": "Float", + "fieldname": "produced_qty", + "width": 200, + }, {"label": _("Pending Qty"), "fieldtype": "Float", "fieldname": "pending_qty", "width": 110}, ] From 8446e87cc2262d20497edd95a15804285ec3e893 Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Mon, 13 Nov 2023 19:20:52 +0530 Subject: [PATCH 22/95] chore: delete comments and unlink attachments on company transactions deletion (backport #38077) (#38078) * chore: delete comments and unlink attachments on company transactions deletion (cherry picked from commit 2f9e96e3245e210ab1a26ffe99499367b0e0afa5) * fix: unrelated transation date typo (cherry picked from commit b097bb20d99f1d25fbd8bdcf0277859741a0ee53) --------- Co-authored-by: anandbaburajan --- erpnext/controllers/buying_controller.py | 2 +- .../transaction_deletion_record.py | 49 +++++++++++++++++-- 2 files changed, 45 insertions(+), 6 deletions(-) diff --git a/erpnext/controllers/buying_controller.py b/erpnext/controllers/buying_controller.py index 2a5f0b482281..913e2274b1ac 100644 --- a/erpnext/controllers/buying_controller.py +++ b/erpnext/controllers/buying_controller.py @@ -338,7 +338,7 @@ def set_incoming_rate(self): { "item_code": d.item_code, "warehouse": d.get("from_warehouse"), - "posting_date": self.get("posting_date") or self.get("transation_date"), + "posting_date": self.get("posting_date") or self.get("transaction_date"), "posting_time": posting_time, "qty": -1 * flt(d.get("stock_qty")), "serial_no": d.get("serial_no"), diff --git a/erpnext/setup/doctype/transaction_deletion_record/transaction_deletion_record.py b/erpnext/setup/doctype/transaction_deletion_record/transaction_deletion_record.py index 481a3a5ebea7..d266285b29a3 100644 --- a/erpnext/setup/doctype/transaction_deletion_record/transaction_deletion_record.py +++ b/erpnext/setup/doctype/transaction_deletion_record/transaction_deletion_record.py @@ -108,7 +108,16 @@ def delete_company_transactions(self): if no_of_docs > 0: self.delete_version_log(docfield["parent"], docfield["fieldname"]) - self.delete_communications(docfield["parent"], docfield["fieldname"]) + + reference_docs = frappe.get_all( + docfield["parent"], filters={docfield["fieldname"]: self.company} + ) + reference_doc_names = [r.name for r in reference_docs] + + self.delete_communications(docfield["parent"], reference_doc_names) + self.delete_comments(docfield["parent"], reference_doc_names) + self.unlink_attachments(docfield["parent"], reference_doc_names) + self.populate_doctypes_table(tables, docfield["parent"], no_of_docs) self.delete_child_tables(docfield["parent"], docfield["fieldname"]) @@ -197,19 +206,49 @@ def delete_version_log(self, doctype, company_fieldname): (versions.ref_doctype == doctype) & (versions.docname.isin(batch)) ).run() - def delete_communications(self, doctype, company_fieldname): - reference_docs = frappe.get_all(doctype, filters={company_fieldname: self.company}) - reference_doc_names = [r.name for r in reference_docs] - + def delete_communications(self, doctype, reference_doc_names): communications = frappe.get_all( "Communication", filters={"reference_doctype": doctype, "reference_name": ["in", reference_doc_names]}, ) communication_names = [c.name for c in communications] + if not communication_names: + return + for batch in create_batch(communication_names, self.batch_size): frappe.delete_doc("Communication", batch, ignore_permissions=True) + def delete_comments(self, doctype, reference_doc_names): + comments = frappe.get_all( + "Comment", + filters={"reference_doctype": doctype, "reference_name": ["in", reference_doc_names]}, + ) + comment_names = [c.name for c in comments] + + if not comment_names: + return + + for batch in create_batch(comment_names, self.batch_size): + frappe.delete_doc("Comment", batch, ignore_permissions=True) + + def unlink_attachments(self, doctype, reference_doc_names): + files = frappe.get_all( + "File", + filters={"attached_to_doctype": doctype, "attached_to_name": ["in", reference_doc_names]}, + ) + file_names = [c.name for c in files] + + if not file_names: + return + + file = qb.DocType("File") + + for batch in create_batch(file_names, self.batch_size): + qb.update(file).set(file.attached_to_doctype, None).set(file.attached_to_name, None).where( + file.name.isin(batch) + ).run() + @frappe.whitelist() def get_doctypes_to_be_ignored(): From 7a2df2412916489a12780b6912ada311ad095ad1 Mon Sep 17 00:00:00 2001 From: Frappe PR Bot Date: Tue, 14 Nov 2023 12:57:28 +0000 Subject: [PATCH 23/95] chore(release): Bumped to Version 14.48.0 # [14.48.0](https://github.com/frappe/erpnext/compare/v14.47.4...v14.48.0) (2023-11-14) ### Bug Fixes * asset depreciation ledger (backport [#37991](https://github.com/frappe/erpnext/issues/37991)) ([#37992](https://github.com/frappe/erpnext/issues/37992)) ([043dc1b](https://github.com/frappe/erpnext/commit/043dc1b14bbcf85a2c87f062a538fc34c731af50)) * close `Credit Limit Crossed` dialog (backport [#38052](https://github.com/frappe/erpnext/issues/38052)) ([#38058](https://github.com/frappe/erpnext/issues/38058)) ([6979c3e](https://github.com/frappe/erpnext/commit/6979c3e490beecdd890eddd33b4e2acb9ba66af7)) * COA Importer app related issues ([#37238](https://github.com/frappe/erpnext/issues/37238)) ([57ce73d](https://github.com/frappe/erpnext/commit/57ce73d5400f9ef5f9e51b061a2a7e73a9e384b2)) * german translations of Accounts Settings ([b75aae9](https://github.com/frappe/erpnext/commit/b75aae99caa5175f16f90304f8b5b56a46ae4773)) * indentation issue in the Production Plan Summary report (backport [#38019](https://github.com/frappe/erpnext/issues/38019)) ([#38068](https://github.com/frappe/erpnext/issues/38068)) ([c552884](https://github.com/frappe/erpnext/commit/c5528844fd30e229e6b4064bd93075b1b8fa0a90)) * make adjustment entry using stock reconciliation (backport [#37995](https://github.com/frappe/erpnext/issues/37995)) ([#38008](https://github.com/frappe/erpnext/issues/38008)) ([984703c](https://github.com/frappe/erpnext/commit/984703c3c9e0201cd17d444da6f549884943d960)) * make item field read-only in batch (backport [#38010](https://github.com/frappe/erpnext/issues/38010)) ([#38033](https://github.com/frappe/erpnext/issues/38033)) ([424ebd1](https://github.com/frappe/erpnext/commit/424ebd154a2c9a5dbe4d096871c7e9b2e87af529)) * minor change added to test_case ([6b34568](https://github.com/frappe/erpnext/commit/6b3456812869c5f288914fdf9bbfd7ab9dcfb5f1)) * minor issue ([0eab723](https://github.com/frappe/erpnext/commit/0eab723243d0a79ae511896313621add0741a97b)) * new logic for handling revaluation journals ([9c0d80c](https://github.com/frappe/erpnext/commit/9c0d80cef4fdeb673bc05acdd3e4f3855ab761b2)) * pick serial nos from selected batch only ([#37988](https://github.com/frappe/erpnext/issues/37988)) ([db29180](https://github.com/frappe/erpnext/commit/db29180eec052c865f82c31a08d84303a002279b)) * sales order not assigned to territory orders ([#37905](https://github.com/frappe/erpnext/issues/37905)) ([#38024](https://github.com/frappe/erpnext/issues/38024)) ([620f4f2](https://github.com/frappe/erpnext/commit/620f4f2c109f3b073e578247331ab50280a24100)) * Set right party name in bank transaction ([21b430a](https://github.com/frappe/erpnext/commit/21b430a575143a258726386c430be4207ed5979d)) * **translations:** suggestions from review ([4d2169e](https://github.com/frappe/erpnext/commit/4d2169e48e3738b21e16cb1418b3127df1b05883)) * Use `process.extract` to get the corresponding party doc name of the result ([b0a184e](https://github.com/frappe/erpnext/commit/b0a184e937553195862607b945f90b66148120d7)) ### Features * **accounts_receivable:** test_case added for multi-select customer group ([cf0d936](https://github.com/frappe/erpnext/commit/cf0d936195401d4098592a4db5c41ac54e7a55ce)) * multi-select customer group in AR Report ([935286f](https://github.com/frappe/erpnext/commit/935286ff94a6779c16e0a9ee5fcbe1a9a5c7f985)) --- erpnext/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/__init__.py b/erpnext/__init__.py index 265b19522db4..8f3a0399e238 100644 --- a/erpnext/__init__.py +++ b/erpnext/__init__.py @@ -3,7 +3,7 @@ import frappe -__version__ = "14.47.4" +__version__ = "14.48.0" def get_default_company(user=None): From d1a8202624ef19ede288a86d838f0271bb86301f Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Tue, 14 Nov 2023 20:11:23 +0530 Subject: [PATCH 24/95] chore: refetch item images on transaction save (backport #38095) (#38098) * chore: refetch item images on transaction save (#38095) chore: re fetch item images on transaction save (cherry picked from commit e93a19ffb5d45a3bf0136ca3fc24a828b008aeee) # Conflicts: # erpnext/accounts/doctype/pos_invoice_item/pos_invoice_item.json # erpnext/accounts/doctype/sales_invoice_item/sales_invoice_item.json # erpnext/selling/doctype/quotation_item/quotation_item.json * chore: fix conflict in pos_invoice_item.json * chore: fix conflict in sales_invoice_item.json * chore: fix conflict in quotation_item.json --------- Co-authored-by: Anand Baburajan --- .../doctype/pos_invoice_item/pos_invoice_item.json | 5 +++-- .../purchase_invoice_item/purchase_invoice_item.json | 3 ++- .../doctype/sales_invoice_item/sales_invoice_item.json | 5 +++-- .../purchase_order_item/purchase_order_item.json | 3 ++- .../request_for_quotation_item.json | 5 ++++- .../supplier_quotation_item.json | 5 ++++- .../crm/doctype/opportunity_item/opportunity_item.json | 4 +++- .../doctype/bom_explosion_item/bom_explosion_item.json | 3 ++- erpnext/manufacturing/doctype/bom_item/bom_item.json | 3 ++- .../selling/doctype/quotation_item/quotation_item.json | 5 +++-- .../doctype/sales_order_item/sales_order_item.json | 10 ++-------- .../doctype/delivery_note_item/delivery_note_item.json | 3 ++- .../material_request_item/material_request_item.json | 3 ++- .../purchase_receipt_item/purchase_receipt_item.json | 3 ++- .../subcontracting_order_item.json | 3 ++- .../subcontracting_receipt_item.json | 3 ++- 16 files changed, 40 insertions(+), 26 deletions(-) diff --git a/erpnext/accounts/doctype/pos_invoice_item/pos_invoice_item.json b/erpnext/accounts/doctype/pos_invoice_item/pos_invoice_item.json index 4bb18655b472..f741cd94a1e3 100644 --- a/erpnext/accounts/doctype/pos_invoice_item/pos_invoice_item.json +++ b/erpnext/accounts/doctype/pos_invoice_item/pos_invoice_item.json @@ -185,6 +185,7 @@ "label": "Image" }, { + "fetch_from": "item_code.image", "fieldname": "image", "fieldtype": "Attach", "hidden": 1, @@ -821,7 +822,7 @@ ], "istable": 1, "links": [], - "modified": "2022-11-02 12:52:39.125295", + "modified": "2023-11-14 18:33:22.585715", "modified_by": "Administrator", "module": "Accounts", "name": "POS Invoice Item", @@ -831,4 +832,4 @@ "sort_field": "modified", "sort_order": "DESC", "states": [] -} \ No newline at end of file +} 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 c7357360ec0d..7f71bd61e350 100644 --- a/erpnext/accounts/doctype/purchase_invoice_item/purchase_invoice_item.json +++ b/erpnext/accounts/doctype/purchase_invoice_item/purchase_invoice_item.json @@ -156,6 +156,7 @@ "width": "300px" }, { + "fetch_from": "item_code.image", "fieldname": "image", "fieldtype": "Attach", "hidden": 1, @@ -890,7 +891,7 @@ "idx": 1, "istable": 1, "links": [], - "modified": "2023-10-03 21:01:01.824892", + "modified": "2023-11-14 18:33:48.547297", "modified_by": "Administrator", "module": "Accounts", "name": "Purchase Invoice Item", 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 f25280f007c8..87cf1ae80d6b 100644 --- a/erpnext/accounts/doctype/sales_invoice_item/sales_invoice_item.json +++ b/erpnext/accounts/doctype/sales_invoice_item/sales_invoice_item.json @@ -167,6 +167,7 @@ "print_hide": 1 }, { + "fetch_from": "item_code.image", "fieldname": "image", "fieldtype": "Attach", "hidden": 1, @@ -891,7 +892,7 @@ "idx": 1, "istable": 1, "links": [], - "modified": "2023-07-25 11:58:10.723833", + "modified": "2023-11-14 18:34:10.479329", "modified_by": "Administrator", "module": "Accounts", "name": "Sales Invoice Item", @@ -901,4 +902,4 @@ "sort_field": "modified", "sort_order": "DESC", "states": [] -} \ No newline at end of file +} diff --git a/erpnext/buying/doctype/purchase_order_item/purchase_order_item.json b/erpnext/buying/doctype/purchase_order_item/purchase_order_item.json index bd7532e9554b..0b390e542a94 100644 --- a/erpnext/buying/doctype/purchase_order_item/purchase_order_item.json +++ b/erpnext/buying/doctype/purchase_order_item/purchase_order_item.json @@ -190,6 +190,7 @@ "fieldtype": "Column Break" }, { + "fetch_from": "item_code.image", "fieldname": "image", "fieldtype": "Attach", "hidden": 1, @@ -917,7 +918,7 @@ "index_web_pages_for_search": 1, "istable": 1, "links": [], - "modified": "2023-11-06 11:00:53.596417", + "modified": "2023-11-14 18:34:27.267382", "modified_by": "Administrator", "module": "Buying", "name": "Purchase Order Item", diff --git a/erpnext/buying/doctype/request_for_quotation_item/request_for_quotation_item.json b/erpnext/buying/doctype/request_for_quotation_item/request_for_quotation_item.json index e07f4626b8fe..1b171c8e9eb7 100644 --- a/erpnext/buying/doctype/request_for_quotation_item/request_for_quotation_item.json +++ b/erpnext/buying/doctype/request_for_quotation_item/request_for_quotation_item.json @@ -88,6 +88,7 @@ "width": "300px" }, { + "fetch_from": "item_code.image", "fieldname": "image", "fieldtype": "Attach", "hidden": 1, @@ -261,13 +262,15 @@ "index_web_pages_for_search": 1, "istable": 1, "links": [], - "modified": "2020-09-24 17:26:46.276934", + "modified": "2023-11-14 18:34:48.327224", "modified_by": "Administrator", "module": "Buying", "name": "Request for Quotation Item", + "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/buying/doctype/supplier_quotation_item/supplier_quotation_item.json b/erpnext/buying/doctype/supplier_quotation_item/supplier_quotation_item.json index 638cde01be5f..a4e3c4f32e23 100644 --- a/erpnext/buying/doctype/supplier_quotation_item/supplier_quotation_item.json +++ b/erpnext/buying/doctype/supplier_quotation_item/supplier_quotation_item.json @@ -134,6 +134,7 @@ "fieldtype": "Column Break" }, { + "fetch_from": "item_code.image", "fieldname": "image", "fieldtype": "Attach", "hidden": 1, @@ -560,13 +561,15 @@ "index_web_pages_for_search": 1, "istable": 1, "links": [], - "modified": "2020-10-19 12:36:26.913211", + "modified": "2023-11-14 18:35:03.435817", "modified_by": "Administrator", "module": "Buying", "name": "Supplier Quotation Item", + "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/crm/doctype/opportunity_item/opportunity_item.json b/erpnext/crm/doctype/opportunity_item/opportunity_item.json index 1b4973c1b2be..732f80d01c9f 100644 --- a/erpnext/crm/doctype/opportunity_item/opportunity_item.json +++ b/erpnext/crm/doctype/opportunity_item/opportunity_item.json @@ -103,6 +103,7 @@ "fieldtype": "Column Break" }, { + "fetch_from": "item_code.image", "fieldname": "image", "fieldtype": "Attach", "hidden": 1, @@ -165,7 +166,7 @@ "idx": 1, "istable": 1, "links": [], - "modified": "2021-07-30 16:39:09.775720", + "modified": "2023-11-14 18:35:30.887278", "modified_by": "Administrator", "module": "CRM", "name": "Opportunity Item", @@ -173,5 +174,6 @@ "permissions": [], "sort_field": "modified", "sort_order": "DESC", + "states": [], "track_changes": 1 } \ No newline at end of file diff --git a/erpnext/manufacturing/doctype/bom_explosion_item/bom_explosion_item.json b/erpnext/manufacturing/doctype/bom_explosion_item/bom_explosion_item.json index 9b1db63494b5..c75ac32cd124 100644 --- a/erpnext/manufacturing/doctype/bom_explosion_item/bom_explosion_item.json +++ b/erpnext/manufacturing/doctype/bom_explosion_item/bom_explosion_item.json @@ -85,6 +85,7 @@ "fieldtype": "Column Break" }, { + "fetch_from": "item_code.image", "fieldname": "image", "fieldtype": "Attach", "hidden": 1, @@ -169,7 +170,7 @@ "index_web_pages_for_search": 1, "istable": 1, "links": [], - "modified": "2022-05-27 13:42:23.305455", + "modified": "2023-11-14 18:35:40.856895", "modified_by": "Administrator", "module": "Manufacturing", "name": "BOM Explosion Item", diff --git a/erpnext/manufacturing/doctype/bom_item/bom_item.json b/erpnext/manufacturing/doctype/bom_item/bom_item.json index c5266119dc20..cb58af1f29a2 100644 --- a/erpnext/manufacturing/doctype/bom_item/bom_item.json +++ b/erpnext/manufacturing/doctype/bom_item/bom_item.json @@ -111,6 +111,7 @@ "fieldtype": "Column Break" }, { + "fetch_from": "item_code.image", "fieldname": "image", "fieldtype": "Attach", "hidden": 1, @@ -289,7 +290,7 @@ "index_web_pages_for_search": 1, "istable": 1, "links": [], - "modified": "2022-07-28 10:20:51.559010", + "modified": "2023-11-14 18:35:51.378513", "modified_by": "Administrator", "module": "Manufacturing", "name": "BOM Item", diff --git a/erpnext/selling/doctype/quotation_item/quotation_item.json b/erpnext/selling/doctype/quotation_item/quotation_item.json index f5e641dceb47..555dc68f4ebe 100644 --- a/erpnext/selling/doctype/quotation_item/quotation_item.json +++ b/erpnext/selling/doctype/quotation_item/quotation_item.json @@ -137,6 +137,7 @@ "width": "300px" }, { + "fetch_from": "item_code.image", "fieldname": "image", "fieldtype": "Attach", "hidden": 1, @@ -668,7 +669,7 @@ "idx": 1, "istable": 1, "links": [], - "modified": "2023-09-27 14:02:12.332407", + "modified": "2023-11-14 18:24:24.619832", "modified_by": "Administrator", "module": "Selling", "name": "Quotation Item", @@ -678,4 +679,4 @@ "sort_order": "DESC", "states": [], "track_changes": 1 -} \ No newline at end of file +} diff --git a/erpnext/selling/doctype/sales_order_item/sales_order_item.json b/erpnext/selling/doctype/sales_order_item/sales_order_item.json index e97141130950..bf28b2054d5c 100644 --- a/erpnext/selling/doctype/sales_order_item/sales_order_item.json +++ b/erpnext/selling/doctype/sales_order_item/sales_order_item.json @@ -66,7 +66,6 @@ "total_weight", "column_break_21", "weight_uom", - "accounting_dimensions_section", "warehouse_and_reference", "warehouse", "target_warehouse", @@ -177,6 +176,7 @@ "print_hide": 1 }, { + "fetch_from": "item_code.image", "fieldname": "image", "fieldtype": "Attach", "hidden": 1, @@ -869,18 +869,12 @@ "label": "Production Plan Qty", "no_copy": 1, "read_only": 1 - }, - { - "collapsible": 1, - "fieldname": "accounting_dimensions_section", - "fieldtype": "Section Break", - "label": "Accounting Dimensions" } ], "idx": 1, "istable": 1, "links": [], - "modified": "2023-10-17 18:18:26.475259", + "modified": "2023-11-14 18:37:12.787893", "modified_by": "Administrator", "module": "Selling", "name": "Sales Order Item", diff --git a/erpnext/stock/doctype/delivery_note_item/delivery_note_item.json b/erpnext/stock/doctype/delivery_note_item/delivery_note_item.json index 237088f64a74..b85bfe5036d8 100644 --- a/erpnext/stock/doctype/delivery_note_item/delivery_note_item.json +++ b/erpnext/stock/doctype/delivery_note_item/delivery_note_item.json @@ -165,6 +165,7 @@ "width": "300px" }, { + "fetch_from": "item_code.image", "fieldname": "image", "fieldtype": "Attach", "hidden": 1, @@ -869,7 +870,7 @@ "index_web_pages_for_search": 1, "istable": 1, "links": [], - "modified": "2023-10-16 16:18:18.013379", + "modified": "2023-11-14 18:37:38.638144", "modified_by": "Administrator", "module": "Stock", "name": "Delivery Note Item", diff --git a/erpnext/stock/doctype/material_request_item/material_request_item.json b/erpnext/stock/doctype/material_request_item/material_request_item.json index f0e117ef48dc..ed4a7e7cf640 100644 --- a/erpnext/stock/doctype/material_request_item/material_request_item.json +++ b/erpnext/stock/doctype/material_request_item/material_request_item.json @@ -111,6 +111,7 @@ "width": "250px" }, { + "fetch_from": "item_code.image", "fieldname": "image", "fieldtype": "Attach Image", "label": "Image", @@ -479,7 +480,7 @@ "index_web_pages_for_search": 1, "istable": 1, "links": [], - "modified": "2023-10-27 15:53:41.444236", + "modified": "2023-11-14 18:37:59.599115", "modified_by": "Administrator", "module": "Stock", "name": "Material Request Item", diff --git a/erpnext/stock/doctype/purchase_receipt_item/purchase_receipt_item.json b/erpnext/stock/doctype/purchase_receipt_item/purchase_receipt_item.json index 47883bbf8a77..749dbf2111f8 100644 --- a/erpnext/stock/doctype/purchase_receipt_item/purchase_receipt_item.json +++ b/erpnext/stock/doctype/purchase_receipt_item/purchase_receipt_item.json @@ -186,6 +186,7 @@ "width": "300px" }, { + "fetch_from": "item_code.image", "fieldname": "image", "fieldtype": "Attach", "hidden": 1, @@ -1053,7 +1054,7 @@ "idx": 1, "istable": 1, "links": [], - "modified": "2023-10-30 17:32:24.560337", + "modified": "2023-11-14 18:38:15.251994", "modified_by": "Administrator", "module": "Stock", "name": "Purchase Receipt Item", diff --git a/erpnext/subcontracting/doctype/subcontracting_order_item/subcontracting_order_item.json b/erpnext/subcontracting/doctype/subcontracting_order_item/subcontracting_order_item.json index d77e77440e04..46c229bfd378 100644 --- a/erpnext/subcontracting/doctype/subcontracting_order_item/subcontracting_order_item.json +++ b/erpnext/subcontracting/doctype/subcontracting_order_item/subcontracting_order_item.json @@ -112,6 +112,7 @@ "fieldtype": "Column Break" }, { + "fetch_from": "item_code.image", "fieldname": "image", "fieldtype": "Attach", "hidden": 1, @@ -337,7 +338,7 @@ "index_web_pages_for_search": 1, "istable": 1, "links": [], - "modified": "2023-01-20 23:25:45.363281", + "modified": "2023-11-14 18:38:37.640677", "modified_by": "Administrator", "module": "Subcontracting", "name": "Subcontracting Order Item", diff --git a/erpnext/subcontracting/doctype/subcontracting_receipt_item/subcontracting_receipt_item.json b/erpnext/subcontracting/doctype/subcontracting_receipt_item/subcontracting_receipt_item.json index f7e88d0fb7fe..28bd84e5895a 100644 --- a/erpnext/subcontracting/doctype/subcontracting_receipt_item/subcontracting_receipt_item.json +++ b/erpnext/subcontracting/doctype/subcontracting_receipt_item/subcontracting_receipt_item.json @@ -104,6 +104,7 @@ "width": "300px" }, { + "fetch_from": "item_code.image", "fieldname": "image", "fieldtype": "Attach", "hidden": 1, @@ -469,7 +470,7 @@ "idx": 1, "istable": 1, "links": [], - "modified": "2023-09-03 17:04:21.214316", + "modified": "2023-11-14 18:38:26.459669", "modified_by": "Administrator", "module": "Subcontracting", "name": "Subcontracting Receipt Item", From 966adfc081c69d09fce4e3cba9707e577802db0b Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Tue, 14 Nov 2023 20:11:23 +0530 Subject: [PATCH 25/95] chore: refetch item images on transaction save (backport #38095) (#38098) * chore: refetch item images on transaction save (#38095) chore: re fetch item images on transaction save (cherry picked from commit e93a19ffb5d45a3bf0136ca3fc24a828b008aeee) # Conflicts: # erpnext/accounts/doctype/pos_invoice_item/pos_invoice_item.json # erpnext/accounts/doctype/sales_invoice_item/sales_invoice_item.json # erpnext/selling/doctype/quotation_item/quotation_item.json * chore: fix conflict in pos_invoice_item.json * chore: fix conflict in sales_invoice_item.json * chore: fix conflict in quotation_item.json --------- Co-authored-by: Anand Baburajan (cherry picked from commit d1a8202624ef19ede288a86d838f0271bb86301f) --- .../doctype/pos_invoice_item/pos_invoice_item.json | 5 +++-- .../purchase_invoice_item/purchase_invoice_item.json | 3 ++- .../doctype/sales_invoice_item/sales_invoice_item.json | 5 +++-- .../purchase_order_item/purchase_order_item.json | 3 ++- .../request_for_quotation_item.json | 5 ++++- .../supplier_quotation_item.json | 5 ++++- .../crm/doctype/opportunity_item/opportunity_item.json | 4 +++- .../doctype/bom_explosion_item/bom_explosion_item.json | 3 ++- erpnext/manufacturing/doctype/bom_item/bom_item.json | 3 ++- .../selling/doctype/quotation_item/quotation_item.json | 5 +++-- .../doctype/sales_order_item/sales_order_item.json | 10 ++-------- .../doctype/delivery_note_item/delivery_note_item.json | 3 ++- .../material_request_item/material_request_item.json | 3 ++- .../purchase_receipt_item/purchase_receipt_item.json | 3 ++- .../subcontracting_order_item.json | 3 ++- .../subcontracting_receipt_item.json | 3 ++- 16 files changed, 40 insertions(+), 26 deletions(-) diff --git a/erpnext/accounts/doctype/pos_invoice_item/pos_invoice_item.json b/erpnext/accounts/doctype/pos_invoice_item/pos_invoice_item.json index 4bb18655b472..f741cd94a1e3 100644 --- a/erpnext/accounts/doctype/pos_invoice_item/pos_invoice_item.json +++ b/erpnext/accounts/doctype/pos_invoice_item/pos_invoice_item.json @@ -185,6 +185,7 @@ "label": "Image" }, { + "fetch_from": "item_code.image", "fieldname": "image", "fieldtype": "Attach", "hidden": 1, @@ -821,7 +822,7 @@ ], "istable": 1, "links": [], - "modified": "2022-11-02 12:52:39.125295", + "modified": "2023-11-14 18:33:22.585715", "modified_by": "Administrator", "module": "Accounts", "name": "POS Invoice Item", @@ -831,4 +832,4 @@ "sort_field": "modified", "sort_order": "DESC", "states": [] -} \ No newline at end of file +} 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 c7357360ec0d..7f71bd61e350 100644 --- a/erpnext/accounts/doctype/purchase_invoice_item/purchase_invoice_item.json +++ b/erpnext/accounts/doctype/purchase_invoice_item/purchase_invoice_item.json @@ -156,6 +156,7 @@ "width": "300px" }, { + "fetch_from": "item_code.image", "fieldname": "image", "fieldtype": "Attach", "hidden": 1, @@ -890,7 +891,7 @@ "idx": 1, "istable": 1, "links": [], - "modified": "2023-10-03 21:01:01.824892", + "modified": "2023-11-14 18:33:48.547297", "modified_by": "Administrator", "module": "Accounts", "name": "Purchase Invoice Item", 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 f25280f007c8..87cf1ae80d6b 100644 --- a/erpnext/accounts/doctype/sales_invoice_item/sales_invoice_item.json +++ b/erpnext/accounts/doctype/sales_invoice_item/sales_invoice_item.json @@ -167,6 +167,7 @@ "print_hide": 1 }, { + "fetch_from": "item_code.image", "fieldname": "image", "fieldtype": "Attach", "hidden": 1, @@ -891,7 +892,7 @@ "idx": 1, "istable": 1, "links": [], - "modified": "2023-07-25 11:58:10.723833", + "modified": "2023-11-14 18:34:10.479329", "modified_by": "Administrator", "module": "Accounts", "name": "Sales Invoice Item", @@ -901,4 +902,4 @@ "sort_field": "modified", "sort_order": "DESC", "states": [] -} \ No newline at end of file +} diff --git a/erpnext/buying/doctype/purchase_order_item/purchase_order_item.json b/erpnext/buying/doctype/purchase_order_item/purchase_order_item.json index bd7532e9554b..0b390e542a94 100644 --- a/erpnext/buying/doctype/purchase_order_item/purchase_order_item.json +++ b/erpnext/buying/doctype/purchase_order_item/purchase_order_item.json @@ -190,6 +190,7 @@ "fieldtype": "Column Break" }, { + "fetch_from": "item_code.image", "fieldname": "image", "fieldtype": "Attach", "hidden": 1, @@ -917,7 +918,7 @@ "index_web_pages_for_search": 1, "istable": 1, "links": [], - "modified": "2023-11-06 11:00:53.596417", + "modified": "2023-11-14 18:34:27.267382", "modified_by": "Administrator", "module": "Buying", "name": "Purchase Order Item", diff --git a/erpnext/buying/doctype/request_for_quotation_item/request_for_quotation_item.json b/erpnext/buying/doctype/request_for_quotation_item/request_for_quotation_item.json index e07f4626b8fe..1b171c8e9eb7 100644 --- a/erpnext/buying/doctype/request_for_quotation_item/request_for_quotation_item.json +++ b/erpnext/buying/doctype/request_for_quotation_item/request_for_quotation_item.json @@ -88,6 +88,7 @@ "width": "300px" }, { + "fetch_from": "item_code.image", "fieldname": "image", "fieldtype": "Attach", "hidden": 1, @@ -261,13 +262,15 @@ "index_web_pages_for_search": 1, "istable": 1, "links": [], - "modified": "2020-09-24 17:26:46.276934", + "modified": "2023-11-14 18:34:48.327224", "modified_by": "Administrator", "module": "Buying", "name": "Request for Quotation Item", + "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/buying/doctype/supplier_quotation_item/supplier_quotation_item.json b/erpnext/buying/doctype/supplier_quotation_item/supplier_quotation_item.json index 638cde01be5f..a4e3c4f32e23 100644 --- a/erpnext/buying/doctype/supplier_quotation_item/supplier_quotation_item.json +++ b/erpnext/buying/doctype/supplier_quotation_item/supplier_quotation_item.json @@ -134,6 +134,7 @@ "fieldtype": "Column Break" }, { + "fetch_from": "item_code.image", "fieldname": "image", "fieldtype": "Attach", "hidden": 1, @@ -560,13 +561,15 @@ "index_web_pages_for_search": 1, "istable": 1, "links": [], - "modified": "2020-10-19 12:36:26.913211", + "modified": "2023-11-14 18:35:03.435817", "modified_by": "Administrator", "module": "Buying", "name": "Supplier Quotation Item", + "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/crm/doctype/opportunity_item/opportunity_item.json b/erpnext/crm/doctype/opportunity_item/opportunity_item.json index 1b4973c1b2be..732f80d01c9f 100644 --- a/erpnext/crm/doctype/opportunity_item/opportunity_item.json +++ b/erpnext/crm/doctype/opportunity_item/opportunity_item.json @@ -103,6 +103,7 @@ "fieldtype": "Column Break" }, { + "fetch_from": "item_code.image", "fieldname": "image", "fieldtype": "Attach", "hidden": 1, @@ -165,7 +166,7 @@ "idx": 1, "istable": 1, "links": [], - "modified": "2021-07-30 16:39:09.775720", + "modified": "2023-11-14 18:35:30.887278", "modified_by": "Administrator", "module": "CRM", "name": "Opportunity Item", @@ -173,5 +174,6 @@ "permissions": [], "sort_field": "modified", "sort_order": "DESC", + "states": [], "track_changes": 1 } \ No newline at end of file diff --git a/erpnext/manufacturing/doctype/bom_explosion_item/bom_explosion_item.json b/erpnext/manufacturing/doctype/bom_explosion_item/bom_explosion_item.json index 9b1db63494b5..c75ac32cd124 100644 --- a/erpnext/manufacturing/doctype/bom_explosion_item/bom_explosion_item.json +++ b/erpnext/manufacturing/doctype/bom_explosion_item/bom_explosion_item.json @@ -85,6 +85,7 @@ "fieldtype": "Column Break" }, { + "fetch_from": "item_code.image", "fieldname": "image", "fieldtype": "Attach", "hidden": 1, @@ -169,7 +170,7 @@ "index_web_pages_for_search": 1, "istable": 1, "links": [], - "modified": "2022-05-27 13:42:23.305455", + "modified": "2023-11-14 18:35:40.856895", "modified_by": "Administrator", "module": "Manufacturing", "name": "BOM Explosion Item", diff --git a/erpnext/manufacturing/doctype/bom_item/bom_item.json b/erpnext/manufacturing/doctype/bom_item/bom_item.json index c5266119dc20..cb58af1f29a2 100644 --- a/erpnext/manufacturing/doctype/bom_item/bom_item.json +++ b/erpnext/manufacturing/doctype/bom_item/bom_item.json @@ -111,6 +111,7 @@ "fieldtype": "Column Break" }, { + "fetch_from": "item_code.image", "fieldname": "image", "fieldtype": "Attach", "hidden": 1, @@ -289,7 +290,7 @@ "index_web_pages_for_search": 1, "istable": 1, "links": [], - "modified": "2022-07-28 10:20:51.559010", + "modified": "2023-11-14 18:35:51.378513", "modified_by": "Administrator", "module": "Manufacturing", "name": "BOM Item", diff --git a/erpnext/selling/doctype/quotation_item/quotation_item.json b/erpnext/selling/doctype/quotation_item/quotation_item.json index f5e641dceb47..555dc68f4ebe 100644 --- a/erpnext/selling/doctype/quotation_item/quotation_item.json +++ b/erpnext/selling/doctype/quotation_item/quotation_item.json @@ -137,6 +137,7 @@ "width": "300px" }, { + "fetch_from": "item_code.image", "fieldname": "image", "fieldtype": "Attach", "hidden": 1, @@ -668,7 +669,7 @@ "idx": 1, "istable": 1, "links": [], - "modified": "2023-09-27 14:02:12.332407", + "modified": "2023-11-14 18:24:24.619832", "modified_by": "Administrator", "module": "Selling", "name": "Quotation Item", @@ -678,4 +679,4 @@ "sort_order": "DESC", "states": [], "track_changes": 1 -} \ No newline at end of file +} diff --git a/erpnext/selling/doctype/sales_order_item/sales_order_item.json b/erpnext/selling/doctype/sales_order_item/sales_order_item.json index e97141130950..bf28b2054d5c 100644 --- a/erpnext/selling/doctype/sales_order_item/sales_order_item.json +++ b/erpnext/selling/doctype/sales_order_item/sales_order_item.json @@ -66,7 +66,6 @@ "total_weight", "column_break_21", "weight_uom", - "accounting_dimensions_section", "warehouse_and_reference", "warehouse", "target_warehouse", @@ -177,6 +176,7 @@ "print_hide": 1 }, { + "fetch_from": "item_code.image", "fieldname": "image", "fieldtype": "Attach", "hidden": 1, @@ -869,18 +869,12 @@ "label": "Production Plan Qty", "no_copy": 1, "read_only": 1 - }, - { - "collapsible": 1, - "fieldname": "accounting_dimensions_section", - "fieldtype": "Section Break", - "label": "Accounting Dimensions" } ], "idx": 1, "istable": 1, "links": [], - "modified": "2023-10-17 18:18:26.475259", + "modified": "2023-11-14 18:37:12.787893", "modified_by": "Administrator", "module": "Selling", "name": "Sales Order Item", diff --git a/erpnext/stock/doctype/delivery_note_item/delivery_note_item.json b/erpnext/stock/doctype/delivery_note_item/delivery_note_item.json index 237088f64a74..b85bfe5036d8 100644 --- a/erpnext/stock/doctype/delivery_note_item/delivery_note_item.json +++ b/erpnext/stock/doctype/delivery_note_item/delivery_note_item.json @@ -165,6 +165,7 @@ "width": "300px" }, { + "fetch_from": "item_code.image", "fieldname": "image", "fieldtype": "Attach", "hidden": 1, @@ -869,7 +870,7 @@ "index_web_pages_for_search": 1, "istable": 1, "links": [], - "modified": "2023-10-16 16:18:18.013379", + "modified": "2023-11-14 18:37:38.638144", "modified_by": "Administrator", "module": "Stock", "name": "Delivery Note Item", diff --git a/erpnext/stock/doctype/material_request_item/material_request_item.json b/erpnext/stock/doctype/material_request_item/material_request_item.json index f0e117ef48dc..ed4a7e7cf640 100644 --- a/erpnext/stock/doctype/material_request_item/material_request_item.json +++ b/erpnext/stock/doctype/material_request_item/material_request_item.json @@ -111,6 +111,7 @@ "width": "250px" }, { + "fetch_from": "item_code.image", "fieldname": "image", "fieldtype": "Attach Image", "label": "Image", @@ -479,7 +480,7 @@ "index_web_pages_for_search": 1, "istable": 1, "links": [], - "modified": "2023-10-27 15:53:41.444236", + "modified": "2023-11-14 18:37:59.599115", "modified_by": "Administrator", "module": "Stock", "name": "Material Request Item", diff --git a/erpnext/stock/doctype/purchase_receipt_item/purchase_receipt_item.json b/erpnext/stock/doctype/purchase_receipt_item/purchase_receipt_item.json index 47883bbf8a77..749dbf2111f8 100644 --- a/erpnext/stock/doctype/purchase_receipt_item/purchase_receipt_item.json +++ b/erpnext/stock/doctype/purchase_receipt_item/purchase_receipt_item.json @@ -186,6 +186,7 @@ "width": "300px" }, { + "fetch_from": "item_code.image", "fieldname": "image", "fieldtype": "Attach", "hidden": 1, @@ -1053,7 +1054,7 @@ "idx": 1, "istable": 1, "links": [], - "modified": "2023-10-30 17:32:24.560337", + "modified": "2023-11-14 18:38:15.251994", "modified_by": "Administrator", "module": "Stock", "name": "Purchase Receipt Item", diff --git a/erpnext/subcontracting/doctype/subcontracting_order_item/subcontracting_order_item.json b/erpnext/subcontracting/doctype/subcontracting_order_item/subcontracting_order_item.json index d77e77440e04..46c229bfd378 100644 --- a/erpnext/subcontracting/doctype/subcontracting_order_item/subcontracting_order_item.json +++ b/erpnext/subcontracting/doctype/subcontracting_order_item/subcontracting_order_item.json @@ -112,6 +112,7 @@ "fieldtype": "Column Break" }, { + "fetch_from": "item_code.image", "fieldname": "image", "fieldtype": "Attach", "hidden": 1, @@ -337,7 +338,7 @@ "index_web_pages_for_search": 1, "istable": 1, "links": [], - "modified": "2023-01-20 23:25:45.363281", + "modified": "2023-11-14 18:38:37.640677", "modified_by": "Administrator", "module": "Subcontracting", "name": "Subcontracting Order Item", diff --git a/erpnext/subcontracting/doctype/subcontracting_receipt_item/subcontracting_receipt_item.json b/erpnext/subcontracting/doctype/subcontracting_receipt_item/subcontracting_receipt_item.json index f7e88d0fb7fe..28bd84e5895a 100644 --- a/erpnext/subcontracting/doctype/subcontracting_receipt_item/subcontracting_receipt_item.json +++ b/erpnext/subcontracting/doctype/subcontracting_receipt_item/subcontracting_receipt_item.json @@ -104,6 +104,7 @@ "width": "300px" }, { + "fetch_from": "item_code.image", "fieldname": "image", "fieldtype": "Attach", "hidden": 1, @@ -469,7 +470,7 @@ "idx": 1, "istable": 1, "links": [], - "modified": "2023-09-03 17:04:21.214316", + "modified": "2023-11-14 18:38:26.459669", "modified_by": "Administrator", "module": "Subcontracting", "name": "Subcontracting Receipt Item", From 1f16c47a2c4562bf5c2e7d7b4bafe7604efbb36a Mon Sep 17 00:00:00 2001 From: Arjun Date: Wed, 15 Nov 2023 12:34:38 +0530 Subject: [PATCH 26/95] fix: duplicate field in `Closing Stock Balance` (#38105) (cherry picked from commit 908b21f7fd8d0c62ffd51eb2ca5238225d0f52ad) --- .../closing_stock_balance/closing_stock_balance.json | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/erpnext/stock/doctype/closing_stock_balance/closing_stock_balance.json b/erpnext/stock/doctype/closing_stock_balance/closing_stock_balance.json index 225da6d15ec1..0c4757ffadb5 100644 --- a/erpnext/stock/doctype/closing_stock_balance/closing_stock_balance.json +++ b/erpnext/stock/doctype/closing_stock_balance/closing_stock_balance.json @@ -103,15 +103,6 @@ "print_hide": 1, "read_only": 1 }, - { - "fieldname": "amended_from", - "fieldtype": "Link", - "label": "Amended From", - "no_copy": 1, - "options": "Closing Stock Balance", - "print_hide": 1, - "read_only": 1 - }, { "fieldname": "include_uom", "fieldtype": "Link", @@ -145,4 +136,4 @@ "sort_field": "modified", "sort_order": "DESC", "states": [] -} \ No newline at end of file +} From 58cb4303ee41a411cd91e09a49f90697d17f0de2 Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Wed, 15 Nov 2023 18:01:28 +0530 Subject: [PATCH 27/95] chore: change read only condition of asset quantity field (backport #38111) (#38112) chore: change read only condition of asset quantity field (#38111) chore: change read only condition of asset quantity (cherry picked from commit 6e0362dee85811267edff53f23a24b48ebd91c11) Co-authored-by: Anand Baburajan --- erpnext/assets/doctype/asset/asset.json | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/erpnext/assets/doctype/asset/asset.json b/erpnext/assets/doctype/asset/asset.json index 963e4b8297a4..b092d193cc4b 100644 --- a/erpnext/assets/doctype/asset/asset.json +++ b/erpnext/assets/doctype/asset/asset.json @@ -495,11 +495,10 @@ "read_only": 1 }, { - "depends_on": "eval.doc.asset_quantity", "fieldname": "asset_quantity", "fieldtype": "Int", "label": "Asset Quantity", - "read_only": 1 + "read_only_depends_on": "eval:!doc.is_existing_asset && !doc.is_composite_asset" }, { "fieldname": "depr_entry_posting_status", @@ -565,7 +564,7 @@ "link_fieldname": "target_asset" } ], - "modified": "2023-10-27 17:03:46.629617", + "modified": "2023-11-15 17:40:17.315203", "modified_by": "Administrator", "module": "Assets", "name": "Asset", From 7d66cb219596023869d59e5849687ba552b5dad2 Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Wed, 15 Nov 2023 18:01:28 +0530 Subject: [PATCH 28/95] chore: change read only condition of asset quantity field (backport #38111) (#38112) chore: change read only condition of asset quantity field (#38111) chore: change read only condition of asset quantity (cherry picked from commit 6e0362dee85811267edff53f23a24b48ebd91c11) Co-authored-by: Anand Baburajan (cherry picked from commit 58cb4303ee41a411cd91e09a49f90697d17f0de2) --- erpnext/assets/doctype/asset/asset.json | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/erpnext/assets/doctype/asset/asset.json b/erpnext/assets/doctype/asset/asset.json index 963e4b8297a4..b092d193cc4b 100644 --- a/erpnext/assets/doctype/asset/asset.json +++ b/erpnext/assets/doctype/asset/asset.json @@ -495,11 +495,10 @@ "read_only": 1 }, { - "depends_on": "eval.doc.asset_quantity", "fieldname": "asset_quantity", "fieldtype": "Int", "label": "Asset Quantity", - "read_only": 1 + "read_only_depends_on": "eval:!doc.is_existing_asset && !doc.is_composite_asset" }, { "fieldname": "depr_entry_posting_status", @@ -565,7 +564,7 @@ "link_fieldname": "target_asset" } ], - "modified": "2023-10-27 17:03:46.629617", + "modified": "2023-11-15 17:40:17.315203", "modified_by": "Administrator", "module": "Assets", "name": "Asset", From bc01007c160ee4f0bb987fab77630c441f38a08b Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Thu, 16 Nov 2023 20:27:53 +0530 Subject: [PATCH 29/95] fix: remove ESS role when not mapped to employee (backport #37867) (#38132) fix: remove ESS role when not mapped to employee (#37867) * fix: remove ESS role when not mapped to employee * fix: emp role removal on unlinking * fix: test case for user employee role mapping * fix: mapped employee and user on creation (cherry picked from commit 56b8d1b9277a1290b18c6745736bef8dfa4e6f90) Co-authored-by: Dany Robert --- erpnext/setup/doctype/employee/employee.js | 4 ++- erpnext/setup/doctype/employee/employee.py | 29 +++++++++++++++---- .../setup/doctype/employee/test_employee.py | 9 ++++++ 3 files changed, 36 insertions(+), 6 deletions(-) diff --git a/erpnext/setup/doctype/employee/employee.js b/erpnext/setup/doctype/employee/employee.js index 39a215f3831c..efc3fd1d33d8 100755 --- a/erpnext/setup/doctype/employee/employee.js +++ b/erpnext/setup/doctype/employee/employee.js @@ -81,8 +81,10 @@ frappe.ui.form.on("Employee", { employee: frm.doc.name, email: frm.doc.prefered_email }, + freeze: true, + freeze_message: __("Creating User..."), callback: function (r) { - frm.set_value("user_id", r.message); + frm.reload_doc(); } }); } diff --git a/erpnext/setup/doctype/employee/employee.py b/erpnext/setup/doctype/employee/employee.py index 78f2e4935e77..a632c90f51ee 100755 --- a/erpnext/setup/doctype/employee/employee.py +++ b/erpnext/setup/doctype/employee/employee.py @@ -49,6 +49,9 @@ def validate(self): else: existing_user_id = frappe.db.get_value("Employee", self.name, "user_id") if existing_user_id: + user = frappe.get_doc("User", existing_user_id) + validate_employee_role(user, ignore_emp_check=True) + user.save(ignore_permissions=True) remove_user_permission("Employee", self.name, existing_user_id) def after_rename(self, old, new, merge): @@ -254,12 +257,26 @@ def reset_employee_emails_cache(self): frappe.cache().hdel("employees_with_number", prev_number) -def validate_employee_role(doc, method): +def validate_employee_role(doc, method=None, ignore_emp_check=False): # called via User hook - if "Employee" in [d.role for d in doc.get("roles")]: - if not frappe.db.get_value("Employee", {"user_id": doc.name}): - frappe.msgprint(_("Please set User ID field in an Employee record to set Employee Role")) - doc.get("roles").remove(doc.get("roles", {"role": "Employee"})[0]) + if not ignore_emp_check: + if frappe.db.get_value("Employee", {"user_id": doc.name}): + return + + user_roles = [d.role for d in doc.get("roles")] + if "Employee" in user_roles: + frappe.msgprint( + _("User {0}: Removed Employee role as there is no mapped employee.").format(doc.name) + ) + doc.get("roles").remove(doc.get("roles", {"role": "Employee"})[0]) + + if "Employee Self Service" in user_roles: + frappe.msgprint( + _("User {0}: Removed Employee Self Service role as there is no mapped employee.").format( + doc.name + ) + ) + doc.get("roles").remove(doc.get("roles", {"role": "Employee Self Service"})[0]) def update_user_permissions(doc, method): @@ -371,6 +388,8 @@ def create_user(employee, user=None, email=None): } ) user.insert() + emp.user_id = user.name + emp.save() return user.name diff --git a/erpnext/setup/doctype/employee/test_employee.py b/erpnext/setup/doctype/employee/test_employee.py index 5a693c5effb9..9b7068362699 100644 --- a/erpnext/setup/doctype/employee/test_employee.py +++ b/erpnext/setup/doctype/employee/test_employee.py @@ -25,6 +25,15 @@ def test_employee_status_left(self): employee1_doc.status = "Left" self.assertRaises(InactiveEmployeeStatusError, employee1_doc.save) + def test_user_has_employee(self): + employee = make_employee("test_emp_user_creation@company.com") + employee_doc = frappe.get_doc("Employee", employee) + user = employee_doc.user_id + self.assertTrue("Employee" in frappe.get_roles(user)) + employee_doc.user_id = "" + employee_doc.save() + self.assertTrue("Employee" not in frappe.get_roles(user)) + def tearDown(self): frappe.db.rollback() From d0698b32bbde5ac4d4e0e33d3c8ca2f10f0d7cc3 Mon Sep 17 00:00:00 2001 From: ruthra kumar Date: Thu, 16 Nov 2023 10:04:50 +0530 Subject: [PATCH 30/95] fix: add revaluation journal filter in Payable report (cherry picked from commit 134201794ace2863c02458b3e1797da816802d06) --- erpnext/accounts/report/accounts_payable/accounts_payable.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/erpnext/accounts/report/accounts_payable/accounts_payable.js b/erpnext/accounts/report/accounts_payable/accounts_payable.js index eff705dafac3..0979cffbf3cb 100644 --- a/erpnext/accounts/report/accounts_payable/accounts_payable.js +++ b/erpnext/accounts/report/accounts_payable/accounts_payable.js @@ -144,6 +144,11 @@ frappe.query_reports["Accounts Payable"] = { "label": __("Show Future Payments"), "fieldtype": "Check", }, + { + "fieldname": "for_revaluation_journals", + "label": __("Revaluation Journals"), + "fieldtype": "Check", + }, { "fieldname": "ignore_accounts", "label": __("Group by Voucher"), From 4eb37cce268464c8fe0de69482e53e9bc06c6753 Mon Sep 17 00:00:00 2001 From: ruthra kumar Date: Thu, 16 Nov 2023 10:04:50 +0530 Subject: [PATCH 31/95] fix: add revaluation journal filter in Payable report (cherry picked from commit 134201794ace2863c02458b3e1797da816802d06) --- erpnext/accounts/report/accounts_payable/accounts_payable.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/erpnext/accounts/report/accounts_payable/accounts_payable.js b/erpnext/accounts/report/accounts_payable/accounts_payable.js index eff705dafac3..0979cffbf3cb 100644 --- a/erpnext/accounts/report/accounts_payable/accounts_payable.js +++ b/erpnext/accounts/report/accounts_payable/accounts_payable.js @@ -144,6 +144,11 @@ frappe.query_reports["Accounts Payable"] = { "label": __("Show Future Payments"), "fieldtype": "Check", }, + { + "fieldname": "for_revaluation_journals", + "label": __("Revaluation Journals"), + "fieldtype": "Check", + }, { "fieldname": "ignore_accounts", "label": __("Group by Voucher"), From 236a064cd3ed23b3b4d9e779664e525710304b23 Mon Sep 17 00:00:00 2001 From: Frappe PR Bot Date: Fri, 17 Nov 2023 04:38:02 +0000 Subject: [PATCH 32/95] chore(release): Bumped to Version 14.48.1 ## [14.48.1](https://github.com/frappe/erpnext/compare/v14.48.0...v14.48.1) (2023-11-17) ### Bug Fixes * add revaluation journal filter in Payable report ([4eb37cc](https://github.com/frappe/erpnext/commit/4eb37cce268464c8fe0de69482e53e9bc06c6753)) --- erpnext/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/__init__.py b/erpnext/__init__.py index 8f3a0399e238..34711be40020 100644 --- a/erpnext/__init__.py +++ b/erpnext/__init__.py @@ -3,7 +3,7 @@ import frappe -__version__ = "14.48.0" +__version__ = "14.48.1" def get_default_company(user=None): From dd76695d3a263f75ae39808a62f14f32afab6f34 Mon Sep 17 00:00:00 2001 From: Gursheen Anand Date: Fri, 17 Nov 2023 12:50:08 +0530 Subject: [PATCH 33/95] fix: show party values when naming by is not naming series --- .../report/tds_payable_monthly/tds_payable_monthly.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/erpnext/accounts/report/tds_payable_monthly/tds_payable_monthly.py b/erpnext/accounts/report/tds_payable_monthly/tds_payable_monthly.py index f2ec31c70e10..b29a386ae339 100644 --- a/erpnext/accounts/report/tds_payable_monthly/tds_payable_monthly.py +++ b/erpnext/accounts/report/tds_payable_monthly/tds_payable_monthly.py @@ -176,6 +176,16 @@ def get_columns(filters): "width": 180, } ) + else: + columns.append( + { + "label": _(filters.get("party_type")), + "fieldname": "party", + "fieldtype": "Dynamic Link", + "options": "party_type", + "width": 180, + } + ) columns.extend( [ From 785bec98d3a590d7dd68d21c8d3cd742f4339fad Mon Sep 17 00:00:00 2001 From: ruthra kumar Date: Thu, 9 Nov 2023 15:26:52 +0530 Subject: [PATCH 34/95] chore: remove 'Bulk Transaction Log' doctype (cherry picked from commit 815c616f18ae1cd6ec1dbd315fa5f0376edef523) --- .../doctype/bulk_transaction_log/__init__.py | 0 .../bulk_transaction_log.js | 30 ------- .../bulk_transaction_log.json | 51 ------------ .../bulk_transaction_log.py | 67 ---------------- .../test_bulk_transaction_log.py | 79 ------------------- 5 files changed, 227 deletions(-) delete mode 100644 erpnext/bulk_transaction/doctype/bulk_transaction_log/__init__.py delete mode 100644 erpnext/bulk_transaction/doctype/bulk_transaction_log/bulk_transaction_log.js delete mode 100644 erpnext/bulk_transaction/doctype/bulk_transaction_log/bulk_transaction_log.json delete mode 100644 erpnext/bulk_transaction/doctype/bulk_transaction_log/bulk_transaction_log.py delete mode 100644 erpnext/bulk_transaction/doctype/bulk_transaction_log/test_bulk_transaction_log.py diff --git a/erpnext/bulk_transaction/doctype/bulk_transaction_log/__init__.py b/erpnext/bulk_transaction/doctype/bulk_transaction_log/__init__.py deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/erpnext/bulk_transaction/doctype/bulk_transaction_log/bulk_transaction_log.js b/erpnext/bulk_transaction/doctype/bulk_transaction_log/bulk_transaction_log.js deleted file mode 100644 index 0073170a855a..000000000000 --- a/erpnext/bulk_transaction/doctype/bulk_transaction_log/bulk_transaction_log.js +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) 2021, Frappe Technologies Pvt. Ltd. and contributors -// For license information, please see license.txt - -frappe.ui.form.on('Bulk Transaction Log', { - - refresh: function(frm) { - frm.disable_save(); - frm.add_custom_button(__('Retry Failed Transactions'), ()=>{ - frappe.confirm(__("Retry Failing Transactions ?"), ()=>{ - query(frm, 1); - } - ); - }); - } -}); - -function query(frm) { - frappe.call({ - method: "erpnext.bulk_transaction.doctype.bulk_transaction_log.bulk_transaction_log.retry_failing_transaction", - args: { - log_date: frm.doc.log_date - } - }).then((r) => { - if (r.message === "No Failed Records") { - frappe.show_alert(__(r.message), 5); - } else { - frappe.show_alert(__("Retrying Failed Transactions"), 5); - } - }); -} \ No newline at end of file diff --git a/erpnext/bulk_transaction/doctype/bulk_transaction_log/bulk_transaction_log.json b/erpnext/bulk_transaction/doctype/bulk_transaction_log/bulk_transaction_log.json deleted file mode 100644 index da42cf1bd4bd..000000000000 --- a/erpnext/bulk_transaction/doctype/bulk_transaction_log/bulk_transaction_log.json +++ /dev/null @@ -1,51 +0,0 @@ -{ - "actions": [], - "allow_rename": 1, - "creation": "2021-11-30 13:41:16.343827", - "doctype": "DocType", - "editable_grid": 1, - "engine": "InnoDB", - "field_order": [ - "log_date", - "logger_data" - ], - "fields": [ - { - "fieldname": "log_date", - "fieldtype": "Date", - "label": "Log Date", - "read_only": 1 - }, - { - "fieldname": "logger_data", - "fieldtype": "Table", - "label": "Logger Data", - "options": "Bulk Transaction Log Detail" - } - ], - "index_web_pages_for_search": 1, - "links": [], - "modified": "2022-02-03 17:23:02.935325", - "modified_by": "Administrator", - "module": "Bulk Transaction", - "name": "Bulk Transaction Log", - "owner": "Administrator", - "permissions": [ - { - "create": 1, - "delete": 1, - "email": 1, - "export": 1, - "print": 1, - "read": 1, - "report": 1, - "role": "System Manager", - "share": 1, - "write": 1 - } - ], - "sort_field": "modified", - "sort_order": "DESC", - "states": [], - "track_changes": 1 -} \ No newline at end of file diff --git a/erpnext/bulk_transaction/doctype/bulk_transaction_log/bulk_transaction_log.py b/erpnext/bulk_transaction/doctype/bulk_transaction_log/bulk_transaction_log.py deleted file mode 100644 index 0596be4462a2..000000000000 --- a/erpnext/bulk_transaction/doctype/bulk_transaction_log/bulk_transaction_log.py +++ /dev/null @@ -1,67 +0,0 @@ -# Copyright (c) 2021, Frappe Technologies Pvt. Ltd. and contributors -# For license information, please see license.txt - -from datetime import date - -import frappe -from frappe.model.document import Document - -from erpnext.utilities.bulk_transaction import task, update_logger - - -class BulkTransactionLog(Document): - pass - - -@frappe.whitelist() -def retry_failing_transaction(log_date=None): - if not log_date: - log_date = str(date.today()) - btp = frappe.qb.DocType("Bulk Transaction Log Detail") - data = ( - frappe.qb.from_(btp) - .select(btp.transaction_name, btp.from_doctype, btp.to_doctype) - .distinct() - .where(btp.retried != 1) - .where(btp.transaction_status == "Failed") - .where(btp.date == log_date) - ).run(as_dict=True) - - if data: - if len(data) > 10: - frappe.enqueue(job, queue="long", job_name="bulk_retry", data=data, log_date=log_date) - else: - job(data, log_date) - else: - return "No Failed Records" - - -def job(data, log_date): - for d in data: - failed = [] - try: - frappe.db.savepoint("before_creation_of_record") - task(d.transaction_name, d.from_doctype, d.to_doctype) - except Exception as e: - frappe.db.rollback(save_point="before_creation_of_record") - failed.append(e) - update_logger( - d.transaction_name, - e, - d.from_doctype, - d.to_doctype, - status="Failed", - log_date=log_date, - restarted=1, - ) - - if not failed: - update_logger( - d.transaction_name, - None, - d.from_doctype, - d.to_doctype, - status="Success", - log_date=log_date, - restarted=1, - ) diff --git a/erpnext/bulk_transaction/doctype/bulk_transaction_log/test_bulk_transaction_log.py b/erpnext/bulk_transaction/doctype/bulk_transaction_log/test_bulk_transaction_log.py deleted file mode 100644 index c673be89b3f6..000000000000 --- a/erpnext/bulk_transaction/doctype/bulk_transaction_log/test_bulk_transaction_log.py +++ /dev/null @@ -1,79 +0,0 @@ -# Copyright (c) 2021, Frappe Technologies Pvt. Ltd. and Contributors -# See license.txt - -import unittest -from datetime import date - -import frappe - -from erpnext.utilities.bulk_transaction import transaction_processing - - -class TestBulkTransactionLog(unittest.TestCase): - def setUp(self): - create_company() - create_customer() - create_item() - - def test_entry_in_log(self): - so_name = create_so() - transaction_processing([{"name": so_name}], "Sales Order", "Sales Invoice") - doc = frappe.get_doc("Bulk Transaction Log", str(date.today())) - for d in doc.get("logger_data"): - if d.transaction_name == so_name: - self.assertEqual(d.transaction_name, so_name) - self.assertEqual(d.transaction_status, "Success") - self.assertEqual(d.from_doctype, "Sales Order") - self.assertEqual(d.to_doctype, "Sales Invoice") - self.assertEqual(d.retried, 0) - - -def create_company(): - if not frappe.db.exists("Company", "_Test Company"): - frappe.get_doc( - { - "doctype": "Company", - "company_name": "_Test Company", - "country": "India", - "default_currency": "INR", - } - ).insert() - - -def create_customer(): - if not frappe.db.exists("Customer", "Bulk Customer"): - frappe.get_doc({"doctype": "Customer", "customer_name": "Bulk Customer"}).insert() - - -def create_item(): - if not frappe.db.exists("Item", "MK"): - frappe.get_doc( - { - "doctype": "Item", - "item_code": "MK", - "item_name": "Milk", - "description": "Milk", - "item_group": "Products", - } - ).insert() - - -def create_so(intent=None): - so = frappe.new_doc("Sales Order") - so.customer = "Bulk Customer" - so.company = "_Test Company" - so.transaction_date = date.today() - - so.set_warehouse = "Finished Goods - _TC" - so.append( - "items", - { - "item_code": "MK", - "delivery_date": date.today(), - "qty": 10, - "rate": 80, - }, - ) - so.insert() - so.submit() - return so.name From 65614497ed42602b6d7a77c99241c81529377adf Mon Sep 17 00:00:00 2001 From: ruthra kumar Date: Thu, 9 Nov 2023 15:29:57 +0530 Subject: [PATCH 35/95] chore: convert child to normal table (cherry picked from commit e5a8ad54e26d74b5713e7db057860c1262c1b93b) --- .../bulk_transaction_log_detail.js | 8 ++++++++ .../bulk_transaction_log_detail.json | 18 +++++++++++++++--- .../test_bulk_transaction_log_detail.py | 9 +++++++++ 3 files changed, 32 insertions(+), 3 deletions(-) create mode 100644 erpnext/bulk_transaction/doctype/bulk_transaction_log_detail/bulk_transaction_log_detail.js create mode 100644 erpnext/bulk_transaction/doctype/bulk_transaction_log_detail/test_bulk_transaction_log_detail.py diff --git a/erpnext/bulk_transaction/doctype/bulk_transaction_log_detail/bulk_transaction_log_detail.js b/erpnext/bulk_transaction/doctype/bulk_transaction_log_detail/bulk_transaction_log_detail.js new file mode 100644 index 000000000000..5669601d1168 --- /dev/null +++ b/erpnext/bulk_transaction/doctype/bulk_transaction_log_detail/bulk_transaction_log_detail.js @@ -0,0 +1,8 @@ +// Copyright (c) 2023, Frappe Technologies Pvt. Ltd. and contributors +// For license information, please see license.txt + +// frappe.ui.form.on("Bulk Transaction Log Detail", { +// refresh(frm) { + +// }, +// }); diff --git a/erpnext/bulk_transaction/doctype/bulk_transaction_log_detail/bulk_transaction_log_detail.json b/erpnext/bulk_transaction/doctype/bulk_transaction_log_detail/bulk_transaction_log_detail.json index 8262caa0209a..64518de4c077 100644 --- a/erpnext/bulk_transaction/doctype/bulk_transaction_log_detail/bulk_transaction_log_detail.json +++ b/erpnext/bulk_transaction/doctype/bulk_transaction_log_detail/bulk_transaction_log_detail.json @@ -71,14 +71,26 @@ } ], "index_web_pages_for_search": 1, - "istable": 1, "links": [], - "modified": "2022-02-03 19:57:31.650359", + "modified": "2023-11-09 15:29:33.013547", "modified_by": "Administrator", "module": "Bulk Transaction", "name": "Bulk Transaction Log Detail", "owner": "Administrator", - "permissions": [], + "permissions": [ + { + "create": 1, + "delete": 1, + "email": 1, + "export": 1, + "print": 1, + "read": 1, + "report": 1, + "role": "System Manager", + "share": 1, + "write": 1 + } + ], "sort_field": "modified", "sort_order": "DESC", "states": [], diff --git a/erpnext/bulk_transaction/doctype/bulk_transaction_log_detail/test_bulk_transaction_log_detail.py b/erpnext/bulk_transaction/doctype/bulk_transaction_log_detail/test_bulk_transaction_log_detail.py new file mode 100644 index 000000000000..5217b601f875 --- /dev/null +++ b/erpnext/bulk_transaction/doctype/bulk_transaction_log_detail/test_bulk_transaction_log_detail.py @@ -0,0 +1,9 @@ +# Copyright (c) 2023, Frappe Technologies Pvt. Ltd. and Contributors +# See license.txt + +# import frappe +from frappe.tests.utils import FrappeTestCase + + +class TestBulkTransactionLogDetail(FrappeTestCase): + pass From 6d983b5f458f3eefe29970c5b11eca29ca910e10 Mon Sep 17 00:00:00 2001 From: ruthra kumar Date: Thu, 9 Nov 2023 16:07:45 +0530 Subject: [PATCH 36/95] chore: rearrange fields (cherry picked from commit c4f8f3613f1173a54b17e3c6ca8ea52469f32e3b) --- .../bulk_transaction_log_detail.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/erpnext/bulk_transaction/doctype/bulk_transaction_log_detail/bulk_transaction_log_detail.json b/erpnext/bulk_transaction/doctype/bulk_transaction_log_detail/bulk_transaction_log_detail.json index 64518de4c077..051dc0af02dc 100644 --- a/erpnext/bulk_transaction/doctype/bulk_transaction_log_detail/bulk_transaction_log_detail.json +++ b/erpnext/bulk_transaction/doctype/bulk_transaction_log_detail/bulk_transaction_log_detail.json @@ -6,12 +6,12 @@ "editable_grid": 1, "engine": "InnoDB", "field_order": [ + "from_doctype", "transaction_name", "date", "time", "transaction_status", "error_description", - "from_doctype", "to_doctype", "retried" ], @@ -72,7 +72,7 @@ ], "index_web_pages_for_search": 1, "links": [], - "modified": "2023-11-09 15:29:33.013547", + "modified": "2023-11-09 15:33:26.828998", "modified_by": "Administrator", "module": "Bulk Transaction", "name": "Bulk Transaction Log Detail", From eda9800c936f5eab3eed7a98e481b23be1ec2ad5 Mon Sep 17 00:00:00 2001 From: ruthra kumar Date: Thu, 9 Nov 2023 16:38:34 +0530 Subject: [PATCH 37/95] refactor: simplify logging logic bulk_transaction (cherry picked from commit ebd74a4e5b68534a4ceab2482618e16643f220d1) --- erpnext/utilities/bulk_transaction.py | 74 +++++---------------------- 1 file changed, 14 insertions(+), 60 deletions(-) diff --git a/erpnext/utilities/bulk_transaction.py b/erpnext/utilities/bulk_transaction.py index fcee26564458..fd8e7226485f 100644 --- a/erpnext/utilities/bulk_transaction.py +++ b/erpnext/utilities/bulk_transaction.py @@ -3,6 +3,7 @@ import frappe from frappe import _ +from frappe.utils import today @frappe.whitelist() @@ -38,7 +39,7 @@ def job(deserialized_data, from_doctype, to_doctype): except Exception as e: frappe.db.rollback(save_point="before_creation_state") fail_count += 1 - update_logger( + create_log( doc_name, str(frappe.get_traceback()), from_doctype, @@ -47,7 +48,7 @@ def job(deserialized_data, from_doctype, to_doctype): log_date=str(date.today()), ) else: - update_logger( + create_log( doc_name, None, from_doctype, to_doctype, status="Success", log_date=str(date.today()) ) @@ -108,45 +109,18 @@ def task(doc_name, from_doctype, to_doctype): obj.insert(ignore_mandatory=True) -def check_logger_doc_exists(log_date): - return frappe.db.exists("Bulk Transaction Log", log_date) - - -def get_logger_doc(log_date): - return frappe.get_doc("Bulk Transaction Log", log_date) - - -def create_logger_doc(): - log_doc = frappe.new_doc("Bulk Transaction Log") - log_doc.set_new_name(set_name=str(date.today())) - log_doc.log_date = date.today() - - return log_doc - - -def append_data_to_logger(log_doc, doc_name, error, from_doctype, to_doctype, status, restarted): - row = log_doc.append("logger_data", {}) - row.transaction_name = doc_name - row.date = date.today() +def create_log(doc_name, e, from_doctype, to_doctype, status, log_date=None, restarted=0): + transaction_log = frappe.new_doc("Bulk Transaction Log Detail") + transaction_log.transaction_name = doc_name + transaction_log.date = today() now = datetime.now() - row.time = now.strftime("%H:%M:%S") - row.transaction_status = status - row.error_description = str(error) - row.from_doctype = from_doctype - row.to_doctype = to_doctype - row.retried = restarted - - -def update_logger(doc_name, e, from_doctype, to_doctype, status, log_date=None, restarted=0): - if not check_logger_doc_exists(log_date): - log_doc = create_logger_doc() - append_data_to_logger(log_doc, doc_name, e, from_doctype, to_doctype, status, restarted) - log_doc.insert() - else: - log_doc = get_logger_doc(log_date) - if record_exists(log_doc, doc_name, status): - append_data_to_logger(log_doc, doc_name, e, from_doctype, to_doctype, status, restarted) - log_doc.save() + transaction_log.time = now.strftime("%H:%M:%S") + transaction_log.transaction_status = status + transaction_log.error_description = str(e) + transaction_log.from_doctype = from_doctype + transaction_log.to_doctype = to_doctype + transaction_log.retried = restarted + transaction_log.save() def show_job_status(fail_count, deserialized_data_count, to_doctype): @@ -176,23 +150,3 @@ def show_job_status(fail_count, deserialized_data_count, to_doctype): title="Failed", indicator="red", ) - - -def record_exists(log_doc, doc_name, status): - record = mark_retrired_transaction(log_doc, doc_name) - if record and status == "Failed": - return False - elif record and status == "Success": - return True - else: - return True - - -def mark_retrired_transaction(log_doc, doc_name): - record = 0 - for d in log_doc.get("logger_data"): - if d.transaction_name == doc_name and d.transaction_status == "Failed": - frappe.db.set_value("Bulk Transaction Log Detail", d.name, "retried", 1) - record = record + 1 - - return record From 8dafe103bd081e75ea3f43a857cdc808c0f46872 Mon Sep 17 00:00:00 2001 From: ruthra kumar Date: Thu, 9 Nov 2023 17:16:58 +0530 Subject: [PATCH 38/95] chore: add list view filters (cherry picked from commit ade09bc709ab8bca047abdad5235461a4618bc17) --- .../bulk_transaction_log_detail.json | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/erpnext/bulk_transaction/doctype/bulk_transaction_log_detail/bulk_transaction_log_detail.json b/erpnext/bulk_transaction/doctype/bulk_transaction_log_detail/bulk_transaction_log_detail.json index 051dc0af02dc..3a5d434a0439 100644 --- a/erpnext/bulk_transaction/doctype/bulk_transaction_log_detail/bulk_transaction_log_detail.json +++ b/erpnext/bulk_transaction/doctype/bulk_transaction_log_detail/bulk_transaction_log_detail.json @@ -20,6 +20,7 @@ "fieldname": "transaction_name", "fieldtype": "Dynamic Link", "in_list_view": 1, + "in_standard_filter": 1, "label": "Name", "options": "from_doctype" }, @@ -39,6 +40,7 @@ { "fieldname": "from_doctype", "fieldtype": "Link", + "in_standard_filter": 1, "label": "From Doctype", "options": "DocType", "read_only": 1 @@ -54,6 +56,7 @@ "fieldname": "date", "fieldtype": "Date", "in_list_view": 1, + "in_standard_filter": 1, "label": "Date ", "read_only": 1 }, @@ -70,9 +73,10 @@ "read_only": 1 } ], + "in_create": 1, "index_web_pages_for_search": 1, "links": [], - "modified": "2023-11-09 15:33:26.828998", + "modified": "2023-11-09 16:55:31.026064", "modified_by": "Administrator", "module": "Bulk Transaction", "name": "Bulk Transaction Log Detail", From 863a2009897d5b2ee072e998dbca71ae0fed9dc7 Mon Sep 17 00:00:00 2001 From: ruthra kumar Date: Thu, 9 Nov 2023 17:40:04 +0530 Subject: [PATCH 39/95] chore: add indexes (cherry picked from commit 73090fa1306fd65ff8e290d57486697af5722081) --- .../bulk_transaction_log_detail.json | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/erpnext/bulk_transaction/doctype/bulk_transaction_log_detail/bulk_transaction_log_detail.json b/erpnext/bulk_transaction/doctype/bulk_transaction_log_detail/bulk_transaction_log_detail.json index 3a5d434a0439..fe1a6d9b5655 100644 --- a/erpnext/bulk_transaction/doctype/bulk_transaction_log_detail/bulk_transaction_log_detail.json +++ b/erpnext/bulk_transaction/doctype/bulk_transaction_log_detail/bulk_transaction_log_detail.json @@ -22,7 +22,8 @@ "in_list_view": 1, "in_standard_filter": 1, "label": "Name", - "options": "from_doctype" + "options": "from_doctype", + "search_index": 1 }, { "fieldname": "transaction_status", @@ -43,7 +44,8 @@ "in_standard_filter": 1, "label": "From Doctype", "options": "DocType", - "read_only": 1 + "read_only": 1, + "search_index": 1 }, { "fieldname": "to_doctype", @@ -58,7 +60,8 @@ "in_list_view": 1, "in_standard_filter": 1, "label": "Date ", - "read_only": 1 + "read_only": 1, + "search_index": 1 }, { "fieldname": "time", @@ -76,7 +79,7 @@ "in_create": 1, "index_web_pages_for_search": 1, "links": [], - "modified": "2023-11-09 16:55:31.026064", + "modified": "2023-11-09 17:44:14.804836", "modified_by": "Administrator", "module": "Bulk Transaction", "name": "Bulk Transaction Log Detail", @@ -99,4 +102,4 @@ "sort_order": "DESC", "states": [], "track_changes": 1 -} \ No newline at end of file +} From b951dbfced94b2399deaad95178e66600b5fa0cc Mon Sep 17 00:00:00 2001 From: ruthra kumar Date: Thu, 9 Nov 2023 17:43:04 +0530 Subject: [PATCH 40/95] chore: make `from_doctype` readonly (cherry picked from commit b0dfc936a10aef4dfd743959a6cf5e47ea69632e) --- .../bulk_transaction_log_detail/bulk_transaction_log_detail.json | 1 + 1 file changed, 1 insertion(+) diff --git a/erpnext/bulk_transaction/doctype/bulk_transaction_log_detail/bulk_transaction_log_detail.json b/erpnext/bulk_transaction/doctype/bulk_transaction_log_detail/bulk_transaction_log_detail.json index fe1a6d9b5655..5491f56a1a55 100644 --- a/erpnext/bulk_transaction/doctype/bulk_transaction_log_detail/bulk_transaction_log_detail.json +++ b/erpnext/bulk_transaction/doctype/bulk_transaction_log_detail/bulk_transaction_log_detail.json @@ -23,6 +23,7 @@ "in_standard_filter": 1, "label": "Name", "options": "from_doctype", + "read_only": 1, "search_index": 1 }, { From 8dbf2ced797ff8fb9a9ed5ffbbbbdcb4968ef4e7 Mon Sep 17 00:00:00 2001 From: ruthra kumar Date: Thu, 9 Nov 2023 20:15:33 +0530 Subject: [PATCH 41/95] feat: virtual parent doctype (cherry picked from commit a248b13cc353fcd94b0009c74c24512ea629a376) --- .../doctype/bulk_transaction_log/__init__.py | 0 .../bulk_transaction_log.js | 8 ++ .../bulk_transaction_log.json | 80 +++++++++++++++++++ .../bulk_transaction_log.py | 28 +++++++ .../test_bulk_transaction_log.py | 9 +++ 5 files changed, 125 insertions(+) create mode 100644 erpnext/bulk_transaction/doctype/bulk_transaction_log/__init__.py create mode 100644 erpnext/bulk_transaction/doctype/bulk_transaction_log/bulk_transaction_log.js create mode 100644 erpnext/bulk_transaction/doctype/bulk_transaction_log/bulk_transaction_log.json create mode 100644 erpnext/bulk_transaction/doctype/bulk_transaction_log/bulk_transaction_log.py create mode 100644 erpnext/bulk_transaction/doctype/bulk_transaction_log/test_bulk_transaction_log.py diff --git a/erpnext/bulk_transaction/doctype/bulk_transaction_log/__init__.py b/erpnext/bulk_transaction/doctype/bulk_transaction_log/__init__.py new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/erpnext/bulk_transaction/doctype/bulk_transaction_log/bulk_transaction_log.js b/erpnext/bulk_transaction/doctype/bulk_transaction_log/bulk_transaction_log.js new file mode 100644 index 000000000000..07a8009816c1 --- /dev/null +++ b/erpnext/bulk_transaction/doctype/bulk_transaction_log/bulk_transaction_log.js @@ -0,0 +1,8 @@ +// Copyright (c) 2023, Frappe Technologies Pvt. Ltd. and contributors +// For license information, please see license.txt + +// frappe.ui.form.on("Bulk Transaction Log", { +// refresh(frm) { + +// }, +// }); diff --git a/erpnext/bulk_transaction/doctype/bulk_transaction_log/bulk_transaction_log.json b/erpnext/bulk_transaction/doctype/bulk_transaction_log/bulk_transaction_log.json new file mode 100644 index 000000000000..a874b791ca4f --- /dev/null +++ b/erpnext/bulk_transaction/doctype/bulk_transaction_log/bulk_transaction_log.json @@ -0,0 +1,80 @@ +{ + "actions": [], + "allow_copy": 1, + "creation": "2023-11-09 20:14:45.139593", + "doctype": "DocType", + "engine": "InnoDB", + "field_order": [ + "date", + "column_break_bsan", + "log_entries", + "section_break_mdmv", + "succeeded", + "column_break_qryp", + "failed" + ], + "fields": [ + { + "fieldname": "date", + "fieldtype": "Date", + "label": "Date", + "read_only": 1 + }, + { + "fieldname": "log_entries", + "fieldtype": "Int", + "in_list_view": 1, + "label": "Log Entries", + "read_only": 1 + }, + { + "fieldname": "column_break_bsan", + "fieldtype": "Column Break" + }, + { + "fieldname": "section_break_mdmv", + "fieldtype": "Section Break" + }, + { + "fieldname": "succeeded", + "fieldtype": "Int", + "label": "Succeeded", + "read_only": 1 + }, + { + "fieldname": "column_break_qryp", + "fieldtype": "Column Break" + }, + { + "fieldname": "failed", + "fieldtype": "Int", + "label": "Failed", + "read_only": 1 + } + ], + "in_create": 1, + "is_virtual": 1, + "links": [], + "modified": "2023-11-10 11:13:52.733076", + "modified_by": "Administrator", + "module": "Bulk Transaction", + "name": "Bulk Transaction Log", + "owner": "Administrator", + "permissions": [ + { + "create": 1, + "delete": 1, + "email": 1, + "export": 1, + "print": 1, + "read": 1, + "report": 1, + "role": "System Manager", + "share": 1, + "write": 1 + } + ], + "sort_field": "modified", + "sort_order": "DESC", + "states": [] +} \ No newline at end of file diff --git a/erpnext/bulk_transaction/doctype/bulk_transaction_log/bulk_transaction_log.py b/erpnext/bulk_transaction/doctype/bulk_transaction_log/bulk_transaction_log.py new file mode 100644 index 000000000000..fb9fcf7c525f --- /dev/null +++ b/erpnext/bulk_transaction/doctype/bulk_transaction_log/bulk_transaction_log.py @@ -0,0 +1,28 @@ +# Copyright (c) 2023, Frappe Technologies Pvt. Ltd. and contributors +# For license information, please see license.txt + +# import frappe +from frappe.model.document import Document + + +class BulkTransactionLog(Document): + def db_insert(self, *args, **kwargs): + pass + + def load_from_db(self): + pass + + def db_update(self): + pass + + @staticmethod + def get_list(args): + pass + + @staticmethod + def get_count(args): + pass + + @staticmethod + def get_stats(args): + pass diff --git a/erpnext/bulk_transaction/doctype/bulk_transaction_log/test_bulk_transaction_log.py b/erpnext/bulk_transaction/doctype/bulk_transaction_log/test_bulk_transaction_log.py new file mode 100644 index 000000000000..01bb615a3e11 --- /dev/null +++ b/erpnext/bulk_transaction/doctype/bulk_transaction_log/test_bulk_transaction_log.py @@ -0,0 +1,9 @@ +# Copyright (c) 2023, Frappe Technologies Pvt. Ltd. and Contributors +# See license.txt + +# import frappe +from frappe.tests.utils import FrappeTestCase + + +class TestBulkTransactionLog(FrappeTestCase): + pass From f5f48f7480cccf09c7f112d307f09098213a4a60 Mon Sep 17 00:00:00 2001 From: ruthra kumar Date: Thu, 9 Nov 2023 21:07:01 +0530 Subject: [PATCH 42/95] refactor: add basic functionalities (cherry picked from commit af35590549987ab84eadbf08c10f3837242203dc) --- .../bulk_transaction_log.js | 15 ++-- .../bulk_transaction_log.py | 71 +++++++++++++++++-- 2 files changed, 75 insertions(+), 11 deletions(-) diff --git a/erpnext/bulk_transaction/doctype/bulk_transaction_log/bulk_transaction_log.js b/erpnext/bulk_transaction/doctype/bulk_transaction_log/bulk_transaction_log.js index 07a8009816c1..218424becaf8 100644 --- a/erpnext/bulk_transaction/doctype/bulk_transaction_log/bulk_transaction_log.js +++ b/erpnext/bulk_transaction/doctype/bulk_transaction_log/bulk_transaction_log.js @@ -1,8 +1,13 @@ // Copyright (c) 2023, Frappe Technologies Pvt. Ltd. and contributors // For license information, please see license.txt -// frappe.ui.form.on("Bulk Transaction Log", { -// refresh(frm) { - -// }, -// }); +frappe.ui.form.on("Bulk Transaction Log", { + refresh(frm) { + frm.add_custom_button(__('Succeeded Entries'), function() { + frappe.set_route('List', 'Bulk Transaction Log Detail', {'date': frm.doc.date, 'transaction_status': "Success"}); + }, __("View")); + frm.add_custom_button(__('Failed Entries'), function() { + frappe.set_route('List', 'Bulk Transaction Log Detail', {'date': frm.doc.date, 'transaction_status': "Failed"}); + }, __("View")); + }, +}); diff --git a/erpnext/bulk_transaction/doctype/bulk_transaction_log/bulk_transaction_log.py b/erpnext/bulk_transaction/doctype/bulk_transaction_log/bulk_transaction_log.py index fb9fcf7c525f..4febb48a606c 100644 --- a/erpnext/bulk_transaction/doctype/bulk_transaction_log/bulk_transaction_log.py +++ b/erpnext/bulk_transaction/doctype/bulk_transaction_log/bulk_transaction_log.py @@ -1,8 +1,14 @@ # Copyright (c) 2023, Frappe Technologies Pvt. Ltd. and contributors # For license information, please see license.txt -# import frappe +import frappe +from frappe import qb from frappe.model.document import Document +from frappe.query_builder.functions import Count +from frappe.utils import cint +from pypika import Order + +log_detail = qb.DocType("Bulk Transaction Log Detail") class BulkTransactionLog(Document): @@ -10,14 +16,51 @@ def db_insert(self, *args, **kwargs): pass def load_from_db(self): - pass - - def db_update(self): - pass + succeeded_logs = ( + qb.from_(log_detail) + .select(Count(log_detail.date).as_("count")) + .where((log_detail.date == self.name) & (log_detail.transaction_status == "Success")) + .run() + )[0][0] or 0 + failed_logs = ( + qb.from_(log_detail) + .select(Count(log_detail.date).as_("count")) + .where((log_detail.date == self.name) & (log_detail.transaction_status == "Failed")) + .run() + )[0][0] or 0 + total_logs = succeeded_logs + failed_logs + transaction_log = frappe._dict( + { + "date": self.name, + "count": total_logs, + "succeeded": succeeded_logs, + "failed": failed_logs, + } + ) + super(Document, self).__init__(serialize_transaction_log(transaction_log)) @staticmethod def get_list(args): - pass + limit = cint(args.get("page_length")) or 20 + dates = ( + qb.from_(log_detail) + .select(log_detail.date) + .distinct() + .orderby(log_detail.date, order=Order.desc) + .limit(limit) + .run() + ) + + transaction_logs = ( + qb.from_(log_detail) + .select(log_detail.date.as_("date"), Count(log_detail.date).as_("count")) + .where(log_detail.date.isin(dates)) + .orderby(log_detail.date, order=Order.desc) + .groupby(log_detail.date) + .limit(limit) + .run(as_dict=True) + ) + return [serialize_transaction_log(x) for x in transaction_logs] @staticmethod def get_count(args): @@ -26,3 +69,19 @@ def get_count(args): @staticmethod def get_stats(args): pass + + def db_update(self, *args, **kwargs): + pass + + def delete(self): + pass + + +def serialize_transaction_log(data): + return frappe._dict( + name=data.date, + date=data.date, + log_entries=data.count, + succeeded=data.succeeded, + failed=data.failed, + ) From 2ec1a2f86279b608abbebffe84a4a73367275a78 Mon Sep 17 00:00:00 2001 From: ruthra kumar Date: Fri, 10 Nov 2023 11:44:25 +0530 Subject: [PATCH 43/95] chore: show retried in list view (cherry picked from commit 194d70f8a0c93c8e2952cd58cdc5d994414198fb) --- .../bulk_transaction_log_detail.json | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/erpnext/bulk_transaction/doctype/bulk_transaction_log_detail/bulk_transaction_log_detail.json b/erpnext/bulk_transaction/doctype/bulk_transaction_log_detail/bulk_transaction_log_detail.json index 5491f56a1a55..9590325a06c1 100644 --- a/erpnext/bulk_transaction/doctype/bulk_transaction_log_detail/bulk_transaction_log_detail.json +++ b/erpnext/bulk_transaction/doctype/bulk_transaction_log_detail/bulk_transaction_log_detail.json @@ -73,6 +73,7 @@ { "fieldname": "retried", "fieldtype": "Int", + "in_list_view": 1, "label": "Retried", "read_only": 1 } @@ -80,7 +81,7 @@ "in_create": 1, "index_web_pages_for_search": 1, "links": [], - "modified": "2023-11-09 17:44:14.804836", + "modified": "2023-11-10 11:44:10.758342", "modified_by": "Administrator", "module": "Bulk Transaction", "name": "Bulk Transaction Log Detail", @@ -103,4 +104,4 @@ "sort_order": "DESC", "states": [], "track_changes": 1 -} +} \ No newline at end of file From ad03008a1a2475b4356c416cf77396121ebadab7 Mon Sep 17 00:00:00 2001 From: ruthra kumar Date: Fri, 10 Nov 2023 12:20:30 +0530 Subject: [PATCH 44/95] refactor: barebones retry functionality (cherry picked from commit 0aa1636d04bed9fef260aedde4ed6a42b6a1968b) --- .../bulk_transaction_log.js | 8 ++++++ erpnext/utilities/bulk_transaction.py | 28 +++++++++++++++++++ 2 files changed, 36 insertions(+) diff --git a/erpnext/bulk_transaction/doctype/bulk_transaction_log/bulk_transaction_log.js b/erpnext/bulk_transaction/doctype/bulk_transaction_log/bulk_transaction_log.js index 218424becaf8..6e2250052ddb 100644 --- a/erpnext/bulk_transaction/doctype/bulk_transaction_log/bulk_transaction_log.js +++ b/erpnext/bulk_transaction/doctype/bulk_transaction_log/bulk_transaction_log.js @@ -9,5 +9,13 @@ frappe.ui.form.on("Bulk Transaction Log", { frm.add_custom_button(__('Failed Entries'), function() { frappe.set_route('List', 'Bulk Transaction Log Detail', {'date': frm.doc.date, 'transaction_status': "Failed"}); }, __("View")); + if (frm.doc.failed) { + frm.add_custom_button(__('Retry Failed Transactions'), function() { + frappe.call({ + method: "erpnext.utilities.bulk_transaction.retry_failed_transactions", + args: {date: frm.doc.date} + }).then(()=> { }); + }); + } }, }); diff --git a/erpnext/utilities/bulk_transaction.py b/erpnext/utilities/bulk_transaction.py index fd8e7226485f..a59600158376 100644 --- a/erpnext/utilities/bulk_transaction.py +++ b/erpnext/utilities/bulk_transaction.py @@ -29,6 +29,34 @@ def transaction_processing(data, from_doctype, to_doctype): job(deserialized_data, from_doctype, to_doctype) +@frappe.whitelist() +def retry_failed_transactions(date: str | None): + if date: + failed_docs = frappe.db.get_all( + "Bulk Transaction Log Detail", + filters={"date": date, "transaction_status": "Failed", "retried": 0}, + fields=["name", "transaction_name", "from_doctype", "to_doctype"], + ) + if not failed_docs: + frappe.msgprint("There are no Failed transactions") + return + + for log in failed_docs: + try: + frappe.db.savepoint("before_creation_state") + task(log.transaction_name, log.from_doctype, log.to_doctype) + except Exception as e: + frappe.db.rollback(save_point="before_creation_state") + update_log(log.name, "Failed", 1) + else: + update_log(log.name, "Success", 1) + + +def update_log(log_name, status, retried): + frappe.db.set_value("Bulk Transaction Log Detail", log_name, "transaction_status", status) + frappe.db.set_value("Bulk Transaction Log Detail", log_name, "retried", retried) + + def job(deserialized_data, from_doctype, to_doctype): fail_count = 0 for d in deserialized_data: From 32b6eed69164b3e17bbc65ee7cb86407ecd47f99 Mon Sep 17 00:00:00 2001 From: ruthra kumar Date: Fri, 10 Nov 2023 13:45:52 +0530 Subject: [PATCH 45/95] refactor: rollback for retries and UI alerts (cherry picked from commit c3202886901eaecc0ab8b9bf73d8816994e6dc1f) --- .../bulk_transaction_log.js | 2 +- erpnext/utilities/bulk_transaction.py | 20 +++++++++++++++---- 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/erpnext/bulk_transaction/doctype/bulk_transaction_log/bulk_transaction_log.js b/erpnext/bulk_transaction/doctype/bulk_transaction_log/bulk_transaction_log.js index 6e2250052ddb..3135d41cc18b 100644 --- a/erpnext/bulk_transaction/doctype/bulk_transaction_log/bulk_transaction_log.js +++ b/erpnext/bulk_transaction/doctype/bulk_transaction_log/bulk_transaction_log.js @@ -12,7 +12,7 @@ frappe.ui.form.on("Bulk Transaction Log", { if (frm.doc.failed) { frm.add_custom_button(__('Retry Failed Transactions'), function() { frappe.call({ - method: "erpnext.utilities.bulk_transaction.retry_failed_transactions", + method: "erpnext.utilities.bulk_transaction.retry", args: {date: frm.doc.date} }).then(()=> { }); }); diff --git a/erpnext/utilities/bulk_transaction.py b/erpnext/utilities/bulk_transaction.py index a59600158376..7e73c2fe0b0c 100644 --- a/erpnext/utilities/bulk_transaction.py +++ b/erpnext/utilities/bulk_transaction.py @@ -3,7 +3,7 @@ import frappe from frappe import _ -from frappe.utils import today +from frappe.utils import get_link_to_form, today @frappe.whitelist() @@ -30,7 +30,7 @@ def transaction_processing(data, from_doctype, to_doctype): @frappe.whitelist() -def retry_failed_transactions(date: str | None): +def retry(date: str | None): if date: failed_docs = frappe.db.get_all( "Bulk Transaction Log Detail", @@ -38,9 +38,21 @@ def retry_failed_transactions(date: str | None): fields=["name", "transaction_name", "from_doctype", "to_doctype"], ) if not failed_docs: - frappe.msgprint("There are no Failed transactions") - return + frappe.msgprint(_("There are no Failed transactions")) + else: + job = frappe.enqueue( + retry_failed_transactions, + failed_docs=failed_docs, + ) + frappe.msgprint( + _("Job: {0} has been triggered for processing failed transactions").format( + get_link_to_form("RQ Job", job.id) + ) + ) + +def retry_failed_transactions(failed_docs: list | None): + if failed_docs: for log in failed_docs: try: frappe.db.savepoint("before_creation_state") From b615cfc54060d239aff93fc16847047e7358e1a4 Mon Sep 17 00:00:00 2001 From: ruthra kumar Date: Fri, 10 Nov 2023 15:27:28 +0530 Subject: [PATCH 46/95] chore: resolve linting issue (cherry picked from commit 73639db9105260d0d1af3cea35caa03523f396e5) --- .../doctype/bulk_transaction_log/bulk_transaction_log.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/erpnext/bulk_transaction/doctype/bulk_transaction_log/bulk_transaction_log.py b/erpnext/bulk_transaction/doctype/bulk_transaction_log/bulk_transaction_log.py index 4febb48a606c..1a078b53d5fd 100644 --- a/erpnext/bulk_transaction/doctype/bulk_transaction_log/bulk_transaction_log.py +++ b/erpnext/bulk_transaction/doctype/bulk_transaction_log/bulk_transaction_log.py @@ -8,14 +8,13 @@ from frappe.utils import cint from pypika import Order -log_detail = qb.DocType("Bulk Transaction Log Detail") - class BulkTransactionLog(Document): def db_insert(self, *args, **kwargs): pass def load_from_db(self): + log_detail = qb.DocType("Bulk Transaction Log Detail") succeeded_logs = ( qb.from_(log_detail) .select(Count(log_detail.date).as_("count")) @@ -41,6 +40,7 @@ def load_from_db(self): @staticmethod def get_list(args): + log_detail = qb.DocType("Bulk Transaction Log Detail") limit = cint(args.get("page_length")) or 20 dates = ( qb.from_(log_detail) From a060000b700ff40d20dd4aa323735ce57689d70d Mon Sep 17 00:00:00 2001 From: ruthra kumar Date: Sat, 11 Nov 2023 05:10:16 +0530 Subject: [PATCH 47/95] refactor: support list view filters (cherry picked from commit 93295bf25b67069936e23d03f5a1c559294bc25f) --- .../bulk_transaction_log.json | 8 +++- .../bulk_transaction_log.py | 42 +++++++++++++------ 2 files changed, 36 insertions(+), 14 deletions(-) diff --git a/erpnext/bulk_transaction/doctype/bulk_transaction_log/bulk_transaction_log.json b/erpnext/bulk_transaction/doctype/bulk_transaction_log/bulk_transaction_log.json index a874b791ca4f..75cb358ff2fb 100644 --- a/erpnext/bulk_transaction/doctype/bulk_transaction_log/bulk_transaction_log.json +++ b/erpnext/bulk_transaction/doctype/bulk_transaction_log/bulk_transaction_log.json @@ -2,6 +2,7 @@ "actions": [], "allow_copy": 1, "creation": "2023-11-09 20:14:45.139593", + "default_view": "List", "doctype": "DocType", "engine": "InnoDB", "field_order": [ @@ -17,6 +18,8 @@ { "fieldname": "date", "fieldtype": "Date", + "in_list_view": 1, + "in_standard_filter": 1, "label": "Date", "read_only": 1 }, @@ -55,7 +58,7 @@ "in_create": 1, "is_virtual": 1, "links": [], - "modified": "2023-11-10 11:13:52.733076", + "modified": "2023-11-11 04:52:49.347376", "modified_by": "Administrator", "module": "Bulk Transaction", "name": "Bulk Transaction Log", @@ -76,5 +79,6 @@ ], "sort_field": "modified", "sort_order": "DESC", - "states": [] + "states": [], + "title_field": "date" } \ No newline at end of file diff --git a/erpnext/bulk_transaction/doctype/bulk_transaction_log/bulk_transaction_log.py b/erpnext/bulk_transaction/doctype/bulk_transaction_log/bulk_transaction_log.py index 1a078b53d5fd..8ae54ddab8b8 100644 --- a/erpnext/bulk_transaction/doctype/bulk_transaction_log/bulk_transaction_log.py +++ b/erpnext/bulk_transaction/doctype/bulk_transaction_log/bulk_transaction_log.py @@ -40,26 +40,33 @@ def load_from_db(self): @staticmethod def get_list(args): - log_detail = qb.DocType("Bulk Transaction Log Detail") + filter_date = parse_list_filters(args) limit = cint(args.get("page_length")) or 20 - dates = ( + log_detail = qb.DocType("Bulk Transaction Log Detail") + + dates_query = ( qb.from_(log_detail) .select(log_detail.date) .distinct() .orderby(log_detail.date, order=Order.desc) .limit(limit) - .run() ) + if filter_date: + dates_query = dates_query.where(log_detail.date == filter_date) + dates = dates_query.run() + + transaction_logs = [] + if dates: + transaction_logs_query = ( + qb.from_(log_detail) + .select(log_detail.date.as_("date"), Count(log_detail.date).as_("count")) + .where(log_detail.date.isin(dates)) + .orderby(log_detail.date, order=Order.desc) + .groupby(log_detail.date) + .limit(limit) + ) + transaction_logs = transaction_logs_query.run(as_dict=True) - transaction_logs = ( - qb.from_(log_detail) - .select(log_detail.date.as_("date"), Count(log_detail.date).as_("count")) - .where(log_detail.date.isin(dates)) - .orderby(log_detail.date, order=Order.desc) - .groupby(log_detail.date) - .limit(limit) - .run(as_dict=True) - ) return [serialize_transaction_log(x) for x in transaction_logs] @staticmethod @@ -85,3 +92,14 @@ def serialize_transaction_log(data): succeeded=data.succeeded, failed=data.failed, ) + + +def parse_list_filters(args): + # parse date filter + filter_date = None + for fil in args.get("filters"): + if isinstance(fil, list): + for elem in fil: + if elem == "date": + filter_date = fil[3] + return filter_date From 8dbe753a251b4a0168ad65910dc97098bbba7883 Mon Sep 17 00:00:00 2001 From: ruthra kumar Date: Sat, 11 Nov 2023 05:20:27 +0530 Subject: [PATCH 48/95] refactor: update traceback on retry (cherry picked from commit a52a1b49af1c7b72ba85563057f60bb7cf54e81c) --- erpnext/utilities/bulk_transaction.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/erpnext/utilities/bulk_transaction.py b/erpnext/utilities/bulk_transaction.py index 7e73c2fe0b0c..402c305ca9ab 100644 --- a/erpnext/utilities/bulk_transaction.py +++ b/erpnext/utilities/bulk_transaction.py @@ -59,14 +59,16 @@ def retry_failed_transactions(failed_docs: list | None): task(log.transaction_name, log.from_doctype, log.to_doctype) except Exception as e: frappe.db.rollback(save_point="before_creation_state") - update_log(log.name, "Failed", 1) + update_log(log.name, "Failed", 1, str(frappe.get_traceback())) else: update_log(log.name, "Success", 1) -def update_log(log_name, status, retried): +def update_log(log_name, status, retried, err=None): frappe.db.set_value("Bulk Transaction Log Detail", log_name, "transaction_status", status) frappe.db.set_value("Bulk Transaction Log Detail", log_name, "retried", retried) + if err: + frappe.db.set_value("Bulk Transaction Log Detail", log_name, "error_description", err) def job(deserialized_data, from_doctype, to_doctype): From fa1f623801791c7b38d89cde6220519bdc786094 Mon Sep 17 00:00:00 2001 From: ruthra kumar Date: Mon, 13 Nov 2023 10:39:40 +0530 Subject: [PATCH 49/95] refactor: raise exception on invalid date (cherry picked from commit a393a6b76c35d95e4422fbf239c468ab48e67b71) --- .../doctype/bulk_transaction_log/bulk_transaction_log.js | 2 +- .../doctype/bulk_transaction_log/bulk_transaction_log.py | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/erpnext/bulk_transaction/doctype/bulk_transaction_log/bulk_transaction_log.js b/erpnext/bulk_transaction/doctype/bulk_transaction_log/bulk_transaction_log.js index 3135d41cc18b..dc54d606e7a1 100644 --- a/erpnext/bulk_transaction/doctype/bulk_transaction_log/bulk_transaction_log.js +++ b/erpnext/bulk_transaction/doctype/bulk_transaction_log/bulk_transaction_log.js @@ -14,7 +14,7 @@ frappe.ui.form.on("Bulk Transaction Log", { frappe.call({ method: "erpnext.utilities.bulk_transaction.retry", args: {date: frm.doc.date} - }).then(()=> { }); + }); }); } }, diff --git a/erpnext/bulk_transaction/doctype/bulk_transaction_log/bulk_transaction_log.py b/erpnext/bulk_transaction/doctype/bulk_transaction_log/bulk_transaction_log.py index 8ae54ddab8b8..712caf1f91f8 100644 --- a/erpnext/bulk_transaction/doctype/bulk_transaction_log/bulk_transaction_log.py +++ b/erpnext/bulk_transaction/doctype/bulk_transaction_log/bulk_transaction_log.py @@ -15,6 +15,13 @@ def db_insert(self, *args, **kwargs): def load_from_db(self): log_detail = qb.DocType("Bulk Transaction Log Detail") + + has_records = frappe.db.sql( + f"select exists (select * from `tabBulk Transaction Log Detail` where date = '{self.name}');" + )[0][0] + if not has_records: + raise frappe.DoesNotExistError + succeeded_logs = ( qb.from_(log_detail) .select(Count(log_detail.date).as_("count")) From c7c751ecd0d16c568c26ab473df6167f84a9a2f3 Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Fri, 17 Nov 2023 18:28:10 +0530 Subject: [PATCH 50/95] fix(Timesheet): reset billing hours equal to hours if they exceed actual hours (backport #38134) (#38152) fix(Timesheet): reset billing hours equal to hours if they exceed actual hours (#38134) (cherry picked from commit 20c6e9fca29d80016cefb83deee4e44ac9bc1d47) Co-authored-by: Rucha Mahabal --- erpnext/projects/doctype/timesheet/timesheet.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/projects/doctype/timesheet/timesheet.py b/erpnext/projects/doctype/timesheet/timesheet.py index 4a27807e4ec9..d854eae8fb64 100644 --- a/erpnext/projects/doctype/timesheet/timesheet.py +++ b/erpnext/projects/doctype/timesheet/timesheet.py @@ -63,7 +63,7 @@ def calculate_percentage_billed(self): def update_billing_hours(self, args): if args.is_billable: - if flt(args.billing_hours) == 0.0: + if flt(args.billing_hours) == 0.0 or flt(args.billing_hours) > flt(args.hours): args.billing_hours = args.hours else: args.billing_hours = 0 From 1ccd5e4ff55f24aed69484a19cf86bc4304a127d Mon Sep 17 00:00:00 2001 From: Vishakh Desai Date: Sat, 18 Nov 2023 17:10:01 +0530 Subject: [PATCH 51/95] fix: pass check permission in render_address (cherry picked from commit 45299fe4b3e23774920d7c35f7fb66e786cf5aa5) --- erpnext/accounts/party.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/erpnext/accounts/party.py b/erpnext/accounts/party.py index 7903beec7cff..ecbe18094a9e 100644 --- a/erpnext/accounts/party.py +++ b/erpnext/accounts/party.py @@ -231,7 +231,9 @@ def set_address_details( if shipping_address: party_details.update( shipping_address=shipping_address, - shipping_address_display=render_address(shipping_address), + shipping_address_display=render_address( + shipping_address, check_permissions=not ignore_permissions + ), **get_fetch_values(doctype, "shipping_address", shipping_address) ) From 9a34518e543692201c1166c154f91976e6ec989a Mon Sep 17 00:00:00 2001 From: s-aga-r Date: Sat, 18 Nov 2023 18:48:25 +0530 Subject: [PATCH 52/95] fix: incorrect incoming rate for serial and batch items in standalone debit note (#38121) --- erpnext/controllers/buying_controller.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/erpnext/controllers/buying_controller.py b/erpnext/controllers/buying_controller.py index 913e2274b1ac..223e9bae2896 100644 --- a/erpnext/controllers/buying_controller.py +++ b/erpnext/controllers/buying_controller.py @@ -87,7 +87,8 @@ def set_rate_for_standalone_debit_note(self): "posting_date": self.get("posting_date"), "posting_time": self.get("posting_time"), "qty": row.qty, - "serial_and_batch_bundle": row.get("serial_and_batch_bundle"), + "serial_no": row.serial_no, + "batch_no": row.batch_no, "company": self.company, "voucher_type": self.doctype, "voucher_no": self.name, From 8d4a19cecfd992cf5522c7b976c26b556db2e47b Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Sat, 18 Nov 2023 18:53:55 +0530 Subject: [PATCH 53/95] feat: add `Supplier Delivery Note` field in SCR (backport #38127) (#38155) * feat: add `Supplier Delivery Note` field in SCR (cherry picked from commit da80e4dbce07707d57e3739b7bb2138adf199905) # Conflicts: # erpnext/subcontracting/doctype/subcontracting_receipt/subcontracting_receipt.json * chore: `conflicts` --------- Co-authored-by: s-aga-r --- .../subcontracting_receipt/subcontracting_receipt.json | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/erpnext/subcontracting/doctype/subcontracting_receipt/subcontracting_receipt.json b/erpnext/subcontracting/doctype/subcontracting_receipt/subcontracting_receipt.json index d572ae3d4bed..4ed169717fb6 100644 --- a/erpnext/subcontracting/doctype/subcontracting_receipt/subcontracting_receipt.json +++ b/erpnext/subcontracting/doctype/subcontracting_receipt/subcontracting_receipt.json @@ -11,6 +11,7 @@ "naming_series", "supplier", "supplier_name", + "supplier_delivery_note", "column_break1", "company", "posting_date", @@ -625,12 +626,17 @@ "fieldtype": "Check", "label": "Edit Posting Date and Time", "print_hide": 1 + }, + { + "fieldname": "supplier_delivery_note", + "fieldtype": "Data", + "label": "Supplier Delivery Note" } ], "in_create": 1, "is_submittable": 1, "links": [], - "modified": "2023-07-06 18:44:16.171842", + "modified": "2023-11-16 13:04:00.710534", "modified_by": "Administrator", "module": "Subcontracting", "name": "Subcontracting Receipt", From 51e33e1556302a4f5f006ceac02303c8e18dea6e Mon Sep 17 00:00:00 2001 From: Deepesh Garg Date: Fri, 17 Nov 2023 12:37:14 +0530 Subject: [PATCH 54/95] feat: Add accounting dimensions to Supplier Quotation (cherry picked from commit 089da459f73791b86d33cf066e6879e77af200b5) # Conflicts: # erpnext/buying/doctype/supplier_quotation/supplier_quotation.json # erpnext/patches.txt --- .../supplier_quotation.json | 81 +++++++++++++++++++ .../supplier_quotation_item.json | 15 +++- erpnext/hooks.py | 2 + erpnext/patches.txt | 7 ++ ...unting_dimensions_in_supplier_quotation.py | 8 ++ 5 files changed, 111 insertions(+), 2 deletions(-) create mode 100644 erpnext/patches/v14_0/create_accounting_dimensions_in_supplier_quotation.py diff --git a/erpnext/buying/doctype/supplier_quotation/supplier_quotation.json b/erpnext/buying/doctype/supplier_quotation/supplier_quotation.json index 11ff91af94d4..fa13c76929d0 100644 --- a/erpnext/buying/doctype/supplier_quotation/supplier_quotation.json +++ b/erpnext/buying/doctype/supplier_quotation/supplier_quotation.json @@ -20,6 +20,10 @@ "valid_till", "quotation_number", "amended_from", + "accounting_dimensions_section", + "cost_center", + "dimension_col_break", + "project", "currency_and_price_list", "currency", "conversion_rate", @@ -837,6 +841,79 @@ "fieldname": "named_place", "fieldtype": "Data", "label": "Named Place" +<<<<<<< HEAD +======= + }, + { + "fieldname": "shipping_address", + "fieldtype": "Link", + "label": "Shipping Address", + "options": "Address", + "print_hide": 1 + }, + { + "fieldname": "column_break_zjaq", + "fieldtype": "Column Break" + }, + { + "fieldname": "shipping_address_display", + "fieldtype": "Small Text", + "label": "Shipping Address Details", + "print_hide": 1, + "read_only": 1 + }, + { + "fieldname": "shipping_address_section", + "fieldtype": "Section Break", + "label": "Shipping Address" + }, + { + "fieldname": "supplier_address_section", + "fieldtype": "Section Break", + "label": "Supplier Address" + }, + { + "fieldname": "company_billing_address_section", + "fieldtype": "Section Break", + "label": "Company Billing Address" + }, + { + "fieldname": "billing_address", + "fieldtype": "Link", + "label": "Company Billing Address", + "options": "Address" + }, + { + "fieldname": "column_break_gcth", + "fieldtype": "Column Break" + }, + { + "fieldname": "billing_address_display", + "fieldtype": "Small Text", + "label": "Billing Address Details", + "read_only": 1 + }, + { + "fieldname": "cost_center", + "fieldtype": "Link", + "label": "Cost Center", + "options": "Cost Center" + }, + { + "fieldname": "project", + "fieldtype": "Link", + "label": "Project", + "options": "Project" + }, + { + "fieldname": "dimension_col_break", + "fieldtype": "Column Break" + }, + { + "fieldname": "accounting_dimensions_section", + "fieldtype": "Section Break", + "label": "Accounting Dimensions" +>>>>>>> 089da459f7 (feat: Add accounting dimensions to Supplier Quotation) } ], "icon": "fa fa-shopping-cart", @@ -844,7 +921,11 @@ "index_web_pages_for_search": 1, "is_submittable": 1, "links": [], +<<<<<<< HEAD "modified": "2023-04-14 16:43:41.714832", +======= + "modified": "2023-11-17 12:34:30.083077", +>>>>>>> 089da459f7 (feat: Add accounting dimensions to Supplier Quotation) "modified_by": "Administrator", "module": "Buying", "name": "Supplier Quotation", diff --git a/erpnext/buying/doctype/supplier_quotation_item/supplier_quotation_item.json b/erpnext/buying/doctype/supplier_quotation_item/supplier_quotation_item.json index a4e3c4f32e23..9ec52fbbb653 100644 --- a/erpnext/buying/doctype/supplier_quotation_item/supplier_quotation_item.json +++ b/erpnext/buying/doctype/supplier_quotation_item/supplier_quotation_item.json @@ -68,6 +68,8 @@ "column_break_15", "manufacturer_part_no", "ad_sec_break", + "cost_center", + "dimension_col_break", "project", "section_break_44", "page_break" @@ -134,7 +136,6 @@ "fieldtype": "Column Break" }, { - "fetch_from": "item_code.image", "fieldname": "image", "fieldtype": "Attach", "hidden": 1, @@ -555,13 +556,23 @@ "fieldname": "expected_delivery_date", "fieldtype": "Date", "label": "Expected Delivery Date" + }, + { + "fieldname": "cost_center", + "fieldtype": "Link", + "label": "Cost Center", + "options": "Cost Center" + }, + { + "fieldname": "dimension_col_break", + "fieldtype": "Column Break" } ], "idx": 1, "index_web_pages_for_search": 1, "istable": 1, "links": [], - "modified": "2023-11-14 18:35:03.435817", + "modified": "2023-11-17 12:25:26.235367", "modified_by": "Administrator", "module": "Buying", "name": "Supplier Quotation Item", diff --git a/erpnext/hooks.py b/erpnext/hooks.py index 6d5dddd9e976..7eef6d9e9a8f 100644 --- a/erpnext/hooks.py +++ b/erpnext/hooks.py @@ -548,6 +548,8 @@ "Subcontracting Receipt", "Subcontracting Receipt Item", "Account Closing Balance", + "Supplier Quotation", + "Supplier Quotation Item", ] # get matching queries for Bank Reconciliation diff --git a/erpnext/patches.txt b/erpnext/patches.txt index 86984819816a..2c54d868aef2 100644 --- a/erpnext/patches.txt +++ b/erpnext/patches.txt @@ -349,5 +349,12 @@ execute:frappe.db.set_single_value("Payment Reconciliation", "payment_limit", 50 erpnext.patches.v14_0.rename_daily_depreciation_to_depreciation_amount_based_on_num_days_in_month erpnext.patches.v14_0.rename_depreciation_amount_based_on_num_days_in_month_to_daily_prorata_based erpnext.patches.v14_0.add_default_for_repost_settings +<<<<<<< HEAD +======= +erpnext.patches.v15_0.rename_daily_depreciation_to_depreciation_amount_based_on_num_days_in_month +erpnext.patches.v15_0.rename_depreciation_amount_based_on_num_days_in_month_to_daily_prorata_based +erpnext.patches.v15_0.set_reserved_stock_in_bin +erpnext.patches.v14_0.create_accounting_dimensions_in_supplier_quotation +>>>>>>> 089da459f7 (feat: Add accounting dimensions to Supplier Quotation) # below migration patch should always run last erpnext.patches.v14_0.migrate_gl_to_payment_ledger diff --git a/erpnext/patches/v14_0/create_accounting_dimensions_in_supplier_quotation.py b/erpnext/patches/v14_0/create_accounting_dimensions_in_supplier_quotation.py new file mode 100644 index 000000000000..6966db1fd731 --- /dev/null +++ b/erpnext/patches/v14_0/create_accounting_dimensions_in_supplier_quotation.py @@ -0,0 +1,8 @@ +from erpnext.accounts.doctype.accounting_dimension.accounting_dimension import ( + create_accounting_dimensions_for_doctype, +) + + +def execute(): + create_accounting_dimensions_for_doctype(doctype="Supplier Quotation") + create_accounting_dimensions_for_doctype(doctype="Supplier Quotation Item") From 430980a836611e0d2a738aab1e4a3b73d47481c9 Mon Sep 17 00:00:00 2001 From: PatrickDenis-stack <77415730+PatrickDenis-stack@users.noreply.github.com> Date: Sat, 18 Nov 2023 11:16:06 +0100 Subject: [PATCH 55/95] fix: attributes were mandatory for manufacturers (cherry picked from commit 434c2a1815f27c59de5cd94528bc371593bdd402) --- erpnext/stock/doctype/item/item.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/stock/doctype/item/item.json b/erpnext/stock/doctype/item/item.json index 7d0a387f43ef..fb3b7e4297e5 100644 --- a/erpnext/stock/doctype/item/item.json +++ b/erpnext/stock/doctype/item/item.json @@ -505,7 +505,7 @@ "fieldtype": "Table", "hidden": 1, "label": "Variant Attributes", - "mandatory_depends_on": "has_variants", + "mandatory_depends_on": "eval:(doc.has_variants || doc.variant_of) && doc.variant_based_on==='Item Attribute'", "options": "Item Variant Attribute" }, { From da27c0fb2dcec6606510cb033bf2e88ce37b9980 Mon Sep 17 00:00:00 2001 From: Deepesh Garg Date: Sat, 18 Nov 2023 20:10:28 +0530 Subject: [PATCH 56/95] chore: resolve conflicts --- .../supplier_quotation.json | 56 ------------------- 1 file changed, 56 deletions(-) diff --git a/erpnext/buying/doctype/supplier_quotation/supplier_quotation.json b/erpnext/buying/doctype/supplier_quotation/supplier_quotation.json index fa13c76929d0..986ed7b9ff22 100644 --- a/erpnext/buying/doctype/supplier_quotation/supplier_quotation.json +++ b/erpnext/buying/doctype/supplier_quotation/supplier_quotation.json @@ -841,57 +841,6 @@ "fieldname": "named_place", "fieldtype": "Data", "label": "Named Place" -<<<<<<< HEAD -======= - }, - { - "fieldname": "shipping_address", - "fieldtype": "Link", - "label": "Shipping Address", - "options": "Address", - "print_hide": 1 - }, - { - "fieldname": "column_break_zjaq", - "fieldtype": "Column Break" - }, - { - "fieldname": "shipping_address_display", - "fieldtype": "Small Text", - "label": "Shipping Address Details", - "print_hide": 1, - "read_only": 1 - }, - { - "fieldname": "shipping_address_section", - "fieldtype": "Section Break", - "label": "Shipping Address" - }, - { - "fieldname": "supplier_address_section", - "fieldtype": "Section Break", - "label": "Supplier Address" - }, - { - "fieldname": "company_billing_address_section", - "fieldtype": "Section Break", - "label": "Company Billing Address" - }, - { - "fieldname": "billing_address", - "fieldtype": "Link", - "label": "Company Billing Address", - "options": "Address" - }, - { - "fieldname": "column_break_gcth", - "fieldtype": "Column Break" - }, - { - "fieldname": "billing_address_display", - "fieldtype": "Small Text", - "label": "Billing Address Details", - "read_only": 1 }, { "fieldname": "cost_center", @@ -913,7 +862,6 @@ "fieldname": "accounting_dimensions_section", "fieldtype": "Section Break", "label": "Accounting Dimensions" ->>>>>>> 089da459f7 (feat: Add accounting dimensions to Supplier Quotation) } ], "icon": "fa fa-shopping-cart", @@ -921,11 +869,7 @@ "index_web_pages_for_search": 1, "is_submittable": 1, "links": [], -<<<<<<< HEAD - "modified": "2023-04-14 16:43:41.714832", -======= "modified": "2023-11-17 12:34:30.083077", ->>>>>>> 089da459f7 (feat: Add accounting dimensions to Supplier Quotation) "modified_by": "Administrator", "module": "Buying", "name": "Supplier Quotation", From 2849e0daed1f7690d1c30abf4644736decc9711d Mon Sep 17 00:00:00 2001 From: barredterra <14891507+barredterra@users.noreply.github.com> Date: Sat, 18 Nov 2023 15:43:23 +0100 Subject: [PATCH 57/95] fix: update modified timestamp Was missing in 434c2a1815f27c59de5cd94528bc371593bdd402 --- erpnext/stock/doctype/item/item.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/stock/doctype/item/item.json b/erpnext/stock/doctype/item/item.json index fb3b7e4297e5..7afc031d87d7 100644 --- a/erpnext/stock/doctype/item/item.json +++ b/erpnext/stock/doctype/item/item.json @@ -897,7 +897,7 @@ "index_web_pages_for_search": 1, "links": [], "make_attachments_public": 1, - "modified": "2023-09-11 13:46:32.688051", + "modified": "2023-09-18 15:41:32.688051", "modified_by": "Administrator", "module": "Stock", "name": "Item", From a70696ea777258cfcf41ccddae9dd0ddba98ce8e Mon Sep 17 00:00:00 2001 From: Patrick Eissler <77415730+PatrickDEissler@users.noreply.github.com> Date: Sat, 18 Nov 2023 15:54:34 +0100 Subject: [PATCH 58/95] fix: valuation rate in report Item Prices (#38161) Co-authored-by: PatrickDenis-stack <77415730+PatrickDenis-stack@users.noreply.github.com> (cherry picked from commit 32f622ef8061f7db50b4c8f63134f947afdcb306) --- erpnext/stock/report/item_prices/item_prices.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/stock/report/item_prices/item_prices.py b/erpnext/stock/report/item_prices/item_prices.py index ab47b4a8b991..a53a9f24f542 100644 --- a/erpnext/stock/report/item_prices/item_prices.py +++ b/erpnext/stock/report/item_prices/item_prices.py @@ -202,7 +202,7 @@ def get_valuation_rate(): bin_data = ( frappe.qb.from_(bin) .select( - bin.item_code, Sum(bin.actual_qty * bin.valuation_rate) / Sum(bin.actual_qty).as_("val_rate") + bin.item_code, (Sum(bin.actual_qty * bin.valuation_rate) / Sum(bin.actual_qty)).as_("val_rate") ) .where(bin.actual_qty > 0) .groupby(bin.item_code) From 49735bc1204ff3ca349f8dff168666a6cbe7b14d Mon Sep 17 00:00:00 2001 From: Devin Slauenwhite Date: Sat, 18 Nov 2023 15:09:44 +0000 Subject: [PATCH 59/95] fix: payment entry rounding error --- erpnext/accounts/doctype/payment_entry/payment_entry.js | 2 +- erpnext/accounts/doctype/payment_entry/payment_entry.py | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/erpnext/accounts/doctype/payment_entry/payment_entry.js b/erpnext/accounts/doctype/payment_entry/payment_entry.js index d23ae8778278..f6280307e9c6 100644 --- a/erpnext/accounts/doctype/payment_entry/payment_entry.js +++ b/erpnext/accounts/doctype/payment_entry/payment_entry.js @@ -829,7 +829,6 @@ frappe.ui.form.on('Payment Entry', { else total_negative_outstanding += Math.abs(flt(row.outstanding_amount)); }) - var allocated_negative_outstanding = 0; if ( (frm.doc.payment_type=="Receive" && frm.doc.party_type=="Customer") || @@ -844,6 +843,7 @@ frappe.ui.form.on('Payment Entry', { var allocated_positive_outstanding = paid_amount + allocated_negative_outstanding; } else if (in_list(["Customer", "Supplier"], frm.doc.party_type)) { + total_negative_outstanding = flt(total_negative_outstanding, precision("outstanding_amount")) if(paid_amount > total_negative_outstanding) { if(total_negative_outstanding == 0) { frappe.msgprint( diff --git a/erpnext/accounts/doctype/payment_entry/payment_entry.py b/erpnext/accounts/doctype/payment_entry/payment_entry.py index 35207eae0e50..03c939cf079c 100644 --- a/erpnext/accounts/doctype/payment_entry/payment_entry.py +++ b/erpnext/accounts/doctype/payment_entry/payment_entry.py @@ -913,8 +913,11 @@ def validate_payment_against_negative_invoice(self): ): return - total_negative_outstanding = sum( - abs(flt(d.outstanding_amount)) for d in self.get("references") if flt(d.outstanding_amount) < 0 + total_negative_outstanding = flt( + sum( + abs(flt(d.outstanding_amount)) for d in self.get("references") if flt(d.outstanding_amount) < 0 + ), + self.references[0].precision("outstanding_amount") if self.references else None, ) paid_amount = self.paid_amount if self.payment_type == "Receive" else self.received_amount From 7b9afa43ffa4ae4889dd398b9775ab9aaa2cd85c Mon Sep 17 00:00:00 2001 From: Deepesh Garg Date: Sun, 19 Nov 2023 18:34:47 +0530 Subject: [PATCH 60/95] chore: resolve conflicts --- erpnext/patches.txt | 6 ------ 1 file changed, 6 deletions(-) diff --git a/erpnext/patches.txt b/erpnext/patches.txt index 2c54d868aef2..0fcf4fef1697 100644 --- a/erpnext/patches.txt +++ b/erpnext/patches.txt @@ -349,12 +349,6 @@ execute:frappe.db.set_single_value("Payment Reconciliation", "payment_limit", 50 erpnext.patches.v14_0.rename_daily_depreciation_to_depreciation_amount_based_on_num_days_in_month erpnext.patches.v14_0.rename_depreciation_amount_based_on_num_days_in_month_to_daily_prorata_based erpnext.patches.v14_0.add_default_for_repost_settings -<<<<<<< HEAD -======= -erpnext.patches.v15_0.rename_daily_depreciation_to_depreciation_amount_based_on_num_days_in_month -erpnext.patches.v15_0.rename_depreciation_amount_based_on_num_days_in_month_to_daily_prorata_based -erpnext.patches.v15_0.set_reserved_stock_in_bin erpnext.patches.v14_0.create_accounting_dimensions_in_supplier_quotation ->>>>>>> 089da459f7 (feat: Add accounting dimensions to Supplier Quotation) # below migration patch should always run last erpnext.patches.v14_0.migrate_gl_to_payment_ledger From 296433a1ddeaa8874d45c05b6c8f649503eeb3cc Mon Sep 17 00:00:00 2001 From: Dany Robert Date: Sat, 18 Nov 2023 13:32:04 +0000 Subject: [PATCH 61/95] fix: wrong round off and rounded total (cherry picked from commit 3a487bd33af1972d9ee8b7bb2f6277775c8e018e) --- erpnext/controllers/taxes_and_totals.py | 1 + erpnext/public/js/controllers/taxes_and_totals.js | 3 +++ 2 files changed, 4 insertions(+) diff --git a/erpnext/controllers/taxes_and_totals.py b/erpnext/controllers/taxes_and_totals.py index 95bf0e4688ef..e24618af1034 100644 --- a/erpnext/controllers/taxes_and_totals.py +++ b/erpnext/controllers/taxes_and_totals.py @@ -51,6 +51,7 @@ def calculate(self): if self.doc.apply_discount_on == "Grand Total" and self.doc.get("is_cash_or_non_trade_discount"): self.doc.grand_total -= self.doc.discount_amount self.doc.base_grand_total -= self.doc.base_discount_amount + self.doc.rounding_adjustment = self.doc.base_rounding_adjustment = 0.0 self.set_rounded_total() self.calculate_shipping_charges() diff --git a/erpnext/public/js/controllers/taxes_and_totals.js b/erpnext/public/js/controllers/taxes_and_totals.js index b7ed22346b45..c179928b5117 100644 --- a/erpnext/public/js/controllers/taxes_and_totals.js +++ b/erpnext/public/js/controllers/taxes_and_totals.js @@ -43,6 +43,9 @@ erpnext.taxes_and_totals = class TaxesAndTotals extends erpnext.payments { if (this.frm.doc.apply_discount_on == "Grand Total" && this.frm.doc.is_cash_or_non_trade_discount) { this.frm.doc.grand_total -= this.frm.doc.discount_amount; this.frm.doc.base_grand_total -= this.frm.doc.base_discount_amount; + this.frm.doc.rounding_adjustment = 0; + this.frm.doc.base_rounding_adjustment = 0; + this.set_rounded_total(); } await this.calculate_shipping_charges(); From 9b5185adc930d59e9c58246f7c51a403e32c6062 Mon Sep 17 00:00:00 2001 From: Dany Robert Date: Sun, 19 Nov 2023 02:53:09 +0000 Subject: [PATCH 62/95] fix: test case for rounded total with cash disc (cherry picked from commit cc60c328fe349f7d53c77799e8e91973c2790746) --- .../sales_invoice/test_sales_invoice.py | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/erpnext/accounts/doctype/sales_invoice/test_sales_invoice.py b/erpnext/accounts/doctype/sales_invoice/test_sales_invoice.py index 79363dbeb1b5..584f297c904c 100644 --- a/erpnext/accounts/doctype/sales_invoice/test_sales_invoice.py +++ b/erpnext/accounts/doctype/sales_invoice/test_sales_invoice.py @@ -782,6 +782,28 @@ def test_outstanding(self): w = self.make() self.assertEqual(w.outstanding_amount, w.base_rounded_total) + def test_rounded_total_with_cash_discount(self): + si = frappe.copy_doc(test_records[2]) + + item = copy.deepcopy(si.get("items")[0]) + item.update( + { + "qty": 1, + "rate": 14960.66, + } + ) + + si.set("items", [item]) + si.set("taxes", []) + si.apply_discount_on = "Grand Total" + si.is_cash_or_non_trade_discount = 1 + si.discount_amount = 1 + si.insert() + + self.assertEqual(si.grand_total, 14959.66) + self.assertEqual(si.rounded_total, 14960) + self.assertEqual(si.rounding_adjustment, 0.34) + def test_payment(self): w = self.make() From 4e2d0aa892739ee06a0681fd5700b07df58379c2 Mon Sep 17 00:00:00 2001 From: ruthra kumar Date: Sat, 18 Nov 2023 09:04:36 +0530 Subject: [PATCH 63/95] refactor: provision to set `remarks` length in accounts settings (cherry picked from commit 97090ff3679104d77a031f29d4acafb8b7ac1580) # Conflicts: # erpnext/accounts/doctype/accounts_settings/accounts_settings.json --- .../accounts_settings/accounts_settings.json | 44 +++++++++++++++++++ .../report/general_ledger/general_ledger.py | 7 ++- 2 files changed, 50 insertions(+), 1 deletion(-) diff --git a/erpnext/accounts/doctype/accounts_settings/accounts_settings.json b/erpnext/accounts/doctype/accounts_settings/accounts_settings.json index 3ab9d2b60d5b..d266468d8b92 100644 --- a/erpnext/accounts/doctype/accounts_settings/accounts_settings.json +++ b/erpnext/accounts/doctype/accounts_settings/accounts_settings.json @@ -67,8 +67,16 @@ "banking_tab", "enable_party_matching", "enable_fuzzy_matching", +<<<<<<< HEAD "tab_break_dpet", "show_balance_in_coa" +======= + "reports_tab", + "remarks_section", + "general_ledger_remarks_length", + "column_break_lvjk", + "receivable_payable_remarks_length" +>>>>>>> 97090ff367 (refactor: provision to set `remarks` length in accounts settings) ], "fields": [ { @@ -428,7 +436,39 @@ "default": "1", "fieldname": "show_balance_in_coa", "fieldtype": "Check", +<<<<<<< HEAD "label": "Show Balances in Chart Of Accounts" +======= + "label": "Round Tax Amount Row-wise" + }, + { + "fieldname": "reports_tab", + "fieldtype": "Tab Break", + "label": "Reports" + }, + { + "default": "0", + "description": "Truncates 'Remarks' column to set character length", + "fieldname": "general_ledger_remarks_length", + "fieldtype": "Int", + "label": "General Ledger" + }, + { + "default": "0", + "description": "Truncates 'Remarks' column to set character length", + "fieldname": "receivable_payable_remarks_length", + "fieldtype": "Int", + "label": "Accounts Receivable/Payable" + }, + { + "fieldname": "column_break_lvjk", + "fieldtype": "Column Break" + }, + { + "fieldname": "remarks_section", + "fieldtype": "Section Break", + "label": "Remarks Column Length" +>>>>>>> 97090ff367 (refactor: provision to set `remarks` length in accounts settings) } ], "icon": "icon-cog", @@ -436,7 +476,11 @@ "index_web_pages_for_search": 1, "issingle": 1, "links": [], +<<<<<<< HEAD "modified": "2023-07-27 15:05:34.000264", +======= + "modified": "2023-11-20 09:37:47.650347", +>>>>>>> 97090ff367 (refactor: provision to set `remarks` length in accounts settings) "modified_by": "Administrator", "module": "Accounts", "name": "Accounts Settings", diff --git a/erpnext/accounts/report/general_ledger/general_ledger.py b/erpnext/accounts/report/general_ledger/general_ledger.py index 754f17c118ef..2e0a9c5f738e 100644 --- a/erpnext/accounts/report/general_ledger/general_ledger.py +++ b/erpnext/accounts/report/general_ledger/general_ledger.py @@ -164,7 +164,12 @@ def get_gl_entries(filters, accounting_dimensions): credit_in_account_currency """ if filters.get("show_remarks"): - select_fields += """,remarks""" + if remarks_length := frappe.db.get_single_value( + "Accounts Settings", "general_ledger_remarks_length" + ): + select_fields += f",substr(remarks, 1, {remarks_length}) as 'remarks'" + else: + select_fields += """,remarks""" order_by_statement = "order by posting_date, account, creation" From ae319760a05058c5e5b4e7ba7c5ddc11c1d2079f Mon Sep 17 00:00:00 2001 From: ruthra kumar Date: Sat, 18 Nov 2023 10:35:56 +0530 Subject: [PATCH 64/95] refactor: add substring logic in ar/ap report (cherry picked from commit a9bf906545dc7c89613c7f6211c35e62b8d7b989) --- .../report/accounts_receivable/accounts_receivable.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/erpnext/accounts/report/accounts_receivable/accounts_receivable.py b/erpnext/accounts/report/accounts_receivable/accounts_receivable.py index c077d829939d..18217f8d3beb 100755 --- a/erpnext/accounts/report/accounts_receivable/accounts_receivable.py +++ b/erpnext/accounts/report/accounts_receivable/accounts_receivable.py @@ -7,7 +7,7 @@ import frappe from frappe import _, qb, scrub from frappe.query_builder import Criterion -from frappe.query_builder.functions import Date, Sum +from frappe.query_builder.functions import Date, Substring, Sum from frappe.utils import cint, cstr, flt, getdate, nowdate from erpnext.accounts.doctype.accounting_dimension.accounting_dimension import ( @@ -762,7 +762,12 @@ def get_ple_entries(self): ) if self.filters.get("show_remarks"): - query = query.select(ple.remarks) + if remarks_length := frappe.db.get_single_value( + "Accounts Settings", "receivable_payable_remarks_length" + ): + query = query.select(Substring(ple.remarks, 1, remarks_length).as_("remarks")) + else: + query = query.select(ple.remarks) if self.filters.get("group_by_party"): query = query.orderby(self.ple.party, self.ple.posting_date) From 883eaee0143ae22998a86ab2b9e011b398a677c3 Mon Sep 17 00:00:00 2001 From: Vishakh Desai <78500008+vishakhdesai@users.noreply.github.com> Date: Thu, 9 Nov 2023 18:26:34 +0530 Subject: [PATCH 65/95] fix: Supplier Quotation fields (#37963) (cherry picked from commit c2bda2c70535ad9e8a61e752bbb551f387460125) # Conflicts: # erpnext/buying/doctype/supplier_quotation/supplier_quotation.json --- erpnext/accounts/party.py | 7 ++- .../request_for_quotation.json | 16 ++++- .../supplier_quotation.json | 63 +++++++++++++++++++ erpnext/public/js/utils/party.js | 2 +- 4 files changed, 85 insertions(+), 3 deletions(-) diff --git a/erpnext/accounts/party.py b/erpnext/accounts/party.py index ecbe18094a9e..037f0ec4a157 100644 --- a/erpnext/accounts/party.py +++ b/erpnext/accounts/party.py @@ -31,7 +31,12 @@ from erpnext.exceptions import InvalidAccountCurrency, PartyDisabled, PartyFrozen from erpnext.utilities.regional import temporary_flag -PURCHASE_TRANSACTION_TYPES = {"Purchase Order", "Purchase Receipt", "Purchase Invoice"} +PURCHASE_TRANSACTION_TYPES = { + "Supplier Quotation", + "Purchase Order", + "Purchase Receipt", + "Purchase Invoice", +} SALES_TRANSACTION_TYPES = { "Quotation", "Sales Order", diff --git a/erpnext/buying/doctype/request_for_quotation/request_for_quotation.json b/erpnext/buying/doctype/request_for_quotation/request_for_quotation.json index 06dbd86ba126..fd73f77ff8f3 100644 --- a/erpnext/buying/doctype/request_for_quotation/request_for_quotation.json +++ b/erpnext/buying/doctype/request_for_quotation/request_for_quotation.json @@ -9,6 +9,8 @@ "field_order": [ "naming_series", "company", + "billing_address", + "billing_address_display", "vendor", "column_break1", "transaction_date", @@ -292,13 +294,25 @@ "fieldtype": "Check", "label": "Send Document Print", "print_hide": 1 + }, + { + "fieldname": "billing_address", + "fieldtype": "Link", + "label": "Company Billing Address", + "options": "Address" + }, + { + "fieldname": "billing_address_display", + "fieldtype": "Small Text", + "label": "Billing Address Details", + "read_only": 1 } ], "icon": "fa fa-shopping-cart", "index_web_pages_for_search": 1, "is_submittable": 1, "links": [], - "modified": "2023-08-09 12:20:26.850623", + "modified": "2023-11-06 12:45:28.898706", "modified_by": "Administrator", "module": "Buying", "name": "Request for Quotation", diff --git a/erpnext/buying/doctype/supplier_quotation/supplier_quotation.json b/erpnext/buying/doctype/supplier_quotation/supplier_quotation.json index 986ed7b9ff22..dc8bc029ed28 100644 --- a/erpnext/buying/doctype/supplier_quotation/supplier_quotation.json +++ b/erpnext/buying/doctype/supplier_quotation/supplier_quotation.json @@ -83,6 +83,7 @@ "pricing_rule_details", "pricing_rules", "address_and_contact_tab", + "supplier_address_section", "supplier_address", "address_display", "column_break_72", @@ -90,6 +91,14 @@ "contact_display", "contact_mobile", "contact_email", + "shipping_address_section", + "shipping_address", + "column_break_zjaq", + "shipping_address_display", + "company_billing_address_section", + "billing_address", + "column_break_gcth", + "billing_address_display", "terms_tab", "tc_name", "terms", @@ -843,6 +852,7 @@ "label": "Named Place" }, { +<<<<<<< HEAD "fieldname": "cost_center", "fieldtype": "Link", "label": "Cost Center", @@ -862,6 +872,55 @@ "fieldname": "accounting_dimensions_section", "fieldtype": "Section Break", "label": "Accounting Dimensions" +======= + "fieldname": "shipping_address", + "fieldtype": "Link", + "label": "Shipping Address", + "options": "Address", + "print_hide": 1 + }, + { + "fieldname": "column_break_zjaq", + "fieldtype": "Column Break" + }, + { + "fieldname": "shipping_address_display", + "fieldtype": "Small Text", + "label": "Shipping Address Details", + "print_hide": 1, + "read_only": 1 + }, + { + "fieldname": "shipping_address_section", + "fieldtype": "Section Break", + "label": "Shipping Address" + }, + { + "fieldname": "supplier_address_section", + "fieldtype": "Section Break", + "label": "Supplier Address" + }, + { + "fieldname": "company_billing_address_section", + "fieldtype": "Section Break", + "label": "Company Billing Address" + }, + { + "fieldname": "billing_address", + "fieldtype": "Link", + "label": "Company Billing Address", + "options": "Address" + }, + { + "fieldname": "column_break_gcth", + "fieldtype": "Column Break" + }, + { + "fieldname": "billing_address_display", + "fieldtype": "Small Text", + "label": "Billing Address Details", + "read_only": 1 +>>>>>>> c2bda2c705 (fix: Supplier Quotation fields (#37963)) } ], "icon": "fa fa-shopping-cart", @@ -869,7 +928,11 @@ "index_web_pages_for_search": 1, "is_submittable": 1, "links": [], +<<<<<<< HEAD "modified": "2023-11-17 12:34:30.083077", +======= + "modified": "2023-11-03 13:21:40.172508", +>>>>>>> c2bda2c705 (fix: Supplier Quotation fields (#37963)) "modified_by": "Administrator", "module": "Buying", "name": "Supplier Quotation", diff --git a/erpnext/public/js/utils/party.js b/erpnext/public/js/utils/party.js index 5c41aa068042..cba615c0d229 100644 --- a/erpnext/public/js/utils/party.js +++ b/erpnext/public/js/utils/party.js @@ -4,7 +4,7 @@ frappe.provide("erpnext.utils"); const SALES_DOCTYPES = ['Quotation', 'Sales Order', 'Delivery Note', 'Sales Invoice']; -const PURCHASE_DOCTYPES = ['Purchase Order', 'Purchase Receipt', 'Purchase Invoice']; +const PURCHASE_DOCTYPES = ['Supplier Quotation','Purchase Order', 'Purchase Receipt', 'Purchase Invoice']; erpnext.utils.get_party_details = function(frm, method, args, callback) { if (!method) { From 80bc235d6e6064756031ea7cf320b001e773e89f Mon Sep 17 00:00:00 2001 From: Smit Vora Date: Mon, 20 Nov 2023 10:56:56 +0530 Subject: [PATCH 66/95] fix: partial cancel of gle and ple (backport #35609) --- erpnext/accounts/general_ledger.py | 16 +++++++++++++--- erpnext/accounts/utils.py | 11 ++++++++--- 2 files changed, 21 insertions(+), 6 deletions(-) diff --git a/erpnext/accounts/general_ledger.py b/erpnext/accounts/general_ledger.py index 07cc5dd734ff..134ddddf9e02 100644 --- a/erpnext/accounts/general_ledger.py +++ b/erpnext/accounts/general_ledger.py @@ -556,7 +556,12 @@ def get_round_off_account_and_cost_center( def make_reverse_gl_entries( - gl_entries=None, voucher_type=None, voucher_no=None, adv_adj=False, update_outstanding="Yes" + gl_entries=None, + voucher_type=None, + voucher_no=None, + adv_adj=False, + update_outstanding="Yes", + partial_cancel=False, ): """ Get original gl entries of the voucher @@ -576,14 +581,19 @@ def make_reverse_gl_entries( if gl_entries: create_payment_ledger_entry( - gl_entries, cancel=1, adv_adj=adv_adj, update_outstanding=update_outstanding + gl_entries, + cancel=1, + adv_adj=adv_adj, + update_outstanding=update_outstanding, + partial_cancel=partial_cancel, ) validate_accounting_period(gl_entries) check_freezing_date(gl_entries[0]["posting_date"], adv_adj) is_opening = any(d.get("is_opening") == "Yes" for d in gl_entries) validate_against_pcv(is_opening, gl_entries[0]["posting_date"], gl_entries[0]["company"]) - set_as_cancel(gl_entries[0]["voucher_type"], gl_entries[0]["voucher_no"]) + if not partial_cancel: + set_as_cancel(gl_entries[0]["voucher_type"], gl_entries[0]["voucher_no"]) for entry in gl_entries: new_gle = copy.deepcopy(entry) diff --git a/erpnext/accounts/utils.py b/erpnext/accounts/utils.py index 01724ff55ca5..92f8ceec4073 100644 --- a/erpnext/accounts/utils.py +++ b/erpnext/accounts/utils.py @@ -1617,6 +1617,7 @@ def get_account_type(account): due_date=gle.due_date, voucher_type=gle.voucher_type, voucher_no=gle.voucher_no, + voucher_detail_no=gle.voucher_detail_no, against_voucher_type=gle.against_voucher_type if gle.against_voucher_type else gle.voucher_type, @@ -1638,7 +1639,7 @@ def get_account_type(account): def create_payment_ledger_entry( - gl_entries, cancel=0, adv_adj=0, update_outstanding="Yes", from_repost=0 + gl_entries, cancel=0, adv_adj=0, update_outstanding="Yes", from_repost=0, partial_cancel=False ): if gl_entries: ple_map = get_payment_ledger_entries(gl_entries, cancel=cancel) @@ -1648,7 +1649,7 @@ def create_payment_ledger_entry( ple = frappe.get_doc(entry) if cancel: - delink_original_entry(ple) + delink_original_entry(ple, partial_cancel=partial_cancel) ple.flags.ignore_permissions = 1 ple.flags.adv_adj = adv_adj @@ -1695,7 +1696,7 @@ def update_voucher_outstanding(voucher_type, voucher_no, account, party_type, pa ref_doc.set_status(update=True) -def delink_original_entry(pl_entry): +def delink_original_entry(pl_entry, partial_cancel=False): if pl_entry: ple = qb.DocType("Payment Ledger Entry") query = ( @@ -1715,6 +1716,10 @@ def delink_original_entry(pl_entry): & (ple.against_voucher_no == pl_entry.against_voucher_no) ) ) + + if partial_cancel: + query = query.where(ple.voucher_detail_no == pl_entry.voucher_detail_no) + query.run() From 7c92ecdc9d04fb7565a9cfb6bc3436099b1cd2a8 Mon Sep 17 00:00:00 2001 From: Sagar Vora Date: Mon, 20 Nov 2023 11:39:15 +0530 Subject: [PATCH 67/95] chore: resolve conflicts --- .../supplier_quotation.json | 53 +++++++++---------- 1 file changed, 24 insertions(+), 29 deletions(-) diff --git a/erpnext/buying/doctype/supplier_quotation/supplier_quotation.json b/erpnext/buying/doctype/supplier_quotation/supplier_quotation.json index dc8bc029ed28..aa89b81b5ed9 100644 --- a/erpnext/buying/doctype/supplier_quotation/supplier_quotation.json +++ b/erpnext/buying/doctype/supplier_quotation/supplier_quotation.json @@ -852,27 +852,6 @@ "label": "Named Place" }, { -<<<<<<< HEAD - "fieldname": "cost_center", - "fieldtype": "Link", - "label": "Cost Center", - "options": "Cost Center" - }, - { - "fieldname": "project", - "fieldtype": "Link", - "label": "Project", - "options": "Project" - }, - { - "fieldname": "dimension_col_break", - "fieldtype": "Column Break" - }, - { - "fieldname": "accounting_dimensions_section", - "fieldtype": "Section Break", - "label": "Accounting Dimensions" -======= "fieldname": "shipping_address", "fieldtype": "Link", "label": "Shipping Address", @@ -880,8 +859,8 @@ "print_hide": 1 }, { - "fieldname": "column_break_zjaq", - "fieldtype": "Column Break" + "fieldname": "column_break_zjaq", + "fieldtype": "Column Break" }, { "fieldname": "shipping_address_display", @@ -920,7 +899,27 @@ "fieldtype": "Small Text", "label": "Billing Address Details", "read_only": 1 ->>>>>>> c2bda2c705 (fix: Supplier Quotation fields (#37963)) + }, + { + "fieldname": "cost_center", + "fieldtype": "Link", + "label": "Cost Center", + "options": "Cost Center" + }, + { + "fieldname": "project", + "fieldtype": "Link", + "label": "Project", + "options": "Project" + }, + { + "fieldname": "dimension_col_break", + "fieldtype": "Column Break" + }, + { + "fieldname": "accounting_dimensions_section", + "fieldtype": "Section Break", + "label": "Accounting Dimensions" } ], "icon": "fa fa-shopping-cart", @@ -928,11 +927,7 @@ "index_web_pages_for_search": 1, "is_submittable": 1, "links": [], -<<<<<<< HEAD - "modified": "2023-11-17 12:34:30.083077", -======= - "modified": "2023-11-03 13:21:40.172508", ->>>>>>> c2bda2c705 (fix: Supplier Quotation fields (#37963)) + "modified": "2023-11-20 11:15:30.083077", "modified_by": "Administrator", "module": "Buying", "name": "Supplier Quotation", From b868e2bd5b568f3ca27e69d22e7c9ad5cd05eb5d Mon Sep 17 00:00:00 2001 From: ruthra kumar Date: Mon, 20 Nov 2023 10:18:29 +0530 Subject: [PATCH 68/95] chore: resolve conflicts --- .../accounts_settings/accounts_settings.json | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/erpnext/accounts/doctype/accounts_settings/accounts_settings.json b/erpnext/accounts/doctype/accounts_settings/accounts_settings.json index d266468d8b92..0370fa2ce87a 100644 --- a/erpnext/accounts/doctype/accounts_settings/accounts_settings.json +++ b/erpnext/accounts/doctype/accounts_settings/accounts_settings.json @@ -67,16 +67,13 @@ "banking_tab", "enable_party_matching", "enable_fuzzy_matching", -<<<<<<< HEAD "tab_break_dpet", - "show_balance_in_coa" -======= + "show_balance_in_coa", "reports_tab", "remarks_section", "general_ledger_remarks_length", "column_break_lvjk", "receivable_payable_remarks_length" ->>>>>>> 97090ff367 (refactor: provision to set `remarks` length in accounts settings) ], "fields": [ { @@ -436,10 +433,7 @@ "default": "1", "fieldname": "show_balance_in_coa", "fieldtype": "Check", -<<<<<<< HEAD "label": "Show Balances in Chart Of Accounts" -======= - "label": "Round Tax Amount Row-wise" }, { "fieldname": "reports_tab", @@ -468,7 +462,6 @@ "fieldname": "remarks_section", "fieldtype": "Section Break", "label": "Remarks Column Length" ->>>>>>> 97090ff367 (refactor: provision to set `remarks` length in accounts settings) } ], "icon": "icon-cog", @@ -476,11 +469,7 @@ "index_web_pages_for_search": 1, "issingle": 1, "links": [], -<<<<<<< HEAD - "modified": "2023-07-27 15:05:34.000264", -======= "modified": "2023-11-20 09:37:47.650347", ->>>>>>> 97090ff367 (refactor: provision to set `remarks` length in accounts settings) "modified_by": "Administrator", "module": "Accounts", "name": "Accounts Settings", From 40f904391e2b8e0d2f8c86b5e392b9c366d9228b Mon Sep 17 00:00:00 2001 From: ruthra kumar Date: Mon, 20 Nov 2023 11:52:26 +0530 Subject: [PATCH 69/95] refactor: set default for 'update_billed_amount_in_delivery_note' (cherry picked from commit ee0c64215d160f0bd493bcefc9e94a5a90d318d2) --- erpnext/accounts/doctype/sales_invoice/sales_invoice.json | 4 ++-- erpnext/controllers/sales_and_purchase_return.py | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/erpnext/accounts/doctype/sales_invoice/sales_invoice.json b/erpnext/accounts/doctype/sales_invoice/sales_invoice.json index 5ec612f6b0fd..6b26d40303bc 100644 --- a/erpnext/accounts/doctype/sales_invoice/sales_invoice.json +++ b/erpnext/accounts/doctype/sales_invoice/sales_invoice.json @@ -2147,7 +2147,7 @@ "label": "Use Company default Cost Center for Round off" }, { - "default": "0", + "default": "1", "depends_on": "eval: doc.is_return", "fieldname": "update_billed_amount_in_delivery_note", "fieldtype": "Check", @@ -2164,7 +2164,7 @@ "link_fieldname": "consolidated_invoice" } ], - "modified": "2023-11-03 14:39:38.012346", + "modified": "2023-11-20 11:51:43.555197", "modified_by": "Administrator", "module": "Accounts", "name": "Sales Invoice", diff --git a/erpnext/controllers/sales_and_purchase_return.py b/erpnext/controllers/sales_and_purchase_return.py index a69b21c7c1d9..5a6c87c21697 100644 --- a/erpnext/controllers/sales_and_purchase_return.py +++ b/erpnext/controllers/sales_and_purchase_return.py @@ -356,6 +356,7 @@ def set_missing_values(source, target): if doc.doctype == "Sales Invoice" or doc.doctype == "POS Invoice": doc.consolidated_invoice = "" doc.set("payments", []) + doc.update_billed_amount_in_delivery_note = True for data in source.payments: paid_amount = 0.00 base_paid_amount = 0.00 From 9f8aa7c59d34d8de393e150eea5942b01e2fcc59 Mon Sep 17 00:00:00 2001 From: ruthra kumar Date: Mon, 20 Nov 2023 12:27:43 +0530 Subject: [PATCH 70/95] refactor: add flag to POS Invoice (cherry picked from commit 83a13e22b7f4aa8ba2c406389af4e7fa8aad55d0) # Conflicts: # erpnext/accounts/doctype/pos_invoice/pos_invoice.json --- .../accounts/doctype/pos_invoice/pos_invoice.json | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/erpnext/accounts/doctype/pos_invoice/pos_invoice.json b/erpnext/accounts/doctype/pos_invoice/pos_invoice.json index eedaaaf338b7..83b025e594c2 100644 --- a/erpnext/accounts/doctype/pos_invoice/pos_invoice.json +++ b/erpnext/accounts/doctype/pos_invoice/pos_invoice.json @@ -18,6 +18,7 @@ "is_pos", "is_return", "update_billed_amount_in_sales_order", + "update_billed_amount_in_delivery_note", "column_break1", "company", "posting_date", @@ -1549,12 +1550,23 @@ "fieldtype": "Currency", "label": "Amount Eligible for Commission", "read_only": 1 + }, + { + "default": "1", + "depends_on": "eval: doc.is_return && doc.return_against", + "fieldname": "update_billed_amount_in_delivery_note", + "fieldtype": "Check", + "label": "Update Billed Amount in Delivery Note" } ], "icon": "fa fa-file-text", "is_submittable": 1, "links": [], +<<<<<<< HEAD "modified": "2022-09-30 03:49:50.455199", +======= + "modified": "2023-11-20 12:27:12.848149", +>>>>>>> 83a13e22b7 (refactor: add flag to POS Invoice) "modified_by": "Administrator", "module": "Accounts", "name": "POS Invoice", From 12f027b3f48069c17f85acb562e5cfa48940886a Mon Sep 17 00:00:00 2001 From: ruthra kumar Date: Mon, 20 Nov 2023 14:15:03 +0530 Subject: [PATCH 71/95] chore: resolve conflict --- erpnext/accounts/doctype/pos_invoice/pos_invoice.json | 4 ---- 1 file changed, 4 deletions(-) diff --git a/erpnext/accounts/doctype/pos_invoice/pos_invoice.json b/erpnext/accounts/doctype/pos_invoice/pos_invoice.json index 83b025e594c2..de333cb9e8d1 100644 --- a/erpnext/accounts/doctype/pos_invoice/pos_invoice.json +++ b/erpnext/accounts/doctype/pos_invoice/pos_invoice.json @@ -1562,11 +1562,7 @@ "icon": "fa fa-file-text", "is_submittable": 1, "links": [], -<<<<<<< HEAD - "modified": "2022-09-30 03:49:50.455199", -======= "modified": "2023-11-20 12:27:12.848149", ->>>>>>> 83a13e22b7 (refactor: add flag to POS Invoice) "modified_by": "Administrator", "module": "Accounts", "name": "POS Invoice", From 562a55122b2e349aad09372203f4f53c23f29e07 Mon Sep 17 00:00:00 2001 From: ruthra kumar Date: Mon, 20 Nov 2023 13:26:02 +0530 Subject: [PATCH 72/95] refactor: update scheduled job for bulk transaction (cherry picked from commit fb06ad7330fd31bf1def7b87a6c3b787650f1555) --- erpnext/hooks.py | 2 +- erpnext/utilities/bulk_transaction.py | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/erpnext/hooks.py b/erpnext/hooks.py index 7eef6d9e9a8f..dad12c4d591b 100644 --- a/erpnext/hooks.py +++ b/erpnext/hooks.py @@ -424,7 +424,7 @@ "hourly_long": [ "erpnext.accounts.doctype.subscription.subscription.process_all", "erpnext.stock.doctype.repost_item_valuation.repost_item_valuation.repost_entries", - "erpnext.bulk_transaction.doctype.bulk_transaction_log.bulk_transaction_log.retry_failing_transaction", + "erpnext.utilities.bulk_transaction.retry", ], "daily": [ "erpnext.support.doctype.issue.issue.auto_close_tickets", diff --git a/erpnext/utilities/bulk_transaction.py b/erpnext/utilities/bulk_transaction.py index 402c305ca9ab..5c43bbe41da1 100644 --- a/erpnext/utilities/bulk_transaction.py +++ b/erpnext/utilities/bulk_transaction.py @@ -30,7 +30,10 @@ def transaction_processing(data, from_doctype, to_doctype): @frappe.whitelist() -def retry(date: str | None): +def retry(date: str | None = None): + if not date: + date = today() + if date: failed_docs = frappe.db.get_all( "Bulk Transaction Log Detail", From 392ee2e0fdad345429b11f6c126cd13cc244e83b Mon Sep 17 00:00:00 2001 From: Dany Robert Date: Mon, 20 Nov 2023 14:36:58 +0530 Subject: [PATCH 73/95] fix: round `unreconciled_amount` before asserting --- erpnext/accounts/utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/accounts/utils.py b/erpnext/accounts/utils.py index 01724ff55ca5..966e7e4bf1e3 100644 --- a/erpnext/accounts/utils.py +++ b/erpnext/accounts/utils.py @@ -533,7 +533,7 @@ def check_if_advance_entry_modified(args): where name = %(voucher_no)s and docstatus = 1 and party_type = %(party_type)s and party = %(party)s and {0} = %(account)s - and round(unallocated_amount, {1}) = %(unreconciled_amount)s + and round(unallocated_amount, {1}) = round(%(unreconciled_amount)s, {1}) """.format( party_account_field, precision ), From 3daf6f822a8c45779eeffc799c7eb2a05b25d7cf Mon Sep 17 00:00:00 2001 From: Anand Baburajan Date: Mon, 20 Nov 2023 22:27:25 +0530 Subject: [PATCH 74/95] fix: set default asset quantity as 1 [v14] (#38224) fix: set default asset quantity as 1 --- erpnext/assets/doctype/asset/asset.json | 3 ++- erpnext/assets/doctype/asset/asset.py | 1 + erpnext/controllers/buying_controller.py | 2 +- erpnext/patches.txt | 1 + erpnext/patches/v14_0/update_zero_asset_quantity_field.py | 6 ++++++ 5 files changed, 11 insertions(+), 2 deletions(-) create mode 100644 erpnext/patches/v14_0/update_zero_asset_quantity_field.py diff --git a/erpnext/assets/doctype/asset/asset.json b/erpnext/assets/doctype/asset/asset.json index b092d193cc4b..3b0d5d5e7fb3 100644 --- a/erpnext/assets/doctype/asset/asset.json +++ b/erpnext/assets/doctype/asset/asset.json @@ -495,6 +495,7 @@ "read_only": 1 }, { + "default": "1", "fieldname": "asset_quantity", "fieldtype": "Int", "label": "Asset Quantity", @@ -564,7 +565,7 @@ "link_fieldname": "target_asset" } ], - "modified": "2023-11-15 17:40:17.315203", + "modified": "2023-11-20 21:05:45.216899", "modified_by": "Administrator", "module": "Assets", "name": "Asset", diff --git a/erpnext/assets/doctype/asset/asset.py b/erpnext/assets/doctype/asset/asset.py index 902a28b286c9..9708c77f8243 100644 --- a/erpnext/assets/doctype/asset/asset.py +++ b/erpnext/assets/doctype/asset/asset.py @@ -1221,6 +1221,7 @@ def get_item_details(item_code, asset_category, gross_purchase_amount): "expected_value_after_useful_life": flt(gross_purchase_amount) * flt(d.salvage_value_percentage / 100), "depreciation_start_date": d.depreciation_start_date or nowdate(), + "rate_of_depreciation": d.rate_of_depreciation, } ) diff --git a/erpnext/controllers/buying_controller.py b/erpnext/controllers/buying_controller.py index 223e9bae2896..81736915f559 100644 --- a/erpnext/controllers/buying_controller.py +++ b/erpnext/controllers/buying_controller.py @@ -746,7 +746,7 @@ def make_asset(self, row, is_grouped_asset=False): "calculate_depreciation": 1, "purchase_receipt_amount": purchase_amount, "gross_purchase_amount": purchase_amount, - "asset_quantity": row.qty if is_grouped_asset else 0, + "asset_quantity": row.qty if is_grouped_asset else 1, "purchase_receipt": self.name if self.doctype == "Purchase Receipt" else None, "purchase_invoice": self.name if self.doctype == "Purchase Invoice" else None, "cost_center": row.cost_center, diff --git a/erpnext/patches.txt b/erpnext/patches.txt index 0fcf4fef1697..de663133a3f0 100644 --- a/erpnext/patches.txt +++ b/erpnext/patches.txt @@ -350,5 +350,6 @@ erpnext.patches.v14_0.rename_daily_depreciation_to_depreciation_amount_based_on_ erpnext.patches.v14_0.rename_depreciation_amount_based_on_num_days_in_month_to_daily_prorata_based erpnext.patches.v14_0.add_default_for_repost_settings erpnext.patches.v14_0.create_accounting_dimensions_in_supplier_quotation +erpnext.patches.v14_0.update_zero_asset_quantity_field # below migration patch should always run last erpnext.patches.v14_0.migrate_gl_to_payment_ledger diff --git a/erpnext/patches/v14_0/update_zero_asset_quantity_field.py b/erpnext/patches/v14_0/update_zero_asset_quantity_field.py new file mode 100644 index 000000000000..0480f9b7aade --- /dev/null +++ b/erpnext/patches/v14_0/update_zero_asset_quantity_field.py @@ -0,0 +1,6 @@ +import frappe + + +def execute(): + asset = frappe.qb.DocType("Asset") + frappe.qb.update(asset).set(asset.asset_quantity, 1).where(asset.asset_quantity == 0).run() From 59a5e132fe874e8bbebb2e73a5cce5d9e9cf2e86 Mon Sep 17 00:00:00 2001 From: ruthra kumar Date: Tue, 21 Nov 2023 11:46:45 +0530 Subject: [PATCH 75/95] test: prevent rounding loss based validation error (cherry picked from commit 56e991b7f49e4677605f74b1de7d00ab40bf09cc) --- .../test_payment_reconciliation.py | 34 +++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/erpnext/accounts/doctype/payment_reconciliation/test_payment_reconciliation.py b/erpnext/accounts/doctype/payment_reconciliation/test_payment_reconciliation.py index 71bc498b494f..d7a73f0ce714 100644 --- a/erpnext/accounts/doctype/payment_reconciliation/test_payment_reconciliation.py +++ b/erpnext/accounts/doctype/payment_reconciliation/test_payment_reconciliation.py @@ -1137,6 +1137,40 @@ def test_reconciliation_from_purchase_order_to_multiple_invoices(self): self.assertEqual(pay.unallocated_amount, 1000) self.assertEqual(pay.difference_amount, 0) + def test_rounding_of_unallocated_amount(self): + self.supplier = "_Test Supplier USD" + pi = self.create_purchase_invoice(qty=1, rate=10, do_not_submit=True) + pi.supplier = self.supplier + pi.currency = "USD" + pi.conversion_rate = 80 + pi.credit_to = self.creditors_usd + pi.save().submit() + + pe = get_payment_entry(pi.doctype, pi.name) + pe.target_exchange_rate = 78.726500000 + pe.received_amount = 26.75 + pe.paid_amount = 2105.93 + pe.references = [] + pe.save().submit() + + # unallocated_amount will have some rounding loss - 26.749950 + self.assertNotEqual(pe.unallocated_amount, 26.75) + + pr = frappe.get_doc("Payment Reconciliation") + pr.company = self.company + pr.party_type = "Supplier" + pr.party = self.supplier + pr.receivable_payable_account = self.creditors_usd + pr.from_invoice_date = pr.to_invoice_date = pr.from_payment_date = pr.to_payment_date = nowdate() + pr.get_unreconciled_entries() + + invoices = [invoice.as_dict() for invoice in pr.invoices] + payments = [payment.as_dict() for payment in pr.payments] + pr.allocate_entries(frappe._dict({"invoices": invoices, "payments": payments})) + + # Should not raise frappe.exceptions.ValidationError: Payment Entry has been modified after you pulled it. Please pull it again. + pr.reconcile() + def make_customer(customer_name, currency=None): if not frappe.db.exists("Customer", customer_name): From e08f1145c9e220d75720834b28e6351375b2592a Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Tue, 21 Nov 2023 13:41:08 +0530 Subject: [PATCH 76/95] fix(Timesheet): warn user if billing hours > actual hours instead of resetting (backport #38239) (#38240) fix(Timesheet): warn user if billing hours > actual hours instead of resetting (#38239) * revert: "fix(Timesheet): reset billing hours equal to hours if they exceed actual hours" This reverts commit 0ec8034507996f06eaf8ca13a414d10b34038c6c. * fix: warn user if billing hours > actual hours (cherry picked from commit ac91030b31f1108b7e32844f12a3a6c916c0120f) Co-authored-by: Rucha Mahabal --- erpnext/projects/doctype/timesheet/timesheet.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/erpnext/projects/doctype/timesheet/timesheet.py b/erpnext/projects/doctype/timesheet/timesheet.py index d854eae8fb64..e63ac144f648 100644 --- a/erpnext/projects/doctype/timesheet/timesheet.py +++ b/erpnext/projects/doctype/timesheet/timesheet.py @@ -63,8 +63,14 @@ def calculate_percentage_billed(self): def update_billing_hours(self, args): if args.is_billable: - if flt(args.billing_hours) == 0.0 or flt(args.billing_hours) > flt(args.hours): + if flt(args.billing_hours) == 0.0: args.billing_hours = args.hours + elif flt(args.billing_hours) > flt(args.hours): + frappe.msgprint( + _("Warning - Row {0}: Billing Hours are more than Actual Hours").format(args.idx), + indicator="orange", + alert=True, + ) else: args.billing_hours = 0 From 00def82843e09a4683ab3ef2308665919071e9c8 Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Tue, 21 Nov 2023 22:53:31 +0530 Subject: [PATCH 77/95] fix: set asset's valuation_rate according to asset quantity (backport #38254) (#38255) fix: set asset's valuation_rate according to asset quantity (#38254) (cherry picked from commit e2bb4e2baa9059afb27f685beb88172a615097a4) Co-authored-by: Anand Baburajan --- .../doctype/purchase_receipt/purchase_receipt.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/erpnext/stock/doctype/purchase_receipt/purchase_receipt.py b/erpnext/stock/doctype/purchase_receipt/purchase_receipt.py index 10bd335468d5..d8c678737ea6 100644 --- a/erpnext/stock/doctype/purchase_receipt/purchase_receipt.py +++ b/erpnext/stock/doctype/purchase_receipt/purchase_receipt.py @@ -732,12 +732,18 @@ def make_tax_gl_entries(self, gl_entries): def update_assets(self, item, valuation_rate): assets = frappe.db.get_all( - "Asset", filters={"purchase_receipt": self.name, "item_code": item.item_code} + "Asset", + filters={"purchase_receipt": self.name, "item_code": item.item_code}, + fields=["name", "asset_quantity"], ) for asset in assets: - frappe.db.set_value("Asset", asset.name, "gross_purchase_amount", flt(valuation_rate)) - frappe.db.set_value("Asset", asset.name, "purchase_receipt_amount", flt(valuation_rate)) + frappe.db.set_value( + "Asset", asset.name, "gross_purchase_amount", flt(valuation_rate) * asset.asset_quantity + ) + frappe.db.set_value( + "Asset", asset.name, "purchase_receipt_amount", flt(valuation_rate) * asset.asset_quantity + ) def update_status(self, status): self.set_status(update=True, status=status) From 7392f9c6624db295dda6060c52a269cad7c8bc5b Mon Sep 17 00:00:00 2001 From: Frappe PR Bot Date: Wed, 22 Nov 2023 04:16:31 +0000 Subject: [PATCH 78/95] chore(release): Bumped to Version 14.49.0 # [14.49.0](https://github.com/frappe/erpnext/compare/v14.48.1...v14.49.0) (2023-11-22) ### Bug Fixes * add revaluation journal filter in Payable report ([d0698b3](https://github.com/frappe/erpnext/commit/d0698b32bbde5ac4d4e0e33d3c8ca2f10f0d7cc3)) * attributes were mandatory for manufacturers ([430980a](https://github.com/frappe/erpnext/commit/430980a836611e0d2a738aab1e4a3b73d47481c9)) * duplicate field in `Closing Stock Balance` ([#38105](https://github.com/frappe/erpnext/issues/38105)) ([1f16c47](https://github.com/frappe/erpnext/commit/1f16c47a2c4562bf5c2e7d7b4bafe7604efbb36a)) * incorrect incoming rate for serial and batch items in standalone debit note ([#38121](https://github.com/frappe/erpnext/issues/38121)) ([9a34518](https://github.com/frappe/erpnext/commit/9a34518e543692201c1166c154f91976e6ec989a)) * pass check permission in render_address ([1ccd5e4](https://github.com/frappe/erpnext/commit/1ccd5e4ff55f24aed69484a19cf86bc4304a127d)) * payment entry rounding error ([49735bc](https://github.com/frappe/erpnext/commit/49735bc1204ff3ca349f8dff168666a6cbe7b14d)) * remove ESS role when not mapped to employee (backport [#37867](https://github.com/frappe/erpnext/issues/37867)) ([#38132](https://github.com/frappe/erpnext/issues/38132)) ([bc01007](https://github.com/frappe/erpnext/commit/bc01007c160ee4f0bb987fab77630c441f38a08b)) * round `unreconciled_amount` before asserting ([392ee2e](https://github.com/frappe/erpnext/commit/392ee2e0fdad345429b11f6c126cd13cc244e83b)) * set asset's valuation_rate according to asset quantity (backport [#38254](https://github.com/frappe/erpnext/issues/38254)) ([#38255](https://github.com/frappe/erpnext/issues/38255)) ([00def82](https://github.com/frappe/erpnext/commit/00def82843e09a4683ab3ef2308665919071e9c8)) * set default asset quantity as 1 [v14] ([#38224](https://github.com/frappe/erpnext/issues/38224)) ([3daf6f8](https://github.com/frappe/erpnext/commit/3daf6f822a8c45779eeffc799c7eb2a05b25d7cf)) * show party values when naming by is not naming series ([dd76695](https://github.com/frappe/erpnext/commit/dd76695d3a263f75ae39808a62f14f32afab6f34)) * Supplier Quotation fields ([#37963](https://github.com/frappe/erpnext/issues/37963)) ([883eaee](https://github.com/frappe/erpnext/commit/883eaee0143ae22998a86ab2b9e011b398a677c3)) * test case for rounded total with cash disc ([9b5185a](https://github.com/frappe/erpnext/commit/9b5185adc930d59e9c58246f7c51a403e32c6062)) * **Timesheet:** reset billing hours equal to hours if they exceed actual hours (backport [#38134](https://github.com/frappe/erpnext/issues/38134)) ([#38152](https://github.com/frappe/erpnext/issues/38152)) ([c7c751e](https://github.com/frappe/erpnext/commit/c7c751ecd0d16c568c26ab473df6167f84a9a2f3)) * **Timesheet:** warn user if billing hours > actual hours instead of resetting (backport [#38239](https://github.com/frappe/erpnext/issues/38239)) ([#38240](https://github.com/frappe/erpnext/issues/38240)) ([e08f114](https://github.com/frappe/erpnext/commit/e08f1145c9e220d75720834b28e6351375b2592a)) * update modified timestamp ([2849e0d](https://github.com/frappe/erpnext/commit/2849e0daed1f7690d1c30abf4644736decc9711d)) * valuation rate in report Item Prices ([#38161](https://github.com/frappe/erpnext/issues/38161)) ([a70696e](https://github.com/frappe/erpnext/commit/a70696ea777258cfcf41ccddae9dd0ddba98ce8e)) * wrong round off and rounded total ([296433a](https://github.com/frappe/erpnext/commit/296433a1ddeaa8874d45c05b6c8f649503eeb3cc)) ### Features * add `Supplier Delivery Note` field in SCR (backport [#38127](https://github.com/frappe/erpnext/issues/38127)) ([#38155](https://github.com/frappe/erpnext/issues/38155)) ([8d4a19c](https://github.com/frappe/erpnext/commit/8d4a19cecfd992cf5522c7b976c26b556db2e47b)) * Add accounting dimensions to Supplier Quotation ([51e33e1](https://github.com/frappe/erpnext/commit/51e33e1556302a4f5f006ceac02303c8e18dea6e)) * virtual parent doctype ([8dbf2ce](https://github.com/frappe/erpnext/commit/8dbf2ced797ff8fb9a9ed5ffbbbbdcb4968ef4e7)) --- erpnext/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/__init__.py b/erpnext/__init__.py index 34711be40020..8a1f277003df 100644 --- a/erpnext/__init__.py +++ b/erpnext/__init__.py @@ -3,7 +3,7 @@ import frappe -__version__ = "14.48.1" +__version__ = "14.49.0" def get_default_company(user=None): From c1a7d614a2c2c02192fc4e2a246a8c2e02de3496 Mon Sep 17 00:00:00 2001 From: Smit Vora Date: Wed, 22 Nov 2023 10:07:38 +0530 Subject: [PATCH 79/95] test: partial cancel for gl entries reversal --- .../payment_entry/test_payment_entry.py | 72 +++++++++++++++++++ 1 file changed, 72 insertions(+) diff --git a/erpnext/accounts/doctype/payment_entry/test_payment_entry.py b/erpnext/accounts/doctype/payment_entry/test_payment_entry.py index 2de009f8c438..536cdba565cb 100644 --- a/erpnext/accounts/doctype/payment_entry/test_payment_entry.py +++ b/erpnext/accounts/doctype/payment_entry/test_payment_entry.py @@ -1,6 +1,7 @@ # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # See license.txt +import json import unittest import frappe @@ -21,6 +22,7 @@ create_sales_invoice, create_sales_invoice_against_cost_center, ) +from erpnext.accounts.general_ledger import make_gl_entries, make_reverse_gl_entries from erpnext.selling.doctype.sales_order.test_sales_order import make_sales_order from erpnext.setup.doctype.employee.test_employee import make_employee @@ -1219,6 +1221,76 @@ def test_allocation_validation_for_sales_order(self): so.reload() self.assertEqual(so.advance_paid, so.rounded_total) + def test_partial_cancel_for_payment_entry(self): + si = create_sales_invoice() + + pe = get_payment_entry(si.doctype, si.name) + pe.save() + pe.submit() + + # Additional GL Entry + tax_amount = 10 + reference_row = pe.references[0] + gl_args = { + "party_type": pe.party_type, + "party": pe.party, + "against_voucher_type": reference_row.reference_doctype, + "against_voucher": reference_row.reference_name, + "voucher_detail_no": reference_row.name, + } + + gl_dicts = [] + + gl_dicts.extend( + [ + pe.get_gl_dict( + { + "account": pe.paid_to, + "credit": tax_amount, + "credit_in_account_currency": tax_amount, + **gl_args, + } + ), + pe.get_gl_dict( + { + "account": pe.paid_from, + "debit": tax_amount, + "debit_in_account_currency": tax_amount, + **gl_args, + } + ), + ] + ) + + make_gl_entries(gl_dicts) + + # Assert PLEs Before + self.assertPLEntries( + pe, + [ + {"amount": -100.0, "against_voucher_no": si.name}, + {"amount": 10.0, "against_voucher_no": si.name}, + ], + ) + + # Partially cancel Payment Entry + make_reverse_gl_entries(gl_dicts, partial_cancel=True) + self.assertPLEntries(pe, [{"amount": -100.0, "against_voucher_no": si.name}]) + + def assertPLEntries(self, payment_doc, expected_pl_entries): + pl_entries = frappe.get_all( + "Payment Ledger Entry", + filters={ + "voucher_type": payment_doc.doctype, + "voucher_no": payment_doc.name, + "delinked": 0, + }, + fields=["amount", "against_voucher_no"], + ) + out_str = json.dumps(sorted(pl_entries, key=json.dumps)) + expected_out_str = json.dumps(sorted(expected_pl_entries, key=json.dumps)) + self.assertEqual(out_str, expected_out_str) + def create_payment_entry(**args): payment_entry = frappe.new_doc("Payment Entry") From ac13e7362cec0aa491da62dd6a1026d7ea440d73 Mon Sep 17 00:00:00 2001 From: ruthra kumar Date: Wed, 22 Nov 2023 09:59:32 +0530 Subject: [PATCH 80/95] refactor: optimize outstanding vouchers query (cherry picked from commit 8b04c1d4f6356bc332c5dd8f6f8711d778e030cd) --- erpnext/accounts/utils.py | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/erpnext/accounts/utils.py b/erpnext/accounts/utils.py index 3d426919fcf5..bd917e5edef2 100644 --- a/erpnext/accounts/utils.py +++ b/erpnext/accounts/utils.py @@ -1796,6 +1796,28 @@ def query_for_outstanding(self): Table("outstanding").amount_in_account_currency >= self.max_outstanding ) + if self.limit and self.get_invoices: + outstanding_vouchers = ( + qb.from_(ple) + .select( + ple.against_voucher_no.as_("voucher_no"), + Sum(ple.amount_in_account_currency).as_("amount_in_account_currency"), + ) + .where(ple.delinked == 0) + .where(Criterion.all(filter_on_against_voucher_no)) + .where(Criterion.all(self.common_filter)) + .groupby(ple.against_voucher_type, ple.against_voucher_no, ple.party_type, ple.party) + .orderby(ple.posting_date, ple.voucher_no) + .having(qb.Field("amount_in_account_currency") > 0) + .limit(self.limit) + .run() + ) + if outstanding_vouchers: + filter_on_voucher_no.append(ple.voucher_no.isin([x[0] for x in outstanding_vouchers])) + filter_on_against_voucher_no.append( + ple.against_voucher_no.isin([x[0] for x in outstanding_vouchers]) + ) + # build query for voucher amount query_voucher_amount = ( qb.from_(ple) From 57c6d616e6fac35566db6fd946fac260f4b0f49d Mon Sep 17 00:00:00 2001 From: ruthra kumar Date: Tue, 21 Nov 2023 16:44:01 +0530 Subject: [PATCH 81/95] chore: rename 'unreconcile payments' to 'unreconcile payment' (cherry picked from commit 9006c9b7478ceee5f7662d62e8eb02a08a309906) --- .../{unreconcile_payments => unreconcile_payment}/__init__.py | 0 .../test_unreconcile_payment.py} | 2 +- .../unreconcile_payment.js} | 2 +- .../unreconcile_payment.json} | 2 +- .../unreconcile_payment.py} | 2 +- 5 files changed, 4 insertions(+), 4 deletions(-) rename erpnext/accounts/doctype/{unreconcile_payments => unreconcile_payment}/__init__.py (100%) rename erpnext/accounts/doctype/{unreconcile_payments/test_unreconcile_payments.py => unreconcile_payment/test_unreconcile_payment.py} (99%) rename erpnext/accounts/doctype/{unreconcile_payments/unreconcile_payments.js => unreconcile_payment/unreconcile_payment.js} (94%) rename erpnext/accounts/doctype/{unreconcile_payments/unreconcile_payments.json => unreconcile_payment/unreconcile_payment.json} (98%) rename erpnext/accounts/doctype/{unreconcile_payments/unreconcile_payments.py => unreconcile_payment/unreconcile_payment.py} (99%) diff --git a/erpnext/accounts/doctype/unreconcile_payments/__init__.py b/erpnext/accounts/doctype/unreconcile_payment/__init__.py similarity index 100% rename from erpnext/accounts/doctype/unreconcile_payments/__init__.py rename to erpnext/accounts/doctype/unreconcile_payment/__init__.py diff --git a/erpnext/accounts/doctype/unreconcile_payments/test_unreconcile_payments.py b/erpnext/accounts/doctype/unreconcile_payment/test_unreconcile_payment.py similarity index 99% rename from erpnext/accounts/doctype/unreconcile_payments/test_unreconcile_payments.py rename to erpnext/accounts/doctype/unreconcile_payment/test_unreconcile_payment.py index 78e04bff8198..0f1a35117690 100644 --- a/erpnext/accounts/doctype/unreconcile_payments/test_unreconcile_payments.py +++ b/erpnext/accounts/doctype/unreconcile_payment/test_unreconcile_payment.py @@ -10,7 +10,7 @@ from erpnext.accounts.test.accounts_mixin import AccountsTestMixin -class TestUnreconcilePayments(AccountsTestMixin, FrappeTestCase): +class TestUnreconcilePayment(AccountsTestMixin, FrappeTestCase): def setUp(self): self.create_company() self.create_customer() diff --git a/erpnext/accounts/doctype/unreconcile_payments/unreconcile_payments.js b/erpnext/accounts/doctype/unreconcile_payment/unreconcile_payment.js similarity index 94% rename from erpnext/accounts/doctype/unreconcile_payments/unreconcile_payments.js rename to erpnext/accounts/doctype/unreconcile_payment/unreconcile_payment.js index c522567637fb..70cefb13b572 100644 --- a/erpnext/accounts/doctype/unreconcile_payments/unreconcile_payments.js +++ b/erpnext/accounts/doctype/unreconcile_payment/unreconcile_payment.js @@ -1,7 +1,7 @@ // Copyright (c) 2023, Frappe Technologies Pvt. Ltd. and contributors // For license information, please see license.txt -frappe.ui.form.on("Unreconcile Payments", { +frappe.ui.form.on("Unreconcile Payment", { refresh(frm) { frm.set_query("voucher_type", function() { return { diff --git a/erpnext/accounts/doctype/unreconcile_payments/unreconcile_payments.json b/erpnext/accounts/doctype/unreconcile_payment/unreconcile_payment.json similarity index 98% rename from erpnext/accounts/doctype/unreconcile_payments/unreconcile_payments.json rename to erpnext/accounts/doctype/unreconcile_payment/unreconcile_payment.json index f29e61b6ef67..17e0b4ddd31f 100644 --- a/erpnext/accounts/doctype/unreconcile_payments/unreconcile_payments.json +++ b/erpnext/accounts/doctype/unreconcile_payment/unreconcile_payment.json @@ -61,7 +61,7 @@ "modified": "2023-08-28 17:42:50.261377", "modified_by": "Administrator", "module": "Accounts", - "name": "Unreconcile Payments", + "name": "Unreconcile Payment", "naming_rule": "Expression", "owner": "Administrator", "permissions": [ diff --git a/erpnext/accounts/doctype/unreconcile_payments/unreconcile_payments.py b/erpnext/accounts/doctype/unreconcile_payment/unreconcile_payment.py similarity index 99% rename from erpnext/accounts/doctype/unreconcile_payments/unreconcile_payments.py rename to erpnext/accounts/doctype/unreconcile_payment/unreconcile_payment.py index 4f9fb50d463c..9abd7523507e 100644 --- a/erpnext/accounts/doctype/unreconcile_payments/unreconcile_payments.py +++ b/erpnext/accounts/doctype/unreconcile_payment/unreconcile_payment.py @@ -15,7 +15,7 @@ ) -class UnreconcilePayments(Document): +class UnreconcilePayment(Document): def validate(self): self.supported_types = ["Payment Entry", "Journal Entry"] if not self.voucher_type in self.supported_types: From 82fa58d4e317c53c5c35bcf34dd48cb478d3457b Mon Sep 17 00:00:00 2001 From: ruthra kumar Date: Tue, 21 Nov 2023 16:51:06 +0530 Subject: [PATCH 82/95] chore: update new unreconcile doctype name in JS and PY files (cherry picked from commit 74f9e34182563b5dd3ef71d93b66596a12be5e91) --- .../doctype/journal_entry/journal_entry.js | 2 +- .../doctype/payment_entry/payment_entry.js | 4 ++-- .../doctype/payment_entry/payment_entry.py | 2 +- .../doctype/purchase_invoice/purchase_invoice.js | 2 +- .../doctype/sales_invoice/sales_invoice.js | 4 ++-- .../doctype/sales_invoice/sales_invoice.py | 2 +- .../test_unreconcile_payment.py | 8 ++++---- .../unreconcile_payment/unreconcile_payment.json | 4 ++-- .../unreconcile_payment/unreconcile_payment.py | 2 +- erpnext/controllers/accounts_controller.py | 6 +++--- erpnext/public/js/utils/unreconcile.js | 14 +++++++------- 11 files changed, 25 insertions(+), 25 deletions(-) diff --git a/erpnext/accounts/doctype/journal_entry/journal_entry.js b/erpnext/accounts/doctype/journal_entry/journal_entry.js index fe570a5ba8aa..cf1341b9c704 100644 --- a/erpnext/accounts/doctype/journal_entry/journal_entry.js +++ b/erpnext/accounts/doctype/journal_entry/journal_entry.js @@ -51,7 +51,7 @@ frappe.ui.form.on("Journal Entry", { }, __('Make')); } - erpnext.accounts.unreconcile_payments.add_unreconcile_btn(frm); + erpnext.accounts.unreconcile_payment.add_unreconcile_btn(frm); }, before_save: function(frm) { if ((frm.doc.docstatus == 0) && (!frm.doc.is_system_generated)) { diff --git a/erpnext/accounts/doctype/payment_entry/payment_entry.js b/erpnext/accounts/doctype/payment_entry/payment_entry.js index f6280307e9c6..d5eeae5ab343 100644 --- a/erpnext/accounts/doctype/payment_entry/payment_entry.js +++ b/erpnext/accounts/doctype/payment_entry/payment_entry.js @@ -7,7 +7,7 @@ cur_frm.cscript.tax_table = "Advance Taxes and Charges"; frappe.ui.form.on('Payment Entry', { onload: function(frm) { - frm.ignore_doctypes_on_cancel_all = ['Sales Invoice', 'Purchase Invoice', 'Journal Entry', 'Repost Payment Ledger','Repost Accounting Ledger', 'Unreconcile Payments', 'Unreconcile Payment Entries']; + frm.ignore_doctypes_on_cancel_all = ['Sales Invoice', 'Purchase Invoice', 'Journal Entry', 'Repost Payment Ledger','Repost Accounting Ledger', 'Unreconcile Payment', 'Unreconcile Payment Entries']; if(frm.doc.__islocal) { if (!frm.doc.paid_from) frm.set_value("paid_from_account_currency", null); @@ -158,7 +158,7 @@ frappe.ui.form.on('Payment Entry', { }, __('Actions')); } - erpnext.accounts.unreconcile_payments.add_unreconcile_btn(frm); + erpnext.accounts.unreconcile_payment.add_unreconcile_btn(frm); }, validate_company: (frm) => { diff --git a/erpnext/accounts/doctype/payment_entry/payment_entry.py b/erpnext/accounts/doctype/payment_entry/payment_entry.py index 03c939cf079c..6abb75dc67c7 100644 --- a/erpnext/accounts/doctype/payment_entry/payment_entry.py +++ b/erpnext/accounts/doctype/payment_entry/payment_entry.py @@ -107,7 +107,7 @@ def on_cancel(self): "Repost Payment Ledger Items", "Repost Accounting Ledger", "Repost Accounting Ledger Items", - "Unreconcile Payments", + "Unreconcile Payment", "Unreconcile Payment Entries", ) super(PaymentEntry, self).on_cancel() diff --git a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.js b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.js index 04b00e09a44c..7f0f04ea651d 100644 --- a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.js +++ b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.js @@ -181,7 +181,7 @@ erpnext.accounts.PurchaseInvoice = class PurchaseInvoice extends erpnext.buying. } this.frm.set_df_property("tax_withholding_category", "hidden", doc.apply_tds ? 0 : 1); - erpnext.accounts.unreconcile_payments.add_unreconcile_btn(me.frm); + erpnext.accounts.unreconcile_payment.add_unreconcile_btn(me.frm); } unblock_invoice() { diff --git a/erpnext/accounts/doctype/sales_invoice/sales_invoice.js b/erpnext/accounts/doctype/sales_invoice/sales_invoice.js index 75b87421dd78..1a04841fd52b 100644 --- a/erpnext/accounts/doctype/sales_invoice/sales_invoice.js +++ b/erpnext/accounts/doctype/sales_invoice/sales_invoice.js @@ -34,7 +34,7 @@ erpnext.accounts.SalesInvoiceController = class SalesInvoiceController extends e super.onload(); this.frm.ignore_doctypes_on_cancel_all = ['POS Invoice', 'Timesheet', 'POS Invoice Merge Log', - 'POS Closing Entry', 'Journal Entry', 'Payment Entry', "Repost Payment Ledger", "Repost Accounting Ledger", "Unreconcile Payments", "Unreconcile Payment Entries"]; + 'POS Closing Entry', 'Journal Entry', 'Payment Entry', "Repost Payment Ledger", "Repost Accounting Ledger", "Unreconcile Payment", "Unreconcile Payment Entries"]; if(!this.frm.doc.__islocal && !this.frm.doc.customer && this.frm.doc.debit_to) { // show debit_to in print format @@ -178,7 +178,7 @@ erpnext.accounts.SalesInvoiceController = class SalesInvoiceController extends e } } - erpnext.accounts.unreconcile_payments.add_unreconcile_btn(me.frm); + erpnext.accounts.unreconcile_payment.add_unreconcile_btn(me.frm); } make_maintenance_schedule() { diff --git a/erpnext/accounts/doctype/sales_invoice/sales_invoice.py b/erpnext/accounts/doctype/sales_invoice/sales_invoice.py index 339c5c2778b5..27ba8853c7da 100644 --- a/erpnext/accounts/doctype/sales_invoice/sales_invoice.py +++ b/erpnext/accounts/doctype/sales_invoice/sales_invoice.py @@ -408,7 +408,7 @@ def on_cancel(self): "Repost Payment Ledger Items", "Repost Accounting Ledger", "Repost Accounting Ledger Items", - "Unreconcile Payments", + "Unreconcile Payment", "Unreconcile Payment Entries", "Payment Ledger Entry", ) diff --git a/erpnext/accounts/doctype/unreconcile_payment/test_unreconcile_payment.py b/erpnext/accounts/doctype/unreconcile_payment/test_unreconcile_payment.py index 0f1a35117690..f404d9981a35 100644 --- a/erpnext/accounts/doctype/unreconcile_payment/test_unreconcile_payment.py +++ b/erpnext/accounts/doctype/unreconcile_payment/test_unreconcile_payment.py @@ -73,7 +73,7 @@ def test_01_unreconcile_invoice(self): unreconcile = frappe.get_doc( { - "doctype": "Unreconcile Payments", + "doctype": "Unreconcile Payment", "company": self.company, "voucher_type": pe.doctype, "voucher_no": pe.name, @@ -138,7 +138,7 @@ def test_02_unreconcile_one_payment_from_multi_payments(self): unreconcile = frappe.get_doc( { - "doctype": "Unreconcile Payments", + "doctype": "Unreconcile Payment", "company": self.company, "voucher_type": pe2.doctype, "voucher_no": pe2.name, @@ -196,7 +196,7 @@ def test_03_unreconciliation_on_multi_currency_invoice(self): unreconcile = frappe.get_doc( { - "doctype": "Unreconcile Payments", + "doctype": "Unreconcile Payment", "company": self.company, "voucher_type": pe.doctype, "voucher_no": pe.name, @@ -281,7 +281,7 @@ def test_04_unreconciliation_on_multi_currency_invoice(self): unreconcile = frappe.get_doc( { - "doctype": "Unreconcile Payments", + "doctype": "Unreconcile Payment", "company": self.company, "voucher_type": pe2.doctype, "voucher_no": pe2.name, diff --git a/erpnext/accounts/doctype/unreconcile_payment/unreconcile_payment.json b/erpnext/accounts/doctype/unreconcile_payment/unreconcile_payment.json index 17e0b4ddd31f..f906dc6cec6a 100644 --- a/erpnext/accounts/doctype/unreconcile_payment/unreconcile_payment.json +++ b/erpnext/accounts/doctype/unreconcile_payment/unreconcile_payment.json @@ -21,7 +21,7 @@ "fieldtype": "Link", "label": "Amended From", "no_copy": 1, - "options": "Unreconcile Payments", + "options": "Unreconcile Payment", "print_hide": 1, "read_only": 1 }, @@ -90,4 +90,4 @@ "sort_order": "DESC", "states": [], "track_changes": 1 -} \ No newline at end of file +} diff --git a/erpnext/accounts/doctype/unreconcile_payment/unreconcile_payment.py b/erpnext/accounts/doctype/unreconcile_payment/unreconcile_payment.py index 9abd7523507e..77906a783323 100644 --- a/erpnext/accounts/doctype/unreconcile_payment/unreconcile_payment.py +++ b/erpnext/accounts/doctype/unreconcile_payment/unreconcile_payment.py @@ -142,7 +142,7 @@ def create_unreconcile_doc_for_selection(selections=None): selections = frappe.json.loads(selections) # assuming each row is a unique voucher for row in selections: - unrecon = frappe.new_doc("Unreconcile Payments") + unrecon = frappe.new_doc("Unreconcile Payment") unrecon.company = row.get("company") unrecon.voucher_type = row.get("voucher_type") unrecon.voucher_no = row.get("voucher_no") diff --git a/erpnext/controllers/accounts_controller.py b/erpnext/controllers/accounts_controller.py index 9a34af2c66cc..99f52416537f 100644 --- a/erpnext/controllers/accounts_controller.py +++ b/erpnext/controllers/accounts_controller.py @@ -238,7 +238,7 @@ def _remove_references_in_unreconcile(self): references_map.setdefault(x.parent, []).append(x.name) for doc, rows in references_map.items(): - unreconcile_doc = frappe.get_doc("Unreconcile Payments", doc) + unreconcile_doc = frappe.get_doc("Unreconcile Payment", doc) for row in rows: unreconcile_doc.remove(unreconcile_doc.get("allocations", {"name": row})[0]) @@ -247,9 +247,9 @@ def _remove_references_in_unreconcile(self): unreconcile_doc.save(ignore_permissions=True) # delete docs upon parent doc deletion - unreconcile_docs = frappe.db.get_all("Unreconcile Payments", filters={"voucher_no": self.name}) + unreconcile_docs = frappe.db.get_all("Unreconcile Payment", filters={"voucher_no": self.name}) for x in unreconcile_docs: - _doc = frappe.get_doc("Unreconcile Payments", x.name) + _doc = frappe.get_doc("Unreconcile Payment", x.name) if _doc.docstatus == 1: _doc.cancel() _doc.delete() diff --git a/erpnext/public/js/utils/unreconcile.js b/erpnext/public/js/utils/unreconcile.js index fa00ed23620c..79490a162d3f 100644 --- a/erpnext/public/js/utils/unreconcile.js +++ b/erpnext/public/js/utils/unreconcile.js @@ -1,6 +1,6 @@ frappe.provide('erpnext.accounts'); -erpnext.accounts.unreconcile_payments = { +erpnext.accounts.unreconcile_payment = { add_unreconcile_btn(frm) { if (frm.doc.docstatus == 1) { if(((frm.doc.doctype == "Journal Entry") && (frm.doc.voucher_type != "Journal Entry")) @@ -10,7 +10,7 @@ erpnext.accounts.unreconcile_payments = { } frappe.call({ - "method": "erpnext.accounts.doctype.unreconcile_payments.unreconcile_payments.doc_has_references", + "method": "erpnext.accounts.doctype.unreconcile_payment.unreconcile_payment.doc_has_references", "args": { "doctype": frm.doc.doctype, "docname": frm.doc.name @@ -18,7 +18,7 @@ erpnext.accounts.unreconcile_payments = { callback: function(r) { if (r.message) { frm.add_custom_button(__("UnReconcile"), function() { - erpnext.accounts.unreconcile_payments.build_unreconcile_dialog(frm); + erpnext.accounts.unreconcile_payment.build_unreconcile_dialog(frm); }, __('Actions')); } } @@ -74,7 +74,7 @@ erpnext.accounts.unreconcile_payments = { // get linked payments frappe.call({ - "method": "erpnext.accounts.doctype.unreconcile_payments.unreconcile_payments.get_linked_payments_for_doc", + "method": "erpnext.accounts.doctype.unreconcile_payment.unreconcile_payment.get_linked_payments_for_doc", "args": { "company": frm.doc.company, "doctype": frm.doc.doctype, @@ -96,8 +96,8 @@ erpnext.accounts.unreconcile_payments = { let selected_allocations = values.allocations.filter(x=>x.__checked); if (selected_allocations.length > 0) { - let selection_map = erpnext.accounts.unreconcile_payments.build_selection_map(frm, selected_allocations); - erpnext.accounts.unreconcile_payments.create_unreconcile_docs(selection_map); + let selection_map = erpnext.accounts.unreconcile_payment.build_selection_map(frm, selected_allocations); + erpnext.accounts.unreconcile_payment.create_unreconcile_docs(selection_map); d.hide(); } else { @@ -115,7 +115,7 @@ erpnext.accounts.unreconcile_payments = { create_unreconcile_docs(selection_map) { frappe.call({ - "method": "erpnext.accounts.doctype.unreconcile_payments.unreconcile_payments.create_unreconcile_doc_for_selection", + "method": "erpnext.accounts.doctype.unreconcile_payment.unreconcile_payment.create_unreconcile_doc_for_selection", "args": { "selections": selection_map }, From f170cb921453bf7e2b59198f60a81e442df1fae2 Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Thu, 23 Nov 2023 11:45:57 +0530 Subject: [PATCH 83/95] fix: Supplier `Primary Contact` (backport #38268) (#38285) fix: Supplier `Primary Contact` (cherry picked from commit 627165dc7c6c1cd83d746b97c82210abeb9a2e29) Co-authored-by: s-aga-r --- erpnext/buying/doctype/supplier/supplier.py | 27 +++++++++++---------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/erpnext/buying/doctype/supplier/supplier.py b/erpnext/buying/doctype/supplier/supplier.py index c96519a91538..91061c8fe8bc 100644 --- a/erpnext/buying/doctype/supplier/supplier.py +++ b/erpnext/buying/doctype/supplier/supplier.py @@ -143,16 +143,17 @@ def after_rename(self, olddn, newdn, merge=False): @frappe.validate_and_sanitize_search_inputs def get_supplier_primary_contact(doctype, txt, searchfield, start, page_len, filters): supplier = filters.get("supplier") - return frappe.db.sql( - """ - SELECT - `tabContact`.name from `tabContact`, - `tabDynamic Link` - WHERE - `tabContact`.name = `tabDynamic Link`.parent - and `tabDynamic Link`.link_name = %(supplier)s - and `tabDynamic Link`.link_doctype = 'Supplier' - and `tabContact`.name like %(txt)s - """, - {"supplier": supplier, "txt": "%%%s%%" % txt}, - ) + contact = frappe.qb.DocType("Contact") + dynamic_link = frappe.qb.DocType("Dynamic Link") + + return ( + frappe.qb.from_(contact) + .join(dynamic_link) + .on(contact.name == dynamic_link.parent) + .select(contact.name, contact.email_id) + .where( + (dynamic_link.link_name == supplier) + & (dynamic_link.link_doctype == "Supplier") + & (contact.name.like("%{0}%".format(txt))) + ) + ).run(as_dict=False) From 5261aba81fb72154c14d96ce976e24a60cf948c2 Mon Sep 17 00:00:00 2001 From: Anand Baburajan Date: Thu, 23 Nov 2023 14:15:40 +0530 Subject: [PATCH 84/95] fix: don't depreciate non-depreciable assets on scrapping [v14] (#38294) fix: don't depreciate non-depreciable assets on scrapping --- erpnext/assets/doctype/asset/depreciation.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/erpnext/assets/doctype/asset/depreciation.py b/erpnext/assets/doctype/asset/depreciation.py index 8e5658e318e8..6f76955e12d1 100644 --- a/erpnext/assets/doctype/asset/depreciation.py +++ b/erpnext/assets/doctype/asset/depreciation.py @@ -464,6 +464,9 @@ def restore_asset(asset_name): def depreciate_asset(asset, date): + if not asset.calculate_depreciation: + return + asset.flags.ignore_validate_update_after_submit = True asset.prepare_depreciation_data(date_of_disposal=date) asset.save() @@ -472,6 +475,9 @@ def depreciate_asset(asset, date): def reset_depreciation_schedule(asset, date): + if not asset.calculate_depreciation: + return + asset.flags.ignore_validate_update_after_submit = True # recreate original depreciation schedule of the asset From 06c6da5c0dc6bc9c1ba2375e93738fbb84af66e7 Mon Sep 17 00:00:00 2001 From: Raffael Meyer <14891507+barredterra@users.noreply.github.com> Date: Thu, 23 Nov 2023 14:02:27 +0100 Subject: [PATCH 85/95] feat: add Bank Transaction to connections in Journal and Payment Entry (#38297) * feat(Payment Entry): Bank Transaction connection * feat(Journal Entry): Bank Transaction connection (cherry picked from commit 3be345e6056f36baa6eef75818a7cdc63826b5f8) # Conflicts: # erpnext/accounts/doctype/payment_entry/payment_entry.json --- .../doctype/journal_entry/journal_entry.json | 12 ++++++++++-- .../doctype/payment_entry/payment_entry.json | 13 +++++++++++++ 2 files changed, 23 insertions(+), 2 deletions(-) diff --git a/erpnext/accounts/doctype/journal_entry/journal_entry.json b/erpnext/accounts/doctype/journal_entry/journal_entry.json index 2eb54a54d541..906760ec312d 100644 --- a/erpnext/accounts/doctype/journal_entry/journal_entry.json +++ b/erpnext/accounts/doctype/journal_entry/journal_entry.json @@ -548,8 +548,16 @@ "icon": "fa fa-file-text", "idx": 176, "is_submittable": 1, - "links": [], - "modified": "2023-08-10 14:32:22.366895", + "links": [ + { + "is_child_table": 1, + "link_doctype": "Bank Transaction Payments", + "link_fieldname": "payment_entry", + "parent_doctype": "Bank Transaction", + "table_fieldname": "payment_entries" + } + ], + "modified": "2023-11-23 12:11:04.128015", "modified_by": "Administrator", "module": "Accounts", "name": "Journal Entry", diff --git a/erpnext/accounts/doctype/payment_entry/payment_entry.json b/erpnext/accounts/doctype/payment_entry/payment_entry.json index 6224d4038d62..f4fd0d1ef527 100644 --- a/erpnext/accounts/doctype/payment_entry/payment_entry.json +++ b/erpnext/accounts/doctype/payment_entry/payment_entry.json @@ -739,8 +739,21 @@ ], "index_web_pages_for_search": 1, "is_submittable": 1, +<<<<<<< HEAD "links": [], "modified": "2023-06-19 11:38:04.387219", +======= + "links": [ + { + "is_child_table": 1, + "link_doctype": "Bank Transaction Payments", + "link_fieldname": "payment_entry", + "parent_doctype": "Bank Transaction", + "table_fieldname": "payment_entries" + } + ], + "modified": "2023-11-23 12:07:20.887885", +>>>>>>> 3be345e605 (feat: add Bank Transaction to connections in Journal and Payment Entry (#38297)) "modified_by": "Administrator", "module": "Accounts", "name": "Payment Entry", From 2293696ab40b29efacc5328427d3eadd5d817794 Mon Sep 17 00:00:00 2001 From: Raffael Meyer <14891507+barredterra@users.noreply.github.com> Date: Thu, 23 Nov 2023 15:10:29 +0100 Subject: [PATCH 86/95] chore: resolve conflicts --- erpnext/accounts/doctype/payment_entry/payment_entry.json | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/erpnext/accounts/doctype/payment_entry/payment_entry.json b/erpnext/accounts/doctype/payment_entry/payment_entry.json index f4fd0d1ef527..bd43fb77c233 100644 --- a/erpnext/accounts/doctype/payment_entry/payment_entry.json +++ b/erpnext/accounts/doctype/payment_entry/payment_entry.json @@ -739,10 +739,6 @@ ], "index_web_pages_for_search": 1, "is_submittable": 1, -<<<<<<< HEAD - "links": [], - "modified": "2023-06-19 11:38:04.387219", -======= "links": [ { "is_child_table": 1, @@ -753,7 +749,6 @@ } ], "modified": "2023-11-23 12:07:20.887885", ->>>>>>> 3be345e605 (feat: add Bank Transaction to connections in Journal and Payment Entry (#38297)) "modified_by": "Administrator", "module": "Accounts", "name": "Payment Entry", @@ -799,4 +794,4 @@ "states": [], "title_field": "title", "track_changes": 1 -} \ No newline at end of file +} From 756f08b9bad7631d8d25172b73a0a2f8d182c036 Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Thu, 23 Nov 2023 22:39:14 +0530 Subject: [PATCH 87/95] fix: patch - Duplicate entry quality inspection parameter (backport #38262) (#38263) fix: patch - Duplicate entry quality inspection parameter (#38262) (cherry picked from commit 0ca7527f7abddcab59edce434d0e68e1deebfc33) Co-authored-by: rohitwaghchaure --- erpnext/patches/v13_0/convert_qi_parameter_to_link_field.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/erpnext/patches/v13_0/convert_qi_parameter_to_link_field.py b/erpnext/patches/v13_0/convert_qi_parameter_to_link_field.py index e53bdf8f19e3..08ddbbf3375b 100644 --- a/erpnext/patches/v13_0/convert_qi_parameter_to_link_field.py +++ b/erpnext/patches/v13_0/convert_qi_parameter_to_link_field.py @@ -21,6 +21,9 @@ def execute(): params = set({x.casefold(): x for x in params}.values()) for parameter in params: + if frappe.db.exists("Quality Inspection Parameter", parameter): + continue + frappe.get_doc( {"doctype": "Quality Inspection Parameter", "parameter": parameter, "description": parameter} ).insert(ignore_permissions=True) From 6353deacf049b25296a06c58b04d542a04548f07 Mon Sep 17 00:00:00 2001 From: ruthra kumar Date: Thu, 23 Nov 2023 11:44:34 +0530 Subject: [PATCH 88/95] chore: index to speed up queries on JE child table reference (cherry picked from commit 24fcd67f8bcf8cc8b387856983b97d8778eac084) --- .../journal_entry_account/journal_entry_account.json | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) 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 3ba8cea94bbf..3132fe9b12bb 100644 --- a/erpnext/accounts/doctype/journal_entry_account/journal_entry_account.json +++ b/erpnext/accounts/doctype/journal_entry_account/journal_entry_account.json @@ -203,7 +203,8 @@ "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\nPayment Entry" + "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\nPayment Entry", + "search_index": 1 }, { "fieldname": "reference_name", @@ -211,7 +212,8 @@ "in_list_view": 1, "label": "Reference Name", "no_copy": 1, - "options": "reference_type" + "options": "reference_type", + "search_index": 1 }, { "depends_on": "eval:doc.reference_type&&!in_list(doc.reference_type, ['Expense Claim', 'Asset', 'Employee Loan', 'Employee Advance'])", @@ -278,13 +280,14 @@ "fieldtype": "Data", "hidden": 1, "label": "Reference Detail No", - "no_copy": 1 + "no_copy": 1, + "search_index": 1 } ], "idx": 1, "istable": 1, "links": [], - "modified": "2023-06-16 14:11:13.507807", + "modified": "2023-11-23 11:44:25.841187", "modified_by": "Administrator", "module": "Accounts", "name": "Journal Entry Account", From f74132b0be9231d202c346535131aca9d879fd73 Mon Sep 17 00:00:00 2001 From: ruthra kumar Date: Thu, 23 Nov 2023 16:56:35 +0530 Subject: [PATCH 89/95] chore: speed up Purchase Invoice cancellation (cherry picked from commit 1efff268b036dd27f7472bc7ec494aafac9edbc8) --- erpnext/accounts/doctype/sales_invoice/sales_invoice.json | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/erpnext/accounts/doctype/sales_invoice/sales_invoice.json b/erpnext/accounts/doctype/sales_invoice/sales_invoice.json index 6b26d40303bc..0c337aa62eca 100644 --- a/erpnext/accounts/doctype/sales_invoice/sales_invoice.json +++ b/erpnext/accounts/doctype/sales_invoice/sales_invoice.json @@ -1613,7 +1613,8 @@ "hide_seconds": 1, "label": "Inter Company Invoice Reference", "options": "Purchase Invoice", - "read_only": 1 + "read_only": 1, + "search_index": 1 }, { "fieldname": "customer_group", @@ -2164,7 +2165,7 @@ "link_fieldname": "consolidated_invoice" } ], - "modified": "2023-11-20 11:51:43.555197", + "modified": "2023-11-23 16:56:29.679499", "modified_by": "Administrator", "module": "Accounts", "name": "Sales Invoice", From a88d322e4f394382984492ba263fb73e3513672b Mon Sep 17 00:00:00 2001 From: ruthra kumar Date: Thu, 23 Nov 2023 17:39:48 +0530 Subject: [PATCH 90/95] perf: optimize total_purchase_cost update (cherry picked from commit aa17110bde44603574d4532afaa6cf1181423ac5) --- .../purchase_invoice/purchase_invoice.py | 20 +++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py index aad1eeabd798..89513aa80c57 100644 --- a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py +++ b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py @@ -1287,13 +1287,21 @@ def on_cancel(self): self.update_advance_tax_references(cancel=1) def update_project(self): - project_list = [] + projects = frappe._dict() for d in self.items: - if d.project and d.project not in project_list: - project = frappe.get_doc("Project", d.project) - project.update_purchase_costing() - project.db_update() - project_list.append(d.project) + if d.project: + if self.docstatus == 1: + projects[d.project] = projects.get(d.project, 0) + d.base_net_amount + elif self.docstatus == 2: + projects[d.project] = projects.get(d.project, 0) - d.base_net_amount + + pj = frappe.qb.DocType("Project") + for proj, value in projects.items(): + res = ( + frappe.qb.from_(pj).select(pj.total_purchase_cost).where(pj.name == proj).for_update().run() + ) + current_purchase_cost = res and res[0][0] or 0 + frappe.db.set_value("Project", proj, "total_purchase_cost", current_purchase_cost + value) def validate_supplier_invoice(self): if self.bill_date: From 49a787b1a8c6dc2ff52717c219463dcfb6088aac Mon Sep 17 00:00:00 2001 From: ruthra kumar Date: Thu, 23 Nov 2023 17:53:42 +0530 Subject: [PATCH 91/95] refactor: provide UI button to recalculate when needed (cherry picked from commit bcbe6c4a531986836a0a2497e05bdbe1a327407a) # Conflicts: # erpnext/projects/doctype/project/project.py --- erpnext/projects/doctype/project/project.js | 20 +++++++++++ erpnext/projects/doctype/project/project.py | 40 +++++++++++++++++---- 2 files changed, 53 insertions(+), 7 deletions(-) diff --git a/erpnext/projects/doctype/project/project.js b/erpnext/projects/doctype/project/project.js index c48ed9180248..8f7437fef8ad 100644 --- a/erpnext/projects/doctype/project/project.js +++ b/erpnext/projects/doctype/project/project.js @@ -68,6 +68,10 @@ frappe.ui.form.on("Project", { frm.events.create_duplicate(frm); }, __("Actions")); + frm.add_custom_button(__('Update Total Purchase Cost'), () => { + frm.events.update_total_purchase_cost(frm); + }, __("Actions")); + frm.trigger("set_project_status_button"); @@ -92,6 +96,22 @@ frappe.ui.form.on("Project", { }, + update_total_purchase_cost: function(frm) { + frappe.call({ + method: "erpnext.projects.doctype.project.project.recalculate_project_total_purchase_cost", + args: {project: frm.doc.name}, + freeze: true, + freeze_message: __('Recalculating Purchase Cost against this Project...'), + callback: function(r) { + if (r && !r.exc) { + frappe.msgprint(__('Total Purchase Cost has been updated')); + frm.refresh(); + } + } + + }); + }, + set_project_status_button: function(frm) { frm.add_custom_button(__('Set Project Status'), () => { let d = new frappe.ui.Dialog({ diff --git a/erpnext/projects/doctype/project/project.py b/erpnext/projects/doctype/project/project.py index 5c351faae1a1..f279cf17d729 100644 --- a/erpnext/projects/doctype/project/project.py +++ b/erpnext/projects/doctype/project/project.py @@ -4,9 +4,14 @@ import frappe from email_reply_parser import EmailReplyParser -from frappe import _ +from frappe import _, qb from frappe.desk.reportview import get_match_cond from frappe.model.document import Document +<<<<<<< HEAD +======= +from frappe.query_builder import Interval +from frappe.query_builder.functions import Count, CurDate, Date, Sum, UnixTimestamp +>>>>>>> bcbe6c4a53 (refactor: provide UI button to recalculate when needed) from frappe.utils import add_days, flt, get_datetime, get_time, get_url, nowtime, today from erpnext import get_default_company @@ -246,12 +251,7 @@ def calculate_gross_margin(self): self.per_gross_margin = (self.gross_margin / flt(self.total_billed_amount)) * 100 def update_purchase_costing(self): - total_purchase_cost = frappe.db.sql( - """select sum(base_net_amount) - from `tabPurchase Invoice Item` where project = %s and docstatus=1""", - self.name, - ) - + total_purchase_cost = calculate_total_purchase_cost(self.name) self.total_purchase_cost = total_purchase_cost and total_purchase_cost[0][0] or 0 def update_sales_amount(self): @@ -671,3 +671,29 @@ def get_holiday_list(company=None): def get_users_email(doc): return [d.email for d in doc.users if frappe.db.get_value("User", d.user, "enabled")] + + +def calculate_total_purchase_cost(project: str | None = None): + if project: + pitem = qb.DocType("Purchase Invoice Item") + frappe.qb.DocType("Purchase Invoice Item") + total_purchase_cost = ( + qb.from_(pitem) + .select(Sum(pitem.base_net_amount)) + .where((pitem.project == project) & (pitem.docstatus == 1)) + .run(as_list=True) + ) + return total_purchase_cost + return None + + +@frappe.whitelist() +def recalculate_project_total_purchase_cost(project: str | None = None): + if project: + total_purchase_cost = calculate_total_purchase_cost(project) + frappe.db.set_value( + "Project", + project, + "total_purchase_cost", + (total_purchase_cost and total_purchase_cost[0][0] or 0), + ) From 205d97125300d4401ddad89ee84c4cacea2571d5 Mon Sep 17 00:00:00 2001 From: ruthra kumar Date: Fri, 24 Nov 2023 10:53:00 +0530 Subject: [PATCH 92/95] refactor: make update_project_cost optional through Buying Settings (cherry picked from commit 0fe6dcd74288d5f2df1ffc37485e22ee96329b9e) --- .../doctype/buying_settings/buying_settings.json | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/erpnext/buying/doctype/buying_settings/buying_settings.json b/erpnext/buying/doctype/buying_settings/buying_settings.json index 059999245d10..0af93bfc9029 100644 --- a/erpnext/buying/doctype/buying_settings/buying_settings.json +++ b/erpnext/buying/doctype/buying_settings/buying_settings.json @@ -17,6 +17,7 @@ "po_required", "pr_required", "blanket_order_allowance", + "project_update_frequency", "column_break_12", "maintain_same_rate", "set_landed_cost_based_on_purchase_invoice_rate", @@ -172,6 +173,14 @@ "fieldname": "blanket_order_allowance", "fieldtype": "Float", "label": "Blanket Order Allowance (%)" + }, + { + "default": "Each Transaction", + "description": "How often should Project be updated of Total Purchase Cost ?", + "fieldname": "project_update_frequency", + "fieldtype": "Select", + "label": "Update frequency of Project", + "options": "Each Transaction\nManual" } ], "icon": "fa fa-cog", @@ -179,7 +188,7 @@ "index_web_pages_for_search": 1, "issingle": 1, "links": [], - "modified": "2023-10-25 14:03:32.520418", + "modified": "2023-11-24 10:55:51.287327", "modified_by": "Administrator", "module": "Buying", "name": "Buying Settings", From 47093bebd3c2289e77b13339dd567014b7b2d3a8 Mon Sep 17 00:00:00 2001 From: ruthra kumar Date: Fri, 24 Nov 2023 10:54:31 +0530 Subject: [PATCH 93/95] refactor: update project costing based on frequency (cherry picked from commit dd016e6ced432b6f8754042fbad808b1cba56cec) --- .../doctype/purchase_invoice/purchase_invoice.py | 11 +++++++++-- erpnext/patches.txt | 1 + 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py index 89513aa80c57..33cd0d55ef73 100644 --- a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py +++ b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py @@ -532,7 +532,11 @@ def on_submit(self): if self.update_stock == 1: self.repost_future_sle_and_gle() - self.update_project() + if ( + frappe.db.get_single_value("Buying Settings", "project_update_frequency") == "Each Transaction" + ): + self.update_project() + update_linked_doc(self.doctype, self.name, self.inter_company_invoice_reference) self.update_advance_tax_references() @@ -1269,7 +1273,10 @@ def on_cancel(self): if self.update_stock == 1: self.repost_future_sle_and_gle() - self.update_project() + if ( + frappe.db.get_single_value("Buying Settings", "project_update_frequency") == "Each Transaction" + ): + self.update_project() self.db_set("status", "Cancelled") unlink_inter_company_doc(self.doctype, self.name, self.inter_company_invoice_reference) diff --git a/erpnext/patches.txt b/erpnext/patches.txt index de663133a3f0..b8cda748509a 100644 --- a/erpnext/patches.txt +++ b/erpnext/patches.txt @@ -351,5 +351,6 @@ erpnext.patches.v14_0.rename_depreciation_amount_based_on_num_days_in_month_to_d erpnext.patches.v14_0.add_default_for_repost_settings erpnext.patches.v14_0.create_accounting_dimensions_in_supplier_quotation erpnext.patches.v14_0.update_zero_asset_quantity_field +execute:frappe.db.set_single_value("Buying Settings", "project_update_frequency", "Each Transaction") # below migration patch should always run last erpnext.patches.v14_0.migrate_gl_to_payment_ledger From 1d1af26f7a286c4e2c2ded42a91e6e674836f383 Mon Sep 17 00:00:00 2001 From: ruthra kumar Date: Fri, 24 Nov 2023 11:54:55 +0530 Subject: [PATCH 94/95] chore: resolve conflict --- erpnext/projects/doctype/project/project.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/erpnext/projects/doctype/project/project.py b/erpnext/projects/doctype/project/project.py index f279cf17d729..748c755d3777 100644 --- a/erpnext/projects/doctype/project/project.py +++ b/erpnext/projects/doctype/project/project.py @@ -7,11 +7,7 @@ from frappe import _, qb from frappe.desk.reportview import get_match_cond from frappe.model.document import Document -<<<<<<< HEAD -======= -from frappe.query_builder import Interval -from frappe.query_builder.functions import Count, CurDate, Date, Sum, UnixTimestamp ->>>>>>> bcbe6c4a53 (refactor: provide UI button to recalculate when needed) +from frappe.query_builder.functions import Sum from frappe.utils import add_days, flt, get_datetime, get_time, get_url, nowtime, today from erpnext import get_default_company From 436ba6f244a62d0486a534585814192182506180 Mon Sep 17 00:00:00 2001 From: Frappe PR Bot Date: Fri, 24 Nov 2023 08:47:31 +0000 Subject: [PATCH 95/95] chore(release): Bumped to Version 14.50.0 # [14.50.0](https://github.com/frappe/erpnext/compare/v14.49.0...v14.50.0) (2023-11-24) ### Bug Fixes * don't depreciate non-depreciable assets on scrapping [v14] ([#38294](https://github.com/frappe/erpnext/issues/38294)) ([5261aba](https://github.com/frappe/erpnext/commit/5261aba81fb72154c14d96ce976e24a60cf948c2)) * partial cancel of gle and ple (backport [#35609](https://github.com/frappe/erpnext/issues/35609)) ([80bc235](https://github.com/frappe/erpnext/commit/80bc235d6e6064756031ea7cf320b001e773e89f)) * patch - Duplicate entry quality inspection parameter (backport [#38262](https://github.com/frappe/erpnext/issues/38262)) ([#38263](https://github.com/frappe/erpnext/issues/38263)) ([756f08b](https://github.com/frappe/erpnext/commit/756f08b9bad7631d8d25172b73a0a2f8d182c036)) * Supplier `Primary Contact` (backport [#38268](https://github.com/frappe/erpnext/issues/38268)) ([#38285](https://github.com/frappe/erpnext/issues/38285)) ([f170cb9](https://github.com/frappe/erpnext/commit/f170cb921453bf7e2b59198f60a81e442df1fae2)) ### Features * add Bank Transaction to connections in Journal and Payment Entry ([#38297](https://github.com/frappe/erpnext/issues/38297)) ([06c6da5](https://github.com/frappe/erpnext/commit/06c6da5c0dc6bc9c1ba2375e93738fbb84af66e7)) ### Performance Improvements * optimize total_purchase_cost update ([a88d322](https://github.com/frappe/erpnext/commit/a88d322e4f394382984492ba263fb73e3513672b)) --- erpnext/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/__init__.py b/erpnext/__init__.py index 8a1f277003df..f82bc47106b5 100644 --- a/erpnext/__init__.py +++ b/erpnext/__init__.py @@ -3,7 +3,7 @@ import frappe -__version__ = "14.49.0" +__version__ = "14.50.0" def get_default_company(user=None):