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_DATA_PATH": "c:\\temp\\sockeye",
"SOCKEYE_USE_URLS": "http://*:7676;",
//"SOCKEYE_PERMANENTLY_ERASE_DATABASE":"true",
"SOCKEYE_PERMANENTLY_ERASE_DATABASE":"true",
//"SOCKEYE_REMOVE_LICENSE_FROM_DB":"true",
//"SOCKEYE_REPORT_RENDERING_TIMEOUT":"1",
"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>
<v-form ref="form">
<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-text-field
ref="name"
v-model="obj.name"
ref="quantity"
v-model="obj.quantity"
dense
:readonly="formState.readOnly"
:label="$sock.t('PurchaseName')"
:rules="[form().required(this, 'name')]"
:error-messages="form().serverErrors(this, 'name')"
data-cy="name"
@input="fieldValueChanged('name')"
:label="$sock.t('PurchaseQuantity')"
:error-messages="form().serverErrors(this, 'quantity')"
:rules="[form().required(this, 'quantity')]"
data-cy="quantity"
:counter="10"
type="number"
step="none"
@input="fieldValueChanged('quantity')"
></v-text-field>
</v-col>
<v-col
v-if="form().showMe(this, 'Vendor')"
cols="12"
sm="6"
lg="4"
xl="3"
>
<v-col cols="12" sm="6" lg="4" xl="3">
<gz-pick-list
ref="vendorId"
v-model="obj.vendorId"
@@ -39,94 +64,133 @@
></gz-pick-list>
</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-if="form().showMe(this, 'PurchaseVendorCode')"
v-if="form().showMe(this, 'PurchaseCouponCode')"
cols="12"
sm="6"
lg="4"
xl="3"
>
<v-text-field
ref="vendorCode"
v-model="obj.vendorCode"
ref="couponCode"
v-model="obj.couponCode"
dense
:readonly="formState.readOnly"
:label="$sock.t('PurchaseVendorCode')"
data-cy="vendorCode"
:error-messages="form().serverErrors(this, 'vendorCode')"
@input="fieldValueChanged('vendorCode')"
:label="$sock.t('PurchaseCouponCode')"
:error-messages="form().serverErrors(this, 'couponCode')"
data-cy="couponCode"
@input="fieldValueChanged('couponCode')"
></v-text-field>
</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-checkbox
ref="active"
v-model="obj.active"
ref="renewNoticeSent"
v-model="obj.renewNoticeSent"
dense
:readonly="formState.readOnly"
:label="$sock.t('Active')"
data-cy="active"
:error-messages="form().serverErrors(this, 'active')"
@change="fieldValueChanged('active')"
:label="$sock.t('PurchaseRenewNoticeSent')"
data-cy="renewNoticeSent"
:error-messages="form().serverErrors(this, 'renewNoticeSent')"
@change="fieldValueChanged('renewNoticeSent')"
></v-checkbox>
</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">
@@ -180,8 +244,6 @@ export default {
name: null,
active: true,
vendorId: 1,
licenseInterval: "365.0:00:00",
maintInterval: "365.0:00:00",
vendorCode: null,
ourCode: null,
wiki: null,
@@ -682,11 +744,13 @@ public string VendorData { get; set; }
public DateTime? ProcessedDate { get; set; }
expiredate TIMESTAMPTZ, canceldate TIMESTAMPTZ, couponcode text, notes text, "
"CREATE TABLE apurchase (id BIGINT GENERATED ALWAYS AS IDENTITY PRIMARY KEY, customerid BIGINT NOT NULL REFERENCES acustomer(id) ON DELETE CASCADE, "
+ "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, "
+ "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, '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'");

View File

@@ -24,14 +24,14 @@ namespace Sockeye.Util
internal const long EXPECTED_COLUMN_COUNT = 495;
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_VIEWS = 0;
internal const long EXPECTED_ROUTINES = 2;
//!!!!WARNING: BE SURE TO UPDATE THE DbUtil::EmptyBizDataFromDatabaseForSeedingOrImportingAsync WHEN NEW TABLES ADDED!!!!
///////////////////////////////////////// (C495:I71:CC236:FC32:V0:R2)
///////////////////////////////////////// (C495:I71:CC237:FC32:V0:R2)
/*