This commit is contained in:
2021-05-20 19:50:58 +00:00
parent 20ab7cbc4f
commit 3ebd938ec2
3 changed files with 91 additions and 80 deletions

View File

@@ -21,7 +21,7 @@
<v-btn icon class="ml-n1 mr-2" @click="picking = true">
<v-icon>$ayiEdit</v-icon>
</v-btn>
<span @click="picking = true">{{ display }}</span>
<span>{{ display }}</span>
</div>
</template>
</div>
@@ -91,9 +91,11 @@ export default {
if (this.picking) {
return true;
}
if (this.value == null || this.display == null || this.display == "") {
if (this.display == null || this.display == "" || this.display == "-") {
return true;
}
return false;
}
}

View File

@@ -285,13 +285,15 @@
lg="4"
xl="3"
>
<gz-pick-list
:aya-type="$ay.ayt().TaxCode"
<gz-tax-picker
:show-edit-icon="true"
v-model="
value.items[activeWoItemIndex].expenses[activeItemIndex]
.chargeTaxCodeId
"
:display="
value.items[activeWoItemIndex].expenses[activeItemIndex].taxName
"
:readonly="formState.readOnly || isDeleted"
:disabled="isDeleted"
:label="$ay.t('WorkOrderItemExpenseChargeTaxCodeID')"
@@ -311,7 +313,7 @@
)
"
@update:name="taxCodeChange"
></gz-pick-list>
></gz-tax-picker>
</v-col>
<v-col
@@ -425,55 +427,11 @@
/////////////////////////////////////////////////////////////////////////////////////////////////////////////
/* XXXeslint-disable */
////////////////////////////////////////////////////////////////////////////////////////////////////////////
/*
l.Add(new FormField { TKey = "WorkOrderItemExpenseChargeAmount", FieldKey = "WorkOrderItemExpenseChargeAmount", TKeySection = "WorkOrderItemExpense" });
l.Add(new FormField { TKey = "WorkOrderItemExpenseChargeTaxCodeID", FieldKey = "WorkOrderItemExpenseChargeTaxCodeID", TKeySection = "WorkOrderItemExpense" });
l.Add(new FormField { TKey = "WorkOrderItemExpenseTaxPaid", FieldKey = "WorkOrderItemExpenseTaxPaid", TKeySection = "WorkOrderItemExpense" });
l.Add(new FormField { TKey = "WorkOrderItemExpenseChargeToCustomer", FieldKey = "WorkOrderItemExpenseChargeToCustomer", TKeySection = "WorkOrderItemExpense" });
l.Add(new FormField { TKey = "WorkOrderItemExpenseDescription", FieldKey = "WorkOrderItemExpenseDescription", TKeySection = "WorkOrderItemExpense" });
l.Add(new FormField { TKey = "WorkOrderItemExpenseName", FieldKey = "WorkOrderItemExpenseName", TKeySection = "WorkOrderItemExpense" });
l.Add(new FormField { TKey = "WorkOrderItemExpenseReimburseUser", FieldKey = "WorkOrderItemExpenseReimburseUser", TKeySection = "WorkOrderItemExpense" });
l.Add(new FormField { TKey = "WorkOrderItemExpenseTotalCost", FieldKey = "WorkOrderItemExpenseTotalCost", TKeySection = "WorkOrderItemExpense" });
l.Add(new FormField { TKey = "WorkOrderItemExpenseUserID", FieldKey = "WorkOrderItemExpenseUserID", TKeySection = "WorkOrderItemExpense" });
public string Description { get; set; }
public string Name { get; set; }
[Required]
public decimal TotalCost { get; set; }
[Required]
public decimal ChargeAmount { get; set; }
[Required]
public decimal TaxPaid { get; set; }
public long? ChargeTaxCodeId { get; set; }
[NotMapped]
public string ChargeTaxCodeViz { get; set; }
public bool ReimburseUser { get; set; } = false;
public long? UserId { get; set; }
[NotMapped]
public string UserViz { get; set; }
public bool ChargeToCustomer { get; set; } = false;
await ExecQueryAsync("CREATE TABLE aworkorderitemexpense (id BIGINT GENERATED ALWAYS AS IDENTITY PRIMARY KEY, workorderitemid BIGINT NOT NULL REFERENCES aworkorderitem (id), "
+ "description TEXT, name TEXT, totalcost DECIMAL(38,18) NOT NULL default 0, chargeamount DECIMAL(38,18) NOT NULL default 0, taxpaid DECIMAL(38,18) NOT NULL default 0, "
+ "chargetaxcodeid BIGINT REFERENCES ataxcode, reimburseuser BOOL NOT NULL, userid BIGINT REFERENCES auser, chargetocustomer BOOL NOT NULL"
+ ")");
"WorkOrderItemExpenseChargeAmount": "Charge Amount",
"WorkOrderItemExpenseChargeTaxCodeID": "Charge Tax Code",
"WorkOrderItemExpenseChargeToCustomer": "Charge to customer?",
"WorkOrderItemExpenseDescription": "Description",
"WorkOrderItemExpenseList": "Expenses",
"WorkOrderItemExpenseName": "Misc Exp Summary",
"WorkOrderItemExpenseReimburseUser": "Reimburse User?",
"WorkOrderItemExpenseTaxPaid": "Tax Paid",
"WorkOrderItemExpenseTotalCost": "Total Cost",
"WorkOrderItemExpenseUserID": "User",
*/
import GzTaxPicker from "./tax-picker.vue";
export default {
components: {
GzTaxPicker
},
created() {
this.setDefaultView();
},
@@ -513,7 +471,7 @@ export default {
taxCodeChange(newName) {
this.value.items[this.activeWoItemIndex].expenses[
this.activeItemIndex
].chargeTaxCodeViz = newName;
].taxName = newName;
},
newItem() {
let newIndex = this.value.items[this.activeWoItemIndex].expenses.length;
@@ -672,9 +630,57 @@ export default {
if (this.form().showMe(this, "WorkOrderItemExpenseChargeTaxCodeID")) {
headers.push({
text: this.$ay.t("WorkOrderItemExpenseChargeTaxCodeID"),
text: this.$ay.t("Tax"),
align: "left",
value: "chargeTaxCodeViz"
value: "taxName"
});
}
if (this.form().showMe(this, "ExpenseTaxAPct")) {
headers.push({
text: this.$ay.t("TaxCodeTaxA"),
align: "right",
value: "taxAPct"
});
}
if (this.form().showMe(this, "ExpenseTaxBPct")) {
headers.push({
text: this.$ay.t("TaxCodeTaxB"),
align: "right",
value: "taxBPct"
});
}
if (this.form().showMe(this, "ExpenseTaxAViz")) {
headers.push({
text: this.$ay.t("TaxAAmt"),
align: "right",
value: "taxAViz"
});
}
if (this.form().showMe(this, "ExpenseTaxBViz")) {
headers.push({
text: this.$ay.t("TaxBAmt"),
align: "right",
value: "taxBViz"
});
}
if (this.form().showMe(this, "ExpenseTaxOnTax")) {
headers.push({
text: this.$ay.t("TaxCodeTaxOnTax"),
align: "center",
value: "taxOnTax"
});
}
if (this.form().showMe(this, "ExpenseLineTotalViz")) {
headers.push({
text: this.$ay.t("LineTotal"),
align: "right",
value: "lineTotalViz"
});
}
@@ -718,7 +724,33 @@ export default {
this.pvm.languageName,
this.pvm.currencyName
),
chargeTaxCodeViz: x.chargeTaxCodeViz,
taxName: x.taxName,
taxAPct:
window.$gz.locale.decimalLocalized(
x.taxAPct,
this.pvm.languageName
) + "%",
taxBPct:
window.$gz.locale.decimalLocalized(
x.taxBPct,
this.pvm.languageName
) + "%",
taxOnTax: x.taxOnTax,
taxAViz: window.$gz.locale.currencyLocalized(
x.taxAViz,
this.pvm.languageName,
this.pvm.currencyName
),
taxBViz: window.$gz.locale.currencyLocalized(
x.taxBViz,
this.pvm.languageName,
this.pvm.currencyName
),
lineTotalViz: window.$gz.locale.currencyLocalized(
x.lineTotalViz,
this.pvm.languageName,
this.pvm.currencyName
),
reimburseUser: x.reimburseUser,
userViz: x.userViz
};

View File

@@ -465,30 +465,7 @@
/* XXXeslint-disable */
////////////////////////////////////////////////////////////////////////////////////////////////////////////
import GzTaxPicker from "./tax-picker.vue";
/*
"cost": 0,
"listPrice": 0,
"price": 0,
"taxName": null,
"taxAPct": 0,
"taxBPct": 0,
"taxOnTax": false,
"taxAViz": 0,
"taxBViz": 0,
"lineTotalViz": 0,
l.Add(new FormField { TKey = "Cost", FieldKey = "LaborCost", TKeySection = "WorkOrderItemLabors" });
l.Add(new FormField { TKey = "ListPrice", FieldKey = "LaborListPrice", TKeySection = "WorkOrderItemLabors" });
l.Add(new FormField { TKey = "Price", FieldKey = "LaborPrice", TKeySection = "WorkOrderItemLabors" });
l.Add(new FormField { TKey = "Tax", FieldKey = "LaborTaxName", TKeySection = "WorkOrderItemLabors" });
l.Add(new FormField { TKey = "TaxCodeTaxA", FieldKey = "LaborTaxAPct", TKeySection = "WorkOrderItemLabors" });
l.Add(new FormField { TKey = "TaxCodeTaxB", FieldKey = "LaborTaxBPct", TKeySection = "WorkOrderItemLabors" });
l.Add(new FormField { TKey = "TaxCodeTaxOnTax", FieldKey = "LaborTaxOnTax", TKeySection = "WorkOrderItemLabors" });
l.Add(new FormField { TKey = "TaxAAmt", FieldKey = "LaborTaxAViz", TKeySection = "WorkOrderItemLabors" });
l.Add(new FormField { TKey = "TaxBAmt", FieldKey = "LaborTaxBViz", TKeySection = "WorkOrderItemLabors" });
l.Add(new FormField { TKey = "LineTotal", FieldKey = "LaborLineTotalViz", TKeySection = "WorkOrderItemLabors" });
*/
export default {
components: {
GzTaxPicker