add cost price && tracking status' importation folder
This commit is contained in:
@@ -1,12 +1,23 @@
|
||||
package com.axelor.apps.purchase.web;
|
||||
|
||||
import com.axelor.apps.base.db.Currency;
|
||||
import com.axelor.apps.base.db.repo.CurrencyRepository;
|
||||
import com.axelor.apps.base.service.CurrencyConversionService;
|
||||
import com.axelor.apps.purchase.db.ImportationFolder;
|
||||
import com.axelor.apps.purchase.db.PurchaseOrder;
|
||||
import com.axelor.apps.purchase.db.repo.ImportationFolderRepository;
|
||||
import com.axelor.apps.purchase.service.ImportationFolderService;
|
||||
import com.axelor.apps.purchase.service.ImportationFolderServiceImpl;
|
||||
import com.axelor.exception.AxelorException;
|
||||
import com.axelor.inject.Beans;
|
||||
import com.axelor.rpc.ActionRequest;
|
||||
import com.axelor.rpc.ActionResponse;
|
||||
import com.google.inject.Singleton;
|
||||
import wslite.json.JSONException;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.net.MalformedURLException;
|
||||
import java.util.List;
|
||||
|
||||
@Singleton
|
||||
public class ImportationFolderController {
|
||||
@@ -29,4 +40,18 @@ public class ImportationFolderController {
|
||||
ImportationFolder importationFolder = request.getContext().asType(ImportationFolder.class);
|
||||
Beans.get(ImportationFolderService.class).cancelImportationFolder(importationFolder);
|
||||
}
|
||||
|
||||
public void calculateSum(ActionRequest request, ActionResponse response)
|
||||
throws MalformedURLException, JSONException, AxelorException {
|
||||
|
||||
ImportationFolder iimportationFolder = (ImportationFolder) request.getContext().asType(ImportationFolder.class);
|
||||
ImportationFolder importationFolder = Beans.get(ImportationFolderRepository.class)
|
||||
.find(iimportationFolder.getId());
|
||||
List<PurchaseOrder> purchaseOrders = importationFolder.getPurchaseOrderList();
|
||||
|
||||
|
||||
Beans.get(ImportationFolderServiceImpl.class).calculateSum(purchaseOrders,
|
||||
importationFolder);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -61,7 +61,10 @@
|
||||
|
||||
|
||||
<!-- end sophal -->
|
||||
|
||||
<track>
|
||||
<field name="name"/>
|
||||
<field name="statusSelect"/>
|
||||
</track>
|
||||
|
||||
</entity>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user