Monday, May 17, 2010

Organize Your QuickLinks Section

Thanks to Landon Russell I learned a tip today that I think will ‘tame’ the QuickLinks content pane on our GP 10 (and 2010) Home Pages.

Landon’s Quick Links section contained dividers much like this:



I thought it was fabulous to have dividers and asked him how he did it. He explained how he created those dividers and I thought it was genius – and can be used in other places throughout our GP system. But for now, let’s deal with the Home Page.

To create a divider line you need to add a web page shortcut to your QuickLinks pane. In the Name field on the Add Web Page box you should put in whatever you want to appear as the divider. For our example I will use a string of hyphen characters (-----). For the address, select either http:// or https://, it does not matter which. In the name field to the right of the address simply type in a hyphen.



The hyphen is really just a placeholder, you will not get any error messages because it will really not try to launch any web page.

The new line will be added to the bottom of the Quick Links pane and can be moved up and down to accommodate your needs.

It’s a wonderful thing, thank YOU Landon Russell!

Until next post!

Leslie

Boolean Logic to the Rescue

We all have a couple of phrases we say all of the time which are probably despised by our friends because they have heard them so often. One of mine is:

“Don’t make this hard”

On a recent post by Richard Whaley on the Dynamics GP Newsgroup, he suggested adding up the values in a field to see if the field was populated. If the resulting value was greater than zero, the field was populated.

With that in mind, let’s explore the world of Boolean logic. I like it, no gray areas, no fancy nested conditional statements, it’s either true or false. Pretty easy.

True or False?

Often we find ourselves building IF statements that go through multiple logical tests. We string together a bunch of AND, OR, and NOT functions in order to test our data and arrive at a conclusion. Throughout this complex statement, all we are doing, really, is making up a group of True or False computations. Think about it, each step of our equation is either true or false. If it is False it is 0 and if it resolves to True it is 1. Such is the logic behind the ‘IF, THEN, ELSE’ statement. So before you reinvent the wheel with some monster conditional structure, consider breaking it down into a logic statement and see if you can get to your answer more quickly and more elegantly.

Before I go into the example, write down these cornerstones for Boolean logic problems:

Cornerstones for Logic

FALSE is Zero (0)

Add (+) if you want ‘OR’

Multiply (*) if you want ‘AND’

Anything else is TRUE (1)

An Example in Logic

Scenario: A 5% bonus is paid to salespeople who have sales over $50,000 so long as their gross profit percentage is greater than 30%. Oh, and it is always paid to ERIN J. because she has a special relationship with Aaron Fitz. Your job is to figure the bonus amount for each sale.

OK, let’s take this apart. The bonus is paid IF:

(Sales > $50,000 AND GP > 30%) OR Salesperson ID = ERIN J.

Programmatically that would look something like this:

IF(OR(AND (Sales > 50,000, GP > .3),
Salesperson = “ERIN J.”),
.05 * Sales, 0)

If we could create a calculation to solve this logical test, we could check the value of the resulting number. If the number is 0, the answer is FALSE. If it is anything else, the answer is TRUE. So if the answer is TRUE, then the bonus is paid, otherwise it is not.

Using the cornerstones we set out above, let’s solve this problem with Boolean logic.

Sales > 50,000 AND GP > 30% would turn into:
Sales > 50,000 * GP > .3
The result of this calculation is 0 if either of the components is not true. The result is 1 if both components are true.

If that was all of our criteria, then we could just multiply this formula by the bonus calculation and we would have our answer. The whole formula would look like this:

Bonus = (Sales > 50,000) * (GP > .3) * .05 * Sales

We have another wrinkle that we need to factor in, however. ERIN J. always gets the bonus, just because she is ERIN J. So now we have a big fat OR clause in our logic problem.

Our cornerstones say that an OR clause should be converted to an addition operation. On its face we might rewrite the formula to this:

Bonus = ((Sales > 50,000) * (GP > .3)) + (Salesperson = ERIN J.)

We need to be careful here because if ERIN J. had a sale that qualified for a bonus in its own right, then the result of our formula would be 2. ERIN J. may like this outcome, but the stockholders would not. In order to avoid this, we need to convert the result to TRUE  or FALSE, or 0 or 1.

The restated formula would look like this:

Bonus = If((Sales > 50,000) * (GP > .3) + (Salesperson = ERIN J.) 1, 0) * Sales * .05

Breaking it down into its components, you can do this easily even in Report Writer. Boolean logic turns it into 3 conditional fields and 3 straight calculated fields.

  • Calc 1, conditional = if Sales > 50,000 then 1
  • Calc 2, conditional = if GP > .3 then 1
  • Calc 3, calculated = Calc 1 * Calc 2, this will be 1 or 0
  • Calc 4, conditional = if Salesperson = ERIN J. then 1
  • Calc 5, calculated = Calc 3 * Calc 4 this will be 1 or 0
  • Calc 6, calculated = Sales * Calc 5 * .05 =The Bonus Amount

If you try and convert your IF statements into Boolean logic, you may find that they are much easier to understand and faster to write.

Don’t make this hard!

Until next post,

Leslie

Friday, May 14, 2010

Speeding up SmartList Exports

Put SmartList on Hyperdrive! There is a dex.ini switch that has just been disclosed. Patrick has posted a great article about how he found it and how it works at the Developing for Dynamics blog. The article explains why SmartList exports are so slow and how to speed them up. Check out his article here:

http://blogs.msdn.com/developingfordynamicsgp/archive/2010/05/14/smartlist-exports-slowly-to-excel-part-1.aspx

The switch is:

SmartlistEnhancedExcelExport=TRUE

It's a wonderful piece of information, thank you Patrick.

Until next post,

Leslie

Friday, March 5, 2010

Allocating Tips in Payroll – How and Why?

This posting steps through the tip allocation computation used by the Payroll module in Dynamics GP. Some questions have come up lately on the forums; rather than posting a lengthy answer, I thought it would be better to cover it in more detail in my blog.

What is it? -- The IRS has set a minimum amount that it expects waitstaff should have included in income for tips. The tip allocation calculation function merely adds an amount to taxable income; it does NOT result in an extra amount going into the paycheck.

The amount includable in income for an employee who is directly tipped is the greater of (a) the amount they reported to their employer or (b) their allocable share of the minimum amount established by the IRS (for 2009 it was 8%).

An indirectly tipped employee does not receive allocated tips. Generally, indirectly tipped employees receive their tips from other tipped employees rather than directly from the customers. Positions such as cooks, bussers, hostesses, barbacks, and dishwashers are typically indirectly tipped employees. Of course, an employee could receive both direct and indirect tips, if so they will be included in the allocation computation for their direct tips.

The Dynamics GP instructions provide the following explanation about allocated tips:

Microsoft Dynamics GP uses the Gross
Receipts method that is calculated per pay
run. The allocated tips amount equals the
difference between tips received and
employee gross receipts divided by
company gross receipts, multiplied by the
tip allocation rate, provided the difference is
more. Made to each directly tipped
employee.

Reading it again won’t help. I think an example is in order.

Our Example -- Let’s say our company, named Tailspin Pizza (“Tailspin”), has three employees who receive tips. The employees are tipped both directly and indirectly

During a payroll period, gross receipts at Tailspin were $15,500. Total tips reported by employees for this period were $980. Directly tipped employees reported $430 and indirectly tipped employees reported $550. Based on the IRS guidelines, the employees’ total tips should have been 8% of $15,500, or $1,240. Our job is to properly calculate and allocate the $260 shortfall.

Dynamics GP can do it!

How to set it up in Payroll -- Payroll Options need to be set telling the system that you want to use the tip allocation feature. To do this:

1. Navigate to the Payroll Setup window

Microsoft Dynamics GP>>Tools>>Setup>>Payroll>>Payroll

2. Select the Options button on the lower right-hand corner of the Payroll Setup window.

3. Mark the Calculate Tip Allocation checkbox in the Options section of the Payroll Setup Options window and set the Tip Allocation Rate to 8.00% (or whatever applicable percentage).

The allocation rate is determined by the IRS. Unless a lower amount was negotiated with the IRS, the rate was 8.00% for 2009.

How to set up Pay Codes --The appropriate pay codes need to be set up in order to include tips in a payroll run. Additionally, we need to be able to indicate whether the tips were received directly or indirectly. For the purposes of the tip allocation computation it does not matter whether the tips were ‘charged’ or ‘reported’. We’ll set up the following 3 Pay Codes to use in our example:

Pay CodePay TypeTips Received
CTIPICharged TipsIndirectly
CTIPDCharged TipsDirectly
RTIPDReported TipsDirectly

For the payroll period, Tailspin has total gross receipts of $15,500. Total gross receipts are calculated by adding together the individual employee receipts entered on the payroll transaction. The employee’s receipts are entered on the Payroll Transaction Entry window with the ‘show’ details open.

The Calculation -- Total gross receipts were $15,500, total reported tips were $980. Tips received directly were reported as $430. Tips received indirectly were reported as $550.

Directly Tipped EmployeesGross Receipts for payroll period

Direct Tips Reported

ACKE

3,500

30

BARB

5,500

100

BARR

6,500

300

Totals

15,500

430

1. $15,500(gross receipts) x .08 = $1,240
2. $1,240 - $550 (tips reported by indirectly tipped workers) = $690
The amount used to calculate each directly tipped employee’s share of 8% of the gross is $690.
3. Calculate each directly tipped employee’s share of 8% of gross receipts.

Directly Tipped Employees

Directly Tipped Share of 8% of the gross

(Times) Gross Receipts Ratio

Employee’s share of 8% of the gross

ACKE

690

3,500/15,500=

156

BARB

690

5,500/15,500=

245

BARR

690

6,500/15,500=

289

Total

690

4. Calculate the shortfall in reported directly received tips

Directly Tipped Employees

Employee’s share of 8% of the gross

(Minus) Tips Reported

Employee shortfall (use 0 if no shortfall)

ACKE

156

30

126

BARB

245

100

145

BARR

289

300

-

Total

690

430

271

5. Calculate the allocable share of the total tip shortfall. $1,240(total gross receipts x 8%) less $980 (total tips reported, includes direct and indirect) = $260(amount to be allocated among employees who had a shortfall).

Shortfall Employees

Allocable Amount(Times) Shortfall ratioAmount of allocation

ACKE

260

126/271=.46484

120.86

BARB

260

145/271=.53516

139.14

BARR

260

0/271=.00000

0

Total

260.00

6. Since employee BARR did not have a shortfall, there is no allocated amount to employee BARR.

Leave it to the IRS to dream up this ‘simple’ allocation calculation. Fortunately Dynamics GP does it for us!

Until next post!

Leslie

Tuesday, March 2, 2010

DEXVBA.ini Switches - Part 1

In keeping with my ‘.ini’ switch theme I would like to keep track of entries we can make to the DEXVBA.ini file. I currently have only two. I hope you will comment here if you have any others and I can add them to the list. I have titled this ‘Part 1’ in hopes that I will get additional settings so that I may post a ‘Part 2’.

The DEXVBA.ini file is not created by default. You will need to open Notepad (or similar text editor) and create it. The file should be created in the root Windows folder, not in the GP folder.

Step 1. Create a file named DEXVBA.ini in the root Windows folder.

Step 2. Add the following line to the top of the file: [General]

Step 3. Add the selected .ini setting beneath [General].

INI Setting Description
LogObjects=TRUE This will create a text file that will include all of the objects in a VBA project. The text file will be the same name as the product dictionary with a ‘.txt’ extension.
NoUnresolvedDialog=TRUE

This will suppress the following error message when you launch Dynamics GP.

“The product_name.vba project references some objects that cannot be found.

These objects are listed in the file: C:\Program Files\Microsoft Business Solutions\GP\ product_name.txt”

The warning will be suppressed for all VBA projects loaded. It doesn’t solve the problem regarding missing objects, but it suppresses the message.

Until next post!

Leslie