completed erpnext v1 integration
This commit is contained in:
@@ -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;
|
||||||
|
|||||||
@@ -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()
|
||||||
|
|||||||
Reference in New Issue
Block a user