fix: Subcontracting Receipt GL Entries (backport #31918) (#32124)

fix: Subcontracting Receipt GL Entries
This commit is contained in:
Sagar Sharma
2022-09-08 11:18:00 +05:30
committed by GitHub
parent 9b6dd7e71f
commit f2ab220ce3
8 changed files with 311 additions and 46 deletions

View File

@@ -700,6 +700,47 @@ class StockController(AccountsController):
else:
create_repost_item_valuation_entry(args)
def add_gl_entry(
self,
gl_entries,
account,
cost_center,
debit,
credit,
remarks,
against_account,
debit_in_account_currency=None,
credit_in_account_currency=None,
account_currency=None,
project=None,
voucher_detail_no=None,
item=None,
posting_date=None,
):
gl_entry = {
"account": account,
"cost_center": cost_center,
"debit": debit,
"credit": credit,
"against": against_account,
"remarks": remarks,
}
if voucher_detail_no:
gl_entry.update({"voucher_detail_no": voucher_detail_no})
if debit_in_account_currency:
gl_entry.update({"debit_in_account_currency": debit_in_account_currency})
if credit_in_account_currency:
gl_entry.update({"credit_in_account_currency": credit_in_account_currency})
if posting_date:
gl_entry.update({"posting_date": posting_date})
gl_entries.append(self.get_gl_dict(gl_entry, item=item))
def repost_required_for_queue(doc: StockController) -> bool:
"""check if stock document contains repeated item-warehouse with queue based valuation.

View File

@@ -897,7 +897,7 @@ def make_stock_transfer_entry(**args):
"item_name": row.item_code,
"rate": row.rate or 100,
"stock_uom": row.stock_uom or "Nos",
"warehouse": row.warehuose or "_Test Warehouse - _TC",
"warehouse": row.warehouse or "_Test Warehouse - _TC",
}
item_details = args.itemwise_details.get(row.item_code)
@@ -1031,9 +1031,9 @@ def get_subcontracting_order(**args):
if not args.service_items:
service_items = [
{
"warehouse": "_Test Warehouse - _TC",
"warehouse": args.warehouse or "_Test Warehouse - _TC",
"item_code": "Subcontracted Service Item 7",
"qty": 5,
"qty": 10,
"rate": 100,
"fg_item": "Subcontracted Item SA7",
"fg_item_qty": 10,
@@ -1046,6 +1046,7 @@ def get_subcontracting_order(**args):
rm_items=service_items,
is_subcontracted=1,
supplier_warehouse=args.supplier_warehouse or "_Test Warehouse 1 - _TC",
company=args.company,
)
return create_subcontracting_order(po_name=po.name, **args)