-
Notifications
You must be signed in to change notification settings - Fork 2.2k
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 10 additions & 0 deletions
10
imports/plugins/core/checkout/client/templates/checkout/addressBook/addressBook.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" | ||
}); | ||
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
152 changes: 152 additions & 0 deletions
152
imports/plugins/core/orders/client/components/invoice.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
150
imports/plugins/core/orders/client/components/lineItems.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Uh oh!
There was an error while loading. Please reload this page.
Create "Tax Detail" view in Orders Dashboard #2005
Changes from all commits
d5b134c
dc3926a
f7ba191
980e73c
b883721
8dd49b4
acf4157
5eed248
b84b6cb
ad09d53
325adc9
b9c4f47
31bce7b
071dffa
cb66df9
ebbe562
838dd08
ac9a3d1
5af1cb5
d3328a3
a6d979a
99ba702
8cfd9f2
fefc617
4ee921b
f962ba1
56a2fe8
de1789f
82704ac
e0e11e8
e43c425
6412df8
338d306
dea6a03
3ff063d
824f733
6ea9084
5e6e9bd
0a0a53a
c786d99
536c719
cda2b18
d1d7c66
bee8e84
75d4b88
b8f7a94
f2eeac5
716b5d9
af14539
9dcf97f
1fe558f
de8f1ff
4f3ec9f
745ec56
a040d9f
d683786
2dc1b05
a0983f9
77680d1
4700cd0
5f7eb46
7c61242
35fd058
cca5710
16c2722
7dc9456
af559e8
6757b10
32bd0bc
4ac0ced
ae6b01a
c02e847
956f23a
73e0415
f53eb18
b45a4a1
67c97bf
532583c
5cc5029
c086f5b
3863dd3
34e9f9a
7ce875a
01c502d
05f5d23
7910e6d
dc13970
dffe6ab
d8522ef
cec736f
30a115e
dc81f94
a5c6008
1f882b1
b22608d
acbc88e
f40855b
348a418
10270bd
edd9c70
87c1271
b8c03dd
cb52e4f
cb54270
0509b43
11e084b
a61c7ee
676c0d2
1c6745c
4287301
9e2f2c2
8b88fb0
e2774a6
156171f
387a184
23d0f41
File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.