{
	"save_script": [],
	"field": [
		{
			"type": "varchar",
			"length": 40,
			"name": "reclamation_id",
			"constraint": [
				"primary key",
				"unique"
			]
		},
		{
			"type": "varchar",
			"length": 40,
			"name": "person_id",
			"foreign_key": {
				"field": "person_id",
				"link_type": "prevent delete",
				"table": "person"
			}
		},
		{
			"type": "varchar",
			"length": 40,
			"name": "company_id",
			"foreign_key": {
				"field": "company_id",
				"link_type": "prevent delete",
				"table": "company"
			}
		},
		{
			"type": "varchar",
			"length": 40,
			"name": "sales_order_id",
			"foreign_key": {
				"field": "order_id",
				"link_type": "prevent delete",
				"table": "order"
			}
		},
		{
			"type": "varchar",
			"length": 40,
			"name": "repair_purchase_order_id",
			"foreign_key": {
				"field": "order_id",
				"link_type": "prevent delete",
				"table": "order"
			}
		},
		{
			"type": "varchar",
			"length": 40,
			"name": "dispatch_note_id",
			"foreign_key": {
				"field": "order_id",
				"link_type": "prevent delete",
				"table": "order"
			}
		},
		{
			"type": "varchar",
			"length": 80,
			"name": "product_id",
			"foreign_key": {
				"field": "product_id",
				"link_type": "prevent delete",
				"table": "product"
			}
		},
		{
			"type": "varchar",
			"length": 40,
			"name": "fault_found_resource_id",
			"foreign_key": {
				"field": "resource_id",
				"link_type": "prevent delete",
				"table": "resource"
			}
		},
		{
			"type": "varchar",
			"length": 40,
			"name": "faultmade_resource_id",
			"foreign_key": {
				"field": "resource_id",
				"link_type": "prevent delete",
				"table": "resource"
			}
		},
		{
			"type": "varchar",
			"length": 20,
			"name": "currency_id",
			"foreign_key": {
				"field": "currency_id",
				"link_type": "prevent delete",
				"table": "currency"
			}
		},
		{
			"name": "exchange_rate",
			"type": "double"
		},
		{
			"type": "varchar",
			"length": 40,
			"name": "production_lot"
		},
		{
			"type": "varchar",
			"length": 40,
			"name": "reclamation_type"
		},
		{
			"type": "varchar",
			"length": 40,
			"name": "reclamation_state"
		},
		{
			"name": "creation_date",
			"type": "date"
		},
		{
			"name": "finished_date",
			"type": "date"
		},
		{
			"type": "varchar",
			"length": 40,
			"name": "created_from"
		},
		{
			"type": "varchar",
			"length": 40,
			"name": "customer_reclamation"
		},
		{
			"name": "customer_reclamation_date",
			"type": "date"
		},
		{
			"type": "varchar",
			"length": 40,
			"name": "customer_handler"
		},
		{
			"type": "varchar",
			"length": 40,
			"name": "customer_order_number"
		},
		{
			"name": "failed_amount",
			"type": "double"
		},
		{
			"name": "fault_found_in_end_check",
			"type": "integer"
		},
		{
			"name": "fault_found_work_phase",
			"type": "integer"
		},
		{
			"name": "fault_made_work_phase",
			"type": "integer"
		},
		{
			"name": "fault_made_date",
			"type": "date"
		},
		{
			"type": "varchar",
			"length": 40,
			"name": "fault_caused_by"
		},
		{
			"name": "employee_description",
			"type": "text"
		},
		{
			"name": "customer_description",
			"type": "text"
		},
		{
			"name": "handler_description",
			"type": "text"
		},
		{
			"type": "varchar",
			"length": 80,
			"name": "fault_type"
		},
		{
			"type": "varchar",
			"length": 80,
			"name": "fault_reason"
		},
		{
			"name": "measures",
			"type": "text"
		},
		{
			"type": "varchar",
			"length": 80,
			"name": "special_permission_giver"
		},
		{
			"name": "special_permission_date",
			"type": "date"
		},
		{
			"type": "varchar",
			"length": 80,
			"name": "freight_payer"
		},
		{
			"type": "varchar",
			"length": 80,
			"name": "way_of_delivery"
		},
		{
			"type": "varchar",
			"length": 80,
			"name": "order_measures"
		},
		{
			"name": "measures_to_avoid_faults",
			"type": "text"
		},
		{
			"name": "repair_amount",
			"type": "double"
		},
		{
			"name": "rejected_amount",
			"type": "double"
		},
		{
			"name": "material_self_cost",
			"type": "double"
		},
		{
			"name": "no_found_phase_self_cost",
			"type": "integer"
		},
		{
			"name": "work_cumul_self_cost",
			"type": "double"
		},
		{
			"name": "sales_price",
			"type": "double"
		},
		{
			"name": "repair_hours",
			"type": "double"
		},
		{
			"name": "repair_unit_price",
			"type": "double"
		},
		{
			"name": "repair_purchase_charges",
			"type": "double"
		},
		{
			"name": "freight_charges",
			"type": "double"
		},
		{
			"name": "other_charges",
			"type": "double"
		},
		{
			"name": "total_charges",
			"type": "double"
		},
		{
			"name": "paid_compensation",
			"type": "double"
		},
		{
			"name": "credit_note_due_date",
			"type": "date"
		},
		{
			"name": "calculation_type",
			"type": "integer"
		},
		{
			"name": "show_type",
			"type": "integer"
		},
		{
			"name": "info",
			"type": "text"
		},
		{
			"name": "json_data",
			"type": "jsonb"
		}
	],
	"constraint": {
		"save": {
			"allow": [
				{
					"field": "rcl_reclamation_id",
					"message": "Field '%s' may not be empty",
					"code": [
						[
							"rcl_reclamation_id",
							"<>",
							""
						]
					]
				}
			]
		}
	},
	"table_prefix": "rcl",
	"extra_field": [
		{
			"type": "double",
			"name": "json_data.compensate_delivery"
		},
		{
			"type": "double",
			"name": "json_data.compensate_material"
		},
		{
			"type": "double",
			"name": "json_data.compensate_other_charges"
		},
		{
			"type": "double",
			"name": "json_data.compensate_subcontract"
		},
		{
			"type": "double",
			"name": "json_data.compensate_work_self_cost"
		},
		{
			"type": "date",
			"name": "json_data.compensation_due_date"
		},
		{
			"type": "varchar",
			"length": 80,
			"name": "json_data.customer_pays_freights"
		},
		{
			"type": "varchar",
			"length": 80,
			"name": "json_data.customer_project"
		},
		{
			"type": "varchar",
			"length": 40,
			"name": "json_data.fault_made_resource_id"
		},
		{
			"type": "integer",
			"name": "json_data.firm_id"
		},
		{
			"type": "varchar",
			"length": 40,
			"name": "json_data.handler_id"
		},
		{
			"type": "double",
			"name": "json_data.incorrect_material_used"
		},
		{
			"type": "varchar",
			"length": 40,
			"name": "json_data.modifier_id"
		},
		{
			"type": "integer",
			"name": "json_data.print_to_report"
		},
		{
			"type": "varchar",
			"length": 80,
			"name": "json_data.project_id"
		},
		{
			"type": "text",
			"name": "json_data.purchase_description"
		},
		{
			"type": "varchar",
			"length": 20,
			"name": "json_data.purchase_order_id"
		},
		{
			"type": "varchar",
			"length": 80,
			"name": "json_data.purchase_our_reference"
		},
		{
			"type": "varchar",
			"length": 100,
			"name": "json_data.purchase_product_id"
		},
		{
			"type": "varchar",
			"length": 80,
			"name": "json_data.purchase_repair_action"
		},
		{
			"type": "varchar",
			"length": 80,
			"name": "json_data.purchase_return"
		},
		{
			"type": "integer",
			"name": "json_data.purchase_row_number"
		},
		{
			"type": "varchar",
			"length": 60,
			"name": "json_data.purchase_way_of_delivery"
		},
		{
			"type": "double",
			"name": "json_data.repair_price__unit"
		},
		{
			"type": "double",
			"name": "json_data.repair_price_total"
		},
		{
			"type": "varchar",
			"length": 80,
			"name": "json_data.return"
		},
		{
			"type": "double",
			"name": "json_data.subcontract_self_cost"
		},
		{
			"type": "varchar",
			"length": 40,
			"name": "json_data.supplier_id"
		},
		{
			"type": "varchar",
			"length": 80,
			"name": "json_data.supplier_pays_freights"
		},
		{
			"type": "text",
			"name": "json_data.supplier_text_address"
		},
		{
			"type": "double",
			"name": "json_data.supplier_total_sum"
		},
		{
			"type": "varchar",
			"length": 120,
			"name": "json_data.transfer_id"
		},
		{
			"type": "integer",
			"name": "json_data.transfer_state"
		}
	],
	"calculated_field": [],
	"field_change": [
		{
			"name": "reclamation_state",
			"old_name": [
				"state"
			]
		},
		{
			"name": "reclamation_type",
			"old_name": [
				"type"
			]
		}
	],
	"name": "structure_ma/rcl.json",
	"table_name": "reclamation"
}