Expenses from cash drawer

I try to setup expenses by the tutotial but i think i’m having some problem with the below report showing and ending sambapos. I want to make a simple expenses function to pay supplier using money from cash drawer. I want it calculate by work period. example this period i have sales of 1000 then expenses 300 so the cash drawer balance will be 700. I’m using V3.

-----------------------------
[General Info]

Application: SambaPOS
Version:     3.0.35 BETA
Region:      en
DB:          CE
Machine:     KEVIN-PC
User:        Kevin
Date:        22/4/2015
Time:        9:42 AM

User Explanation:

Kevin said ""
-----------------------------

[Exception Info 1]

Top-level Exception
Type:        System.Reflection.TargetInvocationException
Message:     Exception has been thrown by the target of an invocation.
Source:      mscorlib
Stack Trace: at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
   at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)
   at System.Reflection.RuntimeMethodInfo.UnsafeInvoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
   at System.Delegate.DynamicInvokeImpl(Object[] args)
   at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
   at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler)
   at System.Windows.Threading.DispatcherOperation.InvokeImpl()
   at System.Windows.Threading.DispatcherOperation.InvokeInSecurityContext(Object state)
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Windows.Threading.DispatcherOperation.Invoke()
   at System.Windows.Threading.Dispatcher.ProcessQueue()
   at System.Windows.Threading.Dispatcher.WndProcHook(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
   at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
   at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler)
   at System.Windows.Threading.Dispatcher.LegacyInvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs)
   at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam)
   at MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg)
   at System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame)
   at System.Windows.Threading.Dispatcher.PushFrame(DispatcherFrame frame)
   at System.Windows.Threading.Dispatcher.Run()
   at System.Windows.Application.RunDispatcher(Object ignore)
   at System.Windows.Application.RunInternal(Window window)
   at System.Windows.Application.Run(Window window)
   at Samba.Presentation.App.Main()

Inner Exception 1
Type:        System.InvalidOperationException
Message:     Sequence contains no matching element
Source:      System.Core
Stack Trace: at System.Linq.Enumerable.Single[TSource](IEnumerable`1 source, Func`2 predicate)
   at Samba.Services.Implementations.CacheService.GetAccountTypeById(Int32 accountTypeId)
   at Samba.Modules.AccountModule.DocumentCreatorViewModel.<GetAccountSelectors>b__2(Int32 x)
   at System.Linq.Enumerable.WhereSelectListIterator`2.MoveNext()
   at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)
   at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
   at Samba.Modules.AccountModule.DocumentCreatorViewModel.OnDocumentCreation(EventParameters`1 obj)
   at Microsoft.Practices.Prism.Events.EventSubscription`1.InvokeAction(Action`1 action, TPayload argument)
   at Microsoft.Practices.Prism.Events.EventSubscription`1.<>c__DisplayClass2.<GetExecutionStrategy>b__0(Object[] arguments)
   at Microsoft.Practices.Prism.Events.EventBase.InternalPublish(Object[] arguments)
   at Microsoft.Practices.Prism.Events.CompositePresentationEvent`1.Publish(TPayload payload)
   at Samba.Presentation.Services.Common.ExtensionMethods.Publish[TEventsubject](TEventsubject eventArgs, String eventTopic, Action expectedAction)

-----------------------------

[Assembly Info]

Samba.Services, Version=1.0.0.0
mscorlib, Version=4.0.0.0
PresentationCore, Version=4.0.0.0
Microsoft.Practices.Prism, Version=4.0.0.0
WindowsBase, Version=4.0.0.0
Samba.Infrastructure.Data, Version=1.0.0.0
PresentationFramework, Version=4.0.0.0
System.Xaml, Version=4.0.0.0
Samba.Presentation.Services, Version=1.0.0.0
System, Version=4.0.0.0
Samba.Infrastructure, Version=1.0.0.0
FluentValidation, Version=3.4.0.0
Samba.Domain, Version=1.0.0.0
Stateless, Version=1.0.0.0
System.Core, Version=4.0.0.0
System.Drawing, Version=4.0.0.0
System.Windows.Forms, Version=4.0.0.0
System.ComponentModel.Composition, Version=4.0.0.0
Samba.Localization, Version=1.0.0.0
Microsoft.CSharp, Version=4.0.0.0
Microsoft.Practices.ServiceLocation, Version=1.0.0.0
Samba.Persistance, Version=1.0.0.0
Microsoft.Practices.Prism.MefExtensions, Version=4.0.0.0
PropertyTools, Version=2012.4.14.1

-----------------------------

[System Info]

Operating System
-Microsoft Windows 7 Home Premium
--CodeSet = 1252
--CSDVersion = Service Pack 1
--CurrentTimeZone = 480
--FreePhysicalMemory = 607164
--OSArchitecture = 64-bit
--OSLanguage = 1033
--ServicePackMajorVersion = 1
--ServicePackMinorVersion = 0
--Version = 6.1.7601

Machine
-KEVIN-PC
--Manufacturer = Dell Inc.
--Model = Inspiron 1122
--TotalPhysicalMemory = 3870191616
--UserName = Kevin-PC\Kevin

-----------------------------

Which Tutorial? There is more than one regarding Expenses.

There is no guarantee that the Tutorials will work with v3 since they were developed in v4 and official support for v3 has ended.

Issue relates with Transaction Document’s Account Type. It is either deleted or setup incorrectly.

PS: This forum is for V4 version. Visit sambapos.org for V3 version support forum.

i follow this which i think its quite old
http://sambapos.org/wiki/doku.php/en/configuring_cash_transactions_for_v2_users

I know that V4 is the way to move forward but i have few pc still running win XP so has to be setup using V3.

That Tutorial was built for v3, so it should work just fine.

Read through it again and ensure you got everything exactly correct. There must be something missing or incorrectly spelled.

Look closely in the area mentioned by @emre.

thanks its working now. i re check everything and noticed my mistake in accounts setting

A simple quick solution if you struggle which I used at first was to ad a product called paid out, left it without a price so using the number pad you can type in a price then add an action and rule so that when its added the price is automatically changed to a negative (0-price).
Or even more basic would be to add the product with positive price then refund it. To give you a negative cash transaction.
While it is not an ideal situation it tied me over in the beginning.
It would depend on how you record your sales and do tax returns, as this would initially (as far as samba is concerned) reduce the sales.
For my reporting and sales I transfer figures to a spreadsheet with daily totals to balance money and record sales.
The result was that the cash/card figures balanced with what came out the till which kept life easy for the bar tender cashing up at end of the night.
As paid out was its own product in paid out category it was recorded separately in the product group breakdown on the period report.
As I use these figures to balance sales and cash I know that the paid out figure (a minus sale) was an expense, and as this was then not put in my sales report my total sales figures where correct and I could clearly see shat had been paid out,

As I said, a little crude and not ideal but kept me going till moving to a more appropriate solution once I had a bit better understanding of samba. It’s not a per inact solution but if your system is in use now and need quick temp solution will tide you over till sort a better solution.

Follow my tutorial here this is exactly what you want, i have a petty cash button that when pressed asks for the value and reason for expense

It has full accounting and you can show it in reports also

3 Likes