Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
61 changes: 30 additions & 31 deletions src/modules/purchasing/purchase-order-external/data-form.html
Original file line number Diff line number Diff line change
Expand Up @@ -75,14 +75,34 @@
options.bind="controlOptions">
</au-dropdown>

<au-dropdown label="Term Pembayaran"
value.bind="data.paymentMethod"
error.bind="error.paymentMethod"
read-only.bind="readOnly"
items.bind="termPaymentOptions"
change.delegate="paymentMethodChanged($event)"
options.bind="controlOptions">p
</au-dropdown>
<au-textbox
if.bind="readOnly"
label="Term Pembayaran"
value.one-way="data.paymentMethod"
error.bind="error.paymentMethod"
read-only.bind="true"
options.bind="controlOptions">
</au-textbox>

<au-autocomplete
if.bind="!readOnly"
label="Term Pembayaran"
value.bind="top"
error.bind="error.TermOfPayment"
read-only.bind="readOnly"
loader.bind="topLoader"
text.bind="topLoaderView"
placeholder="Cari Term Pembayaran"
options.bind="controlOptions">
</au-autocomplete>

<!-- <numeric label="Tempo Pembayaran"
value.bind="data.paymentDueDays"
error.bind="error.paymentDueDays"
format="0"
read-only.bind="true"
post-fix="hari">
</numeric> -->

<au-dropdown if.bind="data.paymentMethod=='CASH'"
label="Jenis PO Cash"
Expand Down Expand Up @@ -126,35 +146,14 @@
read-only.bind="true">
</numeric>

<au-autocomplete
label="Term of Payment"
value.bind="top"
error.bind="error.TermOfPayment"
read-only.bind="readOnly"
loader.bind="topLoader"
text.bind="topLoaderView"
if.bind="data.paymentMethod!='CASH'"
placeholder="Cari Term of Payment"
options.bind="controlOptions">
</au-autocomplete>

<numeric label="Tempo Pembayaran"
value.bind="data.paymentDueDays"
error.bind="error.paymentDueDays"
format="0"
read-only.bind="true"
post-fix="hari"
if.bind="data.paymentMethod=='CASH'">
</numeric>

<numeric label="Tempo Pembayaran"
<!-- <numeric label="Tempo Pembayaran"
value.bind="data.paymentDueDays"
error.bind="error.paymentDueDays"
format="0"
read-only.bind="readOnly"
post-fix="hari"
if.bind="data.paymentMethod!='CASH'">
</numeric>
</numeric> -->

<!-- <au-autocomplete value.bind="selectedIncomeTax"
error.bind="error.incomeTax"
Expand Down
9 changes: 7 additions & 2 deletions src/modules/purchasing/purchase-order-external/data-form.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,11 @@ export class DataForm {
this.data.currencyRate = this.data.currency.rate;
}

if (this.data.TermOfPaymentD365) {
if (!this.readOnly && this.data.TermOfPaymentD365) {
this.top = {
Code: this.data.TermOfPaymentD365,
Days: this.data.paymentDueDays,
Description: this.data.paymentMethod,
Days: Number(this.data.paymentDueDays || 0)
};
}

Expand Down Expand Up @@ -648,9 +649,11 @@ clearIncomeTaxFromSalesTaxGroup() {
if (newValue && newValue.Code) {
this.data.TermOfPaymentD365 = newValue.Code;
this.data.paymentDueDays = Number(newValue.Days || 0);
this.data.paymentMethod = newValue.Description;;
} else {
this.data.TermOfPaymentD365 = "";
this.data.paymentDueDays = 0;
this.data.paymentMethod = "";

if (this.topLoaderViewModel) {
this.topLoaderViewModel.editorValue = "";
Expand All @@ -662,6 +665,7 @@ clearIncomeTaxFromSalesTaxGroup() {
this.top = null;
this.data.TermOfPaymentD365 = "";
this.data.paymentDueDays = 0;
this.data.paymentMethod = "";

if (this.topLoaderViewModel) {
this.topLoaderViewModel.editorValue = "";
Expand All @@ -670,6 +674,7 @@ clearIncomeTaxFromSalesTaxGroup() {
if (this.error) {
this.error.TermOfPayment = "";
this.error.paymentDueDays = "";
this.error.paymentMethod = "";
}
}

Expand Down