Revert "refactor: use both fields to store against values"

This reverts commit 09439334cae6a7306dad8e54a9f81f9ffa483f8b.
diff --git a/erpnext/accounts/deferred_revenue.py b/erpnext/accounts/deferred_revenue.py
index a630325..367b017 100644
--- a/erpnext/accounts/deferred_revenue.py
+++ b/erpnext/accounts/deferred_revenue.py
@@ -516,7 +516,6 @@
 			{
 				"account": credit_account,
 				"against": against,
-				"against_link": against,
 				"credit": base_amount,
 				"credit_in_account_currency": amount,
 				"cost_center": cost_center,
@@ -536,7 +535,6 @@
 			{
 				"account": debit_account,
 				"against": against,
-				"against_link": against,
 				"debit": base_amount,
 				"debit_in_account_currency": amount,
 				"cost_center": cost_center,
diff --git a/erpnext/accounts/doctype/invoice_discounting/invoice_discounting.py b/erpnext/accounts/doctype/invoice_discounting/invoice_discounting.py
index d677f22..76f4dad 100644
--- a/erpnext/accounts/doctype/invoice_discounting/invoice_discounting.py
+++ b/erpnext/accounts/doctype/invoice_discounting/invoice_discounting.py
@@ -154,7 +154,6 @@
 							"party_type": "Customer",
 							"party": d.customer,
 							"against": self.accounts_receivable_credit,
-							"against_link": self.accounts_receivable_credit,
 							"credit": outstanding_in_company_currency,
 							"credit_in_account_currency": outstanding_in_company_currency
 							if inv.party_account_currency == company_currency
@@ -175,7 +174,6 @@
 							"party_type": "Customer",
 							"party": d.customer,
 							"against": inv.debit_to,
-							"against_link": inv.debit_to,
 							"debit": outstanding_in_company_currency,
 							"debit_in_account_currency": outstanding_in_company_currency
 							if ar_credit_account_currency == company_currency
diff --git a/erpnext/accounts/doctype/payment_entry/payment_entry.py b/erpnext/accounts/doctype/payment_entry/payment_entry.py
index cc75d8c..dbebbb0 100644
--- a/erpnext/accounts/doctype/payment_entry/payment_entry.py
+++ b/erpnext/accounts/doctype/payment_entry/payment_entry.py
@@ -1145,7 +1145,6 @@
 					"party_type": self.party_type,
 					"party": self.party,
 					"against": against_account,
-					"against_link": against_account,
 					"account_currency": self.party_account_currency,
 					"cost_center": self.cost_center,
 				},
@@ -1311,7 +1310,6 @@
 						"account": self.paid_from,
 						"account_currency": self.paid_from_account_currency,
 						"against": self.party if self.payment_type == "Pay" else self.paid_to,
-						"against_link": self.party if self.payment_type == "Pay" else self.paid_to,
 						"credit_in_account_currency": self.paid_amount,
 						"credit": self.base_paid_amount,
 						"cost_center": self.cost_center,
@@ -1327,7 +1325,6 @@
 						"account": self.paid_to,
 						"account_currency": self.paid_to_account_currency,
 						"against": self.party if self.payment_type == "Receive" else self.paid_from,
-						"against_link": self.party if self.payment_type == "Receive" else self.paid_from,
 						"debit_in_account_currency": self.received_amount,
 						"debit": self.base_received_amount,
 						"cost_center": self.cost_center,
@@ -1360,7 +1357,6 @@
 					{
 						"account": d.account_head,
 						"against": against,
-						"against_link": against,
 						dr_or_cr: tax_amount,
 						dr_or_cr + "_in_account_currency": base_tax_amount
 						if account_currency == self.company_currency
@@ -1386,7 +1382,6 @@
 						{
 							"account": payment_account,
 							"against": against,
-							"against_link": against,
 							rev_dr_or_cr: tax_amount,
 							rev_dr_or_cr + "_in_account_currency": base_tax_amount
 							if account_currency == self.company_currency
@@ -1412,7 +1407,6 @@
 							"account": d.account,
 							"account_currency": account_currency,
 							"against": self.party or self.paid_from,
-							"against_link": self.party or self.paid_from,
 							"debit_in_account_currency": d.amount,
 							"debit": d.amount,
 							"cost_center": d.cost_center,
diff --git a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py
index fa365fc..c4e09b4 100644
--- a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py
+++ b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py
@@ -828,7 +828,6 @@
 						"party": self.supplier,
 						"due_date": self.due_date,
 						"against": self.against_expense_account,
-						"against_link": self.against_expense_account,
 						"credit": base_grand_total,
 						"credit_in_account_currency": base_grand_total
 						if self.party_account_currency == self.company_currency
@@ -902,7 +901,6 @@
 								{
 									"account": warehouse_account[item.warehouse]["account"],
 									"against": warehouse_account[item.from_warehouse]["account"],
-									"against_link": warehouse_account[item.from_warehouse]["account"],
 									"cost_center": item.cost_center,
 									"project": item.project or self.project,
 									"remarks": self.get("remarks") or _("Accounting Entry for Stock"),
@@ -923,7 +921,6 @@
 								{
 									"account": warehouse_account[item.from_warehouse]["account"],
 									"against": warehouse_account[item.warehouse]["account"],
-									"against_link": warehouse_account[item.warehouse]["account"],
 									"cost_center": item.cost_center,
 									"project": item.project or self.project,
 									"remarks": self.get("remarks") or _("Accounting Entry for Stock"),
@@ -941,7 +938,6 @@
 									{
 										"account": item.expense_account,
 										"against": self.supplier,
-										"against_link": self.supplier,
 										"debit": flt(item.base_net_amount, item.precision("base_net_amount")),
 										"remarks": self.get("remarks") or _("Accounting Entry for Stock"),
 										"cost_center": item.cost_center,
@@ -959,7 +955,6 @@
 									{
 										"account": item.expense_account,
 										"against": self.supplier,
-										"against_link": self.supplier,
 										"debit": warehouse_debit_amount,
 										"remarks": self.get("remarks") or _("Accounting Entry for Stock"),
 										"cost_center": item.cost_center,
@@ -979,7 +974,6 @@
 										{
 											"account": account,
 											"against": item.expense_account,
-											"against_link": item.expense_account,
 											"cost_center": item.cost_center,
 											"remarks": self.get("remarks") or _("Accounting Entry for Stock"),
 											"credit": flt(amount["base_amount"]),
@@ -1000,7 +994,6 @@
 								{
 									"account": supplier_warehouse_account,
 									"against": item.expense_account,
-									"against_link": item.expense_account,
 									"cost_center": item.cost_center,
 									"project": item.project or self.project,
 									"remarks": self.get("remarks") or _("Accounting Entry for Stock"),
@@ -1056,7 +1049,6 @@
 								{
 									"account": expense_account,
 									"against": self.supplier,
-									"against_link": self.supplier,
 									"debit": amount,
 									"cost_center": item.cost_center,
 									"project": item.project or self.project,
@@ -1083,7 +1075,6 @@
 										{
 											"account": expense_account,
 											"against": self.supplier,
-											"against_link": self.supplier,
 											"debit": discrepancy_caused_by_exchange_rate_difference,
 											"cost_center": item.cost_center,
 											"project": item.project or self.project,
@@ -1097,7 +1088,6 @@
 										{
 											"account": self.get_company_default("exchange_gain_loss_account"),
 											"against": self.supplier,
-											"against_link": self.supplier,
 											"credit": discrepancy_caused_by_exchange_rate_difference,
 											"cost_center": item.cost_center,
 											"project": item.project or self.project,
@@ -1132,7 +1122,6 @@
 								{
 									"account": self.stock_received_but_not_billed,
 									"against": self.supplier,
-									"against_link": self.supplier,
 									"debit": flt(item.item_tax_amount, item.precision("item_tax_amount")),
 									"remarks": self.remarks or _("Accounting Entry for Stock"),
 									"cost_center": self.cost_center,
@@ -1194,7 +1183,6 @@
 					{
 						"account": cost_of_goods_sold_account,
 						"against": item.expense_account,
-						"against_link": item.expense_account,
 						"debit": stock_adjustment_amt,
 						"remarks": self.get("remarks") or _("Stock Adjustment"),
 						"cost_center": item.cost_center,
@@ -1225,7 +1213,6 @@
 						{
 							"account": tax.account_head,
 							"against": self.supplier,
-							"against_link": self.supplier,
 							dr_or_cr: base_amount,
 							dr_or_cr + "_in_account_currency": base_amount
 							if account_currency == self.company_currency
@@ -1275,7 +1262,6 @@
 								"account": tax.account_head,
 								"cost_center": tax.cost_center,
 								"against": self.supplier,
-								"against_link": self.supplier,
 								"credit": applicable_amount,
 								"remarks": self.remarks or _("Accounting Entry for Stock"),
 							},
@@ -1294,7 +1280,6 @@
 								"account": tax.account_head,
 								"cost_center": tax.cost_center,
 								"against": self.supplier,
-								"against_link": self.supplier,
 								"credit": valuation_tax[tax.name],
 								"remarks": self.remarks or _("Accounting Entry for Stock"),
 							},
@@ -1310,7 +1295,6 @@
 					{
 						"account": self.unrealized_profit_loss_account,
 						"against": self.supplier,
-						"against_link": self.supplier,
 						"credit": flt(self.total_taxes_and_charges),
 						"credit_in_account_currency": flt(self.base_total_taxes_and_charges),
 						"cost_center": self.cost_center,
@@ -1332,7 +1316,6 @@
 						"party_type": "Supplier",
 						"party": self.supplier,
 						"against": self.cash_bank_account,
-						"against_link": self.cash_bank_account,
 						"debit": self.base_paid_amount,
 						"debit_in_account_currency": self.base_paid_amount
 						if self.party_account_currency == self.company_currency
@@ -1354,7 +1337,6 @@
 					{
 						"account": self.cash_bank_account,
 						"against": self.supplier,
-						"against_link": self.supplier,
 						"credit": self.base_paid_amount,
 						"credit_in_account_currency": self.base_paid_amount
 						if bank_account_currency == self.company_currency
@@ -1379,7 +1361,6 @@
 						"party_type": "Supplier",
 						"party": self.supplier,
 						"against": self.write_off_account,
-						"against_link": self.write_off_account,
 						"debit": self.base_write_off_amount,
 						"debit_in_account_currency": self.base_write_off_amount
 						if self.party_account_currency == self.company_currency
@@ -1400,7 +1381,6 @@
 					{
 						"account": self.write_off_account,
 						"against": self.supplier,
-						"against_link": self.supplier,
 						"credit": flt(self.base_write_off_amount),
 						"credit_in_account_currency": self.base_write_off_amount
 						if write_off_account_currency == self.company_currency
@@ -1428,7 +1408,6 @@
 					{
 						"account": round_off_account,
 						"against": self.supplier,
-						"against_link": self.supplier,
 						"debit_in_account_currency": self.rounding_adjustment,
 						"debit": self.base_rounding_adjustment,
 						"cost_center": round_off_cost_center
diff --git a/erpnext/accounts/doctype/sales_invoice/sales_invoice.py b/erpnext/accounts/doctype/sales_invoice/sales_invoice.py
index 7f00f0f..cc19650 100644
--- a/erpnext/accounts/doctype/sales_invoice/sales_invoice.py
+++ b/erpnext/accounts/doctype/sales_invoice/sales_invoice.py
@@ -1234,7 +1234,6 @@
 						"party": self.customer,
 						"due_date": self.due_date,
 						"against": self.against_income_account,
-						"against_link": self.against_income_account,
 						"debit": base_grand_total,
 						"debit_in_account_currency": base_grand_total
 						if self.party_account_currency == self.company_currency
@@ -1264,7 +1263,6 @@
 						{
 							"account": tax.account_head,
 							"against": self.customer,
-							"against_link": self.customer,
 							"credit": flt(base_amount, tax.precision("tax_amount_after_discount_amount")),
 							"credit_in_account_currency": (
 								flt(base_amount, tax.precision("base_tax_amount_after_discount_amount"))
@@ -1286,7 +1284,6 @@
 					{
 						"account": self.unrealized_profit_loss_account,
 						"against": self.customer,
-						"against_link": self.customer,
 						"debit": flt(self.total_taxes_and_charges),
 						"debit_in_account_currency": flt(self.base_total_taxes_and_charges),
 						"cost_center": self.cost_center,
@@ -1355,7 +1352,6 @@
 
 					for gle in fixed_asset_gl_entries:
 						gle["against"] = self.customer
-						gle["against_link"] = self.customer
 						gl_entries.append(self.get_gl_dict(gle, item=item))
 
 					self.set_asset_status(asset)
@@ -1377,7 +1373,6 @@
 								{
 									"account": income_account,
 									"against": self.customer,
-									"against_link": self.customer,
 									"credit": flt(base_amount, item.precision("base_net_amount")),
 									"credit_in_account_currency": (
 										flt(base_amount, item.precision("base_net_amount"))
@@ -1448,7 +1443,6 @@
 						"account": self.loyalty_redemption_account,
 						"cost_center": self.cost_center or self.loyalty_redemption_cost_center,
 						"against": self.customer,
-						"against_link": self.customer,
 						"debit": self.loyalty_amount,
 						"remark": "Loyalty Points redeemed by the customer",
 					},
@@ -1476,7 +1470,6 @@
 								"party_type": "Customer",
 								"party": self.customer,
 								"against": payment_mode.account,
-								"against_link": payment_mode.account,
 								"credit": payment_mode.base_amount,
 								"credit_in_account_currency": payment_mode.base_amount
 								if self.party_account_currency == self.company_currency
@@ -1498,7 +1491,6 @@
 							{
 								"account": payment_mode.account,
 								"against": self.customer,
-								"against_link": self.customer,
 								"debit": payment_mode.base_amount,
 								"debit_in_account_currency": payment_mode.base_amount
 								if payment_mode_account_currency == self.company_currency
@@ -1523,7 +1515,6 @@
 							"party_type": "Customer",
 							"party": self.customer,
 							"against": self.account_for_change_amount,
-							"against_link": self.account_for_change_amount,
 							"debit": flt(self.base_change_amount),
 							"debit_in_account_currency": flt(self.base_change_amount)
 							if self.party_account_currency == self.company_currency
@@ -1545,7 +1536,6 @@
 						{
 							"account": self.account_for_change_amount,
 							"against": self.customer,
-							"against_link": self.customer,
 							"credit": self.base_change_amount,
 							"cost_center": self.cost_center,
 						},
@@ -1572,7 +1562,6 @@
 						"party_type": "Customer",
 						"party": self.customer,
 						"against": self.write_off_account,
-						"against_link": self.write_off_account,
 						"credit": flt(self.base_write_off_amount, self.precision("base_write_off_amount")),
 						"credit_in_account_currency": (
 							flt(self.base_write_off_amount, self.precision("base_write_off_amount"))
@@ -1593,7 +1582,6 @@
 					{
 						"account": self.write_off_account,
 						"against": self.customer,
-						"against_link": self.customer,
 						"debit": flt(self.base_write_off_amount, self.precision("base_write_off_amount")),
 						"debit_in_account_currency": (
 							flt(self.base_write_off_amount, self.precision("base_write_off_amount"))
@@ -1622,7 +1610,6 @@
 					{
 						"account": round_off_account,
 						"against": self.customer,
-						"against_link": self.customer,
 						"credit_in_account_currency": flt(
 							self.rounding_adjustment, self.precision("rounding_adjustment")
 						),
diff --git a/erpnext/assets/doctype/asset/asset.py b/erpnext/assets/doctype/asset/asset.py
index 604ff6b..a7e6ae9 100644
--- a/erpnext/assets/doctype/asset/asset.py
+++ b/erpnext/assets/doctype/asset/asset.py
@@ -698,7 +698,6 @@
 					{
 						"account": cwip_account,
 						"against": fixed_asset_account,
-						"against_link": fixed_asset_account,
 						"remarks": self.get("remarks") or _("Accounting Entry for Asset"),
 						"posting_date": self.available_for_use_date,
 						"credit": self.purchase_receipt_amount,
@@ -714,7 +713,6 @@
 					{
 						"account": fixed_asset_account,
 						"against": cwip_account,
-						"against_link": cwip_account,
 						"remarks": self.get("remarks") or _("Accounting Entry for Asset"),
 						"posting_date": self.available_for_use_date,
 						"debit": self.purchase_receipt_amount,
diff --git a/erpnext/assets/doctype/asset_capitalization/asset_capitalization.py b/erpnext/assets/doctype/asset_capitalization/asset_capitalization.py
index 4a3c04e..66997ca 100644
--- a/erpnext/assets/doctype/asset_capitalization/asset_capitalization.py
+++ b/erpnext/assets/doctype/asset_capitalization/asset_capitalization.py
@@ -486,7 +486,6 @@
 							{
 								"account": account,
 								"against": target_account,
-								"against_link": target_account,
 								"cost_center": item_row.cost_center,
 								"project": item_row.get("project") or self.get("project"),
 								"remarks": self.get("remarks") or "Accounting Entry for Stock",
@@ -528,7 +527,6 @@
 
 			for gle in fixed_asset_gl_entries:
 				gle["against"] = target_account
-				gle["against_link"] = target_account
 				gl_entries.append(self.get_gl_dict(gle, item=item))
 				target_against.add(gle["account"])
 
@@ -545,7 +543,6 @@
 					{
 						"account": item_row.expense_account,
 						"against": target_account,
-						"against_link": target_account,
 						"cost_center": item_row.cost_center,
 						"project": item_row.get("project") or self.get("project"),
 						"remarks": self.get("remarks") or "Accounting Entry for Stock",
diff --git a/erpnext/assets/doctype/asset_repair/asset_repair.py b/erpnext/assets/doctype/asset_repair/asset_repair.py
index fb088eb..10d36e6 100644
--- a/erpnext/assets/doctype/asset_repair/asset_repair.py
+++ b/erpnext/assets/doctype/asset_repair/asset_repair.py
@@ -286,7 +286,6 @@
 					"debit": self.repair_cost,
 					"debit_in_account_currency": self.repair_cost,
 					"against": pi_expense_account,
-					"against_link": pi_expense_account,
 					"voucher_type": self.doctype,
 					"voucher_no": self.name,
 					"cost_center": self.cost_center,
@@ -306,7 +305,6 @@
 					"credit": self.repair_cost,
 					"credit_in_account_currency": self.repair_cost,
 					"against": fixed_asset_account,
-					"against_link": fixed_asset_account,
 					"voucher_type": self.doctype,
 					"voucher_no": self.name,
 					"cost_center": self.cost_center,
@@ -341,7 +339,6 @@
 							"credit": item.amount,
 							"credit_in_account_currency": item.amount,
 							"against": fixed_asset_account,
-							"against_link": fixed_asset_account,
 							"voucher_type": self.doctype,
 							"voucher_no": self.name,
 							"cost_center": self.cost_center,
@@ -359,7 +356,6 @@
 							"debit": item.amount,
 							"debit_in_account_currency": item.amount,
 							"against": item.expense_account or default_expense_account,
-							"against_link": item.expense_account or default_expense_account,
 							"voucher_type": self.doctype,
 							"voucher_no": self.name,
 							"cost_center": self.cost_center,
diff --git a/erpnext/controllers/accounts_controller.py b/erpnext/controllers/accounts_controller.py
index be92a69..0c554f2 100644
--- a/erpnext/controllers/accounts_controller.py
+++ b/erpnext/controllers/accounts_controller.py
@@ -1169,7 +1169,6 @@
 					{
 						"account": round_off_account,
 						"against": against,
-						"against_link": against,
 						credit_or_debit: precision_loss,
 						"cost_center": round_off_cost_center
 						if self.use_company_roundoff_cost_center
@@ -1553,7 +1552,6 @@
 							{
 								"account": item.discount_account,
 								"against": supplier_or_customer,
-								"against_link": supplier_or_customer,
 								dr_or_cr: flt(
 									discount_amount * self.get("conversion_rate"), item.precision("discount_amount")
 								),
@@ -1572,7 +1570,6 @@
 							{
 								"account": income_or_expense_account,
 								"against": supplier_or_customer,
-								"against_link": supplier_or_customer,
 								rev_dr_cr: flt(
 									discount_amount * self.get("conversion_rate"), item.precision("discount_amount")
 								),
@@ -1596,7 +1593,6 @@
 					{
 						"account": self.additional_discount_account,
 						"against": supplier_or_customer,
-						"against_link": supplier_or_customer,
 						dr_or_cr: self.base_discount_amount,
 						"cost_center": self.cost_center or erpnext.get_default_cost_center(self.company),
 					},
diff --git a/erpnext/controllers/stock_controller.py b/erpnext/controllers/stock_controller.py
index 4eef7cf..7c63518 100644
--- a/erpnext/controllers/stock_controller.py
+++ b/erpnext/controllers/stock_controller.py
@@ -163,7 +163,6 @@
 								{
 									"account": warehouse_account[sle.warehouse]["account"],
 									"against": expense_account,
-									"against_link": expense_account,
 									"cost_center": item_row.cost_center,
 									"project": item_row.project or self.get("project"),
 									"remarks": self.get("remarks") or _("Accounting Entry for Stock"),
@@ -180,7 +179,6 @@
 								{
 									"account": expense_account,
 									"against": warehouse_account[sle.warehouse]["account"],
-									"against_link": warehouse_account[sle.warehouse]["account"],
 									"cost_center": item_row.cost_center,
 									"remarks": self.get("remarks") or _("Accounting Entry for Stock"),
 									"debit": -1 * flt(sle.stock_value_difference, precision),
@@ -213,7 +211,6 @@
 						{
 							"account": expense_account,
 							"against": warehouse_asset_account,
-							"against_link": warehouse_asset_account,
 							"cost_center": item_row.cost_center,
 							"project": item_row.project or self.get("project"),
 							"remarks": _("Rounding gain/loss Entry for Stock Transfer"),
@@ -230,7 +227,6 @@
 						{
 							"account": warehouse_asset_account,
 							"against": expense_account,
-							"against_link": expense_account,
 							"cost_center": item_row.cost_center,
 							"remarks": _("Rounding gain/loss Entry for Stock Transfer"),
 							"credit": sle_rounding_diff,
@@ -847,7 +843,6 @@
 			"debit": debit,
 			"credit": credit,
 			"against": against_account,
-			"against_link": against_account,
 			"remarks": remarks,
 		}
 
diff --git a/erpnext/regional/united_arab_emirates/utils.py b/erpnext/regional/united_arab_emirates/utils.py
index 6530ab8..634a152 100644
--- a/erpnext/regional/united_arab_emirates/utils.py
+++ b/erpnext/regional/united_arab_emirates/utils.py
@@ -154,7 +154,6 @@
 					"cost_center": tax.cost_center,
 					"posting_date": doc.posting_date,
 					"against": doc.supplier,
-					"against_link": doc.supplier,
 					dr_or_cr: tax.base_tax_amount_after_discount_amount,
 					dr_or_cr + "_in_account_currency": tax.base_tax_amount_after_discount_amount
 					if account_currency == doc.company_currency
diff --git a/erpnext/stock/doctype/stock_entry/stock_entry.py b/erpnext/stock/doctype/stock_entry/stock_entry.py
index 0f866cb..96c249f 100644
--- a/erpnext/stock/doctype/stock_entry/stock_entry.py
+++ b/erpnext/stock/doctype/stock_entry/stock_entry.py
@@ -1460,7 +1460,6 @@
 							{
 								"account": account,
 								"against": d.expense_account,
-								"against_link": d.expense_account,
 								"cost_center": d.cost_center,
 								"remarks": self.get("remarks") or _("Accounting Entry for Stock"),
 								"credit_in_account_currency": flt(amount["amount"]),
@@ -1475,7 +1474,6 @@
 							{
 								"account": d.expense_account,
 								"against": account,
-								"against_link": account,
 								"cost_center": d.cost_center,
 								"remarks": self.get("remarks") or _("Accounting Entry for Stock"),
 								"credit": -1