This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import 'dart:core'; | |
| import 'package:intl/intl.dart'; | |
| void main() { | |
| // Create dummy SalesEntity | |
| var sales = dummySales(); | |
| // Create dummy PrinterTicketEntity | |
| var tickets = PrinterTicketEntity( | |
| printersettingTicketId: 1, | |
| name: 'Ticket 1', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import 'dart:core'; | |
| import 'package:intl/intl.dart'; | |
| void main() { | |
| Outlet outlet = dummyOutlet(); | |
| Employee employee = Employee( | |
| name: 'Jane Doe', | |
| ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import 'dart:core'; | |
| import 'package:intl/intl.dart'; | |
| import 'dart:convert'; | |
| import 'package:collection/collection.dart'; | |
| import 'dart:math'; | |
| void main() { | |
| // Create dummy data | |
| SalesEntity sales = dummySales(); | |
| Outlet outlet = dummyOutlet(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import 'dart:core'; | |
| import 'package:intl/intl.dart'; | |
| void main() { | |
| // Create dummy data | |
| SalesEntity sales = dummySales(); | |
| Outlet outlet = dummyOutlet(); | |
| Employee employee = Employee( | |
| name: 'Jane Doe', | |
| ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| void main() { | |
| print(' NOTA SALES '.center(25, '=')); | |
| print('Ayam Goreng Special Pedas'.width(15) + '10'.width(5) + '32,000'.width(7)); | |
| print('www.uniq.id'.center(25, ' ')); | |
| } | |
| extension StringExtensions on String { | |
| String loop(int w) { | |
| var newVal = ''; | |
| for (var i = 0; i < w; i++) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import 'dart:math'; | |
| String generateDisplayNota(int? adminId, int? outletId, int salesCount) { | |
| var nota = StringBuffer(); | |
| try { | |
| var id = (outletId ?? 0) + (adminId ?? 1); | |
| var words = [ | |
| "A", | |
| "P", | |
| "L", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| List<int> generatePaymentOptions(int grandTotal, bool isPiutang) { | |
| final options = <int>[]; | |
| options.add(grandTotal); | |
| //for piutang, the options would be less than grand total | |
| if (isPiutang) { | |
| [0.75, 0.50, 0.25].forEach((divider) { | |
| final option = (grandTotal * divider).round(); | |
| if (option <= 0) { | |
| return; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import 'dart:math'; | |
| class Generator { | |
| static String generateSalesId() { | |
| List<String> words = [ | |
| "A", | |
| "P", | |
| "L", | |
| "I", | |
| "K", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import 'dart:math'; | |
| class Generator { | |
| static String generateSalesId() { | |
| List<String> words = [ | |
| "A", | |
| "P", | |
| "L", | |
| "I", | |
| "K", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import 'dart:math'; | |
| class Generator { | |
| static String generateSalesId() { | |
| List<String> words = [ | |
| "A", | |
| "P", | |
| "L", | |
| "I", | |
| "K", |