Skip to content
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

Development #163

Merged
merged 32 commits into from
Sep 22, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
94161c0
Issue99: SI: Printing multiple orders from order manager no longer in…
ketangarala Jul 11, 2018
8d5162a
#99 SI: Printing multiple orders from order manager no longer include…
ketangarala Jul 11, 2018
50b4d23
Merge branch 'Issues/Issue-99' of https://github.com/ketangarala/core…
ketangarala Jul 12, 2018
a91e9b5
SI: Printing multiple orders from order manager no longer includes bu…
ketangarala Jul 12, 2018
1383960
Merge branch 'Issues/Issue-99' of https://github.com/ketangarala/core…
ketangarala Jul 12, 2018
9c4c4d9
Merge pull request #137 from ketangarala/Issues/Issue-99
Jul 12, 2018
048188e
Merge pull request #1 from HotcakesCommerce/development
ketangarala Jul 13, 2018
cb0aaec
Merge pull request #3 from HotcakesCommerce/development
ketangarala Jul 16, 2018
bb3f996
SI: Tax Exempt Customers Not Honored in Store Administration Order Ma…
ketangarala Jul 16, 2018
3fbd36e
Merge pull request #140 from ketangarala/Issues/Issue-110
Jul 16, 2018
a0553f5
SI: When Calculating Taxes with Discounts applied to the order you ca…
ketangarala Jul 21, 2018
0c4d56c
SI: Unable to use "User Is..." promotion qualification #93
ketangarala Jul 21, 2018
c20c117
Merge pull request #142 from ketangarala/Issues/issue-136
Jul 23, 2018
57e5116
Merge pull request #143 from ketangarala/Issues/Issue-93
Jul 23, 2018
4b732fe
CI: CategoryViewer - DrillDown view error when no category is set #101
Jul 24, 2018
2fbcb32
Merge pull request #146 from ketangarala/Issues/Issue-101
Jul 24, 2018
fe7f1d0
SI: PayPal Express Authorize Setting Not Creating Authorizations #50
Jul 25, 2018
98b7bee
SI: Add E-Mail Template Token for Purchase Order Number #127
Jul 27, 2018
630aaec
Merge pull request #148 from ketangarala/Issues/Issue-127
Jul 27, 2018
5dd7920
Merge pull request #147 from ketangarala/Issues/Issue-50
Jul 27, 2018
eefa528
SI: Update Wish List default View to Show Selection Data #113
Jul 30, 2018
8105eff
SI: Update Wish List default View to Show Selection Data #113
Jul 30, 2018
849b96a
SI: Update Wish List default View to Show Selection Data #113
Aug 3, 2018
ef5332b
SI: Update Wish List default View to Show Selection Data #113
Aug 8, 2018
5482db2
Merge pull request #150 from ketangarala/Issues/Issue-113
Aug 14, 2018
45a69be
Closes issue #157
WillStrohl Sep 21, 2018
1f10645
Updated the license to render better in the installation wizard
WillStrohl Sep 21, 2018
cbac132
Resolves issue #99
WillStrohl Sep 21, 2018
2e1d053
Resolve issue #158
WillStrohl Sep 21, 2018
073c0e0
Resolves issue #130
WillStrohl Sep 22, 2018
11b26fc
Updated the release notes for 03.02.01
WillStrohl Sep 22, 2018
057e561
Merge pull request #162 from hismightiness/tasks/release-03.02.01
Sep 22, 2018
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
Diff view
4 changes: 2 additions & 2 deletions Build.proj
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@

<!-- Version Number -->
<PropertyGroup Condition=" '$(BUILD_NUMBER)' == '' ">
<Version>03.02.00</Version>
<Version>03.02.01</Version>
<FileVersion>01.00.00</FileVersion>
<InformationalVersion>01.00.00</InformationalVersion>
</PropertyGroup>

<PropertyGroup Condition=" '$(BUILD_NUMBER)' != '' ">
<!-- Build Server Number -->
<Version>03.02.00</Version>
<Version>03.02.01</Version>
<FileVersion>$(BUILD_NUMBER)</FileVersion>
<InformationalVersion>$(BUILD_NUMBER)</InformationalVersion>
</PropertyGroup>
Expand Down
2 changes: 1 addition & 1 deletion CommonAssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
[assembly: CLSCompliant(false)]
[assembly: ComVisible(false)]

[assembly: AssemblyVersion("3.02.00")]
[assembly: AssemblyVersion("3.02.01")]
[assembly: AssemblyDelaySign(false)]
[assembly: AssemblyKeyFile("")]
[assembly: AssemblyKeyName("")]
Expand Down
8 changes: 4 additions & 4 deletions GlobalAssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,21 @@
// </auto-generated>
//------------------------------------------------------------------------------

[assembly: System.Reflection.AssemblyCopyright("Copyright © 2017. All rights reserved.")]
[assembly: System.Reflection.AssemblyCopyright("Copyright © 2018. All rights reserved.")]
[assembly: System.Reflection.AssemblyConfiguration("Release")]
[assembly: System.Reflection.AssemblyVersion("03.00.00")]
[assembly: System.Reflection.AssemblyVersion("03.02.01")]
[assembly: System.Reflection.AssemblyFileVersion("01.00.00")]
[assembly: System.Reflection.AssemblyInformationalVersion("01.00.00")]



internal sealed partial class ThisAssembly {

internal const string AssemblyCopyright = "Copyright © 2017. All rights reserved.";
internal const string AssemblyCopyright = "Copyright © 2018. All rights reserved.";

internal const string AssemblyConfiguration = "Release";

internal const string AssemblyVersion = "03.00.00";
internal const string AssemblyVersion = "03.02.01";

internal const string AssemblyFileVersion = "01.00.00";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,14 +63,10 @@ public override bool ProcessCheckout(OrderTaskContext context)
EventLog.LogEvent("PayPal Express Checkout", "CartReturnUrl=" + cartReturnUrl, EventLogSeverity.Information);

PaymentActionCodeType mode = PaymentActionCodeType.Authorization;
if (context.HccApp.CurrentStore.Settings.PayPal.ExpressAuthorizeOnly)
{
mode = PaymentActionCodeType.Order;
}
else
if (!context.HccApp.CurrentStore.Settings.PayPal.ExpressAuthorizeOnly)
{
mode = PaymentActionCodeType.Sale;
}
}

// Accelerated boarding
if (string.IsNullOrWhiteSpace(context.HccApp.CurrentStore.Settings.PayPal.UserName))
Expand Down
7 changes: 7 additions & 0 deletions Libraries/Hotcakes.Commerce/Catalog/WishListItem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,12 @@ public WishListItem()
/// </summary>
public OptionSelections SelectionData { get; set; }


/// <summary>
/// Show Additional Product Variant/Selection
/// </summary>
public string ProductShortDescription { get; set; }

private void Init()
{
Id = 0;
Expand All @@ -84,6 +90,7 @@ private void Init()
ProductId = string.Empty;
Quantity = 1;
SelectionData = new OptionSelections();
ProductShortDescription = string.Empty;
}

/// <summary>
Expand Down
9 changes: 9 additions & 0 deletions Libraries/Hotcakes.Commerce/Orders/Order.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1386,6 +1386,15 @@ public List<HtmlTemplateTag> GetReplaceableTags(HccRequestContext context)

var orderService = Factory.CreateService<OrderService>(context);
result.Add(new HtmlTemplateTag("[[Order.PaymentMethod]]", orderService.OrdersListPaymentMethods(this)));
var PurchaseOrderNumber = string.Empty;
foreach (var orderdetail in orderService.Transactions.FindForOrder(bvin))
{
if (!string.IsNullOrEmpty(orderdetail.PurchaseOrderNumber))
{
PurchaseOrderNumber += orderdetail.PurchaseOrderNumber + ",";
}
}
result.Add(new HtmlTemplateTag("[[Order.Payment.PoNumber]]", PurchaseOrderNumber.Trim().TrimEnd(',')));

result.Add(new HtmlTemplateTag("[[Order.PaymentStatus]]",
LocalizationUtils.GetOrderPaymentStatus(PaymentStatus, culture)));
Expand Down
24 changes: 19 additions & 5 deletions Libraries/Hotcakes.Commerce/Orders/OrderCalculator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -528,7 +528,7 @@ private void CalculateTaxes(Order order)

private void TaxOrder(Order order)
{
TaxItems(order.ItemsAsITaxable(), order.BillingAddress, order.ShippingAddress, order.TotalOrderDiscounts);
TaxItems(order.ItemsAsITaxable(), order.BillingAddress, order.ShippingAddress, order.TotalOrderDiscounts,order.UserID);

var isTaxRateSame = true;
decimal taxRate = -1;
Expand Down Expand Up @@ -586,14 +586,28 @@ private void TaxOrder(Order order)
order.TotalTax = order.ItemsTax + order.ShippingTax;
}

private void TaxItems(List<ITaxable> items, IAddress billingAddress, IAddress shippingAddress,decimal totalOrderDiscounts)
private void TaxItems(List<ITaxable> items, IAddress billingAddress, IAddress shippingAddress,decimal totalOrderDiscounts,string userId)
{
var applyVATRules = _app.CurrentStore.Settings.ApplyVATRules;
decimal discount = 0;
decimal qty = 0;
if (totalOrderDiscounts != 0)
{
var qty = items.Where(i => i.IsTaxExempt == false && i.TaxSchedule != -1 && _app.OrderServices.TaxSchedules.FindForThisStore(i.TaxSchedule) != null).Sum(i => i.Quantity);
discount = totalOrderDiscounts / qty;
foreach (var i in items)
{
if (i.IsTaxExempt == false && i.TaxSchedule != -1)
{
if (_app.OrderServices.TaxSchedules.FindForThisStore(i.TaxSchedule) != null)
{
qty += i.Quantity;
}
}
}

if (qty != 0)
{
discount = totalOrderDiscounts / qty;
}
}

foreach (var item in items)
Expand Down Expand Up @@ -622,7 +636,7 @@ private void TaxItems(List<ITaxable> items, IAddress billingAddress, IAddress sh

if (tax != null)
{
var user = _app.CurrentCustomer;
var user = _app.MembershipServices.Customers.Find(userId);
var taxExemptUser = user != null ? user.TaxExempt : false;

if (!taxExemptUser)
Expand Down
8 changes: 7 additions & 1 deletion Libraries/Hotcakes.Commerce/Payment/Methods/PaypalExpress.cs
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,16 @@ public bool Authorize(Transaction t, HotcakesApplication app)
{
var OrderNumber = t.MerchantInvoiceNumber + Guid.NewGuid();

PaymentActionCodeType mode = PaymentActionCodeType.Authorization;
if (!app.CurrentStore.Settings.PayPal.ExpressAuthorizeOnly)
{
mode = PaymentActionCodeType.Sale;
}

var paymentResponse = ppAPI.DoExpressCheckoutPayment(t.PreviousTransactionNumber,
t.PreviousTransactionAuthCode,
t.Amount.ToString("N", CultureInfo.InvariantCulture),
PaymentActionCodeType.Order,
mode,
PayPalAPI.GetCurrencyCodeType(app.CurrentStore.Settings.PayPal.Currency),
OrderNumber);

Expand Down
17 changes: 15 additions & 2 deletions Libraries/Hotcakes.Shipping.Ups/UPSService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ private List<IShippingRate> GetAllShippingRatesForShipment(IShipment shipment)
sXML = XmlTools.BuildAccessKey(settings);
sXML += "\n";

sXML += BuildUPSRateRequestForShipment(shipment);
sXML += BuildUPSRateRequestForShipment(shipment, settings);

var sResponse = string.Empty;
sResponse = XmlTools.ReadHtmlPage_POST(sURL, sXML);
Expand Down Expand Up @@ -429,7 +429,7 @@ private string DecodeUpsServiceCode(string sCode)
return "UPS";
}

private string BuildUPSRateRequestForShipment(IShipment shipment)
private string BuildUPSRateRequestForShipment(IShipment shipment, UpsSettings settings)
{
var sXML = string.Empty;
var strWriter = new StringWriter();
Expand Down Expand Up @@ -497,7 +497,15 @@ private string BuildUPSRateRequestForShipment(IShipment shipment)
xw.WriteElementString("City", XmlTools.TrimToLength(shipment.SourceAddress.City.Trim(), 30));
}

if (shipment.SourceAddress.RegionData != null)
{
xw.WriteElementString("StateProvinceCode", shipment.SourceAddress.RegionData.Abbreviation);
}

xw.WriteElementString("CountryCode", shipment.SourceAddress.CountryData.IsoCode);

xw.WriteElementString("ShipperNumber", settings.License);

xw.WriteEndElement();
xw.WriteEndElement();

Expand All @@ -517,6 +525,11 @@ private string BuildUPSRateRequestForShipment(IShipment shipment)
}
}

if (shipment.DestinationAddress.RegionData != null)
{
xw.WriteElementString("StateProvinceCode", shipment.DestinationAddress.RegionData.Abbreviation);
}

if (shipment.DestinationAddress.CountryData.Bvin.Length > 0)
{
xw.WriteElementString("CountryCode", shipment.DestinationAddress.CountryData.IsoCode);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
using Hotcakes.Commerce.Membership;
using Hotcakes.Modules.Core.Admin.AppCode;
using Hotcakes.Web;
using System.Linq;

namespace Hotcakes.Modules.Core.Admin.Controls
{
Expand Down Expand Up @@ -211,8 +212,8 @@ protected void btnValidateUser_Click(object sender, ImageClickEventArgs e)

private void ValidateUser()
{
var u
= HccApp.MembershipServices.Customers.FindByUsername(UserNameField.Text.Trim());
var users = HccApp.MembershipServices.Customers.FindByEmail(UserNameField.Text.Trim());
var u = users != null ? users.FirstOrDefault() : null;
if (u != null)
{
if (u.Bvin != string.Empty)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
if (ids.length > 0) {
var templateId = $lstPrintTemplate.val();
var redirectUrl = "PrintOrder.aspx?templateid=" + templateId + "&autoprint=1&id=" + ids.join(",");
window.location.replace(redirectUrl);
window.open(redirectUrl, "_blank");
} else {
hcAlert(event, "Please select at least one order to print first.");
}
Expand Down
88 changes: 47 additions & 41 deletions Website/DesktopModules/Hotcakes/Core/Admin/Orders/PrintOrder.aspx
Original file line number Diff line number Diff line change
Expand Up @@ -3,54 +3,60 @@
<%@ Register Src="OrderActions.ascx" TagName="OrderActions" TagPrefix="uc1" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HccAdminPopupConent" runat="Server">

<script type="text/javascript">
function doPrint() {
if (window.print) {
window.print();
} else {
alert('Please choose the print button from your browser. Usually in the menu dropdowns at File: Print');
}
}
<script type="text/javascript">
function doPrint() {
if (window.print) {
window.print();
} else {
alert('Please choose the print button from your browser. Usually in the menu dropdowns at File: Print');
}
}

jQuery(function ($) {
if (hcc.getUrlVar('autoprint') == "1") {
doPrint();
}
});
</script>
jQuery(function ($) {
if (hcc.getUrlVar('autoprint') == "1") {
doPrint();
}
});
</script>

<div style="background: #fff; padding: 10px;">
<div class="hcNavContent printhidden">
<uc1:OrderActions ID="OrderActions1" HideActions="true" runat="server" />
<div style="background: #fff; padding: 10px;">
<div class="hcNavContent printhidden">
<uc1:OrderActions ID="OrderActions1" HideActions="true" runat="server" />

<div class="hcBlockNoBorder">
<asp:LinkButton ID="lnkPrintNow" runat="server" Text="Print" CssClass="hcPrimaryAction" OnClientClick="javascript:doPrint();" />
</div>
</div>
<div class="hcMainContent printhidden">
<h1>Print Order</h1>
Template:
<div class="hcBlockNoBorder">
<asp:LinkButton ID="lnkPrintNow" runat="server" Text="Print" CssClass="hcPrimaryAction" OnClientClick="javascript:doPrint();" />
</div>
</div>
<div class="hcMainContent printhidden">
<h1>Print Order</h1>
Template:
<asp:DropDownList ID="TemplateField" runat="Server"></asp:DropDownList>
<asp:ImageButton ID="btnGenerate" runat="server"
ImageUrl="~/DesktopModules/Hotcakes/Core/Admin/Images/Buttons/Go.png" OnClick="btnGenerate_Click" />
</div>
<div class="printbackground">
<asp:DataList BackColor="#FFFFFF" ID="DataList1" runat="server" Width="100%" OnItemDataBound="DataList1_ItemDataBound">
</div>
<div class="printbackground">
<asp:repeater id="rpOrder" runat="server" OnItemDataBound="rpOrder_ItemDataBound">
<ItemTemplate>
<div class="printhidden">
<hr />
</div>
<asp:Literal ID="litTemplate" runat="server"></asp:Literal>
<table style="width:100%; background-color:#FFFFFF">
<tbody>
<tr>
<td>
<div class="printhidden">
<hr />
</div>
<asp:Literal ID="litTemplate" runat="server"></asp:Literal>
</td>
</tr>
</tbody>
</table>
<div id="pagebreak" runat="server">&nbsp;</div>
</ItemTemplate>
<SeparatorTemplate>
<div style="page-break-after: always;">&nbsp;</div>
</SeparatorTemplate>
</asp:DataList>
</div>
<div class="printhidden clear">
<asp:ImageButton ID="btnContinue2" runat="server" ImageUrl="~/DesktopModules/Hotcakes/Core/Admin/Images/Buttons/Ok.png" OnClick="btnContinue2_Click" />
</div>
</asp:repeater>
</div>
<div class="printhidden clear">
<asp:ImageButton ID="btnContinue2" runat="server" ImageUrl="~/DesktopModules/Hotcakes/Core/Admin/Images/Buttons/Ok.png" OnClick="btnContinue2_Click" />
</div>

<div class="clear"></div>
</div>
<div class="clear"></div>
</div>
</asp:Content>
Original file line number Diff line number Diff line change
Expand Up @@ -141,28 +141,41 @@ private void Generate()
var id = Request.QueryString["id"];
id = id.TrimEnd(',');
var os = id.Split(',');
DataList1.DataSource = os;
DataList1.DataBind();
rpOrder.DataSource = os;
rpOrder.DataBind();
}

protected void DataList1_ItemDataBound(object sender, DataListItemEventArgs e)
protected void rpOrder_ItemDataBound(Object Sender, RepeaterItemEventArgs e)
{

if (e.Item.ItemType == ListItemType.AlternatingItem | e.Item.ItemType == ListItemType.Item)
{
long templateId = 0;
long.TryParse(TemplateField.SelectedValue, out templateId);
var t = HccApp.ContentServices.HtmlTemplates.Find(templateId);
if (t != null)
{
var orderId = (string) e.Item.DataItem;
var orderId = (string)e.Item.DataItem;
var o = HccApp.OrderServices.Orders.FindForCurrentStore(orderId);
var litTemplate = (Literal) e.Item.FindControl("litTemplate");
var litTemplate = (Literal)e.Item.FindControl("litTemplate");
if (litTemplate != null)
{
t = t.ReplaceTagsInTemplateForOrder(HccApp.CurrentRequestContext, o);
litTemplate.Text = t.Body;
}
}

var id = Request.QueryString["id"];
if (!string.IsNullOrEmpty(id))
{
var count = id.TrimEnd(',').Split(',').Length;
if (e.Item.ItemIndex != count - 1)
{
System.Web.UI.HtmlControls.HtmlGenericControl div = (System.Web.UI.HtmlControls.HtmlGenericControl)e.Item.FindControl("pagebreak");
div.Attributes.Add("style", "page-break-after: always;");
}
}

}
}
}
Expand Down
Loading