|
@@ -6112,9 +6112,9 @@ func UpdateDrugWarehouseOutInfo(id int64, warehouse_info_id int64, org_id int64,
|
6112
|
6112
|
return err
|
6113
|
6113
|
}
|
6114
|
6114
|
|
6115
|
|
-func UpdateNewDrugWarehouseOutInfo(id int64, warehouse_info_id int64, org_id int64, over_count int64, drug_price float64, tx *gorm.DB) error {
|
|
6115
|
+func UpdateNewDrugWarehouseOutInfo(id int64, warehouse_info_id int64, org_id int64, over_count int64, drug_price float64, batch_number string, tx *gorm.DB) error {
|
6116
|
6116
|
|
6117
|
|
- err = tx.Model(&models.DrugWarehouseOutInfo{}).Where("id = ? and org_id = ? and status = 1", id, org_id).Update(map[string]interface{}{"warehouse_info_id": warehouse_info_id, "over_count": over_count, "price": drug_price, "retail_price": drug_price}).Error
|
|
6117
|
+ err = tx.Model(&models.DrugWarehouseOutInfo{}).Where("id = ? and org_id = ? and status = 1", id, org_id).Update(map[string]interface{}{"warehouse_info_id": warehouse_info_id, "over_count": over_count, "price": drug_price, "retail_price": drug_price, "batch_number": batch_number}).Error
|
6118
|
6118
|
if err != nil {
|
6119
|
6119
|
tx.Rollback()
|
6120
|
6120
|
return err
|
|
@@ -6145,9 +6145,9 @@ func GetDrugOutFlowByWarehouseOut(drug_id int64, warehouse_out_detail_id int64,
|
6145
|
6145
|
return flow, err
|
6146
|
6146
|
}
|
6147
|
6147
|
|
6148
|
|
-func UpdateNewGoodWarehouseOutById(id int64, warehouse_info_id int64, org_id int64, over_count int64, tx *gorm.DB) error {
|
|
6148
|
+func UpdateNewGoodWarehouseOutById(id int64, warehouse_info_id int64, org_id int64, over_count int64, number string, tx *gorm.DB) error {
|
6149
|
6149
|
|
6150
|
|
- err := tx.Model(models.WarehouseOutInfo{}).Where("id = ? and org_id = ? and status = 1", id, org_id).Update(map[string]interface{}{"warehouse_info_id": warehouse_info_id, "over_count": over_count}).Error
|
|
6150
|
+ err := tx.Model(models.WarehouseOutInfo{}).Where("id = ? and org_id = ? and status = 1", id, org_id).Update(map[string]interface{}{"warehouse_info_id": warehouse_info_id, "over_count": over_count, "number": number}).Error
|
6151
|
6151
|
if err != nil {
|
6152
|
6152
|
tx.Rollback()
|
6153
|
6153
|
return err
|
|
@@ -8340,7 +8340,7 @@ func ConsumableNewPrescriptionDelivery(orgID int64, patient_id int64, record_tim
|
8340
|
8340
|
}
|
8341
|
8341
|
|
8342
|
8342
|
//添加入库ID
|
8343
|
|
- errWarehouse := UpdateNewGoodWarehouseOutById(goods.ID, warehouse.ID, orgID, sum_count, tx)
|
|
8343
|
+ errWarehouse := UpdateNewGoodWarehouseOutById(goods.ID, warehouse.ID, orgID, sum_count, warehouse.Number, tx)
|
8344
|
8344
|
if errWarehouse != nil {
|
8345
|
8345
|
goodErrcode := models.XtGoodErrcode{
|
8346
|
8346
|
UserOrgId: orgID,
|
|
@@ -8668,7 +8668,7 @@ func ConsumableNewPrescriptionDelivery(orgID int64, patient_id int64, record_tim
|
8668
|
8668
|
ModifyNewAddGoodSumCount(goods.StorehouseId, flow.Count, orgID, goods.GoodId, tx)
|
8669
|
8669
|
}
|
8670
|
8670
|
|
8671
|
|
- errWarehouse := UpdateNewGoodWarehouseOutById(goods.ID, warehouse.ID, orgID, sum_count, tx)
|
|
8671
|
+ errWarehouse := UpdateNewGoodWarehouseOutById(goods.ID, warehouse.ID, orgID, sum_count, warehouse.Number, tx)
|
8672
|
8672
|
if errWarehouse != nil {
|
8673
|
8673
|
goodErrcode := models.XtGoodErrcode{
|
8674
|
8674
|
UserOrgId: orgID,
|
|
@@ -8934,7 +8934,7 @@ func ConsumableNewHisPrescriptionDelivery(orgID int64, patient_id int64, record_
|
8934
|
8934
|
|
8935
|
8935
|
ModifyNewGoodSumCount(goods.StorehouseId, stock_number, orgID, goods.GoodId, tx)
|
8936
|
8936
|
|
8937
|
|
- UpdateNewGoodWarehouseOutById(goods.ID, warehouse.ID, orgID, sum_count, tx)
|
|
8937
|
+ UpdateNewGoodWarehouseOutById(goods.ID, warehouse.ID, orgID, sum_count, warehouse.Number, tx)
|
8938
|
8938
|
|
8939
|
8939
|
}
|
8940
|
8940
|
dialyPrepareOne := &models.DialysisBeforePrepare{
|
|
@@ -10925,7 +10925,7 @@ func ConsumablesNewDeliveryThirty(orgID int64, record_time int64, goods *models.
|
10925
|
10925
|
CreateOutInfoLog(outInfoLog, tx)
|
10926
|
10926
|
|
10927
|
10927
|
//添加入库ID
|
10928
|
|
- UpdateNewGoodWarehouseOutById(goods.ID, warehouse.ID, goods.OrgId, sum_count, tx)
|
|
10928
|
+ UpdateNewGoodWarehouseOutById(goods.ID, warehouse.ID, goods.OrgId, sum_count, warehouse.Number, tx)
|
10929
|
10929
|
|
10930
|
10930
|
//更新出库数量
|
10931
|
10931
|
ModifyNewGoodSumCount(goods.StorehouseId, goods.Count, goods.OrgId, goods.GoodId, tx)
|
|
@@ -11002,7 +11002,7 @@ func ConsumablesNewDeliveryThirty(orgID int64, record_time int64, goods *models.
|
11002
|
11002
|
|
11003
|
11003
|
CreateOutInfoLog(outInfoLog, tx)
|
11004
|
11004
|
|
11005
|
|
- UpdateNewGoodWarehouseOutById(goods.ID, warehouse.ID, goods.OrgId, sum_count, tx)
|
|
11005
|
+ UpdateNewGoodWarehouseOutById(goods.ID, warehouse.ID, goods.OrgId, sum_count, warehouse.Number, tx)
|
11006
|
11006
|
|
11007
|
11007
|
//更新出库数量
|
11008
|
11008
|
ModifyNewGoodSumCount(goods.StorehouseId, stock_number, goods.OrgId, goods.GoodId, tx)
|
|
@@ -11268,7 +11268,7 @@ func AutoNewDrugDeliverInfoFourtyOne(orgID int64, prescribingNumber int64, wareh
|
11268
|
11268
|
CreateDrugOutInfoLog(outInfoLog, tx)
|
11269
|
11269
|
|
11270
|
11270
|
//更新出库id
|
11271
|
|
- UpdateNewDrugWarehouseOutInfo(advice.ID, warehouse.ID, advice.OrgId, over_count, drug_price, tx)
|
|
11271
|
+ UpdateNewDrugWarehouseOutInfo(advice.ID, warehouse.ID, advice.OrgId, over_count, drug_price, warehouse.BatchNumber, tx)
|
11272
|
11272
|
|
11273
|
11273
|
return nil
|
11274
|
11274
|
|
|
@@ -11348,7 +11348,7 @@ func AutoNewDrugDeliverInfoFourtyOne(orgID int64, prescribingNumber int64, wareh
|
11348
|
11348
|
}
|
11349
|
11349
|
CreateDrugOutInfoLog(outInfoLog, tx)
|
11350
|
11350
|
//更新出库id
|
11351
|
|
- UpdateNewDrugWarehouseOutInfo(advice.ID, warehouse.ID, advice.OrgId, over_count, drug_price, tx)
|
|
11351
|
+ UpdateNewDrugWarehouseOutInfo(advice.ID, warehouse.ID, advice.OrgId, over_count, drug_price, warehouse.Number, tx)
|
11352
|
11352
|
// 出库完成后,要将该批次库存清零
|
11353
|
11353
|
|
11354
|
11354
|
prescribingNumber_two_temp := deliver_number - stock_number
|