Browse Source

Fixed the subscription date display bug in the shop.

netuttki 1 year ago
parent
commit
6bf5eeac77
2 changed files with 8 additions and 6 deletions
  1. 6 4
      locations/internet_mobile.qsrc
  2. 2 2
      locations/shop.qsrc

+ 6 - 4
locations/internet_mobile.qsrc

@@ -34,7 +34,7 @@ subscription[<plan nam>-type]       The type of the subscription.
 Plan Names
 
 free:           A subscription that is freely available, libraries, friends and lovers apartment, etc. that has a computer.
-                The value of this plan is always 1 and the subscription_date is 0.
+                The value of this plan is always 1 and the subscription date is 0.
 
 mobile:         Mobile telephone (only internet or calls too?) and laptop if taken somewhere else. 
                 If at a location where subscription['free'] is used, she has to ask first to be able to use her own laptop
@@ -172,7 +172,7 @@ if $ARGS[0] = 'transfer_subscription':
     allowed = allowed and func('internet_mobile', 'check_allowed_location', $ARGS[2])
     if allowed:
         subscription[$ARGS[2]] = subscription[$ARGS[1]]
-        subscription_date['<<ARGS[2]>>-date'] = subscription['<<$ARGS[1]>>-date']
+        subscription['<<ARGS[2]>>-date'] = subscription['<<$ARGS[1]>>-date']
         subscription['<<ARGS[2]>>-price'] = subscription['<<$ARGS[1]>>-price']
         subscription['<<ARGS[2]>>-discount'] = subscription['<<$ARGS[1]>>-discount']
         !! This one is always 1 because only type 1 subscriptions can be transferred, but making it "future proof"
@@ -287,7 +287,8 @@ if $ARGS[0] = 'send_sms':
 end
 
 !! Using the internet - if metered, it lowers the minutes left
-!! $ARGS[1] - the name of the subscription used
+!! $ARGS[1] - the name of the subscription used (this could be completely unnecessary, at this point there is an active
+!!                                               $access which holds the subscription used.)
 !! ARGS[2] - the number of minutes used
 if $ARGS[0] = 'use_internet':
     if $subscription['<<$ARGS[1]>>-type'] = 'metered': 
@@ -300,7 +301,8 @@ end
 !! but monthly subscription can end abruptly too if she did not pay.
 !! Use it as a func() returns 1 or 0 based on the subscription[$ARGS[1]]  value
 !!
-!! $ARGS[1] - the name of the subscription
+!! $ARGS[1] - the name of the subscription (this could be completely unnecessary, at this point there is an active
+!!                                          $access which holds the subscription used.)
 if $ARGS[0] = 'check_internet_access':
     if subscription[$ARGS[1]] > 0: result = 1
 end

+ 2 - 2
locations/shop.qsrc

@@ -607,7 +607,7 @@ if $shoplocation = 'megafon':
 	elseif home['internet_enabled'] = 0:
 		$line = '<tr><td align="center">You can''t buy an internet subscription for <<$home[''display'']>></td></tr>'
 	elseif subscription[$home['current']] = 1:
-		$line = '<tr><td align="center">You have an active internet subscription at <<$home[''display'']>> that will renew next month on day <<subscription[''<<$home[current]>>-date'']>> for <<price>> <b>₽</b></td></tr>'
+		$line = '<tr><td align="center">You have an active internet subscription at <<$home[''display'']>> that will renew next month on day <<subscription[''<<$home[''current'']>>-date'']>> for <<price>> <b>₽</b></td></tr>'
 	else
 		$line = '<tr><td style="padding-left: 10px; padding-right: 10px; align: left; ">Monthly internet subscription for <<price>><b>₽</b> at your <<$home[''display'']>>. Automatically renews every month</td>'
 		if bankAccount = 0:
@@ -748,7 +748,7 @@ if $shoplocation = 'megafon':
 	$title = '<center><h4>Mobile Calls and Texts</h4></center>'
 	price = 800
 	if subscription['monthly_calls'] = 1:
-		$line += '<tr><td align="center">You have an active mobile subscription that will renew next month on day <<subscription_date[''monthly_calls'']>> for <<price>> <b>₽</b></td></tr>'
+		$line += '<tr><td align="center">You have an active mobile subscription that will renew next month on day <<subscription[''monthly_calls-date'']>> for <<price>> <b>₽</b></td></tr>'
 	else
 		if subscription['metered_calls'] > 0:			
 			discount = subscription['metered_calls'] / 2