feature: po pay downpayment
This commit is contained in:
@@ -37,7 +37,7 @@
|
||||
<template slot="items" slot-scope="props">
|
||||
<td class="text-xs-left pa-2" v-bind:class="{'amber lighten-4':isSelected(props.item)}" @click="selectMe(props.item)">{{ props.item.tanggalbayar}}</td>
|
||||
<td class="text-xs-left pa-2" v-bind:class="{'amber lighten-4':isSelected(props.item)}" @click="selectMe(props.item)">{{ props.item.SupplierInvoiceNumber}}
|
||||
<p><v-btn v-if="props.item.SupplierInvoiceIsLunas === 'Y'" small color="success">Lunas</v-btn></p></td>
|
||||
<p><v-btn v-if="props.item.flaglunas === 'Y'" small color="success">Lunas</v-btn></p></td>
|
||||
<td class="pa-2" v-bind:class="{'amber lighten-4':isSelected(props.item)}" @click="selectMe(props.item)">{{ props.item.SupplierPaymentNumber}}
|
||||
<p style="color:#800000" class="mb-0 font-weight-bold caption">{{props.item.SupplierPaymentCashierNumber}}</p></td>
|
||||
<td class="text-xs-left pa-2" v-bind:class="{'amber lighten-4':isSelected(props.item)}" @click="selectMe(props.item)">{{ props.item.SupplierName}}</td>
|
||||
@@ -167,18 +167,18 @@
|
||||
this.$store.commit("bill/update_open_alert_no_pay", true)
|
||||
}
|
||||
|
||||
|
||||
|
||||
var arr = this.$store.state.paymentmanual.tagihans
|
||||
var value = true
|
||||
this.$store.commit("paymentmanual/update_indeterminatex", false)
|
||||
this.$store.commit("paymentmanual/update_bar_chx_all", value)
|
||||
|
||||
|
||||
|
||||
arr.forEach((el) => {
|
||||
el.chex = value
|
||||
el.tagihan_bayar = value == true ? el.tagihan_tagihan : 0
|
||||
})
|
||||
|
||||
|
||||
var selected = _.filter(arr, function (o) {
|
||||
return o.chex;
|
||||
})
|
||||
@@ -192,7 +192,7 @@
|
||||
let totpaid = valx
|
||||
this.$store.commit("paymentmanual/update_total_payment", totpaid)
|
||||
|
||||
|
||||
|
||||
} else {
|
||||
// alert(pat.tanggalbayar)
|
||||
this.$store.commit("paymentmanual/update_xbayar", pat.totalbill)
|
||||
@@ -442,4 +442,4 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
</script>
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
<span @click="printNote(note,index)" class="icon-medium-fill-base xs1 white--text grey darken-1 icon-print"></span>
|
||||
<span v-if="note.SupplierPaymentIsApproved == 'N'" @click="deleteNote(note,index)" class="icon-medium-fill-base xs1 white--text red darken-1 icon-delete"></span>
|
||||
<!-- <span v-if="note.SupplierPaymentIsApproved == 'N'" @click="editNote(note,index)" class="icon-medium-fill-base xs1 white--text green darken-1"><v-icon dark>edit</v-icon></span>
|
||||
|
||||
|
||||
<v-btn small @click="printNote(note,index)" color="primary" dark>
|
||||
Print
|
||||
</v-btn>
|
||||
@@ -44,9 +44,8 @@
|
||||
<v-layout style="border-top:1px dashed rgb(221,221,221)" row mt-1 mb-1></v-layout>
|
||||
<v-layout row mt-1 mb-1 pl-2 pr-2>
|
||||
</v-layout>
|
||||
</v-flex>
|
||||
</v-card>
|
||||
|
||||
|
||||
<v-card>
|
||||
<v-layout row pa-2 align-center wrap>
|
||||
<v-flex xs6>
|
||||
@@ -92,22 +91,22 @@
|
||||
<v-flex xs12>
|
||||
<v-layout row>
|
||||
<v-flex xs6 pa-1>
|
||||
<v-text-field
|
||||
readonly class="amount-right ma-1"
|
||||
label="Jumlah Bayar" v-model="displaybayar"
|
||||
<v-text-field
|
||||
readonly class="amount-right ma-1"
|
||||
label="Jumlah Bayar" v-model="displaybayar"
|
||||
@change="changeBayar()" outline
|
||||
></v-text-field>
|
||||
</v-flex>
|
||||
<v-flex xs6 pa-1>
|
||||
<v-menu
|
||||
class="xs3 pr-2" v-model="menustartdate" :close-on-content-click="false"
|
||||
<v-menu
|
||||
class="xs3 pr-2" v-model="menustartdate" :close-on-content-click="false"
|
||||
:nudge-right="40" lazy transition="scale-transition"
|
||||
offset-y full-width max-width="290px" min-width="290px"
|
||||
>
|
||||
<template v-slot:activator="{ on }">
|
||||
<v-text-field
|
||||
class="mt-1" v-model="startDateFormatted"
|
||||
label="Tgl. Rencana Bayar" outline readonly
|
||||
<v-text-field
|
||||
class="mt-1" v-model="startDateFormatted"
|
||||
label="Tgl. Rencana Bayar" outline readonly
|
||||
v-on="on" @blur="date = deFormatedDate(startDateFormatted)"
|
||||
></v-text-field>
|
||||
</template>
|
||||
@@ -184,7 +183,7 @@
|
||||
</v-flex> -->
|
||||
</v-layout>
|
||||
<v-layout style="border-top:1px dashed rgb(221,221,221)" row mt-1 mb-1></v-layout>
|
||||
|
||||
|
||||
<div>
|
||||
<v-layout pl-2 row align-center wrap>
|
||||
<v-flex xs4 class="pa-1">
|
||||
@@ -194,7 +193,7 @@
|
||||
</v-layout>
|
||||
<v-layout style="border-top:1px dashed rgb(221,221,221)" row mt-1 mb-1></v-layout>
|
||||
</div>
|
||||
|
||||
|
||||
</v-card>
|
||||
|
||||
<template>
|
||||
@@ -275,7 +274,7 @@
|
||||
</v-dialog>
|
||||
|
||||
</template>
|
||||
|
||||
|
||||
<template>
|
||||
<v-dialog v-model="xdialogedit" persistent max-width="50%">
|
||||
<v-card>
|
||||
@@ -954,11 +953,11 @@
|
||||
const [day, month, year] = date.split('-')
|
||||
return `${year}-${month.padStart(2, '0')}-${day.padStart(2, '0')}`
|
||||
},
|
||||
changeBayar() {
|
||||
changeBayar() {
|
||||
var bayar = this.xbayar
|
||||
let str = this.restbill
|
||||
var tagihan = parseInt(Number(str.replace(/,/g, '')))
|
||||
|
||||
|
||||
if (bayar > tagihan){
|
||||
alert('Jumlah bayar melebihi tagihan , bayar : ' + bayar + ' tagihan: ' + tagihan )
|
||||
this.xbayar = 0
|
||||
@@ -966,7 +965,7 @@
|
||||
this.xdisable_btn_pay = 'Y'
|
||||
}
|
||||
console.log(this.xdisable_btn_pay)
|
||||
|
||||
|
||||
},
|
||||
colorbginp(value) {
|
||||
if (value.chex === false) {
|
||||
@@ -994,7 +993,7 @@
|
||||
el.chex = value
|
||||
el.tagihan_bayar = value == true ? el.tagihan_tagihan : 0
|
||||
})
|
||||
|
||||
|
||||
var selected = _.filter(arr, function (o) {
|
||||
return o.chex;
|
||||
})
|
||||
@@ -1017,7 +1016,7 @@
|
||||
el.chex = false
|
||||
el.tagihan_bayar = 0
|
||||
})
|
||||
|
||||
|
||||
var selected = _.filter(arr, function (o) {
|
||||
return o.chex;
|
||||
})
|
||||
@@ -1030,7 +1029,7 @@
|
||||
})
|
||||
let totpaid = valx
|
||||
this.$store.commit("paymentmanual/update_total_payment", totpaid)
|
||||
|
||||
|
||||
}
|
||||
},
|
||||
checkTop(pat) {
|
||||
@@ -1079,31 +1078,31 @@
|
||||
toRupiah(data) {
|
||||
// Input validation
|
||||
if (!data) return '0,00'
|
||||
|
||||
|
||||
// Ensure we're working with a number
|
||||
if (typeof data !== 'number') {
|
||||
data = parseFloat(data)
|
||||
}
|
||||
|
||||
|
||||
// Handle invalid numbers
|
||||
if (isNaN(data)) return '0,00'
|
||||
|
||||
|
||||
// Convert to string with exactly 2 decimal places without rounding
|
||||
// This preserves the exact value for display
|
||||
const parts = data.toString().split('.')
|
||||
const wholePart = parts[0]
|
||||
let decimalPart = parts.length > 1 ? parts[1] : '00'
|
||||
|
||||
|
||||
// Ensure we have exactly 2 decimal digits for display
|
||||
if (decimalPart.length > 2) {
|
||||
decimalPart = decimalPart.substring(0, 2)
|
||||
} else if (decimalPart.length < 2) {
|
||||
decimalPart = decimalPart.padEnd(2, '0')
|
||||
}
|
||||
|
||||
|
||||
// Format the whole number part with dots as thousand separators
|
||||
const formatted = wholePart.replace(/\B(?=(\d{3})+(?!\d))/g, ".")
|
||||
|
||||
|
||||
// Return the formatted number
|
||||
return `${formatted},${decimalPart}`
|
||||
},
|
||||
@@ -1152,12 +1151,12 @@
|
||||
},
|
||||
async pay() {
|
||||
// alert(this.xbayar)
|
||||
|
||||
|
||||
if (this.in_saving) return;
|
||||
this.in_saving = true;
|
||||
var go_pay = true
|
||||
var xmsginfo = ''
|
||||
let prm = {
|
||||
var go_pay = true
|
||||
var xmsginfo = ''
|
||||
let prm = {
|
||||
orderid: this.$store.state.bill.selected_bill.SupplierInvoiceID,
|
||||
amount: this.xbayar,
|
||||
paymenttype: this.xpaymenttype.coaID,
|
||||
@@ -1165,21 +1164,24 @@
|
||||
bills: this.$store.state.paymentmanual.selected_tagihan,
|
||||
totalbill : this.$store.state.bill.selected_bill.totalbill,
|
||||
paid : this.$store.state.bill.selected_bill.paid,
|
||||
tanggalbayar : this.xtanggalbayar
|
||||
tanggalbayar: this.xtanggalbayar,
|
||||
type: this.$store.state.bill.selected_bill.type
|
||||
}
|
||||
// console.log(prm)
|
||||
|
||||
if (this.$store.state.bill.selected_bill.type == 'DP') {
|
||||
this.$store.dispatch("paymentmanual/payDownpayment", prm)
|
||||
} else {
|
||||
this.$store.dispatch("paymentmanual/pay", prm)
|
||||
}
|
||||
//console.log(prm.amount)
|
||||
this.$store.dispatch("paymentmanual/pay", prm)
|
||||
|
||||
|
||||
},
|
||||
async editpay() {
|
||||
// alert(this.xbayar)
|
||||
|
||||
if (this.in_saving) return;
|
||||
this.in_saving = true;
|
||||
var go_pay = true
|
||||
var xmsginfo = ''
|
||||
let prm = {
|
||||
var go_pay = true
|
||||
var xmsginfo = ''
|
||||
let prm = {
|
||||
orderid: this.$store.state.bill.selected_bill.SupplierInvoiceID,
|
||||
headerid: this.$store.state.bill.selected_bill.SupplierPaymentID,
|
||||
xnumber: this.$store.state.bill.selected_bill.SupplierPaymentNumber,
|
||||
@@ -1187,8 +1189,6 @@
|
||||
}
|
||||
//console.log(prm.amount)
|
||||
this.$store.dispatch("paymentmanual/editpay", prm)
|
||||
|
||||
|
||||
},
|
||||
deleteNote(note, idx) {
|
||||
this.$store.commit("paymentmanual/update_note_delete", "")
|
||||
@@ -1369,4 +1369,4 @@
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user