Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -248,13 +248,31 @@ codeunit 30106 "Shpfy Upgrade Mgt."
Shop.SetRange("Customer Posting Group", '');
if Shop.FindSet(true) then
repeat
Shop.CopyPriceCalculationFieldsFromCustomerTempl(Shop."Customer Templ. Code");
Shop.Modify();
CopyPriceCalculationFieldsFromCustomerTempl(Shop, Shop."Customer Templ. Code");
until Shop.Next() = 0;

UpgradeTag.SetUpgradeTag(GetPriceCalculationUpgradeTag());
end;

local procedure CopyPriceCalculationFieldsFromCustomerTempl(var Shop: Record "Shpfy Shop"; TemplateCode: Code[20])
var
CustomerTempl: Record "Customer Templ.";
begin
if TemplateCode = '' then
exit;
if not CustomerTempl.Get(TemplateCode) then
exit;
Shop."Gen. Bus. Posting Group" := CustomerTempl."Gen. Bus. Posting Group";
Shop."VAT Bus. Posting Group" := CustomerTempl."VAT Bus. Posting Group";
Shop."Tax Area Code" := CustomerTempl."Tax Area Code";
Shop."Tax Liable" := CustomerTempl."Tax Liable";
Shop."VAT Country/Region Code" := CustomerTempl."Country/Region Code";
Shop."Customer Posting Group" := CustomerTempl."Customer Posting Group";
Shop."Prices Including VAT" := CustomerTempl."Prices Including VAT";
Shop."Allow Line Disc." := CustomerTempl."Allow Line Disc.";
Shop.Modify();
end;

local procedure LoggingModeUpgrade()
var
Shop: Record "Shpfy Shop";
Expand Down
19 changes: 1 addition & 18 deletions src/Apps/W1/Shopify/App/src/Base/Tables/ShpfyShop.Table.al
Original file line number Diff line number Diff line change
Expand Up @@ -527,6 +527,7 @@ table 30102 "Shpfy Shop"
Caption = 'Allow Line Disc.';
ToolTip = 'Specifies if line discount is allowed while calculating prices for Shopify.';
DataClassification = CustomerContent;
InitValue = true;
}
field(62; "Customer Templ. Code"; Code[20])
{
Expand Down Expand Up @@ -1080,24 +1081,6 @@ table 30102 "Shpfy Shop"
GLAccount.TestField(Blocked, false);
end;

internal procedure CopyPriceCalculationFieldsFromCustomerTempl(TemplateCode: Code[20])
var
CustomerTempl: Record "Customer Templ.";
begin
if TemplateCode = '' then
exit;
if not CustomerTempl.Get(TemplateCode) then
exit;
Rec."Gen. Bus. Posting Group" := CustomerTempl."Gen. Bus. Posting Group";
Rec."VAT Bus. Posting Group" := CustomerTempl."VAT Bus. Posting Group";
Rec."Tax Area Code" := CustomerTempl."Tax Area Code";
Rec."Tax Liable" := CustomerTempl."Tax Liable";
Rec."VAT Country/Region Code" := CustomerTempl."Country/Region Code";
Rec."Customer Posting Group" := CustomerTempl."Customer Posting Group";
Rec."Prices Including VAT" := CustomerTempl."Prices Including VAT";
Rec."Allow Line Disc." := CustomerTempl."Allow Line Disc.";
Rec.Modify();
end;

local procedure EnableShopifyLogRetentionPolicySetup()
var
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ table 30152 "Shpfy Catalog"
Caption = 'Allow Line Disc.';
DataClassification = CustomerContent;
ToolTip = 'Specifies if line discount is allowed while calculating prices for the catalog.';
InitValue = true;
}
field(16; "Sync Prices"; Boolean)
{
Expand Down
Loading