This commit is contained in:
2022-12-25 01:09:24 +00:00
parent 67ee432a2f
commit 6906ae57d4
3 changed files with 156 additions and 92 deletions

2
.vscode/launch.json vendored
View File

@@ -35,7 +35,7 @@
"SOCKEYE_DB_CONNECTION": "Server=localhost;Username=postgres;Password=sockeye;Database=sockeye;CommandTimeout=300;", "SOCKEYE_DB_CONNECTION": "Server=localhost;Username=postgres;Password=sockeye;Database=sockeye;CommandTimeout=300;",
"SOCKEYE_DATA_PATH": "c:\\temp\\sockeye", "SOCKEYE_DATA_PATH": "c:\\temp\\sockeye",
"SOCKEYE_USE_URLS": "http://*:7676;", "SOCKEYE_USE_URLS": "http://*:7676;",
//"SOCKEYE_PERMANENTLY_ERASE_DATABASE":"true", "SOCKEYE_PERMANENTLY_ERASE_DATABASE":"true",
//"SOCKEYE_REMOVE_LICENSE_FROM_DB":"true", //"SOCKEYE_REMOVE_LICENSE_FROM_DB":"true",
//"SOCKEYE_REPORT_RENDERING_TIMEOUT":"1", //"SOCKEYE_REPORT_RENDERING_TIMEOUT":"1",
"SOCKEYE_BACKUP_PG_DUMP_PATH": "C:\\data\\code\\postgres_14\\bin" "SOCKEYE_BACKUP_PG_DUMP_PATH": "C:\\data\\code\\postgres_14\\bin"

View File

@@ -5,27 +5,52 @@
<gz-error :error-box-message="formState.errorBoxMessage"></gz-error> <gz-error :error-box-message="formState.errorBoxMessage"></gz-error>
<v-form ref="form"> <v-form ref="form">
<v-row dense> <v-row dense>
<v-col cols="12" sm="6" lg="4" xl="3">
<gz-pick-list
ref="customerId"
v-model="obj.customerId"
:aya-type="sockTypes().Customer"
show-edit-icon
:readonly="formState.readOnly"
:label="$sock.t('Customer')"
:error-messages="form().serverErrors(this, 'customerId')"
:rules="[form().required(this, 'customerId')]"
@input="fieldValueChanged('customerId')"
></gz-pick-list>
</v-col>
<v-col cols="12" sm="6" lg="4" xl="3">
<gz-pick-list
ref="productId"
v-model="obj.productId"
:aya-type="sockTypes().Product"
show-edit-icon
:readonly="formState.readOnly"
:label="$sock.t('Product')"
:error-messages="form().serverErrors(this, 'productId')"
:rules="[form().required(this, 'productId')]"
@input="fieldValueChanged('productId')"
></gz-pick-list>
</v-col>
<v-col cols="12" sm="6" lg="4" xl="3"> <v-col cols="12" sm="6" lg="4" xl="3">
<v-text-field <v-text-field
ref="name" ref="quantity"
v-model="obj.name" v-model="obj.quantity"
dense dense
:readonly="formState.readOnly" :readonly="formState.readOnly"
:label="$sock.t('PurchaseName')" :label="$sock.t('PurchaseQuantity')"
:rules="[form().required(this, 'name')]" :error-messages="form().serverErrors(this, 'quantity')"
:error-messages="form().serverErrors(this, 'name')" :rules="[form().required(this, 'quantity')]"
data-cy="name" data-cy="quantity"
@input="fieldValueChanged('name')" :counter="10"
type="number"
step="none"
@input="fieldValueChanged('quantity')"
></v-text-field> ></v-text-field>
</v-col> </v-col>
<v-col <v-col cols="12" sm="6" lg="4" xl="3">
v-if="form().showMe(this, 'Vendor')"
cols="12"
sm="6"
lg="4"
xl="3"
>
<gz-pick-list <gz-pick-list
ref="vendorId" ref="vendorId"
v-model="obj.vendorId" v-model="obj.vendorId"
@@ -39,94 +64,133 @@
></gz-pick-list> ></gz-pick-list>
</v-col> </v-col>
<v-col cols="12" sm="6" lg="4" xl="3">
<v-text-field
ref="salesOrderNumber"
v-model="obj.salesOrderNumber"
dense
:readonly="formState.readOnly"
:label="$sock.t('PurchaseSalesOrderNumber')"
:rules="[form().required(this, 'salesOrderNumber')]"
:error-messages="form().serverErrors(this, 'salesOrderNumber')"
data-cy="salesOrderNumber"
@input="fieldValueChanged('salesOrderNumber')"
></v-text-field>
</v-col>
<v-col cols="12" sm="6" lg="4" xl="3">
<gz-date-time-picker
ref="purchaseDate"
v-model="obj.purchaseDate"
:label="$sock.t('PurchaseDate')"
:rules="[form().required(this, 'purchaseDate')]"
:readonly="formState.readOnly"
:error-messages="form().serverErrors(this, 'purchaseDate')"
data-cy="purchaseDate"
@input="fieldValueChanged('purchaseDate')"
></gz-date-time-picker>
</v-col>
<v-col cols="12" sm="6" lg="4" xl="3">
<gz-date-time-picker
ref="expireDate"
v-model="obj.expireDate"
:label="$sock.t('PurchaseExpireDate')"
:readonly="formState.readOnly"
:error-messages="form().serverErrors(this, 'expireDate')"
data-cy="expireDate"
@input="fieldValueChanged('expireDate')"
></gz-date-time-picker>
</v-col>
<v-col cols="12" sm="6" lg="4" xl="3">
<gz-date-time-picker
ref="cancelDate"
v-model="obj.cancelDate"
:label="$sock.t('PurchaseCancelDate')"
:readonly="formState.readOnly"
:error-messages="form().serverErrors(this, 'cancelDate')"
data-cy="cancelDate"
@input="fieldValueChanged('cancelDate')"
></gz-date-time-picker>
</v-col>
<v-col <v-col
v-if="form().showMe(this, 'PurchaseVendorCode')" v-if="form().showMe(this, 'PurchaseCouponCode')"
cols="12" cols="12"
sm="6" sm="6"
lg="4" lg="4"
xl="3" xl="3"
> >
<v-text-field <v-text-field
ref="vendorCode" ref="couponCode"
v-model="obj.vendorCode" v-model="obj.couponCode"
dense dense
:readonly="formState.readOnly" :readonly="formState.readOnly"
:label="$sock.t('PurchaseVendorCode')" :label="$sock.t('PurchaseCouponCode')"
data-cy="vendorCode" :error-messages="form().serverErrors(this, 'couponCode')"
:error-messages="form().serverErrors(this, 'vendorCode')" data-cy="couponCode"
@input="fieldValueChanged('vendorCode')" @input="fieldValueChanged('couponCode')"
></v-text-field> ></v-text-field>
</v-col> </v-col>
<v-col
v-if="form().showMe(this, 'PurchaseOurCode')"
cols="12"
sm="6"
lg="4"
xl="3"
>
<v-text-field
ref="ourCode"
v-model="obj.ourCode"
dense
:readonly="formState.readOnly"
:label="$sock.t('PurchaseOurCode')"
data-cy="ourCode"
:error-messages="form().serverErrors(this, 'ourCode')"
@input="fieldValueChanged('ourCode')"
></v-text-field>
</v-col>
<v-col
v-if="form().showMe(this, 'PurchaseLicenseInterval')"
cols="12"
sm="6"
lg="4"
xl="3"
>
<gz-duration-picker
ref="licenseInterval"
v-model="obj.licenseInterval"
:readonly="formState.readOnly"
:label="$sock.t('PurchaseLicenseInterval')"
:show-seconds="false"
data-cy="licenseInterval"
:error-messages="form().serverErrors(this, 'licenseInterval')"
@input="fieldValueChanged('licenseInterval')"
></gz-duration-picker>
</v-col>
<v-col
v-if="form().showMe(this, 'PurchaseMaintInterval')"
cols="12"
sm="6"
lg="4"
xl="3"
>
<gz-duration-picker
ref="maintInterval"
v-model="obj.maintInterval"
:readonly="formState.readOnly"
:label="$sock.t('PurchaseMaintInterval')"
:show-seconds="false"
data-cy="maintInterval"
:error-messages="form().serverErrors(this, 'maintInterval')"
@input="fieldValueChanged('maintInterval')"
></gz-duration-picker>
</v-col>
<v-col cols="12" sm="6" lg="4" xl="3"> <v-col cols="12" sm="6" lg="4" xl="3">
<v-checkbox <v-checkbox
ref="active" ref="renewNoticeSent"
v-model="obj.active" v-model="obj.renewNoticeSent"
dense dense
:readonly="formState.readOnly" :readonly="formState.readOnly"
:label="$sock.t('Active')" :label="$sock.t('PurchaseRenewNoticeSent')"
data-cy="active" data-cy="renewNoticeSent"
:error-messages="form().serverErrors(this, 'active')" :error-messages="form().serverErrors(this, 'renewNoticeSent')"
@change="fieldValueChanged('active')" @change="fieldValueChanged('renewNoticeSent')"
></v-checkbox> ></v-checkbox>
</v-col> </v-col>
<v-col
v-if="form().showMe(this, 'PurchaseProcessedDate')"
cols="12"
sm="6"
lg="4"
xl="3"
>
<gz-date-time-picker
ref="processedDate"
v-model="obj.processedDate"
:label="$sock.t('PurchaseProcessedDate')"
:readonly="formState.readOnly"
:error-messages="form().serverErrors(this, 'processedDate')"
data-cy="processedDate"
@input="fieldValueChanged('processedDate')"
></gz-date-time-picker>
</v-col>
<v-col v-if="form().showMe(this, 'PurchaseNotes')" cols="12">
<v-textarea
ref="notes"
v-model="obj.notes"
dense
:readonly="formState.readOnly"
:label="$sock.t('PurchaseNotes')"
:error-messages="form().serverErrors(this, 'notes')"
data-cy="notes"
auto-grow
@input="fieldValueChanged('notes')"
></v-textarea>
</v-col>
<v-col v-if="form().showMe(this, 'PurchaseVendorData')" cols="12">
<v-textarea
ref="vendorData"
v-model="obj.vendorData"
dense
:readonly="formState.readOnly"
:label="$sock.t('PurchaseVendorData')"
:error-messages="form().serverErrors(this, 'vendorData')"
data-cy="vendorData"
auto-grow
@input="fieldValueChanged('vendorData')"
></v-textarea>
</v-col>
<!-- --------------------------------- --> <!-- --------------------------------- -->
<v-col v-if="form().showMe(this, 'Tags')" cols="12"> <v-col v-if="form().showMe(this, 'Tags')" cols="12">
@@ -180,8 +244,6 @@ export default {
name: null, name: null,
active: true, active: true,
vendorId: 1, vendorId: 1,
licenseInterval: "365.0:00:00",
maintInterval: "365.0:00:00",
vendorCode: null, vendorCode: null,
ourCode: null, ourCode: null,
wiki: null, wiki: null,
@@ -682,11 +744,13 @@ public string VendorData { get; set; }
public DateTime? ProcessedDate { get; set; } public DateTime? ProcessedDate { get; set; }
"CREATE TABLE apurchase (id BIGINT GENERATED ALWAYS AS IDENTITY PRIMARY KEY, customerid BIGINT NOT NULL REFERENCES acustomer(id) ON DELETE CASCADE, "
expiredate TIMESTAMPTZ, canceldate TIMESTAMPTZ, couponcode text, notes text, " + "vendorid BIGINT NOT NULL REFERENCES avendor(id), productid BIGINT NOT NULL REFERENCES aproduct(id), salesordernumber TEXT NOT NULL, "
+ "purchasedate TIMESTAMPTZ NOT NULL, expiredate TIMESTAMPTZ, canceldate TIMESTAMPTZ, couponcode text, notes text, "
+ "renewnoticesent BOOL NOT NULL DEFAULT false, quantity INTEGER NOT NULL DEFAULT 1, "
+ "vendordata TEXT, processeddate TIMESTAMPTZ, " + "vendordata TEXT, processeddate TIMESTAMPTZ, "
+ "wiki TEXT, tags VARCHAR(255) ARRAY )"); + "wiki TEXT, tags VARCHAR(255) ARRAY )");
await ExecQueryAsync("INSERT INTO atranslationitem(translationid,key,display) SELECT t.id, 'Purchase', 'Purchase' FROM atranslation t where t.baselanguage = 'en'"); await ExecQueryAsync("INSERT INTO atranslationitem(translationid,key,display) SELECT t.id, 'Purchase', 'Purchase' FROM atranslation t where t.baselanguage = 'en'");
await ExecQueryAsync("INSERT INTO atranslationitem(translationid,key,display) SELECT t.id, 'PurchaseList', 'Purchases' FROM atranslation t where t.baselanguage = 'en'"); await ExecQueryAsync("INSERT INTO atranslationitem(translationid,key,display) SELECT t.id, 'PurchaseList', 'Purchases' FROM atranslation t where t.baselanguage = 'en'");
await ExecQueryAsync("INSERT INTO atranslationitem(translationid,key,display) SELECT t.id, 'PurchaseSalesOrderNumber', 'Sales order #' FROM atranslation t where t.baselanguage = 'en'"); await ExecQueryAsync("INSERT INTO atranslationitem(translationid,key,display) SELECT t.id, 'PurchaseSalesOrderNumber', 'Sales order #' FROM atranslation t where t.baselanguage = 'en'");

View File

@@ -24,14 +24,14 @@ namespace Sockeye.Util
internal const long EXPECTED_COLUMN_COUNT = 495; internal const long EXPECTED_COLUMN_COUNT = 495;
internal const long EXPECTED_INDEX_COUNT = 71; internal const long EXPECTED_INDEX_COUNT = 71;
internal const long EXPECTED_CHECK_CONSTRAINTS = 236; internal const long EXPECTED_CHECK_CONSTRAINTS = 237;
internal const long EXPECTED_FOREIGN_KEY_CONSTRAINTS = 32; internal const long EXPECTED_FOREIGN_KEY_CONSTRAINTS = 32;
internal const long EXPECTED_VIEWS = 0; internal const long EXPECTED_VIEWS = 0;
internal const long EXPECTED_ROUTINES = 2; internal const long EXPECTED_ROUTINES = 2;
//!!!!WARNING: BE SURE TO UPDATE THE DbUtil::EmptyBizDataFromDatabaseForSeedingOrImportingAsync WHEN NEW TABLES ADDED!!!! //!!!!WARNING: BE SURE TO UPDATE THE DbUtil::EmptyBizDataFromDatabaseForSeedingOrImportingAsync WHEN NEW TABLES ADDED!!!!
///////////////////////////////////////// (C495:I71:CC236:FC32:V0:R2) ///////////////////////////////////////// (C495:I71:CC237:FC32:V0:R2)
/* /*