From ad8ef1a930d536b45325c7ce11b258c09a30bc81 Mon Sep 17 00:00:00 2001 From: tangxuan <2233783319@qq.com> Date: Mon, 3 Apr 2023 15:45:10 +0800 Subject: [PATCH] =?UTF-8?q?float=E4=BD=99=E9=87=8F=E6=97=A0=E5=80=BC?= =?UTF-8?q?=E5=BC=82=E5=B8=B8=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- db_logic/medicament.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/db_logic/medicament.py b/db_logic/medicament.py index 64f836c..954d87e 100644 --- a/db_logic/medicament.py +++ b/db_logic/medicament.py @@ -378,7 +378,7 @@ class BllMedicament(Repository): self.session.merge(entityDrug) drug = BllMedicament().findEntity(entityDrug.medicament_id) - lastRemain = float(drug.remain) + lastRemain = float(drug.remain) if drug.remain else 0 if entityClient.client_id not in client_list: entityDrugRecord = EntityMedicamentRecord( @@ -390,7 +390,7 @@ class BllMedicament(Repository): price=float(entityDrug.price) if entityDrug.price else 0, use_quantity=float(lastRemain) - float(entityDrug.remain if entityDrug.remain else 0), record_type=DrugRecordType.Return, - record_remain=float(entityDrug.remain), + record_remain=float(entityDrug.remain) if entityDrug.remain else 0, is_empty=1 if(entityDrug.status == DrugStatus.Empty) else 0, create_date=Utils.get_str_datetime(), create_user_id=entityUser.user_id, @@ -414,7 +414,7 @@ class BllMedicament(Repository): self.session.merge(entityVariety) self.commitTrans() - remain_result = self.calculate_use_drug(drug, weight_remain=float(entityDrug.remain)) + remain_result = self.calculate_use_drug(drug, weight_remain=float(entityDrug.remain if entityDrug.remain else 0)) return remain_result # 药剂登记