chore: resolve conflicts

This commit is contained in:
ruthra kumar
2024-06-16 20:37:05 +05:30
parent e8f5c45751
commit b050110544
3 changed files with 1 additions and 97 deletions

View File

@@ -51,37 +51,7 @@ class StockController(AccountsController):
self.validate_internal_transfer()
self.validate_putaway_capacity()
<<<<<<< HEAD
def make_gl_entries(self, gl_entries=None, from_repost=False):
=======
def validate_duplicate_serial_and_batch_bundle(self):
if sbb_list := [
item.get("serial_and_batch_bundle")
for item in self.items
if item.get("serial_and_batch_bundle")
]:
SLE = frappe.qb.DocType("Stock Ledger Entry")
data = (
frappe.qb.from_(SLE)
.select(SLE.voucher_type, SLE.voucher_no, SLE.serial_and_batch_bundle)
.where(
(SLE.docstatus == 1)
& (SLE.serial_and_batch_bundle.notnull())
& (SLE.serial_and_batch_bundle.isin(sbb_list))
)
.limit(1)
).run(as_dict=True)
if data:
data = data[0]
frappe.throw(
_("Serial and Batch Bundle {0} is already used in {1} {2}.").format(
frappe.bold(data.serial_and_batch_bundle), data.voucher_type, data.voucher_no
)
)
def make_gl_entries(self, gl_entries=None, from_repost=False, via_landed_cost_voucher=False):
>>>>>>> baa3fee1bf (fix: add LCV flag to determine negative expenses)
if self.docstatus == 2:
make_reverse_gl_entries(voucher_type=self.doctype, voucher_no=self.name)

View File

@@ -228,7 +228,7 @@ class LandedCostVoucher(Document):
doc.make_gl_entries(via_landed_cost_voucher=True)
else:
doc.make_gl_entries()
doc.repost_future_sle_and_gle(via_landed_cost_voucher=True)
doc.repost_future_sle_and_gle()
def validate_asset_qty_and_status(self, receipt_document_type, receipt_document):
for item in self.get("items"):

View File

@@ -2301,71 +2301,6 @@ class TestPurchaseReceipt(FrappeTestCase):
for index, d in enumerate(data):
self.assertEqual(d.qty_after_transaction, 11 + index)
<<<<<<< HEAD
=======
def test_auto_set_batch_based_on_bundle(self):
item_code = make_item(
"_Test Auto Set Batch Based on Bundle",
properties={
"has_batch_no": 1,
"batch_number_series": "BATCH-BNU-TASBBB-.#####",
"create_new_batch": 1,
},
).name
frappe.db.set_single_value(
"Stock Settings", "do_not_update_serial_batch_on_creation_of_auto_bundle", 0
)
pr = make_purchase_receipt(
item_code=item_code,
qty=5,
rate=100,
)
self.assertTrue(pr.items[0].batch_no)
batch_no = get_batch_from_bundle(pr.items[0].serial_and_batch_bundle)
self.assertEqual(pr.items[0].batch_no, batch_no)
frappe.db.set_single_value(
"Stock Settings", "do_not_update_serial_batch_on_creation_of_auto_bundle", 1
)
def test_pr_billed_amount_against_return_entry(self):
from erpnext.accounts.doctype.purchase_invoice.purchase_invoice import make_debit_note
from erpnext.stock.doctype.purchase_receipt.purchase_receipt import (
make_purchase_invoice as make_pi_from_pr,
)
# Create a Purchase Receipt and Fully Bill it
pr = make_purchase_receipt(qty=10)
pi = make_pi_from_pr(pr.name)
pi.insert()
pi.submit()
# Debit Note - 50% Qty & enable updating PR billed amount
pi_return = make_debit_note(pi.name)
pi_return.items[0].qty = -5
pi_return.update_billed_amount_in_purchase_receipt = 1
pi_return.submit()
# Check if the billed amount reduced
pr.reload()
self.assertEqual(pr.per_billed, 50)
pi_return.reload()
pi_return.cancel()
# Debit Note - 50% Qty & disable updating PR billed amount
pi_return = make_debit_note(pi.name)
pi_return.items[0].qty = -5
pi_return.update_billed_amount_in_purchase_receipt = 0
pi_return.submit()
# Check if the billed amount stayed the same
pr.reload()
self.assertEqual(pr.per_billed, 100)
def test_valuation_taxes_lcv_repost_after_billing(self):
from erpnext.stock.doctype.landed_cost_voucher.test_landed_cost_voucher import (
make_landed_cost_voucher,
@@ -2414,7 +2349,6 @@ class TestPurchaseReceipt(FrappeTestCase):
self.assertSequenceEqual(expected_gle, gl_entries)
frappe.local.enable_perpetual_inventory["_Test Company"] = old_perpetual_inventory
>>>>>>> 53642e7417 (test: LCV entries after billing)
def prepare_data_for_internal_transfer():
from erpnext.accounts.doctype.sales_invoice.test_sales_invoice import create_internal_supplier