Commit a5820eb1 authored by Sai Srinivas's avatar Sai Srinivas
Browse files

05-08-2025 By Sai Srinivas

Finance Test cases and Order Module - List and Details.
parent 402026c6
<svg width="37" height="37" viewBox="0 0 37 37" fill="none" xmlns="http://www.w3.org/2000/svg">
<circle cx="18.208" cy="18.208" r="18.208" fill="#E6F6FF"/>
<g clip-path="url(#clip0_592_4726)">
<path d="M26.3123 13.0729C25.9964 11.6469 24.614 10.3405 23.184 10.0631C22.3129 9.8889 19.8826 9.67374 18.2752 9.69146C16.6677 9.67374 14.2374 9.8889 13.3663 10.0631C11.9363 10.3405 10.5539 11.6469 10.238 13.0729C10.0583 13.9388 9.88153 15.1169 9.87891 16.7246C9.88153 18.3327 10.0583 19.5105 10.238 20.3763C10.5539 21.8024 11.9363 23.1087 13.3663 23.3862C13.8366 23.4803 14.7619 23.5863 15.7661 23.661C15.8799 23.8398 16.0032 24.03 16.1367 24.2317C16.6697 25.0389 17.0777 25.6014 17.3867 25.9933C17.9009 26.6456 18.6497 26.6456 19.164 25.9933C19.4729 25.6014 19.8806 25.0389 20.4139 24.2317C20.5474 24.0297 20.6704 23.8398 20.7845 23.661C21.7891 23.5863 22.714 23.4803 23.1847 23.3862C24.6147 23.1087 25.9971 21.8024 26.3129 20.3763C26.4927 19.5105 26.6694 18.3327 26.6721 16.7246C26.6694 15.1165 26.4927 13.9388 26.3129 13.0729H26.3123ZM20.3611 13.1697L20.6766 12.7348C20.8026 12.5613 21.0453 12.5226 21.2191 12.6485C21.3926 12.7745 21.4313 13.0172 21.3053 13.191L20.9898 13.6259C20.9137 13.7305 20.7953 13.7863 20.6753 13.7863C20.5963 13.7863 20.5166 13.7623 20.4477 13.7121C20.2742 13.5862 20.2355 13.3435 20.3614 13.1697H20.3611ZM15.3824 12.6488C15.5559 12.5229 15.7989 12.5616 15.9249 12.7351L16.2407 13.1703C16.3666 13.3438 16.3279 13.5869 16.1544 13.7128C16.0856 13.7627 16.0059 13.7869 15.9268 13.7869C15.8068 13.7869 15.6881 13.7315 15.6123 13.6265L15.2965 13.1913C15.1705 13.0178 15.2092 12.7748 15.3827 12.6488H15.3824ZM14.5811 18.2832L14.0675 18.4495C14.0278 18.4623 13.9875 18.4685 13.9478 18.4685C13.7838 18.4685 13.6316 18.3639 13.5785 18.1999C13.5126 17.9959 13.6244 17.7768 13.8284 17.7109L14.342 17.5446C14.546 17.4783 14.7651 17.5902 14.8311 17.7942C14.897 17.9982 14.7851 18.2173 14.5811 18.2832ZM18.6891 21.2425C18.6891 21.457 18.5152 21.6309 18.3007 21.6309C18.0862 21.6309 17.9124 21.457 17.9124 21.2425V20.7309C17.9124 20.5164 18.0862 20.3426 18.3007 20.3426C18.5152 20.3426 18.6891 20.5164 18.6891 20.7309V21.2425ZM20.8019 17.6377C20.8009 18.2218 20.7881 18.805 20.7632 19.3878C20.7458 19.7443 20.3844 20.0287 20.0662 19.926C19.5444 19.7581 19.0111 19.5715 18.469 19.3734C18.3604 19.3337 18.241 19.3337 18.1322 19.3734C17.59 19.5715 17.057 19.7578 16.5349 19.926C16.2168 20.0287 15.8553 19.7443 15.8379 19.3878C15.8127 18.805 15.8002 18.2215 15.7992 17.6374C15.7992 17.5203 15.7582 17.4045 15.6831 17.3104C15.3089 16.8404 14.938 16.3793 14.5795 15.9339C14.3584 15.6616 14.5116 15.2599 14.8661 15.147C15.4434 14.966 16.0187 14.7817 16.5903 14.6003C16.7051 14.5639 16.8055 14.4898 16.8747 14.3901C17.22 13.8925 17.5618 13.392 17.8901 12.8945C18.0921 12.5882 18.5087 12.5882 18.7107 12.8945C19.039 13.392 19.3808 13.8925 19.7261 14.3901C19.7953 14.4898 19.8957 14.5639 20.0105 14.6003C20.5822 14.7817 21.1574 14.9657 21.7347 15.147C22.0892 15.2599 22.2421 15.6613 22.0213 15.9339C21.6628 16.3793 21.2919 16.8401 20.9177 17.3101C20.8426 17.4042 20.8019 17.52 20.8016 17.6374L20.8019 17.6377ZM23.023 18.1999C22.9698 18.3642 22.8173 18.4685 22.6537 18.4685C22.614 18.4685 22.5736 18.4623 22.534 18.4495L22.0207 18.2832C21.8167 18.2173 21.7048 17.9982 21.7708 17.7942C21.837 17.5902 22.0558 17.4783 22.2598 17.5442L22.7731 17.7105C22.9771 17.7765 23.0889 17.9955 23.023 18.1995V18.1999Z" fill="url(#paint0_linear_592_4726)"/>
</g>
<defs>
<linearGradient id="paint0_linear_592_4726" x1="9.87891" y1="18.0867" x2="26.6714" y2="18.0867" gradientUnits="userSpaceOnUse">
<stop stop-color="#ED6C14"/>
<stop offset="0.6" stop-color="#FF9045"/>
<stop offset="1" stop-color="#FFB54A"/>
</linearGradient>
<clipPath id="clip0_592_4726">
<rect width="16.7925" height="16.7925" fill="white" transform="translate(9.87891 9.69043)"/>
</clipPath>
</defs>
</svg>
<svg width="40" height="40" viewBox="0 0 40 40" fill="none" xmlns="http://www.w3.org/2000/svg">
<circle cx="20" cy="20" r="20" fill="white"/>
<g clip-path="url(#clip0_171_1058)">
<path d="M10.2983 16.7082C10.3096 16.6355 10.3217 16.5613 10.3338 16.484L10.3385 16.4559C10.4862 15.5277 10.9803 14.6098 11.7006 13.857C12.4209 13.1043 13.3338 12.5582 14.2713 12.3633C14.4955 12.3168 14.7428 12.2711 15.0088 12.2273C15.0195 12.0237 15.0307 11.8202 15.0424 11.6168C15.0725 11.1016 15.485 10.6402 15.9588 10.5992C16.4326 10.5582 16.801 10.9566 16.783 11.4809C16.7768 11.654 16.7707 11.827 16.7647 11.9996C17.5221 11.925 18.335 11.8738 19.1475 11.8531C19.1475 11.6969 19.1489 11.5418 19.1518 11.3879C19.158 10.859 19.5483 10.4219 20.0229 10.4219C20.4975 10.4219 20.8885 10.8598 20.8944 11.3879C20.8959 11.5441 20.8974 11.6992 20.8987 11.8531C21.7088 11.8738 22.5182 11.9246 23.2729 11.9988C23.2666 11.8262 23.2605 11.6534 23.2545 11.4805C23.2365 10.9559 23.6061 10.5563 24.0787 10.5984C24.5514 10.6406 24.9651 11.1008 24.9951 11.616C25.0069 11.8191 25.0181 12.0224 25.0287 12.2258C25.2983 12.2699 25.549 12.3164 25.7756 12.3633C26.7131 12.5586 27.6248 13.1055 28.3463 13.857C29.0678 14.6086 29.5608 15.5277 29.7084 16.4559L29.7131 16.4844C29.7256 16.5625 29.7373 16.6355 29.7487 16.7082C23.274 16.2301 16.7729 16.2301 10.2983 16.7082ZM30.0225 20.5363C29.9901 22.8898 29.8252 23.6613 29.6342 24.8004C29.6342 24.8102 29.6311 24.8195 29.6291 24.8293C29.4647 25.7621 28.9584 26.6937 28.2362 27.4648C27.5139 28.2359 26.6088 28.8 25.685 29.0098C24.3252 29.3254 22.1057 29.5875 20.0237 29.5785C17.9416 29.5875 15.7217 29.3254 14.3619 29.0098C13.4373 28.8004 12.5342 28.234 11.8108 27.4652C11.0873 26.6965 10.5822 25.7625 10.4178 24.8297C10.4178 24.8203 10.4143 24.8105 10.4127 24.8012C10.2217 23.6613 10.0572 22.891 10.0244 20.5367C10.0162 19.3621 10.0596 18.6336 10.1147 18.0566C16.7061 17.7645 23.3408 17.7645 29.9322 18.0566C29.9877 18.6332 30.0307 19.3621 30.0225 20.5367V20.5363ZM16.4147 23.1105C16.4037 22.2992 15.767 21.6352 14.9873 21.623C14.8036 21.6187 14.6209 21.6519 14.4505 21.7206C14.28 21.7892 14.1253 21.892 13.9959 22.0225C13.8665 22.153 13.7651 22.3085 13.6979 22.4795C13.6306 22.6506 13.599 22.8335 13.6049 23.0172C13.6268 23.7984 14.2768 24.4777 15.0455 24.518C15.8143 24.5582 16.4252 23.9215 16.4147 23.1105ZM21.4862 23.1469C21.4916 22.3285 20.8612 21.668 20.0799 21.6676C19.2987 21.6672 18.669 22.3293 18.6737 23.1477C18.6783 23.966 19.3096 24.6406 20.0799 24.6402C20.8502 24.6398 21.4803 23.9648 21.4862 23.1469ZM26.6369 23.0082C26.6429 22.8248 26.6112 22.6422 26.544 22.4715C26.4768 22.3008 26.3754 22.1456 26.2461 22.0155C26.1167 21.8854 25.9622 21.7831 25.7919 21.7148C25.6215 21.6466 25.4391 21.6139 25.2557 21.6187C24.4744 21.6312 23.8393 22.2945 23.8276 23.1031C23.8158 23.9117 24.426 24.5484 25.1947 24.5059C25.9635 24.4633 26.6151 23.7895 26.6369 23.0082Z" fill="url(#paint0_linear_171_1058)"/>
<path d="M10.2983 16.7082C10.3096 16.6355 10.3217 16.5613 10.3338 16.484L10.3385 16.4559C10.4862 15.5277 10.9803 14.6098 11.7006 13.857C12.4209 13.1043 13.3338 12.5582 14.2713 12.3633C14.4955 12.3168 14.7428 12.2711 15.0088 12.2273C15.0195 12.0237 15.0307 11.8202 15.0424 11.6168C15.0725 11.1016 15.485 10.6402 15.9588 10.5992C16.4326 10.5582 16.801 10.9566 16.783 11.4809C16.7768 11.654 16.7707 11.827 16.7647 11.9996C17.5221 11.925 18.335 11.8738 19.1475 11.8531C19.1475 11.6969 19.1489 11.5418 19.1518 11.3879C19.158 10.859 19.5483 10.4219 20.0229 10.4219C20.4975 10.4219 20.8885 10.8598 20.8944 11.3879C20.8959 11.5441 20.8974 11.6992 20.8987 11.8531C21.7088 11.8738 22.5182 11.9246 23.2729 11.9988C23.2666 11.8262 23.2605 11.6534 23.2545 11.4805C23.2365 10.9559 23.6061 10.5563 24.0787 10.5984C24.5514 10.6406 24.9651 11.1008 24.9951 11.616C25.0069 11.8191 25.0181 12.0224 25.0287 12.2258C25.2983 12.2699 25.549 12.3164 25.7756 12.3633C26.7131 12.5586 27.6248 13.1055 28.3463 13.857C29.0678 14.6086 29.5608 15.5277 29.7084 16.4559L29.7131 16.4844C29.7256 16.5625 29.7373 16.6355 29.7487 16.7082C23.274 16.2301 16.7729 16.2301 10.2983 16.7082ZM30.0225 20.5363C29.9901 22.8898 29.8252 23.6613 29.6342 24.8004C29.6342 24.8102 29.6311 24.8195 29.6291 24.8293C29.4647 25.7621 28.9584 26.6937 28.2362 27.4648C27.5139 28.2359 26.6088 28.8 25.685 29.0098C24.3252 29.3254 22.1057 29.5875 20.0237 29.5785C17.9416 29.5875 15.7217 29.3254 14.3619 29.0098C13.4373 28.8004 12.5342 28.234 11.8108 27.4652C11.0873 26.6965 10.5822 25.7625 10.4178 24.8297C10.4178 24.8203 10.4143 24.8105 10.4127 24.8012C10.2217 23.6613 10.0572 22.891 10.0244 20.5367C10.0162 19.3621 10.0596 18.6336 10.1147 18.0566C16.7061 17.7645 23.3408 17.7645 29.9322 18.0566C29.9877 18.6332 30.0307 19.3621 30.0225 20.5367V20.5363ZM16.4147 23.1105C16.4037 22.2992 15.767 21.6352 14.9873 21.623C14.8036 21.6187 14.6209 21.6519 14.4505 21.7206C14.28 21.7892 14.1253 21.892 13.9959 22.0225C13.8665 22.153 13.7651 22.3085 13.6979 22.4795C13.6306 22.6506 13.599 22.8335 13.6049 23.0172C13.6268 23.7984 14.2768 24.4777 15.0455 24.518C15.8143 24.5582 16.4252 23.9215 16.4147 23.1105ZM21.4862 23.1469C21.4916 22.3285 20.8612 21.668 20.0799 21.6676C19.2987 21.6672 18.669 22.3293 18.6737 23.1477C18.6783 23.966 19.3096 24.6406 20.0799 24.6402C20.8502 24.6398 21.4803 23.9648 21.4862 23.1469ZM26.6369 23.0082C26.6429 22.8248 26.6112 22.6422 26.544 22.4715C26.4768 22.3008 26.3754 22.1456 26.2461 22.0155C26.1167 21.8854 25.9622 21.7831 25.7919 21.7148C25.6215 21.6466 25.4391 21.6139 25.2557 21.6187C24.4744 21.6312 23.8393 22.2945 23.8276 23.1031C23.8158 23.9117 24.426 24.5484 25.1947 24.5059C25.9635 24.4633 26.6151 23.7895 26.6369 23.0082Z" fill="#ED3424"/>
<path d="M10.2983 16.7082C10.3096 16.6355 10.3217 16.5613 10.3338 16.484L10.3385 16.4559C10.4862 15.5277 10.9803 14.6098 11.7006 13.857C12.4209 13.1043 13.3338 12.5582 14.2713 12.3633C14.4955 12.3168 14.7428 12.2711 15.0088 12.2273C15.0195 12.0237 15.0307 11.8202 15.0424 11.6168C15.0725 11.1016 15.485 10.6402 15.9588 10.5992C16.4326 10.5582 16.801 10.9566 16.783 11.4809C16.7768 11.654 16.7707 11.827 16.7647 11.9996C17.5221 11.925 18.335 11.8738 19.1475 11.8531C19.1475 11.6969 19.1489 11.5418 19.1518 11.3879C19.158 10.859 19.5483 10.4219 20.0229 10.4219C20.4975 10.4219 20.8885 10.8598 20.8944 11.3879C20.8959 11.5441 20.8974 11.6992 20.8987 11.8531C21.7088 11.8738 22.5182 11.9246 23.2729 11.9988C23.2666 11.8262 23.2605 11.6534 23.2545 11.4805C23.2365 10.9559 23.6061 10.5563 24.0787 10.5984C24.5514 10.6406 24.9651 11.1008 24.9951 11.616C25.0069 11.8191 25.0181 12.0224 25.0287 12.2258C25.2983 12.2699 25.549 12.3164 25.7756 12.3633C26.7131 12.5586 27.6248 13.1055 28.3463 13.857C29.0678 14.6086 29.5608 15.5277 29.7084 16.4559L29.7131 16.4844C29.7256 16.5625 29.7373 16.6355 29.7487 16.7082C23.274 16.2301 16.7729 16.2301 10.2983 16.7082ZM30.0225 20.5363C29.9901 22.8898 29.8252 23.6613 29.6342 24.8004C29.6342 24.8102 29.6311 24.8195 29.6291 24.8293C29.4647 25.7621 28.9584 26.6937 28.2362 27.4648C27.5139 28.2359 26.6088 28.8 25.685 29.0098C24.3252 29.3254 22.1057 29.5875 20.0237 29.5785C17.9416 29.5875 15.7217 29.3254 14.3619 29.0098C13.4373 28.8004 12.5342 28.234 11.8108 27.4652C11.0873 26.6965 10.5822 25.7625 10.4178 24.8297C10.4178 24.8203 10.4143 24.8105 10.4127 24.8012C10.2217 23.6613 10.0572 22.891 10.0244 20.5367C10.0162 19.3621 10.0596 18.6336 10.1147 18.0566C16.7061 17.7645 23.3408 17.7645 29.9322 18.0566C29.9877 18.6332 30.0307 19.3621 30.0225 20.5367V20.5363ZM16.4147 23.1105C16.4037 22.2992 15.767 21.6352 14.9873 21.623C14.8036 21.6187 14.6209 21.6519 14.4505 21.7206C14.28 21.7892 14.1253 21.892 13.9959 22.0225C13.8665 22.153 13.7651 22.3085 13.6979 22.4795C13.6306 22.6506 13.599 22.8335 13.6049 23.0172C13.6268 23.7984 14.2768 24.4777 15.0455 24.518C15.8143 24.5582 16.4252 23.9215 16.4147 23.1105ZM21.4862 23.1469C21.4916 22.3285 20.8612 21.668 20.0799 21.6676C19.2987 21.6672 18.669 22.3293 18.6737 23.1477C18.6783 23.966 19.3096 24.6406 20.0799 24.6402C20.8502 24.6398 21.4803 23.9648 21.4862 23.1469ZM26.6369 23.0082C26.6429 22.8248 26.6112 22.6422 26.544 22.4715C26.4768 22.3008 26.3754 22.1456 26.2461 22.0155C26.1167 21.8854 25.9622 21.7831 25.7919 21.7148C25.6215 21.6466 25.4391 21.6139 25.2557 21.6187C24.4744 21.6312 23.8393 22.2945 23.8276 23.1031C23.8158 23.9117 24.426 24.5484 25.1947 24.5059C25.9635 24.4633 26.6151 23.7895 26.6369 23.0082Z" fill="url(#paint1_linear_171_1058)"/>
</g>
<defs>
<linearGradient id="paint0_linear_171_1058" x1="21.387" y1="32.6081" x2="6.74923" y2="13.1978" gradientUnits="userSpaceOnUse">
<stop stop-color="#498D1E"/>
<stop offset="1" stop-color="#81C320"/>
</linearGradient>
<linearGradient id="paint1_linear_171_1058" x1="-1.08928" y1="9.46403" x2="28.8783" y2="27.3076" gradientUnits="userSpaceOnUse">
<stop stop-color="#CE7138"/>
<stop offset="0.6" stop-color="#CE7138"/>
<stop offset="1" stop-color="#91481B"/>
</linearGradient>
<clipPath id="clip0_171_1058">
<rect width="20" height="20" fill="white" transform="translate(10 10)"/>
</clipPath>
</defs>
</svg>
......@@ -10,6 +10,8 @@ import '../Utils/commonServices.dart';
class Visitdetailsprovider extends ChangeNotifier{
bool _showMoreDetails = false;
CustomerDetails _customerDetails = CustomerDetails();
GeneratorDetails _generatorDetails = GeneratorDetails();
ComplaintDetailsNew _complaintDetailsNew = ComplaintDetailsNew();
......@@ -21,6 +23,12 @@ class Visitdetailsprovider extends ChangeNotifier{
ComplaintDetailsNew get complaintDetailsNew => _complaintDetailsNew;
List<Followuplist> get followUpList => _followupList;
bool get isLoading => _isLoading;
bool get showMoreDetails => _showMoreDetails;
set showMoreDetails(bool value){
_showMoreDetails = value;
notifyListeners();
}
Future<void> LoadVisitDetailsAPI(BuildContext context,ComplaintID) async {
try {
......
......@@ -8,6 +8,7 @@ import 'package:generp/Notifiers/HomeScreenNotifier.dart';
import 'package:generp/Utils/commonServices.dart';
import 'package:generp/services/api_calling.dart';
import 'package:image_picker/image_picker.dart';
import 'package:intl/intl.dart';
import 'package:provider/provider.dart';
import 'approveRejectPaymentRequestResponse.dart';
......@@ -387,6 +388,14 @@ String? proposedAmountError;
notifyListeners();
return;
}
final numberFormat = NumberFormat.decimalPattern();
if(numberFormat.parse(approvedAmount.text) > numberFormat.parse(requestedAmount.text)){
ApprovedAmountError = "Approved Amount should not be greater than requested amount";
return;
}else{
ApprovedAmountError = null;
}
if (data != null) {
if (data.error == "0") {
paymentRequesitionDetails(context, payment_request_id);
......@@ -460,6 +469,17 @@ String? proposedAmountError;
}
onChangeApprov(value){
final numberFormat = NumberFormat.decimalPattern();
if(numberFormat.parse(approvedAmount.text) > numberFormat.parse(requestedAmount.text)){
ApprovedAmountError = "Approved Amount should not be greater than requested amount";
}else{
ApprovedAmountError = null;
}
notifyListeners();
}
void checkDropDownReset() {
if (!_paymentAccounts.contains(_selectedPaymentAccounts) &&
_selectedPaymentAccounts != null) {
......
......@@ -30,6 +30,7 @@ class Pagesdashboardprovider extends ChangeNotifier {
String? saleOrderNumberError;
String? companyNameError;
List<PagesAccessible> _ordersAccessiblePagesList = [];
List<PagesAccessible> _ordersAccessiblePagesList2 = [];
List<Employees> _employeesList = [];
List<String> _leadStatus = [];
List<OrderList> _ordersList = [];
......@@ -106,6 +107,9 @@ class Pagesdashboardprovider extends ChangeNotifier {
List<PagesAccessible> get ordersAccessiblePagesList =>
_ordersAccessiblePagesList;
List<PagesAccessible> get ordersAccessiblePagesList2 =>
_ordersAccessiblePagesList2;
List<Employees> get employeesList => _employeesList;
List<OrderList> get ordersList => _ordersList;
......@@ -270,6 +274,23 @@ class Pagesdashboardprovider extends ChangeNotifier {
if (data != null) {
if (data.error == "0") {
_ordersAccessiblePagesList = data.pagesAccessible!;
print(data.pagesAccessible!.map((e) => e.pageName,));
notifyListeners();
} else {}
}
} catch (e, s) {}
}
Future<void> ordersAccessibleAddPagesAPIFunction(context) async {
try {
var provider = Provider.of<HomescreenNotifier>(context, listen: false);
final data = await ApiCalling.ordersAccesibleAddPagesAPI(
provider.empId,
provider.session,
);
if (data != null) {
if (data.error == "0") {
_ordersAccessiblePagesList2 = data.pagesAccessible!;
notifyListeners();
} else {}
}
......@@ -325,8 +346,9 @@ class Pagesdashboardprovider extends ChangeNotifier {
notifyListeners();
} else {
_isLoading = false;
notifyListeners();
}
notifyListeners();
}
} catch (e, s) {}
}
......
......@@ -71,7 +71,6 @@ class Commondaterangefilter {
return [];
}
// Show bottom sheet with dropdown and custom calendar for Custom
Future<Map<String, dynamic>?> showFilterBottomSheet(BuildContext context) async {
String? tempSelectedValue = selectedValue;
DateTimeRange? tempSelectedDateRange = selectedDateRange;
......@@ -81,7 +80,12 @@ class Commondaterangefilter {
return await showModalBottomSheet<Map<String, dynamic>>(
context: context,
useSafeArea: true,
isDismissible: true,
isScrollControlled: true,
showDragHandle: true,
backgroundColor: Colors.white,
enableDrag: true,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.vertical(top: Radius.circular(20)),
),
......@@ -402,126 +406,133 @@ class Commondaterangefilter {
],
);
}
return Padding(
padding: EdgeInsets.all(16.0),
child: SingleChildScrollView(
child: Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
'Select Date Range',
style: TextStyle(fontSize: 18, fontWeight: FontWeight.bold),
),
SizedBox(height: 16),
DropdownButtonHideUnderline(
child: Row(
children: [
Expanded(
child: DropdownButton2<String>(
isExpanded: true,
hint: Text(
tempSelectedValue ?? 'Select Item',
style: TextStyle(
fontSize: 14,
fontWeight: FontWeight.w400,
color: Colors.black,
return SafeArea(
child: Padding(
padding: EdgeInsets.only(
top: 16,
left: 16,
right: 16,
bottom: MediaQuery.of(context).viewInsets.bottom,
),
child: SingleChildScrollView(
child: Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
'Select Date Range',
style: TextStyle(fontSize: 18, fontWeight: FontWeight.bold),
),
SizedBox(height: 16),
DropdownButtonHideUnderline(
child: Row(
children: [
Expanded(
child: DropdownButton2<String>(
isExpanded: true,
hint: Text(
tempSelectedValue ?? 'Select Item',
style: TextStyle(
fontSize: 14,
fontWeight: FontWeight.w400,
color: Colors.black,
),
),
),
items: filterItems.map((String item) {
return DropdownMenuItem<String>(
value: item,
child: Text(
item,
style: TextStyle(
fontSize: 14,
fontWeight: FontWeight.w400,
color: Colors.black,
items: filterItems.map((String item) {
return DropdownMenuItem<String>(
value: item,
child: Text(
item,
style: TextStyle(
fontSize: 14,
fontWeight: FontWeight.w400,
color: Colors.black,
),
),
),
);
}).toList(),
value: tempSelectedValue,
onChanged: (String? value) {
if (value == null) return;
setState(() {
tempSelectedValue = value;
if (value != 'Custom') {
tempSelectedDateRange = getDateRange(value);
tempStartDate = null;
tempEndDate = null;
} else {
tempSelectedDateRange = null;
tempStartDate = null;
tempEndDate = null;
}
});
},
buttonStyleData: ddtheme.buttonStyleData,
iconStyleData: ddtheme.iconStyleData,
menuItemStyleData: ddtheme.menuItemStyleData,
dropdownStyleData: ddtheme.dropdownStyleData,
);
}).toList(),
value: tempSelectedValue,
onChanged: (String? value) {
if (value == null) return;
setState(() {
tempSelectedValue = value;
if (value != 'Custom') {
tempSelectedDateRange = getDateRange(value);
tempStartDate = null;
tempEndDate = null;
} else {
tempSelectedDateRange = null;
tempStartDate = null;
tempEndDate = null;
}
});
},
buttonStyleData: ddtheme.buttonStyleData,
iconStyleData: ddtheme.iconStyleData,
menuItemStyleData: ddtheme.menuItemStyleData,
dropdownStyleData: ddtheme.dropdownStyleData,
),
),
),
],
),
),
if (tempSelectedValue == 'Custom') ...[
SizedBox(height: 16),
Container(
decoration: BoxDecoration(
border: Border.all(color: Colors.grey[300]!),
borderRadius: BorderRadius.circular(12),
],
),
padding: EdgeInsets.all(12),
child: buildCalendar(),
),
if (tempSelectedDateRange != null)
Padding(
padding: const EdgeInsets.only(top: 12.0),
child: Text(
'Selected: ${formatDate(tempSelectedDateRange!.start)} to ${formatDate(tempSelectedDateRange!.end)}',
style: TextStyle(fontSize: 14, color: Colors.grey[600]),
if (tempSelectedValue == 'Custom') ...[
SizedBox(height: 16),
Container(
decoration: BoxDecoration(
border: Border.all(color: Colors.grey[300]!),
borderRadius: BorderRadius.circular(12),
),
padding: EdgeInsets.all(12),
child: buildCalendar(),
),
],
SizedBox(height: 16),
Row(
mainAxisAlignment: MainAxisAlignment.end,
children: [
TextButton(
onPressed: () => Navigator.pop(context),
child: Text(
'Cancel',
style: TextStyle(color: Colors.grey[600]),
),
),
SizedBox(width: 8),
ElevatedButton(
onPressed: tempSelectedDateRange != null && tempSelectedValue != null
? () {
selectedValue = tempSelectedValue;
selectedDateRange = tempSelectedDateRange;
Navigator.pop(context, {
'selectedValue': tempSelectedValue,
'dateRange': tempSelectedDateRange,
'formatted': getFormattedDateRange(tempSelectedDateRange),
});
}
: null,
style: ElevatedButton.styleFrom(
backgroundColor: Colors.blue[600],
foregroundColor: Colors.white,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(8),
if (tempSelectedDateRange != null)
Padding(
padding: const EdgeInsets.only(top: 12.0),
child: Text(
'Selected: ${formatDate(tempSelectedDateRange!.start)} to ${formatDate(tempSelectedDateRange!.end)}',
style: TextStyle(fontSize: 14, color: Colors.grey[600]),
),
),
child: Text('Apply'),
),
],
),
SizedBox(height: MediaQuery.of(context).viewInsets.bottom),
],
SizedBox(height: 16),
Row(
mainAxisAlignment: MainAxisAlignment.end,
children: [
TextButton(
onPressed: () => Navigator.pop(context),
child: Text(
'Cancel',
style: TextStyle(color: Colors.grey[600]),
),
),
SizedBox(width: 8),
ElevatedButton(
onPressed: tempSelectedDateRange != null && tempSelectedValue != null
? () {
selectedValue = tempSelectedValue;
selectedDateRange = tempSelectedDateRange;
Navigator.pop(context, {
'selectedValue': tempSelectedValue,
'dateRange': tempSelectedDateRange,
'formatted': getFormattedDateRange(tempSelectedDateRange),
});
}
: null,
style: ElevatedButton.styleFrom(
backgroundColor: Colors.blue[600],
foregroundColor: Colors.white,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(8),
),
),
child: Text('Apply'),
),
],
),
SizedBox(height: MediaQuery.of(context).viewInsets.bottom),
],
),
),
),
);
......
......@@ -248,8 +248,9 @@ class _CrmdashboardScreenState extends State<CrmdashboardScreen> {
0xFF605C00,
0xFF91481B,
0xFFED3424,
0xFF586000,
0xFF326D72,
0xFF586000,
];
return InkResponse(
......
......@@ -1300,10 +1300,12 @@ class _PaymentrequestionlistdetailsState
),
textControllerWidget(
context,
approvedAmount,
provider.approvedAmount,
"Approved Amount",
"Enter Approved Amount",
(p0) {},
(p0) {
provider.onChangeApprov(p0);
},
TextInputType.numberWithOptions(),
false,
null,
......@@ -1437,7 +1439,7 @@ class _PaymentrequestionlistdetailsState
context,
widget.mode,
paymentID,
approvedAmount.text,
provider.approvedAmount.text,
remarks.text,
provider.selectedID,
);
......
......@@ -645,6 +645,7 @@ class _SubmitpaymentrequestionlistsbymodeState
"IMPS",
"NEFT",
].contains(provider.paymentModeValue)) ...[
SizedBox(height: 3, key: _globalKey),
textControllerWidget(
context,
......@@ -727,7 +728,8 @@ class _SubmitpaymentrequestionlistsbymodeState
TextInputAction.done,
),
errorWidget(context, provider.bankHolderError),
] else if (provider.paymentModeValue == "UPI") ...[
],
if (provider.paymentModeValue == "UPI") ...[
textControllerWidget(
context,
provider.bankUpiController,
......
......@@ -62,13 +62,13 @@ class _OrderdetailsfeedbackhistoryState extends State<Orderdetailsfeedbackhistor
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: List.generate(6, (j) {
children: List.generate(5, (j) {
final textheads = [
"<th>Employee</th>",
"<th>Feedback</th>",
"<th>Attachment</th>",
"<th>Status</th>",
"<th>Date</th>",
"Employee",
"Feedback",
"Attachment",
"Status",
"Date",
];
final textSubheads = [
"${feedbackHistory[index].employeNaem}",
......
This diff is collapsed.
This diff is collapsed.
......@@ -60,6 +60,95 @@ class _OrderslistbyModesState extends State<OrderslistbyModes> {
_connectivity.disposeStream();
}
Color getDecorationColor(value) {
var color = AppColors.approved_bg_color;
switch (value) {
case 'Registered':
return AppColors.requested_bg_color;
case 'Level 1 Approved':
return AppColors.approved_bg_color;
case 'Level 1 Rejected':
return AppColors.rejected_bg_color;
case 'Level 2 Approved':
return AppColors.approved_bg_color;
case 'Level 2 Rejected':
return AppColors.rejected_bg_color;
case 'Sales Order Registered':
return AppColors.processed_bg_color;
case 'Dispatched':
return AppColors.approved_bg_color;
}
return color;
}
Color getTextColor(value) {
var color = AppColors.approved_text_color;
switch (value) {
case 'Registered':
return AppColors.requested_text_color;
case 'Level 1 Approved':
return AppColors.approved_text_color;
case 'Level 1 Rejected':
return AppColors.rejected_text_color;
case 'Level 2 Approved':
return AppColors.approved_text_color;
case 'Level 2 Rejected':
return AppColors.rejected_text_color;
case 'Sales Order Registered':
return AppColors.processed_text_color;
case 'Dispatched':
return AppColors.approved_text_color;
}
return color;
}
getText(value) {
var text = "R";
switch (value) {
case 'Registered':
return "R";
case 'Level 1 Approved':
return "L1A";
case 'Level 1 Rejected':
return "L1R";
case 'Level 2 Approved':
return "L2A";
case 'Level 2 Rejected':
return "L2R";
case 'Sales Order Registered':
return "SOR";
case 'Dispatched':
return "D";
}
return text;
}
//All","Registered","Level 1 Approved","Level 2 Approved","Level 1 Rejected",
// Level 2 Rejected","Level 2 Rejected Final","Sales Order Registered","Dispatched"
double getSize(value) {
var text = "A";
switch (value) {
case 'Registered':
return 16.0;
case 'Level 1 Approved':
return 13.0;
case 'Level 1 Rejected':
return 13.0;
case 'Level 2 Approved':
return 13.0;
case 'Level 2 Rejected':
return 13.0;
case 'Processed':
return 16.0;
case 'Sales Order Registered':
return 13.0;
case 'Dispatched':
return 16.0;
}
return 18.0;
}
@override
Widget build(BuildContext context) {
switch (_source.keys.toList()[0]) {
......@@ -91,6 +180,224 @@ class _OrderslistbyModesState extends State<OrderslistbyModes> {
}
Widget _scaffold(BuildContext context) {
return Consumer<Pagesdashboardprovider>(
builder: (context, provider, child) {
final ordersList = provider.ordersList;
return Scaffold(
resizeToAvoidBottomInset: true,
appBar: appbar2New(
context,
widget.pageTitleName,
provider.resetAll,
Row(
children: [
// InkResponse(
// onTap: () {
// _showOptionsSheet(context);
// },
// child: SvgPicture.asset("assets/svg/ic_download.svg"),
// ),
InkResponse(
onTap: () async {
_showFilterSheet(context);
},
child: SvgPicture.asset(
"assets/svg/filter_ic.svg",
height: 25,
),
),
],
),
0xFFFFFFFF,
),
backgroundColor: AppColors.scaffold_bg_color,
body:
provider.isLoading
? Center(
child: CircularProgressIndicator.adaptive(
valueColor: AlwaysStoppedAnimation<Color>(
AppColors.app_blue,
),
),
)
: ordersList.isNotEmpty
? SingleChildScrollView(
child: Column(
children: [
ListView.builder(
itemCount: ordersList.length,
shrinkWrap: true,
physics: NeverScrollableScrollPhysics(),
itemBuilder: (context, index) {
if (ordersList.isEmpty) {
return SizedBox(
child: Center(child: Text("No Data Available")),
);
}
return InkResponse(
onTap: () async {
var res = await Navigator.push(
context,
MaterialPageRoute(
builder:
(context) => Ordersdetailsbymodes(
pageTitleName: widget.pageTitleName,
orderId: ordersList[index].orderId,
mode: widget.mode,
),
),
);
if (res == true) {
provider.ordersListByModeFilterAPIFunction(
context,
widget.mode,
);
provider.ordersListByModeAPIFunction(
context,
widget.mode,
"",
"",
);
}
},
child: Container(
padding: EdgeInsets.symmetric(
horizontal: 10,
vertical: 7.5,
),
margin: EdgeInsets.symmetric(
horizontal: 10,
vertical: 5,
),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(16),
),
child: Column(
children: [
Row(
children: [
// Expanded(
// flex: 1,
// child: Container(
// height: 50,
// width: 35,
// padding: EdgeInsets.all(8.0),
// decoration: BoxDecoration(
// color: Color(0xFFFFF3CE),
// borderRadius: BorderRadius.circular(
// 8,
// ),
// ),
// child: SvgPicture.asset(
// "assets/svg/fin_ic.svg",
// ),
// ),
// ),
Expanded(
flex: 1,
child: Container(
height: 50,
width: 50,
padding: EdgeInsets.all(8.0),
decoration: BoxDecoration(
color: getDecorationColor(
ordersList[index].status,
),
shape: BoxShape.circle,
),
child: Center(
child: Text(
getText(
ordersList[index].status,
),
style: TextStyle(
color: getTextColor(
ordersList[index].status,
),
fontSize: getSize(
ordersList[index].status,
),
fontFamily: "JakartaBold",
),
),
),
),
),
SizedBox(width: 10),
Expanded(
flex: 4,
child: SizedBox(
child: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
Text(
ordersList[index]
.accountName!,
maxLines: 1,
overflow:
TextOverflow.ellipsis,
style: TextStyle(
fontFamily:
"JakartaRegular",
fontSize: 14,
color: AppColors.semi_black,
),
),
Text(
ordersList[index]
.orderNumber!,
style: TextStyle(
fontSize: 14,
color: AppColors.grey_semi,
fontFamily:
"JakartaRegular",
decoration:
TextDecoration.none,
decorationColor:
AppColors.white,
),
),
],
),
),
),
SizedBox(width: 10),
Expanded(
flex: 2,
child: Container(
child: Text(
"₹"
"${ordersList[index].balanceAmount}",
textAlign: TextAlign.right,
style: TextStyle(
fontFamily: "JakartaMedium",
fontSize: 14,
color: AppColors.app_blue,
),
),
),
),
],
),
],
),
),
);
},
),
],
),
)
: Emptywidget(context),
);
},
);
}
Widget _scaffold1(BuildContext context) {
return Consumer<Pagesdashboardprovider>(
builder: (context, provider, child) {
final ordersList = provider.ordersList;
......
import 'dart:io';
import 'package:connectivity_plus/connectivity_plus.dart';
import 'package:flutter/material.dart';
import 'package:flutter_slidable/flutter_slidable.dart';
import 'package:flutter_svg/svg.dart';
import 'package:generp/Utils/commonWidgets.dart';
import 'package:provider/provider.dart';
......@@ -8,6 +10,7 @@ import 'package:url_launcher/url_launcher.dart';
import 'package:generp/screens/screensExports.dart';
import '../../Notifiers/TodayMontlyVisitsProvider.dart';
import '../../Utils/app_colors.dart';
import '../../Utils/commonServices.dart';
class Todaymontlyvisists extends StatefulWidget {
final String visitType;
......@@ -19,10 +22,18 @@ class Todaymontlyvisists extends StatefulWidget {
}
class _TodaymontlyvisistsState extends State<Todaymontlyvisists> {
Map _source = {ConnectivityResult.mobile: true};
final MyConnectivity _connectivity = MyConnectivity.instance;
@override
void initState() {
// TODO: implement initState
super.initState();
_connectivity.initialise();
_connectivity.myStream.listen((source) {
setState(() => _source = source);
});
WidgetsBinding.instance.addPostFrameCallback((_) {
var visitsProvider = Provider.of<Todaymontlyvisitsprovider>(
context,
......@@ -41,9 +52,241 @@ class _TodaymontlyvisistsState extends State<Todaymontlyvisists> {
}
});
}
@override
void dispose() {
// TODO: implement dispose
_connectivity.disposeStream();
super.dispose();
}
@override
Widget build(BuildContext context) {
switch (_source.keys.toList()[0]) {
case ConnectivityResult.mobile:
connection = 'Online';
break;
case ConnectivityResult.wifi:
connection = 'Online';
break;
case ConnectivityResult.none:
default:
connection = 'Offline';
}
return (connection == "Online")
? Platform.isAndroid
? WillPopScope(
onWillPop: () => onBackPressed(context),
child: SafeArea(
top: false,
bottom: true,
child: _scaffold1(context),
),
)
: _scaffold1(context)
: NoNetwork(context);
}
@override
Widget _scaffold1(BuildContext context) {
return Consumer<Todaymontlyvisitsprovider>(
builder: (context, provider, child) {
return WillPopScope(
onWillPop: () => onBackPressed(context),
child: SafeArea(
top: false,
bottom: Platform.isIOS?false:true,
child: Scaffold(
resizeToAvoidBottomInset: true,
backgroundColor: AppColors.scaffold_bg_color,
appBar: appbarNew(context, provider.title,0xFFFFFFFF),
body:provider.visitsList.isNotEmpty
? Container(
child: ListView.builder(
scrollDirection: Axis.vertical,
shrinkWrap: true,
itemCount: provider.visitsList.length,
padding: EdgeInsets.symmetric(
horizontal: 10,
vertical: 10,
),
itemBuilder: (context, index) {
return InkResponse(
onTap: () {
Navigator.push(
context,
MaterialPageRoute(
builder:
(context) => Visitdetails(
complaintID:
provider
.visitsList[index]
.complaintId,
),
),
);
},
child: Container(
// padding: EdgeInsets.symmetric(
// horizontal: 10,
// vertical: 0,
// ),
margin: EdgeInsets.symmetric(vertical: 5),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(20),
),
child: ClipRRect(
borderRadius: BorderRadius.circular(20),
child: Slidable(
endActionPane: ActionPane(
motion: const ScrollMotion(),
key: ValueKey(provider.visitsList[index].complaintId),
dragDismissible: false,
// dismissible: DismissiblePane(
//
// onDismissed: () {},
// closeOnCancel: true,
// resizeDuration: Duration(milliseconds: 300),),
children: [
SlidableAction(
onPressed: (context) {
Navigator.push(
context,
MaterialPageRoute(
builder:
(context) => Paymentdetails(
accountName: "Generator",
name:
provider
.visitsList[index]
.companyName,
genId:
provider
.visitsList[index]
.genId,
referenceID:
provider
.visitsList[index]
.complaintId,
),
),
);
},
backgroundColor: Color(0xFFE7FFE5),
foregroundColor: Color(0xFF0D9C00),
icon: Icons.add,
label: 'Payment Details',
),
],
),
child: Container(
margin: EdgeInsets.symmetric(vertical: 5),
padding: EdgeInsets.symmetric(
horizontal: 10,
vertical: 0,
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.center,
children: [
Expanded(
flex: 1,
child: Container(
padding: EdgeInsets.symmetric(
horizontal: 10,
vertical: 10,
),
decoration: BoxDecoration(
color: Color(0xFFE6F6FF),
shape: BoxShape.circle
),
child: SvgPicture.asset(
width: 30,
height: 30,
"assets/svg/se_block_head.svg",
),
),
),
SizedBox(width: 5),
Expanded(
flex: 4,
child: SizedBox(
child: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
Text(
"${provider.visitsList[index].contactName ?? "-"}",
maxLines: 1,
overflow: TextOverflow.ellipsis,
style: TextStyle(
fontFamily: "JakartaMedium",
),
),
Text(
"${provider.visitsList[index].companyName}",
maxLines: 1,
overflow: TextOverflow.ellipsis,
style: TextStyle(
color: Color(0xFF818181),
),
),
],
),
),
),
Spacer(),
Expanded(
flex: 1,
child: InkResponse(
onTap: () {
launch(
'tel://${provider.visitsList[index].mobileNo}',
);
},
child: SvgPicture.asset(
"assets/svg/se_call_customer.svg",
color: Color(0xFF0D9C00),
height: 20,
width: 20,
),
),
),
],
),
],
),
),
),
),
),
);
},
),
)
: Emptywidget(context)
),
),
);
},
);
}
Widget _scaffold(BuildContext context) {
return Consumer<Todaymontlyvisitsprovider>(
builder: (context, provider, child) {
return WillPopScope(
......
......@@ -2238,6 +2238,30 @@ class ApiCalling {
}
}
static Future<ordersAccessiblePagesResponse?> ordersAccesibleAddPagesAPI(
empId,
session,
) async {
try {
Map<String, String> data = {
'emp_id': (empId).toString(),
'session_id': (session).toString(),
};
final res = await post(data, ordersAccessibleAddPagesUrl, {});
if (res != null) {
debugPrint(res.body);
return ordersAccessiblePagesResponse.fromJson(jsonDecode(res.body));
} else {
debugPrint("Null Response");
return null;
}
} catch (e) {
debugPrint('hello bev=bug $e ');
return null;
}
}
static Future<orderPendingTasksListResponse?> orderPendingTasksListAPI(
empId,
session,
......
......@@ -88,6 +88,7 @@ const commonAccountLedgerAccountDetails = "${baseUrl_test}common_account_details
///order Module
const ordersAccessiblePagesUrl = "${baseUrl_test}crm_order_accessible_pages";
const ordersAccessibleAddPagesUrl = "${baseUrl_test}crm_add_order_accessible_pages";
const ordersDashboardUrl = "${baseUrl_test}order_dashboard";
const ordersPendingTasksListUrl = "${baseUrl_test}pending_tasks_list";
const ordersOrderListByModeUrl = "${baseUrl_test}crm_order_list_view";
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment