update guard on get mat definitions

This commit is contained in:
Pakin 2026-02-09 14:32:52 +07:00
parent 4aa9ab3cfb
commit 05d66feb6f

View file

@ -9,6 +9,8 @@ use rayon::iter::{IndexedParallelIterator, IntoParallelRefIterator, ParallelIter
use serde::{Deserialize, Serialize};
use serde_json::Value;
use crate::recipe_functions::common::MATERIAL_INTER_GUARD;
pub trait CommonRecipeTrait {
fn insert_comment(&mut self, comment: String);
@ -1849,10 +1851,10 @@ impl MaterialSetting {
let cc = country_code.unwrap().parse::<i64>().expect("not a number");
let mat_num = self.id.clone().as_i64().unwrap();
let check_if_start_with_cc = mat_num.to_string().starts_with(&format!("{cc}"));
let check_if_start_with_cc = mat_num > MATERIAL_INTER_GUARD as i64;
if check_if_start_with_cc {
mat_num - (cc * 10000)
mat_num - (cc * MATERIAL_INTER_GUARD as i64)
} else {
mat_num
}