{
	"field": [
		{
			"type": "varchar",
			"length": 20,
			"name": "record_type"
		},
		{
			"type": "varchar",
			"length": 40,
			"name": "invoice_id",
			"foreign_key": {
				"field": "order_id",
				"link_type": "prevent delete",
				"table": "order"
			}
		},
		{
			"type": "varchar",
			"length": 20,
			"name": "account_id",
			"foreign_key": {
				"field": "account_id",
				"link_type": "prevent delete",
				"table": "bookkeeping_account"
			}
		},
		{
			"type": "varchar",
			"length": 20,
			"name": "voucher_id",
			"foreign_key": {
				"field": "voucher_id",
				"link_type": "prevent delete",
				"table": "bookkeeping_voucher"
			}
		},
		{
			"type": "varchar",
			"length": 20,
			"name": "currency_id",
			"foreign_key": {
				"field": "currency_id",
				"link_type": "prevent delete",
				"table": "currency"
			}
		},
		{
			"type": "varchar",
			"length": 20,
			"name": "payment_state"
		},
		{
			"name": "payment_date",
			"type": "date"
		},
		{
			"name": "value_date",
			"type": "date"
		},
		{
			"name": "days_late",
			"type": "integer"
		},
		{
			"name": "penalty_interest_price",
			"type": "double"
		},
		{
			"name": "paid_price",
			"type": "double"
		},
		{
			"type": "varchar",
			"length": 80,
			"name": "discount_type"
		},
		{
			"name": "discount_price",
			"type": "double"
		},
		{
			"name": "exchange_rate",
			"type": "double"
		},
		{
			"name": "local_paid_price",
			"type": "double"
		},
		{
			"name": "local_discount_price",
			"type": "double"
		},
		{
			"type": "varchar",
			"length": 80,
			"name": "bank_statement"
		},
		{
			"name": "info",
			"type": "text"
		},
		{
			"name": "json_data",
			"type": "jsonb"
		}
	],
	"table_prefix": "invp",
	"save_script": [],
	"extra_field": [
		{
			"type": "varchar",
			"length": 80,
			"name": "json_data.customer_project"
		},
		{
			"type": "double",
			"name": "json_data.expence_sum"
		},
		{
			"type": "integer",
			"name": "json_data.firm_id"
		},
		{
			"type": "boolean",
			"name": "json_data.is_expence_account"
		},
		{
			"type": "varchar",
			"length": 50,
			"name": "json_data.method_of_payment"
		},
		{
			"type": "varchar",
			"length": 40,
			"name": "json_data.modifier_id"
		},
		{
			"type": "double",
			"name": "json_data.partial_payment_sum"
		},
		{
			"type": "varchar",
			"length": 80,
			"name": "json_data.payee_bank_account"
		},
		{
			"type": "integer",
			"name": "json_data.progress_payment"
		},
		{
			"type": "varchar",
			"length": 80,
			"name": "json_data.project_id"
		},
		{
			"type": "integer",
			"name": "json_data.row_number"
		},
		{
			"type": "varchar",
			"length": 120,
			"name": "json_data.transfer_id"
		},
		{
			"type": "integer",
			"name": "json_data.transfer_state"
		},
		{
			"type": "varchar",
			"length": 40,
			"name": "json_data.voucher_number"
		},
		{
			"type": "varchar",
			"length": 24,
			"name": "json_data.customer"
		},
		{
			"type": "varchar",
			"length": 40,
			"name": "json_data.handler_id"
		},
		{
			"type": "varchar",
			"length": 20,
			"name": "json_data.interest_invoice"
		},
		{
			"type": "varchar",
			"length": 20,
			"name": "json_data.invoice_payment_code"
		},
		{
			"type": "boolean",
			"name": "json_data.is_partial_payment"
		},
		{
			"type": "integer",
			"name": "json_data.payment_number"
		},
		{
			"type": "varchar",
			"length": 40,
			"name": "json_data.bank_reference_number"
		},
		{
			"type": "varchar",
			"length": 12,
			"name": "json_data.saved_currency"
		}
	],
	"calculated_field": [],
	"constraint": {
		"save": {
			"allow": [
				{
					"field": "invp_invoice_id",
					"message": "Field '%s' may not be empty",
					"code": [
						[
							"invp_invoice_id",
							"<>",
							""
						]
					]
				},
				{
					"field": "invp_account_id",
					"message": "Field '%s' may not be empty",
					"code": [
						[
							"invp_account_id",
							"<>",
							""
						]
					]
				},
				{
					"field": "invp_value_date",
					"message": "Field '%s' may not be empty",
					"code": [
						[
							"invp_value_date",
							"<>",
							""
						]
					]
				},
				{
					"field": "invp_payment_date",
					"message": "Field '%s' may not be empty",
					"code": [
						[
							"invp_payment_date",
							"<>",
							""
						]
					]
				}
			]
		}
	},
	"name": "structure_ma/invp.json",
	"table_name": "invoice_payment"
}