{
	"info": "",
	"field": {
		"appa_kVoucher_Number": [],
		"appa_kAccounts_Payable_id": [
			["appa_sc_ACCOUNTS_PAYABLE_ID"]
		],
		"appa_kRow_Number": [],
		"appa_kValue_Date": [],
		"appa_kDiscount_Sum": [
			["appa_scPOISTOSUMMA"],
			["ap_C_ALAR MUUTTU"]
		],
		"appa_kMethod_Of_Payment":[
			["ap_scSUOR_TAPA"],
			["appa_SUOR_TILI"]
		],
		"appa_kPayee_Bank_Account": [
			"if", ["appa_Payee_Bank_account", "<>", ""],
			[
				["_ap_tErr", "=", ["bank__AccountNumberCheck", ["appa_Payee_Bank_Account"]]],
				[
					"if", ["_ap_tErr", "<>", ""],
					[
						["_err_MESSAGE", ["_ap_tErr", "Current_method_name", "true"]],
						[
							"if", ["_el_InInput", "=", "true"],
							[
								["REJECT", ["appa_Payee_Bank_Account"]]
							]
						]
					]
				]
			]
		],
		"appa_kInfo": [],
		"appa_kAccount_id": [
			"if", ["appa_CanModify"],
			[
				["ap_ON_KULUTILI (True)"],
				["appa_SUOR_TAPA"]
			],
			[
				["appa_Account_id", "=", "Old"]
			]
		],
		"appa_kPayment_Date": [
			["appa_Value_Date", "="]
		],
		"appa_kPayment_Sum": [
			["appa_scMAKSETTU"]
		],
		"appa_kState": [
			"if", ["appa_CanModify"],
			[

			],
			[
				["appa_State", "="]
			]
		],
		"appa_kPartial_Payment_Sum": [
			"if", ["appa_CanModify"],
			[
				"if", ["appa_Is_Expence_Account"],
				[
					["appa_Expence_Sum", "="]
				],
				[
					["appa_Expence_Sum", "=", "0"]
				]

			],
			[
				["appa_Partial_Payment_Sum", "="]
			]
		],
		"appa_kIs_Expence_Account": [
			["ap_scKULUTILI"]
		],
		"appa_kExpence_Sum": [
			"if", ["appa_CanModify"],
			[
				["ap_C_ALAR KEN_vs"]
			],
			[
				["appa_Expence_Sum", "="]
			]
		],
		"appa_kProgress_Payment": [],
		"appa_kFirm_id": [],
		"appa_kExchange_Rate": [
			"if", ["appa_CanModify"],
			[

				["ap_ON_KULUTILI"]
			],
			[
				["appa_Exchange_Rate", "="]
			]
		],
		"appa_kSum_Amount": [
			["appa_scSUMMA_MK"]
		],
		"appa_kBank_Statement": [],
		"appa_kCurrency_id": [
			["appa_scVALUUTTA"]
		],
		"appa_kRecord_ID": [],
		"appa_kTransfer_id": []
	},
	"function": {
		"appa_sc_ACCOUNTS_PAYABLE_ID": [
			"if", ["appa_Receiver_Bank_Account", "<>", ""],
			[
				["appa_Payee_Bank_Account", "=", "appa_Receiver_Bank_Account"]
			],
			[
				["appa_Payee_Bank_Account", "=", "s_Bank_Account"]
			],
			["appa_Discount_Sum", "=", "appa_Payable_Amount"],
			["appa_Value_Date", "=", "appa_Due_Date"],
			["appa_Method_Of_Payment", "=", "appa_Method_Of_Payment"]
		],
		"appa_scPOISTOSUMMA": [
			"if", ["appa_CanModify"],
			[
				["appa_Payment_Sum", "=", "appa_Discount_Sum"],
				["appa_scMAKSETTU"]
			],
			[
				["appa_Discount_Sum", "=", ["Old", "appa_Discount_Sum"]]
			]
		],
		"appa_SUOR_TILI": [
			["_err_LANG_DO"],
			"if", ["appa_Method_Of_Payment", "<>", ""],
			[
				["_appa_lFound", "=", "_qry_Fld", [0, "ac_kName", "=", ["appa_Method_Of_Payment", "", "kFalse"]]]
			]
		],
		"appa_SUOR_TAPA": [
			["_err_LANG_DO"],
			["_appa_lFound", "=", "qry_Fld", [0, "ac_kAccount_ID", "=", ["appa_Account_id", "", "kFalse"]]],
			"if", ["_appa_lFound", ">", 0],
			[
				["appa_Method_Of_Payment", "=", "a_Name"]
			],
			[
				["_err_CRY", ["En löydä tätä suoritustapaa tilikartasta", "kTrue"]],
				["appa_Method_Of_Payment", "=", ""]
			]
		],
		"appa_scMAKSETTU": [
			"if", ["appa_CanModify"],
			[
				["appa_Partial_Payment_Sum", "=", "appa_Payment_Sum"],
				"if", ["appa_Is_Expence_Account"],
				[
					["appa_Expence_Sum", "=", "appa_Partial_Payment_Sum"]
				],
				[
					["appa_Expence_Sum", "=", 0]
				],
				["ap_ON_KULUTILI", ["False"]],
				["ap_C_ALAR_MUUTTU"]
			],
			[
				["appa_Payment_Sum", "=", "Old", ["appa_Payment_Sum"]]
			]
		],
		"appa_scSUMMA_MK": [
			"if", ["appa_CanModify"],
			[
				"if", ["appa_Sum_Amount", "<>", 0],
				[
					["appa_Partial_Payment_Sum", "=", "cur_C_Currency", ["False", -1, "appa_Exchange_Rate", "cur_DefaultCurre", "appa_Sum_Amount", "appa_Currency_id"]],
					["appa_Discount_Sum", "=", "appa_Partial_Payment_Sum"],
					["appa_Payment_Sum", "=", "appa_Partial_Payment_Sum"]
				],
				[
					["appa_Partial_Payment_Sum", "=", 0],
					["appa_scC_CURRENCY"]
				],
				["ap_C_ALAR_KEN_vs"]
			],
			[
				["appa_Sum_Amount", "=", "Old", ["appa_Sum_Amount"]]
			]
		],
		"appa_scVALUUTTA": [
			"if", ["appa_CanModify"],
			[
				["appa_Exchange_Rate", "=", "c_Buying_Rate"],
				["RELATE_ONE", ["appa_Account_id"]],
				["ap_ON_KULUTILI", ["False"]]
			],
			[
				["appa_Currency_id", "=", "Old", ["appa_Currency_id"]]
			]
		]
	}
}
