Magento remove reward points on Credit Memo - magento

when we credit memo an order the reward points are not being removed – is there a way to set this so it does remove the points when a credit is processed?
Thanks

You will need to deal with the reward points manually since there is no way to have this work automatically. The customer may already have used the credit points by the time of your refund.

Related

Fees , Reward and Staking in Near

Can any one help me understand
What happens to the fees of each transactions ? Does fees become part of the reward ?
When does the reward gets distributed . Is there any specific timeperiod. Can you please point me to couple of examples in explorer where reward is distribuited.
i got this docs for Reward - https://nomicon.io/Economics/README.html#rewards-calculation
coinbaseReward[t] The maximum inflation per epoch[t], as a function of REWARD_PCT_PER_YEAR / EPOCHS_A_YEAR
where can i get REWARD_PCT_PER_YEAR and EPOCHS_A_YEAR. Does it remain fixed for ceratin range of blocks
epochReward[t] = coinbaseReward[t] + epochFee[t]
epochFee[t] - does this mean fees of all transactions happened in an epoch .
Can i have some staking transactions from explorer if any
Sure,
I had exactly the same questions and came out with a doc.
In a few words:
Fees are burnt, they do not become a part of validators reward, though part of the fees of function calls and cross-contract function calls become a royalty reward to contract accounts.
Reward tokens are minted every epoch (something about every 12 hours) and gone to staking pools.
Please check the doc for the examples, I covered all possible situations of balance changing with all numbers and explanation what is going on.
UPD by the way, it's true, there is no information about royalties in Nomicon, we created the issue for that

Find combination of bank notes for particular sum

How to issue money efficiently. For example if you have 1 bank note of 100$, 1 bank note of 50$ and 2 bank notes of 30$. How to determine that we need 50$ and two of 30$ to achieve 110$ summary.
In other words, we have fixed number of bank note types: 30$ (two bank notes), 50$ (one bank note), 100$ (one bank note). The problem is to determine which bank notes we should take to get a particular sum, for example, 110$? In this case we should take two 30$ bank notes and one 50$ bank note.
We can't use greedy algorithm here because if we take 100$ bank note first, then we can't achieve 110$ summary.
Which data structure do we need to use for storing bank notes? Simply quantity of each bank note type or may be an array to store each bank note: [100, 50, 30, 30]
And what is the algorithm to find which bank notes do we need to get a particular sum?
You can use dynamic programming approach. You keep an array, where index is reachable sum, and value - bill number, by which this sum is reached.
This approach is used in the Emercoin transaction optimizer.
See source code at:
https://github.com/Emercoin/emercoin/blob/master/src/wallet.cpp#L1112
Memory is O(Sum); Time is O(Sum * NumBills);
See short article about it:
http://cointelegraph.com/news/emercoin-implements-solution-to-reduce-blocksize-inflation
See my solution in this question Coin Change Problem
Also for such kind of problem, the hard part is always to determine if the coin / money system is canonical i.e. Can use greedy algorithm

Unable to generate Credit Memo in magento

I am trying to generate a credit memo i have two question.
Whenever i try to create credit memo by pressing refund offline button it show error lik e"Maximum amount available to refund is $XXX" no matter what i fill in.![enter image description here][1]
What is the difference between adjustment refund and adjustment fee. All i understand is if we want to deduct some amount as processing fee we can write under adjustment refund then that amount will get deducted from total paid. But what is then refund adjustment for??
Attached screen shot
1. "https://imageshack.com/i/nhs8s7p"
2. "http://imageshack.com/a/img534/8696/3t2e.png"
Adjustment Refund: Amount to be added on the total amount refunded.
Adjustment Fee: Amount to be subtracted from the total amount refunded.
Take example your customer bought 2 chocolate each costing $5. However he/she wants to return one. In that case you have to return $5 which is correct mathematically (and this is what default magneto calculation shows you). But, you can change mind as business man, like
If you feel to giving return $6, write $1 in Adjustment Refund.
If you feel to give return $4, write $1 in Adjustment Fee.
"Maximum amount available to refund is $XXX" means you can not refund more than $10. In above example, you can not write more than $5 in Adjustment Refund.
Make sense? If yes, please mark answer as accepted.
Thanks

What's the best design in tracking the remaining inventory of a product in a store

Sorry if the title is confusing, I'll just try to describe here I want to achieve.
I want to optimize my database design that handles delivery, and ending inventory. Delivery is done anytime of the week and is group by week number, orders can be done anytime of the day; orders quantity are then subtracted to the total no of delivery per week to get the ending inventory. What's the best database design for this, and programming approach?
What I have:
Deliveries table with quantity, weekNo, weekYr
Orders table with quantity, weekNo, weekYr
Everytime I want to get the ending inventory I will get and group the data base on weekYr and weekNo and subtract total Deliveries quantity minus Orders quantity. But my problem is the ending inventory will be carried out to the next week. What's the best and optimized way to do it?
Thanks,
czetsuya
Your current approach seems sound to me, so you might clarify what the actual problem is. Your last sentence is confusing--does the product spoil at the end of the week? It's not clear why you would need to group by week at all. If you get 100 products via delivery, and sell 10 products per week for the next three weeks, you have 70 products left.
My best guess is you have a case where there are other factors to consider besides the simple math of what was received minus what was sold. Perhaps you lose inventory due to spoilage (maybe you sell some sort of food) or shrinkage (maybe you sell retail goods that get stolen). One solution would be to have a separate table called "shrinkage" or "spoilage" that also gets subtracted out of deliveries to arrive at your actual inventory. Of course, this table will need to be updated as product is removed from the shelves due to spoilage, or when the shrinkage is realized.

Best Fit Scheduling Algorithm for Accommodation / Day Pass Problem?

I have a scheduling problem I'm trying to figure out a best fit algorithm to use.
A hotel owns a theme park and is a highlight for visitors staying at the hotel. However, the hotel has more rooms than day passes for visitors wanting to go to the theme park. So during the peak months, there is a possibility that some will not get to go to the theme park.
We want to have every visitor given at least 1 chance to visit the theme park.
If there is contention, we would want to favour giving the day pass to visitors who stay longer at the hotel.
Can anyone point me in the right direction on which algorithm will fit the problem best?
No this is not homework. :)
Thanks in advance.
You can use Priority Queue (PQ). Every day you put customers in your (PQ) computing the priority as p = 1/r where r is the number of remaining days for that guest in your hotel. In this way, every day you give away your n passes to the n customers who have fewer days to stay at your hotel (if a customer has just 1 more day to stay, she/he must have the highest priority in getting the pass, because there just one possibility). If you have several customers with equal p then you choose among them by looking at the total number of days that they stay at your hotel, and you favour those customers staying longer.
You can assign each guest a weight, or priority, according to length of stay (and maybe the number of days the guy's been a guest already without a pass) and then sort the guests by priority. Then it should be easy to give out passes just starting at the top of the sorted list.
You can use a priority queue for this. The priority queue has to be arranged based on the number of chances and number of days the visitors are staying.

Resources