create rules trade prices for over 200 - magento-1.7

Hi just got to say you are all life savers you know so much.
Ok got a store 1.72 magento and all working ok so I assign a registered person to Trade and they get all the trade prices for trade group for each product.
Problem is or should I say haven't been able to work out.
How do I create this so up to £200 subtotal they get standard prices over gets trade, to stop people buying one top at a time.
I see the discount amount from subtotal but as products they select are random wouldn't be able to calculate that.

Related

Creating ERD and Relational Schema

I wanna know how to make an ERD OR Relationship Scheme out of this. I've been practicing ERD's but this one is really confusing the hell out of me.
This is what I could make out of the narrative currently but not exactly sure how correct I am.
The owner/manager of SCBD, gives you the following information: SCBD conduct a number of
different tours to known microbrewery regions around Victoria. Each Daytrip has an ID, and a
description, and may run many times in a year (such as the West Daytrip). Frequency depends
on the season and the specific daytrip.. Each time it is run it is called an ‘Event’. Each event has
a fee. Fees have usually increased by around 10% each year. SCBD have a number of
customers. Each customer has a name, ID and gender. SCBD customers make bookings for
daytrip events. Payment is made by credit card. (you do not have to worry about recording
credit card details etc.). The date that a booking is made is also recorded.

"Anylogic" Inventory management

I want to simulate a hospital. A patient(disease is illustrated with color) arrives at the hospital, and the doctor needs a medical cart to treat patient.
The medical cart have four different item categories. Three of the item categories relates to the color of the patient and one item category is used at every patient.
When a patient arrives a certain amount of the medical cart gets drained, until it reaches a certain inventory level and the cart is transferred to a location to be filled up. For instance blue patient arrives and blue stock is lowered along with the general stock. If there is three blue patients in a row the carts needs is send to be refilled even though it still have stock for other patients.
An full example of the thinking: There are 40 carts available-each with medicin etc. for 4 blue patients, 3 green,2 red and 10 general. If first four patients are blue the carts needs to be refilled and a new cart is activated.
So the patient flow is described with discrete modeling using the processes modeling librabry, but I cant quite figure out how to create the medical carts in a way such as the inventory levels depend on the number of patients that arrives and at a certain level be filled up. Should I use agent based or system dynamic modelling or continue with discrete modeling?
Your Cart MUST be a resource that is seized by the doctor... When you release the cart you create a selectOutput asking the question if the cart is filled or not with the necessary items... If it's not it goes refill as you can see in the following image:
Now to ask the "itemsMissing" question... you need your resource to be a Cart agent with one variable for each item that keeps count of how many items remain.
This is what I would do... but you need to investigate probably how the release block works with the resource task end block, which is something I can't teach here, so you will have to investigate the help documentation if you don't know.... And probably you will have to adapt this example to your particular case.

How to get P&L on a trade through Interactive Brokers TWS Java API

Is there any way to get Profit and Loss(daily & total till date) on a particular trade made on IB TWS through its Java API?
You can, but not in the way you seem to be asking. All profit and loss in the API is calculated by you until the trade is closed and then you can use the commissionReport method of the wrapper. A commissionReport is sent after every execDetails. API doc
You can always check your statements for previous profits and losses.
The flow is like this.
place trade and get fill price from execDetails
get opening commission from commissionReport
on every tick calculate open position profit, use bid/ask for realism, but it's all forex has anyway
close trade and get price from execDetails
get commission from commissionReport again
calculate closed trade profit/loss
also note that commissionReport has a field m_realizedPNL you can use, but I've never tried it.
In the TWS v9.72+ API there is a reqPnl method on the EClient which can be used to subscribe to real-time PnL (unrealized and realized) updates for a full portfolio via the associated method on the EWrapper
https://interactivebrokers.github.io/tws-api/classIBApi_1_1EClient.html#a0351f22a77b5ba0c0243122baf72fa45
Additionally, for a single contractID, you can use: reqPnLSingle on the Client.
https://interactivebrokers.github.io/tws-api/interfaceIBApi_1_1EWrapper.html#aebeb008f2b763d7bed2969b66bbd1b33
you may presubmit the order, to see all calculations, like the commission and margin impact of the order.
to do that, set whatIf=True in the order definition.
you'll then receive openOrder events, with all the calculations made for you.

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.

woocommerce subscription free trail text

I'm trying to setup woocommerce subscriptions so that all paypal standard payments fall on the same day by using the free trial feature.
But the problem I'm having is changing the text when this feature is used so the customer doesn't get confused.
At the moment on the product page is says "£24.95 / month with a 2-day free trial" when ideally it needs to say "£24.95 / month starting in 2 days" or similar
In the cart is says "A 2-day free trial then £24.95 / month" when I would like it to say "A £24.95 / month starting in 2 days" or similar
And lastly when the customer gets taken to PayPal's secure servers is says under terms "Free for the first 2 days. Then £24.95 GBP for each month" when I would like this changed to "£24.95 GBP for each month starting in 2 days time" or similar
Would anyone know if there are any filter hooks I can use to get the desired effect, or if there is anything else I can do?
The site only has one product so I hope it's going to be straight forward.
Thanks in advance.
The 'woocommerce_subscriptions_product_price_string' filter can be used to customise the price displayed for a product.
The 'woocommerce_subscription_price_string' filter can be used to customise the cart/order prices displayed in the cart and on an order.
For examples of how to build your price strings and details of the parameters passed to each filter, view the source of the WC_Subscriptions_Product::get_price_string() and WC_Subscriptions_Manager::get_subscription_price_string() functions. I always try to write self-documenting code & include PHPDoc for anything that is not self evident.
Hope that helps. :)