temporary branch

This commit is contained in:
BACHIR SOULDI
2024-10-17 11:30:20 +01:00
parent cd115a234b
commit 742ec3e75e
212 changed files with 18396 additions and 1899 deletions

View File

@@ -27,4 +27,5 @@ public interface IReport {
public static final String CLIENT_SITUATION = "ClientSituation.rptdesign";
public static final String MESSAGE_PDF = "MessagePDF.rptdesign";
public static final String ABC_ANALYSIS = "AbcAnalysis.rptdesign";
public static final String MEETING = "PVMeeting.rptdesign";
}

View File

@@ -28,6 +28,7 @@ import java.util.List;
public interface AppBaseService extends AppService {
public static final int DEFAULT_NB_DECIMAL_DIGITS = 2;
public static final int DEFAULT_NB_DECIMAL_DIGITS_SUPPLIER_LINE = 2;
public AppBase getAppBase();

View File

@@ -166,4 +166,12 @@ public class AppBaseController {
e.printStackTrace();
}
}
@CallMethod
public void execWhatsApp2(String username,String message,String url,String id,String enc) throws IOException, ClassNotFoundException {
String args[] = { "python", "/Users\\Bachir.souldi.SOPHAL\\Desktop\\dev\\whatsapp_erp\\index.py" , message, url , id };
Process p = Runtime.getRuntime().exec(args);
// BufferedReader stdInput = new BufferedReader(new InputStreamReader(p.getInputStream()));
}
}

View File

@@ -18,6 +18,7 @@
package com.axelor.apps.base.web;
import com.axelor.apps.ReportFactory;
import com.axelor.apps.base.db.FamilleProduit;
import com.axelor.apps.base.db.Product;
import com.axelor.apps.base.db.repo.ProductRepository;
import com.axelor.apps.base.exceptions.IExceptionMessage;
@@ -41,6 +42,8 @@ import java.lang.invoke.MethodHandles;
import java.util.List;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.axelor.rpc.Context;
import java.util.Map;
@Singleton
public class ProductController {
@@ -132,4 +135,46 @@ public class ProductController {
TraceBackService.trace(response, e);
}
}
public void printProductQrCodes(ActionRequest request, ActionResponse response)
throws AxelorException {
try {
Context context = request.getContext();
Long id = 1L;
Integer typeSelect = Integer.parseInt(context.get("printingTypeSelect").toString());
switch (typeSelect) {
case 1:
id = new Long((Integer) ((Map) context.get("product")).get("id"));
break;
case 2:
id = new Long((Integer) ((Map) request.getContext().get("stockLocation")).get("id"));
break;
case 3:
id = ((FamilleProduit) request.getContext().get("familleProduit")).getId();
break;
default:
id = 0L;
break;
}
String name = I18n.get("QrCode printing");
String fileLink =
ReportFactory.createReport("QrCodePrinting.rptdesign", name + "-${date}")
.addParam("Locale", ReportSettings.getPrintingLocale(null))
.addParam("typeSelect", typeSelect)
.addParam("productId", id)
.addParam("stockLocation", id)
.addParam("familleProduit",id)
.generate()
.getFileLink();
logger.debug("Printing " + name);
response.setView(ActionView.define(name).add("html", fileLink).map());
} catch (Exception e) {
TraceBackService.trace(response, e);
}
}
}

View File

@@ -10,9 +10,12 @@
<many-to-one name="purchaseTax" ref="com.axelor.apps.account.db.Tax" title="Purchase Tax"/>
<many-to-one name="saleTax" ref="com.axelor.apps.account.db.Tax" title="Sale Tax"/>
<many-to-one name="tax" ref="com.axelor.apps.account.db.Tax" title="Tax"/>
<many-to-one name="partner" ref="com.axelor.apps.base.db.Partner" title="Partner" />
<many-to-one name="product" ref="com.axelor.apps.base.db.Product" title="Product"/>
<many-to-one name="productFamily" ref="com.axelor.apps.base.db.ProductFamily" title="Accounting family"/>
<finder-method name="findByProduct" using="product"/>
</entity>

View File

@@ -82,6 +82,9 @@
<boolean name="enableCheckTcoAccpeted" title="Enable check TCO Accepte" />
<!-- roq url -->
<string name="roqURL" title="Roq URL" />
<extra-code>
<![CDATA[
public static final int DISCOUNT_SEPARATE = 1;

View File

@@ -7,9 +7,12 @@
<entity name="CompanyDepartment" lang="java">
<string name="name" title="Name"/>
<string name="code" title="Code"/>
<many-to-one name="company" ref="com.axelor.apps.base.db.Company"/>
<string name="name" title="Name"/>
<string name="code" title="Code"/>
<many-to-one name="company" ref="com.axelor.apps.base.db.Company"/>
<integer name="departmentLevel" title="Level" />
<many-to-one name="parentDepartment" ref="com.axelor.apps.base.db.CompanyDepartment"/>
</entity>

View File

@@ -10,6 +10,7 @@
<string name="url" title="URL"/>
<string name="subject" required="true" namecolumn="true" title="Subject"/>
<string name="description" title="Description" large="true"/>
<string name="decisions" title="Decisions" large="true"/>
<string name="status" title="Status"/>
<datetime name="startDateTime" required="true" title="Start date"/>
<datetime name="endDateTime" required="true" title="End date"/>
@@ -25,7 +26,10 @@
<string name="subjectTeam"/>
<integer name="typeSelect" title="Type" selection="icalendar.event.type.select" required="true" />
<many-to-one name="user" column="user_id" ref="com.axelor.auth.db.User" title="Assigned to"/>
<one-to-many name="companyDepartmentList" title="Company departments" ref="com.axelor.apps.base.db.CompanyDepartment" />
<finder-method name="findByUid" using="uid" />
<extra-code>
<![CDATA[

View File

@@ -146,6 +146,10 @@
<decimal name="pvg" title="PVG" />
<decimal name="stklim" title="Stklim" />
<decimal name="ug" title="UG" />
<boolean name="isDangerousProduct" title="Is dangerous" />
<finder-method name="findByCode" using="code" cacheable="true" />
<extra-code>
<![CDATA[

View File

@@ -45,6 +45,8 @@
<integer name="stepStatusSelect" selection="base.user.form.step.select" default="0"/>
<many-to-one name="companyDepartment" ref="com.axelor.apps.base.db.CompanyDepartment" />
<finder-method name="findByCode" using="code" filter="LOWER(self.code) = LOWER(:code)"/>
<track>