Compare commits

..

6 Commits

Author SHA1 Message Date
Saqib
d43bb4db41 fix(pos): error while merging pos invoices into sales invoice (#24337) 2021-01-11 12:59:35 +05:30
Saurabh
adb8bbe958 Merge branch 'version-13-beta-pre-release' into version-13-beta 2021-01-02 19:59:56 +05:30
Saurabh
0feaab5261 bumped to version 13.0.0-beta.9 2021-01-02 20:19:56 +05:50
rohitwaghchaure
2adf8d07b6 Merge pull request #24266 from rohitwaghchaure/incorrect-valudation-rate-fg
fix: incorrect valuation rate for finished good
2020-12-31 20:53:52 +05:30
Rohit Waghchaure
16bce49f18 fix: incorrect valuation rate for finished good 2020-12-31 17:39:52 +05:30
Saqib
f8f015c961 fix: cannot submit e-invoice if legal name not found 2020-12-31 13:28:08 +05:30
8 changed files with 33 additions and 12 deletions

View File

@@ -5,7 +5,7 @@ import frappe
from erpnext.hooks import regional_overrides
from frappe.utils import getdate
__version__ = '13.0.0-beta.8'
__version__ = '13.0.0-beta.9'
def get_default_company(user=None):
'''Get default company for user'''

View File

@@ -57,7 +57,11 @@ class POSClosingEntry(Document):
if not invalid_rows:
return
error_list = [_("Row #{}: {}").format(row.get('idx'), row.get('msg')) for row in invalid_rows]
error_list = []
for row in invalid_rows:
for msg in row.get('msg'):
error_list.append(_("Row #{}: {}").format(row.get('idx'), msg))
frappe.throw(error_list, title=_("Invalid POS Invoices"), as_list=True)
def on_submit(self):

View File

@@ -5,10 +5,10 @@
from __future__ import unicode_literals
import frappe
from frappe import _
from frappe.utils import cint, flt, add_months, today, date_diff, getdate, add_days, cstr, nowdate
from frappe.model.document import Document
from frappe.model.mapper import map_doc
from frappe.model import default_fields
from frappe.model.document import Document
from frappe.model.mapper import map_doc, map_child_doc
from frappe.utils import cint, flt, add_months, today, date_diff, getdate, add_days, cstr, nowdate
from six import iteritems
@@ -83,7 +83,7 @@ class POSInvoiceMergeLog(Document):
credit_note.is_consolidated = 1
# TODO: return could be against multiple sales invoice which could also have been consolidated?
credit_note.return_against = self.consolidated_invoice
# credit_note.return_against = self.consolidated_invoice
credit_note.save()
credit_note.submit()
self.consolidated_credit_note = credit_note.name
@@ -111,7 +111,8 @@ class POSInvoiceMergeLog(Document):
i.qty = i.qty + item.qty
if not found:
item.rate = item.net_rate
items.append(item)
si_item = map_child_doc(item, invoice, {"doctype": "Sales Invoice Item"})
items.append(si_item)
for tax in doc.get('taxes'):
found = False

View File

@@ -262,6 +262,7 @@ def make_return_doc(doctype, source_name, target_doc=None):
if doc.get("is_return"):
if doc.doctype == 'Sales Invoice' or doc.doctype == 'POS Invoice':
doc.consolidated_invoice = ""
doc.set('payments', [])
for data in source.payments:
paid_amount = 0.00

View File

@@ -743,3 +743,4 @@ erpnext.patches.v13_0.updates_for_multi_currency_payroll
erpnext.patches.v13_0.create_leave_policy_assignment_based_on_employee_current_leave_policy
erpnext.patches.v13_0.add_po_to_global_search
erpnext.patches.v13_0.update_returned_qty_in_pr_dn
erpnext.patches.v13_0.create_uae_pos_invoice_fields

View File

@@ -0,0 +1,14 @@
# Copyright (c) 2019, Frappe and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
from erpnext.regional.united_arab_emirates.setup import make_custom_fields
def execute():
company = frappe.get_all('Company', filters = {'country': ['in', ['Saudi Arabia', 'United Arab Emirates']]})
if not company:
return
make_custom_fields()

View File

@@ -88,7 +88,7 @@ def get_party_details(address_name):
gstin = address.get('gstin')
gstin_details = get_gstin_details(gstin)
legal_name = gstin_details.get('LegalName')
legal_name = gstin_details.get('LegalName') or gstin_details.get('TradeName')
location = gstin_details.get('AddrLoc') or address.get('city')
state_code = gstin_details.get('StateCode')
pincode = gstin_details.get('AddrPncd')

View File

@@ -512,7 +512,7 @@ class StockEntry(StockController):
bom_items = self.get_bom_raw_materials(finished_item_qty)
outgoing_items_cost = sum([flt(row.qty)*flt(row.rate) for row in bom_items.values()])
return flt(outgoing_items_cost - scrap_items_cost)
return flt((outgoing_items_cost - scrap_items_cost) / finished_item_qty)
def distribute_additional_costs(self):
# If no incoming items, set additional costs blank
@@ -699,7 +699,7 @@ class StockEntry(StockController):
# SLE for target warehouse
self.get_sle_for_target_warehouse(sl_entries, finished_item_row)
# reverse sl entries if cancel
if self.docstatus == 2:
sl_entries.reverse()
@@ -727,9 +727,9 @@ class StockEntry(StockController):
sle.dependant_sle_voucher_detail_no = d.name
elif finished_item_row and (finished_item_row.item_code != d.item_code or finished_item_row.t_warehouse != d.s_warehouse):
sle.dependant_sle_voucher_detail_no = finished_item_row.name
sl_entries.append(sle)
def get_sle_for_target_warehouse(self, sl_entries, finished_item_row):
for d in self.get('items'):
if cstr(d.t_warehouse):