servicebook

This commit is contained in:
mashfiq 2025-07-29 18:16:27 +06:00
parent ed13e02cff
commit f9f0fde437
8 changed files with 119 additions and 27 deletions

View File

@ -13,7 +13,7 @@ namespace HRM.Report
{
public class rptDigitalServiceBook
{
public byte[] DigitalServiceBook(int empID, int payrollTypeID, DateTime fromDate, string sEmpIDs, string reportType)
public byte[] DigitalServiceBook(int empID, int payrollTypeID, DateTime fromDate, string sEmpIDs, int? authorizePersionID, string reportType)
{
DataSet dSet = new DataSet();
DataRow oDR = null;
@ -21,6 +21,12 @@ namespace HRM.Report
if (sEmpIDs != null)
empID = Convert.ToInt32(sEmpIDs);
AuthorizedPerson authPerson = null;
if(authorizePersionID != null)
{
authPerson = new AuthorizedPersonService().Get((int)authorizePersionID);
}
//string TargetFolder = @"Documents\EMPPHOTO\";
//string currentDirectory = Directory.GetCurrentDirectory();
string TargetFolder = System.IO.Path.Combine(System.Environment.CurrentDirectory + @"\Documents\EMPPHOTO\");
@ -83,7 +89,8 @@ namespace HRM.Report
oDR["PHOTO"] = System.IO.Path.Combine(TargetFolder + string.Format("Image-{0}.jpg", oDRow["EMPLOYEENO"]));
oDR["SIGNATURE"] = System.IO.Path.Combine(TargetFolder + string.Format("Signature-{0}.jpg", oDRow["EMPLOYEENO"]));
if (authPerson != null)
oDR["AUTHSIGN"] = authPerson.Signature;
dTable.Rows.Add(oDR);
//count++;

View File

@ -481,6 +481,8 @@ namespace HRM.Report.PayrollDataSet {
private global::System.Data.DataColumn columnSIGNATURE;
private global::System.Data.DataColumn columnAUTHSIGN;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")]
public EMPDigitalServiceBookDataTable() {
@ -756,6 +758,14 @@ namespace HRM.Report.PayrollDataSet {
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")]
public global::System.Data.DataColumn AUTHSIGNColumn {
get {
return this.columnAUTHSIGN;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")]
[global::System.ComponentModel.Browsable(false)]
@ -823,7 +833,8 @@ namespace HRM.Report.PayrollDataSet {
string VILLAGETA,
string ROADNOTA,
string WARDNOTA,
string SIGNATURE) {
string SIGNATURE,
string AUTHSIGN) {
EMPDigitalServiceBookRow rowEMPDigitalServiceBookRow = ((EMPDigitalServiceBookRow)(this.NewRow()));
object[] columnValuesArray = new object[] {
EMPLOYEEID,
@ -855,7 +866,8 @@ namespace HRM.Report.PayrollDataSet {
VILLAGETA,
ROADNOTA,
WARDNOTA,
SIGNATURE};
SIGNATURE,
AUTHSIGN};
rowEMPDigitalServiceBookRow.ItemArray = columnValuesArray;
this.Rows.Add(rowEMPDigitalServiceBookRow);
return rowEMPDigitalServiceBookRow;
@ -908,6 +920,7 @@ namespace HRM.Report.PayrollDataSet {
this.columnROADNOTA = base.Columns["ROADNOTA"];
this.columnWARDNOTA = base.Columns["WARDNOTA"];
this.columnSIGNATURE = base.Columns["SIGNATURE"];
this.columnAUTHSIGN = base.Columns["AUTHSIGN"];
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
@ -973,6 +986,8 @@ namespace HRM.Report.PayrollDataSet {
base.Columns.Add(this.columnWARDNOTA);
this.columnSIGNATURE = new global::System.Data.DataColumn("SIGNATURE", typeof(string), null, global::System.Data.MappingType.Element);
base.Columns.Add(this.columnSIGNATURE);
this.columnAUTHSIGN = new global::System.Data.DataColumn("AUTHSIGN", typeof(byte[]), null, global::System.Data.MappingType.Element);
base.Columns.Add(this.columnAUTHSIGN);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
@ -2718,6 +2733,22 @@ namespace HRM.Report.PayrollDataSet {
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")]
public string AUTHSIGN {
get {
try {
return ((string)(this[this.tableEMPDigitalServiceBook.AUTHSIGNColumn]));
}
catch (global::System.InvalidCastException e) {
throw new global::System.Data.StrongTypingException("The value for column \'AUTHSIGN\' in table \'EMPDigitalServiceBook\' is DBNull.", e);
}
}
set {
this[this.tableEMPDigitalServiceBook.AUTHSIGNColumn] = value;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")]
public bool IsEMPLOYEEIDNull() {
@ -3077,6 +3108,18 @@ namespace HRM.Report.PayrollDataSet {
public void SetSIGNATURENull() {
this[this.tableEMPDigitalServiceBook.SIGNATUREColumn] = global::System.Convert.DBNull;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")]
public bool IsAUTHSIGNNull() {
return this.IsNull(this.tableEMPDigitalServiceBook.AUTHSIGNColumn);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")]
public void SetAUTHSIGNNull() {
this[this.tableEMPDigitalServiceBook.AUTHSIGNColumn] = global::System.Convert.DBNull;
}
}
/// <summary>

View File

@ -45,6 +45,7 @@
<xs:element name="ROADNOTA" msprop:Generator_ColumnPropNameInRow="ROADNOTA" msprop:Generator_ColumnPropNameInTable="ROADNOTAColumn" msprop:Generator_ColumnVarNameInTable="columnROADNOTA" msprop:Generator_UserColumnName="ROADNOTA" type="xs:string" minOccurs="0" />
<xs:element name="WARDNOTA" msprop:Generator_ColumnPropNameInRow="WARDNOTA" msprop:Generator_ColumnPropNameInTable="WARDNOTAColumn" msprop:Generator_ColumnVarNameInTable="columnWARDNOTA" msprop:Generator_UserColumnName="WARDNOTA" type="xs:string" minOccurs="0" />
<xs:element name="SIGNATURE" msprop:Generator_ColumnPropNameInRow="SIGNATURE" msprop:Generator_ColumnPropNameInTable="SIGNATUREColumn" msprop:Generator_ColumnVarNameInTable="columnSIGNATURE" msprop:Generator_UserColumnName="SIGNATURE" type="xs:string" minOccurs="0" />
<xs:element name="AUTHSIGN" msprop:Generator_ColumnPropNameInRow="AUTHSIGN" msprop:Generator_ColumnPropNameInTable="AUTHSIGNColumn" msprop:Generator_ColumnVarNameInTable="columnAUTHSIGN" msprop:Generator_UserColumnName="AUTHSIGN" type="xs:string" minOccurs="0" />
</xs:sequence>
</xs:complexType>
</xs:element>

View File

@ -137,6 +137,10 @@
<DataField>SIGNATURE</DataField>
<rd:TypeName>System.String</rd:TypeName>
</Field>
<Field Name="AUTHSIGN">
<DataField>AUTHSIGN</DataField>
<rd:TypeName>System.String</rd:TypeName>
</Field>
</Fields>
<rd:DataSetInfo>
<rd:DataSetName>DigitalServiceBookDataSet</rd:DataSetName>
@ -912,7 +916,7 @@
<Top>9.38506in</Top>
<Left>0.71685in</Left>
<Height>0.25in</Height>
<Width>0.8125in</Width>
<Width>1.15624in</Width>
<ZIndex>18</ZIndex>
<Style>
<Border>
@ -5358,6 +5362,23 @@
</Border>
</Style>
</Image>
<Image Name="image4">
<Source>Database</Source>
<Value>=First(Fields!AUTHSIGN.Value, "EMPDigitalServiceBook")</Value>
<MIMEType>image/jpeg</MIMEType>
<Sizing>Fit</Sizing>
<Top>8.5959in</Top>
<Left>4.7911in</Left>
<Height>0.67708in</Height>
<Width>1.8729in</Width>
<ZIndex>63</ZIndex>
<ToolTip>=First(Fields!AUTHSIGN.Value, "EMPDigitalServiceBook")</ToolTip>
<Style>
<Border>
<Style>None</Style>
</Border>
</Style>
</Image>
</ReportItems>
<Height>20.35496in</Height>
<Style />
@ -5405,12 +5426,6 @@
<AllowBlank>true</AllowBlank>
<Prompt>ReportParameter1</Prompt>
</ReportParameter>
<ReportParameter Name="Photo">
<DataType>String</DataType>
<Nullable>true</Nullable>
<AllowBlank>true</AllowBlank>
<Prompt>ReportParameter1</Prompt>
</ReportParameter>
</ReportParameters>
<ReportParametersLayout>
<GridLayoutDefinition>
@ -5442,11 +5457,6 @@
<RowIndex>1</RowIndex>
<ParameterName>Phone</ParameterName>
</CellDefinition>
<CellDefinition>
<ColumnIndex>1</ColumnIndex>
<RowIndex>1</RowIndex>
<ParameterName>Photo</ParameterName>
</CellDefinition>
</CellDefinitions>
</GridLayoutDefinition>
</ReportParametersLayout>

View File

@ -3963,8 +3963,8 @@ namespace HRM.Report
GetParameters(payrollTypeId);
////GetImageFromEmpFileUpload(empId);
rParam = new ReportParameter("Photo", _PATH);
reportParameters.Add(rParam);
//rParam = new ReportParameter("Photo", _PATH);
//reportParameters.Add(rParam);
if (reportParameters != null)
localReport.SetParameters(reportParameters);
Warning[] warnings;

View File

@ -2,7 +2,7 @@
<div class="p-grid card">
<div class="p-col-12 p-md-12" style="padding: 7px;">
<div class="p-grid">
<div class="p-col-5">
<div class="p-col-12 p-md-5">
<app-employee-picker (ItemSelected)="GetSelectedEmployee($event)"></app-employee-picker>
</div>
@ -14,9 +14,18 @@
style="width:100%">
</kendo-datepicker>
</div> -->
<div class="p-col-5">
<div class="p-col-12 p-md-1" style="margin: auto"></div>
<div class="p-col-6 p-md-2" style="margin: auto">
<label>Authorized Person</label>
</div>
<div class="p-col-2">
<div class="p-col-6 p-md-2">
<kendo-dropdownlist [data]="authorizedPersonList"
[defaultItem]="{ name: 'Select..', id: null }" [textField]="'name'" [valueField]="'id'"
[valuePrimitive]="true" [(ngModel)]="selectedPersonID" id="signatory">
</kendo-dropdownlist>
</div>
<div class="p-col-12 p-md-2">
<button kendoButton style="width: 100%; margin-right: 5%" (click)="onPreview('PDF')"
class="k-primary">Preview</button>
</div>

View File

@ -11,8 +11,8 @@ import { AttendanceServices } from '../../_services/attendance/attendance.servic
import { LoanService } from 'src/app/_services/payroll/loan.service';
import { SalaryService } from '../../_services/payroll/salary.service';
import { LeaveService } from '../../_services/leave/leave.service';
import {PayrollType} from '../../_models/Authentication/payrollType';
import { SearchEmployee, SearchManager } from '../../_models/Employee/searchEmployee';
import { PayrollType } from '../../_models/Authentication/payrollType';
import { SearchEmployee, SearchManager } from '../../_models/Employee/searchEmployee';
import {
EnumBloodGroup,
EnumExtension,
@ -31,6 +31,8 @@ import { ApiService } from '../../app.api.service';
import { NgxExtendedPdfViewerService, PDFPrintRange } from 'ngx-extended-pdf-viewer';
import { Employee } from '../../_models/Employee/employee';
import { saveAs } from 'file-saver';
import { LetterRequestService } from 'src/app/_services/letter-request/letter-request.service';
import { AuthorizedPerson } from 'src/app/adhoc-feature/authorized-persons/authorizedPerson';
@Component({
selector: 'app-digital-service-book',
@ -49,6 +51,8 @@ export class DigitalServiceBookComponent implements OnInit {
fromDate: Date = new Date();
toDate: Date = new Date();
payrolltype: PayrollType;
authorizedPersonList: AuthorizedPerson[] = [];
selectedPersonID: number;
// user: User;
constructor(public employeeService: EmployeeServices,
@ -64,6 +68,7 @@ export class DigitalServiceBookComponent implements OnInit {
public taxService: TaxService,
public salaryService: SalaryService,
public leaveYearService: LeaveService,
public letterRequestService: LetterRequestService,
public router: Router,
public authService: AuthService) {
this.apiService.selectedMenuName = 'Digital Service Book';
@ -95,7 +100,7 @@ export class DigitalServiceBookComponent implements OnInit {
// this.setSelectableSettings();
// this.loadBank();
this.loadDataAuthorizedPersons();
this.loadLoggedInEmployee();
}
loadLoggedInEmployee() {
@ -135,13 +140,14 @@ export class DigitalServiceBookComponent implements OnInit {
const data = {
reportid: 1000,
itemid: 0,
itemid: this.selectedPersonID != undefined ? this.selectedPersonID : null,
// empIds: '',
empIds: this.selectedEmp.employeeID,
reportType: type,
// fromDate: this.selectedMonth,
fromDate: new Date().toDateString(),
toDate: new Date().toDateString()
toDate: new Date().toDateString(),
};
this.loadingPanel.ShowLoadingPanel = true;
console.log(data);
@ -211,4 +217,20 @@ export class DigitalServiceBookComponent implements OnInit {
this.printService.print();
}
loadDataAuthorizedPersons() {
this.loadingPanel.ShowLoadingPanel = true;
this.letterRequestService.getAuthorisedPersons().subscribe(
(resp) => {
this.authorizedPersonList = resp;
},
(err) => {
this.notificationService.showError(err.error);
this.loadingPanel.ShowLoadingPanel = false;
},
() => {
this.loadingPanel.ShowLoadingPanel = false;
},
);
}
}

View File

@ -633,7 +633,7 @@ namespace HRM.UI.Controllers.Report
bytes = rptLeave.ShowCCWiseLeaveEncashmentReturn(itemid, payrollTypeId, reportType);
break;
case EnumReportType.DigitalServiceBook:
bytes = new rptDigitalServiceBook().DigitalServiceBook(currentUser.EmployeeID.HasValue ? currentUser.EmployeeID.Value : 0, (int)currentUser.PayrollTypeID, fromDate, sEmpIDs, reportType);
bytes = new rptDigitalServiceBook().DigitalServiceBook(currentUser.EmployeeID.HasValue ? currentUser.EmployeeID.Value : 0, (int)currentUser.PayrollTypeID, fromDate, sEmpIDs, itemid == 0 ? null : itemid, reportType);
break;
case EnumReportType.SalaryAllocationReportEmployeeWise:
bytes = new rptJV().showJVSalaryDetailEmployeeWReport(1, GlobalFunctions.LastDateOfMonth(fromDate), null, payrollTypeId, reportType);