temporary branch
This commit is contained in:
@@ -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";
|
||||
}
|
||||
|
||||
@@ -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();
|
||||
|
||||
|
||||
@@ -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()));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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>
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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>
|
||||
|
||||
|
||||
@@ -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[
|
||||
|
||||
@@ -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[
|
||||
|
||||
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user