completed erpnext v1 integration

This commit is contained in:
2025-09-27 23:36:00 +02:00
parent b0c2eb352e
commit 230f16e08d
2 changed files with 3 additions and 3 deletions

View File

@@ -78,6 +78,7 @@ public class Transaction extends BaseEntity {
private String erpSalesPaymentRef; private String erpSalesPaymentRef;
private String erpPurchaseRef; private String erpPurchaseRef;
private String erpPurchasePaymentRef; private String erpPurchasePaymentRef;
private String erpCommissionJournalRef;
@Enumerated(EnumType.STRING) @Enumerated(EnumType.STRING)
private RequestType type; private RequestType type;

View File

@@ -40,7 +40,6 @@ public class PurchaseInvoiceHandler implements LogicHandler<Transaction, Transac
private final TransactionRepository transactionRepository; private final TransactionRepository transactionRepository;
private final ProviderService providerService; private final ProviderService providerService;
@Value("${erpnext.url}") @Value("${erpnext.url}")
private String erpnextUrl; private String erpnextUrl;
@Value("${erpnext.api.key}") @Value("${erpnext.api.key}")
@@ -125,11 +124,11 @@ public class PurchaseInvoiceHandler implements LogicHandler<Transaction, Transac
.doctype("Purchase Taxes and Charges") .doctype("Purchase Taxes and Charges")
.chargeType("On Net Total") .chargeType("On Net Total")
.accountHead(erpnextCommissionAccount) .accountHead(erpnextCommissionAccount)
.rate(commission.negate()) .rate(BigDecimal.valueOf(provider.getPercentageCommission()).negate())
.costCenter(erpnextCostCenter) .costCenter(erpnextCostCenter)
.taxAmount(commission.negate()) .taxAmount(commission.negate())
.total(amount) .total(amount)
.description("Discounts Received") .description("Commission")
.build(); .build();
PurchaseInvoiceDto purchaseInvoiceDto = PurchaseInvoiceDto.builder() PurchaseInvoiceDto purchaseInvoiceDto = PurchaseInvoiceDto.builder()