8000 Create "Tax Detail" view in Orders Dashboard by joykare · Pull Request #2005 · reactioncommerce/reaction · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Create "Tax Detail" view in Orders Dashboard #2005

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

Merged
merged 116 commits into from
Mar 21, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
116 commits
Select commit Hold shift + click to select a range
d5b134c
Update version number
mikemurray Feb 16, 2017
dc3926a
Merge branch 'development' into release-0.20.0
kieckhafer Feb 19, 2017
f7ba191
Merge branch 'development' into release-0.20.0
kieckhafer Feb 22, 2017
980e73c
Merge branch 'development' into release-0.20.0
mikemurray Feb 23, 2017
b883721
Merge branch 'development' into release-0.20.0
kieckhafer Feb 23, 2017
8dd49b4
new meta key in registry, allow package registry items to override de…
lcampanis Feb 18, 2017
acf4157
lint fixes
kieckhafer Feb 23, 2017
5eed248
Rewrite example payment settings pane to react #1817 (#1848)
joykare Feb 23, 2017
b84b6cb
Convert social settings to React with new cards (#1854)
mikemurray Feb 27, 2017
ad09d53
Merge branch 'development' into wip-release-0.20.0
mikemurray Mar 1, 2017
325adc9
Show Sidebar shipping in checkout
impactmass Mar 1, 2017
b9c4f47
Set actionView after payment checkout step
impactmass Mar 1, 2017
31bce7b
1907 PDP template switcher (#1909)
mikemurray Mar 2, 2017 10000
071dffa
Hide sidebar on entry to profile page
impactmass Mar 2, 2017
cb66df9
Add presentational aspect for invoice
joykare Mar 3, 2017
ebbe562
Add presentational view for invoice
joykare Mar 3, 2017
838dd08
Added switch component to list item (#1936)
mikemurray Mar 6, 2017
ac9a3d1
Remove broken check for bulk write support (#1929)
brent-hoover Mar 6, 2017
5af1cb5
validated reaction json (#1937)
lcampanis Mar 6, 2017
d3328a3
State feedback capture payment 1243 (#1926)
joykare Mar 6, 2017
a6d979a
remove react-bootstrap (#1914)
kieckhafer Mar 6, 2017
99ba702
Add state to the invoice view
joykare Mar 6, 2017
8cfd9f2
Detail on invoices captured
joykare Mar 6, 2017
fefc617
Add roll over list capability
joykare Mar 6, 2017
4ee921b
Add single invoice render
joykare Mar 6, 2017
f962ba1
Merge remote-tracking branch 'origin/development' into wip-release-0.…
kieckhafer Mar 6, 2017
56a2fe8
Add roll down list not quantity based
joykare Mar 6, 2017
de1789f
Update product handle when title changes (#1898)
mikemurray Mar 6, 2017
82704ac
Add presentational aspect for invoice
joykare Mar 3, 2017
e0e11e8
Add presentational view for invoice
joykare Mar 3, 2017
e43c425
Add state to the invoice view
joykare Mar 6, 2017
6412df8
Detail on invoices captured
joykare Mar 6, 2017
338d306
Add roll over list capability
joykare Mar 6, 2017
dea6a03
Add single invoice render
joykare Mar 6, 2017
3ff063d
Add roll down list not quantity based
joykare Mar 6, 2017
824f733
Display unique items only
joykare Mar 7, 2017
6ea9084
Add quantities to line items
joykare Mar 7, 2017
5e6e9bd
Remove unnecessary parts of the view
joykare Mar 7, 2017
0a0a53a
Fix merge conflicts
joykare Mar 7, 2017
c786d99
Fix search isSoldOut issue (#1904)
kieckhafer Mar 7, 2017
536c719
Seperate components for roll up lists and line items
joykare Mar 8, 2017
cda2b18
Add cancel capability
joykare Mar 8, 2017
d1d7c66
Clean up UI
joykare Mar 8, 2017
bee8e84
Add item functions
joykare Mar 9, 2017
75d4b88
Fix Sidebar Context (#1932)
impactmass Mar 9, 2017
b8f7a94
Remove Inventory subscription that is not in use (#1951)
Mar 9, 2017
f2eeac5
Get package data by shopId as well as package name (#1949)
brent-hoover Mar 9, 2017
716b5d9
Add capture payments capability
joykare Mar 9, 2017
af14539
Add refunds fields
joykare Mar 9, 2017
9dcf97f
Seperate concerns in invoice component
joykare Mar 10, 2017
1fe558f
Clean up invoice code
joykare Mar 10, 2017
de8f1ff
Refactorline items
joykare Mar 10, 2017
4f3ec9f
Updated i18n settings panel (#1947)
mikemurray Mar 10, 2017
745ec56
Avalara Tax Compliance (#1870)
brent-hoover Mar 10, 2017
a040d9f
Fix: Dashboard panel keeps re-opening during checkout (#1956)
impactmass Mar 10, 2017
d683786
localize prices in emails (#1957)
kieckhafer Mar 10, 2017
2dc1b05
Use select box of countries rather than text field for "Origin Countr…
brent-hoover Mar 13, 2017
a0983f9
Fix 404 when adding handle and then editing a variant before publishing.
mikemurray Mar 13, 2017
77680d1
Fixed misspelling in comment
mikemurray Mar 13, 2017
4700cd0
Merge origin development
joykare Mar 13, 2017
5f7eb46
Remove z-index from dropdown as it creates more issues than it solves
mikemurray Mar 13, 2017
7c61242
Moved ColumnData component to its own file. (#1972)
mikemurray Mar 13, 2017
35fd058
Prevent hiding of nested tags on mobile (#1971)
impactmass Mar 13, 2017
cca5710
Show Sidebar shipping in checkout
impactmass Mar 1, 2017
16c2722
Set actionView after payment checkout step
impactmass Mar 1, 2017
7dc9456
Add presentational aspect for invoice
joykare Mar 3, 2017
af559e8
Add presentational view for invoice
joykare Mar 3, 2017
6757b10
Add state to the invoice view
joykare Mar 6, 2017
32bd0bc
Detail on invoices captured
joykare Mar 6, 2017
4ac0ced
Add roll over list capability
joykare Mar 6, 2017
ae6b01a
Add single invoice render
joykare Mar 6, 2017
c02e847
Add roll down list not quantity based
joykare Mar 6, 2017
956f23a
Add presentational aspect for invoice
joykare Mar 3, 2017
73e0415
Add presentational view for invoice
joykare Mar 3, 2017
f53eb18
Add state to the invoice view
joykare Mar 6, 2017
b45a4a1
Detail on invoices captured
joykare Mar 6, 2017
67c97bf
Add roll over list capability
joykare Mar 6, 2017
532583c
Add single invoice render
joykare Mar 6, 2017
5cc5029
Display unique items only
joykare Mar 7, 2017
c086f5b
Add quantities to line items
joykare Mar 7, 2017
3863dd3
Remove unnecessary parts of the view
joykare Mar 7, 2017
34e9f9a
Seperate components for roll up lists and line items
joykare Mar 8, 2017
7ce875a
Add cancel capability
joykare Mar 8, 2017
01c502d
Clean up UI
joykare Mar 8, 2017
05f5d23
Add item functions
joykare Mar 9, 2017
7910e6d
Add capture payments capability
joykare Mar 9, 2017
dc13970
Add refunds fields
joykare Mar 9, 2017
dffe6ab
Seperate concerns in invoice component
joykare Mar 10, 2017
d8522ef
Clean up invoice code
joykare Mar 10, 2017
cec736f
Refactorline items
joykare Mar 10, 2017
30a115e
Add data into individual line items
joykare Mar 13, 2017
dc81f94
Merge branch 'joykare-taxdetail-view-1857' of github.com:reactioncomm…
joykare Mar 13, 2017
a5c6008
linting and minor error fixes (#1973)
kieckhafer Mar 13, 2017
1f882b1
Avalara error handling (#1968)
brent-hoover Mar 13, 2017
b22608d
Move around UI components
joykare Mar 13, 2017
acbc88e
Move around UI components
joykare Mar 13, 2017
f40855b
Merge branch 'joykare-taxdetail-view-1857' of github.com:reactioncomm…
joykare Mar 14, 2017
348a418
Add total price of line items
joykare Mar 14, 2017
10270bd
Format pricing to have dollar signs
joykare Mar 14, 2017
edd9c70
Merge branch 'wip-release-0.20.0' into joykare-taxdetail-view-1857
joykare Mar 15, 2017
87c1271
Finalize on tax data
joykare Mar 15, 2017
b8c03dd
Iterate on design
joykare Mar 15, 2017
cb52e4f
Merge branch 'development' into joykare-taxdetail-view-1857
joykare Mar 15, 2017
cb54270
Merge branch 'development' of github.com:reactioncommerce/reaction in…
joykare Mar 15, 2017
0509b43
Merge branch 'development' into joykare-taxdetail-view-1857
joykare Mar 15, 2017
11e084b
Merge branch 'development' into joykare-taxdetail-view-1857
joykare Mar 16, 2017
a61c7ee
Review tax display
joykare Mar 16, 2017
676c0d2
Merge branch 'joykare-taxdetail-view-1857' of github.com:reactioncomm…
joykare Mar 16, 2017
1c6745c
Can drag drop images onto order
joykare Mar 16, 2017
4287301
Merge branch 'development' of github.com:reactioncommerce/reaction in…
joykare Mar 16, 2017
9e2f2c2
Only display Add discount when discounts are enabled
joykare Mar 17, 2017
8b88fb0
Merge branch 'development' into joykare-taxdetail-view-1857
joykare Mar 17, 2017
e2774a6
Merge branch 'development' into joykare-taxdetail-view-1857
brent-hoover Mar 20, 2017
156171f
Correct syntax issues after review
joykare Mar 21, 2017
387a184
Merge branch 'joykare-taxdetail-view-1857' of github.com:reactioncomm…
joykare Mar 21, 2017
23d0f41
Tweak syntax of functions
joykare Mar 21, 2017
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
< 8000 div class="d-flex flex-justify-center">
Diff view
1 change: 1 addition & 0 deletions imports/plugins/core/checkout/client/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import "./templates/cartPanel/cartPanel.html";
import "./templates/cartPanel/cartPanel.js";

import "./templates/checkout/addressBook/addressBook.html";
import "./templates/checkout/addressBook/addressBook.js";
import "./templates/checkout/completed/completed.html";
import "./templates/checkout/completed/completed.js";
import "./templates/checkout/header/header.html";
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { Template } from "meteor/templating";
import { Reaction } from "/client/api";

Template.checkoutAddressBook.onCreated(function () {
Reaction.showActionView({
provides: "settings",
name: "settings/shipping",
template: "shippingSettings"
});
});
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import "./review.html";
import { Meteor } from "meteor/meteor";
import { Template } from "meteor/templating";
import { Reaction } from "/client/api";

/**
* review status
Expand All @@ -9,4 +10,9 @@ import { Template } from "meteor/templating";

Template.checkoutReview.onRendered(function () {
Meteor.call("workflow/pushCartWorkflow", "coreCartWorkflow", "checkoutReview");
Reaction.showActionView({
name: "payment/settings",
provides: "settings",
template: "paymentSettings"
});
});
5 changes: 3 additions & 2 deletions imports/plugins/core/discounts/client/components/form.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export default class DiscountForm extends Component {
this.state = {
discount: this.props.discount,
validationMessage: null,
validatedInput: false,
validatedInput: this.props.validatedInput || false,
attempts: 0,
discountApplied: false
};
Expand Down Expand Up @@ -144,5 +144,6 @@ export default class DiscountForm extends Component {
DiscountForm.propTypes = {
collection: PropTypes.string,
discount: PropTypes.string,
id: PropTypes.string
id: PropTypes.string,
validatedInput: PropTypes.bool
};
6 changes: 4 additions & 2 deletions imports/plugins/core/discounts/client/components/list.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ class DiscountList extends Component {
// load form input view
renderNoneFound() {
return (
<DiscountForm id={this.props.id} collection={this.props.collection}/>
<DiscountForm id={this.props.id} collection={this.props.collection} validatedInput={this.props.validatedInput} />
);
}

Expand All @@ -63,7 +63,8 @@ class DiscountList extends Component {
DiscountList.propTypes = {
collection: PropTypes.string,
id: PropTypes.string,
listItems: PropTypes.array
listItems: PropTypes.array,
validatedInput: PropTypes.bool
};

function composer(props, onData) {
Expand All @@ -84,6 +85,7 @@ function composer(props, onData) {

onData(null, {
collection: props.collection,
validatedInput: props.validatedInput,
id: props.id,
listItems: listItems
});
Expand Down
152 changes: 152 additions & 0 deletions imports/plugins/core/orders/client/components/invoice.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,152 @@
import React, { Component, PropTypes } from "react";
import { formatPriceString } from "/client/api";
import { Translation } from "/imports/plugins/core/ui/client/components";
import DiscountList from "/imports/plugins/core/discounts/client/components/list";

class Invoice extends Component {
static propTypes = {
canMakeAdjustments: PropTypes.bool,
collection: PropTypes.string,
dateFormat: PropTypes.func,
discounts: PropTypes.bool,
handleClick: PropTypes.func,
invoice: PropTypes.object,
isFetching: PropTypes.bool,
isOpen: PropTypes.bool,
orderId: PropTypes.string,
paymentCaptured: PropTypes.bool,
refunds: PropTypes.array
}

renderDiscountForm() {
const { isOpen, orderId, collection } = this.props;

return (
<div>
{isOpen &&
<div>
<hr/>
<DiscountList
id={orderId}
collection={collection}
validatedInput={true}
/>
<hr/>
</div>
}
</div>
);
}

renderRefundsInfo() {
const { isFetching, refunds, dateFormat } = this.props;

return (
<div>
{isFetching &&
<div className="form-group order-summary-form-group">
<strong>Loading Refunds</strong>
<div className="invoice-details">
<i className="fa fa-spinner fa-spin" />
</div>
</div>
}

{refunds && refunds.map((refund) => (
<div className="order-summary-form-group text-danger" key={refund.created} style={{ marginBottom: 15 }}>
<strong>Refunded on: {dateFormat(refund.created, "MM/D/YYYY")}</strong>
<div className="invoice-details"><strong>{formatPriceString(refund.amount)}</strong></div>
</div>
))}
</div>
);
}

renderTotal() {
const { invoice } = this.props;

return (
<div className="order-summary-form-group">
<hr/>
<strong>TOTAL</strong>
<div className="invoice-details">
<strong>{formatPriceString(invoice.total)}</strong>
</div>
</div>
);
}

renderConditionalDisplay() {
const { canMakeAdjustments, paymentCaptured } = this.props;

return (
<div>
{canMakeAdjustments ?
<div> {this.renderTotal()} </div> :
<span>
{paymentCaptured ?
<div>
{this.renderRefundsInfo()}
</div>
:
<div> {this.renderTotal()} </div>
}
</span>
}
</div>
);
}

render() {
const { invoice, discounts, handleClick } = this.props;

return (
<div>
<div className="order-summary-form-group">
<strong>Quantity Total</strong>
<div className="invoice-details">
{invoice.totalItems}
</div>
</div>

<div className="order-summary-form-group">
<strong><Translation defaultValue="Subtotal" i18nKey="cartSubTotals.subtotal"/></strong>
<div className="invoice-details">
{formatPriceString(invoice.subtotal)}
</div>
</div>

<div className="order-summary-form-group">
<strong><Translation defaultValue="Shipping" i18nKey="cartSubTotals.shipping"/></strong>
<div className="invoice-details">
{formatPriceString(invoice.shipping)}
</div>
</div>

<div className="order-summary-form-group">
<strong><Translation defaultValue="Tax" i18nKey="cartSubTotals.tax"/></strong>
<div className="invoice-details">
{formatPriceString(invoice.taxes)}
</div>
</div>

{discounts &&
<div>
<div className="order-summary-form-group">
<strong><Translation defaultValue="Discount" i18nKey="cartSubTotals.discount"/></strong>
<div className="invoice-details">
<i className="fa fa-tag fa-lg" style={{ marginRight: 2 }}/>
<a className="btn-link" Discount</a>
</div>
</div>
{this.renderDiscountForm()}
</div>
}
{this.renderConditionalDisplay()}
</div>
);
}
}

export default Invoice;

150 changes: 150 additions & 0 deletions imports/plugins/core/orders/client/components/lineItems.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,150 @@
import React, { Component, PropTypes } from "react";
import { formatPriceString } from "/client/api";
import { Translation } from "/imports/plugins/core/ui/client/components";

class LineItems extends Component {
static propTypes = {
displayMedia: PropTypes.func,
handleClick: PropTypes.func,
isExpanded: PropTypes.func,
onClose: PropTypes.func,
uniqueItems: PropTypes.array
}

calculateTotal(price, shipping, taxes) {
return formatPriceString(price + shipping + taxes);
}

renderLineItem(uniqueItem, quantity) {
const { handleClick, displayMedia } = this.props;

return (
<div className="order-items">
<div
className="invoice order-item form-group order-summary-form-group"
=> handleClick(uniqueItem.cartItemId)}
style={{ height: 70 }}
>

<div className="order-item-media" style={{ marginLeft: 15 }}>
{ !displayMedia(uniqueItem) ?
<img src= "/resources/placeholder.gif" /> :
<img
src={displayMedia(uniqueItem).url()}
/>
}
</div>

<div className="order-item-details">
<div className="order-detail-title">
{uniqueItem.title} <br/><small>{uniqueItem.variants.title}</small>
</div>
</div>

<div className="order-detail-quantity">
{quantity || 1}
</div>

<div className="order-detail-price">
<div className="invoice-details" style={{ marginRight: 15 }}>
<strong>{formatPriceString(uniqueItem.variants.price)}</strong>
</div>
</div>

</div>
</div>
);
}

renderLineItemInvoice(uniqueItem, shippingRate, quantity) {
return (
<div>
<div className="order-summary-form-group">
<strong><Translation defaultValue="Subtotal" i18nKey="cartSubTotals.subtotal"/></strong>
<div className="invoice-details">
{formatPriceString(uniqueItem.variants.price)}
</div>
</div>

<div className="order-summary-form-group">
<strong><Translation defaultValue="Shipping" i18nKey="cartSubTotals.shipping"/></strong>
<div className="invoice-details">
{formatPriceString(shippingRate)}
</div>
</div>

<div className="order-summary-form-group">
<strong>Item tax</strong>
<div className="invoice-details">
{uniqueItem.taxDetail ? formatPriceString(uniqueItem.taxDetail.tax / quantity) : formatPriceString(0)}
</div>
</div>

<div className="order-summary-form-group">
<strong>Tax code</strong>
<div className="invoice-details">
{uniqueItem.taxDetail ? uniqueItem.taxDetail.taxCode : uniqueItem.variants.taxCode}
</div>
</div>

<div className="order-summary-form-group">
<strong>TOTAL</strong>
<div className="invoice-details">
{uniqueItem.taxDetail ?
<strong>
{this.calculateTotal(uniqueItem.variants.price, shippingRate, uniqueItem.taxDetail.tax)}
</strong> :
<strong>
{this.calculateTotal(uniqueItem.variants.price, shippingRate, 0)}
</strong>
}
</div>
</div>
<br/>
</div>
);
}

render() {
const { uniqueItems, isExpanded, onClose } = this.props;

return (
<div>
{uniqueItems.map((uniqueItem) => {
if (!isExpanded(uniqueItem.cartItemId)) {
return (
<div key={uniqueItem.cartItemId}> { this.renderLineItem(uniqueItem.items[0], uniqueItem.items.length) } </div>
);
}

return (
<div className="roll-up-invoice-list" key={uniqueItem.cartItemId}>
<div className="roll-up-content">

<div style={{ float: "right" }}>
<button className="rui btn btn-default flat icon-only" => onClose(uniqueItem.cartItemId)}>
<i
className="rui font-icon fa-lg fa fa-times"
/>
</button>
</div>

<br/><br/>

{uniqueItem.items.map((item) => (
<div key={item._id}>
{ this.renderLineItem(item) }
{ this.renderLineItemInvoice(item, uniqueItem.shippingRate, uniqueItem.items.length) }
</div>
))}

</div>
</div>
);
})}
</div>
);
}
}

export default LineItems;
Loading
0