diff --git a/build.gradle b/build.gradle
index c71a0fd..54a287f 100644
--- a/build.gradle
+++ b/build.gradle
@@ -44,8 +44,8 @@ subprojects {
}
axelor {
- title "Axelor ERP"
- description "Axelor Entreprise Application"
+ title "Sophal"
+ description "Sophal Entreprise"
}
dependencies {
diff --git a/modules/axelor-open-suite/axelor-base/src/main/java/com/axelor/apps/base/module/BaseModule.java b/modules/axelor-open-suite/axelor-base/src/main/java/com/axelor/apps/base/module/BaseModule.java
index 56ed36a..4fee19b 100644
--- a/modules/axelor-open-suite/axelor-base/src/main/java/com/axelor/apps/base/module/BaseModule.java
+++ b/modules/axelor-open-suite/axelor-base/src/main/java/com/axelor/apps/base/module/BaseModule.java
@@ -81,8 +81,6 @@ import com.axelor.apps.base.service.ProductMultipleQtyService;
import com.axelor.apps.base.service.ProductMultipleQtyServiceImpl;
import com.axelor.apps.base.service.ProductService;
import com.axelor.apps.base.service.ProductServiceImpl;
-import com.axelor.apps.base.service.SophalService;
-import com.axelor.apps.base.service.SophalServiceImpl;
import com.axelor.apps.base.service.TeamTaskService;
import com.axelor.apps.base.service.TeamTaskServiceImpl;
import com.axelor.apps.base.service.TradingNameService;
@@ -129,11 +127,14 @@ import com.axelor.base.service.ical.ICalendarEventService;
import com.axelor.base.service.ical.ICalendarEventServiceImpl;
import com.axelor.team.db.repo.TeamTaskRepository;
+import com.axelor.apps.base.service.SophalService;
+import com.axelor.apps.base.service.SophalServiceImpl;
+
public class BaseModule extends AxelorModule {
@Override
protected void configure() {
- bind(SophalService.class).to(SophalServiceImpl.class);
+ bind(SophalService.class).to(SophalServiceImpl.class);
bind(AddressService.class).to(AddressServiceImpl.class);
bind(AdvancedExportService.class).to(AdvancedExportServiceImpl.class);
bind(UserService.class).to(UserServiceImpl.class);
diff --git a/modules/axelor-open-suite/axelor-base/src/main/java/com/axelor/apps/base/service/SophalService.java b/modules/axelor-open-suite/axelor-base/src/main/java/com/axelor/apps/base/service/SophalService.java
index c84129c..dbdfa50 100644
--- a/modules/axelor-open-suite/axelor-base/src/main/java/com/axelor/apps/base/service/SophalService.java
+++ b/modules/axelor-open-suite/axelor-base/src/main/java/com/axelor/apps/base/service/SophalService.java
@@ -18,8 +18,16 @@
package com.axelor.apps.base.service;
import com.axelor.apps.base.db.Product;
+import com.axelor.apps.base.db.ProductVariant;
+import com.axelor.apps.base.db.ProductVariantConfig;
+import com.axelor.apps.base.db.ProductVariantValue;
+import com.axelor.exception.AxelorException;
+import com.google.inject.persist.Transactional;
+
public interface SophalService {
+
+ String GenerateCode(Product product) ;
- String GenerateCode(Product product);
-}
+
+}
\ No newline at end of file
diff --git a/modules/axelor-open-suite/axelor-base/src/main/java/com/axelor/apps/base/service/SophalServiceImpl.java b/modules/axelor-open-suite/axelor-base/src/main/java/com/axelor/apps/base/service/SophalServiceImpl.java
index 7f84cae..72d6b71 100644
--- a/modules/axelor-open-suite/axelor-base/src/main/java/com/axelor/apps/base/service/SophalServiceImpl.java
+++ b/modules/axelor-open-suite/axelor-base/src/main/java/com/axelor/apps/base/service/SophalServiceImpl.java
@@ -17,71 +17,109 @@
*/
package com.axelor.apps.base.service;
+
+
+
import com.axelor.apps.base.db.Product;
+import com.axelor.apps.base.db.repo.PartnerAddressRepository;
+import com.axelor.apps.base.db.repo.PartnerRepository;
+import com.axelor.apps.base.db.repo.SequenceRepository;
+import com.axelor.apps.base.exceptions.IExceptionMessage;
+import com.axelor.apps.base.service.administration.SequenceService;
+import com.axelor.apps.base.service.app.AppBaseService;
+import com.axelor.apps.message.db.EmailAddress;
+import com.axelor.common.StringUtils;
import com.axelor.db.JPA;
-import com.google.inject.servlet.RequestScoped;
-import javax.persistence.Query;
+import com.axelor.exception.AxelorException;
+import com.axelor.exception.db.repo.TraceBackRepository;
+import com.axelor.i18n.I18n;
+import com.axelor.inject.Beans;
+import com.google.common.base.Preconditions;
+import com.google.common.base.Strings;
+import com.google.inject.Inject;
+import com.google.inject.persist.Transactional;
+import java.lang.invoke.MethodHandles;
+import java.time.LocalDate;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.regex.Pattern;
+import javax.inject.Singleton;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+import com.google.inject.servlet.RequestScoped;
+import javax.persistence.Query;
+
@RequestScoped
public class SophalServiceImpl implements SophalService {
- protected Logger log = LoggerFactory.getLogger(getClass());
+ protected Logger log = LoggerFactory.getLogger(getClass());
@Override
public String GenerateCode(Product product) {
-
- String num;
- String result;
- String var;
-
- if (product.getUnitCodeSelect() != null) {
- var =
- product.getFamilleProduit().getCode()
- + product.getSousFamilleProduit().getCode()
- + product.getUnitCodeSelect();
- } else {
- var =
- product.getFamilleProduit().getCode() + product.getSousFamilleProduit().getCode() + "00";
- }
-
- if (product.getCode() == null) {
- Query q =
- JPA.em()
- .createQuery(
- "select self.code FROM Product as self WHERE self.codeCreated = ?1 AND self.code LIKE ?2 ORDER BY self.code DESC",
- String.class);
- q.setParameter(1, true);
- q.setParameter(2, var + "%");
-
- if (q.getResultList().size() == 0) {
- result = null;
- } else {
- result = (String) q.getResultList().get(0);
- }
-
- if (result != null) {
-
- String arr[] = result.split(var);
- String nbrString = arr[1];
- int nbrInt = Integer.parseInt(nbrString);
-
- nbrInt = nbrInt + 1;
- num = Integer.toString(nbrInt);
-
- String padding = "000".substring(num.length()) + num;
- result = var + padding;
-
- } else {
-
- result = var + "001";
- }
-
- } else {
- result = product.getCode();
- }
-
- return result;
+
+ String num;
+ String result;
+ String var;
+
+
+
+ if( product.getUnitCodeSelect() != null){
+ var=product.getFamilleProduit().getCode()+product.getSousFamilleProduit().getCode()+product.getUnitCodeSelect();
+ }else{
+ var=product.getFamilleProduit().getCode()+product.getSousFamilleProduit().getCode()+"00";
+ }
+
+
+
+ if( product.getCode() == null){
+ Query q =
+ JPA.em()
+ .createQuery("select self.code FROM Product as self WHERE self.codeCreated = ?1 AND self.code LIKE ?2 ORDER BY self.code DESC",
+ String.class);
+ q.setParameter(1,true);
+ q.setParameter(2, var+"%");
+
+
+
+ if(q.getResultList().size() == 0){
+ result = null;
+ }else{
+ result = (String) q.getResultList().get(0);
+ }
+
+
+
+ if (result != null){
+
+ String arr[]=result.split(var);
+ String nbrString=arr[1];
+ int nbrInt=Integer.parseInt(nbrString);
+
+ nbrInt=nbrInt+1;
+ num=Integer.toString(nbrInt);
+
+
+ String padding = "000".substring(num.length())+ num;
+ result=var+padding;
+
+ }else{
+
+ result=var+"001";
+
+ }
+
+
+ }else{
+ result=product.getCode();
+ }
+
+ return result;
}
-}
+
+
+}
\ No newline at end of file
diff --git a/modules/axelor-open-suite/axelor-base/src/main/java/com/axelor/apps/base/web/SophalController.java b/modules/axelor-open-suite/axelor-base/src/main/java/com/axelor/apps/base/web/SophalController.java
index ee9bd35..cf81726 100644
--- a/modules/axelor-open-suite/axelor-base/src/main/java/com/axelor/apps/base/web/SophalController.java
+++ b/modules/axelor-open-suite/axelor-base/src/main/java/com/axelor/apps/base/web/SophalController.java
@@ -17,23 +17,52 @@
*/
package com.axelor.apps.base.web;
+
import com.axelor.apps.base.db.Product;
-import com.axelor.apps.base.service.SophalService;
+import com.axelor.apps.base.db.repo.ProductRepository;
+import com.axelor.apps.base.exceptions.IExceptionMessage;
+import com.axelor.apps.base.report.IReport;
+import com.axelor.apps.base.service.ProductService;
+import com.axelor.apps.base.service.app.AppBaseService;
+import com.axelor.apps.base.service.user.UserService;
+import com.axelor.apps.report.engine.ReportSettings;
+import com.axelor.auth.db.User;
+import com.axelor.exception.AxelorException;
+import com.axelor.exception.db.repo.TraceBackRepository;
+import com.axelor.exception.service.TraceBackService;
+import com.axelor.i18n.I18n;
+import com.axelor.inject.Beans;
+import com.axelor.meta.schema.actions.ActionView;
import com.axelor.rpc.ActionRequest;
import com.axelor.rpc.ActionResponse;
+import com.google.common.base.Joiner;
+import com.google.inject.Singleton;
+import java.lang.invoke.MethodHandles;
+import java.util.List;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import com.google.inject.servlet.RequestScoped;
+import com.axelor.apps.base.db.Product;
+import com.axelor.apps.base.service.SophalService;
import javax.inject.Inject;
-@RequestScoped
+
+
+import com.axelor.rpc.Response;
+
+@RequestScoped
public class SophalController {
- @Inject private SophalService service;
+
- public void GenerateCode(ActionRequest request, ActionResponse response) {
+ @Inject private SophalService service;
- Product product = request.getContext().asType(Product.class);
- String Code = service.GenerateCode(product);
+ public void GenerateCode(ActionRequest request, ActionResponse response) {
- response.setValue("code", Code);
+ Product product = request.getContext().asType(Product.class);
+ String Code = service.GenerateCode(product);
+
+ response.setValue("code",Code);
}
-}
+
+}
\ No newline at end of file
diff --git a/modules/axelor-open-suite/axelor-base/src/main/resources/domains/Partner.xml b/modules/axelor-open-suite/axelor-base/src/main/resources/domains/Partner.xml
index 774cad9..2d61d66 100644
--- a/modules/axelor-open-suite/axelor-base/src/main/resources/domains/Partner.xml
+++ b/modules/axelor-open-suite/axelor-base/src/main/resources/domains/Partner.xml
@@ -22,6 +22,9 @@
+
+
+
diff --git a/modules/axelor-open-suite/axelor-sale/src/main/resources/domains/SaleOrder.xml b/modules/axelor-open-suite/axelor-sale/src/main/resources/domains/SaleOrder.xml
index 311dfed..455ff39 100644
--- a/modules/axelor-open-suite/axelor-sale/src/main/resources/domains/SaleOrder.xml
+++ b/modules/axelor-open-suite/axelor-sale/src/main/resources/domains/SaleOrder.xml
@@ -143,11 +143,9 @@
-
- Expression updated.
Quotation/sale order created
Draft quotation
Finalized quotation