Help with logic

  

Hi I'm hoping someone can help with a little bit of logic I can't figure out. 


I have been developing a eCommerce web app (started with the forge eCommerce app), what I've been stuck on for a few days is:

The system is set up so that a customer will go in a purchase various items that are for sale. These items will be from various supplier which I have added as an attribute in the "Product" Entity 


Once a customer has created a purchase order and paid, I need to create individual sales orders/invoices to be sent to the supplier. This is where I'm stuck, how can I build a piece of logic to look through the DISTINCT companies, and then create a new invoice for each company that has an item in a purchase order?

HI Talis,

I dont think its very difficult, as per my understanding every product should have a supplier\company associated to it. You just need to loop through the list get the supplier details and create a sales order.

Also if there are more than one supplier for same product than you have to put some algorithm to select the most appropriate supplier based on his last performance.


Regards

-PJ-

-PJ-

Pramod Jain wrote:

HI Talis,

I dont think its very difficult, as per my understanding every product should have a supplier\company associated to it. You just need to loop through the list get the supplier details and create a sales order.

Also if there are more than one supplier for same product than you have to put some algorithm to select the most appropriate supplier based on his last performance.


Regards

-PJ-

-PJ-


Hi PJ,


I'm sure it's super easy, but I'm a bit of a newby to this, so the way I usually learn something that I don't know is i find something very similar then I just modify it a bit. But I've not done anything like this before so I have nothing to reference. Have you developed any similar logic I could look at a see how it works? or I could share my OML and you could point me in the right direction, or any other resource would be super helpful.

Sure,Please share the oml ..i will look into it and try to help you.



Reagrds

-PJ-

Pramod Jain wrote:

Sure,Please share the oml ..i will look into it and try to help you.



Reagrds

-PJ-



Talis Krumins wrote:

Pramod Jain wrote:

Sure,Please share the oml ..i will look into it and try to help you.



Reagrds

-PJ-



Thank you, you will find in tradequotes>logic>cart>create supplier invoice, I've started creating a bit of logic, I've really only got as far as running the SQL to identify the distinct suppliers in the purchase order. Let me know if you have any questions. I really appreciate your help!! 


HI Talis,

Saw your oml ..one thing i want to ask you .

Your Invoice entity have PurchaseOrderId, PurchaseOrderLineId and CustomerId that means you have to make one entry in this table for each PurchaseOrderLineId with customerId and PurchaseOrderId so why do you want to get Distinct supplier id here.

I can solve it real quick if i understand what exactly you are looking for . My skypeid is pramod.jain82 if you wish to connect.



Regards

-PJ-

Pramod Jain wrote:

HI Talis,

Saw your oml ..one thing i want to ask you .

Your Invoice entity have PurchaseOrderId, PurchaseOrderLineId and CustomerId that means you have to make one entry in this table for each PurchaseOrderLineId with customerId and PurchaseOrderId so why do you want to get Distinct supplier id here.

I can solve it real quick if i understand what exactly you are looking for . My skypeid is pramod.jain82 if you wish to connect.



Regards

-PJ-

Hi PJ,


It's completely possible I'm not setting things up correctly for what I want to do. Essentially what I want to do it; once a customer completes their order, then I will need to send an email off to each supplier the customer has ordered from. So what I was trying to do was create an invoice for each supplier, which will have the customers purchasedorderline's, that are owned by that company. Does this make sense?



Pramod Jain wrote:

HI Talis,

Saw your oml ..one thing i want to ask you .

Your Invoice entity have PurchaseOrderId, PurchaseOrderLineId and CustomerId that means you have to make one entry in this table for each PurchaseOrderLineId with customerId and PurchaseOrderId so why do you want to get Distinct supplier id here.

I can solve it real quick if i understand what exactly you are looking for . My skypeid is pramod.jain82 if you wish to connect.



Regards

-PJ-

HI PJ,


I don't mean to be pestering you, I just hope you haven't forgot about me, did what I say make sense, or do you need more info?