@ -29,7 +29,7 @@ import {
} from './Tickets'
} from './Tickets'
import {
import {
AccountOwnerSelect , AmcDialog , AssignModuleForm , ClientModuleStatusSelect ,
AccountOwnerSelect , AmcDialog , AssignModuleForm , ClientModuleStatusSelect ,
InteractionDialog , PaymentForm , PlanDialog , RowDate ,
InteractionDialog , PaymentForm , PlanDialog ,
} from './client-forms'
} from './client-forms'
import { ClientFormDialog } from '../components/ClientFormDialog'
import { ClientFormDialog } from '../components/ClientFormDialog'
import { PulseRibbon } from '../components/PulseRibbon'
import { PulseRibbon } from '../components/PulseRibbon'
@ -268,11 +268,8 @@ export function ClientDetail() {
{ module s.data !== undefined && (
{ module s.data !== undefined && (
< AssignModuleForm
< AssignModuleForm
module s = { module s.data }
module s = { module s.data }
onAssign = { ( module Id , kind , creds ) = > {
onAssign = { ( module Id , kind ) = > {
assignClientModule ( id , { module Id , kind } )
assignClientModule ( id , { module Id , kind } )
. then ( ( cm ) = > creds !== undefined
? patchClientModule ( cm . id , { username : creds.username , password : creds.password } )
: cm )
. then ( ( ) = > { toast . ok ( 'Module assigned' ) ; cms . reload ( ) ; ledger . reload ( ) } )
. then ( ( ) = > { toast . ok ( 'Module assigned' ) ; cms . reload ( ) ; ledger . reload ( ) } )
. catch ( ( err : Error ) = > toast . err ( err . message ) )
. catch ( ( err : Error ) = > toast . err ( err . message ) )
} }
} }
@ -285,8 +282,6 @@ export function ClientDetail() {
columns = { [
columns = { [
{ key : 'module' , label : 'Module' } , { key : 'kind' , label : 'Kind' } ,
{ key : 'module' , label : 'Module' } , { key : 'kind' , label : 'Kind' } ,
{ key : 'status' , label : 'Status' } ,
{ key : 'status' , label : 'Status' } ,
{ key : 'installed' , label : 'Installed' } , { key : 'completed' , label : 'Completed' } ,
{ key : 'trained' , label : 'Trained' } ,
{ key : 'billed' , label : 'Billed' , numeric : true } ,
{ key : 'billed' , label : 'Billed' , numeric : true } ,
{ key : 'settled' , label : 'Settled' , numeric : true } ,
{ key : 'settled' , label : 'Settled' , numeric : true } ,
] }
] }
@ -296,9 +291,6 @@ export function ClientDetail() {
module : moduleName ( cm . module Id ) ,
module : moduleName ( cm . module Id ) ,
kind : KIND_LABEL [ cm . kind ] ,
kind : KIND_LABEL [ cm . kind ] ,
status : < ClientModuleStatusSelect cm = { cm } onPatched = { ( ) = > cms . reload ( ) } onError = { toast . err } / > ,
status : < ClientModuleStatusSelect cm = { cm } onPatched = { ( ) = > cms . reload ( ) } onError = { toast . err } / > ,
installed : < RowDate cm = { cm } field = "installedOn" onPatched = { ( ) = > cms . reload ( ) } onError = { toast . err } / > ,
completed : < RowDate cm = { cm } field = "completedOn" onPatched = { ( ) = > cms . reload ( ) } onError = { toast . err } / > ,
trained : < RowDate cm = { cm } field = "trainedOn" onPatched = { ( ) = > cms . reload ( ) } onError = { toast . err } / > ,
billed : paid !== undefined ? inr ( paid . billedPaise ) : '—' ,
billed : paid !== undefined ? inr ( paid . billedPaise ) : '—' ,
settled : paid !== undefined ? inr ( paid . settledPaise ) : '—' ,
settled : paid !== undefined ? inr ( paid . settledPaise ) : '—' ,
}
}
@ -314,6 +306,9 @@ export function ClientDetail() {
< span className = "mod-name" > { module Name ( cm . module Id ) } < / span >
< span className = "mod-name" > { module Name ( cm . module Id ) } < / span >
< Badge tone = { cm . status === 'live' ? 'ok' : undefined } > { cm . status } < / Badge >
< Badge tone = { cm . status === 'live' ? 'ok' : undefined } > { cm . status } < / Badge >
< Badge > { KIND_LABEL [ cm . kind ] } < / Badge >
< Badge > { KIND_LABEL [ cm . kind ] } < / Badge >
< span onClick = { ( e ) = > e . stopPropagation ( ) } >
< ClientModuleStatusSelect cm = { cm } onPatched = { ( ) = > cms . reload ( ) } onError = { toast . err } / >
< / span >
< / summary >
< / summary >
< div className = "mod-section-body" >
< div className = "mod-section-body" >
< ServiceDataCard
< ServiceDataCard
@ -439,8 +434,6 @@ export function ClientDetail() {
< span className = "due" > { inr ( o . outstandingPaise ) } < / span >
< span className = "due" > { inr ( o . outstandingPaise ) } < / span >
< / div >
< / div >
) ) }
) ) }
< div className = "ofoot" > < span style = { { color : 'var(--text-dim)' , fontSize : 12 } } > Advance on account < / span >
< span className = "mono" style = { { marginLeft : 'auto' , fontWeight : 600 } } > { formatINR ( ledger . data . advancePaise ) } < / span > < / div >
< / div >
< / div >
< / div >
< / div >
) }
) }