Merge branch 'version-12-hotfix' into mr-se-warehouse-validation-hotfix

This commit is contained in:
Marica
2021-01-14 15:10:01 +05:30
committed by GitHub
6 changed files with 38 additions and 25 deletions

View File

@@ -296,7 +296,7 @@ class BuyingController(StockController):
raw_material_data = backflushed_raw_materials_map.get(rm_item_key, {}) raw_material_data = backflushed_raw_materials_map.get(rm_item_key, {})
consumed_qty = raw_material_data.get('qty', 0) consumed_qty = raw_material_data.get('qty', 0)
consumed_serial_nos = raw_material_data.get('serial_nos', '') consumed_serial_nos = raw_material_data.get('serial_no', '')
consumed_batch_nos = raw_material_data.get('batch_nos', '') consumed_batch_nos = raw_material_data.get('batch_nos', '')
transferred_qty = raw_material.qty transferred_qty = raw_material.qty

View File

@@ -5,7 +5,7 @@
from __future__ import unicode_literals from __future__ import unicode_literals
import frappe import frappe
from frappe import _ from frappe import _
from frappe.utils import date_diff, getdate, formatdate, cint, month_diff, flt from frappe.utils import date_diff, getdate, formatdate, cint, month_diff, flt, add_months
from frappe.model.document import Document from frappe.model.document import Document
from erpnext.hr.utils import get_holidays_for_employee from erpnext.hr.utils import get_holidays_for_employee
@@ -88,6 +88,8 @@ def get_period_factor(employee, start_date, end_date, payroll_frequency, payroll
period_start = joining_date period_start = joining_date
if relieving_date and getdate(relieving_date) < getdate(period_end): if relieving_date and getdate(relieving_date) < getdate(period_end):
period_end = relieving_date period_end = relieving_date
if month_diff(period_end, start_date) > 1:
start_date = add_months(start_date, - (month_diff(period_end, start_date)+1))
total_sub_periods, remaining_sub_periods = 0.0, 0.0 total_sub_periods, remaining_sub_periods = 0.0, 0.0

View File

@@ -24,9 +24,8 @@
}, },
{ {
"fieldname": "reference_invoice", "fieldname": "reference_invoice",
"fieldtype": "Link", "fieldtype": "Data",
"label": "Reference Invoice", "label": "Reference Invoice"
"options": "Sales Invoice"
}, },
{ {
"fieldname": "headers", "fieldname": "headers",
@@ -64,7 +63,7 @@
], ],
"index_web_pages_for_search": 1, "index_web_pages_for_search": 1,
"links": [], "links": [],
"modified": "2020-12-24 21:09:38.882866", "modified": "2021-01-13 12:06:57.253111",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "Regional", "module": "Regional",
"name": "E Invoice Request Log", "name": "E Invoice Request Log",

View File

@@ -7,6 +7,7 @@
"field_order": [ "field_order": [
"enable", "enable",
"section_break_2", "section_break_2",
"sandbox_mode",
"credentials", "credentials",
"auth_token", "auth_token",
"token_expiry" "token_expiry"
@@ -41,12 +42,18 @@
"label": "Credentials", "label": "Credentials",
"mandatory_depends_on": "enable", "mandatory_depends_on": "enable",
"options": "E Invoice User" "options": "E Invoice User"
},
{
"default": "0",
"fieldname": "sandbox_mode",
"fieldtype": "Check",
"label": "Sandbox Mode"
} }
], ],
"index_web_pages_for_search": 1, "index_web_pages_for_search": 1,
"issingle": 1, "issingle": 1,
"links": [], "links": [],
"modified": "2020-12-22 15:34:57.280044", "modified": "2021-01-13 12:04:49.449199",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "Regional", "module": "Regional",
"name": "E Invoice Settings", "name": "E Invoice Settings",

View File

@@ -421,18 +421,22 @@ class RequestFailed(Exception): pass
class GSPConnector(): class GSPConnector():
def __init__(self, doctype=None, docname=None): def __init__(self, doctype=None, docname=None):
self.e_invoice_settings = frappe.get_cached_doc('E Invoice Settings') self.e_invoice_settings = frappe.get_cached_doc('E Invoice Settings')
sandbox_mode = self.e_invoice_settings.sandbox_mode
self.invoice = frappe.get_cached_doc(doctype, docname) if doctype and docname else None self.invoice = frappe.get_cached_doc(doctype, docname) if doctype and docname else None
self.credentials = self.get_credentials() self.credentials = self.get_credentials()
self.base_url = 'https://gsp.adaequare.com/' # authenticate url is same for sandbox & live
self.authenticate_url = self.base_url + 'gsp/authenticate?grant_type=token' self.authenticate_url = 'https://gsp.adaequare.com/gsp/authenticate?grant_type=token'
self.gstin_details_url = self.base_url + 'test/enriched/ei/api/master/gstin' self.base_url = 'https://gsp.adaequare.com' if not sandbox_mode else 'https://gsp.adaequare.com/test'
self.generate_irn_url = self.base_url + 'test/enriched/ei/api/invoice'
self.irn_details_url = self.base_url + 'test/enriched/ei/api/invoice/irn' self.cancel_irn_url = self.base_url + '/enriched/ei/api/invoice/cancel'
self.cancel_irn_url = self.base_url + 'test/enriched/ei/api/invoice/cancel' self.irn_details_url = self.base_url + '/enriched/ei/api/invoice/irn'
self.cancel_ewaybill_url = self.base_url + '/test/enriched/ei/api/ewayapi' self.generate_irn_url = self.base_url + '/enriched/ei/api/invoice'
self.generate_ewaybill_url = self.base_url + 'test/enriched/ei/api/ewaybill' self.gstin_details_url = self.base_url + '/enriched/ei/api/master/gstin'
self.cancel_ewaybill_url = self.base_url + '/enriched/ei/api/ewayapi'
self.generate_ewaybill_url = self.base_url + '/enriched/ei/api/ewaybill'
def get_credentials(self): def get_credentials(self):
if self.invoice: if self.invoice:
gstin = self.get_seller_gstin() gstin = self.get_seller_gstin()
@@ -765,7 +769,7 @@ class GSPConnector():
_file = frappe.new_doc('File') _file = frappe.new_doc('File')
_file.update({ _file.update({
'file_name': 'QRCode_{}.png'.format(docname), 'file_name': 'QRCode_{}.png'.format(docname.replace('/', '-')),
'attached_to_doctype': doctype, 'attached_to_doctype': doctype,
'attached_to_name': docname, 'attached_to_name': docname,
'content': 'qrcode', 'content': 'qrcode',

View File

@@ -255,15 +255,16 @@ class Gstr1Report(object):
for item_code, tax_amounts in item_wise_tax_detail.items(): for item_code, tax_amounts in item_wise_tax_detail.items():
tax_rate = tax_amounts[0] tax_rate = tax_amounts[0]
if cgst_or_sgst: if tax_rate:
tax_rate *= 2 if cgst_or_sgst:
if parent not in self.cgst_sgst_invoices: tax_rate *= 2
self.cgst_sgst_invoices.append(parent) if parent not in self.cgst_sgst_invoices:
self.cgst_sgst_invoices.append(parent)
rate_based_dict = self.items_based_on_tax_rate\ rate_based_dict = self.items_based_on_tax_rate\
.setdefault(parent, {}).setdefault(tax_rate, []) .setdefault(parent, {}).setdefault(tax_rate, [])
if item_code not in rate_based_dict: if item_code not in rate_based_dict:
rate_based_dict.append(item_code) rate_based_dict.append(item_code)
except ValueError: except ValueError:
continue continue
if unidentified_gst_accounts: if unidentified_gst_accounts: