Angus Wiki
  • Group 1
    • Angus Wiki
    • Control Types
      • Text
      • Textarea
      • Password
      • Spacer
      • Integer
      • Double
      • Double4
      • Double5
      • Date
      • Daterange
      • Time
      • Datetime
      • Select
      • Anglookup
      • Boolean
      • Button
      • Filter
      • Radio
      • Multiselect
      • Dbimage
      • Image
      • Html
      • Chart
      • Widget
      • Autocomplete
      • Chip
      • Phoneinput
    • General type
    • Toolbar
    • Menu
    • Grid
    • Grid Filter Panel
    • Page
    • Analysis
    • OptionRecord
    • Record
      • Recordlarda Fuzzy Search Kullanımı
      • Recordlara Panel Ekleme
      • Record Butonlarına da Rol Verilebilir
    • Record scripti
    • Butonda Script Kullanımı
    • Buton ve row actiondan gridfilter veri gönderme
    • Combine Latest
    • Sp ye istek atıp dönen id bir tane ise record fazla ise grid açan buton scripti
  • Group 3
    • Angus Lokal Kurulum Linux
    • İlk kurulum
    • Kubernetes Dashboard
  • Group 2
    • Angus Lokal Kurulum Windows
    • Gerekli Uygulamalar
      • Ubuntu Kurulumu
      • WSL Kurulumu
      • Docker Kurulumu
      • Kubernetes Kurulumu
      • Microsoft SQL Kurulumu
    • Kubernetes Ayarları
    • Sistemin Çalıştırılması
  • Group 4
    • Scriptler
      • Rezervasyon Kartı
      • Rezervasyon Kartı BeforeSave Script
      • Rezervasyon Kartı BeforeClone Script
      • Fatura
      • Fatura BeforeSave Script
      • Fatura Before Print Script Editor
      • Satış Projeleri
      • Satış Projeleri BeforeSave Script
      • Kapalı Oda İşlemleri
      • Kayıp Bulunan Listesi
      • İş Kaydı
      • İş Kaydı BeforeSave Script
      • Hesap Kartı
      • Stok Fiyat Anlaşması
      • Proforma Fatura Listesi
      • Fatura BeforeSave Script
      • Fiş
      • Fiş BeforeSave Script
      • Fiş AfterSave Script
      • Fiş Before Print Script
      • Fiş BeforeClone Script
      • Ödeme Emri
      • Ödeme Emri BeforeSave Script
      • Çek/Senet
      • Banka Ekstresi Oku BeforeSave Script
      • Hesap Mutabakatı
      • Babs Mutabakat
      • Kur Değerleme
      • Kur Değerleme(Toplu Döviz)
      • Yaşlandırma Analizi
      • Seyahat Acentası
      • Fiyat Kodu
      • Kontrat Detay
      • Entegrasyon Bağlantı Tanımları
      • Stok İrsaliye
      • Stok İrsaliye BeforeSave Script
      • Stok Fişi
      • Stok Fişi BeforeSave Script
      • Talep
      • Talep BeforeSave Script
      • Üretim Emri
      • Stok Sayım
      • Stok Sayım BeforeSave Script
      • Tüketim Fişleri
      • Adisyon Before Save Script
      • Stok Fiyat Anlaşması
      • Stok Fiyat Anlaşması BeforeSave Script
      • Misafir Kartı
      • Yeni Talep
      • Yeni Talep BeforeSave Script
      • Yeni Talep AfterSave Script
      • Çağrı Merkezi Kaydı
      • Çağrı Merkezi Kaydı AfterSave Script
      • Üyelik
      • Ödeme Linki
      • Doluluk Grafikleri
      • Dağılım Analizi
      • Park Giriş BeforeClone Script
      • Park Giriş
      • Park Rezervasyonu
      • Park Rezervasyonu BeforeSave Script
      • Park Rezervasyonu BeforeClone Script
      • Seyahat Acentası
      • Kullanıcı Bilgileri
      • Kullanıcı Bilgileri BeforeSave Script
      • Medikal Rezervasyon Kartı
      • Medikal BeforeSave Script
      • Medikal BeforeClone Script
      • Ödeme Linki
      • Ödeme Linki BeforeSave Script
  • Group 5
    • IP Santral Entegrasyonu
    • Ip Santral Sistemi
    • File Transfer Service
    • IP Santral Engtegrasyonu Angus Kullanımı
  • Response Header'larındaki Alanlar ve Anlamları
Powered by GitBook
On this page
  1. Group 4
  2. Scriptler

Proforma Fatura Listesi

Proforma Fatura Listesi Script

/*let that = this;
if(!this.isDestroy$.isStopped){
  window.faturaRecord=this;
  this.isDestroy$.subscribe(() => window.faturaRecord = undefined);
}

setTimeout(()=>{
  
    const enabled = faturaRecord.api.tenant.EINVOICEENABLED;
    const sStatus=faturaRecord.allFormControls.SENDINGSTATUS;
    const invoiceId = faturaRecord.allFormControls.InvoiceId;
    const profileID = faturaRecord.recordService.formGroup.controls['ProfileID'].value;
    
    if(!enabled){
       try {
          document.querySelector('.ang-record-E-fatura-listesi div.group.ang-group-G2').style.display = "none";
        } catch(e) {}
    }
    
   
    if(sStatus.value === 3 || sStatus.value===6){
     invoiceId.disable();
    }
    
    
    const __fatRecordHideSendBtn = () => {
        try {
          document.getElementById('fatura-record-fatGnrBtn').disabled = true;
        } catch(e) {}
    };
      
    
    const __fatRecordHideRequestBtn = () => {
        try {
          document.getElementById('fatura-record-fatSrgBtn').disabled = true;
        } catch(e) {}
    };
      
   
    const __fatRecordHideCancelBtn = () => {
        try {
          document.getElementById('fatura-record-fatCancelBtn').disabled = true;
        } catch(e) {}
    };
      
    
    const __fatRecordHideGiveInvoiceNoBtn = () => {
        try {
          document.getElementById('giveInvoiceNo-btn').disabled = true;
        } catch(e) {}
    };
    
    if(sStatus.value==3 || sStatus.value==6 || sStatus.value==255)
      __fatRecordHideSendBtn();
    
    if(sStatus.value < 2 || sStatus.value > 5)
      __fatRecordHideRequestBtn();
        
    console.log('profileID',profileID);
    console.log('sStatus',sStatus);
   
    if(sStatus.value < 2 || sStatus.value > 5 || profileID != "EARSIVFATURA")
      __fatRecordHideCancelBtn();
      
    sStatus.valueChanges.subscribe((v)=>{
      if(v==3)
        __fatRecordHideSendBtn();
    })
    
  
},200)
*/

(async () => {
  
  try {
    
    let status = this.allFormControls['SENDINGSTATUS'].value;
  
    if(status == 3)
        this.recordService.formGroup.controls.ADDRESSID_ADDRESSINFO.disable();
        
    this.recordService.children.cariBilgileri.component.tabGroup.selectedTabChange.subscribe((x) => {
      const enabled = this.api.tenant.EINVOICEENABLED;
     const controls = this.recordService.formGroup.controls;
      if (!enabled) {
        try {
          document.querySelector(recordClass + " div.group.ang-group-EInvoiceButtons").style.display = "none";
        } catch (e) {}
      } else {
        rxjs
          .combineLatest(
            controls.SENDINGSTATUS.valueChanges.pipe(rxjs.startWith(controls.SENDINGSTATUS.value)),
            controls.ProfileID.valueChanges.pipe(rxjs.startWith(controls.ProfileID.value))
          )
          .pipe(rxjs.debounceTime(100))
          .subscribe(([sendingStatusValue, profileId]) => {
            

            
            if (  sendingStatusValue == 255 || sendingStatusValue == 6 )
            {
            //if (sendingStatusValue == 6 || typeValue == 21 || typeValue == 23 || typeValue == 25 || sendingStatusValue == 255 ) {
              disabledButton("fatura-record-fatGnrBtn", true);
            } else {
              disabledButton("fatura-record-fatGnrBtn", false);
            }

            
            if (sendingStatusValue < 2 /*|| sendingStatusValue > 5*/) {
              disabledButton("fatura-record-fatSrgBtn", true);
            } else {
              disabledButton("fatura-record-fatSrgBtn", false);
            }

            
            if (sendingStatusValue < 2 || sendingStatusValue > 5 || profileId != "EARSIVFATURA") {
              disabledButton("fatura-record-fatCancelBtn", true);
            } else {
              disabledButton("fatura-record-fatCancelBtn", false);
            }
            
            if(sendingStatusValue === 3){ 
              //document.querySelector(recordClass + " div.group.ang-group-addressField").style.display = "none";
              this.recordService.formGroup.controls.ADDRESSID_ADDRESSINFO.disable();
            }
           
          });
      }
       
    });
    
    const recordClass = ".ang-record-" + this.recordService.component.recordID;
    
    function disabledButton(id, disabled = false) {
      try {
        const btn = document.querySelector(recordClass + " #" + id);
        if (!disabled) {
          btn.disabled = false;
          btn.classList.remove("mat-button-disabled", "mat-disabled-button");
        } else {
          btn.disabled = true;
          btn.classList.add("mat-button-disabled", "mat-disabled-button");
        }
      } catch (e) {
        console.error("query not found", query, e);
      }
      

    }
    
  } catch (e) {
    console.error("cariBilgileri selectedTabChange not found", e);
  }

})();



let voucherBulCallBack = (invoiceNo) => {
  let id = this.allFormControls['ID'].value;
  if (!invoiceNo) {
    return;
  }

  this.recordService.component.api
    .select({
      Object: 'EFATURA_INVOICE',
      Select: ['ID', 'InvoiceId'],
      Where: [
        {
          Column: 'InvoiceId',
          Operator: '=',
          Value: invoiceNo,
        },
        {
          Column: 'ID',
          Operator: '<>',
          Value: id,
        },
        {
          Column: 'TYPEID',
          Operator: 'IN',
          Value: ['1', '2', '21', '22'],
        },
        {
          Column: 'ISPROFORMA',
          Operator: '=',
          Value: '0',
          IsNull: '0',
        },
        {
          Column: 'SENDINGSTATUS',
          Operator: '<>',
          Value: '255'
        }
    
      ],
      Paging: {
        ItemsPerPage: 1,
        Current: 1,
      },
    })
    .then((response) => {
      if (response.ResultSets[0].length > 0) {
        let inID = response.ResultSets[0][0].ID;
        if (+this.allFormControls['ID'].value === +inID) {
          return;
        }
        let msg = angus.languageService.dynamicTranslator.translate(
          'Invoice No {{' +
            invoiceNo +
            '}} Used before in Invoice ID : {{' +
            inID +
            '}}'
        );
        this.angusDialog.alert(msg);
      }
    });
};
this.allFormControls['InvoiceId'].valueChanges
  .pipe(rxjs.debounceTime(500), rxjs.distinctUntilChanged())
  .subscribe(voucherBulCallBack.bind(this));
PreviousStok Fiyat AnlaşmasıNextFatura BeforeSave Script

Last updated 3 years ago