How to setup magento 2 when shipping fee is charged for each warehouse (source) - magento2

We have two questions about the shipping fee in magento2
Question 1
We are considering how to setup magento 2 when shipping fee is charged for each warehouse (source) . One type of product is basically assigned to one warehouse in our system. But, if you buy multiple types of products from different warehouses at once, the shipping fee will be the total shipping cost for each warehouse.(Also the shipping fee doesn't depend on the quantity of the products.)
For example if there is Product A (which is assigned to warehouse 1 and the shipping fee is 8$) and Product B (which is assigned to warehouse 2 and the shipping fee is $8) , the total shipping fee will be $16 when buying them at once, $8 when buying either of them.
How can we do this in magento 2?
Question 2
Since the shipping fee paid by the customer is different from the actual shipping cost, is it possible to calculate the gross profit and display them in the admin page as a report?
For example if there is Product A (assigned to warehouse 1, shipping fee paid $8, actual shipping cost $7) and Product B (assigned to warehouse 2, shipping fee paid $8, actual shipping cost $4) and bought them both at once, we want to add the shipping profit(($8-$7)+($8-$4)=$5) into the gross profit calculation and display them on the admin page.
we found some extensions and developing programmatically for magento2 which can customize then shipping fee
but couldn't find the way to change the shipping fee depending on warehouses.

Related

10413-The totals of the cart item amounts do not match order amounts

From the magento admin whenever I try to make the payment with zero subtotal and shipping chargesĀ  then it shows this error:
Field format error: 10413-The totals of the cart item amounts do not match order amounts
I need the solution to fix this.
PayPal does not process payments for zero amounts. You need to activate a zero amount payment method if you wish to be able to process such "transactions".
If the total amount is not zero, then the error indicates the various subamounts and amounts of items specified do not add up to the total correctly, which PayPal also cannot process.

Paypal Subscription : Adjustment of the amount on revised plan

In the paypal subscription, we have integrated the revised subscription feature for our system.
Subscription flow working fine, but when the user upgrade or downgrade their plans in mid of the subscription cycle, do we have any option to adjust their subscription amount?
Example :
Customer has purchased the Plan A with price $100 for 1 month recurring plan.
After 15 days, customer is upgrading to the Plan B with price $500
In that case currently no extra charge is executed by the Paypal for that 15 days, From the next payment cycle paypal will charge $500, So how can we manage that 15 days extra charge for that upgraded plan?
For the upgrade we want to manage refund for the adjustment amount and for the upgrade we want to charge extra adjustment amount.
Thank you in advance.
We did solution as below, if anyone need help for the case.
If customer purchase Plan A with price $100 and upgrade subscription to Plan B After 15 days.
So, customer used plan for 15 days and remaining 15 days amount will be return
Before moved to next plan. Previous plan's subscription will be cancel and calculated amount will be refund.
Calculation:
Charged amount = (price * plan used days) / duration (In Days)
Charged amount = ($100 * 15) / 30
Charged amount = $50
Refundable amount = Price - Charged amount
Refundable amount = $100 - $10
Refundable amount = $50
Simply we are giving refund before starting new plan and generating new subscription with new amount.
Create a new plan with a 1 month trial period for the prorated/adjusted amount you want to bill next, and a regular period for the amount you want to bill ongoing. Use this plan to revise the subscription.

Changing subscription plans and billing the difference

I am trying to implement seat based pricing but the documentation doesn't cover scenarios for changing plan mid subscription.
For reference these are the docs I am following: https://developer.paypal.com/docs/api/subscriptions/v1/
Let me give you an example. Lets say I have this pricing:
1-10 seats $5 each per month
11+ seats $3 each per month
To mimic this in PayPal I create 2 quantity based subscription plans. One with a quantity price of $5, the other for $3. Both plans are on the same product and have term set to monthly.
There are a few situations I am unsure how to handle and cannot find this information in the docs. They are as follows:
1) User signs up for 1 seat on the 1st June. On the 15th June they decide to change to 5 seats. The docs say this will be adjusted in the "next billing cycle" but I am unclear what that means. Their next billing cycle is in 15 days so does that mean they get access to 4 seats for free that month? What I would want to happen is the difference is calculated. The user has paid $5 so far and is halfway through the month so half a month cost is $2.50. The new subscription price is $25. So the remainder of the month would cost $12.50. So the difference to pay is $10 to cover them to the end of the month with the additional seats until they will then be billed $25 for a full month. Is this in anyway possible?
2) User signs ups for 5 seats. They then upgrade to 20 seats halfway through the month which moves them onto a different plan to get discounted pricing. How does situation 1 play out again in this regard when changing plans? How are the differences calculated and billed?
It seems in the old billings API you could override the setup cost when creating the subscription but that no longer seems possible. It is not possible to add the setup cost to a plan because this needs to be added dynamically based on the elapsed time in billing cycle, change in seat quantity and change in plan cost.
Have PayPal really removed all possible ways of dealing with package upgrades?
To have new arbitrary costs, setup or otherwise, you would need to dynamically create a bespoke package/plan for that particular checkout.

Websphere Commerce Maximum Order Quantity Per Order Change to All Order history and pending

I have here a Websphere commerce 7 Fp 5 Aurora B2B which is using Orgs, contracts and price lists maximum order quantity that we limit each "Store" Org to buy 3 each so that there is enough to go around. We have 3 sets of entitlements to that most guys Max is 3, better stores max is 5 and a few really good ones max qty is 10.
So we don't have to worry about allocation, these rules let every store buy based on their entitlement. When they try to put more in the cart then they should, they get a message "You are requesting to order more than your allocation limit. Please change your requested quantity." I don't know where this comes from.
Some users buy for 5 or more stores which is selected at checkout during payment. This keeps those store owners from having to have a bunch of log ins to keep track of.
We recently openned up Order Management, we call it multi-cart because this enables a store owner to create more than 1 cart by going to order management and create a new order. This makes it much easier for our store owners to manage what they are buying and paying and receiving with out having to call and email our CSR teams.
But now we noticed that some stores are taking advantage of the Multi-cart to buy more that the MAX qty they are allowed. It wouldn't be so bad, but they are buying all the 1 per customer stuff and all the other stores are calling and complaining because they didn't get their share. It really isn't fair.
I was thinking of all the different places to add a SQL check of order history and pending orders. Here is what I cam up with.
ATP - Inventory check
Pro- best place since customer, sku, entitlement, and everything else pretty much happens here. It is right up front.
Con- It doens't have ship-to, so the guys with more than 1 store need to be added as an exception leading sloppy business logic that could change regularly
OrderItemAddCmdImpl and overloading ExtendOrderItemProcessCmd
Pro - Bring ship-to selection up to the front and control everything here.
Con - Not certain overhead will like it.
At checkout
Pro - this also will have everything
Con - I kind of want to reserve this for all payment handling. It is a little dirty to read throught the order lines and to kick back error with SKU.
Have the ERP handle the exception-
Con - I realized we are setup that all Orders ship complete, we would have to change this and don't really want to because there are additional credit card penalties for charges less then amount held on credit.
So, the questions are what are your thoughts on additional pros and cons?
Are there other places that I'm missing that would make more sense?
We might need to create a new CommandTask and then append it to all existing flows.
OR
As the WebSphere Commerce team to build this new logic into the next release of WebSphere Commerce.
So, for this scenario the answer was creating a JDBC Query that will be called when items are added to cart that sums the Qty by sku of pending orders.
When orderitems are added to the cart, the query will return the item in error if exceeded and not add item.
The query will again run at checkout if all orderitems being paid for exceed total qty max by SKU by shipping address on payment page allowing chance for customer to change billing address if we are limiting item max qty by shipping address.

paypal button for buy 1 year, get 6 months free

I want to make a Paypal button for buy 1 year, get 6 months free
It's rather easy to setup a free trial period, but in that case the first billing doesn't hit until the trial period is finished. That sucks.
We want to run a promotion where the free trial period comes at the END. So they pay for a full year today, and aren't billed again for another 18 months, at which point they are billed for another year of service, and the yearly billing cycle continues from there.
Billing for the trial period of 18 months won't solve my problem because there are 3 different checkout options and the trial period applies to all of them as a whole (they are different prices).
We have 3 subscription types, and 3 promotions. So it seems like I have to make 9 different buttons to solve my problem?? How can it be done a better way?
Solved this. I just had to make a separate buttons for each. For example:
I wanted the first subscription type to pay 1 year, get 6 months free.... In Paypal I selected yearly billing for X dollars, then chose an 18 months promotion (and the cost of the promotion was set to the same cost as the regular yearly billing).
This way, we get paid from the first second, the customer still gets their "free trial" which I guess isn't technically a free trial. It's more like a 50% discount for the first 1.5 years.