moved ImportProcessParameters and LikeKindSettings to core_functions
This commit is contained in:
parent
557546b103
commit
0c00aa869b
|
@ -260,18 +260,3 @@ pub fn elect_like_kind_treatment(cutoff_date_arg: &Option<String>) -> (bool, Str
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
pub struct ImportProcessParameters {
|
||||
pub export_path: PathBuf,
|
||||
pub home_currency: String,
|
||||
pub enable_like_kind_treatment: bool,
|
||||
pub costing_method: InventoryCostingMethod,
|
||||
pub lk_cutoff_date_string: String,
|
||||
}
|
||||
impl ImportProcessParameters {}
|
||||
|
||||
#[derive(Clone)]
|
||||
pub struct LikeKindSettings {
|
||||
pub like_kind_cutoff_date: NaiveDate,
|
||||
pub like_kind_basis_date_preserved: bool,
|
||||
}
|
||||
|
|
|
@ -12,7 +12,6 @@ use structopt::StructOpt;
|
|||
|
||||
use crate::account::{Account, RawAccount, Lot};
|
||||
use crate::transaction::{Transaction, ActionRecord};
|
||||
use crate::cli_user_choices::{ImportProcessParameters, LikeKindSettings};
|
||||
use crate::import_accts_txns;
|
||||
use crate::import_cost_proceeds_etc;
|
||||
use crate::create_lots_mvmts;
|
||||
|
@ -29,6 +28,20 @@ pub enum InventoryCostingMethod {
|
|||
FIFObyLotBasisDate,
|
||||
}
|
||||
|
||||
#[derive(Clone)]
|
||||
pub struct LikeKindSettings {
|
||||
pub like_kind_cutoff_date: NaiveDate,
|
||||
pub like_kind_basis_date_preserved: bool,
|
||||
}
|
||||
|
||||
pub struct ImportProcessParameters {
|
||||
pub export_path: PathBuf,
|
||||
pub home_currency: String,
|
||||
pub enable_like_kind_treatment: bool,
|
||||
pub costing_method: InventoryCostingMethod,
|
||||
pub lk_cutoff_date_string: String,
|
||||
}
|
||||
|
||||
pub fn import_and_process_final(
|
||||
input_file_path: PathBuf,
|
||||
settings: &ImportProcessParameters,
|
||||
|
|
|
@ -10,8 +10,7 @@ use chrono::NaiveDate;
|
|||
|
||||
use crate::transaction::{Transaction, ActionRecord, TxType, Polarity, TxHasMargin};
|
||||
use crate::account::{Account, RawAccount, Lot, Movement};
|
||||
use crate::core_functions::InventoryCostingMethod;
|
||||
use crate::cli_user_choices::{ImportProcessParameters, LikeKindSettings};
|
||||
use crate::core_functions::{InventoryCostingMethod, LikeKindSettings, ImportProcessParameters};
|
||||
use crate::utils::{round_d128_1e8};
|
||||
|
||||
pub fn create_lots_and_movements(
|
||||
|
|
|
@ -10,7 +10,7 @@ use decimal::d128;
|
|||
|
||||
use crate::transaction::{Transaction, ActionRecord, Polarity, TxType};
|
||||
use crate::account::{Account, RawAccount, Term};
|
||||
use crate::cli_user_choices::{ImportProcessParameters};
|
||||
use crate::core_functions::{ImportProcessParameters};
|
||||
|
||||
|
||||
pub fn _1_account_sums_to_csv(
|
||||
|
|
|
@ -9,7 +9,7 @@ use decimal::d128;
|
|||
use crate::transaction::{Transaction, TxType, ActionRecord, Polarity};
|
||||
use crate::account::{Account, RawAccount};
|
||||
use crate::utils::{round_d128_1e2};
|
||||
use crate::cli_user_choices::{ImportProcessParameters};
|
||||
use crate::core_functions::{ImportProcessParameters};
|
||||
|
||||
pub fn add_cost_basis_to_movements(
|
||||
settings: &ImportProcessParameters,
|
||||
|
|
|
@ -26,7 +26,7 @@ mod csv_export;
|
|||
mod utils;
|
||||
mod tests;
|
||||
|
||||
use crate::cli_user_choices::ImportProcessParameters;
|
||||
use crate::core_functions::ImportProcessParameters;
|
||||
|
||||
|
||||
#[derive(StructOpt, Debug)]
|
||||
|
|
|
@ -11,7 +11,7 @@ use decimal::d128;
|
|||
use chrono::NaiveDate;
|
||||
use serde_derive::{Serialize, Deserialize};
|
||||
|
||||
use crate::cli_user_choices::ImportProcessParameters;
|
||||
use crate::core_functions::ImportProcessParameters;
|
||||
use crate::account::{Account, Movement, RawAccount};
|
||||
|
||||
#[derive(Clone, Debug, Serialize, Deserialize)]
|
||||
|
|
Loading…
Reference in New Issue