From 8ae6dfb6047bd4434c5ce529d7cc107b3c256a1e Mon Sep 17 00:00:00 2001 From: Petr Baudis Date: Wed, 17 Oct 2012 21:12:43 +0200 Subject: [PATCH] Add import scripts brmbar1 -> brmbar3 --- brmbar3/import/import-items.pl | 15 +++++++++++++++ brmbar3/import/import-people.pl | 16 ++++++++++++++++ 2 files changed, 31 insertions(+) create mode 100644 brmbar3/import/import-items.pl create mode 100644 brmbar3/import/import-people.pl diff --git a/brmbar3/import/import-items.pl b/brmbar3/import/import-items.pl new file mode 100644 index 0000000..d0181a9 --- /dev/null +++ b/brmbar3/import/import-items.pl @@ -0,0 +1,15 @@ +# stdin in format: 8594002931643;Brmburky - hov.na cibul;-15 +use v5.12; +while (<>) { + chomp; + say STDERR "--- $_"; + my ($barcode, $name, $price) = split(/;/); + $price = -$price; + print </dev/null || echo -n 0`; + my $side = 'credit'; + if ($balance < 0) { + $balance = -$balance; + $side = 'debit'; + } + print <