Spaces:
Sleeping
Sleeping
Update main.py
Browse files
main.py
CHANGED
|
@@ -53,10 +53,28 @@ def process_rental_company(company_name: str):
|
|
| 53 |
print(f"\n'{company_name}' λ νμ¬ λ°μ΄ν° μ²λ¦¬ μλ£.")
|
| 54 |
|
| 55 |
|
| 56 |
-
def process_rental_company_with_voucher(uploaded_file_path, voucher_number):
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 57 |
company_name = "νκ΅λ ν"
|
| 58 |
-
company_config = cfg.RENTAL_COMPANIES[company_name]
|
| 59 |
-
|
|
|
|
|
|
|
|
|
|
| 60 |
mapping_file = company_config['mapping_file']
|
| 61 |
mapping_dict = mapping_utils.load_mapping_file(mapping_file)
|
| 62 |
|
|
@@ -123,6 +141,7 @@ def main():
|
|
| 123 |
parser = argparse.ArgumentParser(description='ERP μλ μ ν μμ± νλ‘κ·Έλ¨')
|
| 124 |
parser.add_argument('-c', '--company', type=str, help='μ²λ¦¬ν λ νμ¬ μ΄λ¦')
|
| 125 |
parser.add_argument('-a', '--all', action='store_true', help='λͺ¨λ λ νμ¬ μ²λ¦¬')
|
|
|
|
| 126 |
|
| 127 |
args = parser.parse_args()
|
| 128 |
|
|
@@ -137,4 +156,4 @@ def main():
|
|
| 137 |
|
| 138 |
|
| 139 |
if __name__ == "__main__":
|
| 140 |
-
main()
|
|
|
|
| 53 |
print(f"\n'{company_name}' λ νμ¬ λ°μ΄ν° μ²λ¦¬ μλ£.")
|
| 54 |
|
| 55 |
|
| 56 |
+
def process_rental_company_with_voucher(uploaded_file_path, voucher_number, employee_number):
|
| 57 |
+
"""
|
| 58 |
+
νΉμ λ νμ¬μ λ°μ΄ν° μ²λ¦¬ (μΉ μΈν°νμ΄μ€μ©)
|
| 59 |
+
|
| 60 |
+
Args:
|
| 61 |
+
uploaded_file_path: μ
λ‘λλ νμΌ κ²½λ‘
|
| 62 |
+
voucher_number: μ νλ²νΈ
|
| 63 |
+
employee_number: μ¬μλ²νΈ (νμ)
|
| 64 |
+
|
| 65 |
+
Returns:
|
| 66 |
+
μΆλ ₯ νμΌ κ²½λ‘
|
| 67 |
+
"""
|
| 68 |
+
# μ¬μλ²νΈ νμ κ²μ¦
|
| 69 |
+
if not employee_number or not employee_number.strip():
|
| 70 |
+
raise ValueError("μ¬μλ²νΈλ₯Ό μ
λ ₯ν΄μ£ΌμΈμ. μ¬μλ²νΈλ νμ μ
λ ₯κ°μ
λλ€.")
|
| 71 |
+
|
| 72 |
company_name = "νκ΅λ ν"
|
| 73 |
+
company_config = cfg.RENTAL_COMPANIES[company_name].copy() # μ€μ μ 볡μ¬ν΄μ μ¬μ©
|
| 74 |
+
|
| 75 |
+
# μ¬μλ²νΈ μ€μ - μ
λ ₯λ κ° μ¬μ©
|
| 76 |
+
company_config['id_write'] = employee_number.strip()
|
| 77 |
+
|
| 78 |
mapping_file = company_config['mapping_file']
|
| 79 |
mapping_dict = mapping_utils.load_mapping_file(mapping_file)
|
| 80 |
|
|
|
|
| 141 |
parser = argparse.ArgumentParser(description='ERP μλ μ ν μμ± νλ‘κ·Έλ¨')
|
| 142 |
parser.add_argument('-c', '--company', type=str, help='μ²λ¦¬ν λ νμ¬ μ΄λ¦')
|
| 143 |
parser.add_argument('-a', '--all', action='store_true', help='λͺ¨λ λ νμ¬ μ²λ¦¬')
|
| 144 |
+
parser.add_argument('-e', '--employee', type=str, default='00616', help='μ¬μλ²νΈ (κΈ°λ³Έκ°: 00616)')
|
| 145 |
|
| 146 |
args = parser.parse_args()
|
| 147 |
|
|
|
|
| 156 |
|
| 157 |
|
| 158 |
if __name__ == "__main__":
|
| 159 |
+
main()
|