upgrade related fixes
This commit is contained in:
parent
9db78c074c
commit
e3d85353e8
6 changed files with 45 additions and 13 deletions
|
|
@ -341,7 +341,12 @@ sub addVendors {
|
|||
create table vendor (
|
||||
vendorId varchar(22) binary not null primary key,
|
||||
dateCreated datetime,
|
||||
name varchar(255)
|
||||
name varchar(255),
|
||||
userId varchar(22) binary not null default '3',
|
||||
preferredPaymentType varchar(255),
|
||||
paymentInformation text,
|
||||
paymentAddressId varchar(22) binary,
|
||||
index userId (userId)
|
||||
)
|
||||
});
|
||||
$session->db->write(q{
|
||||
|
|
@ -608,6 +613,7 @@ sub upgradeEMS {
|
|||
my $ribbon = $ems->addChild({
|
||||
className => 'WebGUI::Asset::Sku::EMSRibbon',
|
||||
title => $ribbonData->{title},
|
||||
url => $ribbonData->{title},
|
||||
description => $ribbonData->{description},
|
||||
sku => $ribbonData->{sku},
|
||||
price => $ribbonData->{price},
|
||||
|
|
@ -622,6 +628,7 @@ sub upgradeEMS {
|
|||
my $badge = $ems->addChild({
|
||||
className => 'WebGUI::Asset::Sku::EMSBadge',
|
||||
title => $badgeData->{title},
|
||||
url => $badgeData->{title},
|
||||
description => $badgeData->{description},
|
||||
sku => $badgeData->{sku},
|
||||
price => $badgeData->{price},
|
||||
|
|
@ -645,6 +652,7 @@ sub upgradeEMS {
|
|||
my $ticket = $ems->addChild({
|
||||
className => 'WebGUI::Asset::Sku::EMSBadge',
|
||||
title => $ticketData->{title},
|
||||
url => $ticketData->{title},
|
||||
description => $ticketData->{description},
|
||||
sku => $ticketData->{sku},
|
||||
price => $ticketData->{price},
|
||||
|
|
@ -666,13 +674,13 @@ sub upgradeEMS {
|
|||
$oldBadgeRegistrants{$registrantData->{badgeId}} = $registrantData->{productId};
|
||||
}
|
||||
elsif ($id ne "") {
|
||||
$db->write("insert into EMSRegistrantTicket (badgeId,ticketAssetId,purchaseComplete) values (?,?,1)",
|
||||
$db->write("replace into EMSRegistrantTicket (badgeId,ticketAssetId,purchaseComplete) values (?,?,1)",
|
||||
[$registrantData->{badgeId}, $id]);
|
||||
}
|
||||
else {
|
||||
my $id = $oldRibbons{$registrantData->{productId}};
|
||||
if ($id ne "") {
|
||||
$db->write("insert into EMSRegistrantRibbon (badgeId,ribbonAssetId) values (?,?)",
|
||||
$db->write("replace into EMSRegistrantRibbon (badgeId,ribbonAssetId) values (?,?)",
|
||||
[$registrantData->{badgeId}, $id]);
|
||||
}
|
||||
}
|
||||
|
|
@ -722,7 +730,7 @@ sub convertTransactionLog {
|
|||
orderNumber int not null auto_increment unique,
|
||||
transactionCode varchar(100),
|
||||
statusCode varchar(35),
|
||||
statusMessage varchar(100),
|
||||
statusMessage varchar(255),
|
||||
userId varchar(22) binary not null,
|
||||
username varchar(35) not null,
|
||||
amount float,
|
||||
|
|
@ -787,6 +795,7 @@ sub convertTransactionLog {
|
|||
my $transactionResults = $db->read("select * from oldtransaction order by initDate");
|
||||
while (my $oldTranny = $transactionResults->hashRef) {
|
||||
my $date = WebGUI::DateTime->new($session, $oldTranny->{initDate});
|
||||
my $u = WebGUI::User->new($session, $oldTranny->{userId});
|
||||
$db->setRow("transaction","transactionId",{
|
||||
transactionId => "new",
|
||||
isSuccessful => (($oldTranny->{status} eq "Completed") ? 1 : 0),
|
||||
|
|
@ -797,11 +806,27 @@ sub convertTransactionLog {
|
|||
username => WebGUI::User->new($session, $oldTranny->{userId})->username,
|
||||
amount => $oldTranny->{amount},
|
||||
shippingPrice => $oldTranny->{shippingCost},
|
||||
shippingAddress1 => $u->profileField('homeAddress'),
|
||||
shippingCity => $u->profileField('homeCity'),
|
||||
shippingState => $u->profileField('homeState'),
|
||||
shippingCode => $u->profileField('homeZip'),
|
||||
shippingCountry => $u->profileField('homeCountry'),
|
||||
shippingAddressName => $u->profileField('firstName').' '.$u->profileField('lastName'),
|
||||
shippingPhoneNumber => $u->profileField('homePhone'),
|
||||
paymentAddress1 => $u->profileField('homeAddress'),
|
||||
paymentCity => $u->profileField('homeCity'),
|
||||
paymentState => $u->profileField('homeState'),
|
||||
paymentCode => $u->profileField('homeZip'),
|
||||
paymentCountry => $u->profileField('homeCountry'),
|
||||
paymentAddressName => $u->profileField('firstName').' '.$u->profileField('lastName'),
|
||||
paymentPhoneNumber => $u->profileField('homePhone'),
|
||||
dateOfPurchase => $date->toDatabase,
|
||||
isRecurring => $oldTranny->{recurring},
|
||||
}, $oldTranny->{transactionId});
|
||||
my $itemResults = $db->read("select * from oldtransactionitem where transactionId=?",[$oldTranny->{transactionId}]);
|
||||
while (my $oldItem = $itemResults->hashRef) {
|
||||
my $status = $oldItem->{shippingStatus};
|
||||
$status = 'NotShipped' if $status eq 'NotSent';
|
||||
$db->setRow("transactionItem","itemId",{
|
||||
itemId => "new",
|
||||
transactionId => $oldItem->{transactionId},
|
||||
|
|
@ -809,7 +834,7 @@ sub convertTransactionLog {
|
|||
options => '{}',
|
||||
shippingTrackingNumber => $oldTranny->{trackingNumber},
|
||||
orderStatus => $oldTranny->{shippingStatus},
|
||||
lastUpdated => $oldTranny->{completionDate},
|
||||
lastUpdated => $date->toDatabase,
|
||||
quantity => $oldItem->{quantity},
|
||||
price => $oldItem->{amount},
|
||||
vendorId => "defaultvendor000000000",
|
||||
|
|
@ -1164,6 +1189,7 @@ sub mergeProductsWithCommerce {
|
|||
my $sku = $productFolder->addChild({
|
||||
className => 'WebGUI::Asset::Sku::Product',
|
||||
title => $productData->{title},
|
||||
url => $productData->{title},
|
||||
sku => $productData->{sku},
|
||||
description => $productData->{description},
|
||||
}, $productData->{productId});
|
||||
|
|
|
|||
|
|
@ -419,6 +419,7 @@ our $HELP = {
|
|||
},
|
||||
{
|
||||
name => 'username',
|
||||
description => 'username help',
|
||||
},
|
||||
{
|
||||
name => 'shopCreditDeduction',
|
||||
|
|
@ -545,6 +546,7 @@ our $HELP = {
|
|||
},
|
||||
{
|
||||
name => 'price',
|
||||
description => 'price help',
|
||||
},
|
||||
{
|
||||
name => 'itemShippingAddress',
|
||||
|
|
@ -654,6 +656,7 @@ our $HELP = {
|
|||
},
|
||||
{
|
||||
name => 'username',
|
||||
description => 'username help',
|
||||
},
|
||||
{
|
||||
name => 'shopCreditDeduction',
|
||||
|
|
|
|||
|
|
@ -1024,7 +1024,6 @@ sub www_view {
|
|||
<tbody>
|
||||
};
|
||||
foreach my $item (@{$transaction->getItems}) {
|
||||
my $sku = $item->getSku;
|
||||
$output .= WebGUI::Form::formHeader($session)
|
||||
.WebGUI::Form::hidden($session, {name=>"shop",value=>"transaction"})
|
||||
.WebGUI::Form::hidden($session, {name=>"method",value=>"updateItem"})
|
||||
|
|
@ -1033,7 +1032,7 @@ sub www_view {
|
|||
.q{
|
||||
<tr>
|
||||
<td>}.$item->get('lastUpdated').q{</td>
|
||||
<td><a href="}.$sku->getUrl('shop=transaction;method=viewItem;transactionId='.$transaction->getId.';itemId='.$item->getId).q{">}.$item->get('configuredTitle').q{</a></td>
|
||||
<td><a href="}.$url->page('shop=transaction;method=viewItem;transactionId='.$transaction->getId.';itemId='.$item->getId).q{">}.$item->get('configuredTitle').q{</a></td>
|
||||
<td>}.$transaction->formatCurrency($item->get('price')).q{</td>
|
||||
<td>}.$item->get('quantity').q{</td>
|
||||
};
|
||||
|
|
|
|||
|
|
@ -132,8 +132,12 @@ Returns an instanciated WebGUI::Asset::Sku object for this item.
|
|||
sub getSku {
|
||||
my ($self) = @_;
|
||||
my $asset = WebGUI::Asset->newByDynamicClass($self->transaction->session, $self->get("assetId"));
|
||||
$asset->applyOptions($self->get("options"));
|
||||
return $asset;
|
||||
if (defined $asset) {
|
||||
$asset->applyOptions($self->get("options"));
|
||||
return $asset;
|
||||
}
|
||||
WebGUI::Error::ObjectNotFound->throw(error=>'SKU Asset '.$self->get('assetId').' could not be instanciated. Perhaps it no longer exists.', id=>$self->get('assetId'));
|
||||
return undef;
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
|
|
|||
|
|
@ -1053,7 +1053,7 @@ our $I18N = {
|
|||
context => q|Template variable for email receipt template|,
|
||||
},
|
||||
|
||||
'username' => {
|
||||
'username help' => {
|
||||
message => q|The name of the user who performed this transaction, to save you a username lookup.|,
|
||||
lastUpdated => 1213132212,
|
||||
context => q|Template variable for email receipt template|,
|
||||
|
|
@ -1227,7 +1227,7 @@ our $I18N = {
|
|||
context => q|Template variable for email receipt template|,
|
||||
},
|
||||
|
||||
'price' => {
|
||||
'price help' => {
|
||||
message => q|The price of this item, formatted to two decimal places.|,
|
||||
lastUpdated => 1213135218,
|
||||
context => q|Template variable for email receipt template|,
|
||||
|
|
|
|||
|
|
@ -276,8 +276,8 @@ STOP
|
|||
sub checkVersion {
|
||||
$_[0] =~ /(\d+)\.(\d+)\.(\d+)/;
|
||||
my $goal = 7;
|
||||
my $feature = 4;
|
||||
my $fix = 21;
|
||||
my $feature = 3;
|
||||
my $fix = 22;
|
||||
if ($1 > $goal) {
|
||||
return 1;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue