Importing now working
except u-product_group_modifier. It does not fit in the new scheme. Will remove in next commit so that it is added to log if needed later.
This commit is contained in:
parent
f8683cf080
commit
1e69c8eeeb
|
@ -0,0 +1,40 @@
|
|||
docker run -it -v /home/tanshu/cl:/mnt --link postgres:db --rm --env PGPASSWORD="123456" postgres:alpine bash -c 'psql -h db -U postgres -c "drop database petty"'
|
||||
docker run -it -v /home/tanshu/cl:/mnt --link postgres:db --rm --env PGPASSWORD="123456" postgres:alpine bash -c 'psql -h db -U postgres -c "create database petty"'
|
||||
alembic upgrade 8c06ac60d125
|
||||
docker run -it -v /home/tanshu/Programming/csv:/mnt --link postgres:db --rm --env PGPASSWORD="123456" postgres:alpine bash -c 'psql -h db -U postgres petty -c "\copy roles(id, name) from /mnt/a-Roles.csv"'
|
||||
docker run -it -v /home/tanshu/Programming/csv:/mnt --link postgres:db --rm --env PGPASSWORD="123456" postgres:alpine bash -c 'psql -h db -U postgres petty -c "\copy permissions(id, name) from /mnt/b-Permissions.csv"'
|
||||
docker run -it -v /home/tanshu/Programming/csv:/mnt --link postgres:db --rm --env PGPASSWORD="123456" postgres:alpine bash -c 'psql -h db -U postgres petty -c "\copy role_permissions(id, permission_id, role_id) from /mnt/c-RolePermissions.csv"'
|
||||
docker run -it -v /home/tanshu/Programming/csv:/mnt --link postgres:db --rm --env PGPASSWORD="123456" postgres:alpine bash -c 'psql -h db -U postgres petty -c "\copy users(id, name, password, locked_out) from /mnt/d-Users.csv"'
|
||||
docker run -it -v /home/tanshu/Programming/csv:/mnt --link postgres:db --rm --env PGPASSWORD="123456" postgres:alpine bash -c 'psql -h db -U postgres petty -c "\copy user_roles(id, user_id, role_id) from /mnt/e-UserRoles.csv"'
|
||||
docker run -it -v /home/tanshu/Programming/csv:/mnt --link postgres:db --rm --env PGPASSWORD="123456" postgres:alpine bash -c 'psql -h db -U postgres petty -c "\copy customers(id, name, address, phone) from /mnt/f-Customers.csv"'
|
||||
docker run -it -v /home/tanshu/Programming/csv:/mnt --link postgres:db --rm --env PGPASSWORD="123456" postgres:alpine bash -c 'psql -h db -U postgres petty -c "\copy food_tables(id, name, seats, is_active, section_id, sort_order) from /mnt/g-FoodTables.csv"'
|
||||
docker run -it -v /home/tanshu/Programming/csv:/mnt --link postgres:db --rm --env PGPASSWORD="123456" postgres:alpine bash -c 'psql -h db -U postgres petty -c "\copy taxes(id, name, rate, is_fixture) from /mnt/h-Taxes.csv"'
|
||||
docker run -it -v /home/tanshu/Programming/csv:/mnt --link postgres:db --rm --env PGPASSWORD="123456" postgres:alpine bash -c 'psql -h db -U postgres petty -c "\copy menu_categories(id, name, discount_limit, is_active, is_fixture, sort_order) from /mnt/i-MenuCategories.csv"'
|
||||
docker run -it -v /home/tanshu/Programming/csv:/mnt --link postgres:db --rm --env PGPASSWORD="123456" postgres:alpine bash -c 'psql -h db -U postgres petty -c "\copy sale_categories(id, name, tax_id) from /mnt/j-SaleCategories.csv"'
|
||||
sed -i 's/\x0//g' ~/Programming/csv/k-Products.csv
|
||||
docker run -it -v /home/tanshu/Programming/csv:/mnt --link postgres:db --rm --env PGPASSWORD="123456" postgres:alpine bash -c 'psql -h db -U postgres petty -c "\copy products(id, name, units, menu_category_id, sale_category_name, price, has_happy_hour, is_active, is_not_available, sort_order, quantity) from /mnt/k-Products.csv"'
|
||||
docker run -it -v /home/tanshu/Programming/csv:/mnt --link postgres:db --rm --env PGPASSWORD="123456" postgres:alpine bash -c 'psql -h db -U postgres petty -c "\copy modifiers(id, name, show_in_bill, is_active, modifier_category_id, price) from /mnt/l-Modifiers.csv"'
|
||||
docker run -it -v /home/tanshu/Programming/csv:/mnt --link postgres:db --rm --env PGPASSWORD="123456" postgres:alpine bash -c 'psql -h db -U postgres petty -c "\copy sections(id, name, is_fixture) from /mnt/m-Sections.csv"'
|
||||
sed -i ':a;N;$!ba;s/\n\r\n\r\n\r\n\r\n\r\n\r/,/g' /home/tanshu/Programming/csv/n-Printers.csv
|
||||
docker run -it -v /home/tanshu/Programming/csv:/mnt --link postgres:db --rm --env PGPASSWORD="123456" postgres:alpine bash -c 'psql -h db -U postgres petty -c "\copy printers(id, name, address, cut_code) from /mnt/n-Printers.csv"'
|
||||
docker run -it -v /home/tanshu/Programming/csv:/mnt --link postgres:db --rm --env PGPASSWORD="123456" postgres:alpine bash -c 'psql -h db -U postgres petty -c "\copy section_printers(id, menu_category_id, section_name, printer_name, copies) from /mnt/o-SectionPrinters.csv"'
|
||||
alembic upgrade head
|
||||
sed -i 's/\x0/\\N/g' ~/Programming/csv/p-Vouchers.csv
|
||||
docker run -it -v /home/tanshu/Programming/csv:/mnt --link postgres:db --rm --env PGPASSWORD="123456" postgres:alpine bash -c 'psql -h db -U postgres petty -c "\copy vouchers(id, date, pax, user_id, creation_date, last_edit_date, bill_id, food_table_id, customer_id, narration, reason, voucher_type, kot_id) from /mnt/p-Vouchers.csv"'
|
||||
docker run -it -v /home/tanshu/Programming/csv:/mnt --link postgres:db --rm --env PGPASSWORD="123456" postgres:alpine bash -c 'psql -h db -U postgres petty -c "\copy kots(id, voucher_id, code, food_table_id, date, user_id) from /mnt/q-Kots.csv"'
|
||||
docker run -it -v /home/tanshu/Programming/csv:/mnt --link postgres:db --rm --env PGPASSWORD="123456" postgres:alpine bash -c 'psql -h db -U postgres petty -c "\copy inventories(id, kot_id, product_id, sort_order, quantity, price, is_happy_hour, tax_rate, tax_id, discount) from /mnt/r-Inventories.csv"'
|
||||
docker run -it -v /home/tanshu/Programming/csv:/mnt --link postgres:db --rm --env PGPASSWORD="123456" postgres:alpine bash -c 'psql -h db -U postgres petty -c "\copy inventory_modifiers(id, inventory_id, modifier_id, price) from /mnt/s-InventoryModifiers.csv"'
|
||||
docker run -it -v /home/tanshu/Programming/csv:/mnt --link postgres:db --rm --env PGPASSWORD="123456" postgres:alpine bash -c 'psql -h db -U postgres petty -c "\copy overview(id, voucher_id, food_table_id, status) from /mnt/t-Overview.csv"'
|
||||
echo u
|
||||
docker run -it -v /home/tanshu/Programming/csv:/mnt --link postgres:db --rm --env PGPASSWORD="123456" postgres:alpine bash -c 'psql -h db -U postgres petty -c "\copy product_group_modifiers(id, product_group_id, modifier_id, show_automatically) from /mnt/u-ProductGroupModifiers.csv"'
|
||||
echo v
|
||||
docker run -it -v /home/tanshu/Programming/csv:/mnt --link postgres:db --rm --env PGPASSWORD="123456" postgres:alpine bash -c 'psql -h db -U postgres petty -c "\copy reprints(id, user_id, date, voucher_id) from /mnt/v-Reprints.csv"'
|
||||
echo w
|
||||
docker run -it -v /home/tanshu/Programming/csv:/mnt --link postgres:db --rm --env PGPASSWORD="123456" postgres:alpine bash -c 'psql -h db -U postgres petty -c "\copy settings(id, name, data) from /mnt/w-Settings.csv"'
|
||||
echo x
|
||||
docker run -it -v /home/tanshu/Programming/csv:/mnt --link postgres:db --rm --env PGPASSWORD="123456" postgres:alpine bash -c 'psql -h db -U postgres petty -c "\copy settlements(id, voucher_id, settled, amount) from /mnt/x-VoucherSettlements.csv"'
|
||||
echo z
|
||||
docker run -it -v /home/tanshu/Programming/barker/DB:/mnt --link postgres:db --rm --env PGPASSWORD="123456" postgres:alpine bash -c 'psql -h db -U postgres petty < /mnt/z-RenamePermissions.sql'
|
||||
|
||||
# Show the file in code to see the hidden chars
|
||||
# od -t c ~/Programming/csv/n-Printers.csv
|
|
@ -1,36 +1,32 @@
|
|||
@echo off
|
||||
call:copyQuery a-Roles "SELECT 'INSERT INTO roles(id, name) VALUES (''' + CAST(GroupID AS Nvarchar(36)) + ''', ''' + Name + ''');' FROM Test.dbo.Auth_Groups;"
|
||||
call:copyQuery b-Permissions "SELECT 'INSERT INTO permissions(id, name) VALUES (''' + CAST(RoleID AS Nvarchar(36)) + ''', ''' + Name + ''');' FROM Test.dbo.Auth_Roles;"
|
||||
call:copyQuery c-RolePermissions "SELECT 'INSERT INTO role_permissions(id, permission_id, role_id) VALUES (''' + CAST(RoleGroupID AS Nvarchar(36)) + ''', ''' + CAST(RoleID AS Nvarchar(36)) + ''', ''' + CAST(GroupID AS Nvarchar(36)) + ''');' FROM Test.dbo.Auth_RoleGroups;"
|
||||
call:copyQuery d-Users "SELECT 'INSERT INTO users(id, name, password, locked_out) VALUES (''' + CAST(UserID AS Nvarchar(36)) + ''', ''' + Name + ''', ''' + Password + ''', ' + CASE WHEN LockedOut = 1 THEN 'true' ELSE 'false' END + ');' FROM Test.dbo.Auth_Users;"
|
||||
call:copyQuery e-UserRoles "SELECT 'INSERT INTO user_roles(id, user_id, role_id) VALUES (''' + CAST(UserGroupID AS Nvarchar(36)) + ''', ''' + CAST(UserID AS Nvarchar(36)) + ''', ''' + CAST(GroupID AS Nvarchar(36)) + ''');' FROM Test.dbo.Auth_UserGroups;"
|
||||
|
||||
call:copyQuery f-Customers "SELECT 'INSERT INTO customers(id, name, address, company, phone) VALUES (''' + CAST(CustomerID AS Nvarchar(36)) + ''', ''' + REPLACE(Name, '''', '''''') + ''', ''' + COALESCE(Address, 'null') + ''', '''', ' + CASE WHEN Phone = '' THEN 'null' ELSE '''' + COALESCE(Phone, Name) + '''' END + ');' FROM Test.dbo.Customers WHERE CustomerID != '2c716f4b-0736-429a-ad51-610d7c47cb5e';"
|
||||
call:copyQuery g-FoodTables "SELECT 'INSERT INTO food_tables(id, name, seats, is_active, section_id, sort_order) VALUES (''' + CAST(FoodTableID AS Nvarchar(36)) + ''', ''' + Name + ''', 0, ' + CASE WHEN IsActive = 1 THEN 'true' ELSE 'false' END + ', ''3f13f6e7-dc76-4fca-8fdb-b2bbf29b35df'', ' + CAST(SortOrder AS Nvarchar(36)) + ');' FROM Test.dbo.FoodTables;"
|
||||
call:copyQuery h-Taxes "SELECT 'INSERT INTO taxes(id, name, rate, is_fixture) VALUES ('''+ CAST(TaxID AS Nvarchar(36)) + ''', ' + '''' + REPLACE(Name, '''', '''''') + '''' + ', ' + CAST(Rate AS Nvarchar(36)) + ', false);' FROM Test.dbo.Taxes;"
|
||||
call:copyQuery i-MenuCategories "SELECT 'INSERT INTO menu_categories(id, name, discount_limit, is_active, is_fixture, sort_order) VALUES (''' + CAST(ProductGroupID AS Nvarchar(36)) + ''', ''' + REPLACE(Name, '''', '''''') + ''', ' + CAST(DiscountLimit AS nvarchar(36)) + ', ' + CASE WHEN IsActive = 1 THEN 'true' ELSE 'false' END + ', false, ' + CAST(SortOrder AS Nvarchar(36)) + ');' FROM Test.dbo.ProductGroups;"
|
||||
call:copyQuery j-SaleCategories "SELECT 'INSERT INTO sale_categories(id, name, tax_id) VALUES (''' + CAST(newid() AS Nvarchar(36)) + ''', ''' + REPLACE(pgo.GroupType, '''', '''''') + ''', ''' + CAST((select top 1 t.TaxID from Test.dbo.Taxes t inner join Test.dbo.Products p on t.TaxID = p.VatID inner join Test.dbo.ProductGroups pg on p.ProductGroupID = pg.ProductGroupID where pg.GroupType = pgo.GroupType) AS Nvarchar(36)) + ''');' from (select distinct pgx.GroupType from Test.dbo.ProductGroups pgx) as pgo;"
|
||||
call:copyQuery k-Products "SELECT 'INSERT INTO products(id, name, units, menu_category_id, sale_category_id, price, has_happy_hour, is_active, is_not_available, sort_order, quantity) VALUES (''' + CAST(ProductID AS Nvarchar(36)) + ''', ' + '''' + REPLACE(Name, '''', '''''') + '''' + ', ' + '''' + Units + '''' + ', ' + '''' + CAST(ProductGroupID AS Nvarchar(36)) + '''' + ', ' + '(select id from sale_categories where name = ''' + (SELECT GroupType FROM Test.dbo.ProductGroups pgs WHERE pgs.ProductGroupID = Products.ProductGroupID) + ''')' + ', ' + CAST(Price AS Nvarchar(36)) + ', ' + CASE WHEN HasHappyHour = 1 THEN 'true' ELSE 'false' END + ', ' + CASE WHEN IsActive = 1 THEN 'true' ELSE 'false' END + ', ' + CASE WHEN IsNotAvailable = 1 THEN 'true' ELSE 'false' END + ', ' + CAST(SortOrder AS Nvarchar(36)) + ', ' + CAST(Quantity AS Nvarchar(36)) + ');' FROM Test.dbo.Products;"
|
||||
call:copyQuery l-Modifiers "SELECT 'INSERT INTO modifiers(id, name, show_in_bill, is_active, modifier_category_id, price) VALUES (''' + CAST(ModifierID AS Nvarchar(36)) + ''', ' + '''' + REPLACE(Name, '''', '''''') + '''' + ', ' + CASE WHEN ShowInBill = 1 THEN 'true' ELSE 'false' END + ', true, ''e046ad33-dc65-4c78-8833-c3d3538d44c0'', ' + CAST(Price AS Nvarchar(36)) + ');' FROM Test.dbo.Modifiers;"
|
||||
call:copyQuery m-Sections "SELECT 'INSERT INTO sections(id, name) VALUES (''' + CAST(NewID() AS Nvarchar(36)) + ''', ''' + Location + ''');' FROM Test.dbo.PrintLocations GROUP BY Location;"
|
||||
call:copyQuery n-Printers "SELECT 'INSERT INTO printers(id, name, address, cut_code) VALUES (''' + CAST(NewID() AS Nvarchar(36)) + ''', ''' + Printer + ''', ''' + Printer + ''', ''' + CutCode + ''');' FROM Test.dbo.PrintLocations GROUP BY Printer, CutCode;"
|
||||
call:copyQuery o-SectionPrinters "SELECT 'INSERT INTO section_printers(id, menu_category_id, section_id, printer_id, copies) VALUES (''' + CAST(PrintLocationID AS Nvarchar(36)) + ''', ' + COALESCE('''' + CAST(ProductGroupID AS Nvarchar(36)) + '''','null') + ', ' + '(select id from sections where name = ''' + Location + ''')' + ', ' + '(select id from printers where name = ''' + Printer + ''')' + ', ' + CAST(Copies AS nvarchar(36)) + ');' FROM Test.dbo.PrintLocations;"
|
||||
|
||||
call:copyQuery p-Vouchers "SELECT 'INSERT INTO vouchers(id, date, pax, user_id, creation_date, last_edit_date, bill_id, food_table_id, customer_id, narration, reason, voucher_type, kot_id) VALUES (''' + CAST(VoucherID AS Nvarchar(36)) + ''', ' + '''' + CONVERT(Nvarchar(36), Date, 126) + ''', ' + COALESCE(CAST(Pax AS Nvarchar(36)), 'null') + ', ''' + CAST(UserID AS Nvarchar(36)) + ''', ' + '''' + CONVERT(Nvarchar(36), CreationDate, 126) + ''', ' + '''' + CONVERT(Nvarchar(36), LastEditDate, 126) + ''', ' + COALESCE(CAST(BillID AS Nvarchar(36)), 'null') + ', ' + '''' + CAST(TableID AS Nvarchar(36)) + ''', ' + '''' + CAST(CustomerID AS Nvarchar(36)) + ''', ' + COALESCE('''' + REPLACE(Narration, '''', '''''') + '''', 'null') + ', ' + COALESCE('''' + REPLACE(VoidReason, '''', '''''') + '''', 'null') + ', ' + CASE WHEN Printed = 0 THEN '0' WHEN Void = 1 THEN '5' ELSE CAST(VoucherType AS Nvarchar(36)) END + ', ' + CAST(KotID AS Nvarchar(36)) + ');' FROM Test.dbo.Vouchers;"
|
||||
call:copyQuery q-Kots "SELECT 'INSERT INTO kots(id, voucher_id, code, food_table_id, date, user_id) VALUES (''' + CAST(KotID AS Nvarchar(36)) + ''', ' + '''' + CAST(VoucherID AS Nvarchar(36)) + '''' + ', ' + CAST(Code AS Nvarchar(36)) + ', ' + '''' + CAST(TableID AS Nvarchar(36)) + '''' + ', ' + '''' + CONVERT(Nvarchar(36), Date, 126) + ''', ''' + CAST(UserID AS Nvarchar(36)) + ''');' FROM Test.dbo.Kots;"
|
||||
call:copyQuery r-Inventories "SELECT 'INSERT INTO inventories(id, kot_id, product_id, sort_order, quantity, price, is_happy_hour, tax_rate, tax_id, discount) VALUES (''' + CAST(InventoryID AS Nvarchar(36)) + ''', ' + '''' + CAST(KotID AS Nvarchar(36)) + '''' + ', ' + '''' + CAST(ProductID AS Nvarchar(36)) + '''' + ', ' + CAST(SortOrder AS Nvarchar(36)) + ', ' + CAST(Quantity AS Nvarchar(36)) + ', ' + CAST(Price AS Nvarchar(36)) + ', ' + CASE WHEN IsHappyHour = 1 THEN 'true' ELSE 'false' END + ', ' + CAST(VatRate AS Nvarchar(36)) + ', ' + '''' + CAST(VatID AS Nvarchar(36)) + '''' + ', ' + CAST(Discount AS Nvarchar(36)) + ');' FROM Test.dbo.Inventories;"
|
||||
call:copyQuery s-InventoryModifiers "SELECT 'INSERT INTO inventory_modifiers(id, inventory_id, modifier_id, price) VALUES (''' + CAST(InventoryModifierID AS Nvarchar(36)) + ''', ' + '''' + CAST(InventoryID AS Nvarchar(36)) + '''' + ', ' + '''' + CAST(ModifierID AS Nvarchar(36)) + '''' + ', 0);' FROM Test.dbo.InventoryModifiers;"
|
||||
call:copyQuery t-Overview "SELECT 'INSERT INTO overview(id, voucher_id, food_table_id, status) VALUES (''' + CAST(newid() AS Nvarchar(36)) + ''', ' + '''' + CAST(VoucherID AS Nvarchar(36)) + ''', ' + '''' + CAST(FoodTableID AS Nvarchar(36)) + ''', ' + '''' + Status + ''');' FROM Test.dbo.FoodTables WHERE VoucherID IS NOT NULL;"
|
||||
|
||||
call:copyQuery u-ProductGroupModifiers "SELECT 'INSERT INTO product_group_modifiers(id, product_group_id, modifier_id, show_automatically) VALUES (''' + CAST(ProductGroupModifierID AS Nvarchar(36)) + ''', ' + COALESCE('''' + CAST(ProductGroupID AS Nvarchar(36)) + '''','null') + ', ' + COALESCE('''' + CAST(ModifierID AS Nvarchar(36)) + '''','null') + ', ' + CASE WHEN ShowAutomatically = 1 THEN 'true' ELSE 'false' END + ');' FROM Test.dbo.ProductGroupModifiers;"
|
||||
call:copyQuery v-Reprints "SELECT 'INSERT INTO reprints(id, user_id, date, voucher_id) VALUES (''' + CAST(ReprintID AS Nvarchar(36)) + ''', ' + '''' + CAST(UserID AS Nvarchar(36)) + '''' + ', ' + '''' + CONVERT(Nvarchar(36), Date, 126) + '''' + ', ' + '''' + CAST(VoucherID AS Nvarchar(36)) + '''' + ');' FROM Test.dbo.Reprints;"
|
||||
call:copyQuery w-Settings "SELECT 'INSERT INTO public.settings(id, name, data) VALUES (''' + CAST(SettingID AS Nvarchar(36)) + ''', ' + '''' + REPLACE(Name, '''', '''''') + '''' + ', ' + '''' + REPLACE(Details, '''', '''''') + '''' + ');' FROM Test.dbo.Settings;"
|
||||
|
||||
call:copyQuery x-VoucherSettlements "SELECT 'INSERT INTO settlements(id, voucher_id, settled, amount) VALUES (''' + CAST(VoucherSettlementID AS Nvarchar(36)) + ''', ' + '''' + CAST(VoucherID AS Nvarchar(36)) + '''' + ', ' + CAST(Settled AS Nvarchar(36)) + ', ' + CAST(Amount AS Nvarchar(36)) + ');' FROM Test.dbo.VoucherSettlements;"
|
||||
call:copyQuery a-Roles "SELECT GroupID, Name FROM Test.dbo.Auth_Groups;"
|
||||
call:copyQuery b-Permissions "SELECT RoleID, Name FROM Test.dbo.Auth_Roles;"
|
||||
call:copyQuery c-RolePermissions "SELECT RoleGroupID, RoleID, GroupID FROM Test.dbo.Auth_RoleGroups;"
|
||||
call:copyQuery d-Users "SELECT UserID, Name, Password, CASE WHEN LockedOut = 1 THEN 't' ELSE 'f' END FROM Test.dbo.Auth_Users;"
|
||||
call:copyQuery e-UserRoles "SELECT UserGroupID, UserID, GroupID FROM Test.dbo.Auth_UserGroups;"
|
||||
call:copyQuery f-Customers "SELECT CustomerID, Name, CASE WHEN Address = '' THEN '\N' ELSE Address END, Phone + ' ' + Name FROM Test.dbo.Customers WHERE CustomerID != '2c716f4b-0736-429a-ad51-610d7c47cb5e';"
|
||||
call:copyQuery g-FoodTables "SELECT FoodTableID, Name, 0, CASE WHEN IsActive = 1 THEN 't' ELSE 'f' END, '3f13f6e7-dc76-4fca-8fdb-b2bbf29b35df', SortOrder FROM Test.dbo.FoodTables;"
|
||||
call:copyQuery h-Taxes "SELECT TaxID, Name, Rate, 'f' FROM Test.dbo.Taxes;"
|
||||
call:copyQuery i-MenuCategories "SELECT ProductGroupID, Name, DiscountLimit, CASE WHEN IsActive = 1 THEN 't' ELSE 'f' END, 'f', SortOrder FROM Test.dbo.ProductGroups;"
|
||||
call:copyQuery j-SaleCategories "SELECT newid(), pgo.GroupType, CAST((select top 1 t.TaxID from Test.dbo.Taxes t inner join Test.dbo.Products p on t.TaxID = p.VatID inner join Test.dbo.ProductGroups pg on p.ProductGroupID = pg.ProductGroupID where pg.GroupType = pgo.GroupType) AS Nvarchar(36)) FROM (select distinct pgx.GroupType from Test.dbo.ProductGroups pgx) as pgo;"
|
||||
call:copyQuery k-Products "SELECT ProductID, Name, COALESCE(Units, '\N'), ProductGroupID, (SELECT GroupType FROM Test.dbo.ProductGroups pgs WHERE pgs.ProductGroupID = Products.ProductGroupID), Price, CASE WHEN HasHappyHour = 1 THEN 't' ELSE 'f' END , CASE WHEN IsActive = 1 THEN 't' ELSE 'f' END, CASE WHEN IsNotAvailable = 1 THEN 't' ELSE 'f' END, SortOrder, Quantity FROM Test.dbo.Products;"
|
||||
call:copyQuery l-Modifiers "SELECT ModifierID, Name, CASE WHEN ShowInBill = 1 THEN 't' ELSE 'f' END, 't', 'e046ad33-dc65-4c78-8833-c3d3538d44c0', Price FROM Test.dbo.Modifiers;"
|
||||
call:copyQuery m-Sections "SELECT NewID(), Location, 'f' FROM Test.dbo.PrintLocations GROUP BY Location;"
|
||||
call:copyQuery n-Printers "SELECT NewID(), Printer, Printer, CutCode FROM Test.dbo.PrintLocations GROUP BY Printer, CutCode;"
|
||||
call:copyQuery o-SectionPrinters "SELECT PrintLocationID, COALESCE(CAST(ProductGroupID AS Nvarchar(36)), '\N'), Location, Printer, Copies FROM Test.dbo.PrintLocations;"
|
||||
call:copyQuery p-Vouchers "SELECT VoucherID, Date, Pax, UserID, CreationDate, LastEditDate, COALESCE(CAST(BillID AS Nvarchar(36)), '\N'), TableID, CustomerID, COALESCE(Narration, '\N'), VoidReason, CASE WHEN Printed = 0 THEN '0' WHEN Void = 1 THEN '5' ELSE VoucherType END, KotID FROM Test.dbo.Vouchers;"
|
||||
call:copyQuery q-Kots "SELECT KotID, VoucherID, Code, TableID, Date, UserID FROM Test.dbo.Kots;"
|
||||
call:copyQuery r-Inventories "SELECT InventoryID, KotID, ProductID, SortOrder, Quantity, Price, CASE WHEN IsHappyHour = 1 THEN 't' ELSE 'f' END, VatRate, VatID, Discount FROM Test.dbo.Inventories;"
|
||||
call:copyQuery s-InventoryModifiers "SELECT InventoryModifierID, InventoryID, ModifierID, 0 FROM Test.dbo.InventoryModifiers;"
|
||||
call:copyQuery t-Overview "SELECT newid(), VoucherID, FoodTableID, Status FROM Test.dbo.FoodTables WHERE VoucherID IS NOT NULL;"
|
||||
call:copyQuery u-ProductGroupModifiers "SELECT ProductGroupModifierID, COALESCE(CAST(ProductGroupID AS Nvarchar(36)),'\N'), ModifierID, CASE WHEN ShowAutomatically = 1 THEN 't' ELSE 'f' END FROM Test.dbo.ProductGroupModifiers;"
|
||||
call:copyQuery v-Reprints "SELECT ReprintID, UserID, Date, VoucherID FROM Test.dbo.Reprints;"
|
||||
call:copyQuery w-Settings "SELECT SettingID, Name, Details FROM Test.dbo.Settings;"
|
||||
call:copyQuery x-VoucherSettlements "SELECT VoucherSettlementID, VoucherID, Settled, Amount FROM Test.dbo.VoucherSettlements;"
|
||||
goto:eof
|
||||
|
||||
:copyQuery - here starts my function identified by it's label
|
||||
echo.
|
||||
echo. Copying %~1
|
||||
bcp "%~2" queryout Data\%~1.sql -c -t',' -S . -U sa -P 123456
|
||||
bcp "%~2" queryout csv\%~1.csv -c -t\t -S . -U sa -P 123456
|
||||
goto:eof
|
||||
|
|
|
@ -1,91 +0,0 @@
|
|||
"""devices
|
||||
|
||||
Revision ID: 00878740057e
|
||||
Revises: 8c06ac60d125
|
||||
Create Date: 2020-10-27 14:02:39.859733
|
||||
|
||||
"""
|
||||
import sqlalchemy as sa
|
||||
|
||||
from alembic import op
|
||||
from sqlalchemy import column, table
|
||||
from sqlalchemy.dialects import postgresql
|
||||
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = "00878740057e"
|
||||
down_revision = "8c06ac60d125"
|
||||
branch_labels = None
|
||||
depends_on = None
|
||||
|
||||
|
||||
def upgrade():
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.create_table(
|
||||
"login_history",
|
||||
sa.Column("login_history_id", postgresql.UUID(as_uuid=True), nullable=False),
|
||||
sa.Column("user_id", postgresql.UUID(as_uuid=True), nullable=False),
|
||||
sa.Column("device_id", postgresql.UUID(as_uuid=True), nullable=False),
|
||||
sa.Column("date", sa.DateTime(timezone=True), nullable=False),
|
||||
sa.ForeignKeyConstraint(["device_id"], ["devices.id"], name=op.f("fk_login_history_device_id_devices")),
|
||||
sa.ForeignKeyConstraint(["user_id"], ["users.id"], name=op.f("fk_login_history_user_id_users")),
|
||||
sa.PrimaryKeyConstraint("login_history_id", name=op.f("pk_login_history")),
|
||||
sa.UniqueConstraint("user_id", "device_id", "date", name=op.f("uq_login_history_user_id")),
|
||||
)
|
||||
op.drop_table("clients")
|
||||
op.add_column("devices", sa.Column("enabled", sa.Boolean(), nullable=False))
|
||||
op.add_column("devices", sa.Column("creation_date", sa.DateTime(timezone=True), nullable=False))
|
||||
op.alter_column("food_tables", "seats", existing_type=sa.NUMERIC(), type_=sa.Integer(), existing_nullable=False)
|
||||
op.alter_column(
|
||||
"food_tables", "sort_order", existing_type=sa.NUMERIC(), type_=sa.Integer(), existing_nullable=False
|
||||
)
|
||||
op.alter_column(
|
||||
"menu_categories", "sort_order", existing_type=sa.NUMERIC(), type_=sa.Integer(), existing_nullable=False
|
||||
)
|
||||
op.alter_column(
|
||||
"modifier_categories", "sort_order", existing_type=sa.NUMERIC(), type_=sa.Integer(), existing_nullable=False
|
||||
)
|
||||
op.alter_column("products", "sort_order", existing_type=sa.NUMERIC(), type_=sa.Integer(), existing_nullable=False)
|
||||
op.add_column("sections", sa.Column("is_fixture", sa.Boolean(), nullable=True))
|
||||
section = table("sections", column("id", postgresql.UUID(as_uuid=True)), column("is_fixture", sa.Boolean()))
|
||||
op.execute(
|
||||
section.update()
|
||||
.where(section.c.id == op.inline_literal("3f13f6e7-dc76-4fca-8fdb-b2bbf29b35df"))
|
||||
.values({"is_fixture": op.inline_literal(True)})
|
||||
)
|
||||
op.execute(
|
||||
section.update()
|
||||
.where(section.c.id != op.inline_literal("3f13f6e7-dc76-4fca-8fdb-b2bbf29b35df"))
|
||||
.values({"is_fixture": op.inline_literal(False)})
|
||||
)
|
||||
op.alter_column("sections", "is_fixture", nullable=False)
|
||||
# ### end Alembic commands ###
|
||||
|
||||
|
||||
def downgrade():
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.drop_column("sections", "is_fixture")
|
||||
op.alter_column("products", "sort_order", existing_type=sa.Integer(), type_=sa.NUMERIC(), existing_nullable=False)
|
||||
op.alter_column(
|
||||
"modifier_categories", "sort_order", existing_type=sa.Integer(), type_=sa.NUMERIC(), existing_nullable=False
|
||||
)
|
||||
op.alter_column(
|
||||
"menu_categories", "sort_order", existing_type=sa.Integer(), type_=sa.NUMERIC(), existing_nullable=False
|
||||
)
|
||||
op.alter_column(
|
||||
"food_tables", "sort_order", existing_type=sa.Integer(), type_=sa.NUMERIC(), existing_nullable=False
|
||||
)
|
||||
op.alter_column("food_tables", "seats", existing_type=sa.Integer(), type_=sa.NUMERIC(), existing_nullable=False)
|
||||
op.drop_column("devices", "enabled")
|
||||
op.create_table(
|
||||
"clients",
|
||||
sa.Column("id", sa.INTEGER(), autoincrement=True, nullable=False),
|
||||
sa.Column("name", sa.VARCHAR(length=255), autoincrement=False, nullable=False),
|
||||
sa.Column("enabled", sa.BOOLEAN(), autoincrement=False, nullable=False),
|
||||
sa.Column("otp", sa.INTEGER(), autoincrement=False, nullable=True),
|
||||
sa.Column("creation_date", postgresql.TIMESTAMP(timezone=True), autoincrement=False, nullable=False),
|
||||
sa.PrimaryKeyConstraint("id", name="pk_clients"),
|
||||
sa.UniqueConstraint("name", name="uq_clients_name"),
|
||||
)
|
||||
op.drop_table("login_history")
|
||||
# ### end Alembic commands ###
|
|
@ -0,0 +1,74 @@
|
|||
"""devices1
|
||||
|
||||
Revision ID: 34fe3d061c5f
|
||||
Revises: 8c06ac60d125
|
||||
Create Date: 2020-10-27 19:38:48.445908
|
||||
|
||||
"""
|
||||
import sqlalchemy as sa
|
||||
|
||||
from alembic import op
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
from sqlalchemy import column, select, table
|
||||
from sqlalchemy.dialects import postgresql
|
||||
|
||||
|
||||
revision = "34fe3d061c5f"
|
||||
down_revision = "8c06ac60d125"
|
||||
branch_labels = None
|
||||
depends_on = None
|
||||
|
||||
|
||||
def upgrade():
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
product = table(
|
||||
"products", column("sale_category_id", postgresql.UUID()), column("sale_category_name", sa.Unicode(length=255))
|
||||
)
|
||||
sale_category = table("sale_categories", column("id", postgresql.UUID()), column("name", sa.Unicode(length=255)))
|
||||
op.execute(
|
||||
product.update(
|
||||
values={
|
||||
"sale_category_id": select([sale_category.c.id]).where(
|
||||
product.c.sale_category_name == sale_category.c.name
|
||||
)
|
||||
}
|
||||
)
|
||||
)
|
||||
|
||||
section_printer = table(
|
||||
"section_printers",
|
||||
column("section_id", postgresql.UUID()),
|
||||
column("section_name", sa.Unicode(length=255)),
|
||||
column("printer_id", postgresql.UUID()),
|
||||
column("printer_name", sa.Unicode(length=255)),
|
||||
)
|
||||
section = table("sections", column("id", postgresql.UUID()), column("name", sa.Unicode(length=255)))
|
||||
printer = table("printers", column("id", postgresql.UUID()), column("name", sa.Unicode(length=255)))
|
||||
op.execute(
|
||||
section_printer.update(
|
||||
values={"section_id": select([section.c.id]).where(section_printer.c.section_name == section.c.name)}
|
||||
)
|
||||
)
|
||||
op.execute(
|
||||
section_printer.update(
|
||||
values={"printer_id": select([printer.c.id]).where(section_printer.c.printer_name == printer.c.name)}
|
||||
)
|
||||
)
|
||||
with op.batch_alter_table("products") as batch_op:
|
||||
batch_op.alter_column("sale_category_id", nullable=True)
|
||||
batch_op.drop_column("sale_category_name")
|
||||
with op.batch_alter_table("section_printers") as batch_op:
|
||||
batch_op.alter_column("section_id", nullable=True)
|
||||
batch_op.drop_column("section_name")
|
||||
batch_op.alter_column("printer_id", nullable=True)
|
||||
batch_op.drop_column("printer_name")
|
||||
# ### end Alembic commands ###
|
||||
|
||||
|
||||
def downgrade():
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.add_column("products", sa.Column("sale_category_name", sa.Unicode(length=255), nullable=False))
|
||||
op.drop_constraint("fk_products_sale_category_id_sale_categories", "products", type_="foreignkey")
|
||||
op.drop_column("products", "sale_category_id")
|
||||
# ### end Alembic commands ###
|
|
@ -22,23 +22,12 @@ depends_on = None
|
|||
|
||||
def upgrade():
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.create_table(
|
||||
"clients",
|
||||
sa.Column("id", sa.Integer(), nullable=False),
|
||||
sa.Column("name", sa.Unicode(length=255), nullable=False),
|
||||
sa.Column("enabled", sa.Boolean(), nullable=False),
|
||||
sa.Column("otp", sa.Integer(), nullable=True),
|
||||
sa.Column("creation_date", sa.DateTime(timezone=True), nullable=False),
|
||||
sa.PrimaryKeyConstraint("id", name=op.f("pk_clients")),
|
||||
sa.UniqueConstraint("name", name=op.f("uq_clients_name")),
|
||||
)
|
||||
op.create_table(
|
||||
"customers",
|
||||
sa.Column("id", postgresql.UUID(), nullable=False),
|
||||
sa.Column("company", sa.Unicode(length=255), nullable=False),
|
||||
sa.Column("name", sa.Unicode(length=255), nullable=False),
|
||||
sa.Column("phone", sa.Unicode(length=255), nullable=True),
|
||||
sa.Column("address", sa.Unicode(length=255), nullable=False),
|
||||
sa.Column("phone", sa.Unicode(length=255), nullable=False),
|
||||
sa.Column("address", sa.Unicode(length=255), nullable=True),
|
||||
sa.PrimaryKeyConstraint("id", name=op.f("pk_customers")),
|
||||
sa.UniqueConstraint("phone", name=op.f("uq_customers_phone")),
|
||||
)
|
||||
|
@ -49,7 +38,7 @@ def upgrade():
|
|||
sa.Column("discount_limit", sa.Numeric(), nullable=False),
|
||||
sa.Column("is_active", sa.Boolean(), nullable=False),
|
||||
sa.Column("is_fixture", sa.Boolean(), nullable=False),
|
||||
sa.Column("sort_order", sa.Numeric(), nullable=False),
|
||||
sa.Column("sort_order", sa.Integer(), nullable=False),
|
||||
sa.PrimaryKeyConstraint("id", name=op.f("pk_menu_categories")),
|
||||
sa.UniqueConstraint("name", name=op.f("uq_menu_categories_name")),
|
||||
)
|
||||
|
@ -60,7 +49,7 @@ def upgrade():
|
|||
sa.Column("minimum", sa.Integer(), nullable=False),
|
||||
sa.Column("maximum", sa.Integer(), nullable=True),
|
||||
sa.Column("is_active", sa.Boolean(), nullable=False),
|
||||
sa.Column("sort_order", sa.Numeric(), nullable=False),
|
||||
sa.Column("sort_order", sa.Integer(), nullable=False),
|
||||
sa.PrimaryKeyConstraint("id", name=op.f("pk_modifier_categories")),
|
||||
sa.UniqueConstraint("name", name=op.f("uq_modifier_categories_name")),
|
||||
)
|
||||
|
@ -92,6 +81,7 @@ def upgrade():
|
|||
"sections",
|
||||
sa.Column("id", postgresql.UUID(), nullable=False),
|
||||
sa.Column("name", sa.Unicode(length=255), nullable=False),
|
||||
sa.Column("is_fixture", sa.Boolean(), nullable=False),
|
||||
sa.PrimaryKeyConstraint("id", name=op.f("pk_sections")),
|
||||
sa.UniqueConstraint("name", name=op.f("uq_sections_name")),
|
||||
)
|
||||
|
@ -136,18 +126,31 @@ def upgrade():
|
|||
sa.Column("id", postgresql.UUID(), nullable=False),
|
||||
sa.Column("name", sa.Unicode(length=255), nullable=False),
|
||||
sa.Column("section_id", postgresql.UUID(), nullable=False),
|
||||
sa.Column("enabled", sa.Boolean(), nullable=False),
|
||||
sa.Column("creation_date", sa.DateTime(timezone=True), nullable=False),
|
||||
sa.ForeignKeyConstraint(["section_id"], ["sections.id"], name=op.f("fk_devices_section_id_sections")),
|
||||
sa.PrimaryKeyConstraint("id", name=op.f("pk_devices")),
|
||||
sa.UniqueConstraint("name", name=op.f("uq_devices_name")),
|
||||
)
|
||||
op.create_table(
|
||||
"login_history",
|
||||
sa.Column("login_history_id", postgresql.UUID(as_uuid=True), nullable=False),
|
||||
sa.Column("user_id", postgresql.UUID(as_uuid=True), nullable=False),
|
||||
sa.Column("device_id", postgresql.UUID(as_uuid=True), nullable=False),
|
||||
sa.Column("date", sa.DateTime(timezone=True), nullable=False),
|
||||
sa.ForeignKeyConstraint(["device_id"], ["devices.id"], name=op.f("fk_login_history_device_id_devices")),
|
||||
sa.ForeignKeyConstraint(["user_id"], ["users.id"], name=op.f("fk_login_history_user_id_users")),
|
||||
sa.PrimaryKeyConstraint("login_history_id", name=op.f("pk_login_history")),
|
||||
sa.UniqueConstraint("user_id", "device_id", "date", name=op.f("uq_login_history_user_id")),
|
||||
)
|
||||
op.create_table(
|
||||
"food_tables",
|
||||
sa.Column("id", postgresql.UUID(), nullable=False),
|
||||
sa.Column("name", sa.Unicode(length=255), nullable=False),
|
||||
sa.Column("seats", sa.Numeric(), nullable=False),
|
||||
sa.Column("seats", sa.Integer(), nullable=False),
|
||||
sa.Column("section_id", postgresql.UUID(), nullable=False),
|
||||
sa.Column("is_active", sa.Boolean(), nullable=False),
|
||||
sa.Column("sort_order", sa.Numeric(), nullable=False),
|
||||
sa.Column("sort_order", sa.Integer(), nullable=False),
|
||||
sa.ForeignKeyConstraint(
|
||||
["section_id"],
|
||||
["sections.id"],
|
||||
|
@ -212,8 +215,10 @@ def upgrade():
|
|||
"section_printers",
|
||||
sa.Column("id", postgresql.UUID(), nullable=False),
|
||||
sa.Column("menu_category_id", postgresql.UUID(), nullable=True),
|
||||
sa.Column("section_id", postgresql.UUID(), nullable=False),
|
||||
sa.Column("printer_id", postgresql.UUID(), nullable=False),
|
||||
sa.Column("section_id", postgresql.UUID(), nullable=True),
|
||||
sa.Column("section_name", sa.Unicode(length=255), nullable=False),
|
||||
sa.Column("printer_id", postgresql.UUID(), nullable=True),
|
||||
sa.Column("printer_name", sa.Unicode(length=255), nullable=False),
|
||||
sa.Column("copies", sa.Integer(), nullable=False),
|
||||
sa.ForeignKeyConstraint(
|
||||
["menu_category_id"],
|
||||
|
@ -253,13 +258,14 @@ def upgrade():
|
|||
sa.Column("name", sa.Unicode(length=255), nullable=False),
|
||||
sa.Column("units", sa.Unicode(length=255), nullable=False),
|
||||
sa.Column("menu_category_id", postgresql.UUID(), nullable=False),
|
||||
sa.Column("sale_category_id", postgresql.UUID(), nullable=False),
|
||||
sa.Column("sale_category_id", postgresql.UUID(), nullable=True),
|
||||
sa.Column("sale_category_name", sa.Unicode(length=255), nullable=True),
|
||||
sa.Column("price", sa.Numeric(), nullable=False),
|
||||
sa.Column("has_happy_hour", sa.Boolean(), nullable=False),
|
||||
sa.Column("is_not_available", sa.Boolean(), nullable=False),
|
||||
sa.Column("quantity", sa.Numeric(), nullable=False),
|
||||
sa.Column("is_active", sa.Boolean(), nullable=False),
|
||||
sa.Column("sort_order", sa.Numeric(), nullable=False),
|
||||
sa.Column("sort_order", sa.Integer(), nullable=False),
|
||||
sa.ForeignKeyConstraint(
|
||||
["menu_category_id"],
|
||||
["menu_categories.id"],
|
||||
|
@ -284,7 +290,7 @@ def upgrade():
|
|||
sa.Column("last_edit_date", sa.DateTime(timezone=True), nullable=False),
|
||||
sa.Column("food_table_id", postgresql.UUID(), nullable=False),
|
||||
sa.Column("customer_id", postgresql.UUID(), nullable=True),
|
||||
sa.Column("narration", sa.Unicode(length=1000), nullable=False),
|
||||
sa.Column("narration", sa.Unicode(length=1000), nullable=True),
|
||||
sa.Column("reason", sa.Unicode(length=255), nullable=True),
|
||||
sa.Column("voucher_type", sa.Integer(), nullable=False),
|
||||
sa.Column("user_id", postgresql.UUID(), nullable=False),
|
||||
|
@ -468,7 +474,9 @@ def upgrade():
|
|||
op.execute(Permission.__table__.insert().values(id="7a04ba63-5d08-4078-9051-a6d91cce3e48", name="Section Printers"))
|
||||
op.execute(Permission.__table__.insert().values(id="d4e1d14f-f2c2-4728-9303-a0d8c74c5ea1", name="Devices"))
|
||||
op.execute(Permission.__table__.insert().values(id="5f6110ba-2d3a-41cb-9597-1157774f10cb", name="Add Devices"))
|
||||
op.execute(Section.__table__.insert().values(id="3f13f6e7-dc76-4fca-8fdb-b2bbf29b35df", name="Main"))
|
||||
op.execute(
|
||||
Section.__table__.insert().values(id="3f13f6e7-dc76-4fca-8fdb-b2bbf29b35df", name="Main", is_fixture=True)
|
||||
)
|
||||
|
||||
op.execute(
|
||||
ModifierCategory.__table__.insert().values(
|
||||
|
@ -594,7 +602,6 @@ def upgrade():
|
|||
op.execute(
|
||||
Customer.__table__.insert().values(
|
||||
id="2c716f4b-0736-429a-ad51-610d7c47cb5e",
|
||||
company="",
|
||||
name="Cash",
|
||||
phone="",
|
||||
address="",
|
||||
|
|
|
@ -23,7 +23,6 @@ class Customer(Base):
|
|||
__tablename__ = "customers"
|
||||
|
||||
id = Column("id", UUID(as_uuid=True), primary_key=True, default=uuid.uuid4)
|
||||
company = Column("company", Unicode(255), nullable=False)
|
||||
name = Column("name", Unicode(255), nullable=False)
|
||||
phone = Column("phone", Unicode(255), nullable=True, unique=True)
|
||||
address = Column("address", Unicode(255), nullable=False)
|
||||
|
@ -32,8 +31,7 @@ class Customer(Base):
|
|||
def __name__(self):
|
||||
return self.name
|
||||
|
||||
def __init__(self, company=None, name=None, phone=None, address=None, id_=None):
|
||||
self.company = company
|
||||
def __init__(self, name=None, phone=None, address=None, id_=None):
|
||||
self.name = name
|
||||
self.phone = phone
|
||||
self.address = address
|
||||
|
|
|
@ -119,7 +119,7 @@ class Voucher(Base):
|
|||
nullable=False,
|
||||
)
|
||||
customer_id = Column("customer_id", UUID(as_uuid=True), ForeignKey("customers.id"))
|
||||
narration = Column("narration", Unicode(1000), nullable=False)
|
||||
narration = Column("narration", Unicode(1000), nullable=True)
|
||||
reason = Column("reason", Unicode(255))
|
||||
_voucher_type = Column("voucher_type", Integer, nullable=False)
|
||||
user_id = Column("user_id", UUID(as_uuid=True), ForeignKey("users.id"), nullable=False)
|
||||
|
@ -175,7 +175,7 @@ class Voucher(Base):
|
|||
self.kot_id = kot_id
|
||||
self.food_table_id = food_table_id
|
||||
self.customer_id = customer_id
|
||||
self.narration = ""
|
||||
self.narration = None
|
||||
self.voucher_type = voucher_type
|
||||
self.user_id = user_id
|
||||
|
||||
|
|
|
@ -13,7 +13,7 @@ from ..core.arq import settings as redis_settings
|
|||
from ..models import DbSetting, Inventory, Printer, SectionPrinter, Voucher, VoucherType
|
||||
|
||||
|
||||
async def print_bill(voucher_id: uuid.UUID, db: Session):
|
||||
def print_bill(voucher_id: uuid.UUID, db: Session):
|
||||
voucher: Voucher = db.query(Voucher).filter(Voucher.id == voucher_id).first()
|
||||
|
||||
printer = (
|
||||
|
|
|
@ -34,9 +34,9 @@ def design_kot(voucher: Voucher, kot: Kot, items: List[Inventory], copy_number:
|
|||
)
|
||||
for item in items:
|
||||
name = "H H " + item.product.full_name if item.is_happy_hour else item.product.full_name
|
||||
s += "\n\r" + f"{item.quantity:6.2} x {name:>33}"
|
||||
s += "\n\r" + f"{item.quantity:6.2} x {name:<33}"
|
||||
for m in item.modifiers:
|
||||
s += "\n\r" + f" --- {m.name:>32}"
|
||||
s += "\n\r" + f" --- {m.modifier.name:<32}"
|
||||
s += "\n\r" + "".ljust(42, "-")
|
||||
return s
|
||||
|
||||
|
|
Loading…
Reference in New Issue