-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Validate if we can create tax item with custom details #41
base: master
Are you sure you want to change the base?
Conversation
63f0e93
to
8c3fac3
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need some changes related to how we are creating tax item
final InvoiceItem taxItemWithEffectiveRate = transactionLineDetailModel.getEffectiveRate() != null | ||
? new PluginInvoiceItem(new Builder<>() | ||
.withId(taxItem.getId()) | ||
.withInvoiceItemType(taxItem.getInvoiceItemType()) | ||
.withInvoiceId(taxItem.getInvoiceId()) | ||
.withAccountId(taxItem.getAccountId()) | ||
.withChildAccountId(taxItem.getChildAccountId()) | ||
.withStartDate(taxItem.getStartDate()) | ||
.withEndDate(taxItem.getEndDate()) | ||
.withAmount(taxItem.getAmount()) | ||
.withCurrency(taxItem.getCurrency()) | ||
.withDescription(taxItem.getDescription()) | ||
.withSubscriptionId(taxItem.getSubscriptionId()) | ||
.withBundleId(taxItem.getBundleId()) | ||
.withCatalogEffectiveDate(taxItem.getCatalogEffectiveDate()) | ||
.withProductName(taxItem.getProductName()) | ||
.withPrettyProductName(taxItem.getPrettyProductName()) | ||
.withPlanName(taxItem.getPlanName()) | ||
.withPrettyPlanName(taxItem.getPrettyPlanName()) | ||
.withPhaseName(taxItem.getPhaseName()) | ||
.withPrettyPhaseName(taxItem.getPrettyPhaseName()) | ||
.withRate(taxItem.getRate()) | ||
.withLinkedItemId(taxItem.getLinkedItemId()) | ||
.withUsageName(taxItem.getUsageName()) | ||
.withPrettyUsageName(taxItem.getPrettyUsageName()) | ||
.withQuantity(taxItem.getQuantity()) | ||
.withItemDetails(String.valueOf(transactionLineDetailModel.getEffectiveRate())) | ||
.withCreatedDate(taxItem.getCreatedDate()) | ||
.withUpdatedDate(taxItem.getUpdatedDate()) | ||
.validate().build()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we move this to a separate function. Something like below -
final String taxRate = String.valueOf(transactionLineDetailModel.getEffectiveRate())
final InvoiceItem taxItem = createTaxInvoiceItem(taxableItem, invoiceId, adjustmentItem, calculatedTax, description, taxRate)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think having value "null" as a result of valueOf(null) is not what we want in this case
.withUsageName(taxItem.getUsageName()) | ||
.withPrettyUsageName(taxItem.getPrettyUsageName()) | ||
.withQuantity(taxItem.getQuantity()) | ||
.withItemDetails(String.valueOf(transactionLineDetailModel.getEffectiveRate())) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, we discussed to save it as json considering we may want to add additional details in future.
Current format won't support that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@vlaskhilkevich This PR was experimental. Feel free to create a separate PR with your changes.
@singh-sukhvir this pr can be closed |
No description provided.