2018-08-24 10:41:33 +00:00
|
|
|
|
using RestSharp;
|
|
|
|
|
using System;
|
2011-01-30 07:14:05 +00:00
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using Tanshu.Accounts.Contracts;
|
|
|
|
|
|
|
|
|
|
namespace Tanshu.Accounts.Repository
|
|
|
|
|
{
|
2018-08-24 10:41:33 +00:00
|
|
|
|
public static class SalesAnalysisBI
|
2011-01-30 07:14:05 +00:00
|
|
|
|
{
|
2018-08-24 10:41:33 +00:00
|
|
|
|
public static IList<SalesAnalysis> GetSale(DateTime startDate, DateTime finishDate)
|
2011-01-30 07:14:05 +00:00
|
|
|
|
{
|
2018-08-24 10:41:33 +00:00
|
|
|
|
var request = new RestRequest();
|
|
|
|
|
request.Resource = "SaleAnalysis/Sale.json";
|
|
|
|
|
request.AddQueryParameter("s", startDate.ToString("dd-MMM-yyyy HH:mm"));
|
|
|
|
|
request.AddQueryParameter("f", finishDate.ToString("dd-MMM-yyyy HH:mm"));
|
|
|
|
|
return JsonStore.Execute<List<SalesAnalysis>>(request);
|
2014-11-11 10:23:54 +00:00
|
|
|
|
}
|
2018-08-24 10:41:33 +00:00
|
|
|
|
public static IList<SalesAnalysis> GetSettlements(DateTime startDate, DateTime finishDate)
|
2011-01-30 07:14:05 +00:00
|
|
|
|
{
|
2018-08-24 10:41:33 +00:00
|
|
|
|
var request = new RestRequest();
|
|
|
|
|
request.Resource = "SaleAnalysis/Settlements.json";
|
|
|
|
|
request.AddQueryParameter("s", startDate.ToString("dd-MMM-yyyy HH:mm"));
|
|
|
|
|
request.AddQueryParameter("f", finishDate.ToString("dd-MMM-yyyy HH:mm"));
|
|
|
|
|
return JsonStore.Execute<List<SalesAnalysis>>(request);
|
2011-01-30 07:14:05 +00:00
|
|
|
|
}
|
2018-08-24 10:41:33 +00:00
|
|
|
|
public static SalesAnalysis GetServiceCharge(DateTime startDate, DateTime finishDate)
|
2011-01-30 07:14:05 +00:00
|
|
|
|
{
|
2018-08-24 10:41:33 +00:00
|
|
|
|
var request = new RestRequest();
|
|
|
|
|
request.Resource = "SaleAnalysis/ServiceCharge.json";
|
|
|
|
|
request.AddQueryParameter("s", startDate.ToString("dd-MMM-yyyy HH:mm"));
|
|
|
|
|
request.AddQueryParameter("f", finishDate.ToString("dd-MMM-yyyy HH:mm"));
|
|
|
|
|
return JsonStore.Execute<SalesAnalysis>(request);
|
2014-11-11 10:23:54 +00:00
|
|
|
|
}
|
2018-08-24 10:41:33 +00:00
|
|
|
|
public static IList<TaxAnalysis> GetServiceTax(DateTime startDate, DateTime finishDate)
|
2014-11-11 10:23:54 +00:00
|
|
|
|
{
|
2018-08-24 10:41:33 +00:00
|
|
|
|
var request = new RestRequest();
|
|
|
|
|
request.Resource = "SaleAnalysis/ServiceTax.json";
|
|
|
|
|
request.AddQueryParameter("s", startDate.ToString("dd-MMM-yyyy HH:mm"));
|
|
|
|
|
request.AddQueryParameter("f", finishDate.ToString("dd-MMM-yyyy HH:mm"));
|
|
|
|
|
return JsonStore.Execute<List<TaxAnalysis>>(request);
|
2014-11-11 10:23:54 +00:00
|
|
|
|
}
|
2018-08-24 10:41:33 +00:00
|
|
|
|
public static IList<TaxAnalysis> GetVat(DateTime startDate, DateTime finishDate)
|
2014-11-11 10:23:54 +00:00
|
|
|
|
{
|
2018-08-24 10:41:33 +00:00
|
|
|
|
var request = new RestRequest();
|
|
|
|
|
request.Resource = "SaleAnalysis/Vat.json";
|
|
|
|
|
request.AddQueryParameter("s", startDate.ToString("dd-MMM-yyyy HH:mm"));
|
|
|
|
|
request.AddQueryParameter("f", finishDate.ToString("dd-MMM-yyyy HH:mm"));
|
|
|
|
|
return JsonStore.Execute<List<TaxAnalysis>>(request);
|
2011-01-30 07:14:05 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|