Macro: Did we make any money on that?

Now that’s a question you don’t hear too often…yeah right!

Here’s a macro that you can easily execute from within a customer order to determine whether you made money on it or not.  You can then save the results with the order for future reference.

Download VMORDENT_ Did We Make Any Money On This macro

Be sure to modify the macro to include your database connection information.  Look for the following variables to change:

strServerName=”E N T E R   N A M E   O F   S Q L   S E R V E R”
strDatabase=”E N T E R   D A T A B A S E   N A M E”
strUserName=”E N T E R   U S E R N A M E”
strPassword=”E N T E R   P A S S W O R D”

  
 
BUT BEFORE YOU CAN USE THE MACRO
,
 you need to first create 5 Customizable UDFs under a new TAB of the Customer Order Entry window.

 

1. Start by selecting “Customizable UDF’s…” from the EDIT menu of Customer Order Entry window

2. Click on the “Insert Tab” icon (as shown below), and enter the following fields:

Field LABEL value:            Revenue
Field TAB value:               Gross Profit Analysis
Field SQL NO value:          10 

Field DATA TYPE value:    Number

Macro: Did we make any money on that?

3. Repeat step 2 for the following 4 custom fields

Field LABEL value:            Costs
Field TAB value:               Gross Profit Analysis
Field SQL NO value:          20
Field DATA TYPE value:    Number

Field LABEL value:            Gross Profit
Field TAB value:               Gross Profit Analysis
Field SQL NO value:          30
Field DATA TYPE value:    Number

Field LABEL value:            Gross Profit (%)
Field TAB value:               Gross Profit Analysis
Field SQL NO value:          40
Field DATA TYPE value:    String

Field LABEL value:            Last Update
Field TAB value:               Gross Profit Analysis
Field SQL NO value:          50
Field DATA TYPE value:    String

You should now have something similar to the follow screenshot:

User Defined Field Maintenance Field Entry

4. Hit the SAVE button and close the screen

5. Your Customer Order Entry window should now be displaying in the header area an extra TAB called Gross Profit Analysis,

Customer Order Enter - Custom Tab and Fields

Now the macro, when executed, will populate the fields you just created.  You will then either giggle at the huge margins you made or weep at the disappointing loss.

Macro menu

Copyright 2019 visualnuggets © All Rights Reserved