Reprint and Printed bill editing logged.
Printed bill can no longer be changed, any changes voids the bill and prints a new one. Added option to Split Bill. Kot printed with right time. Numerous bug fixes.
This commit is contained in:
@ -0,0 +1,28 @@
|
||||
using System.Reflection;
|
||||
using Tanshu.Accounts.Entities;
|
||||
|
||||
namespace Tanshu.Common.Helpers
|
||||
{
|
||||
public enum VoucherFields
|
||||
{
|
||||
CreationDate,
|
||||
LastEditDate,
|
||||
Date,
|
||||
BillID,
|
||||
KotID
|
||||
}
|
||||
public static class ReflectionHelper
|
||||
{
|
||||
public static void SetValue(this Voucher voucher, VoucherFields field, object value)
|
||||
{
|
||||
var fi = typeof(Voucher).GetField(ConvertToCamelCaseUnderscore(field.ToString()), BindingFlags.NonPublic | BindingFlags.Instance);
|
||||
if (fi != null)
|
||||
fi.SetValue(voucher, value);
|
||||
}
|
||||
private static string ConvertToCamelCaseUnderscore(string propertyName)
|
||||
{
|
||||
return "_" + propertyName[0].ToString().ToLower() + propertyName.Substring(1);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user