|
@@ -5297,7 +5297,9 @@ func (this *StockManagerApiController) SaveCheckDamage() {
|
5297
|
5297
|
|
5298
|
5298
|
if errcodes == gorm.ErrRecordNotFound {
|
5299
|
5299
|
service.AddSigleWarehouseOut(&warehouseOut)
|
|
5300
|
+
|
5300
|
5301
|
}
|
|
5302
|
+ out, _ := service.GetLastGoodWarehouseOut(adminUserInfo.CurrentOrgId)
|
5301
|
5303
|
manufacturerList, _ := service.GetAllManufacturerList(adminUserInfo.CurrentOrgId)
|
5302
|
5304
|
dealerList, _ := service.GetAllDealerList(adminUserInfo.CurrentOrgId)
|
5303
|
5305
|
var manufacturer_id int64
|
|
@@ -5314,10 +5316,11 @@ func (this *StockManagerApiController) SaveCheckDamage() {
|
5314
|
5316
|
dealer_id = its.ID
|
5315
|
5317
|
}
|
5316
|
5318
|
}
|
|
5319
|
+ goodinfo, _ := service.GetGoodInformationByGoodId(item.GoodId)
|
5317
|
5320
|
//插入出库单
|
5318
|
5321
|
warehouseOutInfo := &models.WarehouseOutInfo{
|
5319
|
|
- WarehouseOutOrderNumber: warehouseOut.WarehouseOutOrderNumber,
|
5320
|
|
- WarehouseOutId: warehouseOut.ID,
|
|
5322
|
+ WarehouseOutOrderNumber: out.WarehouseOutOrderNumber,
|
|
5323
|
+ WarehouseOutId: out.ID,
|
5321
|
5324
|
GoodId: item.GoodId,
|
5322
|
5325
|
Count: item.Count,
|
5323
|
5326
|
Price: item.PackingPrice,
|
|
@@ -5332,6 +5335,7 @@ func (this *StockManagerApiController) SaveCheckDamage() {
|
5332
|
5335
|
ProductDate: item.ProductDate,
|
5333
|
5336
|
Dealer: dealer_id,
|
5334
|
5337
|
LicenseNumber: item.LicenseNumber,
|
|
5338
|
+ GoodTypeId: goodinfo.GoodTypeId,
|
5335
|
5339
|
}
|
5336
|
5340
|
errOne := service.AddSigleWarehouseOutInfo(warehouseOutInfo)
|
5337
|
5341
|
fmt.Println("99999999999999", errOne)
|
|
@@ -5356,7 +5360,7 @@ func (this *StockManagerApiController) SaveCheckDamage() {
|
5356
|
5360
|
ConsumableType: 5,
|
5357
|
5361
|
IsSys: 0,
|
5358
|
5362
|
WarehousingOrder: "",
|
5359
|
|
- WarehouseOutId: warehouseOutInfo.ID,
|
|
5363
|
+ WarehouseOutId: out.ID,
|
5360
|
5364
|
WarehouseOutOrderNumber: warehouseOutInfo.WarehouseOutOrderNumber,
|
5361
|
5365
|
IsEdit: 0,
|
5362
|
5366
|
CancelStockId: 0,
|
|
@@ -5681,6 +5685,7 @@ func (this *StockManagerApiController) SaveCheckInventory() {
|
5681
|
5685
|
|
5682
|
5686
|
//查询该耗材最后1条批次
|
5683
|
5687
|
info, _ := service.GetLastWarehouseInfo(item.GoodId)
|
|
5688
|
+ good, _ := service.GetGoodInformationByGoodId(item.GoodId)
|
5684
|
5689
|
fmt.Println("总共", item.Count)
|
5685
|
5690
|
fmt.Println("数据", list.StockCount)
|
5686
|
5691
|
//盘点盘点库存和et实际库存的大小
|
|
@@ -5729,6 +5734,7 @@ func (this *StockManagerApiController) SaveCheckInventory() {
|
5729
|
5734
|
Dealer: dealer_id,
|
5730
|
5735
|
LicenseNumber: info.LicenseNumber,
|
5731
|
5736
|
WarehouseInfoId: item.WarehousingInfoId,
|
|
5737
|
+ GoodTypeId: good.GoodTypeId,
|
5732
|
5738
|
}
|
5733
|
5739
|
|
5734
|
5740
|
flow := models.VmStockFlow{
|
|
@@ -5785,9 +5791,10 @@ func (this *StockManagerApiController) SaveCheckInventory() {
|
5785
|
5791
|
}
|
5786
|
5792
|
err = service.CreateWarehouseOut(warehouseOut)
|
5787
|
5793
|
fmt.Println(err)
|
|
5794
|
+ out, _ := service.GetLastGoodWarehouseOut(adminUserInfo.CurrentOrgId)
|
5788
|
5795
|
warehouseOutInfo := &models.WarehouseOutInfo{
|
5789
|
|
- WarehouseOutOrderNumber: warehouseOut.WarehouseOutOrderNumber,
|
5790
|
|
- WarehouseOutId: warehouseOut.ID,
|
|
5796
|
+ WarehouseOutOrderNumber: out.WarehouseOutOrderNumber,
|
|
5797
|
+ WarehouseOutId: out.ID,
|
5791
|
5798
|
GoodId: warehouseInfo.GoodId,
|
5792
|
5799
|
Count: list.StockCount - item.Count,
|
5793
|
5800
|
Price: warehouseInfo.Price,
|
|
@@ -5802,6 +5809,7 @@ func (this *StockManagerApiController) SaveCheckInventory() {
|
5802
|
5809
|
ProductDate: warehouseInfo.ProductDate,
|
5803
|
5810
|
Dealer: dealer_id,
|
5804
|
5811
|
LicenseNumber: warehouseInfo.LicenseNumber,
|
|
5812
|
+ GoodTypeId: good.GoodTypeId,
|
5805
|
5813
|
}
|
5806
|
5814
|
|
5807
|
5815
|
stockFlow := models.VmStockFlow{
|
|
@@ -5816,7 +5824,7 @@ func (this *StockManagerApiController) SaveCheckInventory() {
|
5816
|
5824
|
ConsumableType: 2,
|
5817
|
5825
|
IsSys: 2,
|
5818
|
5826
|
WarehousingOrder: "",
|
5819
|
|
- WarehouseOutId: warehouseOut.ID,
|
|
5827
|
+ WarehouseOutId: out.ID,
|
5820
|
5828
|
WarehouseOutOrderNumber: warehouseOut.WarehouseOutOrderNumber,
|
5821
|
5829
|
IsEdit: 1,
|
5822
|
5830
|
CancelStockId: 0,
|
|
@@ -5830,7 +5838,7 @@ func (this *StockManagerApiController) SaveCheckInventory() {
|
5830
|
5838
|
Mtime: 0,
|
5831
|
5839
|
Price: warehouseInfo.Price,
|
5832
|
5840
|
WarehousingDetailId: 0,
|
5833
|
|
- WarehouseOutDetailId: warehouseOutInfo.ID,
|
|
5841
|
+ WarehouseOutDetailId: out.ID,
|
5834
|
5842
|
CancelOutDetailId: 0,
|
5835
|
5843
|
ProductDate: warehouseInfo.ProductDate,
|
5836
|
5844
|
ExpireDate: warehouseInfo.ExpiryDate,
|