Skip to content

Commit

Permalink
Merge pull request #5 from beckf/vc-formatting
Browse files Browse the repository at this point in the history
Vc formatting
  • Loading branch information
beckf authored Feb 6, 2019
2 parents 7f1b09f + bedf32c commit 6a089a5
Show file tree
Hide file tree
Showing 15 changed files with 3,528 additions and 293 deletions.
1,885 changes: 1,632 additions & 253 deletions images.py

Large diffs are not rendered by default.

Binary file modified images/authorize.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified images/cloud_sync.icns
Binary file not shown.
Binary file modified images/cloud_sync.ico
Binary file not shown.
Binary file modified images/cloud_sync.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified images/export.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified images/export_options.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified images/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1,798 changes: 1,798 additions & 0 deletions images/logo.ai

Large diffs are not rendered by default.

Binary file modified images/password_tab.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified images/settings.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified images/sync.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
84 changes: 50 additions & 34 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,9 @@ def __init__(self):
# Settings Buttons
self.ui.btn_SaveSettings.clicked.connect(self.save_settings_button)

# Export Tab
self.ui.chk_ClearCharges.setChecked(False)

# Export Options Buttons
self.ui.btn_SaveExportOptions.clicked.connect(self.save_settings_button)

Expand Down Expand Up @@ -135,6 +138,10 @@ def __init__(self):
self.ui.txt_ExportOptionsCatalog_Item_fk.setText(self.c["vc_export_catalog_item_fk"])
if "vc_export_school_year" in self.c.keys():
self.ui.txt_ExportOptionsSchoolYear.setText(self.c["vc_export_school_year"])
if "vc_export_transaction_type" in self.c.keys():
self.ui.txt_ExportOptionsTransactionType.setText(self.c["vc_export_transaction_type"])
if "vc_export_transaction_source" in self.c.keys():
self.ui.txt_ExportOptionsTransactionSource.setText(self.c["vc_export_transaction_source"])

# Set Active Tab to Sync
self.ui.tabs.setCurrentIndex(0)
Expand Down Expand Up @@ -381,7 +388,7 @@ def export_charge_balance(self):
self.select_export_directory()

# Notify UI
self.debug_append_log("Export Started for " + str(ct))
self.debug_append_log("Export started for customer type: " + str(ct))

# !! Sale Line Export !!

Expand All @@ -405,20 +412,22 @@ def export_charge_balance(self):
saleline_export_data = []

# throw down some headers.
f = ['Person_ID',
'POS_Transaction_ID',
'Item_date',
'Quantity',
'Unit_Price',
'Tax_Amount',
'Purchase_Amount',
'Total_Amount',
'Description',
'item_category',
'Customer_Account_Number',
'Customer_Name',
'Catalog_Item_fk',
'School_Year']
f = ['person_id',
'customer_account_number',
'customer_name',
'transaction_source',
'transaction_type',
'school_year',
'item_date',
'catalog_item_fk',
'description',
'quantity',
'unit_price',
'purchase_amount',
'tax_amount',
'total_amount',
'pos_transaction_id'
]

saleline_export_data.append(f)

Expand Down Expand Up @@ -448,19 +457,20 @@ def export_charge_balance(self):
for s in i['SaleLines']['SaleLine']:
try:
saleline_single = [str(i['Customer']['companyRegistrationNumber']),
str(i['saleID']),
str(i['Customer']['companyRegistrationNumber']),
str(i['Customer']['firstName'] + " " + i['Customer']['lastName']),
self.ui.txt_ExportOptionsTransactionSource.text(),
self.ui.txt_ExportOptionsTransactionType.text(),
self.ui.txt_ExportOptionsSchoolYear.text(),
str(i['timeStamp'][:10]),
self.ui.txt_ExportOptionsCatalog_Item_fk.text(),
str(s['Item']['description']),
str(s['unitQuantity']),
str(s['unitPrice']),
self.roundup_decimal(Decimal(s['calcTax1'])),
int(s['unitQuantity']) * Decimal(s['unitPrice']),
self.roundup_decimal(Decimal(s['calcTax1'])),
self.roundup_decimal(Decimal(s['calcTotal'])),
str(s['Item']['description']),
str(s['Item']['categoryID']),
str(i['Customer']['companyRegistrationNumber']),
str(i['Customer']['firstName'] + " " + i['Customer']['lastName']),
self.ui.txt_ExportOptionsCatalog_Item_fk.text(),
self.ui.txt_ExportOptionsSchoolYear.text()
str(i['saleID'])
]
saleline_export_data.append(saleline_single)
except:
Expand All @@ -469,19 +479,23 @@ def export_charge_balance(self):
try:
if 'Item' in i["SaleLines"]["SaleLine"]:
saleline_single = [str(i['Customer']['companyRegistrationNumber']),
str(i['saleID']),
str(i["SaleLines"]["SaleLine"]['timeStamp'][:10]),
str(i["SaleLines"]["SaleLine"]['unitQuantity']),
str(i["SaleLines"]["SaleLine"]['unitPrice']),
self.roundup_decimal(Decimal(i["SaleLines"]["SaleLine"]['calcTax1'])),
int(i["SaleLines"]["SaleLine"]['unitQuantity']) * Decimal(i["SaleLines"]["SaleLine"]['unitPrice']),
self.roundup_decimal(Decimal(i["SaleLines"]["SaleLine"]['calcTotal'])),
str(i["SaleLines"]["SaleLine"]['Item']['description']),
str(i["SaleLines"]["SaleLine"]['Item']['categoryID']),
str(i['Customer']['companyRegistrationNumber']),
str(i['Customer']['firstName'] + " " + i['Customer']['lastName']),
self.ui.txt_ExportOptionsTransactionSource.text(),
self.ui.txt_ExportOptionsTransactionType.text(),
self.ui.txt_ExportOptionsSchoolYear.text(),
str(i["SaleLines"]["SaleLine"]['timeStamp'][:10]),
self.ui.txt_ExportOptionsCatalog_Item_fk.text(),
self.ui.txt_ExportOptionsSchoolYear.text()
str(i["SaleLines"]["SaleLine"]['Item']['description']),
str(i["SaleLines"]["SaleLine"]['unitQuantity']),
str(i["SaleLines"]["SaleLine"]['unitPrice']),
int(i["SaleLines"]["SaleLine"]['unitQuantity']) * Decimal(
i["SaleLines"]["SaleLine"]['unitPrice']),
self.roundup_decimal(
Decimal(i["SaleLines"]["SaleLine"]['calcTax1'])),
self.roundup_decimal(
Decimal(i["SaleLines"]["SaleLine"]['calcTotal'])),
str(i['saleID'])
]
saleline_export_data.append(saleline_single)
except:
Expand Down Expand Up @@ -667,7 +681,9 @@ def save_settings_button(self):
"client_secret": self.ui.txt_DevelSecret.text(),
"client_id": self.ui.txt_LSDevelID.text(),
"vc_export_catalog_item_fk": self.ui.txt_ExportOptionsCatalog_Item_fk.text(),
"vc_export_school_year": self.ui.txt_ExportOptionsSchoolYear.text()
"vc_export_school_year": self.ui.txt_ExportOptionsSchoolYear.text(),
"vc_export_transaction_type": self.ui.txt_ExportOptionsTransactionType.text(),
"vc_export_transaction_source": self.ui.txt_ExportOptionsTransactionSource.text()
}
# Save settings
config.save_settings(settings, "config", self.config_passwd)
Expand Down
22 changes: 20 additions & 2 deletions mainwindow.py
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ def setupUi(self, MainWindow):
self.tab_ExportOptions = QtWidgets.QWidget()
self.tab_ExportOptions.setObjectName("tab_ExportOptions")
self.gridLayoutWidget_5 = QtWidgets.QWidget(self.tab_ExportOptions)
self.gridLayoutWidget_5.setGeometry(QtCore.QRect(10, 60, 611, 81))
self.gridLayoutWidget_5.setGeometry(QtCore.QRect(10, 60, 611, 128))
self.gridLayoutWidget_5.setObjectName("gridLayoutWidget_5")
self.gridLayout_5 = QtWidgets.QGridLayout(self.gridLayoutWidget_5)
self.gridLayout_5.setContentsMargins(11, 11, 11, 11)
Expand All @@ -223,6 +223,18 @@ def setupUi(self, MainWindow):
self.txt_ExportOptionsSchoolYear = QtWidgets.QLineEdit(self.gridLayoutWidget_5)
self.txt_ExportOptionsSchoolYear.setObjectName("txt_ExportOptionsSchoolYear")
self.gridLayout_5.addWidget(self.txt_ExportOptionsSchoolYear, 1, 1, 1, 1)
self.txt_ExportOptionsTransactionSource = QtWidgets.QLineEdit(self.gridLayoutWidget_5)
self.txt_ExportOptionsTransactionSource.setObjectName("txt_ExportOptionsTransactionSource")
self.gridLayout_5.addWidget(self.txt_ExportOptionsTransactionSource, 2, 1, 1, 1)
self.txt_ExportOptionsTransactionType = QtWidgets.QLineEdit(self.gridLayoutWidget_5)
self.txt_ExportOptionsTransactionType.setObjectName("txt_ExportOptionsTransactionType")
self.gridLayout_5.addWidget(self.txt_ExportOptionsTransactionType, 3, 1, 1, 1)
self.label_24 = QtWidgets.QLabel(self.gridLayoutWidget_5)
self.label_24.setObjectName("label_24")
self.gridLayout_5.addWidget(self.label_24, 2, 0, 1, 1)
self.label_25 = QtWidgets.QLabel(self.gridLayoutWidget_5)
self.label_25.setObjectName("label_25")
self.gridLayout_5.addWidget(self.label_25, 3, 0, 1, 1)
self.label_23 = QtWidgets.QLabel(self.tab_ExportOptions)
self.label_23.setGeometry(QtCore.QRect(10, 10, 251, 16))
self.label_23.setObjectName("label_23")
Expand Down Expand Up @@ -367,8 +379,12 @@ def setupUi(self, MainWindow):
self.txtb_SyncLog.setGeometry(QtCore.QRect(20, 80, 631, 201))
self.txtb_SyncLog.setObjectName("txtb_SyncLog")
self.lbl_Icon = QtWidgets.QLabel(self.centralWidget)
self.lbl_Icon.setGeometry(QtCore.QRect(500, 10, 150, 59))
self.lbl_Icon.setGeometry(QtCore.QRect(150, 10, 500, 380))
self.lbl_Icon.setObjectName("lbl_Icon")
self.lbl_Icon.raise_()
self.lbl_SyncLog.raise_()
self.tabs.raise_()
self.txtb_SyncLog.raise_()
MainWindow.setCentralWidget(self.centralWidget)
self.mainToolBar = QtWidgets.QToolBar(MainWindow)
self.mainToolBar.setObjectName("mainToolBar")
Expand Down Expand Up @@ -442,6 +458,8 @@ def retranslateUi(self, MainWindow):
self.tabs.setTabText(self.tabs.indexOf(self.functionsTab), _translate("MainWindow", "Export"))
self.label_21.setText(_translate("MainWindow", "Catalog_Item_fk"))
self.label_22.setText(_translate("MainWindow", "School_Year"))
self.label_24.setText(_translate("MainWindow", "Trasaction_Source"))
self.label_25.setText(_translate("MainWindow", "Transaction_Type"))
self.label_23.setText(_translate("MainWindow", "Additional Veracross Import Fields"))
self.btn_SaveExportOptions.setText(_translate("MainWindow", "Save"))
self.label_20.setText(_translate("MainWindow", "<html><head/><body><p><a href=\"https://modules.veracross.com/article/how-to-import-person-charge-items\"><span style=\" text-decoration: underline; color:#0000ff;\">Importing Charge Items to Veracross</span></a></p></body></html>"))
Expand Down
32 changes: 28 additions & 4 deletions qt-lightspeed-pos-vc-connector/mainwindow.ui
Original file line number Diff line number Diff line change
Expand Up @@ -442,7 +442,7 @@ max-height: 16px;
<x>10</x>
<y>60</y>
<width>611</width>
<height>81</height>
<height>128</height>
</rect>
</property>
<layout class="QGridLayout" name="gridLayout_5">
Expand All @@ -466,6 +466,26 @@ max-height: 16px;
<item row="1" column="1">
<widget class="QLineEdit" name="txt_ExportOptionsSchoolYear"/>
</item>
<item row="2" column="1">
<widget class="QLineEdit" name="txt_ExportOptionsTransactionSource"/>
</item>
<item row="3" column="1">
<widget class="QLineEdit" name="txt_ExportOptionsTransactionType"/>
</item>
<item row="2" column="0">
<widget class="QLabel" name="label_24">
<property name="text">
<string>Trasaction_Source</string>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QLabel" name="label_25">
<property name="text">
<string>Transaction_Type</string>
</property>
</widget>
</item>
</layout>
</widget>
<widget class="QLabel" name="label_23">
Expand Down Expand Up @@ -822,16 +842,20 @@ max-height: 16px;
<widget class="QLabel" name="lbl_Icon">
<property name="geometry">
<rect>
<x>500</x>
<x>150</x>
<y>10</y>
<width>150</width>
<height>59</height>
<width>500</width>
<height>380</height>
</rect>
</property>
<property name="text">
<string>icon</string>
</property>
</widget>
<zorder>lbl_Icon</zorder>
<zorder>lbl_SyncLog</zorder>
<zorder>tabs</zorder>
<zorder>txtb_SyncLog</zorder>
</widget>
<widget class="QToolBar" name="mainToolBar">
<attribute name="toolBarArea">
Expand Down

0 comments on commit 6a089a5

Please sign in to comment.