From 9e5da835ecc666186a24041b7150022fa714b6b3 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Thu, 14 Nov 2013 18:41:09 +0530 Subject: [PATCH] [patch] make gl entries for submitted sales invoice where no gl entries exists --- patches/november_2013/__init__.py | 0 patches/november_2013/p01_make_gl_entries_for_si.py | 12 ++++++++++++ patches/patch_list.py | 1 + 3 files changed, 13 insertions(+) create mode 100644 patches/november_2013/__init__.py create mode 100644 patches/november_2013/p01_make_gl_entries_for_si.py diff --git a/patches/november_2013/__init__.py b/patches/november_2013/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/patches/november_2013/p01_make_gl_entries_for_si.py b/patches/november_2013/p01_make_gl_entries_for_si.py new file mode 100644 index 00000000000..cfe107a4d77 --- /dev/null +++ b/patches/november_2013/p01_make_gl_entries_for_si.py @@ -0,0 +1,12 @@ +# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. +# License: GNU General Public License v3. See license.txt + +import webnotes + +def execute(): + si_no_gle = webnotes.conn.sql("""select si.name from `tabSales Invoice` si + where docstatus=1 and not exists(select name from `tabGL Entry` + where voucher_type='Sales Invoice' and voucher_no=si.name)""") + + for si in si_no_gle: + webnotes.get_obj("Sales Invoice", si[0]).make_gl_entries() \ No newline at end of file diff --git a/patches/patch_list.py b/patches/patch_list.py index 0cc393e02ec..82eb6e45602 100644 --- a/patches/patch_list.py +++ b/patches/patch_list.py @@ -230,4 +230,5 @@ patch_list = [ "patches.october_2013.p07_rename_for_territory", "patches.june_2013.p07_taxes_price_list_for_territory", "patches.october_2013.p08_cleanup_after_item_price_module_change", + "patches.november_2013.p01_make_gl_entries_for_si", ] \ No newline at end of file