Breaking up a single page with both cash sales and cash refunds between2 flows
I have a scenario which I am trying to solve. I am getting sent an "exchange" transaction from the POS system that I have to convert to NetSuite cash sales and cash refunds to handle them correctly. The system currently handles sales and refunds correctly when the transaction is one or the other. I have 2 flows - one for cash sales and one for cash refunds. The cash sale is first and has a filter that "keeps" the sales and passes the refunds off to the next flow - which works correctly. With the incoming exchange transaction, I will always have both a sale and a refund that I will need to post separately in NetSuite - as they are done now. The initial data is received via a webhook that then uses a transform to correctly format the data for the NetSuite posts. The transformation lets me use simple import mappings for both the sale and refund. I have taken an exchange transaction and created the correct mapping, which makes both a sale and refund transaction. Here is the flow:
I thought about altering my filter from the CO listener, but it only returns a boolean value. I can create a presave hook to do anymore code changes, but I still need to split the one transaction into 2 or be able to process the sale and then pass the refund on to the final destination. Any help would be greatly appreciated.
-
This is interesting but I'm not understanding what the problem is. Is the flow above only for the Exchanges?
0 -
No, the flow processes all sales and returns (refunds). Exchanges were the 2nd phase of transactions being added. Because of the way the customer wants to account for the transactions - via cash sales and cash refunds - I have to separate an exchange transaction into both a sale and refund to balance correctly. The transformation successfully breaks out sales, returns(refunds) and now does both with an exchange. Before exchanges, the transaction was either a "sale" or a "refund" which made the filtering straight forward. Now, I have to "split" the exchange between one or more sales and one or more refunds, which the javascript does fine, but I have a "combined" transaction that really needs to flow to both the sale and refund and I'm not quite sure how to accomplish this with what I have in place.
0 -
you don't have to split anything. You can run the transformed exchange into your Cash Sale import and then let it run into your Cash Refund import. The same source transaction can be processed more than once. You'll have to update your filtering with an "or" condition possibly so that the "exchange" can process into both.
0
Please sign in to leave a comment.
Comments
3 comments