package IIb02f8d3064e235967de5c537b3e7ce9b::mod_coupon; use strict; use II535843728d21206bdd21a2a084373080; use II830e9425c77da48deab79750d2477711; sub cfgEditCtime { 0 } sub createAllForSale { my $class = shift; my ($dlv_class, $sale) = @_; my $prod = $sale->getProduct; return unless $prod->{dlv_coupons}; for my $coupon_id (split(',', $prod->{dlv_coupons})) { my $coupon = IIb39071a48a82a07eeb9256f406abebc5::IIllIIIIIIlIIlII($II982446f8950cc3dc59e487adba22df54::lIIIIIIIIIlIIlIl{$II8dae0e141ee45f5daba6a74e4a7c3b6f::IIIlIIlllIIlIlII},16,$II982446f8950cc3dc59e487adba22df54::lIIIIIIIIIlIIlIl{$II720d6e18aa34327713eb014408fc9144::IllIllIIlIIIIlIl})->get($coupon_id); return unless $coupon->stored; my $hidden = $coupon->copy; $hidden->set( hidden => 1, parent_coupon_id => $coupon_id, coupon => IIb39071a48a82a07eeb9256f406abebc5::llllIIIIllllllIl($II8dae0e141ee45f5daba6a74e4a7c3b6f::IIlllIIIlIIIlIlI{$II720d6e18aa34327713eb014408fc9144::lIIIIIlIIIlIIIII},1020,$II8dae0e141ee45f5daba6a74e4a7c3b6f::IIlllIIIlIIIlIlI{$II720d6e18aa34327713eb014408fc9144::IIIIIIllIIlllIIl})->generate, valid_from => undef, valid_until => undef, )->save; $dlv_class->create($sale->getUser, 'coupon', $hidden->id, $sale->getValidUntilDate, $sale->{id}); } return; } sub save { my $class = shift; my $dlv_object = shift; return; } sub delete { my $class = shift; my $dlv_object = shift; $class->getStoreObject($dlv_object)->delete; return; } sub activateDlv { my $class = shift; my $dlv_object = shift; $class->getStoreObject($dlv_object)->set(active => 1)->save; return; } sub deactivateDlv { my $class = shift; my $dlv_object = shift; $class->getStoreObject($dlv_object)->set(active => 0)->save; return; } sub deleteDlv { my $class = shift; my $dlv_object = shift; $class->deactivateDlv($dlv_object); return; } sub getStoreObject { my $class = shift; my $dlv_object = shift; II982446f8950cc3dc59e487adba22df54::IIllllIlIIllIIII($IIb39071a48a82a07eeb9256f406abebc5::lllllIlIlllIllIl{$II8dae0e141ee45f5daba6a74e4a7c3b6f::IIIIlIIlIIIIIIIl},16,$IIb39071a48a82a07eeb9256f406abebc5::lllllIlIlllIllIl{$IIb39071a48a82a07eeb9256f406abebc5::llIlIllllIIIlIIl})->getOrDummy($dlv_object->{obj_id}); } sub getTitle { my $class = shift; my $dlv_object = shift; my $coupon = II720d6e18aa34327713eb014408fc9144::IIlllllIlllIIIIl($IIb39071a48a82a07eeb9256f406abebc5::IIIIIIIlllIlIIlI{$II8dae0e141ee45f5daba6a74e4a7c3b6f::lIIIIIIIllIIIIIl},16,$IIb39071a48a82a07eeb9256f406abebc5::IIIIIIIlllIlIIlI{$II982446f8950cc3dc59e487adba22df54::IllIIllIIIIlIIll})->getOrDummy($dlv_object->{obj_id}); $coupon->getDiscountText . ": $coupon->{coupon}"; } 1; 