debug
This commit is contained in:
@@ -33,11 +33,11 @@
|
|||||||
|
|
||||||
<app-amount-percentage-input
|
<app-amount-percentage-input
|
||||||
[percentageControl]="form.controls.discount_percentage"
|
[percentageControl]="form.controls.discount_percentage"
|
||||||
[amountControl]="form.controls.discount"
|
[amountControl]="form.controls.discount_amount"
|
||||||
[baseAmount]="baseAmountForDiscountCalculation()"
|
[baseAmount]="baseAmountForDiscountCalculation()"
|
||||||
[minAmount]="0"
|
[minAmount]="0"
|
||||||
[maxAmount]="baseAmountForDiscountCalculation()"
|
[maxAmount]="baseAmountForDiscountCalculation()"
|
||||||
name="discount"
|
name="discount_amount"
|
||||||
label="تخفیف">
|
label="تخفیف">
|
||||||
<ng-template #labelSuffix>
|
<ng-template #labelSuffix>
|
||||||
<p-selectButton
|
<p-selectButton
|
||||||
@@ -55,7 +55,7 @@
|
|||||||
<pos-form-dialog-amount-card-template
|
<pos-form-dialog-amount-card-template
|
||||||
[totalAmount]="totalAmount()"
|
[totalAmount]="totalAmount()"
|
||||||
[baseTotalAmount]="baseTotalAmount()"
|
[baseTotalAmount]="baseTotalAmount()"
|
||||||
[discountAmount]="form.controls.discount.value || 0"
|
[discountAmount]="form.controls.discount_amount.value || 0"
|
||||||
[taxAmount]="taxAmount()" />
|
[taxAmount]="taxAmount()" />
|
||||||
<button pButton class="w-full sm:w-auto" (click)="submit()">{{ preparedCTAText() }}</button>
|
<button pButton class="w-full sm:w-auto" (click)="submit()">{{ preparedCTAText() }}</button>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -88,7 +88,7 @@ export class PosGoldPayloadFormComponent extends AbstractForm<
|
|||||||
[Validators.required, greaterThanValidator(0)],
|
[Validators.required, greaterThanValidator(0)],
|
||||||
],
|
],
|
||||||
quantity: [this.initialValues?.quantity || 0, [Validators.required, greaterThanValidator(0)]],
|
quantity: [this.initialValues?.quantity || 0, [Validators.required, greaterThanValidator(0)]],
|
||||||
discount: [this.initialValues?.discount_amount || 0],
|
discount_amount: [this.initialValues?.discount_amount || 0],
|
||||||
discount_percentage: [0, [Validators.max(100), Validators.min(0)]],
|
discount_percentage: [0, [Validators.max(100), Validators.min(0)]],
|
||||||
payload: this.fb.group({
|
payload: this.fb.group({
|
||||||
commission: [this.initialValues?.payload?.commission || 0, [Validators.required]],
|
commission: [this.initialValues?.payload?.commission || 0, [Validators.required]],
|
||||||
@@ -107,13 +107,13 @@ export class PosGoldPayloadFormComponent extends AbstractForm<
|
|||||||
|
|
||||||
form.controls.payload.controls.profit.valueChanges.pipe(takeUntilDestroyed()).subscribe(() => {
|
form.controls.payload.controls.profit.valueChanges.pipe(takeUntilDestroyed()).subscribe(() => {
|
||||||
// if ((form.controls.discount_amount.value || 0) > (value || 0)) {
|
// if ((form.controls.discount_amount.value || 0) > (value || 0)) {
|
||||||
form.controls.discount.setValue(0, { emitEvent: false });
|
form.controls.discount_amount.setValue(0, { emitEvent: false });
|
||||||
// }
|
// }
|
||||||
});
|
});
|
||||||
form.controls.payload.controls.profit_percentage.valueChanges
|
form.controls.payload.controls.profit_percentage.valueChanges
|
||||||
.pipe(takeUntilDestroyed())
|
.pipe(takeUntilDestroyed())
|
||||||
.subscribe(() => {
|
.subscribe(() => {
|
||||||
form.controls.discount.setValue(0, { emitEvent: false });
|
form.controls.discount_amount.setValue(0, { emitEvent: false });
|
||||||
});
|
});
|
||||||
|
|
||||||
return form;
|
return form;
|
||||||
@@ -127,7 +127,7 @@ export class PosGoldPayloadFormComponent extends AbstractForm<
|
|||||||
total_amount: this.totalAmount(),
|
total_amount: this.totalAmount(),
|
||||||
base_total_amount: this.baseTotalAmount(),
|
base_total_amount: this.baseTotalAmount(),
|
||||||
tax_amount: this.taxAmount(),
|
tax_amount: this.taxAmount(),
|
||||||
discount_amount: this.form.value.discount || 0,
|
discount_amount: this.form.value.discount_amount || 0,
|
||||||
payload: {
|
payload: {
|
||||||
commission: this.form.controls.payload.controls.commission.value || 0,
|
commission: this.form.controls.payload.controls.commission.value || 0,
|
||||||
karat: this.form.controls.payload.controls.karat.value as TGoldKarat,
|
karat: this.form.controls.payload.controls.karat.value as TGoldKarat,
|
||||||
|
|||||||
@@ -37,9 +37,9 @@ export class CatalogTaxProviderStatusTagComponent {
|
|||||||
case 'NOT_SEND':
|
case 'NOT_SEND':
|
||||||
return 'ارسال نشده';
|
return 'ارسال نشده';
|
||||||
case 'QUEUED':
|
case 'QUEUED':
|
||||||
return 'در صف ارسال به معتمد';
|
return 'در صف ارسال';
|
||||||
case 'FISCAL_QUEUED':
|
case 'FISCAL_QUEUED':
|
||||||
return 'در صف ارسال به مالیات';
|
return 'در انتظار تایید سازمان';
|
||||||
case 'SEND_FAILURE':
|
case 'SEND_FAILURE':
|
||||||
return 'خطا در ارسال';
|
return 'خطا در ارسال';
|
||||||
default:
|
default:
|
||||||
|
|||||||
@@ -87,9 +87,6 @@
|
|||||||
<app-card-data cardTitle="کالاهای خریداری شده" [editable]="false">
|
<app-card-data cardTitle="کالاهای خریداری شده" [editable]="false">
|
||||||
<app-page-data-list
|
<app-page-data-list
|
||||||
[columns]="columns"
|
[columns]="columns"
|
||||||
[expandColumns]="expandableColumns"
|
|
||||||
[expandable]="true"
|
|
||||||
expandableItemKey="payload"
|
|
||||||
[items]="invoice.items"
|
[items]="invoice.items"
|
||||||
[loading]="loading"
|
[loading]="loading"
|
||||||
pageTitle=""
|
pageTitle=""
|
||||||
|
|||||||
@@ -273,6 +273,33 @@ export class SharedSaleInvoiceSingleViewComponent {
|
|||||||
return `${item.quantity} ${item.measure_unit_text}`;
|
return `${item.quantity} ${item.measure_unit_text}`;
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
field: 'commission',
|
||||||
|
header: 'کارمزد',
|
||||||
|
type: 'nested',
|
||||||
|
nestedOption: {
|
||||||
|
path: 'payload.commission',
|
||||||
|
type: 'price',
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'wages',
|
||||||
|
header: 'اجرت',
|
||||||
|
type: 'nested',
|
||||||
|
nestedOption: {
|
||||||
|
path: 'payload.wages',
|
||||||
|
type: 'price',
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'profit',
|
||||||
|
header: 'سود',
|
||||||
|
type: 'nested',
|
||||||
|
nestedOption: {
|
||||||
|
path: 'payload.profit',
|
||||||
|
type: 'price',
|
||||||
|
}
|
||||||
|
},
|
||||||
{
|
{
|
||||||
field: 'discount_amount',
|
field: 'discount_amount',
|
||||||
header: 'مبلغ تخفیف',
|
header: 'مبلغ تخفیف',
|
||||||
@@ -288,28 +315,9 @@ export class SharedSaleInvoiceSingleViewComponent {
|
|||||||
header: 'مبلغ قابل پرداخت',
|
header: 'مبلغ قابل پرداخت',
|
||||||
type: 'price',
|
type: 'price',
|
||||||
},
|
},
|
||||||
];
|
|
||||||
|
|
||||||
expandableColumns: IColumn[] = [
|
|
||||||
{
|
|
||||||
field: 'commission',
|
|
||||||
header: 'کارمزد',
|
|
||||||
type: 'price',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
field: 'wages',
|
|
||||||
header: 'اجرت',
|
|
||||||
type: 'price',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
field: 'profit',
|
|
||||||
header: 'سود',
|
|
||||||
type: 'price',
|
|
||||||
},
|
|
||||||
];
|
];
|
||||||
|
|
||||||
expandedRows: { [key: string]: boolean } = {};
|
|
||||||
|
|
||||||
refresh() {
|
refresh() {
|
||||||
this.onRefresh.emit();
|
this.onRefresh.emit();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user