-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFiscalReceiptPayment.cs
More file actions
49 lines (38 loc) · 1.21 KB
/
FiscalReceiptPayment.cs
File metadata and controls
49 lines (38 loc) · 1.21 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
using System;
namespace ICLPrinterServer
{
public class FiscalReceiptPayment : FiscalReceiptLine
{
public int PaymentTypeId { get; }
public decimal Amount { get; }
public FiscalReceiptPayment (int paymentTypeId, decimal amount)
{
PaymentTypeId = paymentTypeId;
Amount = amount;
Total = -amount;
}
public override void Print (int charsPerLine)
{
var value = Amount + " ";
Console.ForegroundColor = ConsoleColor.DarkGray;
Console.WriteLine (GetPaymentType ().PadRight (charsPerLine - value.Length) + value);
}
private string GetPaymentType ()
{
switch (PaymentTypeId) {
case 1:
return "КРЕДИТНА/ДЕБИТНА КАРТА";
case 2:
return "БАНКА";
case 3:
return "КУПОН";
case 4:
return "ДПЪЛНИТЕЛНО 1";
case 5:
return "ДПЪЛНИТЕЛНО 2";
default:
return "В БРОЙ";
}
}
}
}