83 lines
1.9 KiB
Rust
83 lines
1.9 KiB
Rust
use che_orm::Model;
|
|
|
|
use crate::apps::{
|
|
frcapp::models::Frc, personemanagment::models::Employee, projectapp::models::Project,
|
|
};
|
|
|
|
#[derive(Debug, Clone, Model)]
|
|
#[model(table = "contractapp")]
|
|
pub struct Contract {
|
|
#[field(primary_key)]
|
|
pub id: i64,
|
|
|
|
pub name: String,
|
|
pub number: String,
|
|
pub absolute_url: String,
|
|
pub contract_type: String,
|
|
pub category: String,
|
|
pub amount_total_display: String,
|
|
pub amount_by_ds: String,
|
|
pub comment: String,
|
|
pub date: String,
|
|
pub status_name: String,
|
|
pub status: String,
|
|
pub nds: String,
|
|
pub name_of_product: String,
|
|
pub counterparty_name: String,
|
|
pub amount: f64,
|
|
pub month_pay: Option<f64>,
|
|
pub avans_pay: String,
|
|
pub amount_total: f64,
|
|
pub estimate_nds_cost: f64,
|
|
pub estimate_nds_cert: f64,
|
|
pub bill_cost_sum: Option<f64>,
|
|
pub bill_paid_sum: Option<f64>,
|
|
pub income_total: f64,
|
|
pub arrears: f64,
|
|
|
|
#[field(foreign_key = Counterparty)]
|
|
pub counterparty_id: Option<i64>,
|
|
|
|
#[field(foreign_key = Project)]
|
|
pub project_id: Option<i64>,
|
|
|
|
#[field(foreign_key = Frc)]
|
|
pub frc_id: Option<i64>,
|
|
|
|
#[field(foreign_key = Employee)]
|
|
pub employee_id: Option<i64>,
|
|
}
|
|
|
|
#[derive(Debug, Clone, Model)]
|
|
#[model(table = "counterparty")]
|
|
pub struct Counterparty {
|
|
#[field(primary_key)]
|
|
pub id: i64,
|
|
|
|
pub name: String,
|
|
}
|
|
|
|
#[derive(Debug, Clone, Model)]
|
|
#[model(table = "contract_application_file")]
|
|
pub struct ContractApplicationFile {
|
|
#[field(primary_key)]
|
|
pub id: i64,
|
|
|
|
#[field(foreign_key = Contract)]
|
|
pub contract_id: i64,
|
|
|
|
pub name: String,
|
|
pub file_type: String,
|
|
pub file_type_display: String,
|
|
pub status: String,
|
|
pub status_display: String,
|
|
pub absolute_url: String,
|
|
pub scan_name: String,
|
|
pub scan_url: String,
|
|
pub local_path: String,
|
|
pub comment: String,
|
|
pub bill_total: f64,
|
|
pub bill_cost_total: f64,
|
|
pub questionnair: Option<i64>,
|
|
}
|