zoho integration

This commit is contained in:
Ralph Soika 2025-05-09 10:52:28 +02:00
parent c1f123215a
commit 919ad796de
7 changed files with 57 additions and 37 deletions

View file

@ -19,27 +19,6 @@ zoho.scope ZohoBooks.contacts.ALL ZohoBooks.invoices.CREATE ZohoBooks.i
```
## Forum
form@imixs.com
imixs4zoho
https://api-console.zoho.eu/
ZohoBooks.contacts.ALL,ZohoBooks.invoices.ALL,ZohoBooks.bills.ALL
```
zoho.accesstoken 1.....3
zoho.apidomain https://www.zohoapis.eu
zoho.clientid 1000.5SMVXH92JIA5BTIGJF27OY41TAFFAS
zoho.clientsecret 64aabb5e819757e471c9d0dff6a072b1bcf2c7687d
zoho.code 10-
zoho.organization 886888983
zoho.refreshtoken 10...ff440e
zoho.scope ZohoBooks.contacts.ALL ZohoBooks.invoices.CREATE ZohoBooks.invoices.READ ZohoBooks.invoices.UPDATE
```
## Atari
atari.600xl@gmail.com
@ -59,6 +38,8 @@ zoho.scope ZohoBooks.contacts.ALL,ZohoBooks.invoices.ALL,ZohoBooks.bill
info@imixs.com
imixs4zoho
http://books.zoho.com/
https://api-console.zoho.com/
ZohoBooks.contacts.ALL,ZohoBooks.invoices.ALL,ZohoBooks.bills.ALL

View file

@ -482,7 +482,8 @@ public class ZohoAPIService {
ZohoBillItem lineItem = new ZohoBillItem();
lineItem.setName(itemCol.getItemValueString("name"));
lineItem.setAccountId(accountID);
lineItem.setAmount(itemCol.getItemValueDouble("amount"));
lineItem.setQuantity(1);
lineItem.setRate(itemCol.getItemValueDouble("amount"));
return lineItem;
}).collect(Collectors.toList());

View file

@ -96,7 +96,9 @@ public class ZohoExportAdapter implements SignalAdapter {
files = snapshot.getFileData();
if (files != null) {
for (FileData file : files) {
zohoAPIService.attacheFileData(zohoInvoice.getInvoiceId(), file, "invoices", accessToken);
if (file.getName().toLowerCase().endsWith(".pdf")) {
zohoAPIService.attacheFileData(zohoInvoice.getInvoiceId(), file, "invoices", accessToken);
}
}
}
}
@ -126,7 +128,9 @@ public class ZohoExportAdapter implements SignalAdapter {
files = snapshot.getFileData();
if (files != null) {
for (FileData file : files) {
zohoAPIService.attacheFileData(zohoBill.getBillId(), file, "bills", accessToken);
if (file.getName().toLowerCase().endsWith(".pdf")) {
zohoAPIService.attacheFileData(zohoBill.getBillId(), file, "bills", accessToken);
}
}
}
}

View file

@ -161,7 +161,8 @@ public class ZohoOAuthManager {
saveTokenData(zohoConfig, tokenResponse);
} else {
throw new RuntimeException("Failed to get tokens: " + response.statusCode() + " - " + response.body());
throw new RuntimeException("Failed to update access and refresh tokens: " + response.statusCode()
+ " - " + response.body());
}
} catch (IOException | InterruptedException e) {
@ -213,7 +214,8 @@ public class ZohoOAuthManager {
return zohoConfig.getItemValueString("zoho.accessToken");
} else {
throw new RuntimeException("Failed to get tokens: " + response.statusCode() + " - " + response.body());
throw new RuntimeException(
"Failed to refresh accesss tokens: " + response.statusCode() + " - " + response.body());
}
} catch (IOException | InterruptedException e) {

View file

@ -5,7 +5,8 @@ import jakarta.json.bind.annotation.JsonbProperty;
public class ZohoBillItem {
private String description;
private String name;
private double amount;
private double rate;
private double quantity;
@JsonbProperty("account_id")
private String accountId;
@ -36,12 +37,20 @@ public class ZohoBillItem {
this.accountId = accountId;
}
public double getAmount() {
return amount;
public double getRate() {
return rate;
}
public void setAmount(double amount) {
this.amount = amount;
public void setRate(double rate) {
this.rate = rate;
}
public double getQuantity() {
return quantity;
}
public void setQuantity(double quantity) {
this.quantity = quantity;
}
}

View file

@ -48,6 +48,8 @@
</dt>
<dd>
<span><strong>Default:</strong>
https://accounts.zoho.com/oauth/v2/token</span><br />
<h:inputText required="true"
value="#{zohoController.workitem.item['zoho.oauth.uri']}">
</h:inputText>
@ -60,6 +62,8 @@
<dl>
<dt>API Base URL <span class="imixs-required">*</span></dt>
<dd>
<span><strong>Default:</strong>
https://www.zohoapis.&lt;YOUR-DOMAIN&gt;com/books/v3/</span><br />
<h:inputText required="true"
value="#{zohoController.workitem.item['zoho.uri']}">
</h:inputText>
@ -78,7 +82,7 @@
</dl>
<dl>
<dt>Accountant ID <span class="imixs-required">*</span></dt>
<dt>Costs Account ID <span class="imixs-required">*</span></dt>
<dd>
<h:inputText required="true"
value="#{zohoController.workitem.item['zoho.accountID']}">

View file

@ -4918,6 +4918,12 @@ Export erfolgt über eine asynchrone Verarbeitung im Modell 'cargosoft-export']]
<bpmn2:sequenceFlow id="sequenceFlow_BQWujA" sourceRef="event_vjVWqA" targetRef="Task_6">
<bpmn2:documentation id="documentation_YUR2fQ"/>
</bpmn2:sequenceFlow>
<bpmn2:association id="association_3ESYOQ" sourceRef="Task_6" targetRef="DataObject_3">
<bpmn2:documentation id="documentation_PkPaRA"/>
</bpmn2:association>
<bpmn2:association id="association_BkgMoA" sourceRef="DataObject_3" targetRef="Task_3">
<bpmn2:documentation id="documentation_qMo4pw"/>
</bpmn2:association>
</bpmn2:process>
<bpmn2:process id="process_2" name="Invoice receipt" processType="Public">
<bpmn2:documentation id="documentation_yUm3kA"/>
@ -5215,9 +5221,9 @@ Export erfolgt über eine asynchrone Verarbeitung im Modell 'cargosoft-export']]
<dc:Bounds height="50.0" width="110.0" x="1810.0" y="1980.0"/>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="DataObject_3" id="BPMNShape_DataObject_3">
<dc:Bounds height="50.0" width="35.0" x="550.0" y="1460.0"/>
<dc:Bounds height="50.0" width="35.0" x="650.0" y="1850.0"/>
<bpmndi:BPMNLabel id="BPMNLabel_27">
<dc:Bounds height="20.0" width="100.0" x="518.0" y="1510.0"/>
<dc:Bounds height="20.0" width="100.0" x="618.0" y="1900.0"/>
</bpmndi:BPMNLabel>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="Task_12" id="BPMNShape_Task_14">
@ -5738,9 +5744,10 @@ Export erfolgt über eine asynchrone Verarbeitung im Modell 'cargosoft-export']]
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="Association_7" id="BPMNEdge_Association_7" sourceElement="BPMNShape_DataObject_3" targetElement="BPMNShape_Task_1">
<bpmndi:BPMNLabel id="BPMNLabel_135"/>
<di:waypoint x="585.0" y="1485.0"/>
<di:waypoint x="685.0" y="1485.0"/>
<di:waypoint x="685.0" y="1590.0"/>
<di:waypoint x="668.0" y="1850.0"/>
<di:waypoint x="668.0" y="1745.0"/>
<di:waypoint x="725.0" y="1745.0"/>
<di:waypoint x="725.0" y="1640.0"/>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="SequenceFlow_7" id="BPMNEdge_SequenceFlow_8" sourceElement="BPMNShape_IntermediateCatchEvent_24" targetElement="BPMNShape_Task_14">
<bpmndi:BPMNLabel id="BPMNLabel_137"/>
@ -6095,6 +6102,18 @@ Export erfolgt über eine asynchrone Verarbeitung im Modell 'cargosoft-export']]
<di:waypoint x="1897.0" y="1755.0"/>
<di:waypoint x="1897.0" y="1820.0"/>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="association_3ESYOQ" id="BPMNEdge_tv17zA" sourceElement="BPMNShape_Task_6" targetElement="BPMNShape_DataObject_3">
<di:waypoint x="1810.0" y="1845.0"/>
<di:waypoint x="1248.0" y="1845.0"/>
<di:waypoint x="1248.0" y="1875.0"/>
<di:waypoint x="685.0" y="1875.0"/>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="association_BkgMoA" id="BPMNEdge_MIvrZA" sourceElement="BPMNShape_DataObject_3" targetElement="BPMNShape_Task_9">
<di:waypoint x="685.0" y="1875.0"/>
<di:waypoint x="983.0" y="1875.0"/>
<di:waypoint x="983.0" y="1615.0"/>
<di:waypoint x="1280.0" y="1615.0"/>
</bpmndi:BPMNEdge>
</bpmndi:BPMNPlane>
<bpmndi:BPMNLabelStyle id="BPMNLabelStyle_1">
<dc:Font name="arial" size="9.0"/>